From 8885dd301635c84fca78e3edae5e78a3ff10808b Mon Sep 17 00:00:00 2001 From: Emilien Escalle Date: Fri, 30 Aug 2024 09:40:59 +0200 Subject: [PATCH] fix(core): eslint and nx installation issues Signed-off-by: Emilien Escalle --- .../src/__snapshots__/core.spec.e2e.ts.snap | 24 ------------------- .../20240412185500-eslint-config.ts | 4 ++-- .../20240412185500-eslint-config.spec.ts.snap | 4 ++-- .../src/services/PackageManagerService.ts | 2 +- .../src/__snapshots__/react.spec.e2e.ts.snap | 24 ------------------- 5 files changed, 5 insertions(+), 53 deletions(-) diff --git a/packages/core/src/__snapshots__/core.spec.e2e.ts.snap b/packages/core/src/__snapshots__/core.spec.e2e.ts.snap index b3404b09..750544ac 100644 --- a/packages/core/src/__snapshots__/core.spec.e2e.ts.snap +++ b/packages/core/src/__snapshots__/core.spec.e2e.ts.snap @@ -12,30 +12,6 @@ Migration "core - 20240329200200-eslint-ignore" applied! Applying migration "core - 20240412185500-eslint-config"... Migration "core - 20240412185500-eslint-config" applied! Applying migration "core - 20240617094000-config-nx-scopes"... -[1/4] Resolving packages... -[2/4] Fetching packages... -[3/4] Linking dependencies... -[4/4] Building fresh packages... -success Saved lockfile. -success Saved 2 new dependencies. -info Direct dependencies -├─ @commitlint/config-nx-scopes@19.3.1 -└─ @ts-dev-tools/core@1.7.0 -info All dependencies -├─ @commitlint/config-nx-scopes@19.3.1 -└─ @ts-dev-tools/core@1.7.0 -$ ts-dev-tools install -Updating ts-dev-tools installation... -Applying migration "core - 20240617094000-config-nx-scopes"... -Migration "core - 20240617094000-config-nx-scopes" applied! -Symlinking dev dependencies... -Symlinking dev dependencies done! -Checking for duplicate dev dependencies... -Some dev dependencies are unnecessarily installed as their are already required by "@ts-dev-tools/core": - - typescript - -Check for duplicate dev dependencies done! -Installation done! Migration "core - 20240617094000-config-nx-scopes" applied! Symlinking dev dependencies... Symlinking dev dependencies done! diff --git a/packages/core/src/install/migrations/20240412185500-eslint-config.ts b/packages/core/src/install/migrations/20240412185500-eslint-config.ts index 9bc5435c..2564393a 100644 --- a/packages/core/src/install/migrations/20240412185500-eslint-config.ts +++ b/packages/core/src/install/migrations/20240412185500-eslint-config.ts @@ -16,9 +16,9 @@ export const up: MigrationUpFunction = async (absoluteProjectDir: string): Promi FileService.putFileContent( eslintConfigFilePath, - `import tsDevToolsCore from "@ts-dev-tools/core/dist/eslint-plugin-ts-dev-tools/index.js"; + `import { default as tsDevToolsCore } from "@ts-dev-tools/core/dist/eslint-plugin-ts-dev-tools/index.js"; -export default tsDevToolsCore; +export default tsDevToolsCore.default; ` ); }; diff --git a/packages/core/src/install/migrations/__snapshots__/20240412185500-eslint-config.spec.ts.snap b/packages/core/src/install/migrations/__snapshots__/20240412185500-eslint-config.spec.ts.snap index ae513448..006098b1 100644 --- a/packages/core/src/install/migrations/__snapshots__/20240412185500-eslint-config.spec.ts.snap +++ b/packages/core/src/install/migrations/__snapshots__/20240412185500-eslint-config.spec.ts.snap @@ -8,8 +8,8 @@ exports[`Migration 20240412185500-eslint-config Up should apply migration 1`] = `; exports[`Migration 20240412185500-eslint-config Up should apply migration 2`] = ` -"import tsDevToolsCore from "@ts-dev-tools/core/dist/eslint-plugin-ts-dev-tools/index.js"; +"import { default as tsDevToolsCore } from "@ts-dev-tools/core/dist/eslint-plugin-ts-dev-tools/index.js"; -export default tsDevToolsCore; +export default tsDevToolsCore.default; " `; diff --git a/packages/core/src/services/PackageManagerService.ts b/packages/core/src/services/PackageManagerService.ts index 48812e4d..c70af815 100644 --- a/packages/core/src/services/PackageManagerService.ts +++ b/packages/core/src/services/PackageManagerService.ts @@ -41,7 +41,7 @@ export class PackageManagerService { args.push(packageName); - await PackageManagerService.execCommand(args, dirPath); + await PackageManagerService.execCommand(args, dirPath, true); } static async isMonorepo(dirPath: string) { diff --git a/packages/react/src/__snapshots__/react.spec.e2e.ts.snap b/packages/react/src/__snapshots__/react.spec.e2e.ts.snap index a5ade0cf..768af071 100644 --- a/packages/react/src/__snapshots__/react.spec.e2e.ts.snap +++ b/packages/react/src/__snapshots__/react.spec.e2e.ts.snap @@ -16,30 +16,6 @@ Migration "core - 20240412185500-eslint-config" applied! Applying migration "react - 20240412185501-eslint-config"... Migration "react - 20240412185501-eslint-config" applied! Applying migration "core - 20240617094000-config-nx-scopes"... -[1/4] Resolving packages... -[2/4] Fetching packages... -[3/4] Linking dependencies... -[4/4] Building fresh packages... -success Saved lockfile. -success Saved 2 new dependencies. -info Direct dependencies -├─ @commitlint/config-nx-scopes@19.3.1 -└─ @ts-dev-tools/react@1.7.0 -info All dependencies -├─ @commitlint/config-nx-scopes@19.3.1 -└─ @ts-dev-tools/react@1.7.0 -$ ts-dev-tools install -Updating ts-dev-tools installation... -Applying migration "core - 20240617094000-config-nx-scopes"... -Migration "core - 20240617094000-config-nx-scopes" applied! -Symlinking dev dependencies... -Symlinking dev dependencies done! -Checking for duplicate dev dependencies... -Some dev dependencies are unnecessarily installed as their are already required by "@ts-dev-tools/core": - - typescript - -Check for duplicate dev dependencies done! -Installation done! Migration "core - 20240617094000-config-nx-scopes" applied! Symlinking dev dependencies... Symlinking dev dependencies done!