@o3r/schematics 10.0.0-next.14 → 10.0.0-next.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (74) hide show
  1. package/README.md +1 -1
  2. package/package.json +17 -12
  3. package/src/cli/environment.d.ts +2 -0
  4. package/src/cli/environment.d.ts.map +1 -0
  5. package/src/cli/environment.js +5 -0
  6. package/src/cli/environment.js.map +1 -0
  7. package/src/interfaces/angular-workspace.d.ts +16 -14
  8. package/src/interfaces/angular-workspace.d.ts.map +1 -1
  9. package/src/modules/modules.constants.d.ts +6 -2
  10. package/src/modules/modules.constants.d.ts.map +1 -1
  11. package/src/modules/modules.constants.js +5 -3
  12. package/src/modules/modules.constants.js.map +1 -1
  13. package/src/rule-factories/check-packages-peers/index.d.ts.map +1 -1
  14. package/src/rule-factories/check-packages-peers/index.js +4 -4
  15. package/src/rule-factories/check-packages-peers/index.js.map +1 -1
  16. package/src/rule-factories/dev-tools/devtools-registration.d.ts +20 -0
  17. package/src/rule-factories/dev-tools/devtools-registration.d.ts.map +1 -0
  18. package/src/rule-factories/dev-tools/devtools-registration.js +50 -0
  19. package/src/rule-factories/dev-tools/devtools-registration.js.map +1 -0
  20. package/src/rule-factories/dev-tools/index.d.ts +2 -0
  21. package/src/rule-factories/dev-tools/index.d.ts.map +1 -0
  22. package/src/rule-factories/dev-tools/index.js +5 -0
  23. package/src/rule-factories/dev-tools/index.js.map +1 -0
  24. package/src/rule-factories/eslint-fix/index.d.ts +1 -17
  25. package/src/rule-factories/eslint-fix/index.d.ts.map +1 -1
  26. package/src/rule-factories/eslint-fix/index.js +10 -24
  27. package/src/rule-factories/eslint-fix/index.js.map +1 -1
  28. package/src/rule-factories/index.d.ts +1 -0
  29. package/src/rule-factories/index.d.ts.map +1 -1
  30. package/src/rule-factories/index.js +1 -0
  31. package/src/rule-factories/index.js.map +1 -1
  32. package/src/rule-factories/ng-add/index.d.ts +2 -5
  33. package/src/rule-factories/ng-add/index.d.ts.map +1 -1
  34. package/src/rule-factories/ng-add/index.js +107 -83
  35. package/src/rule-factories/ng-add/index.js.map +1 -1
  36. package/src/tasks/eslint/index.d.ts +26 -1
  37. package/src/tasks/eslint/index.d.ts.map +1 -1
  38. package/src/tasks/eslint/index.js +15 -5
  39. package/src/tasks/eslint/index.js.map +1 -1
  40. package/src/utility/collection.d.ts +2 -5
  41. package/src/utility/collection.d.ts.map +1 -1
  42. package/src/utility/collection.js +11 -9
  43. package/src/utility/collection.js.map +1 -1
  44. package/src/utility/component.d.ts.map +1 -1
  45. package/src/utility/component.js +4 -3
  46. package/src/utility/component.js.map +1 -1
  47. package/src/utility/environment.d.ts +27 -0
  48. package/src/utility/environment.d.ts.map +1 -0
  49. package/src/utility/environment.js +51 -0
  50. package/src/utility/environment.js.map +1 -0
  51. package/src/utility/error.d.ts +7 -0
  52. package/src/utility/error.d.ts.map +1 -0
  53. package/src/utility/error.js +17 -0
  54. package/src/utility/error.js.map +1 -0
  55. package/src/utility/generation.d.ts +0 -1
  56. package/src/utility/generation.d.ts.map +1 -1
  57. package/src/utility/generation.js +7 -11
  58. package/src/utility/generation.js.map +1 -1
  59. package/src/utility/index.d.ts +9 -7
  60. package/src/utility/index.d.ts.map +1 -1
  61. package/src/utility/index.js +9 -7
  62. package/src/utility/index.js.map +1 -1
  63. package/src/utility/loaders.d.ts +19 -17
  64. package/src/utility/loaders.d.ts.map +1 -1
  65. package/src/utility/loaders.js +38 -18
  66. package/src/utility/loaders.js.map +1 -1
  67. package/src/utility/modules.d.ts +2 -7
  68. package/src/utility/modules.d.ts.map +1 -1
  69. package/src/utility/modules.js +5 -10
  70. package/src/utility/modules.js.map +1 -1
  71. package/src/utility/package-manager-runner.d.ts +16 -1
  72. package/src/utility/package-manager-runner.d.ts.map +1 -1
  73. package/src/utility/package-manager-runner.js +39 -1
  74. package/src/utility/package-manager-runner.js.map +1 -1
@@ -4,13 +4,12 @@ exports.setupSchematicsDefaultParams = exports.registerPackageCollectionSchemati
4
4
  const schematics_1 = require("@angular-devkit/schematics");
5
5
  const tasks_1 = require("@angular-devkit/schematics/tasks");
6
6
  const dependencies_1 = require("@schematics/angular/utility/dependencies");
7
- const rxjs_1 = require("rxjs");
8
- const index_1 = require("../../utility/index");
9
7
  const node_fs_1 = require("node:fs");
10
8
  const path = require("node:path");
9
+ const rxjs_1 = require("rxjs");
10
+ const index_1 = require("../../utility/index");
11
11
  /**
12
12
  * Install via `ng add` a list of npm packages.
13
- *
14
13
  * @param packages List of packages to be installed via `ng add`
15
14
  * @param options install options
16
15
  * @param packageJsonPath path of the package json of the project where they will be installed
@@ -20,28 +19,38 @@ function ngAddPackages(packages, options, packageJsonPath = '/package.json') {
20
19
  return schematics_1.noop;
21
20
  }
22
21
  const cwd = process.cwd().replace(/[\\/]+/g, '/');
23
- // FileSystem working directory might be different than Tree working directory (when using `yarn workspace` for example)
22
+ // FileSystem working directory might be different from Tree working directory (when using `yarn workspace` for example)
24
23
  const fsWorkingDirectory = (options?.workingDirectory && !cwd.endsWith(options.workingDirectory)) ? options.workingDirectory : '.';
25
24
  const versions = Object.fromEntries(packages.map((packageName, index) => [packageName, typeof options?.version === 'object' ? options.version[index] : options?.version]));
26
25
  if (options?.workingDirectory && !packageJsonPath.startsWith(options.workingDirectory)) {
27
26
  packageJsonPath = path.join(options.workingDirectory, packageJsonPath);
28
27
  }
29
28
  const getInstalledVersion = (packageName) => {
30
- try {
31
- const fileSystemPackageJson = JSON.parse((0, node_fs_1.readFileSync)(path.join(fsWorkingDirectory, 'package.json'), { encoding: 'utf8' }));
32
- if (options?.dependencyType === dependencies_1.NodeDependencyType.Dev) {
33
- return fileSystemPackageJson.devDependencies[packageName];
34
- }
35
- else if (options?.dependencyType === dependencies_1.NodeDependencyType.Peer) {
36
- return fileSystemPackageJson.peerDependencies[packageName];
29
+ let versionFound;
30
+ for (const workingDirectory of new Set([fsWorkingDirectory, '.'])) {
31
+ try {
32
+ const fileSystemPackageJson = JSON.parse((0, node_fs_1.readFileSync)(path.join(workingDirectory, 'package.json'), { encoding: 'utf8' }));
33
+ let version;
34
+ if (options?.dependencyType === dependencies_1.NodeDependencyType.Dev) {
35
+ version = fileSystemPackageJson.devDependencies[packageName];
36
+ }
37
+ else if (options?.dependencyType === dependencies_1.NodeDependencyType.Peer) {
38
+ version = fileSystemPackageJson.peerDependencies[packageName];
39
+ }
40
+ else {
41
+ version = fileSystemPackageJson.dependencies[packageName];
42
+ }
43
+ if (versionFound && version !== versionFound) {
44
+ // In case of conflict between package.json files, we consider the package as not installed to force its update
45
+ return;
46
+ }
47
+ versionFound = version;
37
48
  }
38
- else {
39
- return fileSystemPackageJson.dependencies[packageName];
49
+ catch (e) {
50
+ return;
40
51
  }
41
52
  }
42
- catch (e) {
43
- return;
44
- }
53
+ return versionFound;
45
54
  };
46
55
  const getNgAddSchema = (packageName, context) => {
47
56
  try {
@@ -62,71 +71,73 @@ function ngAddPackages(packages, options, packageJsonPath = '/package.json') {
62
71
  return accOptions;
63
72
  }, {});
64
73
  };
65
- return async (tree, context) => {
66
- const installedVersions = packages.map((packageName) => getInstalledVersion(packageName));
67
- const packageManager = (0, index_1.getPackageManager)();
68
- let installOptions = '';
69
- if (options?.dependencyType === dependencies_1.NodeDependencyType.Dev && packageManager === 'yarn') {
70
- installOptions = ' --prefer-dev';
71
- }
72
- else if (options?.dependencyType === dependencies_1.NodeDependencyType.Dev) {
73
- installOptions = ' -D';
74
- }
75
- else if (options?.dependencyType === dependencies_1.NodeDependencyType.Peer) {
76
- installOptions = ' -P';
77
- }
78
- const packagesToInstall = packages.filter((packageName, index) => !installedVersions[index] || installedVersions[index] !== versions[packageName]);
79
- if (packagesToInstall.length < 1) {
80
- return schematics_1.noop;
81
- }
82
- const packagesInput = packagesToInstall
83
- .map((packageName) => `${packageName}${versions[packageName] ? `@${versions[packageName]}` : ''}`)
84
- .join(' ');
85
- const workingDirectory = options?.workingDirectory || path.dirname(packageJsonPath);
86
- context.addTask(new tasks_1.NodePackageInstallTask({
87
- packageManager: packageManager,
88
- packageName: `${packagesInput}${installOptions}`,
89
- workingDirectory,
90
- hideOutput: false,
91
- quiet: false
92
- }));
93
- await (0, rxjs_1.lastValueFrom)(context.engine.executePostTasks());
94
- // We need to update manually the package json in the tree as the tree will overwrite the project at the end of the ng add @o3r/core
95
- const latestInstalledVersions = packagesToInstall.map((packageName) => [packageName, getInstalledVersion(packageName)]);
96
- const packageJson = tree.readJson(packageJsonPath);
97
- latestInstalledVersions.forEach(([packageName, latestInstalledVersion]) => {
98
- if (options?.dependencyType === dependencies_1.NodeDependencyType.Dev) {
99
- packageJson.devDependencies = { ...packageJson.devDependencies, [packageName]: latestInstalledVersion };
100
- }
101
- else if (options?.dependencyType === dependencies_1.NodeDependencyType.Peer) {
102
- packageJson.peerDependencies = { ...packageJson.peerDependencies, [packageName]: latestInstalledVersion };
74
+ const installedVersions = packages.map((packageName) => getInstalledVersion(packageName));
75
+ const packageManager = (0, index_1.getPackageManager)();
76
+ const packagesToInstall = packages.filter((packageName, index) => !installedVersions[index] || installedVersions[index] !== versions[packageName]);
77
+ if (packagesToInstall.length < 1) {
78
+ return schematics_1.noop;
79
+ }
80
+ return (0, schematics_1.chain)([
81
+ // Update package.json in tree
82
+ (tree) => {
83
+ const sortDependencies = (packageJson, depType) => {
84
+ packageJson[depType] = packageJson[depType] ?
85
+ Object.fromEntries(Object.entries(packageJson[depType]).sort(([key1, _val1], [key2, _val2]) => key1.localeCompare(key2))) :
86
+ undefined;
87
+ };
88
+ for (const filePath of new Set([packageJsonPath, './package.json'])) {
89
+ const packageJson = tree.readJson(filePath);
90
+ packages.forEach((packageName) => {
91
+ const version = versions[packageName] || 'latest';
92
+ if (options?.dependencyType === dependencies_1.NodeDependencyType.Dev) {
93
+ packageJson.devDependencies = { ...packageJson.devDependencies, [packageName]: version };
94
+ }
95
+ else if (options?.dependencyType === dependencies_1.NodeDependencyType.Peer) {
96
+ packageJson.peerDependencies = { ...packageJson.peerDependencies, [packageName]: version };
97
+ }
98
+ else {
99
+ packageJson.dependencies = { ...packageJson.dependencies, [packageName]: version };
100
+ }
101
+ });
102
+ ['dependencies', 'devDependencies', 'peerDependencies'].forEach((depType) => {
103
+ sortDependencies(packageJson, depType);
104
+ });
105
+ tree.overwrite(filePath, JSON.stringify(packageJson, null, 2));
103
106
  }
104
- else {
105
- packageJson.dependencies = { ...packageJson.dependencies, [packageName]: latestInstalledVersion };
107
+ },
108
+ // Run ng-adds
109
+ async (tree, context) => {
110
+ if (options?.skipNgAddSchematicRun) {
111
+ context.logger.info(`Package(s) '${packagesToInstall.join(', ')}' was(were) installed.
112
+ The run of 'ng-add' schematics for the package(s) is intentionally skipped. You can do the run standalone, later.`);
113
+ return schematics_1.noop;
106
114
  }
107
- });
108
- tree.overwrite(packageJsonPath, JSON.stringify(packageJson, null, 2));
109
- if (options?.skipNgAddSchematicRun) {
110
- context.logger.info(`Package(s) '${packagesToInstall.join(', ')}' was(were) installed.
111
- The run of 'ng-add' schematics for the package(s) is intentionally skipped. You can do the run standalone, later.`);
112
- return schematics_1.noop;
115
+ new Set([packageJsonPath, './package.json']).forEach((filePath) => {
116
+ (0, node_fs_1.mkdirSync)(path.join(process.cwd(), path.dirname(filePath)), { recursive: true });
117
+ (0, node_fs_1.writeFileSync)(path.join(process.cwd(), filePath), tree.readText(filePath));
118
+ });
119
+ context.addTask(new tasks_1.NodePackageInstallTask({
120
+ packageManager: packageManager,
121
+ hideOutput: false,
122
+ quiet: false
123
+ }));
124
+ await (0, rxjs_1.lastValueFrom)(context.engine.executePostTasks());
125
+ const ngAddsToApply = packagesToInstall
126
+ .map((packageName) => ({ packageName, ngAddCollection: getNgAddSchema(packageName, context) }))
127
+ .filter(({ packageName, ngAddCollection }) => {
128
+ if (!ngAddCollection) {
129
+ context.logger.info(`No ng-add schematic found for: '${packageName}'. Skipping ng add for: ${packageName}${versions[packageName] ? ' with version: ' + versions[packageName] : ''}`);
130
+ }
131
+ return !!ngAddCollection;
132
+ })
133
+ .map(({ packageName, ngAddCollection }) => (0, schematics_1.externalSchematic)(packageName, 'ng-add', getOptions(ngAddCollection)));
134
+ return (0, schematics_1.chain)(ngAddsToApply);
113
135
  }
114
- const ngAddsToApply = packagesToInstall
115
- .map((packageName) => ({ packageName, ngAddCollection: getNgAddSchema(packageName, context) }))
116
- .filter(({ packageName, ngAddCollection }) => {
117
- if (!ngAddCollection) {
118
- context.logger.info(`No ng-add schematic found for: '${packageName}'. Skipping ng add for: ${packageName}${versions[packageName] ? ' with version: ' + versions[packageName] : ''}`);
119
- }
120
- return !!ngAddCollection;
121
- })
122
- .map(({ packageName, ngAddCollection }) => (0, schematics_1.externalSchematic)(packageName, 'ng-add', getOptions(ngAddCollection)));
123
- return (0, schematics_1.chain)(ngAddsToApply);
124
- };
136
+ ]);
125
137
  }
126
138
  exports.ngAddPackages = ngAddPackages;
127
139
  /**
128
140
  * Look for the peer dependencies and run ng add on the package requested version
129
- *
130
141
  * @param packages list of the name of the packages needed
131
142
  * @param packageJsonPath path to package json that needs the peer to be resolved
132
143
  * @param type how to install the dependency (dev, peer for a library or default for an application)
@@ -150,42 +161,55 @@ function ngAddPeerDependencyPackages(packages, packageJsonPath, type = dependenc
150
161
  exports.ngAddPeerDependencyPackages = ngAddPeerDependencyPackages;
151
162
  /**
152
163
  * Register the given package in the Angular CLI schematics
153
- *
154
164
  * @param packageJson PackageJson of the project containing the collection to add to the project
155
165
  * @param angularJsonFile Path to the Angular.json file. Will use the workspace root's angular.json if not specified
156
166
  */
157
167
  function registerPackageCollectionSchematics(packageJson, angularJsonFile) {
158
- return (tree) => {
168
+ return (tree, context) => {
159
169
  if (!packageJson.name) {
160
170
  return tree;
161
171
  }
162
- const workspace = (0, index_1.readAngularJson)(tree, angularJsonFile);
172
+ const workspace = (0, index_1.getWorkspaceConfig)(tree, angularJsonFile);
173
+ if (!workspace) {
174
+ context.logger.error('No workspace found');
175
+ return tree;
176
+ }
163
177
  return (0, index_1.writeAngularJson)(tree, (0, index_1.registerCollectionSchematics)(workspace, packageJson.name), angularJsonFile);
164
178
  };
165
179
  }
166
180
  exports.registerPackageCollectionSchematics = registerPackageCollectionSchematics;
167
181
  /**
168
182
  * Setup schematics default params in angular.json
169
- *
170
183
  * @param schematicsDefaultParams default params to setup by schematic
184
+ * @param overrideValue Define if the given value should override the one already defined in the workspace
171
185
  * @param angularJsonFile Path to the Angular.json file. Will use the workspace root's angular.json if not specified
172
186
  */
173
- function setupSchematicsDefaultParams(schematicsDefaultParams, angularJsonFile) {
174
- return (tree) => {
175
- const workspace = (0, index_1.readAngularJson)(tree, angularJsonFile);
187
+ function setupSchematicsDefaultParams(schematicsDefaultParams, overrideValue = false, angularJsonFile) {
188
+ return (tree, context) => {
189
+ const workspace = (0, index_1.getWorkspaceConfig)(tree, angularJsonFile);
190
+ if (!workspace) {
191
+ context.logger.error('No workspace found');
192
+ return tree;
193
+ }
176
194
  workspace.schematics ||= {};
177
195
  Object.entries(schematicsDefaultParams).forEach(([schematicName, defaultParams]) => {
178
- workspace.schematics[schematicName] = {
196
+ workspace.schematics[schematicName] = overrideValue ? {
179
197
  ...workspace.schematics[schematicName],
180
198
  ...defaultParams
199
+ } : {
200
+ ...defaultParams,
201
+ ...workspace.schematics[schematicName]
181
202
  };
182
203
  });
183
204
  Object.values(workspace.projects).forEach((project) => {
184
205
  Object.entries(schematicsDefaultParams).forEach(([schematicName, defaultParams]) => {
185
206
  if (project.schematics?.[schematicName]) {
186
- project.schematics[schematicName] = {
207
+ project.schematics[schematicName] = overrideValue ? {
187
208
  ...project.schematics[schematicName],
188
209
  ...defaultParams
210
+ } : {
211
+ ...defaultParams,
212
+ ...project.schematics[schematicName]
189
213
  };
190
214
  }
191
215
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/rule-factories/ng-add/index.ts"],"names":[],"mappings":";;;AAAA,2DAAqH;AACrH,4DAA0E;AAE1E,2EAA8E;AAC9E,+BAAqC;AAIrC,+CAAqL;AACrL,qCAAuC;AACvC,kCAAkC;AAElC;;;;;;GAMG;AACH,SAAgB,aAAa,CAAC,QAAkB,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 @@
1
1
  import { TaskConfiguration, TaskConfigurationGenerator } from '@angular-devkit/schematics';
2
2
  import { NodePackageTaskOptions } from '@angular-devkit/schematics/tasks/package-manager/options';
3
+ /**
4
+ * Linter options
5
+ */
6
+ export interface LinterOptions {
7
+ /**
8
+ * Indicates if the linter process should succeed even if there are lint errors remaining
9
+ *
10
+ * @default true
11
+ * @deprecated will be removed in v10, please use `continueOnError`
12
+ */
13
+ force?: boolean;
14
+ /**
15
+ * Indicates if the linter process should succeed even if there are lint errors remaining
16
+ *
17
+ * @default true
18
+ */
19
+ continueOnError?: boolean;
20
+ /**
21
+ * If enabled, only errors are reported (--quiet option of ESLint CLI)
22
+ *
23
+ * @default true
24
+ */
25
+ hideWarnings?: boolean;
26
+ }
3
27
  export declare class EslintFixTask implements TaskConfigurationGenerator<NodePackageTaskOptions> {
4
28
  files: string[];
5
29
  workingDirectory?: string | undefined;
6
30
  configFile?: string | undefined;
7
- constructor(files: string[], workingDirectory?: string | undefined, configFile?: string | undefined);
31
+ linterOptions: LinterOptions;
32
+ constructor(files: string[], workingDirectory?: string | undefined, configFile?: string | undefined, options?: LinterOptions);
8
33
  toConfiguration(): TaskConfiguration<NodePackageTaskOptions>;
9
34
  }
10
35
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tasks/eslint/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAC3F,OAAO,EAAmB,sBAAsB,EAAE,MAAM,0DAA0D,CAAC;AAInH,qBAAa,aAAc,YAAW,0BAA0B,CAAC,sBAAsB,CAAC;IACnE,KAAK,EAAE,MAAM,EAAE;IAAS,gBAAgB,CAAC;IAAiB,UAAU,CAAC;gBAArE,KAAK,EAAE,MAAM,EAAE,EAAS,gBAAgB,CAAC,oBAAQ,EAAS,UAAU,CAAC,oBAAQ;IAIzF,eAAe,IAAI,iBAAiB,CAAC,sBAAsB,CAAC;CAapE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tasks/eslint/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAC;AAC3F,OAAO,EAAmB,sBAAsB,EAAE,MAAM,0DAA0D,CAAC;AAGnH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;OAKG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;OAIG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B;;;;OAIG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAED,qBAAa,aAAc,YAAW,0BAA0B,CAAC,sBAAsB,CAAC;IAGnE,KAAK,EAAE,MAAM,EAAE;IAAS,gBAAgB,CAAC;IAAiB,UAAU,CAAC;IAFjF,aAAa,EAAE,aAAa,CAAC;gBAEjB,KAAK,EAAE,MAAM,EAAE,EAAS,gBAAgB,CAAC,oBAAQ,EAAS,UAAU,CAAC,oBAAQ,EAAE,OAAO,CAAC,EAAE,aAAa;IASlH,eAAe,IAAI,iBAAiB,CAAC,sBAAsB,CAAC;CAmBpE"}
@@ -2,15 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EslintFixTask = void 0;
4
4
  const options_1 = require("@angular-devkit/schematics/tasks/package-manager/options");
5
- const path = require("node:path");
6
5
  const package_manager_runner_1 = require("../../utility/package-manager-runner");
7
6
  class EslintFixTask {
8
- constructor(files, workingDirectory, configFile) {
7
+ constructor(files, workingDirectory, configFile, options) {
9
8
  this.files = files;
10
9
  this.workingDirectory = workingDirectory;
11
10
  this.configFile = configFile;
11
+ this.linterOptions = {
12
+ continueOnError: options?.force ?? true,
13
+ force: true,
14
+ hideWarnings: true,
15
+ ...options
16
+ };
12
17
  }
13
- // TODO Find a way to catch linter errors without failing the ng add process
14
18
  toConfiguration() {
15
19
  return {
16
20
  name: options_1.NodePackageName,
@@ -18,8 +22,14 @@ class EslintFixTask {
18
22
  command: 'eslint',
19
23
  quiet: false,
20
24
  workingDirectory: this.workingDirectory,
21
- packageName: 'eslint ' + this.files.join(' ') +
22
- ' --fix' + (this.configFile ? ` --config ${this.configFile} --parser-options=tsconfigRootDir:${path.resolve(process.cwd(), path.dirname(this.configFile))}` : ''),
25
+ packageName: [
26
+ 'eslint',
27
+ ...this.files,
28
+ '--fix',
29
+ ...(this.linterOptions?.hideWarnings ? ['--quiet'] : []),
30
+ ...(this.configFile ? ['--config', this.configFile] : []),
31
+ ...(this.linterOptions?.continueOnError ?? this.linterOptions?.force ? ['|| exit 0'] : [])
32
+ ].join(' '),
23
33
  packageManager: (0, package_manager_runner_1.getPackageManager)()
24
34
  }
25
35
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/tasks/eslint/index.ts"],"names":[],"mappings":";;;AACA,sFAAmH;AACnH,kCAAkC;AAClC,iFAAyE;AAEzE,MAAa,aAAa;IACxB,YAAmB,KAAe,EAAS,gBAAyB,EAAS,UAAmB;QAA7E,UAAK,GAAL,KAAK,CAAU;QAAS,qBAAgB,GAAhB,gBAAgB,CAAS;QAAS,eAAU,GAAV,UAAU,CAAS;IAChG,CAAC;IAED,4EAA4E;IACrE,eAAe;QACpB,OAAO;YACL,IAAI,EAAE,yBAAe;YACrB,OAAO,EAAE;gBACP,OAAO,EAAE,QAAQ;gBACjB,KAAK,EAAE,KAAK;gBACZ,gBAAgB,EAAE,IAAI,CAAC,gBAAgB;gBACvC,WAAW,EAAE,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC;oBAC3C,QAAQ,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,aAAa,IAAI,CAAC,UAAU,qCAAqC,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,IA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;iBAC3F,CAAC,IAAI,CAAC,GAAG,CAAC;gBACX,cAAc,EAAE,IAAA,0CAAiB,GAAE;aACpC;SACF,CAAC;IACJ,CAAC;CACF;AA/BD,sCA+BC"}
@@ -2,7 +2,6 @@ import { SchematicContext } from '@angular-devkit/schematics';
2
2
  import type { WorkspaceSchema, WorkspaceSchematics } from '../interfaces';
3
3
  /**
4
4
  * Register the collection schematic to the workspace
5
- *
6
5
  * @param workspace Workspace to add the collection to
7
6
  * @param collection Collection to add to the workspace schematic collection
8
7
  * @returns the updated workspace
@@ -11,20 +10,18 @@ export declare function registerCollectionSchematics(workspace: WorkspaceSchema,
11
10
  /**
12
11
  * Get default options for a schematic
13
12
  * This will look inside angular.json file for schematics with keys containing wildcards like `*:ng-add` or `@o3r/core:*`
14
- *
15
13
  * @param workspace
16
14
  * @param collection
17
15
  * @param schematicName
18
16
  * @param options
19
17
  * @param options.projectName
20
18
  */
21
- export declare function getDefaultOptionsForSchematic(workspace: WorkspaceSchema | null, collection: string, schematicName: string, options: {
19
+ export declare function getDefaultOptionsForSchematic<T extends WorkspaceSchematics['*:*'] = WorkspaceSchematics['*:*']>(workspace: WorkspaceSchema | null, collection: string, schematicName: string, options?: {
22
20
  projectName?: string | undefined;
23
- }): Record<string, string>;
21
+ }): T;
24
22
  /**
25
23
  * Retrieves the schematics options of a given schematics name
26
24
  * If the schematics name is not found, then the generic options (*:*) will be returned. If the latter is not present the function returns undefined
27
- *
28
25
  * @param config
29
26
  * @param context
30
27
  */
@@ -1 +1 @@
1
- {"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../../src/utility/collection.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AAE1E;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAAC,SAAS,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,GAAG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 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getSchematicOptions = exports.getDefaultOptionsForSchematic = exports.registerCollectionSchematics = void 0;
4
4
  /**
5
5
  * Register the collection schematic to the workspace
6
- *
7
6
  * @param workspace Workspace to add the collection to
8
7
  * @param collection Collection to add to the workspace schematic collection
9
8
  * @returns the updated workspace
@@ -20,7 +19,6 @@ exports.registerCollectionSchematics = registerCollectionSchematics;
20
19
  /**
21
20
  * Get default options for a schematic
22
21
  * This will look inside angular.json file for schematics with keys containing wildcards like `*:ng-add` or `@o3r/core:*`
23
- *
24
22
  * @param workspace
25
23
  * @param collection
26
24
  * @param schematicName
@@ -33,19 +31,23 @@ function getDefaultOptionsForSchematic(workspace, collection, schematicName, opt
33
31
  }
34
32
  const schematicsDefaultParams = [
35
33
  workspace.schematics,
36
- ...options.projectName ? [workspace.projects[options.projectName]?.schematics] : []
34
+ ...options?.projectName ? [workspace.projects[options.projectName]?.schematics] : []
37
35
  ];
38
- return schematicsDefaultParams.flatMap((schematics) => schematics ?
39
- Object.entries(schematics)
40
- .filter(([key, _]) => key === `*:${schematicName}` || key === `${collection}:*`)
41
- .map(([_, value]) => value) :
42
- []).reduce((out, defaultParams) => ({ ...out, ...defaultParams }), {});
36
+ return schematicsDefaultParams.reduce((acc, schematics) => {
37
+ if (!schematics) {
38
+ return acc;
39
+ }
40
+ return Object.entries(schematics)
41
+ .filter(([key, _]) => key === `*:${schematicName}` || key === `${collection}:*` || key === `${collection}:${schematicName}`)
42
+ .sort(([a], [b]) => (a.match(/\*/g)?.length || 0) - (b.match(/\*/g)?.length || 0))
43
+ .map(([_, value]) => value)
44
+ .reduce((config, value) => ({ ...config, ...value }), acc);
45
+ }, {});
43
46
  }
44
47
  exports.getDefaultOptionsForSchematic = getDefaultOptionsForSchematic;
45
48
  /**
46
49
  * Retrieves the schematics options of a given schematics name
47
50
  * If the schematics name is not found, then the generic options (*:*) will be returned. If the latter is not present the function returns undefined
48
- *
49
51
  * @param config
50
52
  * @param context
51
53
  */
@@ -1 +1 @@
1
- {"version":3,"file":"collection.js","sourceRoot":"","sources":["../../../src/utility/collection.ts"],"names":[],"mappings":";;;AAGA;;;;;;GAMG;AACH,SAAgB,4BAA4B,CAAC,SAA0B,EAAE,UAAkB;IACzF,SAAS,CAAC,GAAG,KAAK,EAAE,CAAC;IACrB,SAAS,CAAC,GAAG,CAAC,oBAAoB,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC/D,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,oBAAoB,CAAC,QAAQ,CAAC,UAAU,CAAC,EAAE;QAC5D,SAAS,CAAC,GAAG,CAAC,oBAAoB,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC;KACxD;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAPD,oEAOC;AAED;;;;;;;;;GASG;AACH,SAAgB,6BAA6B,CAAC,SAAiC,EAAE,UAAkB,EAAE,aAAqB,EAAE,OAA6C;IACvK,IAAI,CAAC,SAAS,EAAE;QACd,OAAO,EAAE,CAAC;KACX;IACD,MAAM,uBAAuB,GAAG;QAC9B,SAAS,CAAC,UAAU;QACpB,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC,EAAE;KACpF,CAAC;IACF,OAAO,uBAAuB,CAAC,OAAO,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,CAAC;QACjE,MAAM,CAAC,OAAO,CAAyB,UAAU,CAAC;aAC/C,MAAM,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,KAAK,aAAa,EAAE,IAAI,GAAG,KAAK,GAAG,UAAU,IAAI,CAAC;aAC/E,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,CAAC,CAA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1
+ {"version":3,"file":"component.d.ts","sourceRoot":"","sources":["../../../src/utility/component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAElD,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAA6D,MAAM,OAAO,CAAC;AAGpG;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,SAAU,OAAO,6BAEsB,CAAC;AAEvE;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,SAAU,OAAO,6BAEwB,CAAC;AAE1E;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,qBAAsB,GAAG,gBAAgB,YAAwE,CAAC;AAEjJ;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,qBAAsB,GAAG,gBAAgB,YAEA,CAAC;AAE1E,eAAO,MAAM,iCAAiC,wBAA0G,CAAC;AAEzJ,qBAAa,gBAAiB,SAAQ,KAAK;gBAC7B,aAAa,EAAE,MAAM;CAOlC;AAED;;;;;GAKG;AACH,eAAO,MAAM,oCAAoC,SAAU,IAAI,iBAAiB,MAAM;;;;;CA4DrF,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kDAAkD,YACpD,MAAM,EAAE,KAChB,GAAG,kBAAkB,CAAC,OAAO,CA4B/B,CAAC"}
@@ -4,6 +4,7 @@ exports.addImportsIntoComponentDecoratorTransformerFactory = exports.getO3rCompo
4
4
  const prompt_1 = require("@angular/cli/src/utilities/prompt");
5
5
  const ts = require("typescript");
6
6
  const ast_1 = require("./ast");
7
+ const error_1 = require("./error");
7
8
  /**
8
9
  * Returns true if `node` is the decorator of an Angular component
9
10
  *
@@ -57,21 +58,21 @@ const getO3rComponentInfoOrThrowIfNotFound = (tree, componentPath) => {
57
58
  const sourceFile = ts.createSourceFile(componentPath, tree.readText(componentPath), ts.ScriptTarget.ES2020, true);
58
59
  const ngComponentDeclaration = sourceFile.statements.find((s) => ts.isClassDeclaration(s) && (0, exports.isNgClassComponent)(s));
59
60
  if (!ngComponentDeclaration) {
60
- throw new Error(`No Angular component found in ${componentPath}.`);
61
+ throw new error_1.O3rCliError(`No Angular component found in ${componentPath}.`);
61
62
  }
62
63
  if (!(0, exports.isO3rClassComponent)(ngComponentDeclaration)) {
63
64
  throw new NoOtterComponent(componentPath);
64
65
  }
65
66
  const name = ngComponentDeclaration.name?.escapedText.toString().replace(/Component$/, '');
66
67
  if (!name) {
67
- throw new Error(`The class' name is not specified. Please provide one for the Otter component defined in ${componentPath}.`);
68
+ throw new error_1.O3rCliError(`The class' name is not specified. Please provide one for the Otter component defined in ${componentPath}.`);
68
69
  }
69
70
  const selectorExpression = (0, ast_1.getPropertyFromDecoratorFirstArgument)(ts.getDecorators(ngComponentDeclaration)?.find(exports.isNgClassDecorator), 'selector');
70
71
  const selector = selectorExpression && ts.isStringLiteral(selectorExpression)
71
72
  ? selectorExpression.text
72
73
  : selectorExpression?.getText();
73
74
  if (!selector) {
74
- throw new Error(`The component's selector is not specified. Please provide one for the Otter component defined in ${componentPath}.`);
75
+ throw new error_1.O3rCliError(`The component's selector is not specified. Please provide one for the Otter component defined in ${componentPath}.`);
75
76
  }
76
77
  const standaloneExpression = (0, ast_1.getPropertyFromDecoratorFirstArgument)(ts.getDecorators(ngComponentDeclaration)?.find(exports.isNgClassDecorator), 'standalone');
77
78
  const standalone = standaloneExpression?.kind === ts.SyntaxKind.TrueKeyword;
@@ -1 +1 @@
1
- {"version":3,"file":"component.js","sourceRoot":"","sources":["../../../src/utility/component.ts"],"names":[],"mappings":";;;AACA,8DAAoE;AACpE,iCAAiC;AACjC,+BAAoG;AAEpG;;;;GAIG;AACI,MAAM,kBAAkB,GAAG,CAAC,IAAa,EAA4B,EAAE,CAC5E,IAAA,wBAAkB,EAAC,IAAI,CAAC;OACrB,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,WAAW,CAAC,QAAQ,EAAE,KAAK,WAAW,CAAC;AAF1D,QAAA,kBAAkB,sBAEwC;AAEvE;;;;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ACL,CAAC;iBACH,EAAE,IAAI,CAAC;aACT,CACF,CACF,CAAC;SACH;QACD,OAAO,EAAE,CAAC,cAAc,CAAC,IAAI,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC;IAC7C,CAAC,CAAC;IACF,OAAO,EAAE,CAAC,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;AACvC,CAAC,CAAC;AA9BW,QAAA,kDAAkD,sDA8B7D"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Get all environment information
3
+ * Could be useful for debugging issue
4
+ */
5
+ export declare const getEnvironmentInfo: () => {
6
+ os: {
7
+ architecture: string;
8
+ platform: NodeJS.Platform;
9
+ version: string;
10
+ };
11
+ node: {
12
+ version: string | null;
13
+ };
14
+ packageManager: {
15
+ name: import("./package-manager-runner").SupportedPackageManagers;
16
+ version: string | undefined;
17
+ };
18
+ otter: {
19
+ version: string | undefined;
20
+ };
21
+ };
22
+ /**
23
+ * Stringify the result of `getEnvironmentInfo`
24
+ * @see getEnvironmentInfo
25
+ */
26
+ export declare const getEnvironmentInfoStringify: () => string;
27
+ //# sourceMappingURL=environment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../../../src/utility/environment.ts"],"names":[],"mappings":"AAKA;;;GAGG;AACH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;CAmB9B,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,2BAA2B,cAWvC,CAAC"}