repopo 0.8.0 → 0.10.0
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/CHANGELOG.md +67 -0
- package/THIRD-PARTY-LICENSES.txt +4 -3
- package/esm/adapters/fluidFramework.js +8 -3
- package/esm/adapters/fluidFramework.js.map +1 -1
- package/esm/baseCommand.d.ts.map +1 -1
- package/esm/baseCommand.js +2 -1
- package/esm/baseCommand.js.map +1 -1
- package/esm/commands/check.d.ts +1 -0
- package/esm/commands/check.d.ts.map +1 -1
- package/esm/commands/check.js +114 -52
- package/esm/commands/check.js.map +1 -1
- package/esm/commands/list.d.ts.map +1 -1
- package/esm/commands/list.js +3 -1
- package/esm/commands/list.js.map +1 -1
- package/esm/config.d.ts +19 -4
- package/esm/config.d.ts.map +1 -1
- package/esm/config.js +2 -3
- package/esm/config.js.map +1 -1
- package/esm/generators.d.ts +30 -2
- package/esm/generators.d.ts.map +1 -1
- package/esm/generators.js +31 -1
- package/esm/generators.js.map +1 -1
- package/esm/index.d.ts +14 -4
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +17 -2
- package/esm/index.js.map +1 -1
- package/esm/makePolicy.d.ts +74 -3
- package/esm/makePolicy.d.ts.map +1 -1
- package/esm/makePolicy.js +87 -13
- package/esm/makePolicy.js.map +1 -1
- package/esm/perf.d.ts +3 -2
- package/esm/perf.d.ts.map +1 -1
- package/esm/perf.js +2 -2
- package/esm/perf.js.map +1 -1
- package/esm/policies/ConditionalScripts.d.ts +94 -0
- package/esm/policies/ConditionalScripts.d.ts.map +1 -0
- package/esm/policies/ConditionalScripts.js +144 -0
- package/esm/policies/ConditionalScripts.js.map +1 -0
- package/esm/policies/ExactScripts.d.ts +51 -0
- package/esm/policies/ExactScripts.d.ts.map +1 -0
- package/esm/policies/ExactScripts.js +107 -0
- package/esm/policies/ExactScripts.js.map +1 -0
- package/esm/policies/HtmlFileHeaders.d.ts +1 -1
- package/esm/policies/HtmlFileHeaders.d.ts.map +1 -1
- package/esm/policies/HtmlFileHeaders.js +11 -7
- package/esm/policies/HtmlFileHeaders.js.map +1 -1
- package/esm/policies/JsTsFileHeaders.d.ts +1 -1
- package/esm/policies/JsTsFileHeaders.d.ts.map +1 -1
- package/esm/policies/JsTsFileHeaders.js +11 -7
- package/esm/policies/JsTsFileHeaders.js.map +1 -1
- package/esm/policies/LicenseFileExists.d.ts.map +1 -1
- package/esm/policies/LicenseFileExists.js +22 -18
- package/esm/policies/LicenseFileExists.js.map +1 -1
- package/esm/policies/MutuallyExclusiveScripts.d.ts +46 -0
- package/esm/policies/MutuallyExclusiveScripts.d.ts.map +1 -0
- package/esm/policies/MutuallyExclusiveScripts.js +52 -0
- package/esm/policies/MutuallyExclusiveScripts.js.map +1 -0
- package/esm/policies/NoJsFileExtensions.d.ts.map +1 -1
- package/esm/policies/NoJsFileExtensions.js +16 -12
- package/esm/policies/NoJsFileExtensions.js.map +1 -1
- package/esm/policies/NoLargeBinaryFiles.d.ts.map +1 -1
- package/esm/policies/NoLargeBinaryFiles.js +35 -31
- package/esm/policies/NoLargeBinaryFiles.js.map +1 -1
- package/esm/policies/NoPrivateWorkspaceDependencies.d.ts +1 -1
- package/esm/policies/NoPrivateWorkspaceDependencies.d.ts.map +1 -1
- package/esm/policies/NoPrivateWorkspaceDependencies.js +53 -45
- package/esm/policies/NoPrivateWorkspaceDependencies.js.map +1 -1
- package/esm/policies/PackageAllowedScopes.d.ts +1 -1
- package/esm/policies/PackageAllowedScopes.d.ts.map +1 -1
- package/esm/policies/PackageAllowedScopes.js +45 -40
- package/esm/policies/PackageAllowedScopes.js.map +1 -1
- package/esm/policies/PackageEsmType.d.ts +1 -1
- package/esm/policies/PackageEsmType.d.ts.map +1 -1
- package/esm/policies/PackageEsmType.js +48 -44
- package/esm/policies/PackageEsmType.js.map +1 -1
- package/esm/policies/PackageFolderName.d.ts +1 -1
- package/esm/policies/PackageFolderName.d.ts.map +1 -1
- package/esm/policies/PackageFolderName.js +38 -34
- package/esm/policies/PackageFolderName.js.map +1 -1
- package/esm/policies/PackageJsonProperties.d.ts +1 -1
- package/esm/policies/PackageJsonProperties.d.ts.map +1 -1
- package/esm/policies/PackageJsonProperties.js +36 -31
- package/esm/policies/PackageJsonProperties.js.map +1 -1
- package/esm/policies/PackageJsonRepoDirectoryProperty.d.ts +1 -1
- package/esm/policies/PackageJsonRepoDirectoryProperty.d.ts.map +1 -1
- package/esm/policies/PackageJsonRepoDirectoryProperty.js +41 -38
- package/esm/policies/PackageJsonRepoDirectoryProperty.js.map +1 -1
- package/esm/policies/PackageJsonSorted.d.ts +1 -1
- package/esm/policies/PackageJsonSorted.d.ts.map +1 -1
- package/esm/policies/PackageJsonSorted.js +40 -36
- package/esm/policies/PackageJsonSorted.js.map +1 -1
- package/esm/policies/PackageLicense.d.ts +1 -1
- package/esm/policies/PackageLicense.d.ts.map +1 -1
- package/esm/policies/PackageLicense.js +58 -54
- package/esm/policies/PackageLicense.js.map +1 -1
- package/esm/policies/PackagePrivateField.d.ts +1 -1
- package/esm/policies/PackagePrivateField.d.ts.map +1 -1
- package/esm/policies/PackagePrivateField.js +58 -54
- package/esm/policies/PackagePrivateField.js.map +1 -1
- package/esm/policies/PackageReadme.d.ts +1 -1
- package/esm/policies/PackageReadme.d.ts.map +1 -1
- package/esm/policies/PackageReadme.js +30 -26
- package/esm/policies/PackageReadme.js.map +1 -1
- package/esm/policies/PackageScripts.d.ts +1 -1
- package/esm/policies/PackageScripts.d.ts.map +1 -1
- package/esm/policies/PackageScripts.js +39 -35
- package/esm/policies/PackageScripts.js.map +1 -1
- package/esm/policies/PackageTestScripts.d.ts +1 -1
- package/esm/policies/PackageTestScripts.d.ts.map +1 -1
- package/esm/policies/PackageTestScripts.js +46 -40
- package/esm/policies/PackageTestScripts.js.map +1 -1
- package/esm/policies/RequiredGitignorePatterns.d.ts.map +1 -1
- package/esm/policies/RequiredGitignorePatterns.js +20 -15
- package/esm/policies/RequiredGitignorePatterns.js.map +1 -1
- package/esm/policies/RequiredScripts.d.ts +71 -0
- package/esm/policies/RequiredScripts.d.ts.map +1 -0
- package/esm/policies/RequiredScripts.js +120 -0
- package/esm/policies/RequiredScripts.js.map +1 -0
- package/esm/policies/ScriptContains.d.ts +64 -0
- package/esm/policies/ScriptContains.d.ts.map +1 -0
- package/esm/policies/ScriptContains.js +62 -0
- package/esm/policies/ScriptContains.js.map +1 -0
- package/esm/policies.d.ts +6 -1
- package/esm/policies.d.ts.map +1 -1
- package/esm/policies.js +18 -0
- package/esm/policies.js.map +1 -1
- package/esm/policy.d.ts +193 -74
- package/esm/policy.d.ts.map +1 -1
- package/esm/policy.js +110 -19
- package/esm/policy.js.map +1 -1
- package/esm/policyDefiners/defineFileHeaderPolicy.d.ts +49 -2
- package/esm/policyDefiners/defineFileHeaderPolicy.d.ts.map +1 -1
- package/esm/policyDefiners/defineFileHeaderPolicy.js +21 -4
- package/esm/policyDefiners/defineFileHeaderPolicy.js.map +1 -1
- package/esm/policyDefiners/definePackagePolicy.d.ts +57 -3
- package/esm/policyDefiners/definePackagePolicy.d.ts.map +1 -1
- package/esm/policyDefiners/definePackagePolicy.js +50 -5
- package/esm/policyDefiners/definePackagePolicy.js.map +1 -1
- package/esm/tsdoc-metadata.json +1 -1
- package/oclif.manifest.json +1 -1
- package/package.json +6 -4
package/esm/config.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PolicyCreator } from "./generators.js";
|
|
2
|
-
import {
|
|
2
|
+
import type { ConfiguredPolicy, PolicyInstance } from "./policy.js";
|
|
3
3
|
/**
|
|
4
4
|
* @alpha
|
|
5
5
|
*/
|
|
@@ -9,14 +9,29 @@ export type PolicyList = PolicyCreator[];
|
|
|
9
9
|
*/
|
|
10
10
|
export interface RepopoConfig {
|
|
11
11
|
/**
|
|
12
|
-
* An array of policies that are enabled.
|
|
12
|
+
* An array of configured policies that are enabled.
|
|
13
|
+
*
|
|
14
|
+
* Use the `policy()` function to configure policies before adding them to this array.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```typescript
|
|
18
|
+
* import { policy, type RepopoConfig } from "repopo";
|
|
19
|
+
* import { NoJsFileExtensions, PackageJsonProperties } from "repopo/policies";
|
|
20
|
+
*
|
|
21
|
+
* const config: RepopoConfig = {
|
|
22
|
+
* policies: [
|
|
23
|
+
* policy(NoJsFileExtensions, { exclude: ["bin/*"] }),
|
|
24
|
+
* policy(PackageJsonProperties, { verbatim: { license: "MIT" } }),
|
|
25
|
+
* ],
|
|
26
|
+
* };
|
|
27
|
+
* ```
|
|
13
28
|
*
|
|
14
29
|
* See `DefaultPolicies` for the policies that will be enabled by default if this is `undefined`.
|
|
15
30
|
*/
|
|
16
|
-
policies?: PolicyInstance<any>[];
|
|
31
|
+
policies?: (ConfiguredPolicy<any> | PolicyInstance<any>)[];
|
|
17
32
|
/**
|
|
18
33
|
* An array of strings/regular expressions. File paths that match any of these expressions will be completely excluded
|
|
19
|
-
* from
|
|
34
|
+
* from all policies.
|
|
20
35
|
*/
|
|
21
36
|
excludeFiles?: (string | RegExp)[];
|
|
22
37
|
}
|
package/esm/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAGpE;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG,aAAa,EAAE,CAAC;AAEzC;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B;;;;;;;;;;;;;;;;;;;OAmBG;IAEH,QAAQ,CAAC,EAAE,CAAC,gBAAgB,CAAC,GAAG,CAAC,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;IAE3D;;;OAGG;IACH,YAAY,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CACnC;AAED;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,YAGjC,CAAC"}
|
package/esm/config.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { policy } from "./makePolicy.js";
|
|
2
2
|
import { DefaultPolicies } from "./policy.js";
|
|
3
3
|
/**
|
|
4
4
|
* The default config applied when no config is found.
|
|
@@ -6,8 +6,7 @@ import { DefaultPolicies } from "./policy.js";
|
|
|
6
6
|
* @alpha
|
|
7
7
|
*/
|
|
8
8
|
export const DefaultPolicyConfig = {
|
|
9
|
-
policies: DefaultPolicies.map((p) =>
|
|
9
|
+
policies: DefaultPolicies.map((p) => policy(p)),
|
|
10
10
|
excludeFiles: [],
|
|
11
|
-
// excludePoliciesForFiles: {},
|
|
12
11
|
};
|
|
13
12
|
//# sourceMappingURL=config.js.map
|
package/esm/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAyC9C;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAiB;IAChD,QAAQ,EAAE,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;IAC/C,YAAY,EAAE,EAAE;CAChB,CAAC","sourcesContent":["import type { PolicyCreator } from \"./generators.js\";\nimport { policy } from \"./makePolicy.js\";\nimport type { ConfiguredPolicy, PolicyInstance } from \"./policy.js\";\nimport { DefaultPolicies } from \"./policy.js\";\n\n/**\n * @alpha\n */\nexport type PolicyList = PolicyCreator[];\n\n/**\n * @alpha\n */\nexport interface RepopoConfig {\n\t/**\n\t * An array of configured policies that are enabled.\n\t *\n\t * Use the `policy()` function to configure policies before adding them to this array.\n\t *\n\t * @example\n\t * ```typescript\n\t * import { policy, type RepopoConfig } from \"repopo\";\n\t * import { NoJsFileExtensions, PackageJsonProperties } from \"repopo/policies\";\n\t *\n\t * const config: RepopoConfig = {\n\t * policies: [\n\t * policy(NoJsFileExtensions, { exclude: [\"bin/*\"] }),\n\t * policy(PackageJsonProperties, { verbatim: { license: \"MIT\" } }),\n\t * ],\n\t * };\n\t * ```\n\t *\n\t * See `DefaultPolicies` for the policies that will be enabled by default if this is `undefined`.\n\t */\n\t// biome-ignore lint/suspicious/noExplicitAny: FIXME\n\tpolicies?: (ConfiguredPolicy<any> | PolicyInstance<any>)[];\n\n\t/**\n\t * An array of strings/regular expressions. File paths that match any of these expressions will be completely excluded\n\t * from all policies.\n\t */\n\texcludeFiles?: (string | RegExp)[];\n}\n\n/**\n * The default config applied when no config is found.\n *\n * @alpha\n */\nexport const DefaultPolicyConfig: RepopoConfig = {\n\tpolicies: DefaultPolicies.map((p) => policy(p)),\n\texcludeFiles: [],\n};\n"]}
|
package/esm/generators.d.ts
CHANGED
|
@@ -12,10 +12,38 @@ export type PolicyCreatorFunction<C = undefined> = (args: PolicyDefinition<C>) =
|
|
|
12
12
|
*/
|
|
13
13
|
export type PolicyCreatorConstructor<C = undefined> = new (args: PolicyDefinition<C>) => PolicyDefinition<C>;
|
|
14
14
|
/**
|
|
15
|
-
* A PolicyCreator is a function that can be used to generate a {@link PolicyDefinition}. The function can be a free
|
|
16
|
-
* or a constructor that creates a class implementing the {@link PolicyDefinition} interface.
|
|
15
|
+
* A PolicyCreator is a function that can be used to generate a {@link PolicyDefinition}. The function can be a free
|
|
16
|
+
* function or a constructor that creates a class implementing the {@link PolicyDefinition} interface.
|
|
17
17
|
*
|
|
18
18
|
* @alpha
|
|
19
19
|
*/
|
|
20
20
|
export type PolicyCreator = PolicyCreatorConstructor | PolicyCreatorFunction;
|
|
21
|
+
/**
|
|
22
|
+
* Checks if a given function is a generator function.
|
|
23
|
+
*
|
|
24
|
+
* A generator function is a function that can be paused and resumed, and can yield
|
|
25
|
+
* multiple values over time. This utility function helps identify such functions
|
|
26
|
+
* by checking their constructor name.
|
|
27
|
+
*
|
|
28
|
+
* @param fn - The function to check
|
|
29
|
+
* @returns `true` if the function is a generator function, `false` otherwise
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* function* myGenerator() {
|
|
34
|
+
* yield 1;
|
|
35
|
+
* yield 2;
|
|
36
|
+
* }
|
|
37
|
+
*
|
|
38
|
+
* function regularFunction() {
|
|
39
|
+
* return 1;
|
|
40
|
+
* }
|
|
41
|
+
*
|
|
42
|
+
* console.log(isGeneratorFunction(myGenerator)); // true
|
|
43
|
+
* console.log(isGeneratorFunction(regularFunction)); // false
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @alpha
|
|
47
|
+
*/
|
|
48
|
+
export declare function isGeneratorFunction(fn: Function): fn is GeneratorFunction;
|
|
21
49
|
//# sourceMappingURL=generators.d.ts.map
|
package/esm/generators.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generators.d.ts","sourceRoot":"","sources":["../src/generators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,GAAG,SAAS,IAAI,CAClD,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,KACrB,gBAAgB,CAAC,CAAC,CAAC,CAAC;AAEzB;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,CAAC,CAAC,GAAG,SAAS,IAAI,KACrD,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,KACrB,gBAAgB,CAAC,CAAC,CAAC,CAAC;AAEzB;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,wBAAwB,GAAG,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"generators.d.ts","sourceRoot":"","sources":["../src/generators.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEpD;;;;GAIG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,GAAG,SAAS,IAAI,CAClD,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,KACrB,gBAAgB,CAAC,CAAC,CAAC,CAAC;AAEzB;;;;GAIG;AACH,MAAM,MAAM,wBAAwB,CAAC,CAAC,GAAG,SAAS,IAAI,KACrD,IAAI,EAAE,gBAAgB,CAAC,CAAC,CAAC,KACrB,gBAAgB,CAAC,CAAC,CAAC,CAAC;AAEzB;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,wBAAwB,GAAG,qBAAqB,CAAC;AAE7E;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,QAAQ,GAAG,EAAE,IAAI,iBAAiB,CAEzE"}
|
package/esm/generators.js
CHANGED
|
@@ -1,2 +1,32 @@
|
|
|
1
|
-
|
|
1
|
+
/**
|
|
2
|
+
* Checks if a given function is a generator function.
|
|
3
|
+
*
|
|
4
|
+
* A generator function is a function that can be paused and resumed, and can yield
|
|
5
|
+
* multiple values over time. This utility function helps identify such functions
|
|
6
|
+
* by checking their constructor name.
|
|
7
|
+
*
|
|
8
|
+
* @param fn - The function to check
|
|
9
|
+
* @returns `true` if the function is a generator function, `false` otherwise
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* function* myGenerator() {
|
|
14
|
+
* yield 1;
|
|
15
|
+
* yield 2;
|
|
16
|
+
* }
|
|
17
|
+
*
|
|
18
|
+
* function regularFunction() {
|
|
19
|
+
* return 1;
|
|
20
|
+
* }
|
|
21
|
+
*
|
|
22
|
+
* console.log(isGeneratorFunction(myGenerator)); // true
|
|
23
|
+
* console.log(isGeneratorFunction(regularFunction)); // false
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @alpha
|
|
27
|
+
*/
|
|
28
|
+
// biome-ignore lint/complexity/noBannedTypes: broad type is OK here
|
|
29
|
+
export function isGeneratorFunction(fn) {
|
|
30
|
+
return fn.constructor.name === "GeneratorFunction";
|
|
31
|
+
}
|
|
2
32
|
//# sourceMappingURL=generators.js.map
|
package/esm/generators.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generators.js","sourceRoot":"","sources":["../src/generators.ts"],"names":[],"mappings":"","sourcesContent":["import type { PolicyDefinition } from \"./policy.js\";\n\n/**\n * The definition of a free function that returns a RepoPolicy.\n *\n * @alpha\n */\nexport type PolicyCreatorFunction<C = undefined> = (\n\targs: PolicyDefinition<C>,\n) => PolicyDefinition<C>;\n\n/**\n * The definition of a constructor function that returns a RepoPolicy.\n *\n * @alpha\n */\nexport type PolicyCreatorConstructor<C = undefined> = new (\n\targs: PolicyDefinition<C>,\n) => PolicyDefinition<C>;\n\n/**\n * A PolicyCreator is a function that can be used to generate a {@link PolicyDefinition}. The function can be a free
|
|
1
|
+
{"version":3,"file":"generators.js","sourceRoot":"","sources":["../src/generators.ts"],"names":[],"mappings":"AA4BA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,oEAAoE;AACpE,MAAM,UAAU,mBAAmB,CAAC,EAAY;IAC/C,OAAO,EAAE,CAAC,WAAW,CAAC,IAAI,KAAK,mBAAmB,CAAC;AACpD,CAAC","sourcesContent":["import type { PolicyDefinition } from \"./policy.js\";\n\n/**\n * The definition of a free function that returns a RepoPolicy.\n *\n * @alpha\n */\nexport type PolicyCreatorFunction<C = undefined> = (\n\targs: PolicyDefinition<C>,\n) => PolicyDefinition<C>;\n\n/**\n * The definition of a constructor function that returns a RepoPolicy.\n *\n * @alpha\n */\nexport type PolicyCreatorConstructor<C = undefined> = new (\n\targs: PolicyDefinition<C>,\n) => PolicyDefinition<C>;\n\n/**\n * A PolicyCreator is a function that can be used to generate a {@link PolicyDefinition}. The function can be a free\n * function or a constructor that creates a class implementing the {@link PolicyDefinition} interface.\n *\n * @alpha\n */\nexport type PolicyCreator = PolicyCreatorConstructor | PolicyCreatorFunction;\n\n/**\n * Checks if a given function is a generator function.\n *\n * A generator function is a function that can be paused and resumed, and can yield\n * multiple values over time. This utility function helps identify such functions\n * by checking their constructor name.\n *\n * @param fn - The function to check\n * @returns `true` if the function is a generator function, `false` otherwise\n *\n * @example\n * ```typescript\n * function* myGenerator() {\n * yield 1;\n * yield 2;\n * }\n *\n * function regularFunction() {\n * return 1;\n * }\n *\n * console.log(isGeneratorFunction(myGenerator)); // true\n * console.log(isGeneratorFunction(regularFunction)); // false\n * ```\n *\n * @alpha\n */\n// biome-ignore lint/complexity/noBannedTypes: broad type is OK here\nexport function isGeneratorFunction(fn: Function): fn is GeneratorFunction {\n\treturn fn.constructor.name === \"GeneratorFunction\";\n}\n"]}
|
package/esm/index.d.ts
CHANGED
|
@@ -1,8 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A tool for enforcing repository policies and standards across codebases.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Repopo provides a framework for defining and enforcing policies across repositories,
|
|
6
|
+
* such as file headers, package.json consistency, and other code standards.
|
|
7
|
+
* It can be used as a CLI tool or integrated into CI/CD pipelines.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
1
11
|
export { run } from "@oclif/core";
|
|
2
12
|
export { type FluidAdapterOptions, type FluidHandler, fromFluidHandlers, } from "./adapters/fluidFramework.js";
|
|
3
13
|
export type { RepopoConfig, } from "./config.js";
|
|
4
|
-
export { makePolicy } from "./makePolicy.js";
|
|
5
|
-
export type
|
|
6
|
-
export {
|
|
7
|
-
export { definePackagePolicy as generatePackagePolicy, type PackageJsonHandler, } from "./policyDefiners/definePackagePolicy.js";
|
|
14
|
+
export { makePolicy, makePolicyDefinition, type PolicyDefinitionInput, type PolicyOptions, policy, } from "./makePolicy.js";
|
|
15
|
+
export { type ConfiguredPolicy, isPolicyError, isPolicyFailure, isPolicyFixResult, Policy, type PolicyArgs, type PolicyDefinition, type PolicyError, type PolicyFailure, type PolicyFixResult, type PolicyFunctionArguments, type PolicyHandler, type PolicyHandlerResult, type PolicyInstance, type PolicyInstanceSettings, type PolicyName, type PolicyResolver, type PolicyResult, type PolicyShape, type PolicyStandaloneResolver, } from "./policy.js";
|
|
16
|
+
export { type DefineFileHeaderPolicyArgs, defineFileHeaderPolicy, type FileHeaderGeneratorConfig, type FileHeaderPolicyConfig, } from "./policyDefiners/defineFileHeaderPolicy.js";
|
|
17
|
+
export { type DefinePackagePolicyArgs, definePackagePolicy as generatePackagePolicy, type PackageJsonHandler, } from "./policyDefiners/definePackagePolicy.js";
|
|
8
18
|
//# sourceMappingURL=index.d.ts.map
|
package/esm/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EACN,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,iBAAiB,GACjB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAEX,YAAY,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EACN,KAAK,mBAAmB,EACxB,KAAK,YAAY,EACjB,iBAAiB,GACjB,MAAM,8BAA8B,CAAC;AACtC,YAAY,EAEX,YAAY,GACZ,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,UAAU,EACV,oBAAoB,EACpB,KAAK,qBAAqB,EAC1B,KAAK,aAAa,EAClB,MAAM,GACN,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACN,KAAK,gBAAgB,EAErB,aAAa,EACb,eAAe,EACf,iBAAiB,EAEjB,MAAM,EACN,KAAK,UAAU,EAEf,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,uBAAuB,EAC5B,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,wBAAwB,GAC7B,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,KAAK,0BAA0B,EAC/B,sBAAsB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,GAC3B,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACN,KAAK,uBAAuB,EAC5B,mBAAmB,IAAI,qBAAqB,EAC5C,KAAK,kBAAkB,GACvB,MAAM,yCAAyC,CAAC"}
|
package/esm/index.js
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A tool for enforcing repository policies and standards across codebases.
|
|
3
|
+
*
|
|
4
|
+
* @remarks
|
|
5
|
+
* Repopo provides a framework for defining and enforcing policies across repositories,
|
|
6
|
+
* such as file headers, package.json consistency, and other code standards.
|
|
7
|
+
* It can be used as a CLI tool or integrated into CI/CD pipelines.
|
|
8
|
+
*
|
|
9
|
+
* @packageDocumentation
|
|
10
|
+
*/
|
|
1
11
|
export { run } from "@oclif/core";
|
|
2
12
|
export { fromFluidHandlers, } from "./adapters/fluidFramework.js";
|
|
3
|
-
export { makePolicy } from "./makePolicy.js";
|
|
4
|
-
export {
|
|
13
|
+
export { makePolicy, makePolicyDefinition, policy, } from "./makePolicy.js";
|
|
14
|
+
export {
|
|
15
|
+
// Type guards
|
|
16
|
+
isPolicyError, isPolicyFailure, isPolicyFixResult,
|
|
17
|
+
// New types
|
|
18
|
+
Policy, } from "./policy.js";
|
|
19
|
+
export { defineFileHeaderPolicy, } from "./policyDefiners/defineFileHeaderPolicy.js";
|
|
5
20
|
export { definePackagePolicy as generatePackagePolicy, } from "./policyDefiners/definePackagePolicy.js";
|
|
6
21
|
//# sourceMappingURL=index.js.map
|
package/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAGN,iBAAiB,GACjB,MAAM,8BAA8B,CAAC;AAKtC,OAAO,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAGN,iBAAiB,GACjB,MAAM,8BAA8B,CAAC;AAKtC,OAAO,EACN,UAAU,EACV,oBAAoB,EAGpB,MAAM,GACN,MAAM,iBAAiB,CAAC;AACzB,OAAO;AAEN,cAAc;AACd,aAAa,EACb,eAAe,EACf,iBAAiB;AACjB,YAAY;AACZ,MAAM,GAiBN,MAAM,aAAa,CAAC;AACrB,OAAO,EAEN,sBAAsB,GAGtB,MAAM,4CAA4C,CAAC;AACpD,OAAO,EAEN,mBAAmB,IAAI,qBAAqB,GAE5C,MAAM,yCAAyC,CAAC","sourcesContent":["/**\n * A tool for enforcing repository policies and standards across codebases.\n *\n * @remarks\n * Repopo provides a framework for defining and enforcing policies across repositories,\n * such as file headers, package.json consistency, and other code standards.\n * It can be used as a CLI tool or integrated into CI/CD pipelines.\n *\n * @packageDocumentation\n */\n\nexport { run } from \"@oclif/core\";\nexport {\n\ttype FluidAdapterOptions,\n\ttype FluidHandler,\n\tfromFluidHandlers,\n} from \"./adapters/fluidFramework.js\";\nexport type {\n\t// PolicyList,\n\tRepopoConfig,\n} from \"./config.js\";\nexport {\n\tmakePolicy,\n\tmakePolicyDefinition,\n\ttype PolicyDefinitionInput,\n\ttype PolicyOptions,\n\tpolicy,\n} from \"./makePolicy.js\";\nexport {\n\ttype ConfiguredPolicy,\n\t// Type guards\n\tisPolicyError,\n\tisPolicyFailure,\n\tisPolicyFixResult,\n\t// New types\n\tPolicy,\n\ttype PolicyArgs,\n\t// Legacy types (for backward compatibility)\n\ttype PolicyDefinition,\n\ttype PolicyError,\n\ttype PolicyFailure,\n\ttype PolicyFixResult,\n\ttype PolicyFunctionArguments,\n\ttype PolicyHandler,\n\ttype PolicyHandlerResult,\n\ttype PolicyInstance,\n\ttype PolicyInstanceSettings,\n\ttype PolicyName,\n\ttype PolicyResolver,\n\ttype PolicyResult,\n\ttype PolicyShape,\n\ttype PolicyStandaloneResolver,\n} from \"./policy.js\";\nexport {\n\ttype DefineFileHeaderPolicyArgs,\n\tdefineFileHeaderPolicy,\n\ttype FileHeaderGeneratorConfig,\n\ttype FileHeaderPolicyConfig,\n} from \"./policyDefiners/defineFileHeaderPolicy.js\";\nexport {\n\ttype DefinePackagePolicyArgs,\n\tdefinePackagePolicy as generatePackagePolicy,\n\ttype PackageJsonHandler,\n} from \"./policyDefiners/definePackagePolicy.js\";\n"]}
|
package/esm/makePolicy.d.ts
CHANGED
|
@@ -1,7 +1,78 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
export declare function makePolicyDefinition<C = undefined>(name: PolicyName, match: RegExp, handler: PolicyHandler<C>, defaultConfig?: C, description?: string, resolver?: PolicyStandaloneResolver<C>): PolicyDefinition<C>;
|
|
1
|
+
import type { ConfiguredPolicy, PolicyDefinition, PolicyInstance, PolicyInstanceSettings, PolicyShape } from "./policy.js";
|
|
3
2
|
/**
|
|
4
|
-
*
|
|
3
|
+
* Options for configuring a policy instance.
|
|
4
|
+
*
|
|
5
|
+
* @alpha
|
|
6
|
+
*/
|
|
7
|
+
export interface PolicyOptions {
|
|
8
|
+
/**
|
|
9
|
+
* File paths matching these patterns will be excluded from this policy.
|
|
10
|
+
* Patterns are matched against repo-relative paths.
|
|
11
|
+
*/
|
|
12
|
+
exclude?: (string | RegExp)[];
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Configure a policy for use in repopo.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* This function takes a policy definition and returns a configured policy instance
|
|
19
|
+
* that can be added to the `policies` array in `repopo.config.ts`.
|
|
20
|
+
*
|
|
21
|
+
* Handlers are automatically normalized: async functions are wrapped for Effection
|
|
22
|
+
* compatibility, while generator functions are used directly.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```typescript
|
|
26
|
+
* // Policy with no config, just options
|
|
27
|
+
* policy(NoJsFileExtensions, { exclude: ["bin/*"] })
|
|
28
|
+
*
|
|
29
|
+
* // Policy with config
|
|
30
|
+
* policy(PackageJsonProperties, { verbatim: { license: "MIT" } })
|
|
31
|
+
*
|
|
32
|
+
* // Policy with config and options
|
|
33
|
+
* policy(PackageJsonProperties, { verbatim: { license: "MIT" } }, { exclude: ["vendor/*"] })
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @alpha
|
|
37
|
+
*/
|
|
38
|
+
export declare function policy<C = void>(policyDef: PolicyShape<C>, options?: PolicyOptions): ConfiguredPolicy<C>;
|
|
39
|
+
/** @alpha */
|
|
40
|
+
export declare function policy<C>(policyDef: PolicyShape<C>, config: C, options?: PolicyOptions): ConfiguredPolicy<C>;
|
|
41
|
+
/**
|
|
42
|
+
* Input arguments for creating a policy definition.
|
|
43
|
+
*
|
|
44
|
+
* @deprecated Use {@link PolicyShape} directly instead.
|
|
45
|
+
*
|
|
46
|
+
* @alpha
|
|
47
|
+
*/
|
|
48
|
+
export type PolicyDefinitionInput<C = undefined> = PolicyDefinition<C>;
|
|
49
|
+
/**
|
|
50
|
+
* Creates a {@link PolicyDefinition} from the provided arguments.
|
|
51
|
+
*
|
|
52
|
+
* @deprecated Define policies as object literals satisfying {@link PolicyShape} instead.
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* ```typescript
|
|
56
|
+
* const MyPolicy = makePolicyDefinition({
|
|
57
|
+
* name: "MyPolicy",
|
|
58
|
+
* description: "Ensures files follow conventions",
|
|
59
|
+
* match: /\.ts$/,
|
|
60
|
+
* handler: async ({ file }) => true,
|
|
61
|
+
* });
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @alpha
|
|
65
|
+
*/
|
|
66
|
+
export declare function makePolicyDefinition<C = undefined>(args: PolicyDefinitionInput<C>): PolicyDefinition<C>;
|
|
67
|
+
/**
|
|
68
|
+
* Combine a {@link PolicyDefinition} with a policy-specific config and other settings.
|
|
69
|
+
*
|
|
70
|
+
* @deprecated Use the `policy` function instead, which has a simpler API.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```typescript
|
|
74
|
+
* makePolicy(NoJsFileExtensions, undefined, { excludeFiles: ["bin/*"] })
|
|
75
|
+
* ```
|
|
5
76
|
*
|
|
6
77
|
* @alpha
|
|
7
78
|
*/
|
package/esm/makePolicy.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makePolicy.d.ts","sourceRoot":"","sources":["../src/makePolicy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"makePolicy.d.ts","sourceRoot":"","sources":["../src/makePolicy.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,gBAAgB,EAEhB,gBAAgB,EAGhB,cAAc,EACd,sBAAsB,EACtB,WAAW,EACX,MAAM,aAAa,CAAC;AAMrB;;;;GAIG;AACH,MAAM,WAAW,aAAa;IAC7B;;;OAGG;IACH,OAAO,CAAC,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC;CAC9B;AAuBD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAgB,MAAM,CAAC,CAAC,GAAG,IAAI,EAC9B,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,EACzB,OAAO,CAAC,EAAE,aAAa,GACrB,gBAAgB,CAAC,CAAC,CAAC,CAAC;AACvB,aAAa;AACb,wBAAgB,MAAM,CAAC,CAAC,EACvB,SAAS,EAAE,WAAW,CAAC,CAAC,CAAC,EACzB,MAAM,EAAE,CAAC,EACT,OAAO,CAAC,EAAE,aAAa,GACrB,gBAAgB,CAAC,CAAC,CAAC,CAAC;AAoDvB;;;;;;GAMG;AACH,MAAM,MAAM,qBAAqB,CAAC,CAAC,GAAG,SAAS,IAAI,gBAAgB,CAAC,CAAC,CAAC,CAAC;AAEvE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,CAAC,CAAC,GAAG,SAAS,EACjD,IAAI,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAC5B,gBAAgB,CAAC,CAAC,CAAC,CASrB;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAC3B,UAAU,EAAE,gBAAgB,CAAC,CAAC,CAAC,EAC/B,MAAM,CAAC,EAAE,CAAC,EACV,QAAQ,CAAC,EAAE,sBAAsB,CAAC,CAAC,CAAC,GAClC,cAAc,CAAC,CAAC,CAAC,CAMnB"}
|
package/esm/makePolicy.js
CHANGED
|
@@ -1,20 +1,94 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { call } from "effection";
|
|
2
|
+
import { isGeneratorFunction } from "./generators.js";
|
|
3
|
+
/**
|
|
4
|
+
* Normalizes a handler to always return an Effection Operation.
|
|
5
|
+
* Detection happens once at registration time, not per-invocation.
|
|
6
|
+
*/
|
|
7
|
+
function normalizeHandler(handler) {
|
|
8
|
+
if (isGeneratorFunction(handler)) {
|
|
9
|
+
// Already a generator, return as-is
|
|
10
|
+
return handler;
|
|
11
|
+
}
|
|
12
|
+
// Async function - wrap with call()
|
|
13
|
+
return function* (args) {
|
|
14
|
+
const asyncHandler = handler;
|
|
15
|
+
return yield* call(() => asyncHandler(args));
|
|
11
16
|
};
|
|
12
17
|
}
|
|
13
|
-
|
|
14
|
-
|
|
18
|
+
/** @alpha */
|
|
19
|
+
export function policy(policyDef, configOrOptions, maybeOptions) {
|
|
20
|
+
// Determine if the second argument is config or options
|
|
21
|
+
let config;
|
|
22
|
+
let options;
|
|
23
|
+
if (maybeOptions !== undefined) {
|
|
24
|
+
// Three-argument form: policy(def, config, options)
|
|
25
|
+
config = configOrOptions;
|
|
26
|
+
options = maybeOptions;
|
|
27
|
+
}
|
|
28
|
+
else if (configOrOptions !== undefined) {
|
|
29
|
+
// Two-argument form: need to determine if it's config or options
|
|
30
|
+
// PolicyOptions has a specific shape with 'exclude' property
|
|
31
|
+
if (typeof configOrOptions === "object" &&
|
|
32
|
+
configOrOptions !== null &&
|
|
33
|
+
"exclude" in configOrOptions &&
|
|
34
|
+
!("name" in configOrOptions) &&
|
|
35
|
+
Object.keys(configOrOptions).every((k) => k === "exclude")) {
|
|
36
|
+
// It's options (has only 'exclude')
|
|
37
|
+
options = configOrOptions;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
// It's config
|
|
41
|
+
config = configOrOptions;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
// Merge with default config if available
|
|
45
|
+
const effectiveConfig = config ?? policyDef.defaultConfig;
|
|
46
|
+
// Support both 'exclude' and 'excludeFiles' for backward compatibility
|
|
47
|
+
const excludePatterns = options?.exclude;
|
|
48
|
+
return {
|
|
49
|
+
...policyDef,
|
|
50
|
+
config: effectiveConfig,
|
|
51
|
+
exclude: excludePatterns,
|
|
52
|
+
excludeFiles: excludePatterns,
|
|
53
|
+
_internalHandler: normalizeHandler(policyDef.handler),
|
|
54
|
+
};
|
|
15
55
|
}
|
|
16
56
|
/**
|
|
17
|
-
*
|
|
57
|
+
* Creates a {@link PolicyDefinition} from the provided arguments.
|
|
58
|
+
*
|
|
59
|
+
* @deprecated Define policies as object literals satisfying {@link PolicyShape} instead.
|
|
60
|
+
*
|
|
61
|
+
* @example
|
|
62
|
+
* ```typescript
|
|
63
|
+
* const MyPolicy = makePolicyDefinition({
|
|
64
|
+
* name: "MyPolicy",
|
|
65
|
+
* description: "Ensures files follow conventions",
|
|
66
|
+
* match: /\.ts$/,
|
|
67
|
+
* handler: async ({ file }) => true,
|
|
68
|
+
* });
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @alpha
|
|
72
|
+
*/
|
|
73
|
+
export function makePolicyDefinition(args) {
|
|
74
|
+
return {
|
|
75
|
+
name: args.name,
|
|
76
|
+
description: args.description,
|
|
77
|
+
match: args.match,
|
|
78
|
+
handler: args.handler,
|
|
79
|
+
defaultConfig: args.defaultConfig,
|
|
80
|
+
resolver: args.resolver,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Combine a {@link PolicyDefinition} with a policy-specific config and other settings.
|
|
85
|
+
*
|
|
86
|
+
* @deprecated Use the `policy` function instead, which has a simpler API.
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```typescript
|
|
90
|
+
* makePolicy(NoJsFileExtensions, undefined, { excludeFiles: ["bin/*"] })
|
|
91
|
+
* ```
|
|
18
92
|
*
|
|
19
93
|
* @alpha
|
|
20
94
|
*/
|
package/esm/makePolicy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makePolicy.js","sourceRoot":"","sources":["../src/makePolicy.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"makePolicy.js","sourceRoot":"","sources":["../src/makePolicy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAkB,MAAM,WAAW,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AA6BtD;;;GAGG;AACH,SAAS,gBAAgB,CACxB,OAAyB;IAEzB,IAAI,mBAAmB,CAAC,OAAO,CAAC,EAAE,CAAC;QAClC,oCAAoC;QACpC,OAAO,OAAkE,CAAC;IAC3E,CAAC;IAED,oCAAoC;IACpC,OAAO,QAAQ,CAAC,EAAE,IAAmB;QACpC,MAAM,YAAY,GAAG,OAEY,CAAC;QAClC,OAAO,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,CAAC,CAAC;AACH,CAAC;AAoCD,aAAa;AACb,MAAM,UAAU,MAAM,CACrB,SAAyB,EACzB,eAAmC,EACnC,YAA4B;IAE5B,wDAAwD;IACxD,IAAI,MAAqB,CAAC;IAC1B,IAAI,OAAkC,CAAC;IAEvC,IAAI,YAAY,KAAK,SAAS,EAAE,CAAC;QAChC,oDAAoD;QACpD,MAAM,GAAG,eAAoB,CAAC;QAC9B,OAAO,GAAG,YAAY,CAAC;IACxB,CAAC;SAAM,IAAI,eAAe,KAAK,SAAS,EAAE,CAAC;QAC1C,iEAAiE;QACjE,6DAA6D;QAC7D,IACC,OAAO,eAAe,KAAK,QAAQ;YACnC,eAAe,KAAK,IAAI;YACxB,SAAS,IAAI,eAAe;YAC5B,CAAC,CAAC,MAAM,IAAI,eAAe,CAAC;YAC5B,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,EACzD,CAAC;YACF,oCAAoC;YACpC,OAAO,GAAG,eAAgC,CAAC;QAC5C,CAAC;aAAM,CAAC;YACP,cAAc;YACd,MAAM,GAAG,eAAoB,CAAC;QAC/B,CAAC;IACF,CAAC;IAED,yCAAyC;IACzC,MAAM,eAAe,GAAG,MAAM,IAAK,SAAS,CAAC,aAA+B,CAAC;IAE7E,uEAAuE;IACvE,MAAM,eAAe,GAAG,OAAO,EAAE,OAAO,CAAC;IAEzC,OAAO;QACN,GAAG,SAAS;QACZ,MAAM,EAAE,eAAe;QACvB,OAAO,EAAE,eAAe;QACxB,YAAY,EAAE,eAAe;QAC7B,gBAAgB,EAAE,gBAAgB,CAAC,SAAS,CAAC,OAAO,CAAC;KACrD,CAAC;AACH,CAAC;AAeD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,oBAAoB,CACnC,IAA8B;IAE9B,OAAO;QACN,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,OAAO,EAAE,IAAI,CAAC,OAAO;QACrB,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,QAAQ,EAAE,IAAI,CAAC,QAAQ;KACvB,CAAC;AACH,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,UAAU,CACzB,UAA+B,EAC/B,MAAU,EACV,QAAoC;IAEpC,OAAO;QACN,GAAG,UAAU;QACb,GAAG,QAAQ;QACX,MAAM;KACsB,CAAC;AAC/B,CAAC","sourcesContent":["import { call, type Operation } from \"effection\";\nimport { isGeneratorFunction } from \"./generators.js\";\nimport type {\n\tConfiguredPolicy,\n\tPolicyArgs,\n\tPolicyDefinition,\n\tPolicyHandler,\n\tPolicyHandlerResult,\n\tPolicyInstance,\n\tPolicyInstanceSettings,\n\tPolicyShape,\n} from \"./policy.js\";\n\n// ============================================================================\n// New API: policy() function\n// ============================================================================\n\n/**\n * Options for configuring a policy instance.\n *\n * @alpha\n */\nexport interface PolicyOptions {\n\t/**\n\t * File paths matching these patterns will be excluded from this policy.\n\t * Patterns are matched against repo-relative paths.\n\t */\n\texclude?: (string | RegExp)[];\n}\n\n/**\n * Normalizes a handler to always return an Effection Operation.\n * Detection happens once at registration time, not per-invocation.\n */\nfunction normalizeHandler<C>(\n\thandler: PolicyHandler<C>,\n): (args: PolicyArgs<C>) => Operation<PolicyHandlerResult> {\n\tif (isGeneratorFunction(handler)) {\n\t\t// Already a generator, return as-is\n\t\treturn handler as (args: PolicyArgs<C>) => Operation<PolicyHandlerResult>;\n\t}\n\n\t// Async function - wrap with call()\n\treturn function* (args: PolicyArgs<C>): Operation<PolicyHandlerResult> {\n\t\tconst asyncHandler = handler as (\n\t\t\tpolicyArgs: PolicyArgs<C>,\n\t\t) => Promise<PolicyHandlerResult>;\n\t\treturn yield* call(() => asyncHandler(args));\n\t};\n}\n\n/**\n * Configure a policy for use in repopo.\n *\n * @remarks\n * This function takes a policy definition and returns a configured policy instance\n * that can be added to the `policies` array in `repopo.config.ts`.\n *\n * Handlers are automatically normalized: async functions are wrapped for Effection\n * compatibility, while generator functions are used directly.\n *\n * @example\n * ```typescript\n * // Policy with no config, just options\n * policy(NoJsFileExtensions, { exclude: [\"bin/*\"] })\n *\n * // Policy with config\n * policy(PackageJsonProperties, { verbatim: { license: \"MIT\" } })\n *\n * // Policy with config and options\n * policy(PackageJsonProperties, { verbatim: { license: \"MIT\" } }, { exclude: [\"vendor/*\"] })\n * ```\n *\n * @alpha\n */\nexport function policy<C = void>(\n\tpolicyDef: PolicyShape<C>,\n\toptions?: PolicyOptions,\n): ConfiguredPolicy<C>;\n/** @alpha */\nexport function policy<C>(\n\tpolicyDef: PolicyShape<C>,\n\tconfig: C,\n\toptions?: PolicyOptions,\n): ConfiguredPolicy<C>;\n/** @alpha */\nexport function policy<C>(\n\tpolicyDef: PolicyShape<C>,\n\tconfigOrOptions?: C | PolicyOptions,\n\tmaybeOptions?: PolicyOptions,\n): ConfiguredPolicy<C> {\n\t// Determine if the second argument is config or options\n\tlet config: C | undefined;\n\tlet options: PolicyOptions | undefined;\n\n\tif (maybeOptions !== undefined) {\n\t\t// Three-argument form: policy(def, config, options)\n\t\tconfig = configOrOptions as C;\n\t\toptions = maybeOptions;\n\t} else if (configOrOptions !== undefined) {\n\t\t// Two-argument form: need to determine if it's config or options\n\t\t// PolicyOptions has a specific shape with 'exclude' property\n\t\tif (\n\t\t\ttypeof configOrOptions === \"object\" &&\n\t\t\tconfigOrOptions !== null &&\n\t\t\t\"exclude\" in configOrOptions &&\n\t\t\t!(\"name\" in configOrOptions) &&\n\t\t\tObject.keys(configOrOptions).every((k) => k === \"exclude\")\n\t\t) {\n\t\t\t// It's options (has only 'exclude')\n\t\t\toptions = configOrOptions as PolicyOptions;\n\t\t} else {\n\t\t\t// It's config\n\t\t\tconfig = configOrOptions as C;\n\t\t}\n\t}\n\n\t// Merge with default config if available\n\tconst effectiveConfig = config ?? (policyDef.defaultConfig as C | undefined);\n\n\t// Support both 'exclude' and 'excludeFiles' for backward compatibility\n\tconst excludePatterns = options?.exclude;\n\n\treturn {\n\t\t...policyDef,\n\t\tconfig: effectiveConfig,\n\t\texclude: excludePatterns,\n\t\texcludeFiles: excludePatterns,\n\t\t_internalHandler: normalizeHandler(policyDef.handler),\n\t};\n}\n\n// ============================================================================\n// Legacy API (Still supported for backward compatibility)\n// ============================================================================\n\n/**\n * Input arguments for creating a policy definition.\n *\n * @deprecated Use {@link PolicyShape} directly instead.\n *\n * @alpha\n */\nexport type PolicyDefinitionInput<C = undefined> = PolicyDefinition<C>;\n\n/**\n * Creates a {@link PolicyDefinition} from the provided arguments.\n *\n * @deprecated Define policies as object literals satisfying {@link PolicyShape} instead.\n *\n * @example\n * ```typescript\n * const MyPolicy = makePolicyDefinition({\n * name: \"MyPolicy\",\n * description: \"Ensures files follow conventions\",\n * match: /\\.ts$/,\n * handler: async ({ file }) => true,\n * });\n * ```\n *\n * @alpha\n */\nexport function makePolicyDefinition<C = undefined>(\n\targs: PolicyDefinitionInput<C>,\n): PolicyDefinition<C> {\n\treturn {\n\t\tname: args.name,\n\t\tdescription: args.description,\n\t\tmatch: args.match,\n\t\thandler: args.handler,\n\t\tdefaultConfig: args.defaultConfig,\n\t\tresolver: args.resolver,\n\t};\n}\n\n/**\n * Combine a {@link PolicyDefinition} with a policy-specific config and other settings.\n *\n * @deprecated Use the `policy` function instead, which has a simpler API.\n *\n * @example\n * ```typescript\n * makePolicy(NoJsFileExtensions, undefined, { excludeFiles: [\"bin/*\"] })\n * ```\n *\n * @alpha\n */\nexport function makePolicy<C>(\n\tdefinition: PolicyDefinition<C>,\n\tconfig?: C,\n\tsettings?: PolicyInstanceSettings<C>,\n): PolicyInstance<C> {\n\treturn {\n\t\t...definition,\n\t\t...settings,\n\t\tconfig,\n\t} satisfies PolicyInstance<C>;\n}\n"]}
|
package/esm/perf.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { Logger } from "@tylerbu/cli-api";
|
|
2
|
+
import type { Operation } from "effection";
|
|
2
3
|
import type { PolicyName } from "./policy.js";
|
|
3
|
-
export type PolicyAction = "check" | "resolve";
|
|
4
|
+
export type PolicyAction = "check" | "resolve" | "handle";
|
|
4
5
|
/**
|
|
5
6
|
* Stores performance data for each handler. Used to collect and display performance stats.
|
|
6
7
|
*/
|
|
@@ -10,6 +11,6 @@ export interface PolicyHandlerPerfStats {
|
|
|
10
11
|
data: Map<PolicyAction, Map<PolicyName, number>>;
|
|
11
12
|
}
|
|
12
13
|
export declare function newPerfStats(): PolicyHandlerPerfStats;
|
|
13
|
-
export declare function runWithPerf<T>(name: string, action: PolicyAction, stats: PolicyHandlerPerfStats, run: () =>
|
|
14
|
+
export declare function runWithPerf<T>(name: string, action: PolicyAction, stats: PolicyHandlerPerfStats, run: () => Operation<T>): Operation<T>;
|
|
14
15
|
export declare function logStats(stats: PolicyHandlerPerfStats, log: Logger): void;
|
|
15
16
|
//# sourceMappingURL=perf.d.ts.map
|
package/esm/perf.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../src/perf.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"perf.d.ts","sourceRoot":"","sources":["../src/perf.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAC3C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE1D;;GAEG;AACH,MAAM,WAAW,sBAAsB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,GAAG,CAAC,YAAY,EAAE,GAAG,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;CACjD;AAED,wBAAgB,YAAY,IAAI,sBAAsB,CAMrD;AAED,wBAAiB,WAAW,CAAC,CAAC,EAC7B,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,YAAY,EACpB,KAAK,EAAE,sBAAsB,EAC7B,GAAG,EAAE,MAAM,SAAS,CAAC,CAAC,CAAC,GACrB,SAAS,CAAC,CAAC,CAAC,CAWd;AAED,wBAAgB,QAAQ,CAAC,KAAK,EAAE,sBAAsB,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAWzE"}
|
package/esm/perf.js
CHANGED
|
@@ -5,11 +5,11 @@ export function newPerfStats() {
|
|
|
5
5
|
data: new Map(),
|
|
6
6
|
};
|
|
7
7
|
}
|
|
8
|
-
export
|
|
8
|
+
export function* runWithPerf(name, action, stats, run) {
|
|
9
9
|
const actionMap = stats.data.get(action) ?? new Map();
|
|
10
10
|
let dur = actionMap.get(name) ?? 0;
|
|
11
11
|
const start = Date.now();
|
|
12
|
-
const result =
|
|
12
|
+
const result = yield* run();
|
|
13
13
|
dur += Date.now() - start;
|
|
14
14
|
actionMap.set(name, dur);
|
|
15
15
|
stats.data.set(action, actionMap);
|
package/esm/perf.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"perf.js","sourceRoot":"","sources":["../src/perf.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"perf.js","sourceRoot":"","sources":["../src/perf.ts"],"names":[],"mappings":"AAeA,MAAM,UAAU,YAAY;IAC3B,OAAO;QACN,KAAK,EAAE,CAAC;QACR,SAAS,EAAE,CAAC;QACZ,IAAI,EAAE,IAAI,GAAG,EAAyC;KACtD,CAAC;AACH,CAAC;AAED,MAAM,SAAS,CAAC,CAAC,WAAW,CAC3B,IAAY,EACZ,MAAoB,EACpB,KAA6B,EAC7B,GAAuB;IAEvB,MAAM,SAAS,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,GAAG,EAAkB,CAAC;IACtE,IAAI,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEnC,MAAM,KAAK,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IACzB,MAAM,MAAM,GAAG,KAAK,CAAC,CAAC,GAAG,EAAE,CAAC;IAC5B,GAAG,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,KAAK,CAAC;IAE1B,SAAS,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACzB,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAClC,OAAO,MAAM,CAAC;AACf,CAAC;AAED,MAAM,UAAU,QAAQ,CAAC,KAA6B,EAAE,GAAW;IAClE,GAAG,CAAC,GAAG,CACN,eAAe,KAAK,CAAC,SAAS,oBAAoB;QACjD,GAAG,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,SAAS,cAAc,KAAK,CAAC,KAAK,QAAQ,CAClE,CAAC;IACF,KAAK,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;QAC1D,GAAG,CAAC,GAAG,CAAC,oBAAoB,MAAM,IAAI,CAAC,CAAC;QACxC,KAAK,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,CAAC;YACpD,GAAG,CAAC,GAAG,CAAC,OAAO,OAAO,KAAK,GAAG,IAAI,CAAC,CAAC;QACrC,CAAC;IACF,CAAC;AACF,CAAC","sourcesContent":["import type { Logger } from \"@tylerbu/cli-api\";\nimport type { Operation } from \"effection\";\nimport type { PolicyName } from \"./policy.js\";\n\nexport type PolicyAction = \"check\" | \"resolve\" | \"handle\";\n\n/**\n * Stores performance data for each handler. Used to collect and display performance stats.\n */\nexport interface PolicyHandlerPerfStats {\n\tcount: number;\n\tprocessed: number;\n\tdata: Map<PolicyAction, Map<PolicyName, number>>;\n}\n\nexport function newPerfStats(): PolicyHandlerPerfStats {\n\treturn {\n\t\tcount: 0,\n\t\tprocessed: 0,\n\t\tdata: new Map<PolicyAction, Map<PolicyName, number>>(),\n\t};\n}\n\nexport function* runWithPerf<T>(\n\tname: string,\n\taction: PolicyAction,\n\tstats: PolicyHandlerPerfStats,\n\trun: () => Operation<T>,\n): Operation<T> {\n\tconst actionMap = stats.data.get(action) ?? new Map<string, number>();\n\tlet dur = actionMap.get(name) ?? 0;\n\n\tconst start = Date.now();\n\tconst result = yield* run();\n\tdur += Date.now() - start;\n\n\tactionMap.set(name, dur);\n\tstats.data.set(action, actionMap);\n\treturn result;\n}\n\nexport function logStats(stats: PolicyHandlerPerfStats, log: Logger): void {\n\tlog.log(\n\t\t`Statistics: ${stats.processed} files processed, ` +\n\t\t\t`${stats.count - stats.processed} excluded, ${stats.count} total`,\n\t);\n\tfor (const [action, handlerPerf] of stats.data.entries()) {\n\t\tlog.log(`Performance for \"${action}\":`);\n\t\tfor (const [handler, dur] of handlerPerf.entries()) {\n\t\t\tlog.log(` ${handler}: ${dur}ms`);\n\t\t}\n\t}\n}\n"]}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A required script entry for conditional requirements. Can be either:
|
|
3
|
+
* - A string (script name only, no default value)
|
|
4
|
+
* - An object with a single key-value pair (script name → default value for auto-fix)
|
|
5
|
+
*
|
|
6
|
+
* @example
|
|
7
|
+
* ```typescript
|
|
8
|
+
* // Script must exist, no auto-fix available
|
|
9
|
+
* "test"
|
|
10
|
+
*
|
|
11
|
+
* // Script must exist, auto-fix will add this value if missing
|
|
12
|
+
* { clean: "rimraf dist" }
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* @alpha
|
|
16
|
+
*/
|
|
17
|
+
export type ConditionalScriptEntry = string | Record<string, string>;
|
|
18
|
+
/**
|
|
19
|
+
* Configuration for a conditional script requirement.
|
|
20
|
+
*
|
|
21
|
+
* @alpha
|
|
22
|
+
*/
|
|
23
|
+
export interface ConditionalScriptRule {
|
|
24
|
+
/**
|
|
25
|
+
* The script that triggers the requirement.
|
|
26
|
+
* If this script exists, then `requires` must also exist.
|
|
27
|
+
*/
|
|
28
|
+
ifPresent: string;
|
|
29
|
+
/**
|
|
30
|
+
* Scripts that must be present if `ifPresent` script exists.
|
|
31
|
+
*
|
|
32
|
+
* @remarks
|
|
33
|
+
* Each entry can be:
|
|
34
|
+
* - A string: Script must exist, no auto-fix available
|
|
35
|
+
* - An object `{ scriptName: "default value" }`: Script must exist, auto-fix adds the
|
|
36
|
+
* default value if missing
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```typescript
|
|
40
|
+
* requires: ["test", { clean: "rimraf dist" }]
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
requires: ConditionalScriptEntry[];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Configuration for the ConditionalScripts policy.
|
|
47
|
+
*
|
|
48
|
+
* @alpha
|
|
49
|
+
*/
|
|
50
|
+
export interface ConditionalScriptsConfig {
|
|
51
|
+
/**
|
|
52
|
+
* Conditional script requirements. If a script is present, other scripts must also exist.
|
|
53
|
+
*
|
|
54
|
+
* @remarks
|
|
55
|
+
* This is useful for enforcing that packages with a "build" script also have a "clean" script,
|
|
56
|
+
* or packages with "test" also have "test:coverage".
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* rules: [
|
|
61
|
+
* { ifPresent: "build", requires: [{ clean: "rimraf dist" }] },
|
|
62
|
+
* { ifPresent: "test", requires: ["test:coverage"] },
|
|
63
|
+
* ]
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
rules: ConditionalScriptRule[];
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* A policy that validates conditional script requirements in package.json.
|
|
70
|
+
*
|
|
71
|
+
* @remarks
|
|
72
|
+
* Use this policy when you want to enforce that the presence of one script
|
|
73
|
+
* requires other scripts to also exist. For example, if "build" exists,
|
|
74
|
+
* then "clean" must also exist.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```typescript
|
|
78
|
+
* import { policy } from "repopo";
|
|
79
|
+
* import { ConditionalScripts } from "repopo/policies";
|
|
80
|
+
*
|
|
81
|
+
* policy(ConditionalScripts, {
|
|
82
|
+
* rules: [
|
|
83
|
+
* // If "build" exists, "clean" must also exist (with auto-fix default)
|
|
84
|
+
* { ifPresent: "build", requires: [{ clean: "rimraf dist" }] },
|
|
85
|
+
* // If "test" exists, "test:coverage" must also exist (no auto-fix)
|
|
86
|
+
* { ifPresent: "test", requires: ["test:coverage"] },
|
|
87
|
+
* ],
|
|
88
|
+
* })
|
|
89
|
+
* ```
|
|
90
|
+
*
|
|
91
|
+
* @alpha
|
|
92
|
+
*/
|
|
93
|
+
export declare const ConditionalScripts: import("../policy.js").PolicyShape<ConditionalScriptsConfig | undefined>;
|
|
94
|
+
//# sourceMappingURL=ConditionalScripts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConditionalScripts.d.ts","sourceRoot":"","sources":["../../src/policies/ConditionalScripts.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAErE;;;;GAIG;AACH,MAAM,WAAW,qBAAqB;IACrC;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;;;;;;;;;;;;OAaG;IACH,QAAQ,EAAE,sBAAsB,EAAE,CAAC;CACnC;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACxC;;;;;;;;;;;;;;OAcG;IACH,KAAK,EAAE,qBAAqB,EAAE,CAAC;CAC/B;AAiHD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,eAAO,MAAM,kBAAkB,0EAuE7B,CAAC"}
|