@webpieces/dev-config 0.2.95 → 0.2.98
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/config/eslint/base.mjs +1 -1
- package/executors.json +6 -91
- package/package.json +6 -19
- package/{executors → src/executors}/help/executor.d.ts +4 -2
- package/src/executors/help/executor.js.map +1 -0
- package/src/executors/validate-eslint-sync/executor.js.map +1 -0
- package/{executors → src/executors}/validate-versions-locked/executor.js +2 -1
- package/src/executors/validate-versions-locked/executor.js.map +1 -0
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -1
- package/src/index.js.map +1 -1
- package/src/plugin.d.ts +86 -0
- package/{plugin.js → src/plugin.js} +31 -15
- package/src/plugin.js.map +1 -0
- package/src/toError.d.ts +5 -0
- package/src/toError.js +37 -0
- package/src/toError.js.map +1 -0
- package/templates/eslint.webpieces.config.mjs +1 -1
- package/architecture/executors/diff-utils.d.ts +0 -24
- package/architecture/executors/diff-utils.js +0 -119
- package/architecture/executors/diff-utils.js.map +0 -1
- package/architecture/executors/diff-utils.ts +0 -127
- package/architecture/executors/generate/executor.d.ts +0 -16
- package/architecture/executors/generate/executor.js +0 -44
- package/architecture/executors/generate/executor.js.map +0 -1
- package/architecture/executors/generate/executor.ts +0 -59
- package/architecture/executors/generate/schema.json +0 -14
- package/architecture/executors/validate-architecture-unchanged/executor.d.ts +0 -17
- package/architecture/executors/validate-architecture-unchanged/executor.js +0 -229
- package/architecture/executors/validate-architecture-unchanged/executor.js.map +0 -1
- package/architecture/executors/validate-architecture-unchanged/executor.ts +0 -251
- package/architecture/executors/validate-architecture-unchanged/schema.json +0 -14
- package/architecture/executors/validate-code/executor.d.ts +0 -78
- package/architecture/executors/validate-code/executor.js +0 -243
- package/architecture/executors/validate-code/executor.js.map +0 -1
- package/architecture/executors/validate-code/executor.ts +0 -406
- package/architecture/executors/validate-code/schema.json +0 -227
- package/architecture/executors/validate-dtos/executor.d.ts +0 -42
- package/architecture/executors/validate-dtos/executor.js +0 -561
- package/architecture/executors/validate-dtos/executor.js.map +0 -1
- package/architecture/executors/validate-dtos/executor.ts +0 -689
- package/architecture/executors/validate-dtos/schema.json +0 -33
- package/architecture/executors/validate-modified-files/executor.d.ts +0 -25
- package/architecture/executors/validate-modified-files/executor.js +0 -501
- package/architecture/executors/validate-modified-files/executor.js.map +0 -1
- package/architecture/executors/validate-modified-files/executor.ts +0 -571
- package/architecture/executors/validate-modified-files/schema.json +0 -25
- package/architecture/executors/validate-modified-methods/executor.d.ts +0 -31
- package/architecture/executors/validate-modified-methods/executor.js +0 -694
- package/architecture/executors/validate-modified-methods/executor.js.map +0 -1
- package/architecture/executors/validate-modified-methods/executor.ts +0 -797
- package/architecture/executors/validate-modified-methods/schema.json +0 -25
- package/architecture/executors/validate-new-methods/executor.d.ts +0 -28
- package/architecture/executors/validate-new-methods/executor.js +0 -513
- package/architecture/executors/validate-new-methods/executor.js.map +0 -1
- package/architecture/executors/validate-new-methods/executor.ts +0 -584
- package/architecture/executors/validate-new-methods/schema.json +0 -25
- package/architecture/executors/validate-no-any-unknown/executor.d.ts +0 -42
- package/architecture/executors/validate-no-any-unknown/executor.js +0 -462
- package/architecture/executors/validate-no-any-unknown/executor.js.map +0 -1
- package/architecture/executors/validate-no-any-unknown/executor.ts +0 -540
- package/architecture/executors/validate-no-any-unknown/schema.json +0 -24
- package/architecture/executors/validate-no-architecture-cycles/executor.d.ts +0 -16
- package/architecture/executors/validate-no-architecture-cycles/executor.js +0 -48
- package/architecture/executors/validate-no-architecture-cycles/executor.js.map +0 -1
- package/architecture/executors/validate-no-architecture-cycles/executor.ts +0 -60
- package/architecture/executors/validate-no-architecture-cycles/schema.json +0 -8
- package/architecture/executors/validate-no-destructure/executor.d.ts +0 -52
- package/architecture/executors/validate-no-destructure/executor.js +0 -491
- package/architecture/executors/validate-no-destructure/executor.js.map +0 -1
- package/architecture/executors/validate-no-destructure/executor.ts +0 -578
- package/architecture/executors/validate-no-destructure/schema.json +0 -24
- package/architecture/executors/validate-no-direct-api-resolver/executor.d.ts +0 -47
- package/architecture/executors/validate-no-direct-api-resolver/executor.js +0 -566
- package/architecture/executors/validate-no-direct-api-resolver/executor.js.map +0 -1
- package/architecture/executors/validate-no-direct-api-resolver/executor.ts +0 -666
- package/architecture/executors/validate-no-direct-api-resolver/schema.json +0 -29
- package/architecture/executors/validate-no-inline-types/executor.d.ts +0 -91
- package/architecture/executors/validate-no-inline-types/executor.js +0 -669
- package/architecture/executors/validate-no-inline-types/executor.js.map +0 -1
- package/architecture/executors/validate-no-inline-types/executor.ts +0 -775
- package/architecture/executors/validate-no-inline-types/schema.json +0 -24
- package/architecture/executors/validate-no-skiplevel-deps/executor.d.ts +0 -19
- package/architecture/executors/validate-no-skiplevel-deps/executor.js +0 -227
- package/architecture/executors/validate-no-skiplevel-deps/executor.js.map +0 -1
- package/architecture/executors/validate-no-skiplevel-deps/executor.ts +0 -267
- package/architecture/executors/validate-no-skiplevel-deps/schema.json +0 -8
- package/architecture/executors/validate-packagejson/executor.d.ts +0 -16
- package/architecture/executors/validate-packagejson/executor.js +0 -57
- package/architecture/executors/validate-packagejson/executor.js.map +0 -1
- package/architecture/executors/validate-packagejson/executor.ts +0 -74
- package/architecture/executors/validate-packagejson/schema.json +0 -8
- package/architecture/executors/validate-prisma-converters/executor.d.ts +0 -60
- package/architecture/executors/validate-prisma-converters/executor.js +0 -634
- package/architecture/executors/validate-prisma-converters/executor.js.map +0 -1
- package/architecture/executors/validate-prisma-converters/executor.ts +0 -822
- package/architecture/executors/validate-prisma-converters/schema.json +0 -38
- package/architecture/executors/validate-return-types/executor.d.ts +0 -29
- package/architecture/executors/validate-return-types/executor.js +0 -439
- package/architecture/executors/validate-return-types/executor.js.map +0 -1
- package/architecture/executors/validate-return-types/executor.ts +0 -524
- package/architecture/executors/validate-return-types/schema.json +0 -24
- package/architecture/executors/visualize/executor.d.ts +0 -17
- package/architecture/executors/visualize/executor.js +0 -49
- package/architecture/executors/visualize/executor.js.map +0 -1
- package/architecture/executors/visualize/executor.ts +0 -63
- package/architecture/executors/visualize/schema.json +0 -14
- package/architecture/index.d.ts +0 -19
- package/architecture/index.js +0 -23
- package/architecture/index.js.map +0 -1
- package/architecture/index.ts +0 -20
- package/architecture/lib/graph-comparator.d.ts +0 -39
- package/architecture/lib/graph-comparator.js +0 -100
- package/architecture/lib/graph-comparator.js.map +0 -1
- package/architecture/lib/graph-comparator.ts +0 -141
- package/architecture/lib/graph-generator.d.ts +0 -19
- package/architecture/lib/graph-generator.js +0 -84
- package/architecture/lib/graph-generator.js.map +0 -1
- package/architecture/lib/graph-generator.ts +0 -97
- package/architecture/lib/graph-loader.d.ts +0 -31
- package/architecture/lib/graph-loader.js +0 -98
- package/architecture/lib/graph-loader.js.map +0 -1
- package/architecture/lib/graph-loader.ts +0 -116
- package/architecture/lib/graph-sorter.d.ts +0 -37
- package/architecture/lib/graph-sorter.js +0 -110
- package/architecture/lib/graph-sorter.js.map +0 -1
- package/architecture/lib/graph-sorter.ts +0 -137
- package/architecture/lib/graph-visualizer.d.ts +0 -29
- package/architecture/lib/graph-visualizer.js +0 -217
- package/architecture/lib/graph-visualizer.js.map +0 -1
- package/architecture/lib/graph-visualizer.ts +0 -231
- package/architecture/lib/package-validator.d.ts +0 -38
- package/architecture/lib/package-validator.js +0 -126
- package/architecture/lib/package-validator.js.map +0 -1
- package/architecture/lib/package-validator.ts +0 -170
- package/eslint-plugin/__tests__/catch-error-pattern.test.ts +0 -374
- package/eslint-plugin/__tests__/max-file-lines.test.ts +0 -207
- package/eslint-plugin/__tests__/max-method-lines.test.ts +0 -258
- package/eslint-plugin/__tests__/no-unmanaged-exceptions.test.ts +0 -359
- package/eslint-plugin/index.d.ts +0 -23
- package/eslint-plugin/index.js +0 -30
- package/eslint-plugin/index.js.map +0 -1
- package/eslint-plugin/index.ts +0 -29
- package/eslint-plugin/rules/catch-error-pattern.d.ts +0 -11
- package/eslint-plugin/rules/catch-error-pattern.js +0 -143
- package/eslint-plugin/rules/catch-error-pattern.js.map +0 -1
- package/eslint-plugin/rules/catch-error-pattern.ts +0 -246
- package/eslint-plugin/rules/enforce-architecture.d.ts +0 -15
- package/eslint-plugin/rules/enforce-architecture.js +0 -476
- package/eslint-plugin/rules/enforce-architecture.js.map +0 -1
- package/eslint-plugin/rules/enforce-architecture.ts +0 -543
- package/eslint-plugin/rules/max-file-lines.d.ts +0 -12
- package/eslint-plugin/rules/max-file-lines.js +0 -257
- package/eslint-plugin/rules/max-file-lines.js.map +0 -1
- package/eslint-plugin/rules/max-file-lines.ts +0 -272
- package/eslint-plugin/rules/max-method-lines.d.ts +0 -12
- package/eslint-plugin/rules/max-method-lines.js +0 -240
- package/eslint-plugin/rules/max-method-lines.js.map +0 -1
- package/eslint-plugin/rules/max-method-lines.ts +0 -287
- package/eslint-plugin/rules/no-unmanaged-exceptions.d.ts +0 -22
- package/eslint-plugin/rules/no-unmanaged-exceptions.js +0 -160
- package/eslint-plugin/rules/no-unmanaged-exceptions.js.map +0 -1
- package/eslint-plugin/rules/no-unmanaged-exceptions.ts +0 -179
- package/executors/help/executor.js.map +0 -1
- package/executors/help/executor.ts +0 -61
- package/executors/validate-eslint-sync/executor.js.map +0 -1
- package/executors/validate-eslint-sync/executor.ts +0 -87
- package/executors/validate-versions-locked/executor.js.map +0 -1
- package/executors/validate-versions-locked/executor.ts +0 -368
- package/plugin/README.md +0 -243
- package/plugin/index.d.ts +0 -4
- package/plugin/index.js +0 -8
- package/plugin/index.js.map +0 -1
- package/plugin/index.ts +0 -4
- /package/{executors → src/executors}/help/executor.js +0 -0
- /package/{executors → src/executors}/help/schema.json +0 -0
- /package/{executors → src/executors}/validate-eslint-sync/executor.d.ts +0 -0
- /package/{executors → src/executors}/validate-eslint-sync/executor.js +0 -0
- /package/{executors → src/executors}/validate-eslint-sync/schema.json +0 -0
- /package/{executors → src/executors}/validate-versions-locked/executor.d.ts +0 -0
- /package/{executors → src/executors}/validate-versions-locked/schema.json +0 -0
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Validate Package.json Executor
|
|
3
|
-
*
|
|
4
|
-
* Validates that package.json dependencies match project.json build dependencies.
|
|
5
|
-
* This ensures the two sources of truth don't drift apart.
|
|
6
|
-
*
|
|
7
|
-
* Usage:
|
|
8
|
-
* nx run architecture:validate-packagejson
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
import type { ExecutorContext } from '@nx/devkit';
|
|
12
|
-
import { generateGraph } from '../../lib/graph-generator';
|
|
13
|
-
import { sortGraphTopologically } from '../../lib/graph-sorter';
|
|
14
|
-
import { validatePackageJsonDependencies } from '../../lib/package-validator';
|
|
15
|
-
|
|
16
|
-
export interface ValidatePackageJsonOptions {
|
|
17
|
-
// No options needed for now
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export interface ExecutorResult {
|
|
21
|
-
success: boolean;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export default async function runExecutor(
|
|
25
|
-
options: ValidatePackageJsonOptions,
|
|
26
|
-
context: ExecutorContext
|
|
27
|
-
): Promise<ExecutorResult> {
|
|
28
|
-
const workspaceRoot = context.root;
|
|
29
|
-
|
|
30
|
-
console.log('\n📦 Validating Package.json Dependencies\n');
|
|
31
|
-
|
|
32
|
-
try {
|
|
33
|
-
// Step 1: Generate current graph from project.json files
|
|
34
|
-
console.log('📊 Generating dependency graph from project.json files...');
|
|
35
|
-
const rawGraph = await generateGraph();
|
|
36
|
-
|
|
37
|
-
// Step 2: Topological sort (to get enhanced graph with levels)
|
|
38
|
-
console.log('🔄 Computing topological layers...');
|
|
39
|
-
const enhancedGraph = sortGraphTopologically(rawGraph);
|
|
40
|
-
|
|
41
|
-
// Step 3: Validate package.json dependencies match
|
|
42
|
-
console.log('📦 Validating package.json dependencies match project.json...');
|
|
43
|
-
const packageValidation = await validatePackageJsonDependencies(enhancedGraph, workspaceRoot);
|
|
44
|
-
|
|
45
|
-
if (!packageValidation.valid) {
|
|
46
|
-
console.error('❌ Package.json validation failed!');
|
|
47
|
-
console.error('\nErrors:');
|
|
48
|
-
for (const error of packageValidation.errors) {
|
|
49
|
-
console.error(` ${error}`);
|
|
50
|
-
}
|
|
51
|
-
console.error('\nTo fix:');
|
|
52
|
-
console.error(' 1. Review the missing dependencies above');
|
|
53
|
-
console.error(' 2. Add the missing dependencies to the respective package.json files');
|
|
54
|
-
console.error(' 3. Ensure dependencies in package.json match build.dependsOn in project.json');
|
|
55
|
-
return { success: false };
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
console.log('✅ Package.json dependencies match project.json');
|
|
59
|
-
|
|
60
|
-
// Print summary
|
|
61
|
-
const validProjects = packageValidation.projectResults.filter(r => r.valid).length;
|
|
62
|
-
const totalProjects = packageValidation.projectResults.length;
|
|
63
|
-
console.log(`\n📈 Validation Summary:`);
|
|
64
|
-
console.log(` Projects validated: ${totalProjects}`);
|
|
65
|
-
console.log(` Valid: ${validProjects}`);
|
|
66
|
-
console.log(` Invalid: ${totalProjects - validProjects}`);
|
|
67
|
-
|
|
68
|
-
return { success: true };
|
|
69
|
-
} catch (err: unknown) {
|
|
70
|
-
const error = err instanceof Error ? err : new Error(String(err));
|
|
71
|
-
console.error('❌ Package.json validation failed:', error.message);
|
|
72
|
-
return { success: false };
|
|
73
|
-
}
|
|
74
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Validate Prisma Converters Executor
|
|
3
|
-
*
|
|
4
|
-
* Validates that Prisma converter methods follow a scalable pattern:
|
|
5
|
-
* methods returning XxxDto (where XxxDbo exists in schema.prisma) must
|
|
6
|
-
* accept that exact XxxDbo as the first parameter. This keeps single-table
|
|
7
|
-
* converters clean and forces join converters to compose them.
|
|
8
|
-
*
|
|
9
|
-
* ============================================================================
|
|
10
|
-
* RULES
|
|
11
|
-
* ============================================================================
|
|
12
|
-
*
|
|
13
|
-
* 1. First param must be exact Dbo:
|
|
14
|
-
* If method returns XxxDto and XxxDbo exists in schema.prisma,
|
|
15
|
-
* the first parameter must be of type XxxDbo.
|
|
16
|
-
*
|
|
17
|
-
* 2. Extra params must be booleans:
|
|
18
|
-
* Additional parameters beyond the Dbo are allowed but must be boolean
|
|
19
|
-
* (used for filtering payloads / security info).
|
|
20
|
-
*
|
|
21
|
-
* 3. No async converters:
|
|
22
|
-
* Methods returning Promise<XxxDto> are flagged — converters should be
|
|
23
|
-
* pure data mapping, no async work.
|
|
24
|
-
*
|
|
25
|
-
* 4. No standalone functions:
|
|
26
|
-
* Standalone functions in converter files are flagged — must be class
|
|
27
|
-
* methods so the converter class can be injected (dependency tree tracing).
|
|
28
|
-
*
|
|
29
|
-
* 5. Dto creation outside converters directory:
|
|
30
|
-
* Files outside the configured convertersPath that create `new XxxDto(...)`
|
|
31
|
-
* where XxxDbo exists in schema.prisma are flagged — Dto instances tied to
|
|
32
|
-
* a Dbo must only be created via a converter class.
|
|
33
|
-
*
|
|
34
|
-
* ============================================================================
|
|
35
|
-
* SKIP CONDITIONS
|
|
36
|
-
* ============================================================================
|
|
37
|
-
* - Methods with @deprecated decorator or JSDoc tag
|
|
38
|
-
* - Lines with: // webpieces-disable prisma-converter -- [reason]
|
|
39
|
-
*
|
|
40
|
-
* ============================================================================
|
|
41
|
-
* MODES
|
|
42
|
-
* ============================================================================
|
|
43
|
-
* - OFF: Skip validation entirely
|
|
44
|
-
* - NEW_AND_MODIFIED_METHODS: Validate new/modified methods in converters + changed lines in non-converters
|
|
45
|
-
* - MODIFIED_FILES: Validate all methods in modified files
|
|
46
|
-
*/
|
|
47
|
-
import type { ExecutorContext } from '@nx/devkit';
|
|
48
|
-
export type PrismaConverterMode = 'OFF' | 'NEW_AND_MODIFIED_METHODS' | 'MODIFIED_FILES';
|
|
49
|
-
export interface ValidatePrismaConvertersOptions {
|
|
50
|
-
mode?: PrismaConverterMode;
|
|
51
|
-
disableAllowed?: boolean;
|
|
52
|
-
schemaPath?: string;
|
|
53
|
-
convertersPaths?: string[];
|
|
54
|
-
enforcePaths?: string[];
|
|
55
|
-
ignoreModifiedUntilEpoch?: number;
|
|
56
|
-
}
|
|
57
|
-
export interface ExecutorResult {
|
|
58
|
-
success: boolean;
|
|
59
|
-
}
|
|
60
|
-
export default function runExecutor(options: ValidatePrismaConvertersOptions, context: ExecutorContext): Promise<ExecutorResult>;
|