@schematics/angular 8.3.2 → 8.3.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/module/index.js CHANGED
@@ -75,16 +75,11 @@ function addRouteDeclarationToNgModule(options, routingModulePath) {
75
75
  return host;
76
76
  };
77
77
  }
78
- function getRoutingModulePath(host, options) {
79
- let path;
80
- const modulePath = options.module;
81
- const routingModuleName = modulePath.split('.')[0] + '-routing';
82
- const { module, ...rest } = options;
83
- try {
84
- path = find_module_1.findModuleFromOptions(host, { module: routingModuleName, ...rest });
85
- }
86
- catch (_a) { }
87
- return path;
78
+ function getRoutingModulePath(host, modulePath) {
79
+ const routingModulePath = modulePath.endsWith(find_module_1.ROUTING_MODULE_EXT)
80
+ ? modulePath
81
+ : modulePath.replace(find_module_1.MODULE_EXT, find_module_1.ROUTING_MODULE_EXT);
82
+ return host.exists(routingModulePath) ? core_1.normalize(routingModulePath) : undefined;
88
83
  }
89
84
  function buildRoute(options, modulePath) {
90
85
  const relativeModulePath = buildRelativeModulePath(options, modulePath);
@@ -100,15 +95,15 @@ function default_1(options) {
100
95
  if (options.module) {
101
96
  options.module = find_module_1.findModuleFromOptions(host, options);
102
97
  }
103
- const parsedPath = parse_name_1.parseName(options.path, options.name);
104
- options.name = parsedPath.name;
105
- options.path = parsedPath.path;
106
98
  let routingModulePath;
107
99
  const isLazyLoadedModuleGen = options.route && options.module;
108
100
  if (isLazyLoadedModuleGen) {
109
101
  options.routingScope = schema_1.RoutingScope.Child;
110
- routingModulePath = getRoutingModulePath(host, options);
102
+ routingModulePath = getRoutingModulePath(host, options.module);
111
103
  }
104
+ const parsedPath = parse_name_1.parseName(options.path, options.name);
105
+ options.name = parsedPath.name;
106
+ options.path = parsedPath.path;
112
107
  const templateSource = schematics_1.apply(schematics_1.url('./files'), [
113
108
  options.routing || isLazyLoadedModuleGen && !!routingModulePath
114
109
  ? schematics_1.noop()
@@ -31,7 +31,9 @@ export interface Schema {
31
31
  */
32
32
  project?: string;
33
33
  /**
34
- * Creates lazy loaded routing module. Requires --module option.
34
+ * The route path for a lazy-loaded module. When supplied, creates a component in the new
35
+ * module, and adds the route to that component in the `Routes` array declared in the module
36
+ * provided in the `--module` option.
35
37
  */
36
38
  route?: string;
37
39
  /**
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "route": {
43
43
  "type": "string",
44
- "description": "Creates lazy loaded routing module. Requires --module option."
44
+ "description": "The route path for a lazy-loaded module. When supplied, creates a component in the new module, and adds the route to that component in the `Routes` array declared in the module provided in the `--module` option."
45
45
  },
46
46
  "flat": {
47
47
  "type": "boolean",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schematics/angular",
3
- "version": "8.3.2",
3
+ "version": "8.3.6",
4
4
  "description": "Schematics specific to Angular",
5
5
  "keywords": [
6
6
  "angular",
@@ -14,8 +14,8 @@
14
14
  ],
15
15
  "schematics": "./collection.json",
16
16
  "dependencies": {
17
- "@angular-devkit/core": "8.3.2",
18
- "@angular-devkit/schematics": "8.3.2"
17
+ "@angular-devkit/core": "8.3.6",
18
+ "@angular-devkit/schematics": "8.3.6"
19
19
  },
20
20
  "repository": {
21
21
  "type": "git",
@@ -5,7 +5,7 @@
5
5
  "module": "commonjs"
6
6
  },
7
7
  "files": [
8
- "src/main.server.ts"
8
+ "src/<%= stripTsExtension(main) %>.ts"
9
9
  ],
10
10
  "angularCompilerOptions": {
11
11
  "entryModule": "./<%= rootInSrc ? '' : 'src/' %><%= appDir %>/<%= stripTsExtension(rootModuleFileName) %>#<%= rootModuleClassName %>"
@@ -27,12 +27,13 @@ function updateConfigFile(options, tsConfigDirectory) {
27
27
  if (buildTarget && buildTarget.configurations && buildTarget.configurations.production) {
28
28
  fileReplacements = buildTarget.configurations.production.fileReplacements;
29
29
  }
30
+ const mainPath = options.main;
30
31
  clientProject.targets.add({
31
32
  name: 'server',
32
33
  builder: workspace_models_1.Builders.Server,
33
34
  options: {
34
35
  outputPath: `dist/${options.clientProject}-server`,
35
- main: core_1.join(core_1.normalize(clientProject.root), 'src/main.server.ts'),
36
+ main: core_1.join(core_1.normalize(clientProject.root), 'src', mainPath.endsWith('.ts') ? mainPath : mainPath + '.ts'),
36
37
  tsConfig: core_1.join(tsConfigDirectory, `${options.tsconfigFileName}.json`),
37
38
  },
38
39
  configurations: {
@@ -16,6 +16,8 @@ export interface ModuleOptions {
16
16
  moduleExt?: string;
17
17
  routingModuleExt?: string;
18
18
  }
19
+ export declare const MODULE_EXT = ".module.ts";
20
+ export declare const ROUTING_MODULE_EXT = "-routing.module.ts";
19
21
  /**
20
22
  * Find the module referred by a set of options passed to the schematics.
21
23
  */
@@ -8,8 +8,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
8
8
  * found in the LICENSE file at https://angular.io/license
9
9
  */
10
10
  const core_1 = require("@angular-devkit/core");
11
- const MODULE_EXT = '.module.ts';
12
- const ROUTING_MODULE_EXT = '-routing.module.ts';
11
+ exports.MODULE_EXT = '.module.ts';
12
+ exports.ROUTING_MODULE_EXT = '-routing.module.ts';
13
13
  /**
14
14
  * Find the module referred by a set of options passed to the schematics.
15
15
  */
@@ -17,8 +17,8 @@ function findModuleFromOptions(host, options) {
17
17
  if (options.hasOwnProperty('skipImport') && options.skipImport) {
18
18
  return undefined;
19
19
  }
20
- const moduleExt = options.moduleExt || MODULE_EXT;
21
- const routingModuleExt = options.routingModuleExt || ROUTING_MODULE_EXT;
20
+ const moduleExt = options.moduleExt || exports.MODULE_EXT;
21
+ const routingModuleExt = options.routingModuleExt || exports.ROUTING_MODULE_EXT;
22
22
  if (!options.module) {
23
23
  const pathToCheck = (options.path || '') + '/' + options.name;
24
24
  return core_1.normalize(findModule(host, pathToCheck, moduleExt, routingModuleExt));
@@ -57,7 +57,7 @@ exports.findModuleFromOptions = findModuleFromOptions;
57
57
  /**
58
58
  * Function to find the "closest" module to a generated file's path.
59
59
  */
60
- function findModule(host, generateDir, moduleExt = MODULE_EXT, routingModuleExt = ROUTING_MODULE_EXT) {
60
+ function findModule(host, generateDir, moduleExt = exports.MODULE_EXT, routingModuleExt = exports.ROUTING_MODULE_EXT) {
61
61
  let dir = host.getDir('/' + generateDir);
62
62
  let foundRoutingModule = false;
63
63
  while (dir) {
@@ -9,16 +9,16 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.latestVersions = {
11
11
  // These versions should be kept up to date with latest Angular peer dependencies.
12
- Angular: '~8.2.4',
12
+ Angular: '~8.2.8',
13
13
  RxJs: '~6.4.0',
14
14
  ZoneJs: '~0.9.1',
15
15
  TypeScript: '~3.5.3',
16
16
  TsLib: '^1.10.0',
17
17
  // The versions below must be manually updated when making a new devkit release.
18
- DevkitBuildAngular: '~0.803.2',
19
- DevkitBuildNgPackagr: '~0.803.2',
20
- DevkitBuildWebpack: '~0.803.2',
21
- AngularPWA: '~0.803.2',
18
+ DevkitBuildAngular: '~0.803.6',
19
+ DevkitBuildNgPackagr: '~0.803.6',
20
+ DevkitBuildWebpack: '~0.803.6',
21
+ AngularPWA: '~0.803.6',
22
22
  tsickle: '^0.37.0',
23
23
  ngPackagr: '^5.4.0',
24
24
  };