@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.
Files changed (87) hide show
  1. package/architecture/executors/generate/executor.d.ts +17 -0
  2. package/architecture/executors/generate/executor.js +67 -0
  3. package/architecture/executors/generate/executor.js.map +1 -0
  4. package/architecture/executors/generate/executor.ts +83 -0
  5. package/architecture/executors/generate/schema.json +14 -0
  6. package/architecture/executors/validate-architecture-unchanged/executor.d.ts +17 -0
  7. package/architecture/executors/validate-architecture-unchanged/executor.js +65 -0
  8. package/architecture/executors/validate-architecture-unchanged/executor.js.map +1 -0
  9. package/architecture/executors/validate-architecture-unchanged/executor.ts +81 -0
  10. package/architecture/executors/validate-architecture-unchanged/schema.json +14 -0
  11. package/architecture/executors/validate-no-cycles/executor.d.ts +16 -0
  12. package/architecture/executors/validate-no-cycles/executor.js +48 -0
  13. package/architecture/executors/validate-no-cycles/executor.js.map +1 -0
  14. package/architecture/executors/validate-no-cycles/executor.ts +60 -0
  15. package/architecture/executors/validate-no-cycles/schema.json +8 -0
  16. package/architecture/executors/validate-no-skiplevel-deps/executor.d.ts +19 -0
  17. package/architecture/executors/validate-no-skiplevel-deps/executor.js +227 -0
  18. package/architecture/executors/validate-no-skiplevel-deps/executor.js.map +1 -0
  19. package/architecture/executors/validate-no-skiplevel-deps/executor.ts +267 -0
  20. package/architecture/executors/validate-no-skiplevel-deps/schema.json +8 -0
  21. package/architecture/executors/visualize/executor.d.ts +17 -0
  22. package/architecture/executors/visualize/executor.js +49 -0
  23. package/architecture/executors/visualize/executor.js.map +1 -0
  24. package/architecture/executors/visualize/executor.ts +63 -0
  25. package/architecture/executors/visualize/schema.json +14 -0
  26. package/architecture/index.d.ts +19 -0
  27. package/architecture/index.js +23 -0
  28. package/architecture/index.js.map +1 -0
  29. package/architecture/index.ts +20 -0
  30. package/architecture/lib/graph-comparator.d.ts +39 -0
  31. package/architecture/lib/graph-comparator.js +100 -0
  32. package/architecture/lib/graph-comparator.js.map +1 -0
  33. package/architecture/lib/graph-comparator.ts +141 -0
  34. package/architecture/lib/graph-generator.d.ts +19 -0
  35. package/architecture/lib/graph-generator.js +88 -0
  36. package/architecture/lib/graph-generator.js.map +1 -0
  37. package/architecture/lib/graph-generator.ts +102 -0
  38. package/architecture/lib/graph-loader.d.ts +31 -0
  39. package/architecture/lib/graph-loader.js +70 -0
  40. package/architecture/lib/graph-loader.js.map +1 -0
  41. package/architecture/lib/graph-loader.ts +82 -0
  42. package/architecture/lib/graph-sorter.d.ts +37 -0
  43. package/architecture/lib/graph-sorter.js +110 -0
  44. package/architecture/lib/graph-sorter.js.map +1 -0
  45. package/architecture/lib/graph-sorter.ts +137 -0
  46. package/architecture/lib/graph-visualizer.d.ts +29 -0
  47. package/architecture/lib/graph-visualizer.js +209 -0
  48. package/architecture/lib/graph-visualizer.js.map +1 -0
  49. package/architecture/lib/graph-visualizer.ts +222 -0
  50. package/architecture/lib/package-validator.d.ts +38 -0
  51. package/architecture/lib/package-validator.js +105 -0
  52. package/architecture/lib/package-validator.js.map +1 -0
  53. package/architecture/lib/package-validator.ts +144 -0
  54. package/config/eslint/base.mjs +6 -0
  55. package/eslint-plugin/__tests__/max-file-lines.test.ts +207 -0
  56. package/eslint-plugin/__tests__/max-method-lines.test.ts +258 -0
  57. package/eslint-plugin/__tests__/no-unmanaged-exceptions.test.ts +359 -0
  58. package/eslint-plugin/index.d.ts +11 -0
  59. package/eslint-plugin/index.js +15 -0
  60. package/eslint-plugin/index.js.map +1 -1
  61. package/eslint-plugin/index.ts +15 -0
  62. package/eslint-plugin/rules/enforce-architecture.d.ts +15 -0
  63. package/eslint-plugin/rules/enforce-architecture.js +406 -0
  64. package/eslint-plugin/rules/enforce-architecture.js.map +1 -0
  65. package/eslint-plugin/rules/enforce-architecture.ts +469 -0
  66. package/eslint-plugin/rules/max-file-lines.d.ts +12 -0
  67. package/eslint-plugin/rules/max-file-lines.js +257 -0
  68. package/eslint-plugin/rules/max-file-lines.js.map +1 -0
  69. package/eslint-plugin/rules/max-file-lines.ts +272 -0
  70. package/eslint-plugin/rules/max-method-lines.d.ts +12 -0
  71. package/eslint-plugin/rules/max-method-lines.js +240 -0
  72. package/eslint-plugin/rules/max-method-lines.js.map +1 -0
  73. package/eslint-plugin/rules/max-method-lines.ts +287 -0
  74. package/eslint-plugin/rules/no-unmanaged-exceptions.d.ts +22 -0
  75. package/eslint-plugin/rules/no-unmanaged-exceptions.js +605 -0
  76. package/eslint-plugin/rules/no-unmanaged-exceptions.js.map +1 -0
  77. package/eslint-plugin/rules/no-unmanaged-exceptions.ts +621 -0
  78. package/executors.json +29 -0
  79. package/package.json +13 -3
  80. package/plugins/circular-deps/index.d.ts +8 -0
  81. package/plugins/circular-deps/index.js +14 -0
  82. package/plugins/circular-deps/index.js.map +1 -0
  83. package/plugins/circular-deps/index.ts +9 -0
  84. package/plugins/circular-deps/plugin.d.ts +32 -0
  85. package/plugins/circular-deps/plugin.js +73 -0
  86. package/plugins/circular-deps/plugin.js.map +1 -0
  87. 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,9 @@
1
+ /**
2
+ * Circular Dependencies Plugin
3
+ *
4
+ * Nx inference plugin that automatically adds check-circular-deps target
5
+ * to all projects with a src/ directory.
6
+ */
7
+
8
+ export * from './plugin';
9
+ export { default } from './plugin';
@@ -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 };