Skip to content

Commit

Permalink
chore(): update deps to the latest versions, fix schematics breaking …
Browse files Browse the repository at this point in the history
…changes
  • Loading branch information
kamilmysliwiec committed Nov 4, 2020
1 parent c906e21 commit 230152e
Show file tree
Hide file tree
Showing 21 changed files with 1,935 additions and 1,536 deletions.
2,907 changes: 1,653 additions & 1,254 deletions package-lock.json

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@
},
"homepage": "https://github.com/nestjs/schematics#readme",
"dependencies": {
"@angular-devkit/core": "9.1.12",
"@angular-devkit/schematics": "9.1.12",
"@angular-devkit/core": "10.2.0",
"@angular-devkit/schematics": "10.2.0",
"fs-extra": "9.0.1",
"pluralize": "8.0.0"
},
"devDependencies": {
"@commitlint/cli": "^8.3.5",
"@commitlint/config-angular": "^8.3.4",
"@commitlint/cli": "^11.0.0",
"@commitlint/config-angular": "^11.0.0",
"@types/fs-extra": "9.0.3",
"@types/jest": "26.0.15",
"@types/node": "12.12.31",
"@types/node": "14.14.6",
"@typescript-eslint/eslint-plugin": "4.6.1",
"@typescript-eslint/parser": "4.6.1",
"cpx": "1.5.0",
Expand All @@ -62,13 +62,13 @@
"husky": "4.3.0",
"jest": "26.6.3",
"nyc": "15.1.0",
"release-it": "^12.4.3",
"release-it": "^14.2.1",
"ts-jest": "26.4.3",
"ts-node": "9.0.0",
"typescript": "3.9.7"
},
"peerDependencies": {
"typescript": "^3.4.5"
"typescript": "^3.4.5 || ^4.0.0"
},
"schematics": "./dist/collection.json",
"husky": {
Expand Down
16 changes: 8 additions & 8 deletions src/lib/application/application.factory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ describe('Application Factory', () => {
'.',
path.join(process.cwd(), 'src/collection.json'),
);
it('should manage name only', () => {
it('should manage name only', async () => {
const options: ApplicationOptions = {
name: 'project',
};
const tree: UnitTestTree = runner.runSchematic('application', options);
const tree: UnitTestTree = await runner.runSchematicAsync('application', options).toPromise();
const files: string[] = tree.files;
expect(files).toEqual([
'/project/.eslintrc.js',
Expand All @@ -34,11 +34,11 @@ describe('Application Factory', () => {
'/project/test/jest-e2e.json',
]);
});
it('should manage name to dasherize', () => {
it('should manage name to dasherize', async () => {
const options: ApplicationOptions = {
name: 'awesomeProject',
};
const tree: UnitTestTree = runner.runSchematic('application', options);
const tree: UnitTestTree = await runner.runSchematicAsync('application', options).toPromise();
const files: string[] = tree.files;
expect(files).toEqual([
'/awesome-project/.eslintrc.js',
Expand All @@ -58,12 +58,12 @@ describe('Application Factory', () => {
'/awesome-project/test/jest-e2e.json',
]);
});
it('should manage javascript files', () => {
it('should manage javascript files', async () => {
const options: ApplicationOptions = {
name: 'project',
language: 'js',
};
const tree: UnitTestTree = runner.runSchematic('application', options);
const tree: UnitTestTree = await runner.runSchematicAsync('application', options).toPromise();
const files: string[] = tree.files;
expect(files).toEqual([
'/project/.babelrc',
Expand All @@ -84,12 +84,12 @@ describe('Application Factory', () => {
'/project/test/jest-e2e.json',
]);
});
it('should manage destination directory', () => {
it('should manage destination directory', async () => {
const options: ApplicationOptions = {
name: '@scope/package',
directory: 'scope-package',
};
const tree: UnitTestTree = runner.runSchematic('application', options);
const tree: UnitTestTree = await runner.runSchematicAsync('application', options).toPromise();
const files: string[] = tree.files;
expect(files).toEqual([
'/scope-package/.eslintrc.js',
Expand Down
28 changes: 14 additions & 14 deletions src/lib/class/class.factory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@ describe('Class Factory', () => {
'.',
path.join(process.cwd(), 'src/collection.json'),
);
it('should manage name only', () => {
it('should manage name only', async () => {
const options: ClassOptions = {
name: 'foo',
spec: true,
flat: true,
};
const tree: UnitTestTree = runner.runSchematic('class', options);
const tree: UnitTestTree = await runner.runSchematicAsync('class', options).toPromise();
const files: string[] = tree.files;

expect(files.find(filename => filename === '/foo.ts')).not.toBeUndefined();
expect(tree.readContent('/foo.ts')).toEqual('export class Foo {}\n');
});
it('should manage name as a path', () => {
it('should manage name as a path', async () => {
const options: ClassOptions = {
name: 'bar/foo',
flat: false,
spec: false,
};
const tree: UnitTestTree = runner.runSchematic('class', options);
const tree: UnitTestTree = await runner.runSchematicAsync('class', options).toPromise();
const files: string[] = tree.files;

expect(
Expand All @@ -38,14 +38,14 @@ describe('Class Factory', () => {
'export class Foo {}\n',
);
});
it('should manage name and path', () => {
it('should manage name and path', async () => {
const options: ClassOptions = {
name: 'foo',
path: 'baz',
flat: false,
spec: false,
};
const tree: UnitTestTree = runner.runSchematic('class', options);
const tree: UnitTestTree = await runner.runSchematicAsync('class', options).toPromise();
const files: string[] = tree.files;
expect(
files.find(filename => filename === '/baz/foo/foo.ts'),
Expand All @@ -54,13 +54,13 @@ describe('Class Factory', () => {
'export class Foo {}\n',
);
});
it('should manage name to dasherize', () => {
it('should manage name to dasherize', async () => {
const options: ClassOptions = {
name: 'fooBar',
flat: false,
spec: false,
};
const tree: UnitTestTree = runner.runSchematic('class', options);
const tree: UnitTestTree = await runner.runSchematicAsync('class', options).toPromise();
const files: string[] = tree.files;
expect(
files.find(filename => filename === '/foo-bar/foo-bar.ts'),
Expand All @@ -69,13 +69,13 @@ describe('Class Factory', () => {
'export class FooBar {}\n',
);
});
it('should manage path to dasherize', () => {
it('should manage path to dasherize', async () => {
const options: ClassOptions = {
name: 'barBaz/foo',
spec: false,
flat: false,
};
const tree: UnitTestTree = runner.runSchematic('class', options);
const tree: UnitTestTree = await runner.runSchematicAsync('class', options).toPromise();
const files: string[] = tree.files;
expect(
files.find(filename => filename === '/bar-baz/foo/foo.ts'),
Expand All @@ -84,27 +84,27 @@ describe('Class Factory', () => {
'export class Foo {}\n',
);
});
it('should manage javascript file', () => {
it('should manage javascript file', async () => {
const options: ClassOptions = {
name: 'foo',
language: 'js',
flat: false,
spec: false,
};
const tree: UnitTestTree = runner.runSchematic('class', options);
const tree: UnitTestTree = await runner.runSchematicAsync('class', options).toPromise();
const files: string[] = tree.files;
expect(
files.find(filename => filename === '/foo/foo.js'),
).not.toBeUndefined();
expect(tree.readContent('/foo/foo.js')).toEqual('export class Foo {}\n');
});
it('should remove . from name', () => {
it('should remove . from name', async () => {
const options: ClassOptions = {
name: 'foo.entity',
spec: true,
flat: true,
};
const tree: UnitTestTree = runner.runSchematic('class', options);
const tree: UnitTestTree = await runner.runSchematicAsync('class', options).toPromise();
const files: string[] = tree.files;

expect(
Expand Down
12 changes: 6 additions & 6 deletions src/lib/configuration/configuration.factory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ describe('Configuration Factory', () => {
'.',
path.join(process.cwd(), 'src/collection.json'),
);
it('should manage a default configuation', () => {
it('should manage a default configuation', async () => {
const options: ConfigurationOptions = {
project: 'project',
};
const tree: UnitTestTree = runner.runSchematic('configuration', options);
const tree: UnitTestTree = await runner.runSchematicAsync('configuration', options).toPromise();
const files: string[] = tree.files;
expect(
files.find(filename => filename === '/project/nest-cli.json'),
Expand All @@ -24,12 +24,12 @@ describe('Configuration Factory', () => {
sourceRoot: 'src',
});
});
it('should manage provided language input', () => {
it('should manage provided language input', async () => {
const options: ConfigurationOptions = {
project: 'project',
language: 'js',
};
const tree: UnitTestTree = runner.runSchematic('configuration', options);
const tree: UnitTestTree = await runner.runSchematicAsync('configuration', options).toPromise();
const files: string[] = tree.files;
expect(
files.find(filename => filename === '/project/nest-cli.json'),
Expand All @@ -40,12 +40,12 @@ describe('Configuration Factory', () => {
sourceRoot: 'src',
});
});
it('should manage provided collection input', () => {
it('should manage provided collection input', async () => {
const options: ConfigurationOptions = {
project: 'project',
collection: 'foo',
};
const tree: UnitTestTree = runner.runSchematic('configuration', options);
const tree: UnitTestTree = await runner.runSchematicAsync('configuration', options).toPromise();
const files: string[] = tree.files;
expect(
files.find(filename => filename === '/project/nest-cli.json'),
Expand Down
38 changes: 19 additions & 19 deletions src/lib/controller/controller.factory.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ describe('Controller Factory', () => {
'.',
path.join(process.cwd(), 'src/collection.json'),
);
it('should manage name only', () => {
it('should manage name only', async () => {
const options: ControllerOptions = {
name: 'foo',
skipImport: true,
spec: false,
flat: false,
};
const tree: UnitTestTree = runner.runSchematic('controller', options);
const tree: UnitTestTree = await runner.runSchematicAsync('controller', options).toPromise();
const files: string[] = tree.files;

expect(
Expand All @@ -36,12 +36,12 @@ describe('Controller Factory', () => {
'export class FooController {}\n',
);
});
it('should manage name has a path', () => {
it('should manage name has a path', async () => {
const options: ControllerOptions = {
name: 'bar/foo',
skipImport: true,
};
const tree: UnitTestTree = runner.runSchematic('controller', options);
const tree: UnitTestTree = await runner.runSchematicAsync('controller', options).toPromise();
const files: string[] = tree.files;
expect(
files.find(filename => filename === '/bar/foo/foo.controller.ts'),
Expand All @@ -56,13 +56,13 @@ describe('Controller Factory', () => {
'export class FooController {}\n',
);
});
it('should manage name and path', () => {
it('should manage name and path', async () => {
const options: ControllerOptions = {
name: 'foo',
path: 'bar',
skipImport: true,
};
const tree: UnitTestTree = runner.runSchematic('controller', options);
const tree: UnitTestTree = await runner.runSchematicAsync('controller', options).toPromise();
const files: string[] = tree.files;
expect(
files.find(filename => filename === '/bar/foo/foo.controller.ts'),
Expand All @@ -77,12 +77,12 @@ describe('Controller Factory', () => {
'export class FooController {}\n',
);
});
it('should manage name to dasherize', () => {
it('should manage name to dasherize', async () => {
const options: ControllerOptions = {
name: 'fooBar',
skipImport: true,
};
const tree: UnitTestTree = runner.runSchematic('controller', options);
const tree: UnitTestTree = await runner.runSchematicAsync('controller', options).toPromise();
const files: string[] = tree.files;
expect(
files.find(filename => filename === '/foo-bar/foo-bar.controller.ts'),
Expand All @@ -99,12 +99,12 @@ describe('Controller Factory', () => {
'export class FooBarController {}\n',
);
});
it('should manage path to dasherize', () => {
it('should manage path to dasherize', async () => {
const options: ControllerOptions = {
name: 'barBaz/foo',
skipImport: true,
};
const tree: UnitTestTree = runner.runSchematic('controller', options);
const tree: UnitTestTree = await runner.runSchematicAsync('controller', options).toPromise();
const files: string[] = tree.files;
expect(
files.find(filename => filename === '/bar-baz/foo/foo.controller.ts'),
Expand All @@ -121,13 +121,13 @@ describe('Controller Factory', () => {
'export class FooController {}\n',
);
});
it('should manage javascript file', () => {
it('should manage javascript file', async () => {
const options: ControllerOptions = {
name: 'foo',
language: 'js',
skipImport: true,
};
const tree: UnitTestTree = runner.runSchematic('controller', options);
const tree: UnitTestTree = await runner.runSchematicAsync('controller', options).toPromise();
const files: string[] = tree.files;
expect(
files.find(filename => filename === '/foo/foo.controller.js'),
Expand All @@ -142,15 +142,15 @@ describe('Controller Factory', () => {
'export class FooController {}\n',
);
});
it('should manage declaration in app module', () => {
it('should manage declaration in app module', async () => {
const app: ApplicationOptions = {
name: '',
};
let tree: UnitTestTree = runner.runSchematic('application', app);
let tree: UnitTestTree = await runner.runSchematicAsync('application', app).toPromise();
const options: ControllerOptions = {
name: 'foo',
};
tree = runner.runSchematic('controller', options, tree);
tree = await runner.runSchematicAsync('controller', options, tree).toPromise();
expect(tree.readContent(normalize('/src/app.module.ts'))).toEqual(
"import { Module } from '@nestjs/common';\n" +
"import { AppController } from './app.controller';\n" +
Expand All @@ -165,19 +165,19 @@ describe('Controller Factory', () => {
'export class AppModule {}\n',
);
});
it('should manage declaration in foo module', () => {
it('should manage declaration in foo module', async () => {
const app: ApplicationOptions = {
name: '',
};
let tree: UnitTestTree = runner.runSchematic('application', app);
let tree: UnitTestTree = await runner.runSchematicAsync('application', app).toPromise();
const module: ModuleOptions = {
name: 'foo',
};
tree = runner.runSchematic('module', module, tree);
tree = await runner.runSchematicAsync('module', module, tree).toPromise();;
const options: ControllerOptions = {
name: 'foo',
};
tree = runner.runSchematic('controller', options, tree);
tree = await runner.runSchematicAsync('controller', options, tree).toPromise();
expect(tree.readContent(normalize('/src/foo/foo.module.ts'))).toEqual(
"import { Module } from '@nestjs/common';\n" +
"import { FooController } from './foo.controller';\n" +
Expand Down

0 comments on commit 230152e

Please sign in to comment.