Skip to content

Commit

Permalink
chore: migrate from lerna to rush
Browse files Browse the repository at this point in the history
  • Loading branch information
mkopa committed Nov 7, 2022
1 parent 11e53b3 commit 4be8096
Show file tree
Hide file tree
Showing 20 changed files with 2,869 additions and 94 deletions.
12 changes: 7 additions & 5 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,14 @@ jobs:
node-version: [16.x]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- run: npm install
# - run: npm run bootstrap
# - run: npm run build
# - run: npm run integration
- run: node common/scripts/install-run-rush.js change -v
- run: node common/scripts/install-run-rush.js install
- run: node common/scripts/install-run-rush.js build
- run: node common/scripts/install-run-rush.js integration

7 changes: 3 additions & 4 deletions .github/workflows/npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ jobs:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: rush install
- run: rush update
- run: rush link
- run: rush publish -p -b master --include-all --set-access-level=public
- run: node common/scripts/install-run-rush.js install
- run: node common/scripts/install-run-rush.js build
- run: npm run publish -p
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
82 changes: 1 addition & 81 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -72,85 +72,5 @@ common/autoinstallers/*/.npmrc
# Heft temporary files
.heft

*.dist
dist
/.gitattributes
/dist/tests/awilix-resolver.spec.d.ts
/dist/tests/awilix-resolver.spec.d.ts.map
/packages/awilix-resolver/dist/tests/awilix-resolver.spec.js
/packages/awilix-resolver/dist/tests/awilix-resolver.spec.js.map
/common/config/rush/build-cache.json
/.github/workflows/ci.yml
/dist/tests/command-bus.spec.d.ts
/dist/tests/command-bus.spec.d.ts.map
/packages/command-bus/dist/tests/command-bus.spec.js
/packages/command-bus/dist/tests/command-bus.spec.js.map
/common/config/rush/command-line.json
/dist/errors/command-not-supported.error.d.ts
/packages/command-bus/dist/errors/command-not-supported.error.d.ts
/dist/errors/command-not-supported.error.d.ts.map
/packages/command-bus/dist/errors/command-not-supported.error.js
/packages/command-bus/dist/errors/command-not-supported.error.js.map
/common/git-hooks/commit-msg.sample
/common/config/rush/common-versions.json
/dist/tests/event-dispatcher.spec.d.ts
/dist/tests/event-dispatcher.spec.d.ts.map
/packages/event-dispatcher/dist/tests/event-dispatcher.spec.js
/packages/event-dispatcher/dist/tests/event-dispatcher.spec.js.map
/common/config/rush/experiments.json
/dist/index.d.ts
/packages/awilix-resolver/dist/index.d.ts
/packages/command-bus/dist/index.d.ts
/packages/event-dispatcher/dist/index.d.ts
/packages/logger/dist/index.d.ts
/packages/query-bus/dist/index.d.ts
/dist/index.d.ts.map
/packages/awilix-resolver/dist/index.js
/packages/command-bus/dist/index.js
/packages/event-dispatcher/dist/index.js
/packages/logger/dist/index.js
/packages/query-bus/dist/index.js
/packages/awilix-resolver/dist/index.js.map
/packages/command-bus/dist/index.js.map
/packages/event-dispatcher/dist/index.js.map
/packages/logger/dist/index.js.map
/packages/query-bus/dist/index.js.map
/common/scripts/install-run.js
/common/scripts/install-run-rush.js
/common/scripts/install-run-rushx.js
/packages/awilix-resolver/dist/LICENSE
/packages/command-bus/dist/LICENSE
/packages/event-dispatcher/dist/LICENSE
/packages/logger/dist/LICENSE
/packages/query-bus/dist/LICENSE
/dist/logger.d.ts
/packages/logger/dist/logger.d.ts
/dist/logger.d.ts.map
/packages/logger/dist/logger.js
/packages/logger/dist/logger.js.map
/dist/tests/logger.spec.d.ts
/dist/tests/logger.spec.d.ts.map
/packages/logger/dist/tests/logger.spec.js
/packages/logger/dist/tests/logger.spec.js.map
/dist/logger.types.d.ts
/packages/logger/dist/logger.types.d.ts
/dist/logger.types.d.ts.map
/packages/logger/dist/logger.types.js
/packages/logger/dist/logger.types.js.map
/common/config/rush/npm-shrinkwrap.json
/dist/tests/query-bus.spec.d.ts
/dist/tests/query-bus.spec.d.ts.map
/packages/query-bus/dist/tests/query-bus.spec.js
/packages/query-bus/dist/tests/query-bus.spec.js.map
/dist/errors/query-not-supported.error.d.ts
/packages/query-bus/dist/errors/query-not-supported.error.d.ts
/dist/errors/query-not-supported.error.d.ts.map
/packages/query-bus/dist/errors/query-not-supported.error.js
/packages/query-bus/dist/errors/query-not-supported.error.js.map
/dist/restrict-from-production.d.ts
/packages/logger/dist/restrict-from-production.d.ts
/dist/restrict-from-production.d.ts.map
/packages/logger/dist/restrict-from-production.js
/packages/logger/dist/restrict-from-production.js.map
/rush.json
/common/config/rush/rush-plugins.json
/common/config/rush/version-policies.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@tshio/awilix-resolver",
"comment": "Project refactor",
"type": "patch"
}
],
"packageName": "@tshio/awilix-resolver"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@tshio/awilix-resolver",
"comment": "",
"type": "none"
}
],
"packageName": "@tshio/awilix-resolver"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@tshio/awilix-resolver",
"comment": "",
"type": "none"
}
],
"packageName": "@tshio/awilix-resolver"
}
100 changes: 100 additions & 0 deletions common/config/rush/build-cache.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
/**
* This configuration file manages Rush's build cache feature.
* More documentation is available on the Rush website: https://rushjs.io
*/
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/build-cache.schema.json",

/**
* (Required) EXPERIMENTAL - Set this to true to enable the build cache feature.
*
* See https://rushjs.io/pages/maintainer/build_cache/ for details about this experimental feature.
*/
"buildCacheEnabled": false,

/**
* (Required) Choose where project build outputs will be cached.
*
* Possible values: "local-only", "azure-blob-storage", "amazon-s3"
*/
"cacheProvider": "local-only",

/**
* Setting this property overrides the cache entry ID. If this property is set, it must contain
* a [hash] token.
*
* Other available tokens:
* - [projectName]
* - [projectName:normalize]
* - [phaseName]
* - [phaseName:normalize]
* - [phaseName:trimPrefix]
*/
// "cacheEntryNamePattern": "[projectName:normalize]-[phaseName:normalize]-[hash]"

/**
* Use this configuration with "cacheProvider"="azure-blob-storage"
*/
"azureBlobStorageConfiguration": {
/**
* (Required) The name of the the Azure storage account to use for build cache.
*/
// "storageAccountName": "example",

/**
* (Required) The name of the container in the Azure storage account to use for build cache.
*/
// "storageContainerName": "my-container",

/**
* The Azure environment the storage account exists in. Defaults to AzurePublicCloud.
*
* Possible values: "AzurePublicCloud", "AzureChina", "AzureGermany", "AzureGovernment"
*/
// "azureEnvironment": "AzurePublicCloud",

/**
* An optional prefix for cache item blob names.
*/
// "blobPrefix": "my-prefix",

/**
* If set to true, allow writing to the cache. Defaults to false.
*/
// "isCacheWriteAllowed": true
},

/**
* Use this configuration with "cacheProvider"="amazon-s3"
*/
"amazonS3Configuration": {
/**
* (Required unless s3Endpoint is specified) The name of the bucket to use for build cache.
* Example: "my-bucket"
*/
// "s3Bucket": "my-bucket",

/**
* (Required unless s3Bucket is specified) The Amazon S3 endpoint of the bucket to use for build cache.
* This should not include any path; use the s3Prefix to set the path.
* Examples: "my-bucket.s3.us-east-2.amazonaws.com" or "http://localhost:9000"
*/
// "s3Endpoint": "https://my-bucket.s3.us-east-2.amazonaws.com",

/**
* (Required) The Amazon S3 region of the bucket to use for build cache.
* Example: "us-east-1"
*/
// "s3Region": "us-east-1",

/**
* An optional prefix ("folder") for cache items. It should not start with "/".
*/
// "s3Prefix": "my-prefix",

/**
* If set to true, allow writing to the cache. Defaults to false.
*/
// "isCacheWriteAllowed": true
}
}
15 changes: 15 additions & 0 deletions common/config/rush/command-line.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/command-line.schema.json",
"commands": [
{
"name": "integration",
"commandKind": "bulk",
"summary": "Run linter on each package",
"description": "Iterates through each package in the monorepo and runs the 'integration' script",
"enableParallelism": true,
"ignoreMissingScript": true,
"ignoreDependencyOrder": true,
"allowWarningsInSuccessfulBuild": false
}
]
}
62 changes: 62 additions & 0 deletions common/config/rush/common-versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/**
* This configuration file specifies NPM dependency version selections that affect all projects
* in a Rush repo. More documentation is available on the Rush website: https://rushjs.io
*/
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/common-versions.schema.json",

/**
* A table that specifies a "preferred version" for a given NPM package. This feature is typically used
* to hold back an indirect dependency to a specific older version, or to reduce duplication of indirect dependencies.
*
* The "preferredVersions" value can be any SemVer range specifier (e.g. "~1.2.3"). Rush injects these values into
* the "dependencies" field of the top-level common/temp/package.json, which influences how the package manager
* will calculate versions. The specific effect depends on your package manager. Generally it will have no
* effect on an incompatible or already constrained SemVer range. If you are using PNPM, similar effects can be
* achieved using the pnpmfile.js hook. See the Rush documentation for more details.
*
* After modifying this field, it's recommended to run "rush update --full" so that the package manager
* will recalculate all version selections.
*/
"preferredVersions": {
/**
* When someone asks for "^1.0.0" make sure they get "1.2.3" when working in this repo,
* instead of the latest version.
*/
// "some-library": "1.2.3"
},

/**
* When set to true, for all projects in the repo, all dependencies will be automatically added as preferredVersions,
* except in cases where different projects specify different version ranges for a given dependency. For older
* package managers, this tended to reduce duplication of indirect dependencies. However, it can sometimes cause
* trouble for indirect dependencies with incompatible peerDependencies ranges.
*
* The default value is true. If you're encountering installation errors related to peer dependencies,
* it's recommended to set this to false.
*
* After modifying this field, it's recommended to run "rush update --full" so that the package manager
* will recalculate all version selections.
*/
// "implicitlyPreferredVersions": false,

/**
* The "rush check" command can be used to enforce that every project in the repo must specify
* the same SemVer range for a given dependency. However, sometimes exceptions are needed.
* The allowedAlternativeVersions table allows you to list other SemVer ranges that will be
* accepted by "rush check" for a given dependency.
*
* IMPORTANT: THIS TABLE IS FOR *ADDITIONAL* VERSION RANGES THAT ARE ALTERNATIVES TO THE
* USUAL VERSION (WHICH IS INFERRED BY LOOKING AT ALL PROJECTS IN THE REPO).
* This design avoids unnecessary churn in this file.
*/
"allowedAlternativeVersions": {
/**
* For example, allow some projects to use an older TypeScript compiler
* (in addition to whatever "usual" version is being used by other projects in the repo):
*/
// "typescript": [
// "~2.4.0"
// ]
}
}
44 changes: 44 additions & 0 deletions common/config/rush/experiments.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**
* This configuration file allows repo maintainers to enable and disable experimental
* Rush features. More documentation is available on the Rush website: https://rushjs.io
*/
{
"$schema": "https://developer.microsoft.com/json-schemas/rush/v5/experiments.schema.json",

/**
* By default, 'rush install' passes --no-prefer-frozen-lockfile to 'pnpm install'.
* Set this option to true to pass '--frozen-lockfile' instead for faster installs.
*/
// "usePnpmFrozenLockfileForRushInstall": true,

/**
* By default, 'rush update' passes --no-prefer-frozen-lockfile to 'pnpm install'.
* Set this option to true to pass '--prefer-frozen-lockfile' instead to minimize shrinkwrap changes.
*/
// "usePnpmPreferFrozenLockfileForRushUpdate": true,

/**
* If using the 'preventManualShrinkwrapChanges' option, restricts the hash to only include the layout of external dependencies.
* Used to allow links between workspace projects or the addition/removal of references to existing dependency versions to not
* cause hash changes.
*/
// "omitImportersFromPreventManualShrinkwrapChanges": true,

/**
* If true, the chmod field in temporary project tar headers will not be normalized.
* This normalization can help ensure consistent tarball integrity across platforms.
*/
// "noChmodFieldInTarHeaderNormalization": true,

/**
* If true, build caching will respect the allowWarningsInSuccessfulBuild flag and cache builds with warnings.
* This will not replay warnings from the cached build.
*/
// "buildCacheWithAllowWarningsInSuccessfulBuild": true,

/**
* If true, the phased commands feature is enabled. To use this feature, create a "phased" command
* in common/config/rush/command-line.json.
*/
// "phasedCommands": true
}
Loading

0 comments on commit 4be8096

Please sign in to comment.