@webpieces/dev-config 0.2.41 → 0.2.42
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/executors/help/executor.js +11 -0
- package/executors/help/executor.js.map +1 -1
- package/executors/help/executor.ts +11 -0
- package/package.json +1 -1
- package/plugin.js +34 -14
|
@@ -36,6 +36,17 @@ async function helpExecutor(options, context) {
|
|
|
36
36
|
console.log(' nx affected --target=validate-no-file-import-cycles # Check all affected projects');
|
|
37
37
|
console.log(' nx run-many --target=validate-no-file-import-cycles --all # Check all projects');
|
|
38
38
|
console.log('');
|
|
39
|
+
console.log(' Per-project CI target (lint + build + test):');
|
|
40
|
+
console.log(' nx run <project>:ci # Run lint, build, test together');
|
|
41
|
+
console.log(' nx run-many --target=ci --all # Run ci for all projects');
|
|
42
|
+
console.log('');
|
|
43
|
+
console.log(' Execution order (test waits for build via targetDefaults):');
|
|
44
|
+
console.log(' ci (nx:noop)');
|
|
45
|
+
console.log(' ├── lint ─────────────────┐');
|
|
46
|
+
console.log(' ├── build ────────────────┼── run in parallel');
|
|
47
|
+
console.log(' └── test ─────────────────┘');
|
|
48
|
+
console.log(' └── depends on build (waits)');
|
|
49
|
+
console.log('');
|
|
39
50
|
console.log(`${GREEN}💡 Quick start:${RESET}`);
|
|
40
51
|
console.log(` ${BOLD}npm run arch:generate${RESET} # Generate the graph first`);
|
|
41
52
|
console.log(` ${BOLD}npm run arch:validate-complete${RESET} # Run complete validation`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/tooling/dev-config/executors/help/executor.ts"],"names":[],"mappings":";;AAIA,+
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../packages/tooling/dev-config/executors/help/executor.ts"],"names":[],"mappings":";;AAIA,+BAwDC;AAxDc,KAAK,UAAU,YAAY,CACtC,OAA4B,EAC5B,OAAwB;IAExB,mBAAmB;IACnB,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AC;IAC3F,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAEhB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;AAC7B,CAAC","sourcesContent":["import type { ExecutorContext } from '@nx/devkit';\n\nexport interface HelpExecutorOptions {}\n\nexport default async function helpExecutor(\n options: HelpExecutorOptions,\n context: ExecutorContext\n): Promise<{ success: true }> {\n // ANSI color codes\n const GREEN = '\\x1b[32m\\x1b[1m';\n const BOLD = '\\x1b[1m';\n const RESET = '\\x1b[0m';\n\n console.log('');\n console.log(`${GREEN}💡 @webpieces/dev-config - Available Commands${RESET}`);\n console.log('');\n console.log(`${BOLD}📝 Available npm scripts (convenient shortcuts):${RESET}`);\n console.log('');\n console.log(' Architecture graph:');\n console.log(' npm run arch:generate # Generate dependency graph');\n console.log(' npm run arch:visualize # Visualize dependency graph');\n console.log('');\n console.log(' Validation:');\n console.log(' npm run arch:validate # Quick validation (no-cycles + no-skiplevel-deps)');\n console.log(' npm run arch:validate-all # Full arch validation (+ unchanged check)');\n console.log(' npm run arch:check-circular # Check all projects for circular deps');\n console.log(' npm run arch:check-circular-affected # Check affected projects only');\n console.log(' npm run arch:validate-complete # Complete validation (arch + circular)');\n console.log('');\n console.log(`${BOLD}📝 Available Nx targets:${RESET}`);\n console.log('');\n console.log(' Workspace-level architecture validation:');\n console.log(' nx run architecture:generate # Generate dependency graph');\n console.log(' nx run architecture:visualize # Visualize dependency graph');\n console.log(' nx run architecture:validate-no-architecture-cycles # Check for circular project dependencies');\n console.log(' nx run architecture:validate-no-skiplevel-deps # Check for redundant dependencies');\n console.log(' nx run architecture:validate-architecture-unchanged # Validate against blessed graph');\n console.log('');\n console.log(' Per-project file import cycle checking:');\n console.log(' nx run <project>:validate-no-file-import-cycles # Check project for file import cycles');\n console.log(' nx affected --target=validate-no-file-import-cycles # Check all affected projects');\n console.log(' nx run-many --target=validate-no-file-import-cycles --all # Check all projects');\n console.log('');\n console.log(' Per-project CI target (lint + build + test):');\n console.log(' nx run <project>:ci # Run lint, build, test together');\n console.log(' nx run-many --target=ci --all # Run ci for all projects');\n console.log('');\n console.log(' Execution order (test waits for build via targetDefaults):');\n console.log(' ci (nx:noop)');\n console.log(' ├── lint ─────────────────┐');\n console.log(' ├── build ────────────────┼── run in parallel');\n console.log(' └── test ─────────────────┘');\n console.log(' └── depends on build (waits)');\n console.log('');\n console.log(`${GREEN}💡 Quick start:${RESET}`);\n console.log(` ${BOLD}npm run arch:generate${RESET} # Generate the graph first`);\n console.log(` ${BOLD}npm run arch:validate-complete${RESET} # Run complete validation`);\n console.log('');\n\n return { success: true };\n}\n"]}
|
|
@@ -41,6 +41,17 @@ export default async function helpExecutor(
|
|
|
41
41
|
console.log(' nx affected --target=validate-no-file-import-cycles # Check all affected projects');
|
|
42
42
|
console.log(' nx run-many --target=validate-no-file-import-cycles --all # Check all projects');
|
|
43
43
|
console.log('');
|
|
44
|
+
console.log(' Per-project CI target (lint + build + test):');
|
|
45
|
+
console.log(' nx run <project>:ci # Run lint, build, test together');
|
|
46
|
+
console.log(' nx run-many --target=ci --all # Run ci for all projects');
|
|
47
|
+
console.log('');
|
|
48
|
+
console.log(' Execution order (test waits for build via targetDefaults):');
|
|
49
|
+
console.log(' ci (nx:noop)');
|
|
50
|
+
console.log(' ├── lint ─────────────────┐');
|
|
51
|
+
console.log(' ├── build ────────────────┼── run in parallel');
|
|
52
|
+
console.log(' └── test ─────────────────┘');
|
|
53
|
+
console.log(' └── depends on build (waits)');
|
|
54
|
+
console.log('');
|
|
44
55
|
console.log(`${GREEN}💡 Quick start:${RESET}`);
|
|
45
56
|
console.log(` ${BOLD}npm run arch:generate${RESET} # Generate the graph first`);
|
|
46
57
|
console.log(` ${BOLD}npm run arch:validate-complete${RESET} # Run complete validation`);
|
package/package.json
CHANGED
package/plugin.js
CHANGED
|
@@ -70,8 +70,8 @@ async function createNodesFunction(projectFiles, options, context) {
|
|
|
70
70
|
const results = [];
|
|
71
71
|
// Add workspace-level architecture targets
|
|
72
72
|
addArchitectureProject(results, projectFiles, opts, context);
|
|
73
|
-
// Add per-project circular-deps
|
|
74
|
-
|
|
73
|
+
// Add per-project targets (circular-deps, ci)
|
|
74
|
+
addPerProjectTargets(results, projectFiles, opts, context);
|
|
75
75
|
return results;
|
|
76
76
|
}
|
|
77
77
|
function addArchitectureProject(results, projectFiles, opts, context) {
|
|
@@ -97,28 +97,33 @@ function addArchitectureProject(results, projectFiles, opts, context) {
|
|
|
97
97
|
results.push([firstProjectFile, result]);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
function
|
|
101
|
-
if (!opts.circularDeps.enabled)
|
|
102
|
-
return;
|
|
100
|
+
function addPerProjectTargets(results, projectFiles, opts, context) {
|
|
103
101
|
for (const projectFile of projectFiles) {
|
|
104
102
|
if (!projectFile.endsWith('project.json'))
|
|
105
103
|
continue;
|
|
106
104
|
const projectRoot = (0, path_1.dirname)(projectFile);
|
|
107
105
|
if (projectRoot === '.')
|
|
108
106
|
continue;
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
107
|
+
const targets = {};
|
|
108
|
+
// Add circular-deps target if enabled and src exists
|
|
109
|
+
if (opts.circularDeps.enabled) {
|
|
110
|
+
if (!isExcluded(projectRoot, opts.circularDeps.excludePatterns)) {
|
|
111
|
+
const srcDir = (0, path_1.join)(context.workspaceRoot, projectRoot, 'src');
|
|
112
|
+
if ((0, fs_1.existsSync)(srcDir)) {
|
|
113
|
+
const targetName = opts.circularDeps.targetName;
|
|
114
|
+
targets[targetName] = createCircularDepsTarget(projectRoot, targetName);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
// Add ci target - composite target that runs lint, build, test in parallel
|
|
119
|
+
// (with test depending on build via targetDefaults)
|
|
120
|
+
targets['ci'] = createCiTarget();
|
|
121
|
+
if (Object.keys(targets).length === 0)
|
|
113
122
|
continue;
|
|
114
|
-
const targetName = opts.circularDeps.targetName;
|
|
115
|
-
const checkCircularDepsTarget = createCircularDepsTarget(projectRoot, targetName);
|
|
116
123
|
const result = {
|
|
117
124
|
projects: {
|
|
118
125
|
[projectRoot]: {
|
|
119
|
-
targets
|
|
120
|
-
[targetName]: checkCircularDepsTarget,
|
|
121
|
-
},
|
|
126
|
+
targets,
|
|
122
127
|
},
|
|
123
128
|
},
|
|
124
129
|
};
|
|
@@ -323,6 +328,21 @@ function createValidateCompleteTarget(validationTargets) {
|
|
|
323
328
|
},
|
|
324
329
|
};
|
|
325
330
|
}
|
|
331
|
+
/**
|
|
332
|
+
* Create per-project ci target - Gradle-style composite target
|
|
333
|
+
* Runs lint, build, and test in parallel (with test waiting for build via targetDefaults)
|
|
334
|
+
*/
|
|
335
|
+
function createCiTarget() {
|
|
336
|
+
return {
|
|
337
|
+
executor: 'nx:noop',
|
|
338
|
+
cache: true,
|
|
339
|
+
dependsOn: ['lint', 'build', 'test'],
|
|
340
|
+
metadata: {
|
|
341
|
+
technologies: ['nx'],
|
|
342
|
+
description: 'Run all CI checks: lint, build, and test (Gradle-style composite target)',
|
|
343
|
+
},
|
|
344
|
+
};
|
|
345
|
+
}
|
|
326
346
|
function createHelpTarget() {
|
|
327
347
|
return {
|
|
328
348
|
executor: '@webpieces/dev-config:help',
|