repopo 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/LICENSE +21 -0
  3. package/README.md +103 -0
  4. package/THIRD-PARTY-LICENSES.txt +198 -0
  5. package/bin/dev.cmd +3 -0
  6. package/bin/dev.js +5 -0
  7. package/bin/run.cmd +3 -0
  8. package/bin/run.js +5 -0
  9. package/esm/commands/check.d.ts +46 -0
  10. package/esm/commands/check.d.ts.map +1 -0
  11. package/esm/commands/check.js +330 -0
  12. package/esm/commands/check.js.map +1 -0
  13. package/esm/config.d.ts +35 -0
  14. package/esm/config.d.ts.map +1 -0
  15. package/esm/config.js +6 -0
  16. package/esm/config.js.map +1 -0
  17. package/esm/index.d.ts +6 -0
  18. package/esm/index.d.ts.map +1 -0
  19. package/esm/index.js +3 -0
  20. package/esm/index.js.map +1 -0
  21. package/esm/policies/NoJsFileExtensions.d.ts +10 -0
  22. package/esm/policies/NoJsFileExtensions.d.ts.map +1 -0
  23. package/esm/policies/NoJsFileExtensions.js +23 -0
  24. package/esm/policies/NoJsFileExtensions.js.map +1 -0
  25. package/esm/policies/PackageJsonProperties.d.ts +21 -0
  26. package/esm/policies/PackageJsonProperties.d.ts.map +1 -0
  27. package/esm/policies/PackageJsonProperties.js +45 -0
  28. package/esm/policies/PackageJsonProperties.js.map +1 -0
  29. package/esm/policies/PackageJsonRepoDirectoryProperty.d.ts +7 -0
  30. package/esm/policies/PackageJsonRepoDirectoryProperty.d.ts.map +1 -0
  31. package/esm/policies/PackageJsonRepoDirectoryProperty.js +48 -0
  32. package/esm/policies/PackageJsonRepoDirectoryProperty.js.map +1 -0
  33. package/esm/policies/PackageJsonSortedPolicy.d.ts +6 -0
  34. package/esm/policies/PackageJsonSortedPolicy.d.ts.map +1 -0
  35. package/esm/policies/PackageJsonSortedPolicy.js +48 -0
  36. package/esm/policies/PackageJsonSortedPolicy.js.map +1 -0
  37. package/esm/policies/SortTsconfigs.d.ts +10 -0
  38. package/esm/policies/SortTsconfigs.d.ts.map +1 -0
  39. package/esm/policies/SortTsconfigs.js +33 -0
  40. package/esm/policies/SortTsconfigs.js.map +1 -0
  41. package/esm/policy.d.ts +104 -0
  42. package/esm/policy.d.ts.map +1 -0
  43. package/esm/policy.js +53 -0
  44. package/esm/policy.js.map +1 -0
  45. package/esm/tsdoc-metadata.json +11 -0
  46. package/oclif.manifest.json +104 -0
  47. package/package.json +100 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,89 @@
1
+ # repopo
2
+
3
+ ## 0.2.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Publish repopo package _[`#125`](https://github.com/tylerbutler/tools-monorepo/pull/125) [`12b3a58`](https://github.com/tylerbutler/tools-monorepo/commit/12b3a58e8946b0988009331bf1830e1fa1cc6567) [@tylerbutler](https://github.com/tylerbutler)_
8
+
9
+ ## 0.2.1
10
+
11
+ ### Patch Changes
12
+
13
+ <details><summary>Updated 1 dependency</summary>
14
+
15
+ <small>
16
+
17
+ [`61fade5`](https://github.com/tylerbutler/tools-monorepo/commit/61fade577c27a6ad55c79d997eb42ecc0ca9abe9)
18
+
19
+ </small>
20
+
21
+ - `sort-tsconfig@0.1.1`
22
+
23
+ </details>
24
+
25
+ ## 0.2.0
26
+
27
+ ### Minor Changes
28
+
29
+ - PackageJsonSortedPolicy keeps package.json files sorted _[`#114`](https://github.com/tylerbutler/tools-monorepo/pull/114) [`0664ac5`](https://github.com/tylerbutler/tools-monorepo/commit/0664ac5731c5dd23bc1c21070fe880335f46489b) [@tylerbutler](https://github.com/tylerbutler)_
30
+
31
+ The new `PackageJsonSortedPolicy` policy enforces that package.json files are always sorted according to sort-package-json.
32
+
33
+ ### Patch Changes
34
+
35
+ <details><summary>Updated 2 dependencies</summary>
36
+
37
+ <small>
38
+
39
+ [`cbdec3f`](https://github.com/tylerbutler/tools-monorepo/commit/cbdec3f7b3daa4ec642b44a5de046fff8420f15a) [`d55c982`](https://github.com/tylerbutler/tools-monorepo/commit/d55c982f960b56a79f0e0d35dd9102a25882032f) [`ddcbd48`](https://github.com/tylerbutler/tools-monorepo/commit/ddcbd48a161d8be666ff537316fa018d8c0b7ad8)
40
+
41
+ </small>
42
+
43
+ - `@tylerbu/cli-api@0.4.0`
44
+ - `sort-tsconfig@0.1.0`
45
+
46
+ </details>
47
+
48
+ ## 0.1.1
49
+
50
+ ### Patch Changes
51
+
52
+ - Fix homepage URL _[`#99`](https://github.com/tylerbutler/tools-monorepo/pull/99) [`0654323`](https://github.com/tylerbutler/tools-monorepo/commit/06543231947fa5267863e5467d5837a51cf3d44b) [@tylerbutler](https://github.com/tylerbutler)_
53
+
54
+ <details><summary>Updated 1 dependency</summary>
55
+
56
+ <small>
57
+
58
+ [`0654323`](https://github.com/tylerbutler/tools-monorepo/commit/06543231947fa5267863e5467d5837a51cf3d44b)
59
+
60
+ </small>
61
+
62
+ - `@tylerbu/cli-api@0.3.1`
63
+
64
+ </details>
65
+
66
+ ## 0.1.0
67
+
68
+ ### Minor Changes
69
+
70
+ - Introducing repopo, a tool to make sure the files in a git repository adhere to configurable policies _[`#16`](https://github.com/tylerbutler/tools-monorepo/pull/16) [`030fd98`](https://github.com/tylerbutler/tools-monorepo/commit/030fd980ee45471074a8f41aab46d1a5b025b2f6) [@tylerbutler](https://github.com/tylerbutler)_
71
+
72
+ You can use repopo to make sure all source files have a common header, check that all packages have a particular field
73
+ in package.json, etc. You can extend repopo with your own policies or policies from the ecosystem.
74
+
75
+ For more information, see the [repopo readme](https://github.com/tylerbutler/tools-monorepo/blob/main/packages/repopo/README.md).
76
+
77
+ ### Patch Changes
78
+
79
+ <details><summary>Updated 1 dependency</summary>
80
+
81
+ <small>
82
+
83
+ [`f54b0e7`](https://github.com/tylerbutler/tools-monorepo/commit/f54b0e71dd1d54c5e3730b7a1f1ab1a53b9b7943)
84
+
85
+ </small>
86
+
87
+ - `@tylerbu/cli-api@0.3.0`
88
+
89
+ </details>
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Tyler Butler <tyler@tylerbutler.com>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,103 @@
1
+ # repopo - police the files in your git repo with extensible policies
2
+
3
+ repopo is a tool to apply policies to the files in your git repo. You can think of it as a sort of lint tool for any
4
+ file in your git repo, with a straightforward way to write your own policies.
5
+
6
+ <!-- toc -->
7
+ * [repopo - police the files in your git repo with extensible policies](#repopo---police-the-files-in-your-git-repo-with-extensible-policies)
8
+ * [Configuring policies](#configuring-policies)
9
+ * [Included policies](#included-policies)
10
+ * [Usage](#usage)
11
+ <!-- tocstop -->
12
+
13
+ # Configuring policies
14
+
15
+ Repopo and its policies can be configured in a repopo.config.ts (or .cjs, or .mjs) file in the root of the repo. Using a
16
+ TypeScript configuration file is recommended.
17
+
18
+ The policy config must export a default object of the type `PolicyConfig`.
19
+
20
+ ## Excluding files from policy check
21
+
22
+ By default, all files in the repo are checked. You can exclude files completely from the policy check by configuring the
23
+ d `excludeFiles` setting. It should be an array of strings/regular expressions. Paths that match any of these
24
+ expressions will be completely excluded from all policies.
25
+
26
+ You can exclude files from individual policies as well. To do this, set the `excludePoliciesForFiles` setting. It should
27
+ be an object with keys that match policy names. The value is an array of strings/regular expressions. Paths that match
28
+ any of these expressions will be excluded from that policy only.
29
+
30
+ ## Configuring individual policies
31
+
32
+ Individual policies can be configured using the `policySettings` setting. Use the policy name as the key, with the
33
+ policy settings as the value.
34
+
35
+ # Included policies
36
+
37
+ repopo includes the following policies. All of the included policies are enabled by default.
38
+
39
+ ## NoJsFileExtensions
40
+
41
+ The NoJsFileExtensions policy checks for JavaScript source files that just use the .js file extension. Such files may be
42
+ interpreted by Node.js as either CommonJS or ESM based on the `type` field in the nearest package.json file. This can
43
+ create unexpected behavior for JS files; changing the package.json nearest to one will change how the JS is processed by
44
+ node. Using explicit file extensions reduces ambiguity and ensures a CJS file isn't suddenly treated like an ESM file.
45
+
46
+ ## PackageJsonProperties
47
+
48
+ The PackageJsonProperties policy is used to enforce fields in package.json files across the repo.
49
+
50
+ ### Configuration
51
+
52
+ The `verbatim` setting requires that all the configured fields in package.json match the values in the configuration.
53
+
54
+ ```ts
55
+ import type { PolicyConfig } from "@tylerbu/repopo";
56
+ const config: PolicyConfig = {
57
+ policySettings: {
58
+ PackageJsonProperties: {
59
+ // This setting will force all package.json files to contain these fields with the exact configured values.
60
+ verbatim: {
61
+ license: "MIT",
62
+ author: "Tyler Butler <tyler@tylerbutler.com>",
63
+ bugs: "https://github.com/tylerbutler/tools-monorepo/issues",
64
+ }
65
+ }
66
+ }
67
+ };
68
+ ```
69
+
70
+ ## PackageJsonRepoDirectoryProperty
71
+
72
+ A RepoPolicy that checks that the `repository.directory` property in package.json is set correctly. If the repository
73
+ field is a string instead of an object the package will be ignored.
74
+
75
+ # Usage
76
+
77
+ <!-- commands -->
78
+ * [`repopo check`](#repopo-check)
79
+
80
+ ## `repopo check`
81
+
82
+ Checks and applies policies to the files in the repository.
83
+
84
+ ```
85
+ USAGE
86
+ $ repopo check [-v | --quiet] [-f] [-D <value>... | -d <value>] [-p <value>] [--stdin]
87
+
88
+ FLAGS
89
+ -D, --excludePolicy=<value>... Exclude policies by name. Can be specified multiple times to exclude multiple
90
+ policies.
91
+ -d, --policy=<value> Filter policies to apply by <regex>. Only policies with a name matching the regex will
92
+ be applied.
93
+ -f, --fix Fix errors if possible.
94
+ -p, --path=<value> Filter file paths by <regex>.
95
+ --stdin Read list of files from stdin.
96
+
97
+ LOGGING FLAGS
98
+ -v, --verbose Enable verbose logging.
99
+ --quiet Disable all logging.
100
+ ```
101
+
102
+ _See code: [src/commands/check.ts](https://github.com/tylerbutler/tools-monorepo/blob/main/packages/repopo/src/commands/check.ts)_
103
+ <!-- commandsstop -->
@@ -0,0 +1,198 @@
1
+ This file was generated with the generate-license-file npm package!
2
+ https://www.npmjs.com/package/generate-license-file
3
+
4
+ The following npm package may be included in this product:
5
+
6
+ - fs-extra@11.2.0
7
+
8
+ This package contains the following license and notice below:
9
+
10
+ (The MIT License)
11
+
12
+ Copyright (c) 2011-2017 JP Richardson
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files
15
+ (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify,
16
+ merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
20
+
21
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
22
+ WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
23
+ OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
24
+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
+
26
+ -----------
27
+
28
+ The following npm package may be included in this product:
29
+
30
+ - @fluidframework/build-tools@0.41.0
31
+
32
+ This package contains the following license and notice below:
33
+
34
+ Copyright (c) Microsoft Corporation and contributors. All rights reserved.
35
+
36
+ MIT License
37
+
38
+ Permission is hereby granted, free of charge, to any person obtaining a copy
39
+ of this software and associated documentation files (the "Software"), to deal
40
+ in the Software without restriction, including without limitation the rights
41
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
42
+ copies of the Software, and to permit persons to whom the Software is
43
+ furnished to do so, subject to the following conditions:
44
+
45
+ The above copyright notice and this permission notice shall be included in all
46
+ copies or substantial portions of the Software.
47
+
48
+ THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
49
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
50
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
51
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
52
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
53
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
54
+ SOFTWARE.
55
+
56
+ -----------
57
+
58
+ The following npm packages may be included in this product:
59
+
60
+ - @oclif/core@4.0.12
61
+ - @oclif/plugin-help@6.2.6
62
+
63
+ These packages each contain the following license and notice below:
64
+
65
+ MIT License
66
+
67
+ Copyright (c) 2018 Salesforce.com
68
+
69
+ Permission is hereby granted, free of charge, to any person obtaining a copy
70
+ of this software and associated documentation files (the "Software"), to deal
71
+ in the Software without restriction, including without limitation the rights
72
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
73
+ copies of the Software, and to permit persons to whom the Software is
74
+ furnished to do so, subject to the following conditions:
75
+
76
+ The above copyright notice and this permission notice shall be included in all
77
+ copies or substantial portions of the Software.
78
+
79
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
80
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
81
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
82
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
83
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
84
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
85
+ SOFTWARE.
86
+
87
+ -----------
88
+
89
+ The following npm package may be included in this product:
90
+
91
+ - sort-tsconfig@0.0.1
92
+
93
+ This package contains the following license and notice below:
94
+
95
+ MIT License
96
+
97
+ Copyright (c) 2023 Tyler Butler <tyler@tylerbutler.com>
98
+
99
+ Permission is hereby granted, free of charge, to any person obtaining a copy
100
+ of this software and associated documentation files (the "Software"), to deal
101
+ in the Software without restriction, including without limitation the rights
102
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
103
+ copies of the Software, and to permit persons to whom the Software is
104
+ furnished to do so, subject to the following conditions:
105
+
106
+ The above copyright notice and this permission notice shall be included in all
107
+ copies or substantial portions of the Software.
108
+
109
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
110
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
111
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
112
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
113
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
114
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
115
+ SOFTWARE.
116
+
117
+ -----------
118
+
119
+ The following npm package may be included in this product:
120
+
121
+ - chalk@5.3.0
122
+
123
+ This package contains the following license and notice below:
124
+
125
+ MIT License
126
+
127
+ Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
128
+
129
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
130
+
131
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
132
+
133
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
134
+
135
+ -----------
136
+
137
+ The following npm package may be included in this product:
138
+
139
+ - @tylerbu/cli-api@0.2.0
140
+
141
+ This package contains the following license and notice below:
142
+
143
+ MIT License
144
+
145
+ Copyright (c) Tyler Butler <tyler@tylerbutler.com>
146
+
147
+ Permission is hereby granted, free of charge, to any person obtaining a copy
148
+ of this software and associated documentation files (the "Software"), to deal
149
+ in the Software without restriction, including without limitation the rights
150
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
151
+ copies of the Software, and to permit persons to whom the Software is
152
+ furnished to do so, subject to the following conditions:
153
+
154
+ The above copyright notice and this permission notice shall be included in all
155
+ copies or substantial portions of the Software.
156
+
157
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
158
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
159
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
160
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
161
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
162
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
163
+ SOFTWARE.
164
+
165
+ -----------
166
+
167
+ The following npm package may be included in this product:
168
+
169
+ - cosmiconfig@9.0.0
170
+
171
+ This package contains the following license and notice below:
172
+
173
+ The MIT License (MIT)
174
+
175
+ Copyright (c) 2015 David Clark
176
+
177
+ Permission is hereby granted, free of charge, to any person obtaining a copy
178
+ of this software and associated documentation files (the "Software"), to deal
179
+ in the Software without restriction, including without limitation the rights
180
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
181
+ copies of the Software, and to permit persons to whom the Software is
182
+ furnished to do so, subject to the following conditions:
183
+
184
+ The above copyright notice and this permission notice shall be included in all
185
+ copies or substantial portions of the Software.
186
+
187
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
188
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
189
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
190
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
191
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
192
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
193
+ SOFTWARE.
194
+
195
+ -----------
196
+
197
+ This file was generated with the generate-license-file npm package!
198
+ https://www.npmjs.com/package/generate-license-file
package/bin/dev.cmd ADDED
@@ -0,0 +1,3 @@
1
+ @echo off
2
+
3
+ node --loader ts-node/esm --no-warnings=ExperimentalWarning "%~dp0\dev" %*
package/bin/dev.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env -S node --loader ts-node/esm --no-warnings=ExperimentalWarning
2
+
3
+ import { execute } from "@oclif/core";
4
+
5
+ await execute({ development: true, dir: import.meta.url });
package/bin/run.cmd ADDED
@@ -0,0 +1,3 @@
1
+ @echo off
2
+
3
+ node "%~dp0\run" %*
package/bin/run.js ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { execute } from "@oclif/core";
4
+
5
+ await execute({ dir: import.meta.url });
@@ -0,0 +1,46 @@
1
+ import { GitCommand } from "@tylerbu/cli-api";
2
+ import { type PolicyConfig } from "../config.js";
3
+ /**
4
+ * This tool enforces policies across the code base via a series of handler functions. The handler functions are
5
+ * associated with a regular expression, and all files matching that expression are passed to the handler function.
6
+ *
7
+ * By default, the list of files to check comes from `git ls-files. You can also pipe in file names from stdin. For
8
+ * example:
9
+ *
10
+ * `git ls-files -co --exclude-standard --full-name | repopo check --stdin --verbose`
11
+ */
12
+ export declare class CheckPolicy extends GitCommand<typeof CheckPolicy & {
13
+ args: typeof GitCommand.args;
14
+ flags: typeof GitCommand.flags;
15
+ }, PolicyConfig> {
16
+ static readonly summary = "Checks and applies policies to the files in the repository.";
17
+ static readonly flags: {
18
+ readonly config: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
19
+ readonly fix: import("@oclif/core/interfaces").BooleanFlag<boolean>;
20
+ readonly policy: import("@oclif/core/interfaces").OptionFlag<RegExp | undefined, import("@oclif/core/interfaces").CustomOptions>;
21
+ readonly excludePolicy: import("@oclif/core/interfaces").OptionFlag<string[] | undefined, import("@oclif/core/interfaces").CustomOptions>;
22
+ readonly path: import("@oclif/core/interfaces").OptionFlag<RegExp | undefined, import("@oclif/core/interfaces").CustomOptions>;
23
+ readonly stdin: import("@oclif/core/interfaces").BooleanFlag<boolean>;
24
+ };
25
+ private processed;
26
+ private count;
27
+ private commandContext;
28
+ get defaultConfig(): import("type-fest").SetOptional<Required<PolicyConfig>, "policies" | "policySettings">;
29
+ protected loadConfig(): Promise<PolicyConfig>;
30
+ init(): Promise<void>;
31
+ run(): Promise<void>;
32
+ private executePolicy;
33
+ /**
34
+ * Routes files to their handlers and resolvers by regex testing their full paths. If a file fails a policy that has a
35
+ * resolver, the resolver will be invoked as well. Synchronizes the output, exit codes, and resolve
36
+ * decision for all handlers.
37
+ */
38
+ private routeToHandlers;
39
+ private logStats;
40
+ /**
41
+ * Given a string that represents a path to a file in the repo, determines if the file should be checked, and if so,
42
+ * routes the file to the appropriate handlers.
43
+ */
44
+ private checkOrExcludeFile;
45
+ }
46
+ //# sourceMappingURL=check.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"check.d.ts","sourceRoot":"","sources":["../../src/commands/check.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAA2B,MAAM,kBAAkB,CAAC;AAGvE,OAAO,EAAuB,KAAK,YAAY,EAAE,MAAM,cAAc,CAAC;AAoDtE;;;;;;;;GAQG;AACH,qBAAa,WAAY,SAAQ,UAAU,CAC1C,OAAO,WAAW,GAAG;IACpB,IAAI,EAAE,OAAO,UAAU,CAAC,IAAI,CAAC;IAC7B,KAAK,EAAE,OAAO,UAAU,CAAC,KAAK,CAAC;CAC/B,EACD,YAAY,CACZ;IACA,gBAAyB,OAAO,iEAC+B;IAE/D,gBAAyB,KAAK;gCA7De,wBAAwB,wCAGrD,wBAAwB;;;;;;MAwF7B;IAEX,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,KAAK,CAAK;IAElB,OAAO,CAAC,cAAc,CAAwC;IAE9D,IAAoB,aAAa,2FAEhC;cAEwB,UAAU,IAAI,OAAO,CAAC,YAAY,CAAC;IAuBtC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IA6DrB,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;YAmE5B,aAAa;IAc3B;;;;OAIG;YACW,eAAe;IAwG7B,OAAO,CAAC,QAAQ;IAchB;;;OAGG;YACW,kBAAkB;CA0BhC"}