@webpieces/dev-config 0.2.38 → 0.2.40
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/architecture/executors/validate-architecture-unchanged/executor.js +166 -2
- package/architecture/executors/validate-architecture-unchanged/executor.js.map +1 -1
- package/architecture/executors/validate-architecture-unchanged/executor.ts +172 -2
- package/architecture/executors/validate-new-methods/executor.d.ts +22 -0
- package/architecture/executors/validate-new-methods/executor.js +351 -0
- package/architecture/executors/validate-new-methods/executor.js.map +1 -0
- package/architecture/executors/validate-new-methods/executor.ts +408 -0
- package/architecture/executors/validate-new-methods/schema.json +14 -0
- package/eslint-plugin/rules/enforce-architecture.js +12 -3
- package/eslint-plugin/rules/enforce-architecture.js.map +1 -1
- package/eslint-plugin/rules/enforce-architecture.ts +12 -3
- package/executors.json +5 -0
- package/package.json +1 -1
- package/plugin.js +43 -0
package/plugin.js
CHANGED
|
@@ -34,6 +34,8 @@ const DEFAULT_OPTIONS = {
|
|
|
34
34
|
noCycles: true,
|
|
35
35
|
noSkipLevelDeps: true,
|
|
36
36
|
architectureUnchanged: true,
|
|
37
|
+
validatePackageJson: true,
|
|
38
|
+
validateNewMethods: true,
|
|
37
39
|
},
|
|
38
40
|
features: {
|
|
39
41
|
generate: true,
|
|
@@ -157,6 +159,12 @@ function createWorkspaceTargetsWithoutPrefix(opts) {
|
|
|
157
159
|
if (opts.workspace.validations.noSkipLevelDeps) {
|
|
158
160
|
targets['validate-no-skiplevel-deps'] = createValidateNoSkipLevelTarget();
|
|
159
161
|
}
|
|
162
|
+
if (opts.workspace.validations.validatePackageJson) {
|
|
163
|
+
targets['validate-packagejson'] = createValidatePackageJsonTarget();
|
|
164
|
+
}
|
|
165
|
+
if (opts.workspace.validations.validateNewMethods) {
|
|
166
|
+
targets['validate-new-methods'] = createValidateNewMethodsTarget();
|
|
167
|
+
}
|
|
160
168
|
// Add validate-complete target that runs all validations
|
|
161
169
|
const validationTargets = [];
|
|
162
170
|
if (opts.workspace.validations.noCycles) {
|
|
@@ -168,6 +176,12 @@ function createWorkspaceTargetsWithoutPrefix(opts) {
|
|
|
168
176
|
if (opts.workspace.validations.noSkipLevelDeps) {
|
|
169
177
|
validationTargets.push('validate-no-skiplevel-deps');
|
|
170
178
|
}
|
|
179
|
+
if (opts.workspace.validations.validatePackageJson) {
|
|
180
|
+
validationTargets.push('validate-packagejson');
|
|
181
|
+
}
|
|
182
|
+
if (opts.workspace.validations.validateNewMethods) {
|
|
183
|
+
validationTargets.push('validate-new-methods');
|
|
184
|
+
}
|
|
171
185
|
if (validationTargets.length > 0) {
|
|
172
186
|
targets['validate-complete'] = createValidateCompleteTarget(validationTargets);
|
|
173
187
|
}
|
|
@@ -198,6 +212,12 @@ function createWorkspaceTargets(opts) {
|
|
|
198
212
|
if (opts.workspace.validations.noSkipLevelDeps) {
|
|
199
213
|
targets[`${prefix}validate-no-skiplevel-deps`] = createValidateNoSkipLevelTarget();
|
|
200
214
|
}
|
|
215
|
+
if (opts.workspace.validations.validatePackageJson) {
|
|
216
|
+
targets[`${prefix}validate-packagejson`] = createValidatePackageJsonTarget();
|
|
217
|
+
}
|
|
218
|
+
if (opts.workspace.validations.validateNewMethods) {
|
|
219
|
+
targets[`${prefix}validate-new-methods`] = createValidateNewMethodsTarget();
|
|
220
|
+
}
|
|
201
221
|
return targets;
|
|
202
222
|
}
|
|
203
223
|
function createGenerateTarget(graphPath) {
|
|
@@ -269,6 +289,29 @@ function createValidateNoSkipLevelTarget() {
|
|
|
269
289
|
},
|
|
270
290
|
};
|
|
271
291
|
}
|
|
292
|
+
function createValidatePackageJsonTarget() {
|
|
293
|
+
return {
|
|
294
|
+
executor: '@webpieces/dev-config:validate-packagejson',
|
|
295
|
+
cache: true,
|
|
296
|
+
inputs: ['default'],
|
|
297
|
+
metadata: {
|
|
298
|
+
technologies: ['nx'],
|
|
299
|
+
description: 'Validate package.json dependencies match project.json build dependencies',
|
|
300
|
+
},
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
function createValidateNewMethodsTarget() {
|
|
304
|
+
return {
|
|
305
|
+
executor: '@webpieces/dev-config:validate-new-methods',
|
|
306
|
+
cache: false, // Don't cache - depends on git state
|
|
307
|
+
inputs: ['default'],
|
|
308
|
+
options: { max: 30 },
|
|
309
|
+
metadata: {
|
|
310
|
+
technologies: ['nx'],
|
|
311
|
+
description: 'Validate new methods do not exceed max line count (only runs in affected mode)',
|
|
312
|
+
},
|
|
313
|
+
};
|
|
314
|
+
}
|
|
272
315
|
function createValidateCompleteTarget(validationTargets) {
|
|
273
316
|
return {
|
|
274
317
|
executor: 'nx:noop',
|