diff --git a/e2e/workspace-create/src/create-nx-workspace-npm.test.ts b/e2e/workspace-create/src/create-nx-workspace-npm.test.ts index 1bd60c0fa7069..c5a0433729589 100644 --- a/e2e/workspace-create/src/create-nx-workspace-npm.test.ts +++ b/e2e/workspace-create/src/create-nx-workspace-npm.test.ts @@ -68,7 +68,7 @@ describe('create-nx-workspace --preset=npm', () => { checkFilesExist('tsconfig.base.json'); const tsconfig = readJson(`tsconfig.base.json`); expect(tsconfig.compilerOptions.paths).toEqual({ - [libName]: [`packages/${libName}/src/index.ts`], + [`@${wsName}/${libName}`]: [`packages/${libName}/src/index.ts`], }); }, 1_000_000); @@ -83,7 +83,7 @@ describe('create-nx-workspace --preset=npm', () => { checkFilesExist('tsconfig.base.json'); const tsconfig = readJson(`tsconfig.base.json`); expect(tsconfig.compilerOptions.paths).toEqual({ - [libName]: [`packages/${libName}/src/index.ts`], + [`@${wsName}/${libName}`]: [`packages/${libName}/src/index.ts`], }); }); @@ -120,7 +120,7 @@ describe('create-nx-workspace --preset=npm', () => { checkFilesExist('tsconfig.base.json'); const tsconfig = readJson(`tsconfig.base.json`); expect(tsconfig.compilerOptions.paths).toEqual({ - [libName]: [`packages/${libName}/src/index.ts`], + [`@${wsName}/${libName}`]: [`packages/${libName}/src/index.ts`], }); }); @@ -146,8 +146,8 @@ describe('create-nx-workspace --preset=npm', () => { checkFilesExist('tsconfig.base.json'); const tsconfig = readJson(`tsconfig.base.json`); expect(tsconfig.compilerOptions.paths).toEqual({ - [libName]: [`packages/${libName}/src/index.ts`], - [`${libName}/server`]: [`packages/${libName}/src/server.ts`], + [`@${wsName}/${libName}`]: [`packages/${libName}/src/index.ts`], + [`@${wsName}/${libName}/server`]: [`packages/${libName}/src/server.ts`], }); }); @@ -177,7 +177,7 @@ describe('create-nx-workspace --preset=npm', () => { checkFilesExist('tsconfig.base.json'); const tsconfig = readJson(`tsconfig.base.json`); expect(tsconfig.compilerOptions.paths).toEqual({ - [libName]: [`packages/${libName}/src/index.ts`], + [`@${wsName}/${libName}`]: [`packages/${libName}/src/index.ts`], }); }); @@ -203,7 +203,7 @@ describe('create-nx-workspace --preset=npm', () => { checkFilesExist('tsconfig.base.json'); const tsconfig = readJson(`tsconfig.base.json`); expect(tsconfig.compilerOptions.paths).toEqual({ - [libName]: [`packages/${libName}/src/index.ts`], + [`@${wsName}/${libName}`]: [`packages/${libName}/src/index.ts`], }); }); @@ -229,7 +229,7 @@ describe('create-nx-workspace --preset=npm', () => { checkFilesExist('tsconfig.base.json'); const tsconfig = readJson(`tsconfig.base.json`); expect(tsconfig.compilerOptions.paths).toEqual({ - [libName]: [`packages/${libName}/src/index.ts`], + [`@${wsName}/${libName}`]: [`packages/${libName}/src/index.ts`], }); }); diff --git a/packages/workspace/src/generators/new/files-package-based-repo/package.json__tmpl__ b/packages/workspace/src/generators/new/files-package-based-repo/package.json__tmpl__ index ca5e43f6234fc..efdfabbb8d41a 100644 --- a/packages/workspace/src/generators/new/files-package-based-repo/package.json__tmpl__ +++ b/packages/workspace/src/generators/new/files-package-based-repo/package.json__tmpl__ @@ -1,5 +1,5 @@ { - "name": "<%= formattedNames.fileName %>", + "name": "@<%= formattedNames.fileName %>/source", "version": "0.0.0", "license": "MIT", "scripts": { diff --git a/packages/workspace/src/generators/new/generate-workspace-files.spec.ts b/packages/workspace/src/generators/new/generate-workspace-files.spec.ts index 3edd4b25d9298..2a84d1791c92e 100644 --- a/packages/workspace/src/generators/new/generate-workspace-files.spec.ts +++ b/packages/workspace/src/generators/new/generate-workspace-files.spec.ts @@ -227,7 +227,7 @@ describe('@nx/workspace:generateWorkspaceFiles', () => { "nx": "0.0.1", }, "license": "MIT", - "name": "proj", + "name": "@proj/source", "private": true, "scripts": {}, "version": "0.0.0", @@ -256,7 +256,7 @@ describe('@nx/workspace:generateWorkspaceFiles', () => { "nx": "0.0.1", }, "license": "MIT", - "name": "proj", + "name": "@proj/source", "private": true, "scripts": {}, "version": "0.0.0",