@webpieces/dev-config 0.2.17 → 0.2.21
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/generate/executor.d.ts +17 -0
- package/architecture/executors/generate/executor.js +67 -0
- package/architecture/executors/generate/executor.js.map +1 -0
- package/architecture/executors/generate/executor.ts +83 -0
- package/architecture/executors/generate/schema.json +14 -0
- package/architecture/executors/validate-architecture-unchanged/executor.d.ts +17 -0
- package/architecture/executors/validate-architecture-unchanged/executor.js +65 -0
- package/architecture/executors/validate-architecture-unchanged/executor.js.map +1 -0
- package/architecture/executors/validate-architecture-unchanged/executor.ts +81 -0
- package/architecture/executors/validate-architecture-unchanged/schema.json +14 -0
- package/architecture/executors/validate-no-cycles/executor.d.ts +16 -0
- package/architecture/executors/validate-no-cycles/executor.js +48 -0
- package/architecture/executors/validate-no-cycles/executor.js.map +1 -0
- package/architecture/executors/validate-no-cycles/executor.ts +60 -0
- package/architecture/executors/validate-no-cycles/schema.json +8 -0
- package/architecture/executors/validate-no-skiplevel-deps/executor.d.ts +19 -0
- package/architecture/executors/validate-no-skiplevel-deps/executor.js +227 -0
- package/architecture/executors/validate-no-skiplevel-deps/executor.js.map +1 -0
- package/architecture/executors/validate-no-skiplevel-deps/executor.ts +267 -0
- package/architecture/executors/validate-no-skiplevel-deps/schema.json +8 -0
- package/architecture/executors/visualize/executor.d.ts +17 -0
- package/architecture/executors/visualize/executor.js +49 -0
- package/architecture/executors/visualize/executor.js.map +1 -0
- package/architecture/executors/visualize/executor.ts +63 -0
- package/architecture/executors/visualize/schema.json +14 -0
- package/architecture/index.d.ts +19 -0
- package/architecture/index.js +23 -0
- package/architecture/index.js.map +1 -0
- package/architecture/index.ts +20 -0
- package/architecture/lib/graph-comparator.d.ts +39 -0
- package/architecture/lib/graph-comparator.js +100 -0
- package/architecture/lib/graph-comparator.js.map +1 -0
- package/architecture/lib/graph-comparator.ts +141 -0
- package/architecture/lib/graph-generator.d.ts +19 -0
- package/architecture/lib/graph-generator.js +88 -0
- package/architecture/lib/graph-generator.js.map +1 -0
- package/architecture/lib/graph-generator.ts +102 -0
- package/architecture/lib/graph-loader.d.ts +31 -0
- package/architecture/lib/graph-loader.js +70 -0
- package/architecture/lib/graph-loader.js.map +1 -0
- package/architecture/lib/graph-loader.ts +82 -0
- package/architecture/lib/graph-sorter.d.ts +37 -0
- package/architecture/lib/graph-sorter.js +110 -0
- package/architecture/lib/graph-sorter.js.map +1 -0
- package/architecture/lib/graph-sorter.ts +137 -0
- package/architecture/lib/graph-visualizer.d.ts +29 -0
- package/architecture/lib/graph-visualizer.js +209 -0
- package/architecture/lib/graph-visualizer.js.map +1 -0
- package/architecture/lib/graph-visualizer.ts +222 -0
- package/architecture/lib/package-validator.d.ts +38 -0
- package/architecture/lib/package-validator.js +105 -0
- package/architecture/lib/package-validator.js.map +1 -0
- package/architecture/lib/package-validator.ts +144 -0
- package/config/eslint/base.mjs +6 -0
- package/eslint-plugin/__tests__/max-file-lines.test.ts +207 -0
- package/eslint-plugin/__tests__/max-method-lines.test.ts +258 -0
- package/eslint-plugin/__tests__/no-unmanaged-exceptions.test.ts +359 -0
- package/eslint-plugin/index.d.ts +11 -0
- package/eslint-plugin/index.js +15 -0
- package/eslint-plugin/index.js.map +1 -1
- package/eslint-plugin/index.ts +15 -0
- package/eslint-plugin/rules/enforce-architecture.d.ts +15 -0
- package/eslint-plugin/rules/enforce-architecture.js +406 -0
- package/eslint-plugin/rules/enforce-architecture.js.map +1 -0
- package/eslint-plugin/rules/enforce-architecture.ts +469 -0
- package/eslint-plugin/rules/max-file-lines.d.ts +12 -0
- package/eslint-plugin/rules/max-file-lines.js +257 -0
- package/eslint-plugin/rules/max-file-lines.js.map +1 -0
- package/eslint-plugin/rules/max-file-lines.ts +272 -0
- package/eslint-plugin/rules/max-method-lines.d.ts +12 -0
- package/eslint-plugin/rules/max-method-lines.js +240 -0
- package/eslint-plugin/rules/max-method-lines.js.map +1 -0
- package/eslint-plugin/rules/max-method-lines.ts +287 -0
- package/eslint-plugin/rules/no-unmanaged-exceptions.d.ts +22 -0
- package/eslint-plugin/rules/no-unmanaged-exceptions.js +605 -0
- package/eslint-plugin/rules/no-unmanaged-exceptions.js.map +1 -0
- package/eslint-plugin/rules/no-unmanaged-exceptions.ts +621 -0
- package/executors.json +29 -0
- package/package.json +13 -3
- package/plugins/circular-deps/index.d.ts +8 -0
- package/plugins/circular-deps/index.js +14 -0
- package/plugins/circular-deps/index.js.map +1 -0
- package/plugins/circular-deps/index.ts +9 -0
- package/plugins/circular-deps/plugin.d.ts +32 -0
- package/plugins/circular-deps/plugin.js +73 -0
- package/plugins/circular-deps/plugin.js.map +1 -0
- package/plugins/circular-deps/plugin.ts +83 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Circular Dependencies Plugin
|
|
4
|
+
*
|
|
5
|
+
* Nx inference plugin that automatically adds check-circular-deps target
|
|
6
|
+
* to all projects with a src/ directory.
|
|
7
|
+
*/
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
exports.default = void 0;
|
|
10
|
+
const tslib_1 = require("tslib");
|
|
11
|
+
tslib_1.__exportStar(require("./plugin"), exports);
|
|
12
|
+
var plugin_1 = require("./plugin");
|
|
13
|
+
Object.defineProperty(exports, "default", { enumerable: true, get: function () { return tslib_1.__importDefault(plugin_1).default; } });
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/tooling/dev-config/plugins/circular-deps/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;AAEH,mDAAyB;AACzB,mCAAmC;AAA1B,0HAAA,OAAO,OAAA","sourcesContent":["/**\n * Circular Dependencies Plugin\n *\n * Nx inference plugin that automatically adds check-circular-deps target\n * to all projects with a src/ directory.\n */\n\nexport * from './plugin';\nexport { default } from './plugin';\n"]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nx Inference Plugin for Circular Dependency Checking
|
|
3
|
+
*
|
|
4
|
+
* This plugin automatically creates a "check-circular-deps" target for ANY project
|
|
5
|
+
* that has a src/ directory, similar to how @nx/eslint/plugin creates lint targets.
|
|
6
|
+
*
|
|
7
|
+
* Benefits:
|
|
8
|
+
* - Zero configuration per project
|
|
9
|
+
* - Works for ALL projects (services + libraries)
|
|
10
|
+
* - New projects automatically get the target
|
|
11
|
+
* - `nx affected --target=check-circular-deps` works on everything
|
|
12
|
+
*
|
|
13
|
+
* Usage:
|
|
14
|
+
* Add to nx.json plugins array:
|
|
15
|
+
* {
|
|
16
|
+
* "plugins": ["@webpieces/dev-config/plugins/circular-deps"]
|
|
17
|
+
* }
|
|
18
|
+
*
|
|
19
|
+
* Then run:
|
|
20
|
+
* - nx run <project>:check-circular-deps
|
|
21
|
+
* - nx affected --target=check-circular-deps
|
|
22
|
+
*/
|
|
23
|
+
import type { CreateNodesV2 } from '@nx/devkit';
|
|
24
|
+
/**
|
|
25
|
+
* Nx V2 Inference Plugin
|
|
26
|
+
* Matches project.json files and creates check-circular-deps target
|
|
27
|
+
*/
|
|
28
|
+
export declare const createNodesV2: CreateNodesV2;
|
|
29
|
+
declare const _default: {
|
|
30
|
+
createNodesV2: CreateNodesV2;
|
|
31
|
+
};
|
|
32
|
+
export default _default;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Nx Inference Plugin for Circular Dependency Checking
|
|
4
|
+
*
|
|
5
|
+
* This plugin automatically creates a "check-circular-deps" target for ANY project
|
|
6
|
+
* that has a src/ directory, similar to how @nx/eslint/plugin creates lint targets.
|
|
7
|
+
*
|
|
8
|
+
* Benefits:
|
|
9
|
+
* - Zero configuration per project
|
|
10
|
+
* - Works for ALL projects (services + libraries)
|
|
11
|
+
* - New projects automatically get the target
|
|
12
|
+
* - `nx affected --target=check-circular-deps` works on everything
|
|
13
|
+
*
|
|
14
|
+
* Usage:
|
|
15
|
+
* Add to nx.json plugins array:
|
|
16
|
+
* {
|
|
17
|
+
* "plugins": ["@webpieces/dev-config/plugins/circular-deps"]
|
|
18
|
+
* }
|
|
19
|
+
*
|
|
20
|
+
* Then run:
|
|
21
|
+
* - nx run <project>:check-circular-deps
|
|
22
|
+
* - nx affected --target=check-circular-deps
|
|
23
|
+
*/
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.createNodesV2 = void 0;
|
|
26
|
+
const path_1 = require("path");
|
|
27
|
+
const fs_1 = require("fs");
|
|
28
|
+
/**
|
|
29
|
+
* Nx V2 Inference Plugin
|
|
30
|
+
* Matches project.json files and creates check-circular-deps target
|
|
31
|
+
*/
|
|
32
|
+
exports.createNodesV2 = [
|
|
33
|
+
// Pattern to match: look for project.json files
|
|
34
|
+
'**/project.json',
|
|
35
|
+
// Inference function
|
|
36
|
+
async (projectFiles, _options, context) => {
|
|
37
|
+
const results = [];
|
|
38
|
+
for (const projectFile of projectFiles) {
|
|
39
|
+
const projectRoot = (0, path_1.dirname)(projectFile);
|
|
40
|
+
const srcDir = (0, path_1.join)(context.workspaceRoot, projectRoot, 'src');
|
|
41
|
+
// Only create target if project has a src/ directory
|
|
42
|
+
if ((0, fs_1.existsSync)(srcDir)) {
|
|
43
|
+
const checkCircularDepsTarget = {
|
|
44
|
+
executor: 'nx:run-commands',
|
|
45
|
+
cache: true,
|
|
46
|
+
inputs: ['default'],
|
|
47
|
+
outputs: [],
|
|
48
|
+
options: {
|
|
49
|
+
command: 'npx madge --circular --extensions ts,tsx src',
|
|
50
|
+
cwd: projectRoot,
|
|
51
|
+
},
|
|
52
|
+
metadata: {
|
|
53
|
+
technologies: ['madge'],
|
|
54
|
+
description: 'Check for circular dependencies using madge',
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
const result = {
|
|
58
|
+
projects: {
|
|
59
|
+
[projectRoot]: {
|
|
60
|
+
targets: {
|
|
61
|
+
'check-circular-deps': checkCircularDepsTarget,
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
results.push([projectFile, result]);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return results;
|
|
70
|
+
},
|
|
71
|
+
];
|
|
72
|
+
exports.default = { createNodesV2: exports.createNodesV2 };
|
|
73
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../../../../../packages/tooling/dev-config/plugins/circular-deps/plugin.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;;;AAEH,+BAAqC;AACrC,2BAAgC;AAGhC;;;GAGG;AACU,QAAA,aAAa,GAAkB;IACxC,gDAAgD;IAChD,iBAAiB;IAEjB,qBAAqB;IACrB,KAAK,EACD,YAA+B,EAC/B,QAAiB,EACjB,OAA6B,EACD,EAAE;QAC9B,MAAM,OAAO,GAAgD,EAAE,CAAC;QAEhE,KAAK,MAAM,WAAW,IAAI,YAAY,EAAE,CAAC;YACrC,MAAM,WAAW,GAAG,IAAA,cAAO,EAAC,WAAW,CAAC,CAAC;YACzC,MAAM,MAAM,GAAG,IAAA,WAAI,EAAC,OAAO,CAAC,aAAa,EAAE,WAAW,EAAE,KAAK,CAAC,CAAC;YAE/D,qDAAqD;YACrD,IAAI,IAAA,eAAU,EAAC,MAAM,CAAC,EAAE,CAAC;gBACrB,MAAM,uBAAuB,GAAG;oBAC5B,QAAQ,EAAE,iBAAiB;oBAC3B,KAAK,EAAE,IAAI;oBACX,MAAM,EAAE,CAAC,SAAS,CAAC;oBACnB,OAAO,EAAE,EAAc;oBACvB,OAAO,EAAE;wBACL,OAAO,EAAE,8CAA8C;wBACvD,GAAG,EAAE,WAAW;qBACnB;oBACD,QAAQ,EAAE;wBACN,YAAY,EAAE,CAAC,OAAO,CAAC;wBACvB,WAAW,EAAE,6CAA6C;qBAC7D;iBACJ,CAAC;gBAEF,MAAM,MAAM,GAAsB;oBAC9B,QAAQ,EAAE;wBACN,CAAC,WAAW,CAAC,EAAE;4BACX,OAAO,EAAE;gCACL,qBAAqB,EAAE,uBAAuB;6BACjD;yBACJ;qBACJ;iBACJ,CAAC;gBAEF,OAAO,CAAC,IAAI,CAAC,CAAC,WAAW,EAAE,MAAM,CAAU,CAAC,CAAC;YACjD,CAAC;QACL,CAAC;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ,CAAC;AAEF,kBAAe,EAAE,aAAa,EAAb,qBAAa,EAAE,CAAC","sourcesContent":["/**\n * Nx Inference Plugin for Circular Dependency Checking\n *\n * This plugin automatically creates a \"check-circular-deps\" target for ANY project\n * that has a src/ directory, similar to how @nx/eslint/plugin creates lint targets.\n *\n * Benefits:\n * - Zero configuration per project\n * - Works for ALL projects (services + libraries)\n * - New projects automatically get the target\n * - `nx affected --target=check-circular-deps` works on everything\n *\n * Usage:\n * Add to nx.json plugins array:\n * {\n * \"plugins\": [\"@webpieces/dev-config/plugins/circular-deps\"]\n * }\n *\n * Then run:\n * - nx run <project>:check-circular-deps\n * - nx affected --target=check-circular-deps\n */\n\nimport { dirname, join } from 'path';\nimport { existsSync } from 'fs';\nimport type { CreateNodesV2, CreateNodesContextV2, CreateNodesResultV2, CreateNodesResult } from '@nx/devkit';\n\n/**\n * Nx V2 Inference Plugin\n * Matches project.json files and creates check-circular-deps target\n */\nexport const createNodesV2: CreateNodesV2 = [\n // Pattern to match: look for project.json files\n '**/project.json',\n\n // Inference function\n async (\n projectFiles: readonly string[],\n _options: unknown,\n context: CreateNodesContextV2\n ): Promise<CreateNodesResultV2> => {\n const results: Array<readonly [string, CreateNodesResult]> = [];\n\n for (const projectFile of projectFiles) {\n const projectRoot = dirname(projectFile);\n const srcDir = join(context.workspaceRoot, projectRoot, 'src');\n\n // Only create target if project has a src/ directory\n if (existsSync(srcDir)) {\n const checkCircularDepsTarget = {\n executor: 'nx:run-commands',\n cache: true,\n inputs: ['default'],\n outputs: [] as string[],\n options: {\n command: 'npx madge --circular --extensions ts,tsx src',\n cwd: projectRoot,\n },\n metadata: {\n technologies: ['madge'],\n description: 'Check for circular dependencies using madge',\n },\n };\n\n const result: CreateNodesResult = {\n projects: {\n [projectRoot]: {\n targets: {\n 'check-circular-deps': checkCircularDepsTarget,\n },\n },\n },\n };\n\n results.push([projectFile, result] as const);\n }\n }\n\n return results;\n },\n];\n\nexport default { createNodesV2 };\n"]}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nx Inference Plugin for Circular Dependency Checking
|
|
3
|
+
*
|
|
4
|
+
* This plugin automatically creates a "check-circular-deps" target for ANY project
|
|
5
|
+
* that has a src/ directory, similar to how @nx/eslint/plugin creates lint targets.
|
|
6
|
+
*
|
|
7
|
+
* Benefits:
|
|
8
|
+
* - Zero configuration per project
|
|
9
|
+
* - Works for ALL projects (services + libraries)
|
|
10
|
+
* - New projects automatically get the target
|
|
11
|
+
* - `nx affected --target=check-circular-deps` works on everything
|
|
12
|
+
*
|
|
13
|
+
* Usage:
|
|
14
|
+
* Add to nx.json plugins array:
|
|
15
|
+
* {
|
|
16
|
+
* "plugins": ["@webpieces/dev-config/plugins/circular-deps"]
|
|
17
|
+
* }
|
|
18
|
+
*
|
|
19
|
+
* Then run:
|
|
20
|
+
* - nx run <project>:check-circular-deps
|
|
21
|
+
* - nx affected --target=check-circular-deps
|
|
22
|
+
*/
|
|
23
|
+
|
|
24
|
+
import { dirname, join } from 'path';
|
|
25
|
+
import { existsSync } from 'fs';
|
|
26
|
+
import type { CreateNodesV2, CreateNodesContextV2, CreateNodesResultV2, CreateNodesResult } from '@nx/devkit';
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Nx V2 Inference Plugin
|
|
30
|
+
* Matches project.json files and creates check-circular-deps target
|
|
31
|
+
*/
|
|
32
|
+
export const createNodesV2: CreateNodesV2 = [
|
|
33
|
+
// Pattern to match: look for project.json files
|
|
34
|
+
'**/project.json',
|
|
35
|
+
|
|
36
|
+
// Inference function
|
|
37
|
+
async (
|
|
38
|
+
projectFiles: readonly string[],
|
|
39
|
+
_options: unknown,
|
|
40
|
+
context: CreateNodesContextV2
|
|
41
|
+
): Promise<CreateNodesResultV2> => {
|
|
42
|
+
const results: Array<readonly [string, CreateNodesResult]> = [];
|
|
43
|
+
|
|
44
|
+
for (const projectFile of projectFiles) {
|
|
45
|
+
const projectRoot = dirname(projectFile);
|
|
46
|
+
const srcDir = join(context.workspaceRoot, projectRoot, 'src');
|
|
47
|
+
|
|
48
|
+
// Only create target if project has a src/ directory
|
|
49
|
+
if (existsSync(srcDir)) {
|
|
50
|
+
const checkCircularDepsTarget = {
|
|
51
|
+
executor: 'nx:run-commands',
|
|
52
|
+
cache: true,
|
|
53
|
+
inputs: ['default'],
|
|
54
|
+
outputs: [] as string[],
|
|
55
|
+
options: {
|
|
56
|
+
command: 'npx madge --circular --extensions ts,tsx src',
|
|
57
|
+
cwd: projectRoot,
|
|
58
|
+
},
|
|
59
|
+
metadata: {
|
|
60
|
+
technologies: ['madge'],
|
|
61
|
+
description: 'Check for circular dependencies using madge',
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const result: CreateNodesResult = {
|
|
66
|
+
projects: {
|
|
67
|
+
[projectRoot]: {
|
|
68
|
+
targets: {
|
|
69
|
+
'check-circular-deps': checkCircularDepsTarget,
|
|
70
|
+
},
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
results.push([projectFile, result] as const);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
return results;
|
|
80
|
+
},
|
|
81
|
+
];
|
|
82
|
+
|
|
83
|
+
export default { createNodesV2 };
|