From fbc14d6544f41761a56f05aab159d3599ef51ba4 Mon Sep 17 00:00:00 2001 From: Victor Savkin Date: Mon, 13 Jun 2022 10:05:22 -0400 Subject: [PATCH] fix(core): rearrange the core and npm presets to avoid breaking existing workspaces --- packages/nx/presets/core.json | 10 +--------- packages/nx/presets/npm.json | 4 ++++ packages/nx/src/command-line/init.ts | 2 +- packages/nx/src/config/workspaces.ts | 4 +++- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/packages/nx/presets/core.json b/packages/nx/presets/core.json index da77b19512..7816bd9f01 100644 --- a/packages/nx/presets/core.json +++ b/packages/nx/presets/core.json @@ -1,10 +1,6 @@ { "implicitDependencies": { - "package.json": { - "dependencies": "*", - "devDependencies": "*" - }, - ".eslintrc.json": "*" + "package.json": "*" }, "tasksRunnerOptions": { "default": { @@ -14,10 +10,6 @@ } } }, - "workspaceLayout": { - "libsDir": "packages", - "appsDir": "packages" - }, "pluginsConfig": { "@nrwl/js": { "analyzeSourceFiles": false diff --git a/packages/nx/presets/npm.json b/packages/nx/presets/npm.json index 7816bd9f01..b754765d75 100644 --- a/packages/nx/presets/npm.json +++ b/packages/nx/presets/npm.json @@ -10,6 +10,10 @@ } } }, + "workspaceLayout": { + "libsDir": "packages", + "appsDir": "packages" + }, "pluginsConfig": { "@nrwl/js": { "analyzeSourceFiles": false diff --git a/packages/nx/src/command-line/init.ts b/packages/nx/src/command-line/init.ts index 1ef1617bf2..4a18973a5d 100644 --- a/packages/nx/src/command-line/init.ts +++ b/packages/nx/src/command-line/init.ts @@ -29,7 +29,7 @@ export function initHandler() { if (!fileExists('nx.json')) { writeJsonFile( 'nx.json', - readJsonFile(join(__dirname, '..', '..', 'presets', 'npm.json')) + readJsonFile(join(__dirname, '..', '..', 'presets', 'core.json')) ); output.success({ diff --git a/packages/nx/src/config/workspaces.ts b/packages/nx/src/config/workspaces.ts index 861dc64642..7cdf858113 100644 --- a/packages/nx/src/config/workspaces.ts +++ b/packages/nx/src/config/workspaces.ts @@ -197,7 +197,9 @@ export class Workspaces { } } else { try { - return readJsonFile(join(__dirname, '..', '..', 'presets', 'npm.json')); + return readJsonFile( + join(__dirname, '..', '..', 'presets', 'core.json') + ); } catch (e) { return {}; }