Skip to content

Commit

Permalink
POC - Start converting to monorepo
Browse files Browse the repository at this point in the history
Completed work:

* Copy a few modules to `packages/`
* Upgrade Yarn to v3
* Add Yarn workspaces
* Add Yarn constraints for `package.json` in root and package
* Reconfigure TypeScript support new structure
* Reconfigure Jest to support new structure

Remaining work:

* TypeDoc — it doesn't seem to support TypeScript project references, so
  we may have to generate docs for each package individually or figure
  out something else
* ESLint — the `node` and `import` plugins are tripping up on imports
  which are aliases — we either need to disable the appropriate rules or
  get the plugins to recognize `tsconfig.json` appropriately
  • Loading branch information
mcmire committed May 17, 2022
1 parent 05e2126 commit be212ce
Show file tree
Hide file tree
Showing 50 changed files with 12,846 additions and 9,044 deletions.
11 changes: 11 additions & 0 deletions .eslintrc.js
Expand Up @@ -69,6 +69,17 @@ module.exports = {
'error',
{ matchDescription: '^[A-Z`\\d_][\\s\\S]*[.?!`>)}]$' },
],

// These options do not support our monorepo structure, which houses
// two levels of `package.json`'s instead of just one.
'import/no-extraneous-import': 'off',
'import/no-extraneous-dependencies': 'off',
'node/no-extraneous-import': 'off',
'node/no-extraneous-dependencies': 'off',

// TODO: This isn't working for `jest.config.ts` (see first line). Look into
// why.
'node/no-unpublished-import': 'off',
},
settings: {
'import/resolver': {
Expand Down
94 changes: 79 additions & 15 deletions .gitignore
@@ -1,18 +1,82 @@
# node
npm-debug.log
yarn-error.log
npm-debug.log
yarn-error.log
node_modules
package-lock.json

# tarball from `yarn pack`
*.tgz
.DS_Store
dist/
coverage/

# eslint cache
.eslintcache
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

.DS_STORE
# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Coverage directory used by tools like istanbul
coverage
dist
docs
*.lcov

# nyc test coverage
.nyc_output

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env
.env.test

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# ---- Additions/changes beyond the module template ----

# yarn v3 (w/o zero-install)
# See: <https://yarnpkg.com/getting-started/qa#which-files-should-be-gitignored>
.pnp.*
.yarn/*
!.yarn/patches
!.yarn/plugins
!.yarn/releases
!.yarn/sdks
!.yarn/versions

# Docs
docs/
52 changes: 52 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-constraints.cjs

Large diffs are not rendered by default.

28 changes: 28 additions & 0 deletions .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs

Large diffs are not rendered by default.

786 changes: 786 additions & 0 deletions .yarn/releases/yarn-3.2.1.cjs

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion .yarnrc

This file was deleted.

16 changes: 16 additions & 0 deletions .yarnrc.yml
@@ -0,0 +1,16 @@
# We use allow-scripts to manually enable scripts and then run them
enableScripts: false

# This is necessary right now for TypeScript to find @types/* packages
nodeLinker: node-modules

plugins:
# Provides `yarn workspaces foreach`, etc.
- path: .yarn/plugins/@yarnpkg/plugin-workspace-tools.cjs
spec: "@yarnpkg/plugin-workspace-tools"
# Provides `yarn constraints`
- path: .yarn/plugins/@yarnpkg/plugin-constraints.cjs
spec: "@yarnpkg/plugin-constraints"

# The current version of Yarn we're using
yarnPath: .yarn/releases/yarn-3.2.1.cjs

0 comments on commit be212ce

Please sign in to comment.