From ad52ee1f0df702ee4f82b03ede37bbdaeae2269f Mon Sep 17 00:00:00 2001 From: Austin Fahsl Date: Thu, 21 Jul 2022 14:10:01 -0400 Subject: [PATCH 01/11] feat: default useNx and useWorkspaces to true for new workspaces --- __fixtures__/cycle-intersection/lerna.json | 3 +- __fixtures__/cycle-parent/lerna.json | 3 +- __fixtures__/cycle-separate/lerna.json | 3 +- __fixtures__/licenses-missing/lerna.json | 3 +- __fixtures__/licenses/lerna.json | 3 +- __fixtures__/lifecycle/lerna.json | 3 +- __fixtures__/normal/lerna.json | 5 +- __fixtures__/toposort/lerna.json | 3 +- .../__tests__/__fixtures__/ci/lerna.json | 3 +- commands/init/__tests__/init-command.test.js | 175 ++++++++++++++---- commands/init/index.js | 51 +++-- commands/init/package.json | 1 + .../version-command.test.js.snap | 20 +- core/command/__fixtures__/basic/lerna.json | 1 + core/package/index.js | 1 - core/project/__tests__/project.test.js | 78 +++++--- core/project/index.js | 23 ++- integration/__fixtures__/lerna-add/lerna.json | 3 +- .../__fixtures__/lerna-clean/lerna.json | 3 +- integration/__fixtures__/lerna-run/lerna.json | 3 +- integration/lerna-init.test.js | 10 +- integration/lerna-publish-fixed.test.js | 4 +- package-lock.json | 2 + 23 files changed, 294 insertions(+), 110 deletions(-) diff --git a/__fixtures__/cycle-intersection/lerna.json b/__fixtures__/cycle-intersection/lerna.json index 1587a66968..743ceadeaa 100644 --- a/__fixtures__/cycle-intersection/lerna.json +++ b/__fixtures__/cycle-intersection/lerna.json @@ -1,3 +1,4 @@ { - "version": "1.0.0" + "version": "1.0.0", + "packages": ["packages/*"] } diff --git a/__fixtures__/cycle-parent/lerna.json b/__fixtures__/cycle-parent/lerna.json index 1587a66968..743ceadeaa 100644 --- a/__fixtures__/cycle-parent/lerna.json +++ b/__fixtures__/cycle-parent/lerna.json @@ -1,3 +1,4 @@ { - "version": "1.0.0" + "version": "1.0.0", + "packages": ["packages/*"] } diff --git a/__fixtures__/cycle-separate/lerna.json b/__fixtures__/cycle-separate/lerna.json index 1587a66968..743ceadeaa 100644 --- a/__fixtures__/cycle-separate/lerna.json +++ b/__fixtures__/cycle-separate/lerna.json @@ -1,3 +1,4 @@ { - "version": "1.0.0" + "version": "1.0.0", + "packages": ["packages/*"] } diff --git a/__fixtures__/licenses-missing/lerna.json b/__fixtures__/licenses-missing/lerna.json index 1587a66968..743ceadeaa 100644 --- a/__fixtures__/licenses-missing/lerna.json +++ b/__fixtures__/licenses-missing/lerna.json @@ -1,3 +1,4 @@ { - "version": "1.0.0" + "version": "1.0.0", + "packages": ["packages/*"] } diff --git a/__fixtures__/licenses/lerna.json b/__fixtures__/licenses/lerna.json index 1587a66968..743ceadeaa 100644 --- a/__fixtures__/licenses/lerna.json +++ b/__fixtures__/licenses/lerna.json @@ -1,3 +1,4 @@ { - "version": "1.0.0" + "version": "1.0.0", + "packages": ["packages/*"] } diff --git a/__fixtures__/lifecycle/lerna.json b/__fixtures__/lifecycle/lerna.json index 1587a66968..743ceadeaa 100644 --- a/__fixtures__/lifecycle/lerna.json +++ b/__fixtures__/lifecycle/lerna.json @@ -1,3 +1,4 @@ { - "version": "1.0.0" + "version": "1.0.0", + "packages": ["packages/*"] } diff --git a/__fixtures__/normal/lerna.json b/__fixtures__/normal/lerna.json index 1587a66968..fbf89425b6 100644 --- a/__fixtures__/normal/lerna.json +++ b/__fixtures__/normal/lerna.json @@ -1,3 +1,6 @@ { - "version": "1.0.0" + "version": "1.0.0", + "packages": [ + "packages/*" + ] } diff --git a/__fixtures__/toposort/lerna.json b/__fixtures__/toposort/lerna.json index 1587a66968..743ceadeaa 100644 --- a/__fixtures__/toposort/lerna.json +++ b/__fixtures__/toposort/lerna.json @@ -1,3 +1,4 @@ { - "version": "1.0.0" + "version": "1.0.0", + "packages": ["packages/*"] } diff --git a/commands/bootstrap/__tests__/__fixtures__/ci/lerna.json b/commands/bootstrap/__tests__/__fixtures__/ci/lerna.json index 1587a66968..743ceadeaa 100644 --- a/commands/bootstrap/__tests__/__fixtures__/ci/lerna.json +++ b/commands/bootstrap/__tests__/__fixtures__/ci/lerna.json @@ -1,3 +1,4 @@ { - "version": "1.0.0" + "version": "1.0.0", + "packages": ["packages/*"] } diff --git a/commands/init/__tests__/init-command.test.js b/commands/init/__tests__/init-command.test.js index 0f8ed13656..d5fc0ba4db 100644 --- a/commands/init/__tests__/init-command.test.js +++ b/commands/init/__tests__/init-command.test.js @@ -26,15 +26,26 @@ describe("InitCommand", () => { fs.exists(path.join(testDir, ".git")), ]); - expect(lernaJson).toMatchObject({ - packages: ["packages/*"], - version: "0.0.0", - }); - expect(pkgJson).toMatchObject({ - devDependencies: { - lerna: `^${lernaVersion}`, - }, - }); + expect(lernaJson).toMatchInlineSnapshot(` + Object { + "$schema": "node_modules/lerna/schemas/lerna-schema.json", + "useNx": true, + "useWorkspaces": true, + "version": "0.0.0", + } + `); + expect(pkgJson).toMatchInlineSnapshot(` + Object { + "devDependencies": Object { + "lerna": "^__TEST_VERSION__", + }, + "name": "root", + "private": true, + "workspaces": Array [ + "packages/*", + ], + } + `); expect(packagesDirExists).toBe(true); expect(gitDirExists).toBe(true); }); @@ -75,6 +86,14 @@ describe("InitCommand", () => { }); }); }); + + it("creates packages directory", async () => { + const testDir = tempy.directory(); + + await lernaInit(testDir)(); + + expect(fs.existsSync(path.join(testDir, "packages"))).toBe(true); + }); }); describe("in a subdirectory of a git repo", () => { @@ -91,16 +110,26 @@ describe("InitCommand", () => { fs.exists(path.join(testDir, "packages")), ]); - expect(lernaJson).toMatchObject({ - $schema: "node_modules/lerna/schemas/lerna-schema.json", - packages: ["packages/*"], - version: "0.0.0", - }); - expect(pkgJson).toMatchObject({ - devDependencies: { - lerna: `^${lernaVersion}`, - }, - }); + expect(lernaJson).toMatchInlineSnapshot(` + Object { + "$schema": "node_modules/lerna/schemas/lerna-schema.json", + "useNx": true, + "useWorkspaces": true, + "version": "0.0.0", + } + `); + expect(pkgJson).toMatchInlineSnapshot(` + Object { + "devDependencies": Object { + "lerna": "^__TEST_VERSION__", + }, + "name": "root", + "private": true, + "workspaces": Array [ + "packages/*", + ], + } + `); expect(packagesDirExists).toBe(true); }); }); @@ -177,12 +206,69 @@ describe("InitCommand", () => { }, }); }); + + describe("when workspaces are already configured", () => { + it("does not overwrite existing workspaces", async () => { + const testDir = await initFixture("has-package"); + const pkgJsonPath = path.join(testDir, "package.json"); + + await fs.outputJSON(pkgJsonPath, { + workspaces: ["modules/*", "others/*"], + }); + + await lernaInit(testDir)(); + + expect(await fs.readJSON(pkgJsonPath)).toMatchObject({ + workspaces: ["modules/*", "others/*"], + }); + }); + }); + + describe("when workspaces are not yet configured", () => { + it("sets workspaces to include default packages location", async () => { + const testDir = await initFixture("has-package"); + const pkgJsonPath = path.join(testDir, "package.json"); + + await lernaInit(testDir)(); + + expect(await fs.readJSON(pkgJsonPath)).toMatchObject({ + workspaces: ["packages/*"], + }); + }); + }); }); describe("when lerna.json exists", () => { - it("deletes lerna property if found", async () => { + describe("when useWorkspaces is false or missing", () => { + it("updates to explicitly set useNx, $schema, and packages", async () => { + const testDir = await initFixture("has-lerna"); + const lernaJsonPath = path.join(testDir, "lerna.json"); + + await fs.outputJSON(lernaJsonPath, { + lerna: "0.1.100", + version: "1.2.3", + }); + + await lernaInit(testDir)(); + + expect(await fs.readJSON(lernaJsonPath)).toMatchInlineSnapshot(` + Object { + "$schema": "node_modules/lerna/schemas/lerna-schema.json", + "packages": Array [ + "packages/*", + ], + "useNx": false, + "useWorkspaces": false, + "version": "1.2.3", + } + `); + }); + }); + + it("creates package.json without workspaces configured", async () => { const testDir = await initFixture("has-lerna"); const lernaJsonPath = path.join(testDir, "lerna.json"); + const packageJsonPath = path.join(testDir, "package.json"); await fs.outputJSON(lernaJsonPath, { lerna: "0.1.100", @@ -191,12 +277,15 @@ describe("InitCommand", () => { await lernaInit(testDir)(); - expect(await fs.readJSON(lernaJsonPath)).toEqual({ - $schema: "node_modules/lerna/schemas/lerna-schema.json", - packages: ["packages/*"], - useNx: false, - version: "1.2.3", - }); + expect(await fs.readJSON(packageJsonPath)).toMatchInlineSnapshot(` + Object { + "devDependencies": Object { + "lerna": "^__TEST_VERSION__", + }, + "name": "root", + "private": true, + } + `); }); it("creates package directories when glob is configured", async () => { @@ -204,6 +293,7 @@ describe("InitCommand", () => { const lernaJsonPath = path.join(testDir, "lerna.json"); await fs.outputJSON(lernaJsonPath, { + version: "1.2.3", packages: ["modules/*"], }); @@ -214,7 +304,7 @@ describe("InitCommand", () => { }); describe("when re-initializing with --exact", () => { - it("sets lerna.json command.init.exact to true", async () => { + it("sets lerna.json command.init.exact to true and explicitly sets useNx, useWorkspaces, $schema, and packages", async () => { const testDir = await initFixture("updates"); const lernaJsonPath = path.join(testDir, "lerna.json"); const pkgJsonPath = path.join(testDir, "package.json"); @@ -237,20 +327,25 @@ describe("InitCommand", () => { await lernaInit(testDir)("--exact"); - expect(await fs.readJSON(lernaJsonPath)).toEqual({ - command: { - bootstrap: { - hoist: true, - }, - init: { - exact: true, + expect(await fs.readJSON(lernaJsonPath)).toMatchInlineSnapshot(` + Object { + "$schema": "node_modules/lerna/schemas/lerna-schema.json", + "command": Object { + "bootstrap": Object { + "hoist": true, + }, + "init": Object { + "exact": true, + }, }, - }, - $schema: "node_modules/lerna/schemas/lerna-schema.json", - packages: ["packages/*"], - useNx: false, - version: "1.2.3", - }); + "packages": Array [ + "packages/*", + ], + "useNx": false, + "useWorkspaces": false, + "version": "1.2.3", + } + `); }); }); }); diff --git a/commands/init/index.js b/commands/init/index.js index 87bba82243..4d4bf80b8e 100644 --- a/commands/init/index.js +++ b/commands/init/index.js @@ -7,6 +7,7 @@ const writeJsonFile = require("write-json-file"); const { Command } = require("@lerna/command"); const childProcess = require("@lerna/child-process"); +const { Project } = require("@lerna/project"); module.exports = factory; @@ -50,6 +51,10 @@ class InitCommand extends Command { }); } + get hasExistingLernaConfig() { + return !!this.project.version; + } + ensurePackageJSON() { let chain = Promise.resolve(); @@ -57,18 +62,28 @@ class InitCommand extends Command { this.logger.info("", "Creating package.json"); // initialize with default indentation so write-pkg doesn't screw it up with tabs - chain = chain.then(() => - writeJsonFile( - path.join(this.project.rootPath, "package.json"), - { - name: "root", - private: true, - }, - { indent: 2 } - ) - ); + chain = chain.then(() => { + const pkg = { + name: "root", + private: true, + }; + + if (!this.hasExistingLernaConfig) { + pkg.workspaces = [Project.PACKAGE_GLOB]; + } + + return writeJsonFile(path.join(this.project.rootPath, "package.json"), pkg, { indent: 2 }); + }); } else { this.logger.info("", "Updating package.json"); + + chain = chain.then(() => { + if (!this.hasExistingLernaConfig && !this.project.manifest.get("workspaces")) { + this.project.manifest.set("workspaces", [Project.PACKAGE_GLOB]); + + return this.project.manifest.serialize(); + } + }); } chain = chain.then(() => { @@ -111,10 +126,20 @@ class InitCommand extends Command { version = "0.0.0"; } - if (!projectVersion) { + let useNx = config.useNx ?? false; + let useWorkspaces = config.useWorkspaces ?? false; + + if (!this.hasExistingLernaConfig) { this.logger.info("", "Creating lerna.json"); + useNx = true; + useWorkspaces = true; } else { this.logger.info("", "Updating lerna.json"); + if (!useWorkspaces && !config.packages) { + Object.assign(config, { + packages: [Project.PACKAGE_GLOB], + }); + } } delete config.lerna; // no longer relevant @@ -129,8 +154,8 @@ class InitCommand extends Command { Object.assign(config, { $schema: "node_modules/lerna/schemas/lerna-schema.json", - packages: this.project.packageConfigs, - useNx: false, + useNx, + useWorkspaces, version, }); diff --git a/commands/init/package.json b/commands/init/package.json index e25853576a..c58fbdc199 100644 --- a/commands/init/package.json +++ b/commands/init/package.json @@ -34,6 +34,7 @@ "dependencies": { "@lerna/child-process": "file:../../core/child-process", "@lerna/command": "file:../../core/command", + "@lerna/project": "file:../../core/project", "fs-extra": "^9.1.0", "p-map": "^4.0.0", "write-json-file": "^4.3.0" diff --git a/commands/version/__tests__/__snapshots__/version-command.test.js.snap b/commands/version/__tests__/__snapshots__/version-command.test.js.snap index 45a5770385..bafde0d9a0 100644 --- a/commands/version/__tests__/__snapshots__/version-command.test.js.snap +++ b/commands/version/__tests__/__snapshots__/version-command.test.js.snap @@ -68,8 +68,8 @@ index SHA..SHA 100644 --- a/lerna.json +++ b/lerna.json @@ -2 +2 @@ -- \\"version\\": \\"1.0.0\\" -+ \\"version\\": \\"1.0.1\\" +- \\"version\\": \\"1.0.0\\", ++ \\"version\\": \\"1.0.1\\", diff --git a/packages/package-1/package.json b/packages/package-1/package.json index SHA..SHA 100644 --- a/packages/package-1/package.json @@ -139,8 +139,8 @@ index SHA..SHA 100644 --- a/lerna.json +++ b/lerna.json @@ -2 +2 @@ -- \\"version\\": \\"1.0.0\\" -+ \\"version\\": \\"1.0.1\\" +- \\"version\\": \\"1.0.0\\", ++ \\"version\\": \\"1.0.1\\", diff --git a/packages/package-1/package.json b/packages/package-1/package.json index SHA..SHA 100644 --- a/packages/package-1/package.json @@ -278,8 +278,8 @@ index SHA..SHA 100644 --- a/lerna.json +++ b/lerna.json @@ -2 +2 @@ -- \\"version\\": \\"1.0.0\\" -+ \\"version\\": \\"2.0.0\\" +- \\"version\\": \\"1.0.0\\", ++ \\"version\\": \\"2.0.0\\", diff --git a/packages/package-1/package.json b/packages/package-1/package.json index SHA..SHA 100644 --- a/packages/package-1/package.json @@ -339,8 +339,8 @@ index SHA..SHA 100644 --- a/lerna.json +++ b/lerna.json @@ -2 +2 @@ -- \\"version\\": \\"1.0.0\\" -+ \\"version\\": \\"1.1.0\\" +- \\"version\\": \\"1.0.0\\", ++ \\"version\\": \\"1.1.0\\", diff --git a/packages/package-3/package.json b/packages/package-3/package.json index SHA..SHA 100644 --- a/packages/package-3/package.json @@ -360,8 +360,8 @@ index SHA..SHA 100644 --- a/lerna.json +++ b/lerna.json @@ -2 +2 @@ -- \\"version\\": \\"1.0.0\\" -+ \\"version\\": \\"1.0.1\\" +- \\"version\\": \\"1.0.0\\", ++ \\"version\\": \\"1.0.1\\", diff --git a/packages/package-1/package.json b/packages/package-1/package.json index SHA..SHA 100644 --- a/packages/package-1/package.json diff --git a/core/command/__fixtures__/basic/lerna.json b/core/command/__fixtures__/basic/lerna.json index 7c855688b9..245c057088 100644 --- a/core/command/__fixtures__/basic/lerna.json +++ b/core/command/__fixtures__/basic/lerna.json @@ -1,5 +1,6 @@ { "version": "1.0.0", + "packages": ["packages/*"], "testOption": "default", "command": { "testb": { diff --git a/core/package/index.js b/core/package/index.js index 79732d5612..b1ee4dd51c 100644 --- a/core/package/index.js +++ b/core/package/index.js @@ -54,7 +54,6 @@ function shallowCopy(json) { * @property {Record} [optionalDependencies] * @property {Record} [peerDependencies] * @property {Record<'directory' | 'registry' | 'tag', string>} [publishConfig] - * @property {string[] | { packages: string[] }} [workspaces] */ /** diff --git a/core/project/__tests__/project.test.js b/core/project/__tests__/project.test.js index 9cccd3a6e5..3355c0a633 100644 --- a/core/project/__tests__/project.test.js +++ b/core/project/__tests__/project.test.js @@ -2,6 +2,7 @@ const fs = require("fs-extra"); const path = require("path"); +const { loggingOutput } = require("@lerna-test/helpers/logging-output"); // helpers const initFixture = require("@lerna-test/helpers").initFixtureFactory(__dirname); @@ -141,29 +142,29 @@ describe("Project", () => { const project = new Project(cwd); expect(project.config).toMatchInlineSnapshot(` -Object { - "command": Object { - "bootstrap": Object { - "hoist": true, - }, - "publish": Object { - "bump": "prerelease", - "distTag": "next", - "ignoreChanges": Array [ - "ignored-file", - ], - "loglevel": "success", - }, - "version": Object { - "createRelease": "github", - }, - }, - "packages": Array [ - "recursive-pkgs/*", - ], - "version": "1.0.0", -} -`); + Object { + "command": Object { + "bootstrap": Object { + "hoist": true, + }, + "publish": Object { + "bump": "prerelease", + "distTag": "next", + "ignoreChanges": Array [ + "ignored-file", + ], + "loglevel": "success", + }, + "version": Object { + "createRelease": "github", + }, + }, + "packages": Array [ + "recursive-pkgs/*", + ], + "version": "1.0.0", + } + `); }); it("updates command.publish.githubRelease to command.version.createRelease", async () => { @@ -220,16 +221,26 @@ Object { }); describe("get .packageConfigs", () => { - it("returns the default packageConfigs", () => { + it("returns the default packageConfigs and warns when neither workspaces nor packages are explicitly configured", () => { const project = new Project(testDir); expect(project.packageConfigs).toEqual(["packages/*"]); + + const warningLogs = loggingOutput("warn"); + expect(warningLogs).toMatchInlineSnapshot(` + Array [ + "No packages defined in lerna.json. Defaulting to packages in packages/*", + ] + `); }); - it("returns custom packageConfigs", () => { + it("returns custom packageConfigs and does not warn that the default will be used", () => { const project = new Project(testDir); const customPackages = [".", "my-packages/*"]; project.config.packages = customPackages; expect(project.packageConfigs).toBe(customPackages); + + const warningLogs = loggingOutput("warn"); + expect(warningLogs).toEqual([]); }); it("returns workspace packageConfigs", async () => { @@ -241,7 +252,22 @@ Object { it("throws with friendly error if workspaces are not configured", () => { const project = new Project(testDir); project.config.useWorkspaces = true; - expect(() => project.packageConfigs).toThrow(/workspaces need to be defined/); + expect(() => project.packageConfigs).toThrow(/Workspaces need to be defined/); + }); + + it("warns when workspaces are defined but lerna is not configured to use them", () => { + const project = new Project(testDir); + project.config.useWorkspaces = false; + project.config.packages = ["packages/*"]; + project.manifest.set("workspaces", ["modules/*"]); + + expect(project.packageConfigs).toEqual(["packages/*"]); + + const warningLogs = loggingOutput("warn"); + expect(warningLogs[0]).toMatchInlineSnapshot(` + "Workspaces exist in the root package.json, but Lerna is not configured to use them. + To fix this and have Lerna use workspaces to resolve packages, set \`useWorkspaces: true\` in lerna.json." + `); }); }); diff --git a/core/project/index.js b/core/project/index.js index 12b69dbf76..f57e68c8c2 100644 --- a/core/project/index.js +++ b/core/project/index.js @@ -19,6 +19,7 @@ const { makeFileFinder, makeSyncFileFinder } = require("./lib/make-file-finder") /** * @typedef {object} ProjectConfig * @property {string[]} packages + * @property {boolean} useNx * @property {boolean} useWorkspaces * @property {string} version */ @@ -109,7 +110,7 @@ class Project { throw new ValidationError( "EWORKSPACES", dedent` - Yarn workspaces need to be defined in the root package.json. + Workspaces need to be defined in the root package.json. See: https://github.com/lerna/lerna/blob/master/commands/bootstrap/README.md#--use-workspaces ` ); @@ -118,7 +119,25 @@ class Project { return workspaces.packages || workspaces; } - return this.config.packages || [Project.PACKAGE_GLOB]; + if (this.manifest.get("workspaces")) { + log.warn( + "EWORKSPACES", + dedent` + Workspaces exist in the root package.json, but Lerna is not configured to use them. + To fix this and have Lerna use workspaces to resolve packages, set \`useWorkspaces: true\` in lerna.json. + ` + ); + } + + if (this.config.packages) { + return this.config.packages; + } + + log.warn( + "EPACKAGES", + `No packages defined in lerna.json. Defaulting to packages in ${Project.PACKAGE_GLOB}` + ); + return [Project.PACKAGE_GLOB]; } get packageParentDirs() { diff --git a/integration/__fixtures__/lerna-add/lerna.json b/integration/__fixtures__/lerna-add/lerna.json index 1587a66968..743ceadeaa 100644 --- a/integration/__fixtures__/lerna-add/lerna.json +++ b/integration/__fixtures__/lerna-add/lerna.json @@ -1,3 +1,4 @@ { - "version": "1.0.0" + "version": "1.0.0", + "packages": ["packages/*"] } diff --git a/integration/__fixtures__/lerna-clean/lerna.json b/integration/__fixtures__/lerna-clean/lerna.json index 1587a66968..743ceadeaa 100644 --- a/integration/__fixtures__/lerna-clean/lerna.json +++ b/integration/__fixtures__/lerna-clean/lerna.json @@ -1,3 +1,4 @@ { - "version": "1.0.0" + "version": "1.0.0", + "packages": ["packages/*"] } diff --git a/integration/__fixtures__/lerna-run/lerna.json b/integration/__fixtures__/lerna-run/lerna.json index 1587a66968..743ceadeaa 100644 --- a/integration/__fixtures__/lerna-run/lerna.json +++ b/integration/__fixtures__/lerna-run/lerna.json @@ -1,3 +1,4 @@ { - "version": "1.0.0" + "version": "1.0.0", + "packages": ["packages/*"] } diff --git a/integration/lerna-init.test.js b/integration/lerna-init.test.js index 42cd67d184..489aba70bf 100644 --- a/integration/lerna-init.test.js +++ b/integration/lerna-init.test.js @@ -33,15 +33,16 @@ describe("lerna init", () => { }, "name": "root", "private": true, + "workspaces": Array [ + "packages/*", + ], } `); expect(lernaJson).toMatchInlineSnapshot(` Object { "$schema": "node_modules/lerna/schemas/lerna-schema.json", - "packages": Array [ - "packages/*", - ], - "useNx": false, + "useNx": true, + "useWorkspaces": true, "version": "0.0.0", } `); @@ -85,6 +86,7 @@ describe("lerna init", () => { "packages/*", ], "useNx": false, + "useWorkspaces": false, "version": "1.0.0", } `); diff --git a/integration/lerna-publish-fixed.test.js b/integration/lerna-publish-fixed.test.js index 2c876a575a..10ab6c7f0f 100644 --- a/integration/lerna-publish-fixed.test.js +++ b/integration/lerna-publish-fixed.test.js @@ -50,8 +50,8 @@ index SHA..SHA 100644 --- a/lerna.json +++ b/lerna.json @@ -2 +2 @@ -- "version": "1.0.0" -+ "version": "1.0.1" +- "version": "1.0.0", ++ "version": "1.0.1", diff --git a/packages/package-1/package.json b/packages/package-1/package.json index SHA..SHA 100644 --- a/packages/package-1/package.json diff --git a/package-lock.json b/package-lock.json index ac59bb12fd..e8ffb26349 100644 --- a/package-lock.json +++ b/package-lock.json @@ -306,6 +306,7 @@ "dependencies": { "@lerna/child-process": "file:../../core/child-process", "@lerna/command": "file:../../core/command", + "@lerna/project": "file:../../core/project", "fs-extra": "^9.1.0", "p-map": "^4.0.0", "write-json-file": "^4.3.0" @@ -20667,6 +20668,7 @@ "requires": { "@lerna/child-process": "file:../../core/child-process", "@lerna/command": "file:../../core/command", + "@lerna/project": "file:../../core/project", "fs-extra": "^9.1.0", "p-map": "^4.0.0", "write-json-file": "^4.3.0" From f0061d21297a884ff263ce5485b171b3f809e9c0 Mon Sep 17 00:00:00 2001 From: Austin Fahsl Date: Thu, 21 Jul 2022 22:02:19 -0400 Subject: [PATCH 02/11] chore(docs): Update getting started guide --- website/docs/getting-started.md | 35 ++++++--------------------------- 1 file changed, 6 insertions(+), 29 deletions(-) diff --git a/website/docs/getting-started.md b/website/docs/getting-started.md index 044a6340f9..58f8439063 100644 --- a/website/docs/getting-started.md +++ b/website/docs/getting-started.md @@ -67,31 +67,15 @@ To add Lerna run the following command: npx lerna@latest init ``` -This will generate `lerna.json` and will add `lerna` to the root `package.json`. - -```json title="package.json" -{ - "name": "root", - "private": true, - "devDependencies": { - "lerna": "5.1.6" - } -} -``` - -What makes Lerna 5.1+ so powerful is the task delegation and other features that come with its integration -with [Nx](https://nx.dev). To opt in, install the `nx` package: - -```bash -npm i nx --save-dev -``` - -You should get a `package.json` as follows: +This will generate `lerna.json` and will add `lerna` and `nx` to the root `package.json`. ```json title="package.json" { "name": "root", "private": true, + "workspaces": [ + "packages/*" + ], "devDependencies": { "lerna": "5.1.6", "nx": "14.4.0" @@ -99,15 +83,8 @@ You should get a `package.json` as follows: } ``` -Finally, set `useNx` to `true` in `lerna.json`: - -```json title="lerna.json" -{ - "packages": ["packages/*"], - "useNx": true, - "version": "0.0.0" -} -``` +What makes Lerna 5.1+ so powerful is the task delegation and other features that come with its integration +with [Nx](https://nx.dev). ## Visualizing Workspace From 07ee12c22c1701d551c6077408b514ef92116988 Mon Sep 17 00:00:00 2001 From: Austin Fahsl Date: Thu, 21 Jul 2022 22:15:45 -0400 Subject: [PATCH 03/11] fix: add nx as dev dependency when useNx will be true --- commands/init/__tests__/init-command.test.js | 77 ++++++++++++++++++++ commands/init/index.js | 31 ++++---- commands/run/index.js | 1 - integration/lerna-init.test.js | 1 + 4 files changed, 96 insertions(+), 14 deletions(-) diff --git a/commands/init/__tests__/init-command.test.js b/commands/init/__tests__/init-command.test.js index d5fc0ba4db..5aa7353295 100644 --- a/commands/init/__tests__/init-command.test.js +++ b/commands/init/__tests__/init-command.test.js @@ -38,6 +38,7 @@ describe("InitCommand", () => { Object { "devDependencies": Object { "lerna": "^__TEST_VERSION__", + "nx": "^14.4.3", }, "name": "root", "private": true, @@ -122,6 +123,7 @@ describe("InitCommand", () => { Object { "devDependencies": Object { "lerna": "^__TEST_VERSION__", + "nx": "^14.4.3", }, "name": "root", "private": true, @@ -301,6 +303,81 @@ describe("InitCommand", () => { expect(await fs.exists(path.join(testDir, "modules"))).toBe(true); }); + + describe("when useNx is false", () => { + it("preserves useNx false and does not add nx as dependency", async () => { + const testDir = await initFixture("has-lerna"); + const lernaJsonPath = path.join(testDir, "lerna.json"); + + await fs.outputJSON(lernaJsonPath, { + lerna: "0.1.100", + version: "1.2.3", + useNx: false, + }); + + await lernaInit(testDir)(); + + expect(await fs.readJSON(lernaJsonPath)).toMatchInlineSnapshot(` + Object { + "$schema": "node_modules/lerna/schemas/lerna-schema.json", + "packages": Array [ + "packages/*", + ], + "useNx": false, + "useWorkspaces": false, + "version": "1.2.3", + } + `); + + expect(await fs.readJSON(path.join(testDir, "package.json"))).toMatchInlineSnapshot(` + Object { + "devDependencies": Object { + "lerna": "^__TEST_VERSION__", + }, + "name": "root", + "private": true, + } + `); + }); + }); + + describe("when useNx is true", () => { + it("preserves useNx true and adds nx as dependency", async () => { + const testDir = await initFixture("has-lerna"); + const lernaJsonPath = path.join(testDir, "lerna.json"); + + await fs.outputJSON(lernaJsonPath, { + lerna: "0.1.100", + version: "1.2.3", + useNx: true, + }); + + await lernaInit(testDir)(); + + expect(await fs.readJSON(lernaJsonPath)).toMatchInlineSnapshot(` + Object { + "$schema": "node_modules/lerna/schemas/lerna-schema.json", + "packages": Array [ + "packages/*", + ], + "useNx": true, + "useWorkspaces": false, + "version": "1.2.3", + } + `); + + expect(await fs.readJSON(path.join(testDir, "package.json"))).toMatchInlineSnapshot(` + Object { + "devDependencies": Object { + "lerna": "^__TEST_VERSION__", + "nx": "^14.4.3", + }, + "name": "root", + "private": true, + } + `); + }); + }); }); describe("when re-initializing with --exact", () => { diff --git a/commands/init/index.js b/commands/init/index.js index 4d4bf80b8e..c483a5c113 100644 --- a/commands/init/index.js +++ b/commands/init/index.js @@ -89,22 +89,27 @@ class InitCommand extends Command { chain = chain.then(() => { const rootPkg = this.project.manifest; - let targetDependencies; - - if (rootPkg.dependencies && rootPkg.dependencies.lerna) { - // lerna is a dependency in the current project - targetDependencies = rootPkg.dependencies; - } else { - // lerna is a devDependency or no dependency, yet - if (!rootPkg.devDependencies) { - // mutate raw JSON object - rootPkg.set("devDependencies", {}); + const setDependency = ({ name, version }) => { + let targetDependencies; + + if (rootPkg.dependencies && rootPkg.dependencies[name]) { + targetDependencies = rootPkg.dependencies; + } else { + if (!rootPkg.devDependencies) { + rootPkg.set("devDependencies", {}); + } + + targetDependencies = rootPkg.devDependencies; } - targetDependencies = rootPkg.devDependencies; - } + targetDependencies[name] = this.exact ? version : `^${version}`; + }; - targetDependencies.lerna = this.exact ? this.lernaVersion : `^${this.lernaVersion}`; + setDependency({ name: "lerna", version: this.lernaVersion }); + + if (!this.hasExistingLernaConfig || this.project.config.useNx) { + setDependency({ name: "nx", version: "14.4.3" }); + } return rootPkg.serialize(); }); diff --git a/commands/run/index.js b/commands/run/index.js index 56dbeb5ed9..067018c453 100644 --- a/commands/run/index.js +++ b/commands/run/index.js @@ -12,7 +12,6 @@ const { runTopologically } = require("@lerna/run-topologically"); const { ValidationError } = require("@lerna/validation-error"); const { getFilteredPackages } = require("@lerna/filter-options"); const { performance } = require("perf_hooks"); -const { readFileSync } = require("fs"); module.exports = factory; diff --git a/integration/lerna-init.test.js b/integration/lerna-init.test.js index 489aba70bf..c70f31e634 100644 --- a/integration/lerna-init.test.js +++ b/integration/lerna-init.test.js @@ -30,6 +30,7 @@ describe("lerna init", () => { Object { "devDependencies": Object { "lerna": "^__TEST_VERSION__", + "nx": "^14.4.3", }, "name": "root", "private": true, From 2496ff9a61745002a239280c28dad98bc38c6fc9 Mon Sep 17 00:00:00 2001 From: Austin Fahsl Date: Thu, 21 Jul 2022 22:18:37 -0400 Subject: [PATCH 04/11] chore(e2e): update e2e tests to reflect new defaults --- e2e/tests/lerna-init/lerna-init.spec.ts | 48 ++++++++++++++----------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/e2e/tests/lerna-init/lerna-init.spec.ts b/e2e/tests/lerna-init/lerna-init.spec.ts index 55c20045f8..61a1563501 100644 --- a/e2e/tests/lerna-init/lerna-init.spec.ts +++ b/e2e/tests/lerna-init/lerna-init.spec.ts @@ -30,10 +30,8 @@ describe("lerna-init", () => { expect(await fixture.readWorkspaceFile("lerna.json")).toMatchInlineSnapshot(` "{ \\"$schema\\": \\"node_modules/lerna/schemas/lerna-schema.json\\", - \\"packages\\": [ - \\"packages/*\\" - ], - \\"useNx\\": false, + \\"useNx\\": true, + \\"useWorkspaces\\": true, \\"version\\": \\"0.0.0\\" } " @@ -42,8 +40,12 @@ describe("lerna-init", () => { "{ \\"name\\": \\"root\\", \\"private\\": true, + \\"workspaces\\": [ + \\"packages/*\\" + ], \\"devDependencies\\": { - \\"lerna\\": \\"^999.9.9-e2e.0\\" + \\"lerna\\": \\"^999.9.9-e2e.0\\", + \\"nx\\": \\"^14.4.3\\" } } " @@ -67,10 +69,8 @@ describe("lerna-init", () => { expect(await fixture.readWorkspaceFile("lerna.json")).toMatchInlineSnapshot(` "{ \\"$schema\\": \\"node_modules/lerna/schemas/lerna-schema.json\\", - \\"packages\\": [ - \\"packages/*\\" - ], - \\"useNx\\": false, + \\"useNx\\": true, + \\"useWorkspaces\\": true, \\"version\\": \\"independent\\" } " @@ -79,8 +79,12 @@ describe("lerna-init", () => { "{ \\"name\\": \\"root\\", \\"private\\": true, + \\"workspaces\\": [ + \\"packages/*\\" + ], \\"devDependencies\\": { - \\"lerna\\": \\"^999.9.9-e2e.0\\" + \\"lerna\\": \\"^999.9.9-e2e.0\\", + \\"nx\\": \\"^14.4.3\\" } } " @@ -110,10 +114,8 @@ describe("lerna-init", () => { } }, \\"$schema\\": \\"node_modules/lerna/schemas/lerna-schema.json\\", - \\"packages\\": [ - \\"packages/*\\" - ], - \\"useNx\\": false, + \\"useNx\\": true, + \\"useWorkspaces\\": true, \\"version\\": \\"0.0.0\\" } " @@ -122,8 +124,12 @@ describe("lerna-init", () => { "{ \\"name\\": \\"root\\", \\"private\\": true, + \\"workspaces\\": [ + \\"packages/*\\" + ], \\"devDependencies\\": { - \\"lerna\\": \\"999.9.9-e2e.0\\" + \\"lerna\\": \\"999.9.9-e2e.0\\", + \\"nx\\": \\"14.4.3\\" } } " @@ -153,10 +159,8 @@ describe("lerna-init", () => { } }, \\"$schema\\": \\"node_modules/lerna/schemas/lerna-schema.json\\", - \\"packages\\": [ - \\"packages/*\\" - ], - \\"useNx\\": false, + \\"useNx\\": true, + \\"useWorkspaces\\": true, \\"version\\": \\"independent\\" } " @@ -165,8 +169,12 @@ describe("lerna-init", () => { "{ \\"name\\": \\"root\\", \\"private\\": true, + \\"workspaces\\": [ + \\"packages/*\\" + ], \\"devDependencies\\": { - \\"lerna\\": \\"999.9.9-e2e.0\\" + \\"lerna\\": \\"999.9.9-e2e.0\\", + \\"nx\\": \\"14.4.3\\" } } " From 71f57d4ebb9137f7671d503e1a048523c715d39b Mon Sep 17 00:00:00 2001 From: Austin Fahsl Date: Thu, 21 Jul 2022 22:44:02 -0400 Subject: [PATCH 05/11] fix: use condition instead of null coalescing operator --- commands/init/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/commands/init/index.js b/commands/init/index.js index c483a5c113..04591fa55c 100644 --- a/commands/init/index.js +++ b/commands/init/index.js @@ -131,8 +131,8 @@ class InitCommand extends Command { version = "0.0.0"; } - let useNx = config.useNx ?? false; - let useWorkspaces = config.useWorkspaces ?? false; + let useNx = config.useNx === true; + let useWorkspaces = config.useWorkspaces === true; if (!this.hasExistingLernaConfig) { this.logger.info("", "Creating lerna.json"); From af5cb22867dfd871427145cc06f0b5bfb7d67156 Mon Sep 17 00:00:00 2001 From: Austin Fahsl Date: Thu, 21 Jul 2022 23:03:13 -0400 Subject: [PATCH 06/11] feat: add link to docs site in lerna init success message --- commands/init/__tests__/init-command.test.js | 13 +++++++++++++ commands/init/index.js | 1 + e2e/tests/lerna-init/lerna-init.spec.ts | 4 ++++ integration/lerna-init.test.js | 2 ++ 4 files changed, 20 insertions(+) diff --git a/commands/init/__tests__/init-command.test.js b/commands/init/__tests__/init-command.test.js index 5aa7353295..346fe0b8f7 100644 --- a/commands/init/__tests__/init-command.test.js +++ b/commands/init/__tests__/init-command.test.js @@ -4,6 +4,8 @@ const fs = require("fs-extra"); const path = require("path"); const tempy = require("tempy"); +const { loggingOutput } = require("@lerna-test/helpers/logging-output"); + // helpers const initFixture = require("@lerna-test/helpers").initFixtureFactory(__dirname); @@ -13,6 +15,17 @@ const lernaInit = require("@lerna-test/helpers").commandRunner(require("../comma describe("InitCommand", () => { const lernaVersion = "__TEST_VERSION__"; + it("should link to docs site after success", async () => { + const testDir = tempy.directory(); + + await lernaInit(testDir)(); + + const logMessages = loggingOutput("info"); + expect(logMessages).toContain( + "New to Lerna? Check out the docs: https://lerna.js.org/docs/getting-started" + ); + }); + describe("in an empty directory", () => { it("initializes git repo with lerna files", async () => { const testDir = tempy.directory(); diff --git a/commands/init/index.js b/commands/init/index.js index 04591fa55c..f69e034a90 100644 --- a/commands/init/index.js +++ b/commands/init/index.js @@ -48,6 +48,7 @@ class InitCommand extends Command { return chain.then(() => { this.logger.success("", "Initialized Lerna files"); + this.logger.info("", "New to Lerna? Check out the docs: https://lerna.js.org/docs/getting-started"); }); } diff --git a/e2e/tests/lerna-init/lerna-init.spec.ts b/e2e/tests/lerna-init/lerna-init.spec.ts index 61a1563501..ad6620e427 100644 --- a/e2e/tests/lerna-init/lerna-init.spec.ts +++ b/e2e/tests/lerna-init/lerna-init.spec.ts @@ -24,6 +24,7 @@ describe("lerna-init", () => { lerna info Creating lerna.json lerna info Creating packages directory lerna success Initialized Lerna files + lerna info New to Lerna? Check out the docs: https://lerna.js.org/docs/getting-started " `); @@ -63,6 +64,7 @@ describe("lerna-init", () => { lerna info Creating lerna.json lerna info Creating packages directory lerna success Initialized Lerna files + lerna info New to Lerna? Check out the docs: https://lerna.js.org/docs/getting-started " `); @@ -103,6 +105,7 @@ describe("lerna-init", () => { lerna info Creating lerna.json lerna info Creating packages directory lerna success Initialized Lerna files + lerna info New to Lerna? Check out the docs: https://lerna.js.org/docs/getting-started " `); @@ -148,6 +151,7 @@ describe("lerna-init", () => { lerna info Creating lerna.json lerna info Creating packages directory lerna success Initialized Lerna files + lerna info New to Lerna? Check out the docs: https://lerna.js.org/docs/getting-started " `); diff --git a/integration/lerna-init.test.js b/integration/lerna-init.test.js index c70f31e634..c1ceb13e4d 100644 --- a/integration/lerna-init.test.js +++ b/integration/lerna-init.test.js @@ -23,6 +23,7 @@ describe("lerna init", () => { lerna info Creating lerna.json lerna info Creating packages directory lerna success Initialized Lerna files + lerna info New to Lerna? Check out the docs: https://lerna.js.org/docs/getting-started `); const [packageJson, lernaJson] = await loadMetaData(cwd); @@ -61,6 +62,7 @@ describe("lerna init", () => { lerna info Updating lerna.json lerna info Creating packages directory lerna success Initialized Lerna files + lerna info New to Lerna? Check out the docs: https://lerna.js.org/docs/getting-started `); const [packageJson, lernaJson] = await loadMetaData(cwd); From 7e2d46871ffa882aac94003e150211357ebe9ab1 Mon Sep 17 00:00:00 2001 From: Austin Fahsl Date: Thu, 21 Jul 2022 23:11:06 -0400 Subject: [PATCH 07/11] chore(docs): update help command to include new docs link --- core/cli/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/cli/index.js b/core/cli/index.js index edd15807bc..41a213d5a6 100644 --- a/core/cli/index.js +++ b/core/cli/index.js @@ -44,6 +44,6 @@ function lernaCLI(argv, cwd) { .wrap(cli.terminalWidth()).epilogue(dedent` When a command fails, all logs are written to lerna-debug.log in the current working directory. - For more information, find our manual at https://github.com/lerna/lerna + For more information, check out the docs at https://lerna.js.org/docs/introduction `); } From f7498f66eebd443394a0a36bc7459b85869a3b10 Mon Sep 17 00:00:00 2001 From: Austin Fahsl Date: Thu, 21 Jul 2022 23:41:45 -0400 Subject: [PATCH 08/11] chore: refactor to single ensureConfig function to reduce duplicate logic --- commands/init/index.js | 97 ++++++++++++++++++++---------------------- 1 file changed, 46 insertions(+), 51 deletions(-) diff --git a/commands/init/index.js b/commands/init/index.js index f69e034a90..2bc97d799f 100644 --- a/commands/init/index.js +++ b/commands/init/index.js @@ -42,8 +42,7 @@ class InitCommand extends Command { execute() { let chain = Promise.resolve(); - chain = chain.then(() => this.ensurePackageJSON()); - chain = chain.then(() => this.ensureLernaConfig()); + chain = chain.then(() => this.ensureConfig()); chain = chain.then(() => this.ensurePackagesDir()); return chain.then(() => { @@ -52,14 +51,16 @@ class InitCommand extends Command { }); } - get hasExistingLernaConfig() { - return !!this.project.version; - } + ensureConfig() { + const hasExistingLernaConfig = !!this.project.version; + const hasExistingPackageJson = !!this.project.manifest; + + const useNx = !hasExistingLernaConfig || this.project.config.useNx === true; + const useWorkspaces = !hasExistingLernaConfig || this.project.config.useWorkspaces === true; - ensurePackageJSON() { let chain = Promise.resolve(); - if (!this.project.manifest) { + if (!hasExistingPackageJson) { this.logger.info("", "Creating package.json"); // initialize with default indentation so write-pkg doesn't screw it up with tabs @@ -69,7 +70,7 @@ class InitCommand extends Command { private: true, }; - if (!this.hasExistingLernaConfig) { + if (useWorkspaces) { pkg.workspaces = [Project.PACKAGE_GLOB]; } @@ -79,7 +80,7 @@ class InitCommand extends Command { this.logger.info("", "Updating package.json"); chain = chain.then(() => { - if (!this.hasExistingLernaConfig && !this.project.manifest.get("workspaces")) { + if (useWorkspaces && !this.project.manifest.get("workspaces")) { this.project.manifest.set("workspaces", [Project.PACKAGE_GLOB]); return this.project.manifest.serialize(); @@ -87,6 +88,7 @@ class InitCommand extends Command { }); } + // add dependencies to package.json chain = chain.then(() => { const rootPkg = this.project.manifest; @@ -108,64 +110,57 @@ class InitCommand extends Command { setDependency({ name: "lerna", version: this.lernaVersion }); - if (!this.hasExistingLernaConfig || this.project.config.useNx) { + if (useNx) { setDependency({ name: "nx", version: "14.4.3" }); } return rootPkg.serialize(); }); - return chain; - } + chain = chain.then(() => { + let version; + + if (this.options.independent) { + version = "independent"; + } else if (this.project.version) { + version = this.project.version; + } else { + version = "0.0.0"; + } - ensureLernaConfig() { - // config already defaulted to empty object in Project constructor - const { config, version: projectVersion } = this.project; + if (!hasExistingLernaConfig) { + this.logger.info("", "Creating lerna.json"); + } else { + this.logger.info("", "Updating lerna.json"); - let version; + if (!useWorkspaces && !this.project.config.packages) { + Object.assign(this.project.config, { + packages: [Project.PACKAGE_GLOB], + }); + } + } - if (this.options.independent) { - version = "independent"; - } else if (projectVersion) { - version = projectVersion; - } else { - version = "0.0.0"; - } + delete this.project.config.lerna; // no longer relevant - let useNx = config.useNx === true; - let useWorkspaces = config.useWorkspaces === true; + if (this.exact) { + // ensure --exact is preserved for future init commands + const commandConfig = this.project.config.command || (this.project.config.command = {}); + const initConfig = commandConfig.init || (commandConfig.init = {}); - if (!this.hasExistingLernaConfig) { - this.logger.info("", "Creating lerna.json"); - useNx = true; - useWorkspaces = true; - } else { - this.logger.info("", "Updating lerna.json"); - if (!useWorkspaces && !config.packages) { - Object.assign(config, { - packages: [Project.PACKAGE_GLOB], - }); + initConfig.exact = true; } - } - - delete config.lerna; // no longer relevant - if (this.exact) { - // ensure --exact is preserved for future init commands - const commandConfig = config.command || (config.command = {}); - const initConfig = commandConfig.init || (commandConfig.init = {}); - - initConfig.exact = true; - } + Object.assign(this.project.config, { + $schema: "node_modules/lerna/schemas/lerna-schema.json", + useNx, + useWorkspaces, + version, + }); - Object.assign(config, { - $schema: "node_modules/lerna/schemas/lerna-schema.json", - useNx, - useWorkspaces, - version, + return this.project.serializeConfig(); }); - return this.project.serializeConfig(); + return chain; } ensurePackagesDir() { From 97d36a135246166f84f19ef7f6eeffe2706c65ff Mon Sep 17 00:00:00 2001 From: Austin Fahsl Date: Fri, 22 Jul 2022 10:39:16 -0400 Subject: [PATCH 09/11] chore(e2e): e2e fixture now reverts useNx and useWorkspaces by default --- e2e/tests/lerna-init/lerna-init.spec.ts | 8 ++++---- e2e/utils/fixture.ts | 20 ++++++++++++++++++-- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/e2e/tests/lerna-init/lerna-init.spec.ts b/e2e/tests/lerna-init/lerna-init.spec.ts index ad6620e427..4dbf412168 100644 --- a/e2e/tests/lerna-init/lerna-init.spec.ts +++ b/e2e/tests/lerna-init/lerna-init.spec.ts @@ -15,7 +15,7 @@ describe("lerna-init", () => { afterEach(() => fixture.destroy()); it("should initialize a lerna workspace", async () => { - const output = await fixture.lernaInit(); + const output = await fixture.lernaInit("", { keepDefaultOptions: true }); expect(output.stderr).toMatchInlineSnapshot(` "lerna notice cli v999.9.9-e2e.0 @@ -55,7 +55,7 @@ describe("lerna-init", () => { describe("--independent", () => { it("should initialize a lerna workspace in independent versioning mode", async () => { - const output = await fixture.lernaInit("--independent"); + const output = await fixture.lernaInit("--independent", { keepDefaultOptions: true }); expect(output.stderr).toMatchInlineSnapshot(` "lerna notice cli v999.9.9-e2e.0 @@ -96,7 +96,7 @@ describe("lerna-init", () => { describe("--exact", () => { it("should initialize a lerna workspace with exact package version enforcement", async () => { - const output = await fixture.lernaInit("--exact"); + const output = await fixture.lernaInit("--exact", { keepDefaultOptions: true }); expect(output.stderr).toMatchInlineSnapshot(` "lerna notice cli v999.9.9-e2e.0 @@ -142,7 +142,7 @@ describe("lerna-init", () => { describe("--independent --exact", () => { it("should initialize a lerna workspace in independent versioning mode with exact package version enforcement", async () => { - const output = await fixture.lernaInit("--independent --exact"); + const output = await fixture.lernaInit("--independent --exact", { keepDefaultOptions: true }); expect(output.stderr).toMatchInlineSnapshot(` "lerna notice cli v999.9.9-e2e.0 diff --git a/e2e/utils/fixture.ts b/e2e/utils/fixture.ts index 5ad796c7eb..c685635639 100644 --- a/e2e/utils/fixture.ts +++ b/e2e/utils/fixture.ts @@ -124,14 +124,30 @@ export class Fixture { /** * Resolve the locally published version of lerna and run the `init` command, with an optionally - * provided arguments. + * provided arguments. Reverts useNx and useWorkspaces to false when options.keepDefaultOptions is not provided, since those options are off for most users. */ - async lernaInit(args?: string): Promise { + async lernaInit(args?: string, options?: { keepDefaultOptions: true }): Promise { return this.exec( `npx --registry=http://localhost:4872/ --yes lerna@${getPublishedVersion()} init ${args || ""}` + ).then((initResult) => + options?.keepDefaultOptions ? initResult : this.revertDefaultInitOptions().then(() => initResult) ); } + private async revertDefaultInitOptions(): Promise { + await this.updateJson("lerna.json", (json) => ({ + ...json, + useNx: false, + useWorkspaces: false, + packages: ["packages/*"], + })); + await this.updateJson("package.json", (json) => { + const newJson = { ...json }; + delete newJson.workspaces; + return newJson; + }); + } + /** * Execute the install command of the configured package manager for the current fixture. * This has been given a terse name to help with readability in the spec files. From 09e3154894ccc2856ebe0cf028366d80c087ce10 Mon Sep 17 00:00:00 2001 From: Austin Fahsl Date: Fri, 22 Jul 2022 12:30:03 -0400 Subject: [PATCH 10/11] chore: move nx to dev dependency --- commands/init/__tests__/init-command.test.js | 15 +-------------- commands/init/index.js | 4 ---- core/lerna/package.json | 3 ++- e2e/tests/lerna-init/lerna-init.spec.ts | 12 ++++-------- integration/lerna-init.test.js | 1 - website/docs/getting-started.md | 5 ++--- 6 files changed, 9 insertions(+), 31 deletions(-) diff --git a/commands/init/__tests__/init-command.test.js b/commands/init/__tests__/init-command.test.js index 346fe0b8f7..f807d764d5 100644 --- a/commands/init/__tests__/init-command.test.js +++ b/commands/init/__tests__/init-command.test.js @@ -51,7 +51,6 @@ describe("InitCommand", () => { Object { "devDependencies": Object { "lerna": "^__TEST_VERSION__", - "nx": "^14.4.3", }, "name": "root", "private": true, @@ -136,7 +135,6 @@ describe("InitCommand", () => { Object { "devDependencies": Object { "lerna": "^__TEST_VERSION__", - "nx": "^14.4.3", }, "name": "root", "private": true, @@ -355,7 +353,7 @@ describe("InitCommand", () => { }); describe("when useNx is true", () => { - it("preserves useNx true and adds nx as dependency", async () => { + it("preserves useNx true", async () => { const testDir = await initFixture("has-lerna"); const lernaJsonPath = path.join(testDir, "lerna.json"); @@ -378,17 +376,6 @@ describe("InitCommand", () => { "version": "1.2.3", } `); - - expect(await fs.readJSON(path.join(testDir, "package.json"))).toMatchInlineSnapshot(` - Object { - "devDependencies": Object { - "lerna": "^__TEST_VERSION__", - "nx": "^14.4.3", - }, - "name": "root", - "private": true, - } - `); }); }); }); diff --git a/commands/init/index.js b/commands/init/index.js index 2bc97d799f..5951cfff96 100644 --- a/commands/init/index.js +++ b/commands/init/index.js @@ -110,10 +110,6 @@ class InitCommand extends Command { setDependency({ name: "lerna", version: this.lernaVersion }); - if (useNx) { - setDependency({ name: "nx", version: "14.4.3" }); - } - return rootPkg.serialize(); }); diff --git a/core/lerna/package.json b/core/lerna/package.json index b6059bc0cb..01cdca2dc3 100644 --- a/core/lerna/package.json +++ b/core/lerna/package.json @@ -53,6 +53,7 @@ "@lerna/run": "file:../../commands/run", "@lerna/version": "file:../../commands/version", "import-local": "^3.0.2", - "npmlog": "^6.0.2" + "npmlog": "^6.0.2", + "nx": ">=14.4.3 < 16" } } diff --git a/e2e/tests/lerna-init/lerna-init.spec.ts b/e2e/tests/lerna-init/lerna-init.spec.ts index 4dbf412168..4950cf9937 100644 --- a/e2e/tests/lerna-init/lerna-init.spec.ts +++ b/e2e/tests/lerna-init/lerna-init.spec.ts @@ -45,8 +45,7 @@ describe("lerna-init", () => { \\"packages/*\\" ], \\"devDependencies\\": { - \\"lerna\\": \\"^999.9.9-e2e.0\\", - \\"nx\\": \\"^14.4.3\\" + \\"lerna\\": \\"^999.9.9-e2e.0\\" } } " @@ -85,8 +84,7 @@ describe("lerna-init", () => { \\"packages/*\\" ], \\"devDependencies\\": { - \\"lerna\\": \\"^999.9.9-e2e.0\\", - \\"nx\\": \\"^14.4.3\\" + \\"lerna\\": \\"^999.9.9-e2e.0\\" } } " @@ -131,8 +129,7 @@ describe("lerna-init", () => { \\"packages/*\\" ], \\"devDependencies\\": { - \\"lerna\\": \\"999.9.9-e2e.0\\", - \\"nx\\": \\"14.4.3\\" + \\"lerna\\": \\"999.9.9-e2e.0\\" } } " @@ -177,8 +174,7 @@ describe("lerna-init", () => { \\"packages/*\\" ], \\"devDependencies\\": { - \\"lerna\\": \\"999.9.9-e2e.0\\", - \\"nx\\": \\"14.4.3\\" + \\"lerna\\": \\"999.9.9-e2e.0\\" } } " diff --git a/integration/lerna-init.test.js b/integration/lerna-init.test.js index c1ceb13e4d..86cba36b82 100644 --- a/integration/lerna-init.test.js +++ b/integration/lerna-init.test.js @@ -31,7 +31,6 @@ describe("lerna init", () => { Object { "devDependencies": Object { "lerna": "^__TEST_VERSION__", - "nx": "^14.4.3", }, "name": "root", "private": true, diff --git a/website/docs/getting-started.md b/website/docs/getting-started.md index 58f8439063..c8b6902636 100644 --- a/website/docs/getting-started.md +++ b/website/docs/getting-started.md @@ -67,7 +67,7 @@ To add Lerna run the following command: npx lerna@latest init ``` -This will generate `lerna.json` and will add `lerna` and `nx` to the root `package.json`. +This will generate `lerna.json` and will add `lerna` to the root `package.json`. ```json title="package.json" { @@ -77,8 +77,7 @@ This will generate `lerna.json` and will add `lerna` and `nx` to the root `packa "packages/*" ], "devDependencies": { - "lerna": "5.1.6", - "nx": "14.4.0" + "lerna": "5.1.6" } } ``` From b4d740dd810df8cb22c03cf49f29bd577b8ef821 Mon Sep 17 00:00:00 2001 From: Austin Fahsl Date: Fri, 22 Jul 2022 12:35:12 -0400 Subject: [PATCH 11/11] fix: run npm install to include nx in core/lerna lock file --- package-lock.json | 402 +++++++++++++++++++++++++++++++++------------- 1 file changed, 292 insertions(+), 110 deletions(-) diff --git a/package-lock.json b/package-lock.json index e8ffb26349..89e5288e09 100644 --- a/package-lock.json +++ b/package-lock.json @@ -547,7 +547,8 @@ "@lerna/run": "file:../../commands/run", "@lerna/version": "file:../../commands/version", "import-local": "^3.0.2", - "npmlog": "^6.0.2" + "npmlog": "^6.0.2", + "nx": ">=14.4.3 < 16" }, "bin": { "lerna": "cli.js" @@ -556,6 +557,153 @@ "node": "^14.15.0 || >=16.0.0" } }, + "core/lerna/node_modules/@nrwl/cli": { + "version": "14.4.3", + "resolved": "https://registry.npmjs.org/@nrwl/cli/-/cli-14.4.3.tgz", + "integrity": "sha512-9WzOOXgdf9YJxqte5e8KNkM3NWOuBgM7hz9jEOyw53Ht1Y2H8xLDPVkqDTS9kROgcyMQxHIjIcw80wZNaZL8Mw==", + "dependencies": { + "nx": "14.4.3" + } + }, + "core/lerna/node_modules/@nrwl/tao": { + "version": "14.4.3", + "resolved": "https://registry.npmjs.org/@nrwl/tao/-/tao-14.4.3.tgz", + "integrity": "sha512-sHlnqTlJ/XEc/lv0MIKYI1R643CWFvYL6QyZD7f38FvP1RblZ6eVqvOJcrkpwcvRWcZNEY+GrQpb1Io1ZvMEmQ==", + "dependencies": { + "nx": "14.4.3" + }, + "bin": { + "tao": "index.js" + } + }, + "core/lerna/node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "core/lerna/node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "core/lerna/node_modules/glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "core/lerna/node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "core/lerna/node_modules/nx": { + "version": "14.4.3", + "resolved": "https://registry.npmjs.org/nx/-/nx-14.4.3.tgz", + "integrity": "sha512-XPaoEAfJI9056qdwTvkutQSwwA3iihqNDwhvk3dmgpT35j8Uzm/y67goACaCUBCjP2dIQqXfNfJVWQIpcG3MTw==", + "hasInstallScript": true, + "dependencies": { + "@nrwl/cli": "14.4.3", + "@nrwl/tao": "14.4.3", + "@parcel/watcher": "2.0.4", + "chalk": "4.1.0", + "chokidar": "^3.5.1", + "cli-cursor": "3.1.0", + "cli-spinners": "2.6.1", + "cliui": "^7.0.2", + "dotenv": "~10.0.0", + "enquirer": "~2.3.6", + "fast-glob": "3.2.7", + "figures": "3.2.0", + "flat": "^5.0.2", + "fs-extra": "^10.1.0", + "glob": "7.1.4", + "ignore": "^5.0.4", + "js-yaml": "4.1.0", + "jsonc-parser": "3.0.0", + "minimatch": "3.0.5", + "npm-run-path": "^4.0.1", + "open": "^8.4.0", + "semver": "7.3.4", + "string-width": "^4.2.3", + "tar-stream": "~2.2.0", + "tmp": "~0.2.1", + "tsconfig-paths": "^3.9.0", + "tslib": "^2.3.0", + "v8-compile-cache": "2.3.0", + "yargs": "^17.4.0", + "yargs-parser": "21.0.1" + }, + "bin": { + "nx": "bin/nx.js" + }, + "peerDependencies": { + "@swc-node/register": "^1.4.2", + "@swc/core": "^1.2.173" + }, + "peerDependenciesMeta": { + "@swc-node/register": { + "optional": true + }, + "@swc/core": { + "optional": true + } + } + }, + "core/lerna/node_modules/tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + }, + "core/lerna/node_modules/yargs": { + "version": "17.5.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz", + "integrity": "sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "core/lerna/node_modules/yargs-parser": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", + "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==", + "engines": { + "node": ">=12" + } + }, "core/otplease": { "name": "@lerna/otplease", "version": "5.1.8", @@ -3624,7 +3772,6 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.0.4.tgz", "integrity": "sha512-cTDi+FUDBIUOBKEtj+nhiJ71AZVlkAsQFuGQTun5tV9mwQBQgZvhCzG+URPQc8myeN32yRVZEfVAPCs1RW+Jvg==", - "dev": true, "hasInstallScript": true, "dependencies": { "node-addon-api": "^3.2.1", @@ -3696,7 +3843,6 @@ "version": "1.9.0", "resolved": "https://registry.npmjs.org/@swc-node/core/-/core-1.9.0.tgz", "integrity": "sha512-vRnvsMtL9OxybA/Wun1ZhlDvB6MNs4Zujnina0VKdGk+yI6s87KUhdTcbAY6dQMZhQTLFiC1Lnv/BuwCKcCEug==", - "dev": true, "optional": true, "peer": true, "dependencies": { @@ -3714,7 +3860,6 @@ "version": "1.5.1", "resolved": "https://registry.npmjs.org/@swc-node/register/-/register-1.5.1.tgz", "integrity": "sha512-6IL5s4QShKGs08qAeNou3rDA3gbp2WHk6fo0XnJXQn/aC9k6FnVBbj/thGOIEDtgNhC/DKpZT8tCY1LpQnOZFg==", - "dev": true, "optional": true, "peer": true, "dependencies": { @@ -3737,7 +3882,6 @@ "version": "2.4.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", - "dev": true, "optional": true, "peer": true }, @@ -3745,7 +3889,6 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/@swc-node/sourcemap-support/-/sourcemap-support-0.2.0.tgz", "integrity": "sha512-FNrxdI6XMYfoNt81L8eFKEm1d8P82I1nPwS3MrnBGzZoMWB+seQhQK+iN6M5RreJxXbfZw5lF86LRjHEQeGMqg==", - "dev": true, "optional": true, "peer": true, "dependencies": { @@ -3756,7 +3899,6 @@ "version": "1.2.186", "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.2.186.tgz", "integrity": "sha512-n+I0z+gIsk+rkO2/UYGLcnyI2bq0YcHFtnMynRtZ8v541luGszFLBrayd3ljnmt4mFzSPY+2gTSQgK5HNuYk5g==", - "dev": true, "optional": true, "peer": true, "bin": { @@ -4192,8 +4334,7 @@ "node_modules/@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", - "dev": true + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=" }, "node_modules/@types/minimatch": { "version": "3.0.3", @@ -4957,7 +5098,6 @@ "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true, "engines": { "node": ">=6" } @@ -5013,7 +5153,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, "dependencies": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -5329,7 +5468,6 @@ "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true, "funding": [ { "type": "github", @@ -5729,7 +5867,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true, "engines": { "node": ">=8" } @@ -5738,7 +5875,6 @@ "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "dev": true, "dependencies": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -5859,7 +5995,6 @@ "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, "funding": [ { "type": "github", @@ -6157,7 +6292,6 @@ "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, "funding": [ { "type": "individual", @@ -6222,7 +6356,6 @@ "version": "2.6.1", "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==", - "dev": true, "engines": { "node": ">=6" }, @@ -6376,7 +6509,6 @@ "version": "2.0.16", "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz", "integrity": "sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==", - "dev": true, "optional": true, "peer": true }, @@ -7217,7 +7349,6 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", - "dev": true, "engines": { "node": ">=8" } @@ -7394,7 +7525,6 @@ "version": "10.0.0", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==", - "dev": true, "engines": { "node": ">=10" } @@ -7575,7 +7705,6 @@ "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, "dependencies": { "once": "^1.4.0" } @@ -7584,7 +7713,6 @@ "version": "2.3.6", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, "dependencies": { "ansi-colors": "^4.1.1" }, @@ -8738,7 +8866,6 @@ "version": "3.2.7", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", - "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -8964,7 +9091,6 @@ "version": "5.0.2", "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "dev": true, "bin": { "flat": "cli.js" } @@ -9072,8 +9198,7 @@ "node_modules/fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", - "dev": true + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" }, "node_modules/fs-extra": { "version": "9.1.0", @@ -9109,7 +9234,6 @@ "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, "hasInstallScript": true, "optional": true, "os": [ @@ -9854,7 +9978,6 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true, "funding": [ { "type": "github", @@ -10177,7 +10300,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, "dependencies": { "binary-extensions": "^2.0.0" }, @@ -10254,7 +10376,6 @@ "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz", "integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==", - "dev": true, "bin": { "is-docker": "cli.js" }, @@ -10564,7 +10685,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "dev": true, "dependencies": { "is-docker": "^2.0.0" }, @@ -12325,8 +12445,7 @@ "node_modules/jsonc-parser": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz", - "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==", - "dev": true + "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==" }, "node_modules/jsonfile": { "version": "6.1.0", @@ -13366,8 +13485,7 @@ "node_modules/node-addon-api": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", - "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", - "dev": true + "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==" }, "node_modules/node-fetch": { "version": "2.6.7", @@ -13434,7 +13552,6 @@ "version": "4.4.0", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==", - "dev": true, "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -13736,7 +13853,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -14281,7 +14397,6 @@ "version": "8.4.0", "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz", "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==", - "dev": true, "dependencies": { "define-lazy-prop": "^2.0.0", "is-docker": "^2.1.1", @@ -15075,7 +15190,7 @@ "version": "4.0.5", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz", "integrity": "sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==", - "dev": true, + "devOptional": true, "engines": { "node": ">= 6" } @@ -15568,7 +15683,6 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, "dependencies": { "picomatch": "^2.2.1" }, @@ -16181,7 +16295,6 @@ "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, "optional": true, "peer": true, "dependencies": { @@ -16746,7 +16859,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", - "dev": true, "dependencies": { "bl": "^4.0.3", "end-of-stream": "^1.4.1", @@ -16924,7 +17036,6 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "dev": true, "dependencies": { "rimraf": "^3.0.0" }, @@ -17177,7 +17288,6 @@ "version": "3.14.1", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", - "dev": true, "dependencies": { "@types/json5": "^0.0.29", "json5": "^1.0.1", @@ -17189,7 +17299,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dev": true, "dependencies": { "minimist": "^1.2.0" }, @@ -17201,7 +17310,6 @@ "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true, "engines": { "node": ">=4" } @@ -17325,7 +17433,7 @@ "version": "4.7.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.3.tgz", "integrity": "sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA==", - "dev": true, + "devOptional": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -17491,8 +17599,7 @@ "node_modules/v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==" }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", @@ -21819,7 +21926,6 @@ "version": "2.0.4", "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.0.4.tgz", "integrity": "sha512-cTDi+FUDBIUOBKEtj+nhiJ71AZVlkAsQFuGQTun5tV9mwQBQgZvhCzG+URPQc8myeN32yRVZEfVAPCs1RW+Jvg==", - "dev": true, "requires": { "node-addon-api": "^3.2.1", "node-gyp-build": "^4.3.0" @@ -21880,7 +21986,6 @@ "version": "1.9.0", "resolved": "https://registry.npmjs.org/@swc-node/core/-/core-1.9.0.tgz", "integrity": "sha512-vRnvsMtL9OxybA/Wun1ZhlDvB6MNs4Zujnina0VKdGk+yI6s87KUhdTcbAY6dQMZhQTLFiC1Lnv/BuwCKcCEug==", - "dev": true, "optional": true, "peer": true, "requires": { @@ -21891,7 +21996,6 @@ "version": "1.5.1", "resolved": "https://registry.npmjs.org/@swc-node/register/-/register-1.5.1.tgz", "integrity": "sha512-6IL5s4QShKGs08qAeNou3rDA3gbp2WHk6fo0XnJXQn/aC9k6FnVBbj/thGOIEDtgNhC/DKpZT8tCY1LpQnOZFg==", - "dev": true, "optional": true, "peer": true, "requires": { @@ -21907,7 +22011,6 @@ "version": "2.4.0", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==", - "dev": true, "optional": true, "peer": true } @@ -21917,7 +22020,6 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/@swc-node/sourcemap-support/-/sourcemap-support-0.2.0.tgz", "integrity": "sha512-FNrxdI6XMYfoNt81L8eFKEm1d8P82I1nPwS3MrnBGzZoMWB+seQhQK+iN6M5RreJxXbfZw5lF86LRjHEQeGMqg==", - "dev": true, "optional": true, "peer": true, "requires": { @@ -21928,7 +22030,6 @@ "version": "1.2.186", "resolved": "https://registry.npmjs.org/@swc/core/-/core-1.2.186.tgz", "integrity": "sha512-n+I0z+gIsk+rkO2/UYGLcnyI2bq0YcHFtnMynRtZ8v541luGszFLBrayd3ljnmt4mFzSPY+2gTSQgK5HNuYk5g==", - "dev": true, "optional": true, "peer": true, "requires": { @@ -22226,8 +22327,7 @@ "@types/json5": { "version": "0.0.29", "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=", - "dev": true + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=" }, "@types/minimatch": { "version": "3.0.3", @@ -22802,8 +22902,7 @@ "ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==" }, "ansi-escapes": { "version": "4.3.1", @@ -22837,7 +22936,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", - "dev": true, "requires": { "normalize-path": "^3.0.0", "picomatch": "^2.0.4" @@ -23085,8 +23183,7 @@ "base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "dev": true + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" }, "bcrypt-pbkdf": { "version": "1.0.2", @@ -23393,14 +23490,12 @@ "binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true + "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==" }, "bl": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", - "dev": true, "requires": { "buffer": "^5.5.0", "inherits": "^2.0.4", @@ -23504,7 +23599,6 @@ "version": "5.7.1", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "dev": true, "requires": { "base64-js": "^1.3.1", "ieee754": "^1.1.13" @@ -23733,7 +23827,6 @@ "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, "requires": { "anymatch": "~3.1.2", "braces": "~3.0.2", @@ -23777,8 +23870,7 @@ "cli-spinners": { "version": "2.6.1", "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.1.tgz", - "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==", - "dev": true + "integrity": "sha512-x/5fWmGMnbKQAaNwN+UZlV79qBLM9JFnJuJ03gIi5whrob0xV0ofNVHy9DhwGdsMJQc2OKv0oGmLzvaqvAVv+g==" }, "cli-width": { "version": "3.0.0", @@ -23896,7 +23988,6 @@ "version": "2.0.16", "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.16.tgz", "integrity": "sha512-hUewv7oMjCp+wkBv5Rm0v87eJhq4woh5rSR+42YSQJKecCqgIqNkZ6lAlQms/BwHPJA5NKMRlpxPRv0n8HQW6g==", - "dev": true, "optional": true, "peer": true }, @@ -24574,8 +24665,7 @@ "define-lazy-prop": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", - "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", - "dev": true + "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==" }, "define-properties": { "version": "1.1.4", @@ -24702,8 +24792,7 @@ "dotenv": { "version": "10.0.0", "resolved": "https://registry.npmjs.org/dotenv/-/dotenv-10.0.0.tgz", - "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==", - "dev": true + "integrity": "sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==" }, "download": { "version": "8.0.0", @@ -24849,7 +24938,6 @@ "version": "1.4.4", "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "dev": true, "requires": { "once": "^1.4.0" } @@ -24858,7 +24946,6 @@ "version": "2.3.6", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", - "dev": true, "requires": { "ansi-colors": "^4.1.1" } @@ -25748,7 +25835,6 @@ "version": "3.2.7", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.7.tgz", "integrity": "sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==", - "dev": true, "requires": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -25935,8 +26021,7 @@ "flat": { "version": "5.0.2", "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "dev": true + "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==" }, "flat-cache": { "version": "3.0.4", @@ -26028,8 +26113,7 @@ "fs-constants": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", - "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", - "dev": true + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==" }, "fs-extra": { "version": "9.1.0", @@ -26059,7 +26143,6 @@ "version": "2.3.2", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", - "dev": true, "optional": true }, "function-bind": { @@ -26624,8 +26707,7 @@ "ieee754": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" }, "ignore": { "version": "5.2.0", @@ -26867,7 +26949,6 @@ "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dev": true, "requires": { "binary-extensions": "^2.0.0" } @@ -26916,8 +26997,7 @@ "is-docker": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz", - "integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==", - "dev": true + "integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==" }, "is-extglob": { "version": "2.1.1", @@ -27130,7 +27210,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "dev": true, "requires": { "is-docker": "^2.0.0" } @@ -28549,8 +28628,7 @@ "jsonc-parser": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz", - "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==", - "dev": true + "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==" }, "jsonfile": { "version": "6.1.0", @@ -28702,7 +28780,123 @@ "@lerna/run": "file:../../commands/run", "@lerna/version": "file:../../commands/version", "import-local": "^3.0.2", - "npmlog": "^6.0.2" + "npmlog": "^6.0.2", + "nx": ">=14.4.3 < 16" + }, + "dependencies": { + "@nrwl/cli": { + "version": "14.4.3", + "resolved": "https://registry.npmjs.org/@nrwl/cli/-/cli-14.4.3.tgz", + "integrity": "sha512-9WzOOXgdf9YJxqte5e8KNkM3NWOuBgM7hz9jEOyw53Ht1Y2H8xLDPVkqDTS9kROgcyMQxHIjIcw80wZNaZL8Mw==", + "requires": { + "nx": "14.4.3" + } + }, + "@nrwl/tao": { + "version": "14.4.3", + "resolved": "https://registry.npmjs.org/@nrwl/tao/-/tao-14.4.3.tgz", + "integrity": "sha512-sHlnqTlJ/XEc/lv0MIKYI1R643CWFvYL6QyZD7f38FvP1RblZ6eVqvOJcrkpwcvRWcZNEY+GrQpb1Io1ZvMEmQ==", + "requires": { + "nx": "14.4.3" + } + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" + }, + "fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "requires": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + } + }, + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "requires": { + "argparse": "^2.0.1" + } + }, + "nx": { + "version": "14.4.3", + "resolved": "https://registry.npmjs.org/nx/-/nx-14.4.3.tgz", + "integrity": "sha512-XPaoEAfJI9056qdwTvkutQSwwA3iihqNDwhvk3dmgpT35j8Uzm/y67goACaCUBCjP2dIQqXfNfJVWQIpcG3MTw==", + "requires": { + "@nrwl/cli": "14.4.3", + "@nrwl/tao": "14.4.3", + "@parcel/watcher": "2.0.4", + "chalk": "4.1.0", + "chokidar": "^3.5.1", + "cli-cursor": "3.1.0", + "cli-spinners": "2.6.1", + "cliui": "^7.0.2", + "dotenv": "~10.0.0", + "enquirer": "~2.3.6", + "fast-glob": "3.2.7", + "figures": "3.2.0", + "flat": "^5.0.2", + "fs-extra": "^10.1.0", + "glob": "7.1.4", + "ignore": "^5.0.4", + "js-yaml": "4.1.0", + "jsonc-parser": "3.0.0", + "minimatch": "3.0.5", + "npm-run-path": "^4.0.1", + "open": "^8.4.0", + "semver": "7.3.4", + "string-width": "^4.2.3", + "tar-stream": "~2.2.0", + "tmp": "~0.2.1", + "tsconfig-paths": "^3.9.0", + "tslib": "^2.3.0", + "v8-compile-cache": "2.3.0", + "yargs": "^17.4.0", + "yargs-parser": "21.0.1" + } + }, + "tslib": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.4.0.tgz", + "integrity": "sha512-d6xOpEDfsi2CZVlPQzGeux8XMwLT9hssAsaPYExaQMuYskwb+x1x7J371tWlbBdWHroy99KnVB6qIkUbs5X3UQ==" + }, + "yargs": { + "version": "17.5.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.5.1.tgz", + "integrity": "sha512-t6YAJcxDkNX7NFYiVtKvWUz8l+PaKTLiL63mJYWR2GnHq2gjEWISzsLp9wg3aY36dY1j+gfIEL3pIF+XlJJfbA==", + "requires": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.0.0" + } + }, + "yargs-parser": { + "version": "21.0.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.0.1.tgz", + "integrity": "sha512-9BK1jFpLzJROCI5TzwZL/TU4gqjK5xiHV/RfWLOahrjAko/e4DJkRDZQXfvqAsiZzzYhgAzbgz6lg48jcm4GLg==" + } } }, "leven": { @@ -29391,8 +29585,7 @@ "node-addon-api": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", - "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", - "dev": true + "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==" }, "node-fetch": { "version": "2.6.7", @@ -29615,8 +29808,7 @@ "node-gyp-build": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.4.0.tgz", - "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==", - "dev": true + "integrity": "sha512-amJnQCcgtRVw9SvoebO3BKGESClrfXGCUTX9hSn1OuGQTQBOZmVd0Z0OlecpuRksKvbsUqALE8jls/ErClAPuQ==" }, "node-int64": { "version": "0.4.0", @@ -29676,8 +29868,7 @@ "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==" }, "normalize-url": { "version": "6.1.0", @@ -30092,7 +30283,6 @@ "version": "8.4.0", "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz", "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==", - "dev": true, "requires": { "define-lazy-prop": "^2.0.0", "is-docker": "^2.1.1", @@ -30677,7 +30867,7 @@ "version": "4.0.5", "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.5.tgz", "integrity": "sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ==", - "dev": true + "devOptional": true }, "pkginfo": { "version": "0.4.1", @@ -31059,7 +31249,6 @@ "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, "requires": { "picomatch": "^2.2.1" } @@ -31516,7 +31705,6 @@ "version": "0.5.21", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", - "dev": true, "optional": true, "peer": true, "requires": { @@ -31967,7 +32155,6 @@ "version": "2.2.0", "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", - "dev": true, "requires": { "bl": "^4.0.3", "end-of-stream": "^1.4.1", @@ -32103,7 +32290,6 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", - "dev": true, "requires": { "rimraf": "^3.0.0" } @@ -32266,7 +32452,6 @@ "version": "3.14.1", "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.1.tgz", "integrity": "sha512-fxDhWnFSLt3VuTwtvJt5fpwxBHg5AdKWMsgcPOOIilyjymcYVZoCQF8fvFRezCNfblEXmi+PcM1eYHeOAgXCOQ==", - "dev": true, "requires": { "@types/json5": "^0.0.29", "json5": "^1.0.1", @@ -32278,7 +32463,6 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "dev": true, "requires": { "minimist": "^1.2.0" } @@ -32286,8 +32470,7 @@ "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" } } }, @@ -32386,7 +32569,7 @@ "version": "4.7.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.3.tgz", "integrity": "sha512-WOkT3XYvrpXx4vMMqlD+8R8R37fZkjyLGlxavMc4iB8lrl8L0DeTcHbYgw/v0N/z9wAFsgBhcsF0ruoySS22mA==", - "dev": true + "devOptional": true }, "uglify-js": { "version": "3.12.7", @@ -32511,8 +32694,7 @@ "v8-compile-cache": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.3.0.tgz", - "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==", - "dev": true + "integrity": "sha512-l8lCEmLcLYZh4nbunNZvQCJc5pv7+RCwa8q/LdUx8u7lsWvPDKmpodJAJNwkAhJC//dFY48KuIEmjtd4RViDrA==" }, "v8-compile-cache-lib": { "version": "3.0.1",