@webpieces/dev-config 0.2.83 → 0.2.85
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-code/executor.d.ts +27 -3
- package/architecture/executors/validate-code/executor.js +46 -13
- package/architecture/executors/validate-code/executor.js.map +1 -1
- package/architecture/executors/validate-code/executor.ts +87 -16
- package/architecture/executors/validate-code/schema.json +91 -15
- package/architecture/executors/validate-dtos/executor.d.ts +1 -0
- package/architecture/executors/validate-dtos/executor.js +6 -5
- package/architecture/executors/validate-dtos/executor.js.map +1 -1
- package/architecture/executors/validate-dtos/executor.ts +8 -4
- package/architecture/executors/validate-dtos/schema.json +5 -0
- package/architecture/executors/validate-no-any-unknown/executor.d.ts +2 -0
- package/architecture/executors/validate-no-any-unknown/executor.js +27 -7
- package/architecture/executors/validate-no-any-unknown/executor.js.map +1 -1
- package/architecture/executors/validate-no-any-unknown/executor.ts +31 -7
- package/architecture/executors/validate-no-any-unknown/schema.json +9 -0
- package/architecture/executors/validate-no-destructure/executor.d.ts +52 -0
- package/architecture/executors/validate-no-destructure/executor.js +493 -0
- package/architecture/executors/validate-no-destructure/executor.js.map +1 -0
- package/architecture/executors/validate-no-destructure/executor.ts +580 -0
- package/architecture/executors/validate-no-destructure/schema.json +24 -0
- package/architecture/executors/validate-no-inline-types/executor.d.ts +2 -0
- package/architecture/executors/validate-no-inline-types/executor.js +30 -10
- package/architecture/executors/validate-no-inline-types/executor.js.map +1 -1
- package/architecture/executors/validate-no-inline-types/executor.ts +35 -10
- package/architecture/executors/validate-no-inline-types/schema.json +9 -0
- package/architecture/executors/validate-prisma-converters/executor.d.ts +1 -0
- package/architecture/executors/validate-prisma-converters/executor.js +13 -11
- package/architecture/executors/validate-prisma-converters/executor.js.map +1 -1
- package/architecture/executors/validate-prisma-converters/executor.ts +19 -11
- package/architecture/executors/validate-prisma-converters/schema.json +5 -0
- package/architecture/executors/validate-return-types/executor.d.ts +2 -0
- package/architecture/executors/validate-return-types/executor.js +30 -10
- package/architecture/executors/validate-return-types/executor.js.map +1 -1
- package/architecture/executors/validate-return-types/executor.ts +35 -10
- package/architecture/executors/validate-return-types/schema.json +9 -0
- package/executors.json +5 -0
- package/package.json +1 -1
|
@@ -4,6 +4,7 @@ import { NoInlineTypesMode } from '../validate-no-inline-types/executor';
|
|
|
4
4
|
import { NoAnyUnknownMode } from '../validate-no-any-unknown/executor';
|
|
5
5
|
import { ValidateDtosMode } from '../validate-dtos/executor';
|
|
6
6
|
import { PrismaConverterMode } from '../validate-prisma-converters/executor';
|
|
7
|
+
import { NoDestructureMode } from '../validate-no-destructure/executor';
|
|
7
8
|
export type MethodMaxLimitMode = 'OFF' | 'NEW_METHODS' | 'NEW_AND_MODIFIED_METHODS' | 'MODIFIED_FILES';
|
|
8
9
|
export type FileMaxLimitMode = 'OFF' | 'MODIFIED_FILES';
|
|
9
10
|
export interface MethodMaxLimitConfig {
|
|
@@ -18,26 +19,49 @@ export interface FileMaxLimitConfig {
|
|
|
18
19
|
disableAllowed?: boolean;
|
|
19
20
|
ignoreModifiedUntilEpoch?: number;
|
|
20
21
|
}
|
|
22
|
+
export interface RequireReturnTypeConfig {
|
|
23
|
+
mode?: ReturnTypeMode;
|
|
24
|
+
disableAllowed?: boolean;
|
|
25
|
+
ignoreModifiedUntilEpoch?: number;
|
|
26
|
+
}
|
|
27
|
+
export interface NoInlineTypeLiteralsConfig {
|
|
28
|
+
mode?: NoInlineTypesMode;
|
|
29
|
+
disableAllowed?: boolean;
|
|
30
|
+
ignoreModifiedUntilEpoch?: number;
|
|
31
|
+
}
|
|
32
|
+
export interface NoAnyUnknownConfig {
|
|
33
|
+
mode?: NoAnyUnknownMode;
|
|
34
|
+
disableAllowed?: boolean;
|
|
35
|
+
ignoreModifiedUntilEpoch?: number;
|
|
36
|
+
}
|
|
21
37
|
export interface ValidateDtosConfig {
|
|
22
38
|
mode?: ValidateDtosMode;
|
|
39
|
+
disableAllowed?: boolean;
|
|
23
40
|
prismaSchemaPath?: string;
|
|
24
41
|
dtoSourcePaths?: string[];
|
|
25
42
|
ignoreModifiedUntilEpoch?: number;
|
|
26
43
|
}
|
|
27
44
|
export interface PrismaConverterConfig {
|
|
28
45
|
mode?: PrismaConverterMode;
|
|
46
|
+
disableAllowed?: boolean;
|
|
29
47
|
schemaPath?: string;
|
|
30
48
|
convertersPaths?: string[];
|
|
31
49
|
ignoreModifiedUntilEpoch?: number;
|
|
32
50
|
}
|
|
51
|
+
export interface NoDestructureConfig {
|
|
52
|
+
mode?: NoDestructureMode;
|
|
53
|
+
disableAllowed?: boolean;
|
|
54
|
+
ignoreModifiedUntilEpoch?: number;
|
|
55
|
+
}
|
|
33
56
|
export interface ValidateCodeOptions {
|
|
34
57
|
methodMaxLimit?: MethodMaxLimitConfig;
|
|
35
58
|
fileMaxLimit?: FileMaxLimitConfig;
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
59
|
+
requireReturnType?: RequireReturnTypeConfig;
|
|
60
|
+
noInlineTypeLiterals?: NoInlineTypeLiteralsConfig;
|
|
61
|
+
noAnyUnknown?: NoAnyUnknownConfig;
|
|
39
62
|
validateDtos?: ValidateDtosConfig;
|
|
40
63
|
prismaConverter?: PrismaConverterConfig;
|
|
64
|
+
noDestructure?: NoDestructureConfig;
|
|
41
65
|
}
|
|
42
66
|
export interface ExecutorResult {
|
|
43
67
|
success: boolean;
|
|
@@ -10,6 +10,7 @@ const executor_5 = tslib_1.__importDefault(require("../validate-no-inline-types/
|
|
|
10
10
|
const executor_6 = tslib_1.__importDefault(require("../validate-no-any-unknown/executor"));
|
|
11
11
|
const executor_7 = tslib_1.__importDefault(require("../validate-dtos/executor"));
|
|
12
12
|
const executor_8 = tslib_1.__importDefault(require("../validate-prisma-converters/executor"));
|
|
13
|
+
const executor_9 = tslib_1.__importDefault(require("../validate-no-destructure/executor"));
|
|
13
14
|
function formatEpochDate(epoch) {
|
|
14
15
|
return new Date(epoch * 1000).toISOString().split('T')[0];
|
|
15
16
|
}
|
|
@@ -62,17 +63,28 @@ function parseConfig(options) {
|
|
|
62
63
|
fileMode: fileResolved.mode,
|
|
63
64
|
fileDisableAllowed: fileConfig.disableAllowed ?? true,
|
|
64
65
|
fileOverride: fileResolved.override,
|
|
65
|
-
returnTypeMode: options.
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
returnTypeMode: options.requireReturnType?.mode ?? 'OFF',
|
|
67
|
+
returnTypeDisableAllowed: options.requireReturnType?.disableAllowed ?? true,
|
|
68
|
+
returnTypeIgnoreEpoch: options.requireReturnType?.ignoreModifiedUntilEpoch,
|
|
69
|
+
noInlineTypesMode: options.noInlineTypeLiterals?.mode ?? 'OFF',
|
|
70
|
+
noInlineTypesDisableAllowed: options.noInlineTypeLiterals?.disableAllowed ?? true,
|
|
71
|
+
noInlineTypesIgnoreEpoch: options.noInlineTypeLiterals?.ignoreModifiedUntilEpoch,
|
|
72
|
+
noAnyUnknownMode: options.noAnyUnknown?.mode ?? 'OFF',
|
|
73
|
+
noAnyUnknownDisableAllowed: options.noAnyUnknown?.disableAllowed ?? true,
|
|
74
|
+
noAnyUnknownIgnoreEpoch: options.noAnyUnknown?.ignoreModifiedUntilEpoch,
|
|
68
75
|
validateDtosMode: options.validateDtos?.mode ?? 'OFF',
|
|
76
|
+
validateDtosDisableAllowed: options.validateDtos?.disableAllowed ?? true,
|
|
69
77
|
validateDtosPrismaPath: options.validateDtos?.prismaSchemaPath,
|
|
70
78
|
validateDtosSrcPaths: options.validateDtos?.dtoSourcePaths ?? [],
|
|
71
79
|
validateDtosIgnoreEpoch: options.validateDtos?.ignoreModifiedUntilEpoch,
|
|
72
80
|
prismaConverterMode: options.prismaConverter?.mode ?? 'OFF',
|
|
81
|
+
prismaConverterDisableAllowed: options.prismaConverter?.disableAllowed ?? true,
|
|
73
82
|
prismaConverterSchemaPath: options.prismaConverter?.schemaPath,
|
|
74
83
|
prismaConverterConvertersPaths: options.prismaConverter?.convertersPaths ?? [],
|
|
75
84
|
prismaConverterIgnoreEpoch: options.prismaConverter?.ignoreModifiedUntilEpoch,
|
|
85
|
+
noDestructureMode: options.noDestructure?.mode ?? 'OFF',
|
|
86
|
+
noDestructureDisableAllowed: options.noDestructure?.disableAllowed ?? true,
|
|
87
|
+
noDestructureIgnoreEpoch: options.noDestructure?.ignoreModifiedUntilEpoch,
|
|
76
88
|
};
|
|
77
89
|
}
|
|
78
90
|
function formatOverride(override) {
|
|
@@ -85,18 +97,19 @@ function logConfig(config) {
|
|
|
85
97
|
console.log('\n\ud83d\udccf Running Code Validations\n');
|
|
86
98
|
console.log(` Method limits: mode=${config.methodMode}${formatOverride(config.methodOverride)}, limit=${config.methodLimit}, disableAllowed=${config.methodDisableAllowed}`);
|
|
87
99
|
console.log(` File limits: mode=${config.fileMode}${formatOverride(config.fileOverride)}, limit=${config.fileLimit}, disableAllowed=${config.fileDisableAllowed}`);
|
|
88
|
-
console.log(` Require return types:
|
|
89
|
-
console.log(` No inline type literals:
|
|
90
|
-
console.log(` No any/unknown:
|
|
91
|
-
console.log(` Validate DTOs:
|
|
92
|
-
console.log(` Prisma converters:
|
|
100
|
+
console.log(` Require return types: mode=${config.returnTypeMode}, disableAllowed=${config.returnTypeDisableAllowed}`);
|
|
101
|
+
console.log(` No inline type literals: mode=${config.noInlineTypesMode}, disableAllowed=${config.noInlineTypesDisableAllowed}`);
|
|
102
|
+
console.log(` No any/unknown: mode=${config.noAnyUnknownMode}, disableAllowed=${config.noAnyUnknownDisableAllowed}`);
|
|
103
|
+
console.log(` Validate DTOs: mode=${config.validateDtosMode}, disableAllowed=${config.validateDtosDisableAllowed}`);
|
|
104
|
+
console.log(` Prisma converters: mode=${config.prismaConverterMode}, disableAllowed=${config.prismaConverterDisableAllowed}`);
|
|
105
|
+
console.log(` No destructure: mode=${config.noDestructureMode}, disableAllowed=${config.noDestructureDisableAllowed}`);
|
|
93
106
|
console.log('');
|
|
94
107
|
}
|
|
95
108
|
function isAllOff(config) {
|
|
96
109
|
return config.methodMode === 'OFF' && config.fileMode === 'OFF' &&
|
|
97
110
|
config.returnTypeMode === 'OFF' && config.noInlineTypesMode === 'OFF' &&
|
|
98
111
|
config.noAnyUnknownMode === 'OFF' && config.validateDtosMode === 'OFF' &&
|
|
99
|
-
config.prismaConverterMode === 'OFF';
|
|
112
|
+
config.prismaConverterMode === 'OFF' && config.noDestructureMode === 'OFF';
|
|
100
113
|
}
|
|
101
114
|
async function runMethodValidators(config, context) {
|
|
102
115
|
const results = [];
|
|
@@ -126,25 +139,45 @@ async function runExecutor(options, context) {
|
|
|
126
139
|
const fileResult = await (0, executor_3.default)({
|
|
127
140
|
limit: config.fileLimit, mode: config.fileMode, disableAllowed: config.fileDisableAllowed,
|
|
128
141
|
}, context);
|
|
129
|
-
const returnTypesResult = await (0, executor_4.default)({
|
|
130
|
-
|
|
131
|
-
|
|
142
|
+
const returnTypesResult = await (0, executor_4.default)({
|
|
143
|
+
mode: config.returnTypeMode,
|
|
144
|
+
disableAllowed: config.returnTypeDisableAllowed,
|
|
145
|
+
ignoreModifiedUntilEpoch: config.returnTypeIgnoreEpoch,
|
|
146
|
+
}, context);
|
|
147
|
+
const noInlineTypesResult = await (0, executor_5.default)({
|
|
148
|
+
mode: config.noInlineTypesMode,
|
|
149
|
+
disableAllowed: config.noInlineTypesDisableAllowed,
|
|
150
|
+
ignoreModifiedUntilEpoch: config.noInlineTypesIgnoreEpoch,
|
|
151
|
+
}, context);
|
|
152
|
+
const noAnyUnknownResult = await (0, executor_6.default)({
|
|
153
|
+
mode: config.noAnyUnknownMode,
|
|
154
|
+
disableAllowed: config.noAnyUnknownDisableAllowed,
|
|
155
|
+
ignoreModifiedUntilEpoch: config.noAnyUnknownIgnoreEpoch,
|
|
156
|
+
}, context);
|
|
132
157
|
const validateDtosResult = await (0, executor_7.default)({
|
|
133
158
|
mode: config.validateDtosMode,
|
|
159
|
+
disableAllowed: config.validateDtosDisableAllowed,
|
|
134
160
|
prismaSchemaPath: config.validateDtosPrismaPath,
|
|
135
161
|
dtoSourcePaths: config.validateDtosSrcPaths,
|
|
136
162
|
ignoreModifiedUntilEpoch: config.validateDtosIgnoreEpoch,
|
|
137
163
|
}, context);
|
|
138
164
|
const prismaConverterResult = await (0, executor_8.default)({
|
|
139
165
|
mode: config.prismaConverterMode,
|
|
166
|
+
disableAllowed: config.prismaConverterDisableAllowed,
|
|
140
167
|
schemaPath: config.prismaConverterSchemaPath,
|
|
141
168
|
convertersPaths: config.prismaConverterConvertersPaths,
|
|
142
169
|
ignoreModifiedUntilEpoch: config.prismaConverterIgnoreEpoch,
|
|
143
170
|
}, context);
|
|
171
|
+
const noDestructureResult = await (0, executor_9.default)({
|
|
172
|
+
mode: config.noDestructureMode,
|
|
173
|
+
disableAllowed: config.noDestructureDisableAllowed,
|
|
174
|
+
ignoreModifiedUntilEpoch: config.noDestructureIgnoreEpoch,
|
|
175
|
+
}, context);
|
|
144
176
|
const allSuccess = methodResults.every((r) => r.success) &&
|
|
145
177
|
fileResult.success && returnTypesResult.success &&
|
|
146
178
|
noInlineTypesResult.success && noAnyUnknownResult.success &&
|
|
147
|
-
validateDtosResult.success && prismaConverterResult.success
|
|
179
|
+
validateDtosResult.success && prismaConverterResult.success &&
|
|
180
|
+
noDestructureResult.success;
|
|
148
181
|
console.log(allSuccess ? '\n\u2705 All code validations passed\n' : '\n\u274c Some code validations failed\n');
|
|
149
182
|
return { success: allSuccess };
|
|
150
183
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/dev-config/architecture/executors/validate-code/executor.ts"],"names":[],"mappings":";;AAuNA,8BAwCC;;AA9PD,wFAAqE;AACrE,6FAA+E;AAC/E,2FAA2E;AAC3E,yFAA2F;AAC3F,4FAAmG;AACnG,2FAAgG;AAChG,iFAAsF;AACtF,8FAA0G;AAqF1G,SAAS,eAAe,CAAC,KAAa;IAClC,OAAO,IAAI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC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MAAM,CAAC,gBAAgB;QAC7B,gBAAgB,EAAE,MAAM,CAAC,sBAAsB;QAC/C,cAAc,EAAE,MAAM,CAAC,oBAAoB;QAC3C,wBAAwB,EAAE,MAAM,CAAC,uBAAuB;KAC3D,EAAE,OAAO,CAAC,CAAC;IACZ,MAAM,qBAAqB,GAAG,MAAM,IAAA,kBAA2B,EAAC;QAC5D,IAAI,EAAE,MAAM,CAAC,mBAAmB;QAChC,UAAU,EAAE,MAAM,CAAC,yBAAyB;QAC5C,eAAe,EAAE,MAAM,CAAC,8BAA8B;QACtD,wBAAwB,EAAE,MAAM,CAAC,0BAA0B;KAC9D,EAAE,OAAO,CAAC,CAAC;IAEZ,MAAM,UAAU,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;QACpD,UAAU,CAAC,OAAO,IAAI,iBAAiB,CAAC,OAAO;QAC/C,mBAAmB,CAAC,OAAO,IAAI,kBAAkB,CAAC,OAAO;QACzD,kBAAkB,CAAC,OAAO,IAAI,qBAAqB,CAAC,OAAO,CAAC;IAEhE,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,wCAAwC,CAAC,CAAC,CAAC,yCAAyC,CAAC,CAAC;IAC/G,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AACnC,CAAC","sourcesContent":["import { ExecutorContext } from '@nx/devkit';\nimport runNewMethodsExecutor from '../validate-new-methods/executor';\nimport runModifiedMethodsExecutor from '../validate-modified-methods/executor';\nimport runModifiedFilesExecutor from '../validate-modified-files/executor';\nimport runReturnTypesExecutor, { ReturnTypeMode } from '../validate-return-types/executor';\nimport runNoInlineTypesExecutor, { NoInlineTypesMode } from '../validate-no-inline-types/executor';\nimport runNoAnyUnknownExecutor, { NoAnyUnknownMode } from '../validate-no-any-unknown/executor';\nimport runValidateDtosExecutor, { ValidateDtosMode } from '../validate-dtos/executor';\nimport runPrismaConvertersExecutor, { PrismaConverterMode } from '../validate-prisma-converters/executor';\n\nexport type MethodMaxLimitMode = 'OFF' | 'NEW_METHODS' | 'NEW_AND_MODIFIED_METHODS' | 'MODIFIED_FILES';\nexport type FileMaxLimitMode = 'OFF' | 'MODIFIED_FILES';\n\nexport interface MethodMaxLimitConfig {\n limit?: number;\n mode?: MethodMaxLimitMode;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n}\n\nexport interface FileMaxLimitConfig {\n limit?: number;\n mode?: FileMaxLimitMode;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n}\n\nexport interface ValidateDtosConfig {\n mode?: ValidateDtosMode;\n prismaSchemaPath?: string;\n dtoSourcePaths?: string[];\n ignoreModifiedUntilEpoch?: number;\n}\n\nexport interface PrismaConverterConfig {\n mode?: PrismaConverterMode;\n schemaPath?: string;\n convertersPaths?: string[];\n ignoreModifiedUntilEpoch?: number;\n}\n\nexport interface ValidateCodeOptions {\n methodMaxLimit?: MethodMaxLimitConfig;\n fileMaxLimit?: FileMaxLimitConfig;\n requireReturnTypeMode?: ReturnTypeMode;\n noInlineTypeLiteralsMode?: NoInlineTypesMode;\n noAnyUnknownMode?: NoAnyUnknownMode;\n validateDtos?: ValidateDtosConfig;\n prismaConverter?: PrismaConverterConfig;\n}\n\nexport interface ExecutorResult {\n success: boolean;\n}\n\ninterface OverrideInfo {\n active: boolean;\n normalMode: string;\n expiresDate: string;\n}\n\ninterface ParsedConfig {\n methodLimit: number;\n methodMode: MethodMaxLimitMode;\n methodDisableAllowed: boolean;\n methodOverride: OverrideInfo | undefined;\n fileLimit: number;\n fileMode: FileMaxLimitMode;\n fileDisableAllowed: boolean;\n fileOverride: OverrideInfo | undefined;\n returnTypeMode: ReturnTypeMode;\n noInlineTypesMode: NoInlineTypesMode;\n noAnyUnknownMode: NoAnyUnknownMode;\n validateDtosMode: ValidateDtosMode;\n validateDtosPrismaPath: string | undefined;\n validateDtosSrcPaths: string[];\n validateDtosIgnoreEpoch: number | undefined;\n prismaConverterMode: PrismaConverterMode;\n prismaConverterSchemaPath: string | undefined;\n prismaConverterConvertersPaths: string[];\n prismaConverterIgnoreEpoch: number | undefined;\n}\n\ninterface ResolvedMethodMode {\n mode: MethodMaxLimitMode;\n override: OverrideInfo | undefined;\n}\n\ninterface ResolvedFileMode {\n mode: FileMaxLimitMode;\n override: OverrideInfo | undefined;\n}\n\nfunction formatEpochDate(epoch: number): string {\n return new Date(epoch * 1000).toISOString().split('T')[0];\n}\n\nfunction resolveMethodMode(\n normalMode: MethodMaxLimitMode, epoch: number | undefined\n): ResolvedMethodMode {\n if (epoch === undefined) {\n return { mode: normalMode, override: undefined };\n }\n const nowSeconds = Date.now() / 1000;\n if (nowSeconds < epoch) {\n // Active: downgrade to skip modified checking\n const downgraded: MethodMaxLimitMode =\n normalMode === 'OFF' ? 'OFF' : 'NEW_METHODS';\n return {\n mode: downgraded,\n override: { active: true, normalMode, expiresDate: formatEpochDate(epoch) },\n };\n }\n // Expired\n console.log(`\\n\\u26a0\\ufe0f methodMaxLimit.ignoreModifiedUntilEpoch (${epoch}) has expired (${formatEpochDate(epoch)}). Remove it from nx.json. Using normal mode: ${normalMode}\\n`);\n return { mode: normalMode, override: undefined };\n}\n\nfunction resolveFileMode(\n normalMode: FileMaxLimitMode, epoch: number | undefined\n): ResolvedFileMode {\n if (epoch === undefined) {\n return { mode: normalMode, override: undefined };\n }\n const nowSeconds = Date.now() / 1000;\n if (nowSeconds < epoch) {\n // Active: file checking is inherently about modified files, so skip entirely\n return {\n mode: 'OFF',\n override: { active: true, normalMode, expiresDate: formatEpochDate(epoch) },\n };\n }\n // Expired\n console.log(`\\n\\u26a0\\ufe0f fileMaxLimit.ignoreModifiedUntilEpoch (${epoch}) has expired (${formatEpochDate(epoch)}). Remove it from nx.json. Using normal mode: ${normalMode}\\n`);\n return { mode: normalMode, override: undefined };\n}\n\nfunction parseConfig(options: ValidateCodeOptions): ParsedConfig {\n const methodConfig: MethodMaxLimitConfig = options.methodMaxLimit ?? {};\n const fileConfig: FileMaxLimitConfig = options.fileMaxLimit ?? {};\n\n const normalMethodMode = methodConfig.mode ?? 'NEW_AND_MODIFIED_METHODS';\n const normalFileMode = fileConfig.mode ?? 'MODIFIED_FILES';\n\n const methodResolved = resolveMethodMode(normalMethodMode, methodConfig.ignoreModifiedUntilEpoch);\n const fileResolved = resolveFileMode(normalFileMode, fileConfig.ignoreModifiedUntilEpoch);\n\n return {\n methodLimit: methodConfig.limit ?? 80,\n methodMode: methodResolved.mode,\n methodDisableAllowed: methodConfig.disableAllowed ?? true,\n methodOverride: methodResolved.override,\n fileLimit: fileConfig.limit ?? 900,\n fileMode: fileResolved.mode,\n fileDisableAllowed: fileConfig.disableAllowed ?? true,\n fileOverride: fileResolved.override,\n returnTypeMode: options.requireReturnTypeMode ?? 'OFF',\n noInlineTypesMode: options.noInlineTypeLiteralsMode ?? 'OFF',\n noAnyUnknownMode: options.noAnyUnknownMode ?? 'OFF',\n validateDtosMode: options.validateDtos?.mode ?? 'OFF',\n validateDtosPrismaPath: options.validateDtos?.prismaSchemaPath,\n validateDtosSrcPaths: options.validateDtos?.dtoSourcePaths ?? [],\n validateDtosIgnoreEpoch: options.validateDtos?.ignoreModifiedUntilEpoch,\n prismaConverterMode: options.prismaConverter?.mode ?? 'OFF',\n prismaConverterSchemaPath: options.prismaConverter?.schemaPath,\n prismaConverterConvertersPaths: options.prismaConverter?.convertersPaths ?? [],\n prismaConverterIgnoreEpoch: options.prismaConverter?.ignoreModifiedUntilEpoch,\n };\n}\n\nfunction formatOverride(override: OverrideInfo | undefined): string {\n if (!override) {\n return '';\n }\n return ` (override active, normal: ${override.normalMode}, expires: ${override.expiresDate})`;\n}\n\nfunction logConfig(config: ParsedConfig): void {\n console.log('\\n\\ud83d\\udccf Running Code Validations\\n');\n console.log(` Method limits: mode=${config.methodMode}${formatOverride(config.methodOverride)}, limit=${config.methodLimit}, disableAllowed=${config.methodDisableAllowed}`);\n console.log(` File limits: mode=${config.fileMode}${formatOverride(config.fileOverride)}, limit=${config.fileLimit}, disableAllowed=${config.fileDisableAllowed}`);\n console.log(` Require return types: ${config.returnTypeMode}`);\n console.log(` No inline type literals: ${config.noInlineTypesMode}`);\n console.log(` No any/unknown: ${config.noAnyUnknownMode}`);\n console.log(` Validate DTOs: ${config.validateDtosMode}`);\n console.log(` Prisma converters: ${config.prismaConverterMode}`);\n console.log('');\n}\n\nfunction isAllOff(config: ParsedConfig): boolean {\n return config.methodMode === 'OFF' && config.fileMode === 'OFF' &&\n config.returnTypeMode === 'OFF' && config.noInlineTypesMode === 'OFF' &&\n config.noAnyUnknownMode === 'OFF' && config.validateDtosMode === 'OFF' &&\n config.prismaConverterMode === 'OFF';\n}\n\nasync function runMethodValidators(config: ParsedConfig, context: ExecutorContext): Promise<ExecutorResult[]> {\n const results: ExecutorResult[] = [];\n const runNew = config.methodMode === 'NEW_METHODS' || config.methodMode === 'NEW_AND_MODIFIED_METHODS';\n const runModified = config.methodMode === 'NEW_AND_MODIFIED_METHODS' || config.methodMode === 'MODIFIED_FILES';\n\n if (runNew) {\n results.push(await runNewMethodsExecutor({\n limit: config.methodLimit,\n mode: config.methodMode, disableAllowed: config.methodDisableAllowed,\n }, context));\n }\n if (runModified) {\n results.push(await runModifiedMethodsExecutor({\n limit: config.methodLimit, mode: config.methodMode, disableAllowed: config.methodDisableAllowed,\n }, context));\n }\n return results;\n}\n\nexport default async function runExecutor(\n options: ValidateCodeOptions,\n context: ExecutorContext\n): Promise<ExecutorResult> {\n const config = parseConfig(options);\n\n if (isAllOff(config)) {\n console.log('\\n\\u23ed\\ufe0f Skipping all code validations (all modes: OFF)\\n');\n return { success: true };\n }\n\n logConfig(config);\n\n const methodResults = await runMethodValidators(config, context);\n const fileResult = await runModifiedFilesExecutor({\n limit: config.fileLimit, mode: config.fileMode, disableAllowed: config.fileDisableAllowed,\n }, context);\n const returnTypesResult = await runReturnTypesExecutor({ mode: config.returnTypeMode }, context);\n const noInlineTypesResult = await runNoInlineTypesExecutor({ mode: config.noInlineTypesMode }, context);\n const noAnyUnknownResult = await runNoAnyUnknownExecutor({ mode: config.noAnyUnknownMode }, context);\n const validateDtosResult = await runValidateDtosExecutor({\n mode: config.validateDtosMode,\n prismaSchemaPath: config.validateDtosPrismaPath,\n dtoSourcePaths: config.validateDtosSrcPaths,\n ignoreModifiedUntilEpoch: config.validateDtosIgnoreEpoch,\n }, context);\n const prismaConverterResult = await runPrismaConvertersExecutor({\n mode: config.prismaConverterMode,\n schemaPath: config.prismaConverterSchemaPath,\n convertersPaths: config.prismaConverterConvertersPaths,\n ignoreModifiedUntilEpoch: config.prismaConverterIgnoreEpoch,\n }, context);\n\n const allSuccess = methodResults.every((r) => r.success) &&\n fileResult.success && returnTypesResult.success &&\n noInlineTypesResult.success && noAnyUnknownResult.success &&\n validateDtosResult.success && prismaConverterResult.success;\n\n console.log(allSuccess ? '\\n\\u2705 All code validations passed\\n' : '\\n\\u274c Some code validations failed\\n');\n return { success: allSuccess };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"executor.js","sourceRoot":"","sources":["../../../../../../../packages/tooling/dev-config/architecture/executors/validate-code/executor.ts"],"names":[],"mappings":";;AA0QA,8BA4DC;;AArUD,wFAAqE;AACrE,6FAA+E;AAC/E,2FAA2E;AAC3E,yFAA2F;AAC3F,4FAAmG;AACnG,2FAAgG;AAChG,iFAAsF;AACtF,8FAA0G;AAC1G,2FAAkG;AA2HlG,SAAS,eAAe,CAAC,KAAa;IAClC,OAAO,IAAI,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC9D,CAAC;AAED,SAAS,iBAAiB,CACtB,UAA8B,EAAE,KAAyB;IAEzD,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;QACtB,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;IACrD,CAAC;IACD,MAAM,U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IAAI,EAAE,MAAM,CAAC,mBAAmB;QAChC,cAAc,EAAE,MAAM,CAAC,6BAA6B;QACpD,UAAU,EAAE,MAAM,CAAC,yBAAyB;QAC5C,eAAe,EAAE,MAAM,CAAC,8BAA8B;QACtD,wBAAwB,EAAE,MAAM,CAAC,0BAA0B;KAC9D,EAAE,OAAO,CAAC,CAAC;IACZ,MAAM,mBAAmB,GAAG,MAAM,IAAA,kBAAwB,EAAC;QACvD,IAAI,EAAE,MAAM,CAAC,iBAAiB;QAC9B,cAAc,EAAE,MAAM,CAAC,2BAA2B;QAClD,wBAAwB,EAAE,MAAM,CAAC,wBAAwB;KAC5D,EAAE,OAAO,CAAC,CAAC;IAEZ,MAAM,UAAU,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;QACpD,UAAU,CAAC,OAAO,IAAI,iBAAiB,CAAC,OAAO;QAC/C,mBAAmB,CAAC,OAAO,IAAI,kBAAkB,CAAC,OAAO;QACzD,kBAAkB,CAAC,OAAO,IAAI,qBAAqB,CAAC,OAAO;QAC3D,mBAAmB,CAAC,OAAO,CAAC;IAEhC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,CAAC,wCAAwC,CAAC,CAAC,CAAC,yCAAyC,CAAC,CAAC;IAC/G,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;AACnC,CAAC","sourcesContent":["import { ExecutorContext } from '@nx/devkit';\nimport runNewMethodsExecutor from '../validate-new-methods/executor';\nimport runModifiedMethodsExecutor from '../validate-modified-methods/executor';\nimport runModifiedFilesExecutor from '../validate-modified-files/executor';\nimport runReturnTypesExecutor, { ReturnTypeMode } from '../validate-return-types/executor';\nimport runNoInlineTypesExecutor, { NoInlineTypesMode } from '../validate-no-inline-types/executor';\nimport runNoAnyUnknownExecutor, { NoAnyUnknownMode } from '../validate-no-any-unknown/executor';\nimport runValidateDtosExecutor, { ValidateDtosMode } from '../validate-dtos/executor';\nimport runPrismaConvertersExecutor, { PrismaConverterMode } from '../validate-prisma-converters/executor';\nimport runNoDestructureExecutor, { NoDestructureMode } from '../validate-no-destructure/executor';\n\nexport type MethodMaxLimitMode = 'OFF' | 'NEW_METHODS' | 'NEW_AND_MODIFIED_METHODS' | 'MODIFIED_FILES';\nexport type FileMaxLimitMode = 'OFF' | 'MODIFIED_FILES';\n\nexport interface MethodMaxLimitConfig {\n limit?: number;\n mode?: MethodMaxLimitMode;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n}\n\nexport interface FileMaxLimitConfig {\n limit?: number;\n mode?: FileMaxLimitMode;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n}\n\nexport interface RequireReturnTypeConfig {\n mode?: ReturnTypeMode;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n}\n\nexport interface NoInlineTypeLiteralsConfig {\n mode?: NoInlineTypesMode;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n}\n\nexport interface NoAnyUnknownConfig {\n mode?: NoAnyUnknownMode;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n}\n\nexport interface ValidateDtosConfig {\n mode?: ValidateDtosMode;\n disableAllowed?: boolean;\n prismaSchemaPath?: string;\n dtoSourcePaths?: string[];\n ignoreModifiedUntilEpoch?: number;\n}\n\nexport interface PrismaConverterConfig {\n mode?: PrismaConverterMode;\n disableAllowed?: boolean;\n schemaPath?: string;\n convertersPaths?: string[];\n ignoreModifiedUntilEpoch?: number;\n}\n\nexport interface NoDestructureConfig {\n mode?: NoDestructureMode;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n}\n\nexport interface ValidateCodeOptions {\n methodMaxLimit?: MethodMaxLimitConfig;\n fileMaxLimit?: FileMaxLimitConfig;\n requireReturnType?: RequireReturnTypeConfig;\n noInlineTypeLiterals?: NoInlineTypeLiteralsConfig;\n noAnyUnknown?: NoAnyUnknownConfig;\n validateDtos?: ValidateDtosConfig;\n prismaConverter?: PrismaConverterConfig;\n noDestructure?: NoDestructureConfig;\n}\n\nexport interface ExecutorResult {\n success: boolean;\n}\n\ninterface OverrideInfo {\n active: boolean;\n normalMode: string;\n expiresDate: string;\n}\n\ninterface ParsedConfig {\n methodLimit: number;\n methodMode: MethodMaxLimitMode;\n methodDisableAllowed: boolean;\n methodOverride: OverrideInfo | undefined;\n fileLimit: number;\n fileMode: FileMaxLimitMode;\n fileDisableAllowed: boolean;\n fileOverride: OverrideInfo | undefined;\n returnTypeMode: ReturnTypeMode;\n returnTypeDisableAllowed: boolean;\n returnTypeIgnoreEpoch: number | undefined;\n noInlineTypesMode: NoInlineTypesMode;\n noInlineTypesDisableAllowed: boolean;\n noInlineTypesIgnoreEpoch: number | undefined;\n noAnyUnknownMode: NoAnyUnknownMode;\n noAnyUnknownDisableAllowed: boolean;\n noAnyUnknownIgnoreEpoch: number | undefined;\n validateDtosMode: ValidateDtosMode;\n validateDtosDisableAllowed: boolean;\n validateDtosPrismaPath: string | undefined;\n validateDtosSrcPaths: string[];\n validateDtosIgnoreEpoch: number | undefined;\n prismaConverterMode: PrismaConverterMode;\n prismaConverterDisableAllowed: boolean;\n prismaConverterSchemaPath: string | undefined;\n prismaConverterConvertersPaths: string[];\n prismaConverterIgnoreEpoch: number | undefined;\n noDestructureMode: NoDestructureMode;\n noDestructureDisableAllowed: boolean;\n noDestructureIgnoreEpoch: number | undefined;\n}\n\ninterface ResolvedMethodMode {\n mode: MethodMaxLimitMode;\n override: OverrideInfo | undefined;\n}\n\ninterface ResolvedFileMode {\n mode: FileMaxLimitMode;\n override: OverrideInfo | undefined;\n}\n\nfunction formatEpochDate(epoch: number): string {\n return new Date(epoch * 1000).toISOString().split('T')[0];\n}\n\nfunction resolveMethodMode(\n normalMode: MethodMaxLimitMode, epoch: number | undefined\n): ResolvedMethodMode {\n if (epoch === undefined) {\n return { mode: normalMode, override: undefined };\n }\n const nowSeconds = Date.now() / 1000;\n if (nowSeconds < epoch) {\n // Active: downgrade to skip modified checking\n const downgraded: MethodMaxLimitMode =\n normalMode === 'OFF' ? 'OFF' : 'NEW_METHODS';\n return {\n mode: downgraded,\n override: { active: true, normalMode, expiresDate: formatEpochDate(epoch) },\n };\n }\n // Expired\n console.log(`\\n\\u26a0\\ufe0f methodMaxLimit.ignoreModifiedUntilEpoch (${epoch}) has expired (${formatEpochDate(epoch)}). Remove it from nx.json. Using normal mode: ${normalMode}\\n`);\n return { mode: normalMode, override: undefined };\n}\n\nfunction resolveFileMode(\n normalMode: FileMaxLimitMode, epoch: number | undefined\n): ResolvedFileMode {\n if (epoch === undefined) {\n return { mode: normalMode, override: undefined };\n }\n const nowSeconds = Date.now() / 1000;\n if (nowSeconds < epoch) {\n // Active: file checking is inherently about modified files, so skip entirely\n return {\n mode: 'OFF',\n override: { active: true, normalMode, expiresDate: formatEpochDate(epoch) },\n };\n }\n // Expired\n console.log(`\\n\\u26a0\\ufe0f fileMaxLimit.ignoreModifiedUntilEpoch (${epoch}) has expired (${formatEpochDate(epoch)}). Remove it from nx.json. Using normal mode: ${normalMode}\\n`);\n return { mode: normalMode, override: undefined };\n}\n\nfunction parseConfig(options: ValidateCodeOptions): ParsedConfig {\n const methodConfig: MethodMaxLimitConfig = options.methodMaxLimit ?? {};\n const fileConfig: FileMaxLimitConfig = options.fileMaxLimit ?? {};\n\n const normalMethodMode = methodConfig.mode ?? 'NEW_AND_MODIFIED_METHODS';\n const normalFileMode = fileConfig.mode ?? 'MODIFIED_FILES';\n\n const methodResolved = resolveMethodMode(normalMethodMode, methodConfig.ignoreModifiedUntilEpoch);\n const fileResolved = resolveFileMode(normalFileMode, fileConfig.ignoreModifiedUntilEpoch);\n\n return {\n methodLimit: methodConfig.limit ?? 80,\n methodMode: methodResolved.mode,\n methodDisableAllowed: methodConfig.disableAllowed ?? true,\n methodOverride: methodResolved.override,\n fileLimit: fileConfig.limit ?? 900,\n fileMode: fileResolved.mode,\n fileDisableAllowed: fileConfig.disableAllowed ?? true,\n fileOverride: fileResolved.override,\n returnTypeMode: options.requireReturnType?.mode ?? 'OFF',\n returnTypeDisableAllowed: options.requireReturnType?.disableAllowed ?? true,\n returnTypeIgnoreEpoch: options.requireReturnType?.ignoreModifiedUntilEpoch,\n noInlineTypesMode: options.noInlineTypeLiterals?.mode ?? 'OFF',\n noInlineTypesDisableAllowed: options.noInlineTypeLiterals?.disableAllowed ?? true,\n noInlineTypesIgnoreEpoch: options.noInlineTypeLiterals?.ignoreModifiedUntilEpoch,\n noAnyUnknownMode: options.noAnyUnknown?.mode ?? 'OFF',\n noAnyUnknownDisableAllowed: options.noAnyUnknown?.disableAllowed ?? true,\n noAnyUnknownIgnoreEpoch: options.noAnyUnknown?.ignoreModifiedUntilEpoch,\n validateDtosMode: options.validateDtos?.mode ?? 'OFF',\n validateDtosDisableAllowed: options.validateDtos?.disableAllowed ?? true,\n validateDtosPrismaPath: options.validateDtos?.prismaSchemaPath,\n validateDtosSrcPaths: options.validateDtos?.dtoSourcePaths ?? [],\n validateDtosIgnoreEpoch: options.validateDtos?.ignoreModifiedUntilEpoch,\n prismaConverterMode: options.prismaConverter?.mode ?? 'OFF',\n prismaConverterDisableAllowed: options.prismaConverter?.disableAllowed ?? true,\n prismaConverterSchemaPath: options.prismaConverter?.schemaPath,\n prismaConverterConvertersPaths: options.prismaConverter?.convertersPaths ?? [],\n prismaConverterIgnoreEpoch: options.prismaConverter?.ignoreModifiedUntilEpoch,\n noDestructureMode: options.noDestructure?.mode ?? 'OFF',\n noDestructureDisableAllowed: options.noDestructure?.disableAllowed ?? true,\n noDestructureIgnoreEpoch: options.noDestructure?.ignoreModifiedUntilEpoch,\n };\n}\n\nfunction formatOverride(override: OverrideInfo | undefined): string {\n if (!override) {\n return '';\n }\n return ` (override active, normal: ${override.normalMode}, expires: ${override.expiresDate})`;\n}\n\nfunction logConfig(config: ParsedConfig): void {\n console.log('\\n\\ud83d\\udccf Running Code Validations\\n');\n console.log(` Method limits: mode=${config.methodMode}${formatOverride(config.methodOverride)}, limit=${config.methodLimit}, disableAllowed=${config.methodDisableAllowed}`);\n console.log(` File limits: mode=${config.fileMode}${formatOverride(config.fileOverride)}, limit=${config.fileLimit}, disableAllowed=${config.fileDisableAllowed}`);\n console.log(` Require return types: mode=${config.returnTypeMode}, disableAllowed=${config.returnTypeDisableAllowed}`);\n console.log(` No inline type literals: mode=${config.noInlineTypesMode}, disableAllowed=${config.noInlineTypesDisableAllowed}`);\n console.log(` No any/unknown: mode=${config.noAnyUnknownMode}, disableAllowed=${config.noAnyUnknownDisableAllowed}`);\n console.log(` Validate DTOs: mode=${config.validateDtosMode}, disableAllowed=${config.validateDtosDisableAllowed}`);\n console.log(` Prisma converters: mode=${config.prismaConverterMode}, disableAllowed=${config.prismaConverterDisableAllowed}`);\n console.log(` No destructure: mode=${config.noDestructureMode}, disableAllowed=${config.noDestructureDisableAllowed}`);\n console.log('');\n}\n\nfunction isAllOff(config: ParsedConfig): boolean {\n return config.methodMode === 'OFF' && config.fileMode === 'OFF' &&\n config.returnTypeMode === 'OFF' && config.noInlineTypesMode === 'OFF' &&\n config.noAnyUnknownMode === 'OFF' && config.validateDtosMode === 'OFF' &&\n config.prismaConverterMode === 'OFF' && config.noDestructureMode === 'OFF';\n}\n\nasync function runMethodValidators(config: ParsedConfig, context: ExecutorContext): Promise<ExecutorResult[]> {\n const results: ExecutorResult[] = [];\n const runNew = config.methodMode === 'NEW_METHODS' || config.methodMode === 'NEW_AND_MODIFIED_METHODS';\n const runModified = config.methodMode === 'NEW_AND_MODIFIED_METHODS' || config.methodMode === 'MODIFIED_FILES';\n\n if (runNew) {\n results.push(await runNewMethodsExecutor({\n limit: config.methodLimit,\n mode: config.methodMode, disableAllowed: config.methodDisableAllowed,\n }, context));\n }\n if (runModified) {\n results.push(await runModifiedMethodsExecutor({\n limit: config.methodLimit, mode: config.methodMode, disableAllowed: config.methodDisableAllowed,\n }, context));\n }\n return results;\n}\n\nexport default async function runExecutor(\n options: ValidateCodeOptions,\n context: ExecutorContext\n): Promise<ExecutorResult> {\n const config = parseConfig(options);\n\n if (isAllOff(config)) {\n console.log('\\n\\u23ed\\ufe0f Skipping all code validations (all modes: OFF)\\n');\n return { success: true };\n }\n\n logConfig(config);\n\n const methodResults = await runMethodValidators(config, context);\n const fileResult = await runModifiedFilesExecutor({\n limit: config.fileLimit, mode: config.fileMode, disableAllowed: config.fileDisableAllowed,\n }, context);\n const returnTypesResult = await runReturnTypesExecutor({\n mode: config.returnTypeMode,\n disableAllowed: config.returnTypeDisableAllowed,\n ignoreModifiedUntilEpoch: config.returnTypeIgnoreEpoch,\n }, context);\n const noInlineTypesResult = await runNoInlineTypesExecutor({\n mode: config.noInlineTypesMode,\n disableAllowed: config.noInlineTypesDisableAllowed,\n ignoreModifiedUntilEpoch: config.noInlineTypesIgnoreEpoch,\n }, context);\n const noAnyUnknownResult = await runNoAnyUnknownExecutor({\n mode: config.noAnyUnknownMode,\n disableAllowed: config.noAnyUnknownDisableAllowed,\n ignoreModifiedUntilEpoch: config.noAnyUnknownIgnoreEpoch,\n }, context);\n const validateDtosResult = await runValidateDtosExecutor({\n mode: config.validateDtosMode,\n disableAllowed: config.validateDtosDisableAllowed,\n prismaSchemaPath: config.validateDtosPrismaPath,\n dtoSourcePaths: config.validateDtosSrcPaths,\n ignoreModifiedUntilEpoch: config.validateDtosIgnoreEpoch,\n }, context);\n const prismaConverterResult = await runPrismaConvertersExecutor({\n mode: config.prismaConverterMode,\n disableAllowed: config.prismaConverterDisableAllowed,\n schemaPath: config.prismaConverterSchemaPath,\n convertersPaths: config.prismaConverterConvertersPaths,\n ignoreModifiedUntilEpoch: config.prismaConverterIgnoreEpoch,\n }, context);\n const noDestructureResult = await runNoDestructureExecutor({\n mode: config.noDestructureMode,\n disableAllowed: config.noDestructureDisableAllowed,\n ignoreModifiedUntilEpoch: config.noDestructureIgnoreEpoch,\n }, context);\n\n const allSuccess = methodResults.every((r) => r.success) &&\n fileResult.success && returnTypesResult.success &&\n noInlineTypesResult.success && noAnyUnknownResult.success &&\n validateDtosResult.success && prismaConverterResult.success &&\n noDestructureResult.success;\n\n console.log(allSuccess ? '\\n\\u2705 All code validations passed\\n' : '\\n\\u274c Some code validations failed\\n');\n return { success: allSuccess };\n}\n"]}
|
|
@@ -7,6 +7,7 @@ import runNoInlineTypesExecutor, { NoInlineTypesMode } from '../validate-no-inli
|
|
|
7
7
|
import runNoAnyUnknownExecutor, { NoAnyUnknownMode } from '../validate-no-any-unknown/executor';
|
|
8
8
|
import runValidateDtosExecutor, { ValidateDtosMode } from '../validate-dtos/executor';
|
|
9
9
|
import runPrismaConvertersExecutor, { PrismaConverterMode } from '../validate-prisma-converters/executor';
|
|
10
|
+
import runNoDestructureExecutor, { NoDestructureMode } from '../validate-no-destructure/executor';
|
|
10
11
|
|
|
11
12
|
export type MethodMaxLimitMode = 'OFF' | 'NEW_METHODS' | 'NEW_AND_MODIFIED_METHODS' | 'MODIFIED_FILES';
|
|
12
13
|
export type FileMaxLimitMode = 'OFF' | 'MODIFIED_FILES';
|
|
@@ -25,8 +26,27 @@ export interface FileMaxLimitConfig {
|
|
|
25
26
|
ignoreModifiedUntilEpoch?: number;
|
|
26
27
|
}
|
|
27
28
|
|
|
29
|
+
export interface RequireReturnTypeConfig {
|
|
30
|
+
mode?: ReturnTypeMode;
|
|
31
|
+
disableAllowed?: boolean;
|
|
32
|
+
ignoreModifiedUntilEpoch?: number;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export interface NoInlineTypeLiteralsConfig {
|
|
36
|
+
mode?: NoInlineTypesMode;
|
|
37
|
+
disableAllowed?: boolean;
|
|
38
|
+
ignoreModifiedUntilEpoch?: number;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface NoAnyUnknownConfig {
|
|
42
|
+
mode?: NoAnyUnknownMode;
|
|
43
|
+
disableAllowed?: boolean;
|
|
44
|
+
ignoreModifiedUntilEpoch?: number;
|
|
45
|
+
}
|
|
46
|
+
|
|
28
47
|
export interface ValidateDtosConfig {
|
|
29
48
|
mode?: ValidateDtosMode;
|
|
49
|
+
disableAllowed?: boolean;
|
|
30
50
|
prismaSchemaPath?: string;
|
|
31
51
|
dtoSourcePaths?: string[];
|
|
32
52
|
ignoreModifiedUntilEpoch?: number;
|
|
@@ -34,19 +54,27 @@ export interface ValidateDtosConfig {
|
|
|
34
54
|
|
|
35
55
|
export interface PrismaConverterConfig {
|
|
36
56
|
mode?: PrismaConverterMode;
|
|
57
|
+
disableAllowed?: boolean;
|
|
37
58
|
schemaPath?: string;
|
|
38
59
|
convertersPaths?: string[];
|
|
39
60
|
ignoreModifiedUntilEpoch?: number;
|
|
40
61
|
}
|
|
41
62
|
|
|
63
|
+
export interface NoDestructureConfig {
|
|
64
|
+
mode?: NoDestructureMode;
|
|
65
|
+
disableAllowed?: boolean;
|
|
66
|
+
ignoreModifiedUntilEpoch?: number;
|
|
67
|
+
}
|
|
68
|
+
|
|
42
69
|
export interface ValidateCodeOptions {
|
|
43
70
|
methodMaxLimit?: MethodMaxLimitConfig;
|
|
44
71
|
fileMaxLimit?: FileMaxLimitConfig;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
72
|
+
requireReturnType?: RequireReturnTypeConfig;
|
|
73
|
+
noInlineTypeLiterals?: NoInlineTypeLiteralsConfig;
|
|
74
|
+
noAnyUnknown?: NoAnyUnknownConfig;
|
|
48
75
|
validateDtos?: ValidateDtosConfig;
|
|
49
76
|
prismaConverter?: PrismaConverterConfig;
|
|
77
|
+
noDestructure?: NoDestructureConfig;
|
|
50
78
|
}
|
|
51
79
|
|
|
52
80
|
export interface ExecutorResult {
|
|
@@ -69,16 +97,27 @@ interface ParsedConfig {
|
|
|
69
97
|
fileDisableAllowed: boolean;
|
|
70
98
|
fileOverride: OverrideInfo | undefined;
|
|
71
99
|
returnTypeMode: ReturnTypeMode;
|
|
100
|
+
returnTypeDisableAllowed: boolean;
|
|
101
|
+
returnTypeIgnoreEpoch: number | undefined;
|
|
72
102
|
noInlineTypesMode: NoInlineTypesMode;
|
|
103
|
+
noInlineTypesDisableAllowed: boolean;
|
|
104
|
+
noInlineTypesIgnoreEpoch: number | undefined;
|
|
73
105
|
noAnyUnknownMode: NoAnyUnknownMode;
|
|
106
|
+
noAnyUnknownDisableAllowed: boolean;
|
|
107
|
+
noAnyUnknownIgnoreEpoch: number | undefined;
|
|
74
108
|
validateDtosMode: ValidateDtosMode;
|
|
109
|
+
validateDtosDisableAllowed: boolean;
|
|
75
110
|
validateDtosPrismaPath: string | undefined;
|
|
76
111
|
validateDtosSrcPaths: string[];
|
|
77
112
|
validateDtosIgnoreEpoch: number | undefined;
|
|
78
113
|
prismaConverterMode: PrismaConverterMode;
|
|
114
|
+
prismaConverterDisableAllowed: boolean;
|
|
79
115
|
prismaConverterSchemaPath: string | undefined;
|
|
80
116
|
prismaConverterConvertersPaths: string[];
|
|
81
117
|
prismaConverterIgnoreEpoch: number | undefined;
|
|
118
|
+
noDestructureMode: NoDestructureMode;
|
|
119
|
+
noDestructureDisableAllowed: boolean;
|
|
120
|
+
noDestructureIgnoreEpoch: number | undefined;
|
|
82
121
|
}
|
|
83
122
|
|
|
84
123
|
interface ResolvedMethodMode {
|
|
@@ -154,17 +193,28 @@ function parseConfig(options: ValidateCodeOptions): ParsedConfig {
|
|
|
154
193
|
fileMode: fileResolved.mode,
|
|
155
194
|
fileDisableAllowed: fileConfig.disableAllowed ?? true,
|
|
156
195
|
fileOverride: fileResolved.override,
|
|
157
|
-
returnTypeMode: options.
|
|
158
|
-
|
|
159
|
-
|
|
196
|
+
returnTypeMode: options.requireReturnType?.mode ?? 'OFF',
|
|
197
|
+
returnTypeDisableAllowed: options.requireReturnType?.disableAllowed ?? true,
|
|
198
|
+
returnTypeIgnoreEpoch: options.requireReturnType?.ignoreModifiedUntilEpoch,
|
|
199
|
+
noInlineTypesMode: options.noInlineTypeLiterals?.mode ?? 'OFF',
|
|
200
|
+
noInlineTypesDisableAllowed: options.noInlineTypeLiterals?.disableAllowed ?? true,
|
|
201
|
+
noInlineTypesIgnoreEpoch: options.noInlineTypeLiterals?.ignoreModifiedUntilEpoch,
|
|
202
|
+
noAnyUnknownMode: options.noAnyUnknown?.mode ?? 'OFF',
|
|
203
|
+
noAnyUnknownDisableAllowed: options.noAnyUnknown?.disableAllowed ?? true,
|
|
204
|
+
noAnyUnknownIgnoreEpoch: options.noAnyUnknown?.ignoreModifiedUntilEpoch,
|
|
160
205
|
validateDtosMode: options.validateDtos?.mode ?? 'OFF',
|
|
206
|
+
validateDtosDisableAllowed: options.validateDtos?.disableAllowed ?? true,
|
|
161
207
|
validateDtosPrismaPath: options.validateDtos?.prismaSchemaPath,
|
|
162
208
|
validateDtosSrcPaths: options.validateDtos?.dtoSourcePaths ?? [],
|
|
163
209
|
validateDtosIgnoreEpoch: options.validateDtos?.ignoreModifiedUntilEpoch,
|
|
164
210
|
prismaConverterMode: options.prismaConverter?.mode ?? 'OFF',
|
|
211
|
+
prismaConverterDisableAllowed: options.prismaConverter?.disableAllowed ?? true,
|
|
165
212
|
prismaConverterSchemaPath: options.prismaConverter?.schemaPath,
|
|
166
213
|
prismaConverterConvertersPaths: options.prismaConverter?.convertersPaths ?? [],
|
|
167
214
|
prismaConverterIgnoreEpoch: options.prismaConverter?.ignoreModifiedUntilEpoch,
|
|
215
|
+
noDestructureMode: options.noDestructure?.mode ?? 'OFF',
|
|
216
|
+
noDestructureDisableAllowed: options.noDestructure?.disableAllowed ?? true,
|
|
217
|
+
noDestructureIgnoreEpoch: options.noDestructure?.ignoreModifiedUntilEpoch,
|
|
168
218
|
};
|
|
169
219
|
}
|
|
170
220
|
|
|
@@ -179,11 +229,12 @@ function logConfig(config: ParsedConfig): void {
|
|
|
179
229
|
console.log('\n\ud83d\udccf Running Code Validations\n');
|
|
180
230
|
console.log(` Method limits: mode=${config.methodMode}${formatOverride(config.methodOverride)}, limit=${config.methodLimit}, disableAllowed=${config.methodDisableAllowed}`);
|
|
181
231
|
console.log(` File limits: mode=${config.fileMode}${formatOverride(config.fileOverride)}, limit=${config.fileLimit}, disableAllowed=${config.fileDisableAllowed}`);
|
|
182
|
-
console.log(` Require return types:
|
|
183
|
-
console.log(` No inline type literals:
|
|
184
|
-
console.log(` No any/unknown:
|
|
185
|
-
console.log(` Validate DTOs:
|
|
186
|
-
console.log(` Prisma converters:
|
|
232
|
+
console.log(` Require return types: mode=${config.returnTypeMode}, disableAllowed=${config.returnTypeDisableAllowed}`);
|
|
233
|
+
console.log(` No inline type literals: mode=${config.noInlineTypesMode}, disableAllowed=${config.noInlineTypesDisableAllowed}`);
|
|
234
|
+
console.log(` No any/unknown: mode=${config.noAnyUnknownMode}, disableAllowed=${config.noAnyUnknownDisableAllowed}`);
|
|
235
|
+
console.log(` Validate DTOs: mode=${config.validateDtosMode}, disableAllowed=${config.validateDtosDisableAllowed}`);
|
|
236
|
+
console.log(` Prisma converters: mode=${config.prismaConverterMode}, disableAllowed=${config.prismaConverterDisableAllowed}`);
|
|
237
|
+
console.log(` No destructure: mode=${config.noDestructureMode}, disableAllowed=${config.noDestructureDisableAllowed}`);
|
|
187
238
|
console.log('');
|
|
188
239
|
}
|
|
189
240
|
|
|
@@ -191,7 +242,7 @@ function isAllOff(config: ParsedConfig): boolean {
|
|
|
191
242
|
return config.methodMode === 'OFF' && config.fileMode === 'OFF' &&
|
|
192
243
|
config.returnTypeMode === 'OFF' && config.noInlineTypesMode === 'OFF' &&
|
|
193
244
|
config.noAnyUnknownMode === 'OFF' && config.validateDtosMode === 'OFF' &&
|
|
194
|
-
config.prismaConverterMode === 'OFF';
|
|
245
|
+
config.prismaConverterMode === 'OFF' && config.noDestructureMode === 'OFF';
|
|
195
246
|
}
|
|
196
247
|
|
|
197
248
|
async function runMethodValidators(config: ParsedConfig, context: ExecutorContext): Promise<ExecutorResult[]> {
|
|
@@ -230,26 +281,46 @@ export default async function runExecutor(
|
|
|
230
281
|
const fileResult = await runModifiedFilesExecutor({
|
|
231
282
|
limit: config.fileLimit, mode: config.fileMode, disableAllowed: config.fileDisableAllowed,
|
|
232
283
|
}, context);
|
|
233
|
-
const returnTypesResult = await runReturnTypesExecutor({
|
|
234
|
-
|
|
235
|
-
|
|
284
|
+
const returnTypesResult = await runReturnTypesExecutor({
|
|
285
|
+
mode: config.returnTypeMode,
|
|
286
|
+
disableAllowed: config.returnTypeDisableAllowed,
|
|
287
|
+
ignoreModifiedUntilEpoch: config.returnTypeIgnoreEpoch,
|
|
288
|
+
}, context);
|
|
289
|
+
const noInlineTypesResult = await runNoInlineTypesExecutor({
|
|
290
|
+
mode: config.noInlineTypesMode,
|
|
291
|
+
disableAllowed: config.noInlineTypesDisableAllowed,
|
|
292
|
+
ignoreModifiedUntilEpoch: config.noInlineTypesIgnoreEpoch,
|
|
293
|
+
}, context);
|
|
294
|
+
const noAnyUnknownResult = await runNoAnyUnknownExecutor({
|
|
295
|
+
mode: config.noAnyUnknownMode,
|
|
296
|
+
disableAllowed: config.noAnyUnknownDisableAllowed,
|
|
297
|
+
ignoreModifiedUntilEpoch: config.noAnyUnknownIgnoreEpoch,
|
|
298
|
+
}, context);
|
|
236
299
|
const validateDtosResult = await runValidateDtosExecutor({
|
|
237
300
|
mode: config.validateDtosMode,
|
|
301
|
+
disableAllowed: config.validateDtosDisableAllowed,
|
|
238
302
|
prismaSchemaPath: config.validateDtosPrismaPath,
|
|
239
303
|
dtoSourcePaths: config.validateDtosSrcPaths,
|
|
240
304
|
ignoreModifiedUntilEpoch: config.validateDtosIgnoreEpoch,
|
|
241
305
|
}, context);
|
|
242
306
|
const prismaConverterResult = await runPrismaConvertersExecutor({
|
|
243
307
|
mode: config.prismaConverterMode,
|
|
308
|
+
disableAllowed: config.prismaConverterDisableAllowed,
|
|
244
309
|
schemaPath: config.prismaConverterSchemaPath,
|
|
245
310
|
convertersPaths: config.prismaConverterConvertersPaths,
|
|
246
311
|
ignoreModifiedUntilEpoch: config.prismaConverterIgnoreEpoch,
|
|
247
312
|
}, context);
|
|
313
|
+
const noDestructureResult = await runNoDestructureExecutor({
|
|
314
|
+
mode: config.noDestructureMode,
|
|
315
|
+
disableAllowed: config.noDestructureDisableAllowed,
|
|
316
|
+
ignoreModifiedUntilEpoch: config.noDestructureIgnoreEpoch,
|
|
317
|
+
}, context);
|
|
248
318
|
|
|
249
319
|
const allSuccess = methodResults.every((r) => r.success) &&
|
|
250
320
|
fileResult.success && returnTypesResult.success &&
|
|
251
321
|
noInlineTypesResult.success && noAnyUnknownResult.success &&
|
|
252
|
-
validateDtosResult.success && prismaConverterResult.success
|
|
322
|
+
validateDtosResult.success && prismaConverterResult.success &&
|
|
323
|
+
noDestructureResult.success;
|
|
253
324
|
|
|
254
325
|
console.log(allSuccess ? '\n\u2705 All code validations passed\n' : '\n\u274c Some code validations failed\n');
|
|
255
326
|
return { success: allSuccess };
|
|
@@ -56,23 +56,68 @@
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
|
-
"
|
|
60
|
-
"type": "
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
|
|
59
|
+
"requireReturnType": {
|
|
60
|
+
"type": "object",
|
|
61
|
+
"description": "Configuration for return type validation",
|
|
62
|
+
"properties": {
|
|
63
|
+
"mode": {
|
|
64
|
+
"type": "string",
|
|
65
|
+
"enum": ["OFF", "NEW_METHODS", "NEW_AND_MODIFIED_METHODS", "MODIFIED_FILES"],
|
|
66
|
+
"description": "OFF: skip return type validation. NEW_METHODS: only new methods in diff. NEW_AND_MODIFIED_METHODS: new methods + methods with changes. MODIFIED_FILES: all methods in modified files.",
|
|
67
|
+
"default": "OFF"
|
|
68
|
+
},
|
|
69
|
+
"disableAllowed": {
|
|
70
|
+
"type": "boolean",
|
|
71
|
+
"description": "Whether disable comments work. When false, no escape hatch.",
|
|
72
|
+
"default": true
|
|
73
|
+
},
|
|
74
|
+
"ignoreModifiedUntilEpoch": {
|
|
75
|
+
"type": "number",
|
|
76
|
+
"description": "Epoch seconds. Until this time, skip validation entirely. When expired, normal mode resumes. Omit when not needed."
|
|
77
|
+
}
|
|
78
|
+
}
|
|
64
79
|
},
|
|
65
|
-
"
|
|
66
|
-
"type": "
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
|
|
80
|
+
"noInlineTypeLiterals": {
|
|
81
|
+
"type": "object",
|
|
82
|
+
"description": "Configuration for no-inline-types validation",
|
|
83
|
+
"properties": {
|
|
84
|
+
"mode": {
|
|
85
|
+
"type": "string",
|
|
86
|
+
"enum": ["OFF", "NEW_METHODS", "NEW_AND_MODIFIED_METHODS", "MODIFIED_FILES"],
|
|
87
|
+
"description": "OFF: skip validation. NEW_METHODS: only new methods. NEW_AND_MODIFIED_METHODS: new + modified methods. MODIFIED_FILES: all in modified files. Disallows inline type literals like { x: number } - use named types instead.",
|
|
88
|
+
"default": "OFF"
|
|
89
|
+
},
|
|
90
|
+
"disableAllowed": {
|
|
91
|
+
"type": "boolean",
|
|
92
|
+
"description": "Whether disable comments work. When false, no escape hatch.",
|
|
93
|
+
"default": true
|
|
94
|
+
},
|
|
95
|
+
"ignoreModifiedUntilEpoch": {
|
|
96
|
+
"type": "number",
|
|
97
|
+
"description": "Epoch seconds. Until this time, skip validation entirely. When expired, normal mode resumes. Omit when not needed."
|
|
98
|
+
}
|
|
99
|
+
}
|
|
70
100
|
},
|
|
71
|
-
"
|
|
72
|
-
"type": "
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
|
|
101
|
+
"noAnyUnknown": {
|
|
102
|
+
"type": "object",
|
|
103
|
+
"description": "Configuration for no-any-unknown validation",
|
|
104
|
+
"properties": {
|
|
105
|
+
"mode": {
|
|
106
|
+
"type": "string",
|
|
107
|
+
"enum": ["OFF", "MODIFIED_CODE", "MODIFIED_FILES"],
|
|
108
|
+
"description": "OFF: skip validation. MODIFIED_CODE: only changed lines in diff. MODIFIED_FILES: all in modified files. Disallows `any` and `unknown` TypeScript keywords.",
|
|
109
|
+
"default": "OFF"
|
|
110
|
+
},
|
|
111
|
+
"disableAllowed": {
|
|
112
|
+
"type": "boolean",
|
|
113
|
+
"description": "Whether disable comments work. When false, no escape hatch.",
|
|
114
|
+
"default": true
|
|
115
|
+
},
|
|
116
|
+
"ignoreModifiedUntilEpoch": {
|
|
117
|
+
"type": "number",
|
|
118
|
+
"description": "Epoch seconds. Until this time, skip validation entirely. When expired, normal mode resumes. Omit when not needed."
|
|
119
|
+
}
|
|
120
|
+
}
|
|
76
121
|
},
|
|
77
122
|
"validateDtos": {
|
|
78
123
|
"type": "object",
|
|
@@ -84,6 +129,11 @@
|
|
|
84
129
|
"description": "OFF: skip validation. MODIFIED_CLASS: only validate Dto classes with changed lines. MODIFIED_FILES: validate all Dtos in modified files.",
|
|
85
130
|
"default": "OFF"
|
|
86
131
|
},
|
|
132
|
+
"disableAllowed": {
|
|
133
|
+
"type": "boolean",
|
|
134
|
+
"description": "Whether @deprecated field exemption works. When false, all fields must match.",
|
|
135
|
+
"default": true
|
|
136
|
+
},
|
|
87
137
|
"prismaSchemaPath": {
|
|
88
138
|
"type": "string",
|
|
89
139
|
"description": "Relative path from workspace root to schema.prisma"
|
|
@@ -109,6 +159,11 @@
|
|
|
109
159
|
"description": "OFF: skip validation. MODIFIED_FILES: validate converter and non-converter files modified in the diff.",
|
|
110
160
|
"default": "OFF"
|
|
111
161
|
},
|
|
162
|
+
"disableAllowed": {
|
|
163
|
+
"type": "boolean",
|
|
164
|
+
"description": "Whether disable comments work. When false, no escape hatch.",
|
|
165
|
+
"default": true
|
|
166
|
+
},
|
|
112
167
|
"schemaPath": {
|
|
113
168
|
"type": "string",
|
|
114
169
|
"description": "Relative path from workspace root to schema.prisma"
|
|
@@ -123,6 +178,27 @@
|
|
|
123
178
|
"description": "Epoch seconds. Until this time, skip prisma-converter validation entirely. When expired, normal mode resumes. Omit when not needed."
|
|
124
179
|
}
|
|
125
180
|
}
|
|
181
|
+
},
|
|
182
|
+
"noDestructure": {
|
|
183
|
+
"type": "object",
|
|
184
|
+
"description": "Validate no destructuring patterns are used. Destructuring hurts code traceability.",
|
|
185
|
+
"properties": {
|
|
186
|
+
"mode": {
|
|
187
|
+
"type": "string",
|
|
188
|
+
"enum": ["OFF", "MODIFIED_CODE", "MODIFIED_FILES"],
|
|
189
|
+
"description": "OFF: skip validation. MODIFIED_CODE: only changed lines in diff. MODIFIED_FILES: all in modified files. Disallows destructuring patterns.",
|
|
190
|
+
"default": "OFF"
|
|
191
|
+
},
|
|
192
|
+
"disableAllowed": {
|
|
193
|
+
"type": "boolean",
|
|
194
|
+
"description": "Whether disable comments work. When false, no escape hatch.",
|
|
195
|
+
"default": true
|
|
196
|
+
},
|
|
197
|
+
"ignoreModifiedUntilEpoch": {
|
|
198
|
+
"type": "number",
|
|
199
|
+
"description": "Epoch seconds. Until this time, skip validation entirely. When expired, normal mode resumes. Omit when not needed."
|
|
200
|
+
}
|
|
201
|
+
}
|
|
126
202
|
}
|
|
127
203
|
},
|
|
128
204
|
"required": []
|
|
@@ -31,6 +31,7 @@ import type { ExecutorContext } from '@nx/devkit';
|
|
|
31
31
|
export type ValidateDtosMode = 'OFF' | 'MODIFIED_CLASS' | 'MODIFIED_FILES';
|
|
32
32
|
export interface ValidateDtosOptions {
|
|
33
33
|
mode?: ValidateDtosMode;
|
|
34
|
+
disableAllowed?: boolean;
|
|
34
35
|
prismaSchemaPath?: string;
|
|
35
36
|
dtoSourcePaths?: string[];
|
|
36
37
|
ignoreModifiedUntilEpoch?: number;
|