@webpieces/rules-config 0.3.171 → 0.3.174

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webpieces/rules-config",
3
- "version": "0.3.171",
3
+ "version": "0.3.174",
4
4
  "description": "Shared webpieces.config.json loader. Single source of truth for validation rule configuration consumed by @webpieces/ai-hook-rules, @webpieces/code-rules, and @webpieces/nx-webpieces-rules.",
5
5
  "type": "commonjs",
6
6
  "main": "./src/index.js",
@@ -0,0 +1,28 @@
1
+ import { MaxMethodLinesConfig, MaxFileLinesConfig, RequireReturnTypeConfig, NoInlineTypeLiteralsConfig, NoAnyUnknownConfig, NoImplicitAnyConfig, PrismaValidateDtosConfig, PrismaConverterConfig, NoDestructureConfig, NoUnmanagedExceptionsConfig, CatchErrorPatternConfig, ThrowCauseRequiredConfig, AngularNoDirectApiInResolverConfig, NoSymbolDiTokensConfig, NoShellSubstitutionConfig, BranchCreationGuardConfig, PrCreationGuardConfig, PrMergeCleanupConfig, NoDirectMainUpdateConfig, NoEditOnMainConfig, NoFileImportCyclesConfig, RuntimeArchitectureConfig, NoJsFilesConfig, ValidateTsInSrcConfig } from './rule-configs';
2
+ export declare class WebpiecesRulesConfig {
3
+ 'max-method-lines'?: MaxMethodLinesConfig;
4
+ 'max-file-lines'?: MaxFileLinesConfig;
5
+ 'require-return-type'?: RequireReturnTypeConfig;
6
+ 'no-inline-type-literals'?: NoInlineTypeLiteralsConfig;
7
+ 'no-any-unknown'?: NoAnyUnknownConfig;
8
+ 'no-implicit-any'?: NoImplicitAnyConfig;
9
+ 'prisma-validate-dtos'?: PrismaValidateDtosConfig;
10
+ 'prisma-converter'?: PrismaConverterConfig;
11
+ 'no-destructure'?: NoDestructureConfig;
12
+ 'no-unmanaged-exceptions'?: NoUnmanagedExceptionsConfig;
13
+ 'catch-error-pattern'?: CatchErrorPatternConfig;
14
+ 'throw-cause-required'?: ThrowCauseRequiredConfig;
15
+ 'angular-no-direct-api-in-resolver'?: AngularNoDirectApiInResolverConfig;
16
+ 'no-symbol-di-tokens'?: NoSymbolDiTokensConfig;
17
+ 'no-shell-substitution'?: NoShellSubstitutionConfig;
18
+ 'branch-creation-guard'?: BranchCreationGuardConfig;
19
+ 'pr-creation-guard'?: PrCreationGuardConfig;
20
+ 'pr-merge-cleanup'?: PrMergeCleanupConfig;
21
+ 'no-direct-main-update'?: NoDirectMainUpdateConfig;
22
+ 'no-edit-on-main'?: NoEditOnMainConfig;
23
+ 'no-file-import-cycles'?: NoFileImportCyclesConfig;
24
+ 'runtime-architecture'?: RuntimeArchitectureConfig;
25
+ 'no-js-files'?: NoJsFilesConfig;
26
+ 'validate-ts-in-src'?: ValidateTsInSrcConfig;
27
+ rulesDir?: string[];
28
+ }
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.WebpiecesRulesConfig = void 0;
4
+ class WebpiecesRulesConfig {
5
+ 'max-method-lines';
6
+ 'max-file-lines';
7
+ 'require-return-type';
8
+ 'no-inline-type-literals';
9
+ 'no-any-unknown';
10
+ 'no-implicit-any';
11
+ 'prisma-validate-dtos';
12
+ 'prisma-converter';
13
+ 'no-destructure';
14
+ 'no-unmanaged-exceptions';
15
+ 'catch-error-pattern';
16
+ 'throw-cause-required';
17
+ 'angular-no-direct-api-in-resolver';
18
+ 'no-symbol-di-tokens';
19
+ 'no-shell-substitution';
20
+ 'branch-creation-guard';
21
+ 'pr-creation-guard';
22
+ 'pr-merge-cleanup';
23
+ 'no-direct-main-update';
24
+ 'no-edit-on-main';
25
+ 'no-file-import-cycles';
26
+ 'runtime-architecture';
27
+ 'no-js-files';
28
+ 'validate-ts-in-src';
29
+ rulesDir;
30
+ }
31
+ exports.WebpiecesRulesConfig = WebpiecesRulesConfig;
32
+ //# sourceMappingURL=WebpiecesRulesConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WebpiecesRulesConfig.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/WebpiecesRulesConfig.ts"],"names":[],"mappings":";;;AA2BA,MAAa,oBAAoB;IAC7B,kBAAkB,CAAwB;IAC1C,gBAAgB,CAAsB;IACtC,qBAAqB,CAA2B;IAChD,yBAAyB,CAA8B;IACvD,gBAAgB,CAAsB;IACtC,iBAAiB,CAAuB;IACxC,sBAAsB,CAA4B;IAClD,kBAAkB,CAAyB;IAC3C,gBAAgB,CAAuB;IACvC,yBAAyB,CAA+B;IACxD,qBAAqB,CAA2B;IAChD,sBAAsB,CAA4B;IAClD,mCAAmC,CAAsC;IACzE,qBAAqB,CAA0B;IAC/C,uBAAuB,CAA6B;IACpD,uBAAuB,CAA6B;IACpD,mBAAmB,CAAyB;IAC5C,kBAAkB,CAAwB;IAC1C,uBAAuB,CAA4B;IACnD,iBAAiB,CAAsB;IACvC,uBAAuB,CAA4B;IACnD,sBAAsB,CAA6B;IACnD,aAAa,CAAmB;IAChC,oBAAoB,CAAyB;IAC7C,QAAQ,CAAY;CACvB;AA1BD,oDA0BC","sourcesContent":["import {\n MaxMethodLinesConfig,\n MaxFileLinesConfig,\n RequireReturnTypeConfig,\n NoInlineTypeLiteralsConfig,\n NoAnyUnknownConfig,\n NoImplicitAnyConfig,\n PrismaValidateDtosConfig,\n PrismaConverterConfig,\n NoDestructureConfig,\n NoUnmanagedExceptionsConfig,\n CatchErrorPatternConfig,\n ThrowCauseRequiredConfig,\n AngularNoDirectApiInResolverConfig,\n NoSymbolDiTokensConfig,\n NoShellSubstitutionConfig,\n BranchCreationGuardConfig,\n PrCreationGuardConfig,\n PrMergeCleanupConfig,\n NoDirectMainUpdateConfig,\n NoEditOnMainConfig,\n NoFileImportCyclesConfig,\n RuntimeArchitectureConfig,\n NoJsFilesConfig,\n ValidateTsInSrcConfig,\n} from './rule-configs';\n\nexport class WebpiecesRulesConfig {\n 'max-method-lines'?: MaxMethodLinesConfig;\n 'max-file-lines'?: MaxFileLinesConfig;\n 'require-return-type'?: RequireReturnTypeConfig;\n 'no-inline-type-literals'?: NoInlineTypeLiteralsConfig;\n 'no-any-unknown'?: NoAnyUnknownConfig;\n 'no-implicit-any'?: NoImplicitAnyConfig;\n 'prisma-validate-dtos'?: PrismaValidateDtosConfig;\n 'prisma-converter'?: PrismaConverterConfig;\n 'no-destructure'?: NoDestructureConfig;\n 'no-unmanaged-exceptions'?: NoUnmanagedExceptionsConfig;\n 'catch-error-pattern'?: CatchErrorPatternConfig;\n 'throw-cause-required'?: ThrowCauseRequiredConfig;\n 'angular-no-direct-api-in-resolver'?: AngularNoDirectApiInResolverConfig;\n 'no-symbol-di-tokens'?: NoSymbolDiTokensConfig;\n 'no-shell-substitution'?: NoShellSubstitutionConfig;\n 'branch-creation-guard'?: BranchCreationGuardConfig;\n 'pr-creation-guard'?: PrCreationGuardConfig;\n 'pr-merge-cleanup'?: PrMergeCleanupConfig;\n 'no-direct-main-update'?: NoDirectMainUpdateConfig;\n 'no-edit-on-main'?: NoEditOnMainConfig;\n 'no-file-import-cycles'?: NoFileImportCyclesConfig;\n 'runtime-architecture'?: RuntimeArchitectureConfig;\n 'no-js-files'?: NoJsFilesConfig;\n 'validate-ts-in-src'?: ValidateTsInSrcConfig;\n rulesDir?: string[];\n}\n"]}
@@ -0,0 +1,10 @@
1
+ type FieldType = 'string' | 'number' | 'boolean' | 'string[]';
2
+ export declare class FieldDef {
3
+ readonly type: FieldType;
4
+ readonly enumValues?: readonly string[] | undefined;
5
+ constructor(type: FieldType, enumValues?: readonly string[] | undefined);
6
+ }
7
+ export type SchemaShape<T> = {
8
+ [K in keyof Required<T>]: FieldDef;
9
+ };
10
+ export {};
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.FieldDef = void 0;
4
+ class FieldDef {
5
+ type;
6
+ enumValues;
7
+ constructor(type, enumValues) {
8
+ this.type = type;
9
+ this.enumValues = enumValues;
10
+ }
11
+ }
12
+ exports.FieldDef = FieldDef;
13
+ //# sourceMappingURL=field-def.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"field-def.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/field-def.ts"],"names":[],"mappings":";;;AAEA,MAAa,QAAQ;IAEJ;IACA;IAFb,YACa,IAAe,EACf,UAA8B;QAD9B,SAAI,GAAJ,IAAI,CAAW;QACf,eAAU,GAAV,UAAU,CAAoB;IACxC,CAAC;CACP;AALD,4BAKC","sourcesContent":["type FieldType = 'string' | 'number' | 'boolean' | 'string[]';\n\nexport class FieldDef {\n constructor(\n readonly type: FieldType,\n readonly enumValues?: readonly string[],\n ) {}\n}\n\n// Enforces that a static SCHEMA has exactly the same keys as the config class.\n// Add a field to the class → TS errors until SCHEMA is updated.\n// Add to SCHEMA without adding to class → TS errors (extra property).\nexport type SchemaShape<T> = { [K in keyof Required<T>]: FieldDef };\n"]}
package/src/index.d.ts CHANGED
@@ -1,7 +1,13 @@
1
1
  export { ResolvedConfig, ResolvedRuleConfig, RuleOptions } from './types';
2
2
  export { InformAiError } from './inform-ai-error';
3
3
  export { toError } from './to-error';
4
- export { loadConfig, findConfigFile, CONFIG_FILENAME } from './load-config';
4
+ export { loadConfig, findConfigFile, CONFIG_FILENAME, loadWebpiecesRulesConfig } from './load-config';
5
+ export type { LoadedWebpiecesConfig } from './load-config';
5
6
  export { isPathExcluded } from './exclude-paths';
6
7
  export { defaultRules, defaultRulesDir } from './default-rules';
7
8
  export { loadTemplate, writeTemplateIfMissing, writeTemplate } from './load-template';
9
+ export { validateWebpiecesConfig } from './validate-config';
10
+ export { FieldDef } from './field-def';
11
+ export type { SchemaShape } from './field-def';
12
+ export { WebpiecesRulesConfig } from './WebpiecesRulesConfig';
13
+ export { MaxMethodLinesConfig, MaxFileLinesConfig, RequireReturnTypeConfig, NoInlineTypeLiteralsConfig, NoAnyUnknownConfig, NoImplicitAnyConfig, PrismaValidateDtosConfig, PrismaConverterConfig, NoDestructureConfig, NoUnmanagedExceptionsConfig, CatchErrorPatternConfig, ThrowCauseRequiredConfig, AngularNoDirectApiInResolverConfig, NoSymbolDiTokensConfig, NoShellSubstitutionConfig, BranchCreationGuardConfig, PrCreationGuardConfig, PrMergeCleanupConfig, NoDirectMainUpdateConfig, NoEditOnMainConfig, NoFileImportCyclesConfig, RuntimeArchitectureConfig, NoJsFilesConfig, ValidateTsInSrcConfig, } from './rule-configs';
package/src/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.writeTemplate = exports.writeTemplateIfMissing = exports.loadTemplate = exports.defaultRulesDir = exports.defaultRules = exports.isPathExcluded = exports.CONFIG_FILENAME = exports.findConfigFile = exports.loadConfig = exports.toError = exports.InformAiError = exports.ResolvedRuleConfig = exports.ResolvedConfig = void 0;
3
+ exports.ValidateTsInSrcConfig = exports.NoJsFilesConfig = exports.RuntimeArchitectureConfig = exports.NoFileImportCyclesConfig = exports.NoEditOnMainConfig = exports.NoDirectMainUpdateConfig = exports.PrMergeCleanupConfig = exports.PrCreationGuardConfig = exports.BranchCreationGuardConfig = exports.NoShellSubstitutionConfig = exports.NoSymbolDiTokensConfig = exports.AngularNoDirectApiInResolverConfig = exports.ThrowCauseRequiredConfig = exports.CatchErrorPatternConfig = exports.NoUnmanagedExceptionsConfig = exports.NoDestructureConfig = exports.PrismaConverterConfig = exports.PrismaValidateDtosConfig = exports.NoImplicitAnyConfig = exports.NoAnyUnknownConfig = exports.NoInlineTypeLiteralsConfig = exports.RequireReturnTypeConfig = exports.MaxFileLinesConfig = exports.MaxMethodLinesConfig = exports.WebpiecesRulesConfig = exports.FieldDef = exports.validateWebpiecesConfig = exports.writeTemplate = exports.writeTemplateIfMissing = exports.loadTemplate = exports.defaultRulesDir = exports.defaultRules = exports.isPathExcluded = exports.loadWebpiecesRulesConfig = exports.CONFIG_FILENAME = exports.findConfigFile = exports.loadConfig = exports.toError = exports.InformAiError = exports.ResolvedRuleConfig = exports.ResolvedConfig = void 0;
4
4
  var types_1 = require("./types");
5
5
  Object.defineProperty(exports, "ResolvedConfig", { enumerable: true, get: function () { return types_1.ResolvedConfig; } });
6
6
  Object.defineProperty(exports, "ResolvedRuleConfig", { enumerable: true, get: function () { return types_1.ResolvedRuleConfig; } });
@@ -12,6 +12,7 @@ var load_config_1 = require("./load-config");
12
12
  Object.defineProperty(exports, "loadConfig", { enumerable: true, get: function () { return load_config_1.loadConfig; } });
13
13
  Object.defineProperty(exports, "findConfigFile", { enumerable: true, get: function () { return load_config_1.findConfigFile; } });
14
14
  Object.defineProperty(exports, "CONFIG_FILENAME", { enumerable: true, get: function () { return load_config_1.CONFIG_FILENAME; } });
15
+ Object.defineProperty(exports, "loadWebpiecesRulesConfig", { enumerable: true, get: function () { return load_config_1.loadWebpiecesRulesConfig; } });
15
16
  var exclude_paths_1 = require("./exclude-paths");
16
17
  Object.defineProperty(exports, "isPathExcluded", { enumerable: true, get: function () { return exclude_paths_1.isPathExcluded; } });
17
18
  var default_rules_1 = require("./default-rules");
@@ -21,4 +22,35 @@ var load_template_1 = require("./load-template");
21
22
  Object.defineProperty(exports, "loadTemplate", { enumerable: true, get: function () { return load_template_1.loadTemplate; } });
22
23
  Object.defineProperty(exports, "writeTemplateIfMissing", { enumerable: true, get: function () { return load_template_1.writeTemplateIfMissing; } });
23
24
  Object.defineProperty(exports, "writeTemplate", { enumerable: true, get: function () { return load_template_1.writeTemplate; } });
25
+ var validate_config_1 = require("./validate-config");
26
+ Object.defineProperty(exports, "validateWebpiecesConfig", { enumerable: true, get: function () { return validate_config_1.validateWebpiecesConfig; } });
27
+ var field_def_1 = require("./field-def");
28
+ Object.defineProperty(exports, "FieldDef", { enumerable: true, get: function () { return field_def_1.FieldDef; } });
29
+ var WebpiecesRulesConfig_1 = require("./WebpiecesRulesConfig");
30
+ Object.defineProperty(exports, "WebpiecesRulesConfig", { enumerable: true, get: function () { return WebpiecesRulesConfig_1.WebpiecesRulesConfig; } });
31
+ var rule_configs_1 = require("./rule-configs");
32
+ Object.defineProperty(exports, "MaxMethodLinesConfig", { enumerable: true, get: function () { return rule_configs_1.MaxMethodLinesConfig; } });
33
+ Object.defineProperty(exports, "MaxFileLinesConfig", { enumerable: true, get: function () { return rule_configs_1.MaxFileLinesConfig; } });
34
+ Object.defineProperty(exports, "RequireReturnTypeConfig", { enumerable: true, get: function () { return rule_configs_1.RequireReturnTypeConfig; } });
35
+ Object.defineProperty(exports, "NoInlineTypeLiteralsConfig", { enumerable: true, get: function () { return rule_configs_1.NoInlineTypeLiteralsConfig; } });
36
+ Object.defineProperty(exports, "NoAnyUnknownConfig", { enumerable: true, get: function () { return rule_configs_1.NoAnyUnknownConfig; } });
37
+ Object.defineProperty(exports, "NoImplicitAnyConfig", { enumerable: true, get: function () { return rule_configs_1.NoImplicitAnyConfig; } });
38
+ Object.defineProperty(exports, "PrismaValidateDtosConfig", { enumerable: true, get: function () { return rule_configs_1.PrismaValidateDtosConfig; } });
39
+ Object.defineProperty(exports, "PrismaConverterConfig", { enumerable: true, get: function () { return rule_configs_1.PrismaConverterConfig; } });
40
+ Object.defineProperty(exports, "NoDestructureConfig", { enumerable: true, get: function () { return rule_configs_1.NoDestructureConfig; } });
41
+ Object.defineProperty(exports, "NoUnmanagedExceptionsConfig", { enumerable: true, get: function () { return rule_configs_1.NoUnmanagedExceptionsConfig; } });
42
+ Object.defineProperty(exports, "CatchErrorPatternConfig", { enumerable: true, get: function () { return rule_configs_1.CatchErrorPatternConfig; } });
43
+ Object.defineProperty(exports, "ThrowCauseRequiredConfig", { enumerable: true, get: function () { return rule_configs_1.ThrowCauseRequiredConfig; } });
44
+ Object.defineProperty(exports, "AngularNoDirectApiInResolverConfig", { enumerable: true, get: function () { return rule_configs_1.AngularNoDirectApiInResolverConfig; } });
45
+ Object.defineProperty(exports, "NoSymbolDiTokensConfig", { enumerable: true, get: function () { return rule_configs_1.NoSymbolDiTokensConfig; } });
46
+ Object.defineProperty(exports, "NoShellSubstitutionConfig", { enumerable: true, get: function () { return rule_configs_1.NoShellSubstitutionConfig; } });
47
+ Object.defineProperty(exports, "BranchCreationGuardConfig", { enumerable: true, get: function () { return rule_configs_1.BranchCreationGuardConfig; } });
48
+ Object.defineProperty(exports, "PrCreationGuardConfig", { enumerable: true, get: function () { return rule_configs_1.PrCreationGuardConfig; } });
49
+ Object.defineProperty(exports, "PrMergeCleanupConfig", { enumerable: true, get: function () { return rule_configs_1.PrMergeCleanupConfig; } });
50
+ Object.defineProperty(exports, "NoDirectMainUpdateConfig", { enumerable: true, get: function () { return rule_configs_1.NoDirectMainUpdateConfig; } });
51
+ Object.defineProperty(exports, "NoEditOnMainConfig", { enumerable: true, get: function () { return rule_configs_1.NoEditOnMainConfig; } });
52
+ Object.defineProperty(exports, "NoFileImportCyclesConfig", { enumerable: true, get: function () { return rule_configs_1.NoFileImportCyclesConfig; } });
53
+ Object.defineProperty(exports, "RuntimeArchitectureConfig", { enumerable: true, get: function () { return rule_configs_1.RuntimeArchitectureConfig; } });
54
+ Object.defineProperty(exports, "NoJsFilesConfig", { enumerable: true, get: function () { return rule_configs_1.NoJsFilesConfig; } });
55
+ Object.defineProperty(exports, "ValidateTsInSrcConfig", { enumerable: true, get: function () { return rule_configs_1.ValidateTsInSrcConfig; } });
24
56
  //# sourceMappingURL=index.js.map
package/src/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/index.ts"],"names":[],"mappings":";;;AAAA,iCAA0E;AAAjE,uGAAA,cAAc,OAAA;AAAE,2GAAA,kBAAkB,OAAA;AAC3C,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AACtB,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAChB,6CAA4E;AAAnE,yGAAA,UAAU,OAAA;AAAE,6GAAA,cAAc,OAAA;AAAE,8GAAA,eAAe,OAAA;AACpD,iDAAiD;AAAxC,+GAAA,cAAc,OAAA;AACvB,iDAAgE;AAAvD,6GAAA,YAAY,OAAA;AAAE,gHAAA,eAAe,OAAA;AACtC,iDAAsF;AAA7E,6GAAA,YAAY,OAAA;AAAE,uHAAA,sBAAsB,OAAA;AAAE,8GAAA,aAAa,OAAA","sourcesContent":["export { ResolvedConfig, ResolvedRuleConfig, RuleOptions } from './types';\nexport { InformAiError } from './inform-ai-error';\nexport { toError } from './to-error';\nexport { loadConfig, findConfigFile, CONFIG_FILENAME } from './load-config';\nexport { isPathExcluded } from './exclude-paths';\nexport { defaultRules, defaultRulesDir } from './default-rules';\nexport { loadTemplate, writeTemplateIfMissing, writeTemplate } from './load-template';\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/index.ts"],"names":[],"mappings":";;;AAAA,iCAA0E;AAAjE,uGAAA,cAAc,OAAA;AAAE,2GAAA,kBAAkB,OAAA;AAC3C,qDAAkD;AAAzC,gHAAA,aAAa,OAAA;AACtB,uCAAqC;AAA5B,mGAAA,OAAO,OAAA;AAChB,6CAAsG;AAA7F,yGAAA,UAAU,OAAA;AAAE,6GAAA,cAAc,OAAA;AAAE,8GAAA,eAAe,OAAA;AAAE,uHAAA,wBAAwB,OAAA;AAE9E,iDAAiD;AAAxC,+GAAA,cAAc,OAAA;AACvB,iDAAgE;AAAvD,6GAAA,YAAY,OAAA;AAAE,gHAAA,eAAe,OAAA;AACtC,iDAAsF;AAA7E,6GAAA,YAAY,OAAA;AAAE,uHAAA,sBAAsB,OAAA;AAAE,8GAAA,aAAa,OAAA;AAC5D,qDAA4D;AAAnD,0HAAA,uBAAuB,OAAA;AAChC,yCAAuC;AAA9B,qGAAA,QAAQ,OAAA;AAEjB,+DAA8D;AAArD,4HAAA,oBAAoB,OAAA;AAC7B,+CAyBwB;AAxBpB,oHAAA,oBAAoB,OAAA;AACpB,kHAAA,kBAAkB,OAAA;AAClB,uHAAA,uBAAuB,OAAA;AACvB,0HAAA,0BAA0B,OAAA;AAC1B,kHAAA,kBAAkB,OAAA;AAClB,mHAAA,mBAAmB,OAAA;AACnB,wHAAA,wBAAwB,OAAA;AACxB,qHAAA,qBAAqB,OAAA;AACrB,mHAAA,mBAAmB,OAAA;AACnB,2HAAA,2BAA2B,OAAA;AAC3B,uHAAA,uBAAuB,OAAA;AACvB,wHAAA,wBAAwB,OAAA;AACxB,kIAAA,kCAAkC,OAAA;AAClC,sHAAA,sBAAsB,OAAA;AACtB,yHAAA,yBAAyB,OAAA;AACzB,yHAAA,yBAAyB,OAAA;AACzB,qHAAA,qBAAqB,OAAA;AACrB,oHAAA,oBAAoB,OAAA;AACpB,wHAAA,wBAAwB,OAAA;AACxB,kHAAA,kBAAkB,OAAA;AAClB,wHAAA,wBAAwB,OAAA;AACxB,yHAAA,yBAAyB,OAAA;AACzB,+GAAA,eAAe,OAAA;AACf,qHAAA,qBAAqB,OAAA","sourcesContent":["export { ResolvedConfig, ResolvedRuleConfig, RuleOptions } from './types';\nexport { InformAiError } from './inform-ai-error';\nexport { toError } from './to-error';\nexport { loadConfig, findConfigFile, CONFIG_FILENAME, loadWebpiecesRulesConfig } from './load-config';\nexport type { LoadedWebpiecesConfig } from './load-config';\nexport { isPathExcluded } from './exclude-paths';\nexport { defaultRules, defaultRulesDir } from './default-rules';\nexport { loadTemplate, writeTemplateIfMissing, writeTemplate } from './load-template';\nexport { validateWebpiecesConfig } from './validate-config';\nexport { FieldDef } from './field-def';\nexport type { SchemaShape } from './field-def';\nexport { WebpiecesRulesConfig } from './WebpiecesRulesConfig';\nexport {\n MaxMethodLinesConfig,\n MaxFileLinesConfig,\n RequireReturnTypeConfig,\n NoInlineTypeLiteralsConfig,\n NoAnyUnknownConfig,\n NoImplicitAnyConfig,\n PrismaValidateDtosConfig,\n PrismaConverterConfig,\n NoDestructureConfig,\n NoUnmanagedExceptionsConfig,\n CatchErrorPatternConfig,\n ThrowCauseRequiredConfig,\n AngularNoDirectApiInResolverConfig,\n NoSymbolDiTokensConfig,\n NoShellSubstitutionConfig,\n BranchCreationGuardConfig,\n PrCreationGuardConfig,\n PrMergeCleanupConfig,\n NoDirectMainUpdateConfig,\n NoEditOnMainConfig,\n NoFileImportCyclesConfig,\n RuntimeArchitectureConfig,\n NoJsFilesConfig,\n ValidateTsInSrcConfig,\n} from './rule-configs';\n"]}
@@ -1,7 +1,13 @@
1
1
  import { ResolvedConfig } from './types';
2
+ import { WebpiecesRulesConfig } from './WebpiecesRulesConfig';
2
3
  export declare const CONFIG_FILENAME = "webpieces.config.json";
3
4
  /**
4
5
  * Walk up from `startDir` looking for webpieces.config.json.
5
6
  */
6
7
  export declare function findConfigFile(startDir: string): string | null;
7
8
  export declare function loadConfig(cwd: string): ResolvedConfig;
9
+ export interface LoadedWebpiecesConfig {
10
+ readonly config: WebpiecesRulesConfig;
11
+ readonly configPath: string;
12
+ }
13
+ export declare function loadWebpiecesRulesConfig(cwd: string): LoadedWebpiecesConfig | null;
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.CONFIG_FILENAME = void 0;
4
4
  exports.findConfigFile = findConfigFile;
5
5
  exports.loadConfig = loadConfig;
6
+ exports.loadWebpiecesRulesConfig = loadWebpiecesRulesConfig;
6
7
  const tslib_1 = require("tslib");
7
8
  const fs = tslib_1.__importStar(require("fs"));
8
9
  const path = tslib_1.__importStar(require("path"));
@@ -10,6 +11,8 @@ const default_rules_1 = require("./default-rules");
10
11
  const inform_ai_error_1 = require("./inform-ai-error");
11
12
  const to_error_1 = require("./to-error");
12
13
  const types_1 = require("./types");
14
+ const validate_config_1 = require("./validate-config");
15
+ const WebpiecesRulesConfig_1 = require("./WebpiecesRulesConfig");
13
16
  exports.CONFIG_FILENAME = 'webpieces.config.json';
14
17
  /**
15
18
  * Walk up from `startDir` looking for webpieces.config.json.
@@ -66,6 +69,11 @@ function loadConfig(cwd) {
66
69
  }
67
70
  const consumerConfig = readRawConfig(configPath);
68
71
  const overrideRules = consumerConfig.rules || {};
72
+ const validationErrors = (0, validate_config_1.validateWebpiecesConfig)(overrideRules);
73
+ if (validationErrors.length > 0) {
74
+ throw new inform_ai_error_1.InformAiError(`webpieces.config.json has ${validationErrors.length} validation error(s) — fix ALL, then retry:\n\n` +
75
+ validationErrors.map(e => ` • ${e}`).join('\n'));
76
+ }
69
77
  const userConfiguredRuleNames = new Set(Object.keys(overrideRules));
70
78
  const mergedRules = new Map();
71
79
  const allRuleNames = new Set([
@@ -78,4 +86,29 @@ function loadConfig(cwd) {
78
86
  const rulesDir = consumerConfig.rulesDir ?? [];
79
87
  return new types_1.ResolvedConfig(mergedRules, userConfiguredRuleNames, rulesDir, configPath);
80
88
  }
89
+ function buildWebpiecesRulesConfig(
90
+ // webpieces-disable no-any-unknown -- JSON values are opaque until assigned to typed fields
91
+ rawRules, rulesDir) {
92
+ const typed = new WebpiecesRulesConfig_1.WebpiecesRulesConfig();
93
+ for (const key of Object.keys(rawRules)) {
94
+ // webpieces-disable no-any-unknown -- dynamic key assignment to typed class
95
+ typed[key] = rawRules[key];
96
+ }
97
+ typed.rulesDir = rulesDir;
98
+ return typed;
99
+ }
100
+ function loadWebpiecesRulesConfig(cwd) {
101
+ const configPath = findConfigFile(cwd);
102
+ if (!configPath)
103
+ return null;
104
+ const consumerConfig = readRawConfig(configPath);
105
+ const overrideRules = consumerConfig.rules || {};
106
+ const validationErrors = (0, validate_config_1.validateWebpiecesConfig)(overrideRules);
107
+ if (validationErrors.length > 0) {
108
+ throw new inform_ai_error_1.InformAiError(`webpieces.config.json has ${validationErrors.length} validation error(s) — fix ALL, then retry:\n\n` +
109
+ validationErrors.map(e => ` • ${e}`).join('\n'));
110
+ }
111
+ const rulesDir = consumerConfig.rulesDir ?? [];
112
+ return { config: buildWebpiecesRulesConfig(overrideRules, rulesDir), configPath };
113
+ }
81
114
  //# sourceMappingURL=load-config.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"load-config.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/load-config.ts"],"names":[],"mappings":";;;AAoBA,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AAY,EAAE,CAAC;QAC9B,WAAW,CAAC,GAAG,CAAC,IAAI,EAAE,SAAS,CAAC,4BAAY,CAAC,IAAI,CAAC,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9E,CAAC;IAED,MAAM,QAAQ,GAAG,cAAc,CAAC,QAAQ,IAAI,EAAE,CAAC;IAE/C,OAAO,IAAI,sBAAc,CAAC,WAAW,EAAE,uBAAuB,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;AAC1F,CAAC","sourcesContent":["import * as fs from 'fs';\nimport * as path from 'path';\n\nimport { defaultRules } from './default-rules';\nimport { InformAiError } from './inform-ai-error';\nimport { toError } from './to-error';\nimport { ResolvedConfig, ResolvedRuleConfig, RuleOptions } from './types';\n\nexport const CONFIG_FILENAME = 'webpieces.config.json';\n\n// webpieces-disable no-any-unknown -- consumer JSON config has opaque rule option values\ninterface RawConfigFile {\n extends?: string;\n rules?: Record<string, Record<string, unknown>>;\n rulesDir?: string[];\n}\n\n/**\n * Walk up from `startDir` looking for webpieces.config.json.\n */\nexport function findConfigFile(startDir: string): string | null {\n let dir = startDir;\n while (true) {\n const primary = path.join(dir, CONFIG_FILENAME);\n if (fs.existsSync(primary)) return primary;\n const parent = path.dirname(dir);\n if (parent === dir) return null;\n dir = parent;\n }\n}\n\n// webpieces-disable no-any-unknown -- merging opaque option bags from config JSON\nfunction mergeRule(\n // webpieces-disable no-any-unknown -- opaque option bag\n baseRule: Record<string, unknown> | undefined,\n // webpieces-disable no-any-unknown -- opaque option bag\n overrideRule: Record<string, unknown> | undefined,\n): ResolvedRuleConfig {\n if (!baseRule && !overrideRule) return new ResolvedRuleConfig({ mode: 'OFF' });\n if (!baseRule) return new ResolvedRuleConfig(overrideRule! as RuleOptions);\n if (!overrideRule) return new ResolvedRuleConfig(baseRule as RuleOptions);\n\n // webpieces-disable no-any-unknown -- building merged option bag\n const merged: Record<string, unknown> = {};\n for (const key of Object.keys(baseRule)) merged[key] = baseRule[key];\n for (const key of Object.keys(overrideRule)) merged[key] = overrideRule[key];\n return new ResolvedRuleConfig(merged as RuleOptions);\n}\n\nfunction readRawConfig(configPath: string): RawConfigFile {\n const raw = fs.readFileSync(configPath, 'utf8');\n // eslint-disable-next-line @webpieces/no-unmanaged-exceptions\n try {\n return JSON.parse(raw) as RawConfigFile;\n } catch (err: unknown) {\n const error = toError(err);\n throw new InformAiError(\n `webpieces.config.json has invalid JSON — fix the file, then retry.\\n` +\n `Parse error: ${error.message}\\n` +\n `File: ${configPath}`,\n );\n }\n}\n\nexport function loadConfig(cwd: string): ResolvedConfig {\n const configPath = findConfigFile(cwd);\n\n if (!configPath) {\n return new ResolvedConfig(new Map(), new Set(), [], null);\n }\n\n const consumerConfig = readRawConfig(configPath);\n const overrideRules = consumerConfig.rules || {};\n const userConfiguredRuleNames = new Set(Object.keys(overrideRules));\n const mergedRules = new Map<string, ResolvedRuleConfig>();\n\n const allRuleNames = new Set([\n ...Object.keys(defaultRules),\n ...Object.keys(overrideRules),\n ]);\n for (const name of allRuleNames) {\n mergedRules.set(name, mergeRule(defaultRules[name], overrideRules[name]));\n }\n\n const rulesDir = consumerConfig.rulesDir ?? [];\n\n return new ResolvedConfig(mergedRules, userConfiguredRuleNames, rulesDir, configPath);\n}\n"]}
1
+ {"version":3,"file":"load-config.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/load-config.ts"],"names":[],"mappings":";;;AAsBA,wCASC;AAmCD,gCAgCC;AAqBD,4DAiBC;;AAxID,+CAAyB;AACzB,mDAA6B;AAE7B,mDAA+C;AAC/C,uDAAkD;AAClD,yCAAqC;AACrC,mCAA0E;AAC1E,uDAA4D;AAC5D,iEAA8D;AAEjD,QAAA,eAAe,GAAG,uBAAuB,CAAC;AASvD;;GAEG;AACH,SAAgB,cAAc,CAAC,QAAgB;IAC3C,IAAI,GAAG,GAAG,QAAQ,CAAC;IACnB,OAAO,IAAI,EAAE,CAAC;QACV,MAAM,OAAO,GAAG,IAAI,CAAC,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AAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CACnD,CAAC;IACN,CAAC;IAED,MAAM,QAAQ,GAAG,cAAc,CAAC,QAAQ,IAAI,EAAE,CAAC;IAC/C,OAAO,EAAE,MAAM,EAAE,yBAAyB,CAAC,aAAa,EAAE,QAAQ,CAAC,EAAE,UAAU,EAAE,CAAC;AACtF,CAAC","sourcesContent":["import * as fs from 'fs';\nimport * as path from 'path';\n\nimport { defaultRules } from './default-rules';\nimport { InformAiError } from './inform-ai-error';\nimport { toError } from './to-error';\nimport { ResolvedConfig, ResolvedRuleConfig, RuleOptions } from './types';\nimport { validateWebpiecesConfig } from './validate-config';\nimport { WebpiecesRulesConfig } from './WebpiecesRulesConfig';\n\nexport const CONFIG_FILENAME = 'webpieces.config.json';\n\n// webpieces-disable no-any-unknown -- consumer JSON config has opaque rule option values\ninterface RawConfigFile {\n extends?: string;\n rules?: Record<string, Record<string, unknown>>;\n rulesDir?: string[];\n}\n\n/**\n * Walk up from `startDir` looking for webpieces.config.json.\n */\nexport function findConfigFile(startDir: string): string | null {\n let dir = startDir;\n while (true) {\n const primary = path.join(dir, CONFIG_FILENAME);\n if (fs.existsSync(primary)) return primary;\n const parent = path.dirname(dir);\n if (parent === dir) return null;\n dir = parent;\n }\n}\n\n// webpieces-disable no-any-unknown -- merging opaque option bags from config JSON\nfunction mergeRule(\n // webpieces-disable no-any-unknown -- opaque option bag\n baseRule: Record<string, unknown> | undefined,\n // webpieces-disable no-any-unknown -- opaque option bag\n overrideRule: Record<string, unknown> | undefined,\n): ResolvedRuleConfig {\n if (!baseRule && !overrideRule) return new ResolvedRuleConfig({ mode: 'OFF' });\n if (!baseRule) return new ResolvedRuleConfig(overrideRule! as RuleOptions);\n if (!overrideRule) return new ResolvedRuleConfig(baseRule as RuleOptions);\n\n // webpieces-disable no-any-unknown -- building merged option bag\n const merged: Record<string, unknown> = {};\n for (const key of Object.keys(baseRule)) merged[key] = baseRule[key];\n for (const key of Object.keys(overrideRule)) merged[key] = overrideRule[key];\n return new ResolvedRuleConfig(merged as RuleOptions);\n}\n\nfunction readRawConfig(configPath: string): RawConfigFile {\n const raw = fs.readFileSync(configPath, 'utf8');\n // eslint-disable-next-line @webpieces/no-unmanaged-exceptions\n try {\n return JSON.parse(raw) as RawConfigFile;\n } catch (err: unknown) {\n const error = toError(err);\n throw new InformAiError(\n `webpieces.config.json has invalid JSON — fix the file, then retry.\\n` +\n `Parse error: ${error.message}\\n` +\n `File: ${configPath}`,\n );\n }\n}\n\nexport function loadConfig(cwd: string): ResolvedConfig {\n const configPath = findConfigFile(cwd);\n\n if (!configPath) {\n return new ResolvedConfig(new Map(), new Set(), [], null);\n }\n\n const consumerConfig = readRawConfig(configPath);\n const overrideRules = consumerConfig.rules || {};\n\n const validationErrors = validateWebpiecesConfig(overrideRules);\n if (validationErrors.length > 0) {\n throw new InformAiError(\n `webpieces.config.json has ${validationErrors.length} validation error(s) — fix ALL, then retry:\\n\\n` +\n validationErrors.map(e => ` • ${e}`).join('\\n'),\n );\n }\n\n const userConfiguredRuleNames = new Set(Object.keys(overrideRules));\n const mergedRules = new Map<string, ResolvedRuleConfig>();\n\n const allRuleNames = new Set([\n ...Object.keys(defaultRules),\n ...Object.keys(overrideRules),\n ]);\n for (const name of allRuleNames) {\n mergedRules.set(name, mergeRule(defaultRules[name], overrideRules[name]));\n }\n\n const rulesDir = consumerConfig.rulesDir ?? [];\n\n return new ResolvedConfig(mergedRules, userConfiguredRuleNames, rulesDir, configPath);\n}\n\nexport interface LoadedWebpiecesConfig {\n readonly config: WebpiecesRulesConfig;\n readonly configPath: string;\n}\n\nfunction buildWebpiecesRulesConfig(\n // webpieces-disable no-any-unknown -- JSON values are opaque until assigned to typed fields\n rawRules: Record<string, Record<string, unknown>>,\n rulesDir: string[],\n): WebpiecesRulesConfig {\n const typed = new WebpiecesRulesConfig();\n for (const key of Object.keys(rawRules)) {\n // webpieces-disable no-any-unknown -- dynamic key assignment to typed class\n (typed as Record<string, unknown>)[key] = rawRules[key];\n }\n typed.rulesDir = rulesDir;\n return typed;\n}\n\nexport function loadWebpiecesRulesConfig(cwd: string): LoadedWebpiecesConfig | null {\n const configPath = findConfigFile(cwd);\n if (!configPath) return null;\n\n const consumerConfig = readRawConfig(configPath);\n const overrideRules = consumerConfig.rules || {};\n\n const validationErrors = validateWebpiecesConfig(overrideRules);\n if (validationErrors.length > 0) {\n throw new InformAiError(\n `webpieces.config.json has ${validationErrors.length} validation error(s) — fix ALL, then retry:\\n\\n` +\n validationErrors.map(e => ` • ${e}`).join('\\n'),\n );\n }\n\n const rulesDir = consumerConfig.rulesDir ?? [];\n return { config: buildWebpiecesRulesConfig(overrideRules, rulesDir), configPath };\n}\n"]}
@@ -0,0 +1,184 @@
1
+ import { SchemaShape } from './field-def';
2
+ declare const METHOD_LIMIT_MODES: readonly ["OFF", "NEW_METHODS", "NEW_AND_MODIFIED_METHODS", "MODIFIED_FILES"];
3
+ type MethodLimitMode = typeof METHOD_LIMIT_MODES[number];
4
+ declare const FILE_LIMIT_MODES: readonly ["OFF", "MODIFIED_FILES"];
5
+ type FileLimitMode = typeof FILE_LIMIT_MODES[number];
6
+ declare const RETURN_TYPE_MODES: readonly ["OFF", "NEW_METHODS", "NEW_AND_MODIFIED_METHODS", "MODIFIED_FILES"];
7
+ type ReturnTypeModeLocal = typeof RETURN_TYPE_MODES[number];
8
+ declare const INLINE_TYPE_MODES: readonly ["OFF", "NEW_METHODS", "NEW_AND_MODIFIED_METHODS", "MODIFIED_FILES"];
9
+ type InlineTypeModeLocal = typeof INLINE_TYPE_MODES[number];
10
+ declare const MODIFIED_CODE_MODES: readonly ["OFF", "MODIFIED_CODE", "MODIFIED_FILES"];
11
+ type ModifiedCodeMode = typeof MODIFIED_CODE_MODES[number];
12
+ declare const PRISMA_DTOS_MODES: readonly ["OFF", "MODIFIED_CLASS", "MODIFIED_FILES"];
13
+ type PrismaValidateDtosMode = typeof PRISMA_DTOS_MODES[number];
14
+ declare const PRISMA_CONVERTER_MODES: readonly ["OFF", "NEW_AND_MODIFIED_METHODS", "MODIFIED_FILES"];
15
+ type PrismaConverterModeLocal = typeof PRISMA_CONVERTER_MODES[number];
16
+ declare const DIRECT_API_RESOLVER_MODES: readonly ["OFF", "MODIFIED_CODE", "NEW_AND_MODIFIED_METHODS", "MODIFIED_FILES"];
17
+ type DirectApiResolverMode = typeof DIRECT_API_RESOLVER_MODES[number];
18
+ declare const THROW_CAUSE_MODES: readonly ["ON", "OFF", "MODIFIED_CODE"];
19
+ type ThrowCauseModeLocal = typeof THROW_CAUSE_MODES[number];
20
+ declare const ON_OFF_MODES: readonly ["ON", "OFF"];
21
+ type OnOffMode = typeof ON_OFF_MODES[number];
22
+ declare const VALIDATE_TS_MODES: readonly ["ON", "OFF", "MODIFIED_FILES"];
23
+ type ValidateTsMode = typeof VALIDATE_TS_MODES[number];
24
+ export declare class MaxMethodLinesConfig {
25
+ mode?: MethodLimitMode;
26
+ limit?: number;
27
+ disableAllowed?: boolean;
28
+ ignoreModifiedUntilEpoch?: number;
29
+ ignoreRuleWhileOnBranch?: string;
30
+ static readonly SCHEMA: SchemaShape<MaxMethodLinesConfig>;
31
+ }
32
+ export declare class MaxFileLinesConfig {
33
+ mode?: FileLimitMode;
34
+ limit?: number;
35
+ disableAllowed?: boolean;
36
+ ignoreModifiedUntilEpoch?: number;
37
+ ignoreRuleWhileOnBranch?: string;
38
+ static readonly SCHEMA: SchemaShape<MaxFileLinesConfig>;
39
+ }
40
+ export declare class RequireReturnTypeConfig {
41
+ mode?: ReturnTypeModeLocal;
42
+ disableAllowed?: boolean;
43
+ ignoreModifiedUntilEpoch?: number;
44
+ ignoreRuleWhileOnBranch?: string;
45
+ static readonly SCHEMA: SchemaShape<RequireReturnTypeConfig>;
46
+ }
47
+ export declare class NoInlineTypeLiteralsConfig {
48
+ mode?: InlineTypeModeLocal;
49
+ disableAllowed?: boolean;
50
+ ignoreModifiedUntilEpoch?: number;
51
+ ignoreRuleWhileOnBranch?: string;
52
+ static readonly SCHEMA: SchemaShape<NoInlineTypeLiteralsConfig>;
53
+ }
54
+ export declare class NoAnyUnknownConfig {
55
+ mode?: ModifiedCodeMode;
56
+ disableAllowed?: boolean;
57
+ ignoreModifiedUntilEpoch?: number;
58
+ ignoreRuleWhileOnBranch?: string;
59
+ static readonly SCHEMA: SchemaShape<NoAnyUnknownConfig>;
60
+ }
61
+ export declare class NoImplicitAnyConfig {
62
+ mode?: ModifiedCodeMode;
63
+ disableAllowed?: boolean;
64
+ ignoreModifiedUntilEpoch?: number;
65
+ ignoreRuleWhileOnBranch?: string;
66
+ static readonly SCHEMA: SchemaShape<NoImplicitAnyConfig>;
67
+ }
68
+ export declare class PrismaValidateDtosConfig {
69
+ mode?: PrismaValidateDtosMode;
70
+ disableAllowed?: boolean;
71
+ prismaSchemaPath?: string;
72
+ dtoSourcePaths?: string[];
73
+ ignoreModifiedUntilEpoch?: number;
74
+ ignoreRuleWhileOnBranch?: string;
75
+ static readonly SCHEMA: SchemaShape<PrismaValidateDtosConfig>;
76
+ }
77
+ export declare class PrismaConverterConfig {
78
+ mode?: PrismaConverterModeLocal;
79
+ disableAllowed?: boolean;
80
+ schemaPath?: string;
81
+ convertersPaths?: string[];
82
+ enforcePaths?: string[];
83
+ ignoreModifiedUntilEpoch?: number;
84
+ ignoreRuleWhileOnBranch?: string;
85
+ static readonly SCHEMA: SchemaShape<PrismaConverterConfig>;
86
+ }
87
+ export declare class NoDestructureConfig {
88
+ mode?: ModifiedCodeMode;
89
+ allowTopLevel?: boolean;
90
+ disableAllowed?: boolean;
91
+ ignoreModifiedUntilEpoch?: number;
92
+ ignoreRuleWhileOnBranch?: string;
93
+ static readonly SCHEMA: SchemaShape<NoDestructureConfig>;
94
+ }
95
+ export declare class NoUnmanagedExceptionsConfig {
96
+ mode?: ModifiedCodeMode;
97
+ disableAllowed?: boolean;
98
+ ignoreModifiedUntilEpoch?: number;
99
+ ignoreRuleWhileOnBranch?: string;
100
+ static readonly SCHEMA: SchemaShape<NoUnmanagedExceptionsConfig>;
101
+ }
102
+ export declare class CatchErrorPatternConfig {
103
+ mode?: ModifiedCodeMode;
104
+ disableAllowed?: boolean;
105
+ ignoreModifiedUntilEpoch?: number;
106
+ ignoreRuleWhileOnBranch?: string;
107
+ static readonly SCHEMA: SchemaShape<CatchErrorPatternConfig>;
108
+ }
109
+ export declare class ThrowCauseRequiredConfig {
110
+ mode?: ThrowCauseModeLocal;
111
+ disableAllowed?: boolean;
112
+ ignoreModifiedUntilEpoch?: number;
113
+ ignoreRuleWhileOnBranch?: string;
114
+ static readonly SCHEMA: SchemaShape<ThrowCauseRequiredConfig>;
115
+ }
116
+ export declare class AngularNoDirectApiInResolverConfig {
117
+ mode?: DirectApiResolverMode;
118
+ disableAllowed?: boolean;
119
+ ignoreModifiedUntilEpoch?: number;
120
+ ignoreRuleWhileOnBranch?: string;
121
+ enforcePaths?: string[];
122
+ static readonly SCHEMA: SchemaShape<AngularNoDirectApiInResolverConfig>;
123
+ }
124
+ export declare class NoSymbolDiTokensConfig {
125
+ mode?: ModifiedCodeMode;
126
+ disableAllowed?: boolean;
127
+ ignoreModifiedUntilEpoch?: number;
128
+ ignoreRuleWhileOnBranch?: string;
129
+ allowedPaths?: string[];
130
+ static readonly SCHEMA: SchemaShape<NoSymbolDiTokensConfig>;
131
+ }
132
+ export declare class NoShellSubstitutionConfig {
133
+ mode?: OnOffMode;
134
+ static readonly SCHEMA: SchemaShape<NoShellSubstitutionConfig>;
135
+ }
136
+ export declare class BranchCreationGuardConfig {
137
+ mode?: OnOffMode;
138
+ subBranchNaming?: string;
139
+ static readonly SCHEMA: SchemaShape<BranchCreationGuardConfig>;
140
+ }
141
+ export declare class PrCreationGuardConfig {
142
+ mode?: OnOffMode;
143
+ buildCommand?: string;
144
+ requireTextInPr?: string;
145
+ static readonly SCHEMA: SchemaShape<PrCreationGuardConfig>;
146
+ }
147
+ export declare class PrMergeCleanupConfig {
148
+ mode?: OnOffMode;
149
+ static readonly SCHEMA: SchemaShape<PrMergeCleanupConfig>;
150
+ }
151
+ export declare class NoDirectMainUpdateConfig {
152
+ mode?: OnOffMode;
153
+ static readonly SCHEMA: SchemaShape<NoDirectMainUpdateConfig>;
154
+ }
155
+ export declare class NoEditOnMainConfig {
156
+ mode?: OnOffMode;
157
+ branchNamingConvention?: string;
158
+ static readonly SCHEMA: SchemaShape<NoEditOnMainConfig>;
159
+ }
160
+ export declare class NoFileImportCyclesConfig {
161
+ mode?: OnOffMode;
162
+ ignoreTypeOnly?: boolean;
163
+ static readonly SCHEMA: SchemaShape<NoFileImportCyclesConfig>;
164
+ }
165
+ export declare class RuntimeArchitectureConfig {
166
+ mode?: OnOffMode;
167
+ servicePaths?: string[];
168
+ apiProjectPaths?: string[];
169
+ allowedCycles?: string[];
170
+ static readonly SCHEMA: SchemaShape<RuntimeArchitectureConfig>;
171
+ }
172
+ export declare class NoJsFilesConfig {
173
+ mode?: OnOffMode;
174
+ allowedPaths?: string[];
175
+ static readonly SCHEMA: SchemaShape<NoJsFilesConfig>;
176
+ }
177
+ export declare class ValidateTsInSrcConfig {
178
+ mode?: ValidateTsMode;
179
+ ignoreModifiedUntilEpoch?: number;
180
+ allowedRootFiles?: string[];
181
+ excludePaths?: string[];
182
+ static readonly SCHEMA: SchemaShape<ValidateTsInSrcConfig>;
183
+ }
184
+ export {};
@@ -0,0 +1,314 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ValidateTsInSrcConfig = exports.NoJsFilesConfig = exports.RuntimeArchitectureConfig = exports.NoFileImportCyclesConfig = exports.NoEditOnMainConfig = exports.NoDirectMainUpdateConfig = exports.PrMergeCleanupConfig = exports.PrCreationGuardConfig = exports.BranchCreationGuardConfig = exports.NoShellSubstitutionConfig = exports.NoSymbolDiTokensConfig = exports.AngularNoDirectApiInResolverConfig = exports.ThrowCauseRequiredConfig = exports.CatchErrorPatternConfig = exports.NoUnmanagedExceptionsConfig = exports.NoDestructureConfig = exports.PrismaConverterConfig = exports.PrismaValidateDtosConfig = exports.NoImplicitAnyConfig = exports.NoAnyUnknownConfig = exports.NoInlineTypeLiteralsConfig = exports.RequireReturnTypeConfig = exports.MaxFileLinesConfig = exports.MaxMethodLinesConfig = void 0;
4
+ const field_def_1 = require("./field-def");
5
+ // Mode const arrays — TypeScript union types derived from them, and FieldDef enum
6
+ // values reference the same array. Impossible for the type and runtime check to diverge.
7
+ const METHOD_LIMIT_MODES = ['OFF', 'NEW_METHODS', 'NEW_AND_MODIFIED_METHODS', 'MODIFIED_FILES'];
8
+ const FILE_LIMIT_MODES = ['OFF', 'MODIFIED_FILES'];
9
+ const RETURN_TYPE_MODES = ['OFF', 'NEW_METHODS', 'NEW_AND_MODIFIED_METHODS', 'MODIFIED_FILES'];
10
+ const INLINE_TYPE_MODES = ['OFF', 'NEW_METHODS', 'NEW_AND_MODIFIED_METHODS', 'MODIFIED_FILES'];
11
+ const MODIFIED_CODE_MODES = ['OFF', 'MODIFIED_CODE', 'MODIFIED_FILES'];
12
+ const PRISMA_DTOS_MODES = ['OFF', 'MODIFIED_CLASS', 'MODIFIED_FILES'];
13
+ const PRISMA_CONVERTER_MODES = ['OFF', 'NEW_AND_MODIFIED_METHODS', 'MODIFIED_FILES'];
14
+ const DIRECT_API_RESOLVER_MODES = ['OFF', 'MODIFIED_CODE', 'NEW_AND_MODIFIED_METHODS', 'MODIFIED_FILES'];
15
+ const THROW_CAUSE_MODES = ['ON', 'OFF', 'MODIFIED_CODE'];
16
+ const ON_OFF_MODES = ['ON', 'OFF'];
17
+ const VALIDATE_TS_MODES = ['ON', 'OFF', 'MODIFIED_FILES'];
18
+ class MaxMethodLinesConfig {
19
+ mode;
20
+ limit;
21
+ disableAllowed;
22
+ ignoreModifiedUntilEpoch;
23
+ ignoreRuleWhileOnBranch;
24
+ static SCHEMA = {
25
+ mode: new field_def_1.FieldDef('string', METHOD_LIMIT_MODES),
26
+ limit: new field_def_1.FieldDef('number'),
27
+ disableAllowed: new field_def_1.FieldDef('boolean'),
28
+ ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
29
+ ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
30
+ };
31
+ }
32
+ exports.MaxMethodLinesConfig = MaxMethodLinesConfig;
33
+ class MaxFileLinesConfig {
34
+ mode;
35
+ limit;
36
+ disableAllowed;
37
+ ignoreModifiedUntilEpoch;
38
+ ignoreRuleWhileOnBranch;
39
+ static SCHEMA = {
40
+ mode: new field_def_1.FieldDef('string', FILE_LIMIT_MODES),
41
+ limit: new field_def_1.FieldDef('number'),
42
+ disableAllowed: new field_def_1.FieldDef('boolean'),
43
+ ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
44
+ ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
45
+ };
46
+ }
47
+ exports.MaxFileLinesConfig = MaxFileLinesConfig;
48
+ class RequireReturnTypeConfig {
49
+ mode;
50
+ disableAllowed;
51
+ ignoreModifiedUntilEpoch;
52
+ ignoreRuleWhileOnBranch;
53
+ static SCHEMA = {
54
+ mode: new field_def_1.FieldDef('string', RETURN_TYPE_MODES),
55
+ disableAllowed: new field_def_1.FieldDef('boolean'),
56
+ ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
57
+ ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
58
+ };
59
+ }
60
+ exports.RequireReturnTypeConfig = RequireReturnTypeConfig;
61
+ class NoInlineTypeLiteralsConfig {
62
+ mode;
63
+ disableAllowed;
64
+ ignoreModifiedUntilEpoch;
65
+ ignoreRuleWhileOnBranch;
66
+ static SCHEMA = {
67
+ mode: new field_def_1.FieldDef('string', INLINE_TYPE_MODES),
68
+ disableAllowed: new field_def_1.FieldDef('boolean'),
69
+ ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
70
+ ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
71
+ };
72
+ }
73
+ exports.NoInlineTypeLiteralsConfig = NoInlineTypeLiteralsConfig;
74
+ class NoAnyUnknownConfig {
75
+ mode;
76
+ disableAllowed;
77
+ ignoreModifiedUntilEpoch;
78
+ ignoreRuleWhileOnBranch;
79
+ static SCHEMA = {
80
+ mode: new field_def_1.FieldDef('string', MODIFIED_CODE_MODES),
81
+ disableAllowed: new field_def_1.FieldDef('boolean'),
82
+ ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
83
+ ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
84
+ };
85
+ }
86
+ exports.NoAnyUnknownConfig = NoAnyUnknownConfig;
87
+ class NoImplicitAnyConfig {
88
+ mode;
89
+ disableAllowed;
90
+ ignoreModifiedUntilEpoch;
91
+ ignoreRuleWhileOnBranch;
92
+ static SCHEMA = {
93
+ mode: new field_def_1.FieldDef('string', MODIFIED_CODE_MODES),
94
+ disableAllowed: new field_def_1.FieldDef('boolean'),
95
+ ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
96
+ ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
97
+ };
98
+ }
99
+ exports.NoImplicitAnyConfig = NoImplicitAnyConfig;
100
+ class PrismaValidateDtosConfig {
101
+ mode;
102
+ disableAllowed;
103
+ prismaSchemaPath;
104
+ dtoSourcePaths;
105
+ ignoreModifiedUntilEpoch;
106
+ ignoreRuleWhileOnBranch;
107
+ static SCHEMA = {
108
+ mode: new field_def_1.FieldDef('string', PRISMA_DTOS_MODES),
109
+ disableAllowed: new field_def_1.FieldDef('boolean'),
110
+ prismaSchemaPath: new field_def_1.FieldDef('string'),
111
+ dtoSourcePaths: new field_def_1.FieldDef('string[]'),
112
+ ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
113
+ ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
114
+ };
115
+ }
116
+ exports.PrismaValidateDtosConfig = PrismaValidateDtosConfig;
117
+ class PrismaConverterConfig {
118
+ mode;
119
+ disableAllowed;
120
+ schemaPath;
121
+ convertersPaths;
122
+ enforcePaths;
123
+ ignoreModifiedUntilEpoch;
124
+ ignoreRuleWhileOnBranch;
125
+ static SCHEMA = {
126
+ mode: new field_def_1.FieldDef('string', PRISMA_CONVERTER_MODES),
127
+ disableAllowed: new field_def_1.FieldDef('boolean'),
128
+ schemaPath: new field_def_1.FieldDef('string'),
129
+ convertersPaths: new field_def_1.FieldDef('string[]'),
130
+ enforcePaths: new field_def_1.FieldDef('string[]'),
131
+ ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
132
+ ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
133
+ };
134
+ }
135
+ exports.PrismaConverterConfig = PrismaConverterConfig;
136
+ class NoDestructureConfig {
137
+ mode;
138
+ allowTopLevel;
139
+ disableAllowed;
140
+ ignoreModifiedUntilEpoch;
141
+ ignoreRuleWhileOnBranch;
142
+ static SCHEMA = {
143
+ mode: new field_def_1.FieldDef('string', MODIFIED_CODE_MODES),
144
+ allowTopLevel: new field_def_1.FieldDef('boolean'),
145
+ disableAllowed: new field_def_1.FieldDef('boolean'),
146
+ ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
147
+ ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
148
+ };
149
+ }
150
+ exports.NoDestructureConfig = NoDestructureConfig;
151
+ class NoUnmanagedExceptionsConfig {
152
+ mode;
153
+ disableAllowed;
154
+ ignoreModifiedUntilEpoch;
155
+ ignoreRuleWhileOnBranch;
156
+ static SCHEMA = {
157
+ mode: new field_def_1.FieldDef('string', MODIFIED_CODE_MODES),
158
+ disableAllowed: new field_def_1.FieldDef('boolean'),
159
+ ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
160
+ ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
161
+ };
162
+ }
163
+ exports.NoUnmanagedExceptionsConfig = NoUnmanagedExceptionsConfig;
164
+ class CatchErrorPatternConfig {
165
+ mode;
166
+ disableAllowed;
167
+ ignoreModifiedUntilEpoch;
168
+ ignoreRuleWhileOnBranch;
169
+ static SCHEMA = {
170
+ mode: new field_def_1.FieldDef('string', MODIFIED_CODE_MODES),
171
+ disableAllowed: new field_def_1.FieldDef('boolean'),
172
+ ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
173
+ ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
174
+ };
175
+ }
176
+ exports.CatchErrorPatternConfig = CatchErrorPatternConfig;
177
+ class ThrowCauseRequiredConfig {
178
+ mode;
179
+ disableAllowed;
180
+ ignoreModifiedUntilEpoch;
181
+ ignoreRuleWhileOnBranch;
182
+ static SCHEMA = {
183
+ mode: new field_def_1.FieldDef('string', THROW_CAUSE_MODES),
184
+ disableAllowed: new field_def_1.FieldDef('boolean'),
185
+ ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
186
+ ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
187
+ };
188
+ }
189
+ exports.ThrowCauseRequiredConfig = ThrowCauseRequiredConfig;
190
+ class AngularNoDirectApiInResolverConfig {
191
+ mode;
192
+ disableAllowed;
193
+ ignoreModifiedUntilEpoch;
194
+ ignoreRuleWhileOnBranch;
195
+ enforcePaths;
196
+ static SCHEMA = {
197
+ mode: new field_def_1.FieldDef('string', DIRECT_API_RESOLVER_MODES),
198
+ disableAllowed: new field_def_1.FieldDef('boolean'),
199
+ ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
200
+ ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
201
+ enforcePaths: new field_def_1.FieldDef('string[]'),
202
+ };
203
+ }
204
+ exports.AngularNoDirectApiInResolverConfig = AngularNoDirectApiInResolverConfig;
205
+ class NoSymbolDiTokensConfig {
206
+ mode;
207
+ disableAllowed;
208
+ ignoreModifiedUntilEpoch;
209
+ ignoreRuleWhileOnBranch;
210
+ allowedPaths;
211
+ static SCHEMA = {
212
+ mode: new field_def_1.FieldDef('string', MODIFIED_CODE_MODES),
213
+ disableAllowed: new field_def_1.FieldDef('boolean'),
214
+ ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
215
+ ignoreRuleWhileOnBranch: new field_def_1.FieldDef('string'),
216
+ allowedPaths: new field_def_1.FieldDef('string[]'),
217
+ };
218
+ }
219
+ exports.NoSymbolDiTokensConfig = NoSymbolDiTokensConfig;
220
+ class NoShellSubstitutionConfig {
221
+ mode;
222
+ static SCHEMA = {
223
+ mode: new field_def_1.FieldDef('string', ON_OFF_MODES),
224
+ };
225
+ }
226
+ exports.NoShellSubstitutionConfig = NoShellSubstitutionConfig;
227
+ class BranchCreationGuardConfig {
228
+ mode;
229
+ subBranchNaming;
230
+ static SCHEMA = {
231
+ mode: new field_def_1.FieldDef('string', ON_OFF_MODES),
232
+ subBranchNaming: new field_def_1.FieldDef('string'),
233
+ };
234
+ }
235
+ exports.BranchCreationGuardConfig = BranchCreationGuardConfig;
236
+ class PrCreationGuardConfig {
237
+ mode;
238
+ buildCommand;
239
+ requireTextInPr;
240
+ static SCHEMA = {
241
+ mode: new field_def_1.FieldDef('string', ON_OFF_MODES),
242
+ buildCommand: new field_def_1.FieldDef('string'),
243
+ requireTextInPr: new field_def_1.FieldDef('string'),
244
+ };
245
+ }
246
+ exports.PrCreationGuardConfig = PrCreationGuardConfig;
247
+ class PrMergeCleanupConfig {
248
+ mode;
249
+ static SCHEMA = {
250
+ mode: new field_def_1.FieldDef('string', ON_OFF_MODES),
251
+ };
252
+ }
253
+ exports.PrMergeCleanupConfig = PrMergeCleanupConfig;
254
+ class NoDirectMainUpdateConfig {
255
+ mode;
256
+ static SCHEMA = {
257
+ mode: new field_def_1.FieldDef('string', ON_OFF_MODES),
258
+ };
259
+ }
260
+ exports.NoDirectMainUpdateConfig = NoDirectMainUpdateConfig;
261
+ class NoEditOnMainConfig {
262
+ mode;
263
+ branchNamingConvention;
264
+ static SCHEMA = {
265
+ mode: new field_def_1.FieldDef('string', ON_OFF_MODES),
266
+ branchNamingConvention: new field_def_1.FieldDef('string'),
267
+ };
268
+ }
269
+ exports.NoEditOnMainConfig = NoEditOnMainConfig;
270
+ class NoFileImportCyclesConfig {
271
+ mode;
272
+ ignoreTypeOnly;
273
+ static SCHEMA = {
274
+ mode: new field_def_1.FieldDef('string', ON_OFF_MODES),
275
+ ignoreTypeOnly: new field_def_1.FieldDef('boolean'),
276
+ };
277
+ }
278
+ exports.NoFileImportCyclesConfig = NoFileImportCyclesConfig;
279
+ class RuntimeArchitectureConfig {
280
+ mode;
281
+ servicePaths;
282
+ apiProjectPaths;
283
+ allowedCycles;
284
+ static SCHEMA = {
285
+ mode: new field_def_1.FieldDef('string', ON_OFF_MODES),
286
+ servicePaths: new field_def_1.FieldDef('string[]'),
287
+ apiProjectPaths: new field_def_1.FieldDef('string[]'),
288
+ allowedCycles: new field_def_1.FieldDef('string[]'),
289
+ };
290
+ }
291
+ exports.RuntimeArchitectureConfig = RuntimeArchitectureConfig;
292
+ class NoJsFilesConfig {
293
+ mode;
294
+ allowedPaths;
295
+ static SCHEMA = {
296
+ mode: new field_def_1.FieldDef('string', ON_OFF_MODES),
297
+ allowedPaths: new field_def_1.FieldDef('string[]'),
298
+ };
299
+ }
300
+ exports.NoJsFilesConfig = NoJsFilesConfig;
301
+ class ValidateTsInSrcConfig {
302
+ mode;
303
+ ignoreModifiedUntilEpoch;
304
+ allowedRootFiles;
305
+ excludePaths;
306
+ static SCHEMA = {
307
+ mode: new field_def_1.FieldDef('string', VALIDATE_TS_MODES),
308
+ ignoreModifiedUntilEpoch: new field_def_1.FieldDef('number'),
309
+ allowedRootFiles: new field_def_1.FieldDef('string[]'),
310
+ excludePaths: new field_def_1.FieldDef('string[]'),
311
+ };
312
+ }
313
+ exports.ValidateTsInSrcConfig = ValidateTsInSrcConfig;
314
+ //# sourceMappingURL=rule-configs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rule-configs.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/rule-configs.ts"],"names":[],"mappings":";;;AAAA,2CAAoD;AAEpD,kFAAkF;AAClF,yFAAyF;AAEzF,MAAM,kBAAkB,GAAG,CAAC,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EAAE,IAAI,oBAAQ,CAAC,UAAU,CAAC;QACtC,eAAe,EAAE,IAAI,oBAAQ,CAAC,UAAU,CAAC;QACzC,aAAa,EAAE,IAAI,oBAAQ,CAAC,UAAU,CAAC;KAC1C,CAAC;;AAXN,8DAYC;AAED,MAAa,eAAe;IACxB,IAAI,CAAa;IACjB,YAAY,CAAY;IAExB,MAAM,CAAU,MAAM,GAAiC;QACnD,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,YAAY,CAAC;QAC1C,YAAY,EAAE,IAAI,oBAAQ,CAAC,UAAU,CAAC;KACzC,CAAC;;AAPN,0CAQC;AAED,MAAa,qBAAqB;IAC9B,IAAI,CAAkB;IACtB,wBAAwB,CAAU;IAClC,gBAAgB,CAAY;IAC5B,YAAY,CAAY;IAExB,MAAM,CAAU,MAAM,GAAuC;QACzD,IAAI,EAAE,IAAI,oBAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;QAC/C,wBAAwB,EAAE,IAAI,oBAAQ,CAAC,QAAQ,CAAC;QAChD,gBAAgB,EAAE,IAAI,oBAAQ,CAAC,UAAU,CAAC;QAC1C,YAAY,EAAE,IAAI,oBAAQ,CAAC,UAAU,CAAC;KACzC,CAAC;;AAXN,sDAYC","sourcesContent":["import { FieldDef, SchemaShape } from './field-def';\n\n// Mode const arrays — TypeScript union types derived from them, and FieldDef enum\n// values reference the same array. Impossible for the type and runtime check to diverge.\n\nconst METHOD_LIMIT_MODES = ['OFF', 'NEW_METHODS', 'NEW_AND_MODIFIED_METHODS', 'MODIFIED_FILES'] as const;\ntype MethodLimitMode = typeof METHOD_LIMIT_MODES[number];\n\nconst FILE_LIMIT_MODES = ['OFF', 'MODIFIED_FILES'] as const;\ntype FileLimitMode = typeof FILE_LIMIT_MODES[number];\n\nconst RETURN_TYPE_MODES = ['OFF', 'NEW_METHODS', 'NEW_AND_MODIFIED_METHODS', 'MODIFIED_FILES'] as const;\ntype ReturnTypeModeLocal = typeof RETURN_TYPE_MODES[number];\n\nconst INLINE_TYPE_MODES = ['OFF', 'NEW_METHODS', 'NEW_AND_MODIFIED_METHODS', 'MODIFIED_FILES'] as const;\ntype InlineTypeModeLocal = typeof INLINE_TYPE_MODES[number];\n\nconst MODIFIED_CODE_MODES = ['OFF', 'MODIFIED_CODE', 'MODIFIED_FILES'] as const;\ntype ModifiedCodeMode = typeof MODIFIED_CODE_MODES[number];\n\nconst PRISMA_DTOS_MODES = ['OFF', 'MODIFIED_CLASS', 'MODIFIED_FILES'] as const;\ntype PrismaValidateDtosMode = typeof PRISMA_DTOS_MODES[number];\n\nconst PRISMA_CONVERTER_MODES = ['OFF', 'NEW_AND_MODIFIED_METHODS', 'MODIFIED_FILES'] as const;\ntype PrismaConverterModeLocal = typeof PRISMA_CONVERTER_MODES[number];\n\nconst DIRECT_API_RESOLVER_MODES = ['OFF', 'MODIFIED_CODE', 'NEW_AND_MODIFIED_METHODS', 'MODIFIED_FILES'] as const;\ntype DirectApiResolverMode = typeof DIRECT_API_RESOLVER_MODES[number];\n\nconst THROW_CAUSE_MODES = ['ON', 'OFF', 'MODIFIED_CODE'] as const;\ntype ThrowCauseModeLocal = typeof THROW_CAUSE_MODES[number];\n\nconst ON_OFF_MODES = ['ON', 'OFF'] as const;\ntype OnOffMode = typeof ON_OFF_MODES[number];\n\nconst VALIDATE_TS_MODES = ['ON', 'OFF', 'MODIFIED_FILES'] as const;\ntype ValidateTsMode = typeof VALIDATE_TS_MODES[number];\n\nexport class MaxMethodLinesConfig {\n mode?: MethodLimitMode;\n limit?: number;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<MaxMethodLinesConfig> = {\n mode: new FieldDef('string', METHOD_LIMIT_MODES),\n limit: new FieldDef('number'),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class MaxFileLinesConfig {\n mode?: FileLimitMode;\n limit?: number;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<MaxFileLinesConfig> = {\n mode: new FieldDef('string', FILE_LIMIT_MODES),\n limit: new FieldDef('number'),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class RequireReturnTypeConfig {\n mode?: ReturnTypeModeLocal;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<RequireReturnTypeConfig> = {\n mode: new FieldDef('string', RETURN_TYPE_MODES),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class NoInlineTypeLiteralsConfig {\n mode?: InlineTypeModeLocal;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<NoInlineTypeLiteralsConfig> = {\n mode: new FieldDef('string', INLINE_TYPE_MODES),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class NoAnyUnknownConfig {\n mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<NoAnyUnknownConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class NoImplicitAnyConfig {\n mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<NoImplicitAnyConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class PrismaValidateDtosConfig {\n mode?: PrismaValidateDtosMode;\n disableAllowed?: boolean;\n prismaSchemaPath?: string;\n dtoSourcePaths?: string[];\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<PrismaValidateDtosConfig> = {\n mode: new FieldDef('string', PRISMA_DTOS_MODES),\n disableAllowed: new FieldDef('boolean'),\n prismaSchemaPath: new FieldDef('string'),\n dtoSourcePaths: new FieldDef('string[]'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class PrismaConverterConfig {\n mode?: PrismaConverterModeLocal;\n disableAllowed?: boolean;\n schemaPath?: string;\n convertersPaths?: string[];\n enforcePaths?: string[];\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<PrismaConverterConfig> = {\n mode: new FieldDef('string', PRISMA_CONVERTER_MODES),\n disableAllowed: new FieldDef('boolean'),\n schemaPath: new FieldDef('string'),\n convertersPaths: new FieldDef('string[]'),\n enforcePaths: new FieldDef('string[]'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class NoDestructureConfig {\n mode?: ModifiedCodeMode;\n allowTopLevel?: boolean;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<NoDestructureConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n allowTopLevel: new FieldDef('boolean'),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class NoUnmanagedExceptionsConfig {\n mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<NoUnmanagedExceptionsConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class CatchErrorPatternConfig {\n mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<CatchErrorPatternConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class ThrowCauseRequiredConfig {\n mode?: ThrowCauseModeLocal;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n\n static readonly SCHEMA: SchemaShape<ThrowCauseRequiredConfig> = {\n mode: new FieldDef('string', THROW_CAUSE_MODES),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n };\n}\n\nexport class AngularNoDirectApiInResolverConfig {\n mode?: DirectApiResolverMode;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n enforcePaths?: string[];\n\n static readonly SCHEMA: SchemaShape<AngularNoDirectApiInResolverConfig> = {\n mode: new FieldDef('string', DIRECT_API_RESOLVER_MODES),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n enforcePaths: new FieldDef('string[]'),\n };\n}\n\nexport class NoSymbolDiTokensConfig {\n mode?: ModifiedCodeMode;\n disableAllowed?: boolean;\n ignoreModifiedUntilEpoch?: number;\n ignoreRuleWhileOnBranch?: string;\n allowedPaths?: string[];\n\n static readonly SCHEMA: SchemaShape<NoSymbolDiTokensConfig> = {\n mode: new FieldDef('string', MODIFIED_CODE_MODES),\n disableAllowed: new FieldDef('boolean'),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n ignoreRuleWhileOnBranch: new FieldDef('string'),\n allowedPaths: new FieldDef('string[]'),\n };\n}\n\nexport class NoShellSubstitutionConfig {\n mode?: OnOffMode;\n\n static readonly SCHEMA: SchemaShape<NoShellSubstitutionConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n };\n}\n\nexport class BranchCreationGuardConfig {\n mode?: OnOffMode;\n subBranchNaming?: string;\n\n static readonly SCHEMA: SchemaShape<BranchCreationGuardConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n subBranchNaming: new FieldDef('string'),\n };\n}\n\nexport class PrCreationGuardConfig {\n mode?: OnOffMode;\n buildCommand?: string;\n requireTextInPr?: string;\n\n static readonly SCHEMA: SchemaShape<PrCreationGuardConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n buildCommand: new FieldDef('string'),\n requireTextInPr: new FieldDef('string'),\n };\n}\n\nexport class PrMergeCleanupConfig {\n mode?: OnOffMode;\n\n static readonly SCHEMA: SchemaShape<PrMergeCleanupConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n };\n}\n\nexport class NoDirectMainUpdateConfig {\n mode?: OnOffMode;\n\n static readonly SCHEMA: SchemaShape<NoDirectMainUpdateConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n };\n}\n\nexport class NoEditOnMainConfig {\n mode?: OnOffMode;\n branchNamingConvention?: string;\n\n static readonly SCHEMA: SchemaShape<NoEditOnMainConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n branchNamingConvention: new FieldDef('string'),\n };\n}\n\nexport class NoFileImportCyclesConfig {\n mode?: OnOffMode;\n ignoreTypeOnly?: boolean;\n\n static readonly SCHEMA: SchemaShape<NoFileImportCyclesConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n ignoreTypeOnly: new FieldDef('boolean'),\n };\n}\n\nexport class RuntimeArchitectureConfig {\n mode?: OnOffMode;\n servicePaths?: string[];\n apiProjectPaths?: string[];\n allowedCycles?: string[];\n\n static readonly SCHEMA: SchemaShape<RuntimeArchitectureConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n servicePaths: new FieldDef('string[]'),\n apiProjectPaths: new FieldDef('string[]'),\n allowedCycles: new FieldDef('string[]'),\n };\n}\n\nexport class NoJsFilesConfig {\n mode?: OnOffMode;\n allowedPaths?: string[];\n\n static readonly SCHEMA: SchemaShape<NoJsFilesConfig> = {\n mode: new FieldDef('string', ON_OFF_MODES),\n allowedPaths: new FieldDef('string[]'),\n };\n}\n\nexport class ValidateTsInSrcConfig {\n mode?: ValidateTsMode;\n ignoreModifiedUntilEpoch?: number;\n allowedRootFiles?: string[];\n excludePaths?: string[];\n\n static readonly SCHEMA: SchemaShape<ValidateTsInSrcConfig> = {\n mode: new FieldDef('string', VALIDATE_TS_MODES),\n ignoreModifiedUntilEpoch: new FieldDef('number'),\n allowedRootFiles: new FieldDef('string[]'),\n excludePaths: new FieldDef('string[]'),\n };\n}\n"]}
@@ -0,0 +1 @@
1
+ export declare function validateWebpiecesConfig(rawRules: Record<string, Record<string, unknown>>): string[];
@@ -0,0 +1,60 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateWebpiecesConfig = validateWebpiecesConfig;
4
+ const rule_configs_1 = require("./rule-configs");
5
+ // Thin lookup table — each entry delegates to the class's own SCHEMA.
6
+ // No field lists here; all schemas live with their config class.
7
+ const RULE_SCHEMAS = {
8
+ 'max-method-lines': rule_configs_1.MaxMethodLinesConfig.SCHEMA,
9
+ 'max-file-lines': rule_configs_1.MaxFileLinesConfig.SCHEMA,
10
+ 'require-return-type': rule_configs_1.RequireReturnTypeConfig.SCHEMA,
11
+ 'no-inline-type-literals': rule_configs_1.NoInlineTypeLiteralsConfig.SCHEMA,
12
+ 'no-any-unknown': rule_configs_1.NoAnyUnknownConfig.SCHEMA,
13
+ 'no-implicit-any': rule_configs_1.NoImplicitAnyConfig.SCHEMA,
14
+ 'prisma-validate-dtos': rule_configs_1.PrismaValidateDtosConfig.SCHEMA,
15
+ 'prisma-converter': rule_configs_1.PrismaConverterConfig.SCHEMA,
16
+ 'no-destructure': rule_configs_1.NoDestructureConfig.SCHEMA,
17
+ 'no-unmanaged-exceptions': rule_configs_1.NoUnmanagedExceptionsConfig.SCHEMA,
18
+ 'catch-error-pattern': rule_configs_1.CatchErrorPatternConfig.SCHEMA,
19
+ 'throw-cause-required': rule_configs_1.ThrowCauseRequiredConfig.SCHEMA,
20
+ 'angular-no-direct-api-in-resolver': rule_configs_1.AngularNoDirectApiInResolverConfig.SCHEMA,
21
+ 'no-symbol-di-tokens': rule_configs_1.NoSymbolDiTokensConfig.SCHEMA,
22
+ 'no-shell-substitution': rule_configs_1.NoShellSubstitutionConfig.SCHEMA,
23
+ 'branch-creation-guard': rule_configs_1.BranchCreationGuardConfig.SCHEMA,
24
+ 'pr-creation-guard': rule_configs_1.PrCreationGuardConfig.SCHEMA,
25
+ 'pr-merge-cleanup': rule_configs_1.PrMergeCleanupConfig.SCHEMA,
26
+ 'no-direct-main-update': rule_configs_1.NoDirectMainUpdateConfig.SCHEMA,
27
+ 'no-edit-on-main': rule_configs_1.NoEditOnMainConfig.SCHEMA,
28
+ 'no-file-import-cycles': rule_configs_1.NoFileImportCyclesConfig.SCHEMA,
29
+ 'runtime-architecture': rule_configs_1.RuntimeArchitectureConfig.SCHEMA,
30
+ 'no-js-files': rule_configs_1.NoJsFilesConfig.SCHEMA,
31
+ 'validate-ts-in-src': rule_configs_1.ValidateTsInSrcConfig.SCHEMA,
32
+ };
33
+ // webpieces-disable no-any-unknown -- rawRules values are opaque JSON; each field is validated individually
34
+ function validateWebpiecesConfig(rawRules) {
35
+ const errors = [];
36
+ for (const [ruleName, entry] of Object.entries(rawRules)) {
37
+ const schema = RULE_SCHEMAS[ruleName];
38
+ if (!schema)
39
+ continue; // custom/unknown rule — no schema to validate against
40
+ for (const [key, value] of Object.entries(entry)) {
41
+ const fieldDef = schema[key];
42
+ if (!fieldDef) {
43
+ errors.push(`[${ruleName}] Unknown field "${key}". Valid fields: [${Object.keys(schema).join(', ')}]`);
44
+ continue;
45
+ }
46
+ if (fieldDef.type === 'string[]') {
47
+ if (!Array.isArray(value) || !value.every(v => typeof v === 'string'))
48
+ errors.push(`[${ruleName}] "${key}" must be string[], got ${typeof value}.`);
49
+ }
50
+ else if (typeof value !== fieldDef.type) {
51
+ errors.push(`[${ruleName}] "${key}" must be ${fieldDef.type}, got ${typeof value}.`);
52
+ }
53
+ else if (fieldDef.enumValues && !fieldDef.enumValues.includes(value)) {
54
+ errors.push(`[${ruleName}] "${key}" = "${value}" is not valid. Must be one of: ${fieldDef.enumValues.join(', ')}.`);
55
+ }
56
+ }
57
+ }
58
+ return errors;
59
+ }
60
+ //# sourceMappingURL=validate-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate-config.js","sourceRoot":"","sources":["../../../../../packages/tooling/rules-config/src/validate-config.ts"],"names":[],"mappings":";;AA0DA,0DAwBC;AAjFD,iDAyBwB;AAExB,sEAAsE;AACtE,iEAAiE;AACjE,MAAM,YAAY,GAA6C;IAC3D,kBAAkB,EAAE,mCAAoB,CAAC,MAAM;IAC/C,gBAAgB,EAAE,iCAAkB,CAAC,MAAM;IAC3C,qBAAqB,EAAE,sCAAuB,CAAC,MAAM;IACrD,yBAAyB,EAAE,yCAA0B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UnknownConfig,\n NoImplicitAnyConfig,\n PrismaValidateDtosConfig,\n PrismaConverterConfig,\n NoDestructureConfig,\n NoUnmanagedExceptionsConfig,\n CatchErrorPatternConfig,\n ThrowCauseRequiredConfig,\n AngularNoDirectApiInResolverConfig,\n NoSymbolDiTokensConfig,\n NoShellSubstitutionConfig,\n BranchCreationGuardConfig,\n PrCreationGuardConfig,\n PrMergeCleanupConfig,\n NoDirectMainUpdateConfig,\n NoEditOnMainConfig,\n NoFileImportCyclesConfig,\n RuntimeArchitectureConfig,\n NoJsFilesConfig,\n ValidateTsInSrcConfig,\n} from './rule-configs';\n\n// Thin lookup table — each entry delegates to the class's own SCHEMA.\n// No field lists here; all schemas live with their config class.\nconst RULE_SCHEMAS: Record<string, Record<string, FieldDef>> = {\n 'max-method-lines': MaxMethodLinesConfig.SCHEMA,\n 'max-file-lines': MaxFileLinesConfig.SCHEMA,\n 'require-return-type': RequireReturnTypeConfig.SCHEMA,\n 'no-inline-type-literals': NoInlineTypeLiteralsConfig.SCHEMA,\n 'no-any-unknown': NoAnyUnknownConfig.SCHEMA,\n 'no-implicit-any': NoImplicitAnyConfig.SCHEMA,\n 'prisma-validate-dtos': PrismaValidateDtosConfig.SCHEMA,\n 'prisma-converter': PrismaConverterConfig.SCHEMA,\n 'no-destructure': NoDestructureConfig.SCHEMA,\n 'no-unmanaged-exceptions': NoUnmanagedExceptionsConfig.SCHEMA,\n 'catch-error-pattern': CatchErrorPatternConfig.SCHEMA,\n 'throw-cause-required': ThrowCauseRequiredConfig.SCHEMA,\n 'angular-no-direct-api-in-resolver': AngularNoDirectApiInResolverConfig.SCHEMA,\n 'no-symbol-di-tokens': NoSymbolDiTokensConfig.SCHEMA,\n 'no-shell-substitution': NoShellSubstitutionConfig.SCHEMA,\n 'branch-creation-guard': BranchCreationGuardConfig.SCHEMA,\n 'pr-creation-guard': PrCreationGuardConfig.SCHEMA,\n 'pr-merge-cleanup': PrMergeCleanupConfig.SCHEMA,\n 'no-direct-main-update': NoDirectMainUpdateConfig.SCHEMA,\n 'no-edit-on-main': NoEditOnMainConfig.SCHEMA,\n 'no-file-import-cycles': NoFileImportCyclesConfig.SCHEMA,\n 'runtime-architecture': RuntimeArchitectureConfig.SCHEMA,\n 'no-js-files': NoJsFilesConfig.SCHEMA,\n 'validate-ts-in-src': ValidateTsInSrcConfig.SCHEMA,\n};\n\n// webpieces-disable no-any-unknown -- rawRules values are opaque JSON; each field is validated individually\nexport function validateWebpiecesConfig(\n rawRules: Record<string, Record<string, unknown>>,\n): string[] {\n const errors: string[] = [];\n for (const [ruleName, entry] of Object.entries(rawRules)) {\n const schema = RULE_SCHEMAS[ruleName];\n if (!schema) continue; // custom/unknown rule — no schema to validate against\n for (const [key, value] of Object.entries(entry)) {\n const fieldDef = schema[key];\n if (!fieldDef) {\n errors.push(`[${ruleName}] Unknown field \"${key}\". Valid fields: [${Object.keys(schema).join(', ')}]`);\n continue;\n }\n if (fieldDef.type === 'string[]') {\n if (!Array.isArray(value) || !value.every(v => typeof v === 'string'))\n errors.push(`[${ruleName}] \"${key}\" must be string[], got ${typeof value}.`);\n } else if (typeof value !== fieldDef.type) {\n errors.push(`[${ruleName}] \"${key}\" must be ${fieldDef.type}, got ${typeof value}.`);\n } else if (fieldDef.enumValues && !fieldDef.enumValues.includes(value as string)) {\n errors.push(`[${ruleName}] \"${key}\" = \"${value}\" is not valid. Must be one of: ${fieldDef.enumValues.join(', ')}.`);\n }\n }\n }\n return errors;\n}\n"]}