feat(nest): Update nest version to 11 (#31393)
This PR updates our Nest dependency to version 11. It also fixes an issue when you generate a Nest app with `--unitTestRunner=none` it would still generate `.spec` files closes: #30188
This commit is contained in:
parent
cb4ae8a779
commit
8fb63e00ce
@ -3322,6 +3322,14 @@
|
||||
],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"id": "migrations",
|
||||
"path": "/technologies/node/nest/api/migrations",
|
||||
"name": "migrations",
|
||||
"children": [],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"disableCollapsible": false
|
||||
@ -8896,6 +8904,14 @@
|
||||
],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"id": "migrations",
|
||||
"path": "/nx-api/nest/migrations",
|
||||
"name": "migrations",
|
||||
"children": [],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
@ -12889,6 +12905,14 @@
|
||||
],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
},
|
||||
{
|
||||
"id": "migrations",
|
||||
"path": "/nx-api/nest/migrations",
|
||||
"name": "migrations",
|
||||
"children": [],
|
||||
"isExternal": false,
|
||||
"disableCollapsible": false
|
||||
}
|
||||
],
|
||||
"isExternal": false,
|
||||
|
||||
@ -2723,7 +2723,18 @@
|
||||
"type": "generator"
|
||||
}
|
||||
},
|
||||
"migrations": {},
|
||||
"migrations": {
|
||||
"/technologies/node/nest/api/migrations/21.2.0-beta.2-package-updates": {
|
||||
"description": "",
|
||||
"file": "generated/packages/nest/migrations/21.2.0-beta.2-package-updates.json",
|
||||
"hidden": false,
|
||||
"name": "21.2.0-beta.2-package-updates",
|
||||
"version": "21.2.0-beta.2",
|
||||
"originalFilePath": "/packages/nest",
|
||||
"path": "/technologies/node/nest/api/migrations/21.2.0-beta.2-package-updates",
|
||||
"type": "migration"
|
||||
}
|
||||
},
|
||||
"path": "/technologies/nest/nest"
|
||||
},
|
||||
"next": {
|
||||
|
||||
@ -2869,7 +2869,18 @@
|
||||
"type": "generator"
|
||||
}
|
||||
},
|
||||
"migrations": {},
|
||||
"migrations": {
|
||||
"/nx-api/nest/migrations/21.2.0-beta.2-package-updates": {
|
||||
"description": "",
|
||||
"file": "generated/packages/nest/migrations/21.2.0-beta.2-package-updates.json",
|
||||
"hidden": false,
|
||||
"name": "21.2.0-beta.2-package-updates",
|
||||
"version": "21.2.0-beta.2",
|
||||
"originalFilePath": "/packages/nest",
|
||||
"path": "/nx-api/nest/migrations/21.2.0-beta.2-package-updates",
|
||||
"type": "migration"
|
||||
}
|
||||
},
|
||||
"path": "/nx-api/nest"
|
||||
},
|
||||
"next": {
|
||||
|
||||
@ -2849,7 +2849,18 @@
|
||||
"type": "generator"
|
||||
}
|
||||
],
|
||||
"migrations": [],
|
||||
"migrations": [
|
||||
{
|
||||
"description": "",
|
||||
"file": "generated/packages/nest/migrations/21.2.0-beta.2-package-updates.json",
|
||||
"hidden": false,
|
||||
"name": "21.2.0-beta.2-package-updates",
|
||||
"version": "21.2.0-beta.2",
|
||||
"originalFilePath": "/packages/nest",
|
||||
"path": "nest/migrations/21.2.0-beta.2-package-updates",
|
||||
"type": "migration"
|
||||
}
|
||||
],
|
||||
"githubRoot": "https://github.com/nrwl/nx/blob/master",
|
||||
"name": "nest",
|
||||
"packageName": "@nx/nest",
|
||||
|
||||
@ -0,0 +1,18 @@
|
||||
{
|
||||
"name": "21.2.0-beta.2-package-updates",
|
||||
"version": "21.2.0-beta.2",
|
||||
"packages": {
|
||||
"nest": { "version": "^11.0.0", "alwaysAddToPackageJson": false },
|
||||
"@nestjs/schematics": {
|
||||
"version": "^11.0.0",
|
||||
"alwaysAddToPackageJson": false
|
||||
}
|
||||
},
|
||||
"aliases": [],
|
||||
"description": "",
|
||||
"hidden": false,
|
||||
"implementation": "",
|
||||
"path": "/packages/nest",
|
||||
"schema": null,
|
||||
"type": "migration"
|
||||
}
|
||||
@ -402,6 +402,7 @@
|
||||
- [resolver](/technologies/node/nest/api/generators/resolver)
|
||||
- [resource](/technologies/node/nest/api/generators/resource)
|
||||
- [service](/technologies/node/nest/api/generators/service)
|
||||
- [migrations](/technologies/node/nest/api/migrations)
|
||||
- [Java](/technologies/java)
|
||||
- [Introduction](/technologies/java/introduction)
|
||||
- [API](/technologies/java/api)
|
||||
@ -1074,6 +1075,7 @@
|
||||
- [resolver](/nx-api/nest/generators/resolver)
|
||||
- [resource](/nx-api/nest/generators/resource)
|
||||
- [service](/nx-api/nest/generators/service)
|
||||
- [migrations](/nx-api/nest/migrations)
|
||||
- [next](/nx-api/next)
|
||||
- [executors](/nx-api/next/executors)
|
||||
- [build](/nx-api/next/executors/build)
|
||||
@ -1558,6 +1560,7 @@
|
||||
- [resolver](/nx-api/nest/generators/resolver)
|
||||
- [resource](/nx-api/nest/generators/resource)
|
||||
- [service](/nx-api/nest/generators/service)
|
||||
- [migrations](/nx-api/nest/migrations)
|
||||
- [next](/nx-api/next)
|
||||
- [documents](/nx-api/next/documents)
|
||||
- [Overview](/nx-api/next/documents/overview)
|
||||
@ -2070,6 +2073,7 @@
|
||||
- [resolver](/nx-api/nest/generators/resolver)
|
||||
- [resource](/nx-api/nest/generators/resource)
|
||||
- [service](/nx-api/nest/generators/service)
|
||||
- [migrations](/nx-api/nest/migrations)
|
||||
- [next](/nx-api/next)
|
||||
- [documents](/nx-api/next/documents)
|
||||
- [Overview](/nx-api/next/documents/overview)
|
||||
|
||||
@ -1,4 +1,18 @@
|
||||
{
|
||||
"generators": {},
|
||||
"packageJsonUpdates": {}
|
||||
"packageJsonUpdates": {
|
||||
"21.2.0-beta.2": {
|
||||
"version": "21.2.0-beta.2",
|
||||
"packages": {
|
||||
"nest": {
|
||||
"version": "^11.0.0",
|
||||
"alwaysAddToPackageJson": false
|
||||
},
|
||||
"@nestjs/schematics": {
|
||||
"version": "^11.0.0",
|
||||
"alwaysAddToPackageJson": false
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
"migrations": "./migrations.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@nestjs/schematics": "^9.1.0",
|
||||
"@nestjs/schematics": "^11.0.0",
|
||||
"@nx/devkit": "file:../devkit",
|
||||
"@nx/js": "file:../js",
|
||||
"@nx/eslint": "file:../eslint",
|
||||
|
||||
@ -90,17 +90,27 @@ describe('application generator', () => {
|
||||
});
|
||||
|
||||
expect(tree.exists(`${appDirectory}/src/main.ts`)).toBeTruthy();
|
||||
expect(
|
||||
tree.exists(`${appDirectory}/src/app/app.controller.spec.ts`)
|
||||
).toBeTruthy();
|
||||
|
||||
expect(
|
||||
tree.exists(`${appDirectory}/src/app/app.controller.ts`)
|
||||
).toBeTruthy();
|
||||
expect(tree.exists(`${appDirectory}/src/app/app.module.ts`)).toBeTruthy();
|
||||
expect(tree.exists(`${appDirectory}/src/app/app.service.ts`)).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should generate spec files when unitTestRunner is jest', async () => {
|
||||
await applicationGenerator(tree, {
|
||||
directory: appDirectory,
|
||||
unitTestRunner: 'jest',
|
||||
addPlugin: true,
|
||||
});
|
||||
|
||||
expect(
|
||||
tree.exists(`${appDirectory}/src/app/app.controller.spec.ts`)
|
||||
).toBeTruthy();
|
||||
expect(
|
||||
tree.exists(`${appDirectory}/src/app/app.service.spec.ts`)
|
||||
).toBeTruthy();
|
||||
expect(tree.exists(`${appDirectory}/src/app/app.service.ts`)).toBeTruthy();
|
||||
});
|
||||
|
||||
it('should configure tsconfig correctly', async () => {
|
||||
|
||||
@ -5,7 +5,7 @@ import type { NormalizedOptions } from '../schema';
|
||||
export function createFiles(tree: Tree, options: NormalizedOptions): void {
|
||||
generateFiles(
|
||||
tree,
|
||||
joinPathFragments(__dirname, '..', 'files'),
|
||||
joinPathFragments(__dirname, '..', 'files', 'common'),
|
||||
joinPathFragments(options.appProjectRoot, 'src'),
|
||||
{
|
||||
tmpl: '',
|
||||
@ -13,4 +13,14 @@ export function createFiles(tree: Tree, options: NormalizedOptions): void {
|
||||
root: options.appProjectRoot,
|
||||
}
|
||||
);
|
||||
if (options.unitTestRunner === 'jest') {
|
||||
generateFiles(
|
||||
tree,
|
||||
joinPathFragments(__dirname, '..', 'files', 'test'),
|
||||
joinPathFragments(options.appProjectRoot, 'src'),
|
||||
{
|
||||
tmpl: '',
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
export const nxVersion = require('../../package.json').version;
|
||||
|
||||
export const nestJsVersion = '^10.0.2';
|
||||
export const nestJsSchematicsVersion = '^10.0.1';
|
||||
export const nestJsVersion = '^11.0.0';
|
||||
export const nestJsSchematicsVersion = '^11.0.0';
|
||||
export const rxjsVersion = '^7.8.0';
|
||||
export const reflectMetadataVersion = '^0.1.13';
|
||||
export const tsLibVersion = '^2.3.0';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user