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..f807d764d5 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(); @@ -26,15 +39,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 +99,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 +123,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 +219,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 +290,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 +306,7 @@ describe("InitCommand", () => { const lernaJsonPath = path.join(testDir, "lerna.json"); await fs.outputJSON(lernaJsonPath, { + version: "1.2.3", packages: ["modules/*"], }); @@ -211,10 +314,74 @@ 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", 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", + } + `); + }); + }); }); 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 +404,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..5951cfff96 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; @@ -41,100 +42,121 @@ 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(() => { this.logger.success("", "Initialized Lerna files"); + this.logger.info("", "New to Lerna? Check out the docs: https://lerna.js.org/docs/getting-started"); }); } - ensurePackageJSON() { + 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; + 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 - 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 (useWorkspaces) { + 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 (useWorkspaces && !this.project.manifest.get("workspaces")) { + this.project.manifest.set("workspaces", [Project.PACKAGE_GLOB]); + + return this.project.manifest.serialize(); + } + }); } + // add dependencies to package.json chain = chain.then(() => { const rootPkg = this.project.manifest; - let targetDependencies; + const setDependency = ({ name, version }) => { + 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", {}); + 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 }); return rootPkg.serialize(); }); - return chain; - } + chain = chain.then(() => { + let version; - ensureLernaConfig() { - // config already defaulted to empty object in Project constructor - const { config, version: projectVersion } = this.project; + if (this.options.independent) { + version = "independent"; + } else if (this.project.version) { + version = this.project.version; + } else { + version = "0.0.0"; + } - let version; + if (!hasExistingLernaConfig) { + this.logger.info("", "Creating lerna.json"); + } else { + this.logger.info("", "Updating lerna.json"); - if (this.options.independent) { - version = "independent"; - } else if (projectVersion) { - version = projectVersion; - } else { - version = "0.0.0"; - } + if (!useWorkspaces && !this.project.config.packages) { + Object.assign(this.project.config, { + packages: [Project.PACKAGE_GLOB], + }); + } + } - if (!projectVersion) { - this.logger.info("", "Creating lerna.json"); - } else { - this.logger.info("", "Updating lerna.json"); - } + delete this.project.config.lerna; // no longer relevant - delete config.lerna; // no longer relevant + 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.exact) { - // ensure --exact is preserved for future init commands - const commandConfig = config.command || (config.command = {}); - const initConfig = commandConfig.init || (commandConfig.init = {}); + initConfig.exact = true; + } - 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", - packages: this.project.packageConfigs, - useNx: false, - version, + return this.project.serializeConfig(); }); - return this.project.serializeConfig(); + return chain; } ensurePackagesDir() { 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/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/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/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 `); } 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/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/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/e2e/tests/lerna-init/lerna-init.spec.ts b/e2e/tests/lerna-init/lerna-init.spec.ts index 55c20045f8..4950cf9937 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 @@ -24,16 +24,15 @@ 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 " `); 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,6 +41,9 @@ describe("lerna-init", () => { "{ \\"name\\": \\"root\\", \\"private\\": true, + \\"workspaces\\": [ + \\"packages/*\\" + ], \\"devDependencies\\": { \\"lerna\\": \\"^999.9.9-e2e.0\\" } @@ -52,7 +54,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 @@ -61,16 +63,15 @@ 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 " `); 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,6 +80,9 @@ describe("lerna-init", () => { "{ \\"name\\": \\"root\\", \\"private\\": true, + \\"workspaces\\": [ + \\"packages/*\\" + ], \\"devDependencies\\": { \\"lerna\\": \\"^999.9.9-e2e.0\\" } @@ -90,7 +94,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 @@ -99,6 +103,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 " `); @@ -110,10 +115,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,6 +125,9 @@ describe("lerna-init", () => { "{ \\"name\\": \\"root\\", \\"private\\": true, + \\"workspaces\\": [ + \\"packages/*\\" + ], \\"devDependencies\\": { \\"lerna\\": \\"999.9.9-e2e.0\\" } @@ -133,7 +139,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 @@ -142,6 +148,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 " `); @@ -153,10 +160,8 @@ describe("lerna-init", () => { } }, \\"$schema\\": \\"node_modules/lerna/schemas/lerna-schema.json\\", - \\"packages\\": [ - \\"packages/*\\" - ], - \\"useNx\\": false, + \\"useNx\\": true, + \\"useWorkspaces\\": true, \\"version\\": \\"independent\\" } " @@ -165,6 +170,9 @@ describe("lerna-init", () => { "{ \\"name\\": \\"root\\", \\"private\\": true, + \\"workspaces\\": [ + \\"packages/*\\" + ], \\"devDependencies\\": { \\"lerna\\": \\"999.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. 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..86cba36b82 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); @@ -33,15 +34,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", } `); @@ -59,6 +61,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); @@ -85,6 +88,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..89e5288e09 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" @@ -546,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" @@ -555,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", @@ -3623,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", @@ -3695,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": { @@ -3713,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": { @@ -3736,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 }, @@ -3744,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": { @@ -3755,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": { @@ -4191,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", @@ -4956,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" } @@ -5012,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" @@ -5328,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", @@ -5728,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" } @@ -5737,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", @@ -5858,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", @@ -6156,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", @@ -6221,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" }, @@ -6375,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 }, @@ -7216,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" } @@ -7393,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" } @@ -7574,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" } @@ -7583,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" }, @@ -8737,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", @@ -8963,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" } @@ -9071,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", @@ -9108,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": [ @@ -9853,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", @@ -10176,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" }, @@ -10253,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" }, @@ -10563,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" }, @@ -12324,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", @@ -13365,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", @@ -13433,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", @@ -13735,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" } @@ -14280,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", @@ -15074,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" } @@ -15567,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" }, @@ -16180,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": { @@ -16745,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", @@ -16923,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" }, @@ -17176,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", @@ -17188,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" }, @@ -17200,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" } @@ -17324,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" @@ -17490,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", @@ -20667,6 +20775,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" @@ -21817,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" @@ -21878,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": { @@ -21889,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": { @@ -21905,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 } @@ -21915,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": { @@ -21926,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": { @@ -22224,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", @@ -22800,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", @@ -22835,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" @@ -23083,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", @@ -23391,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", @@ -23502,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" @@ -23731,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", @@ -23775,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", @@ -23894,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 }, @@ -24572,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", @@ -24700,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", @@ -24847,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" } @@ -24856,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" } @@ -25746,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", @@ -25933,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", @@ -26026,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", @@ -26057,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": { @@ -26622,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", @@ -26865,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" } @@ -26914,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", @@ -27128,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" } @@ -28547,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", @@ -28700,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": { @@ -29389,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", @@ -29613,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", @@ -29674,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", @@ -30090,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", @@ -30675,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", @@ -31057,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" } @@ -31514,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": { @@ -31965,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", @@ -32101,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" } @@ -32264,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", @@ -32276,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" } @@ -32284,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=" } } }, @@ -32384,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", @@ -32509,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", diff --git a/website/docs/getting-started.md b/website/docs/getting-started.md index 044a6340f9..c8b6902636 100644 --- a/website/docs/getting-started.md +++ b/website/docs/getting-started.md @@ -73,6 +73,9 @@ This will generate `lerna.json` and will add `lerna` to the root `package.json`. { "name": "root", "private": true, + "workspaces": [ + "packages/*" + ], "devDependencies": { "lerna": "5.1.6" } @@ -80,34 +83,7 @@ This will generate `lerna.json` and will add `lerna` to the root `package.json`. ``` 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: - -```json title="package.json" -{ - "name": "root", - "private": true, - "devDependencies": { - "lerna": "5.1.6", - "nx": "14.4.0" - } -} -``` - -Finally, set `useNx` to `true` in `lerna.json`: - -```json title="lerna.json" -{ - "packages": ["packages/*"], - "useNx": true, - "version": "0.0.0" -} -``` +with [Nx](https://nx.dev). ## Visualizing Workspace