repopo 0.7.1 → 0.9.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.
Files changed (122) hide show
  1. package/CHANGELOG.md +217 -6
  2. package/THIRD-PARTY-LICENSES.txt +152 -5
  3. package/esm/adapters/fluidFramework.d.ts +103 -0
  4. package/esm/adapters/fluidFramework.d.ts.map +1 -0
  5. package/esm/adapters/fluidFramework.js +124 -0
  6. package/esm/adapters/fluidFramework.js.map +1 -0
  7. package/esm/baseCommand.d.ts +1 -0
  8. package/esm/baseCommand.d.ts.map +1 -1
  9. package/esm/baseCommand.js +2 -0
  10. package/esm/baseCommand.js.map +1 -1
  11. package/esm/commands/check.d.ts.map +1 -1
  12. package/esm/commands/check.js +76 -50
  13. package/esm/commands/check.js.map +1 -1
  14. package/esm/commands/list.d.ts.map +1 -1
  15. package/esm/commands/list.js +3 -1
  16. package/esm/commands/list.js.map +1 -1
  17. package/esm/generators.d.ts +30 -2
  18. package/esm/generators.d.ts.map +1 -1
  19. package/esm/generators.js +31 -1
  20. package/esm/generators.js.map +1 -1
  21. package/esm/index.d.ts +14 -3
  22. package/esm/index.d.ts.map +1 -1
  23. package/esm/index.js +13 -2
  24. package/esm/index.js.map +1 -1
  25. package/esm/makePolicy.d.ts +31 -2
  26. package/esm/makePolicy.d.ts.map +1 -1
  27. package/esm/makePolicy.js +27 -13
  28. package/esm/makePolicy.js.map +1 -1
  29. package/esm/perf.d.ts +6 -2
  30. package/esm/perf.d.ts.map +1 -1
  31. package/esm/perf.js +5 -4
  32. package/esm/perf.js.map +1 -1
  33. package/esm/policies/HtmlFileHeaders.d.ts.map +1 -1
  34. package/esm/policies/HtmlFileHeaders.js +11 -7
  35. package/esm/policies/HtmlFileHeaders.js.map +1 -1
  36. package/esm/policies/JsTsFileHeaders.d.ts.map +1 -1
  37. package/esm/policies/JsTsFileHeaders.js +11 -7
  38. package/esm/policies/JsTsFileHeaders.js.map +1 -1
  39. package/esm/policies/LicenseFileExists.d.ts.map +1 -1
  40. package/esm/policies/LicenseFileExists.js +22 -16
  41. package/esm/policies/LicenseFileExists.js.map +1 -1
  42. package/esm/policies/NoJsFileExtensions.d.ts.map +1 -1
  43. package/esm/policies/NoJsFileExtensions.js +16 -9
  44. package/esm/policies/NoJsFileExtensions.js.map +1 -1
  45. package/esm/policies/NoLargeBinaryFiles.d.ts.map +1 -1
  46. package/esm/policies/NoLargeBinaryFiles.js +35 -29
  47. package/esm/policies/NoLargeBinaryFiles.js.map +1 -1
  48. package/esm/policies/NoPrivateWorkspaceDependencies.d.ts +37 -0
  49. package/esm/policies/NoPrivateWorkspaceDependencies.d.ts.map +1 -0
  50. package/esm/policies/NoPrivateWorkspaceDependencies.js +145 -0
  51. package/esm/policies/NoPrivateWorkspaceDependencies.js.map +1 -0
  52. package/esm/policies/PackageAllowedScopes.d.ts +88 -0
  53. package/esm/policies/PackageAllowedScopes.d.ts.map +1 -0
  54. package/esm/policies/PackageAllowedScopes.js +118 -0
  55. package/esm/policies/PackageAllowedScopes.js.map +1 -0
  56. package/esm/policies/PackageEsmType.d.ts +100 -0
  57. package/esm/policies/PackageEsmType.d.ts.map +1 -0
  58. package/esm/policies/PackageEsmType.js +261 -0
  59. package/esm/policies/PackageEsmType.js.map +1 -0
  60. package/esm/policies/PackageFolderName.d.ts +97 -0
  61. package/esm/policies/PackageFolderName.d.ts.map +1 -0
  62. package/esm/policies/PackageFolderName.js +108 -0
  63. package/esm/policies/PackageFolderName.js.map +1 -0
  64. package/esm/policies/PackageJsonProperties.d.ts.map +1 -1
  65. package/esm/policies/PackageJsonProperties.js +36 -30
  66. package/esm/policies/PackageJsonProperties.js.map +1 -1
  67. package/esm/policies/PackageJsonRepoDirectoryProperty.d.ts.map +1 -1
  68. package/esm/policies/PackageJsonRepoDirectoryProperty.js +41 -37
  69. package/esm/policies/PackageJsonRepoDirectoryProperty.js.map +1 -1
  70. package/esm/policies/PackageJsonSorted.d.ts.map +1 -1
  71. package/esm/policies/PackageJsonSorted.js +40 -28
  72. package/esm/policies/PackageJsonSorted.js.map +1 -1
  73. package/esm/policies/PackageLicense.d.ts +61 -0
  74. package/esm/policies/PackageLicense.d.ts.map +1 -0
  75. package/esm/policies/PackageLicense.js +135 -0
  76. package/esm/policies/PackageLicense.js.map +1 -0
  77. package/esm/policies/PackagePrivateField.d.ts +124 -0
  78. package/esm/policies/PackagePrivateField.d.ts.map +1 -0
  79. package/esm/policies/PackagePrivateField.js +159 -0
  80. package/esm/policies/PackagePrivateField.js.map +1 -0
  81. package/esm/policies/PackageReadme.d.ts +77 -0
  82. package/esm/policies/PackageReadme.d.ts.map +1 -0
  83. package/esm/policies/PackageReadme.js +213 -0
  84. package/esm/policies/PackageReadme.js.map +1 -0
  85. package/esm/policies/PackageScripts.d.ts +180 -2
  86. package/esm/policies/PackageScripts.d.ts.map +1 -1
  87. package/esm/policies/PackageScripts.js +358 -34
  88. package/esm/policies/PackageScripts.js.map +1 -1
  89. package/esm/policies/PackageTestScripts.d.ts +100 -0
  90. package/esm/policies/PackageTestScripts.d.ts.map +1 -0
  91. package/esm/policies/PackageTestScripts.js +155 -0
  92. package/esm/policies/PackageTestScripts.js.map +1 -0
  93. package/esm/policies/RequiredGitignorePatterns.d.ts.map +1 -1
  94. package/esm/policies/RequiredGitignorePatterns.js +30 -19
  95. package/esm/policies/RequiredGitignorePatterns.js.map +1 -1
  96. package/esm/policies.d.ts +9 -1
  97. package/esm/policies.d.ts.map +1 -1
  98. package/esm/policies.js +10 -1
  99. package/esm/policies.js.map +1 -1
  100. package/esm/policy.d.ts +37 -8
  101. package/esm/policy.d.ts.map +1 -1
  102. package/esm/policy.js +18 -9
  103. package/esm/policy.js.map +1 -1
  104. package/esm/policyDefiners/defineFileHeaderPolicy.d.ts +43 -1
  105. package/esm/policyDefiners/defineFileHeaderPolicy.d.ts.map +1 -1
  106. package/esm/policyDefiners/defineFileHeaderPolicy.js +18 -5
  107. package/esm/policyDefiners/defineFileHeaderPolicy.js.map +1 -1
  108. package/esm/policyDefiners/definePackagePolicy.d.ts +43 -2
  109. package/esm/policyDefiners/definePackagePolicy.d.ts.map +1 -1
  110. package/esm/policyDefiners/definePackagePolicy.js +41 -5
  111. package/esm/policyDefiners/definePackagePolicy.js.map +1 -1
  112. package/esm/tsdoc-metadata.json +1 -1
  113. package/esm/utils/indentation.d.ts +73 -0
  114. package/esm/utils/indentation.d.ts.map +1 -0
  115. package/esm/utils/indentation.js +97 -0
  116. package/esm/utils/indentation.js.map +1 -0
  117. package/esm/utils/packageName.d.ts +71 -0
  118. package/esm/utils/packageName.d.ts.map +1 -0
  119. package/esm/utils/packageName.js +79 -0
  120. package/esm/utils/packageName.js.map +1 -0
  121. package/oclif.manifest.json +1 -1
  122. package/package.json +33 -16
package/CHANGELOG.md CHANGED
@@ -1,5 +1,222 @@
1
1
  # repopo
2
2
 
3
+ ## 0.9.0
4
+
5
+ ### Minor Changes
6
+
7
+ - Make `description` required on PolicyDefinition _[`#594`](https://github.com/tylerbutler/tools-monorepo/pull/594) [`c3d1b65`](https://github.com/tylerbutler/tools-monorepo/commit/c3d1b65299f58b9fa605ebd18e7fb4346ae7745f) [@tylerbutler](https://github.com/tylerbutler)_
8
+
9
+ BREAKING CHANGE: `PolicyDefinition.description` is now required (was optional). All policies must include a description that explains their purpose.
10
+
11
+ All built-in policies now include descriptions.
12
+
13
+ - Use object parameters for policy factory functions and Policy class _[`#594`](https://github.com/tylerbutler/tools-monorepo/pull/594) [`c3d1b65`](https://github.com/tylerbutler/tools-monorepo/commit/c3d1b65299f58b9fa605ebd18e7fb4346ae7745f) [@tylerbutler](https://github.com/tylerbutler)_
14
+
15
+ BREAKING CHANGES:
16
+ - `makePolicyDefinition()` now takes an object argument: `{ name, description, match, handler, defaultConfig?, resolver? }`
17
+ - `definePackagePolicy()` now takes an object argument: `{ name, description, handler }`
18
+ - `defineFileHeaderPolicy()` now takes an object argument: `{ name, description, config }`
19
+ - `Policy` class constructor now takes a `PolicyDefinition` object instead of positional arguments
20
+
21
+ This change makes it easier to add new optional properties in the future without breaking changes.
22
+
23
+ New exports:
24
+ - `makePolicyDefinition` function (previously internal)
25
+ - `PolicyDefinitionInput` type
26
+ - `DefinePackagePolicyArgs` interface
27
+ - `DefineFileHeaderPolicyArgs` interface
28
+
29
+ ### Patch Changes
30
+
31
+ - Refactor to use Effection 4 for structured concurrency _[`#379`](https://github.com/tylerbutler/tools-monorepo/pull/379) [`1582ad1`](https://github.com/tylerbutler/tools-monorepo/commit/1582ad1abc79b211492dba2e5172e995c9c47fe0) [@tylerbutler](https://github.com/tylerbutler)_
32
+ - Replace manual async handling with Effection's structured concurrency primitives
33
+ - Policy handlers now support generator functions for better cancellation and resource management
34
+ - Improved internal architecture for concurrent policy execution
35
+ - Added comprehensive test coverage for async/generator patterns
36
+
37
+ <details><summary>Updated 1 dependency</summary>
38
+
39
+ <small>
40
+
41
+ [`c577266`](https://github.com/tylerbutler/tools-monorepo/commit/c577266129da545000aea343256b06129a243987)
42
+
43
+ </small>
44
+
45
+ - `@tylerbu/cli-api@0.10.1`
46
+
47
+ </details>
48
+
49
+ ## 0.8.0
50
+
51
+ ### Minor Changes
52
+
53
+ - **BREAKING CHANGE**: Change `PolicyFailure.errorMessage` to `errorMessages` array. _[`#552`](https://github.com/tylerbutler/tools-monorepo/pull/552) [`6b6317a`](https://github.com/tylerbutler/tools-monorepo/commit/6b6317a7be0a050dc0665a9af7b187afb1bb4b31) [@tylerbutler](https://github.com/tylerbutler)_
54
+
55
+ The `PolicyFailure` interface now uses `errorMessages: string[]` instead of `errorMessage?: string`. This allows policies to report multiple error messages per failure and provides clearer semantics.
56
+
57
+ Additionally, a new optional `manualFix?: string` property has been added to provide user guidance on how to resolve policy failures manually.
58
+
59
+ Migration:
60
+ - Change `errorMessage: "message"` to `errorMessages: ["message"]`
61
+ - For multiple messages, use `errorMessages: ["msg1", "msg2"]`
62
+ - When checking failures, use `errorMessages.join("\n")` instead of `errorMessage`
63
+
64
+ - Add NoPrivateWorkspaceDependencies policy that prevents publishable packages from depending on private workspace packages via the `workspace:` protocol. This catches configuration issues where a public npm package would fail to install because its workspace dependencies aren't published. _[`#534`](https://github.com/tylerbutler/tools-monorepo/pull/534) [`b7e4d4b`](https://github.com/tylerbutler/tools-monorepo/commit/b7e4d4b374cae228d246b16c668ba6e55c08f3dc) [@tylerbutler](https://github.com/tylerbutler)_
65
+
66
+ The policy:
67
+ - Detects workspace dependencies using the `workspace:` protocol
68
+ - Checks if those dependencies are marked as private
69
+ - Reports violations for publishable packages that depend on private packages
70
+ - Supports configurable `checkDevDependencies` option (default: false)
71
+ - Uses workspace configuration (pnpm-workspace.yaml or package.json workspaces) for package discovery
72
+
73
+ - Make sort-tsconfig and sort-package-json peer dependencies _[`#395`](https://github.com/tylerbutler/tools-monorepo/pull/395) [`ee059d0`](https://github.com/tylerbutler/tools-monorepo/commit/ee059d02161494c14eb6131aaf32624902fd65e4) [@tylerbutler](https://github.com/tylerbutler)_
74
+
75
+ Moves `sort-tsconfig` and `sort-package-json` from dependencies to peerDependencies, allowing consumers to control versions and reducing bundle size.
76
+
77
+ - Add multiple new policies and enhance existing PackageScripts policy _[`#535`](https://github.com/tylerbutler/tools-monorepo/pull/535) [`79e19e8`](https://github.com/tylerbutler/tools-monorepo/commit/79e19e892a5b1193650cab21a4d38187c700fb01) [@tylerbutler](https://github.com/tylerbutler)_
78
+
79
+ ## New Policies
80
+
81
+ ### PackageAllowedScopes
82
+
83
+ Validates that packages use only approved npm scopes or package names, preventing accidental
84
+ introduction of new scopes and maintaining naming consistency.
85
+
86
+ ### PackageLicense
87
+
88
+ Ensures each package has a LICENSE file that matches the root repository LICENSE. Supports
89
+ auto-fixing by copying the root LICENSE to packages. By default, skips private packages.
90
+
91
+ ### PackageReadme
92
+
93
+ Validates that packages have README.md files with proper content:
94
+ - Ensures README exists
95
+ - Validates title matches package name
96
+ - Can require specific content (e.g., trademark notices)
97
+ - Supports auto-fixing by creating or updating README files
98
+
99
+ ## Enhanced PackageScripts Policy
100
+
101
+ Added powerful new validation options with a cleaner, more intuitive configuration API.
102
+
103
+ ### must (enhanced)
104
+
105
+ The `must` array now accepts either strings (script must exist, no auto-fix) or objects with
106
+ inline default values (script must exist, auto-fixable with the default):
107
+
108
+ ```typescript
109
+ must: [
110
+ "test", // Must exist, no auto-fix available
111
+ { build: "tsc" }, // Must exist, auto-fix adds "tsc" if missing
112
+ { lint: "biome lint ." }, // Must exist, auto-fix adds "biome lint ." if missing
113
+ ];
114
+ ```
115
+
116
+ Existing scripts with different content will pass validation - only the existence is enforced.
117
+
118
+ ### exact (new)
119
+
120
+ Scripts that must exist AND have exact content. Both missing and mismatched scripts are
121
+ auto-fixable:
122
+
123
+ ```typescript
124
+ exact: {
125
+ clean: "rimraf dist esm",
126
+ format: "biome format --write .",
127
+ }
128
+ ```
129
+
130
+ ### conditionalRequired (enhanced)
131
+
132
+ Enforce that certain scripts must exist when other scripts are present. The `requires` field
133
+ now accepts the same format as `must` - strings or objects with inline defaults for auto-fix:
134
+
135
+ ```typescript
136
+ // With inline default - auto-fixable
137
+ conditionalRequired: [
138
+ { ifPresent: "build", requires: [{ clean: "rimraf dist" }] },
139
+ ];
140
+
141
+ // Mixed: "test" required without default, "clean" with default
142
+ conditionalRequired: [
143
+ { ifPresent: "build", requires: ["test", { clean: "rimraf dist" }] },
144
+ ];
145
+ ```
146
+
147
+ ### scriptMustContain
148
+
149
+ Validate that script bodies contain required substrings:
150
+
151
+ ```typescript
152
+ scriptMustContain: [{ script: "clean", mustContain: ["rimraf"] }];
153
+ ```
154
+
155
+ ## Usage Examples
156
+
157
+ ```typescript
158
+ import { makePolicy, type RepopoConfig } from "repopo";
159
+ import {
160
+ PackageAllowedScopes,
161
+ PackageLicense,
162
+ PackageReadme,
163
+ PackageScripts,
164
+ } from "repopo/policies";
165
+
166
+ const config: RepopoConfig = {
167
+ policies: [
168
+ makePolicy(PackageAllowedScopes, {
169
+ allowedScopes: ["@myorg", "@internal"],
170
+ }),
171
+ makePolicy(PackageLicense),
172
+ makePolicy(PackageReadme, {
173
+ requiredContent: "## Trademark",
174
+ }),
175
+ makePolicy(PackageScripts, {
176
+ // Scripts that must exist
177
+ must: [
178
+ "test", // Must exist, no auto-fix
179
+ { build: "tsc" }, // Must exist, auto-fix available
180
+ { lint: "biome lint ." }, // Must exist, auto-fix available
181
+ ],
182
+ // Scripts that must exist AND match exactly
183
+ exact: {
184
+ clean: "rimraf dist esm",
185
+ format: "biome format --write .",
186
+ },
187
+ // If "build" exists, "clean" must also exist (with inline auto-fix default)
188
+ conditionalRequired: [
189
+ { ifPresent: "build", requires: [{ clean: "rimraf dist" }] },
190
+ ],
191
+ // Validate script content contains required substrings
192
+ scriptMustContain: [{ script: "build", mustContain: ["tsc"] }],
193
+ // Only one of these can exist
194
+ mutuallyExclusive: [["lint:eslint", "lint:biome"]],
195
+ }),
196
+ ],
197
+ };
198
+ ```
199
+
200
+ ### Patch Changes
201
+
202
+ - Update to use new cli-api logger API _[`#395`](https://github.com/tylerbutler/tools-monorepo/pull/395) [`ee059d0`](https://github.com/tylerbutler/tools-monorepo/commit/ee059d02161494c14eb6131aaf32624902fd65e4) [@tylerbutler](https://github.com/tylerbutler)_
203
+
204
+ Updates commands to use the new logger API from @tylerbu/cli-api:
205
+ - Replace `errorLog()` calls with `logError()`
206
+ - Use standalone `logIndent()` function where needed
207
+
208
+ <details><summary>Updated 1 dependency</summary>
209
+
210
+ <small>
211
+
212
+ [`ee059d0`](https://github.com/tylerbutler/tools-monorepo/commit/ee059d02161494c14eb6131aaf32624902fd65e4)
213
+
214
+ </small>
215
+
216
+ - `@tylerbu/cli-api@0.10.0`
217
+
218
+ </details>
219
+
3
220
  ## 0.7.1
4
221
 
5
222
  ### Patch Changes
@@ -23,7 +240,6 @@
23
240
  - Add configurable PackageScripts policy _[`#376`](https://github.com/tylerbutler/tools-monorepo/pull/376) [`c17462a`](https://github.com/tylerbutler/tools-monorepo/commit/c17462a8af35a8bfbb528f29825a0ef177923946) [@tylerbutler](https://github.com/tylerbutler)_
24
241
 
25
242
  Enhances the `PackageScripts` policy with flexible configuration options to enforce package.json script requirements across your repository. The policy now supports two validation modes:
26
-
27
243
  1. **Required Scripts (`must`)**: Specify scripts that must be present in all package.json files
28
244
  2. **Mutually Exclusive Scripts (`mutuallyExclusive`)**: Define groups of scripts where exactly one from each group must exist
29
245
 
@@ -39,7 +255,6 @@
39
255
  ```
40
256
 
41
257
  The policy validates that:
42
-
43
258
  - All scripts in the `must` array are present
44
259
  - For each group in `mutuallyExclusive`, exactly one script from that group exists (not zero, not multiple)
45
260
 
@@ -48,7 +263,6 @@
48
263
  - New built-in policies _[`#308`](https://github.com/tylerbutler/tools-monorepo/pull/308) [`1856d58`](https://github.com/tylerbutler/tools-monorepo/commit/1856d582fb92692447b02c89cdb45dcd3c5f7370) [@tylerbutler](https://github.com/tylerbutler)_
49
264
 
50
265
  Added three new policies for repository quality and safety:
51
-
52
266
  - **LicenseFileExists**: Ensures a LICENSE file exists in the repository root (essential for open source projects)
53
267
  - **NoLargeBinaryFiles**: Prevents large binary files from being committed (default 10MB max, suggests Git LFS for large assets)
54
268
  - **RequiredGitignorePatterns**: Validates .gitignore contains required patterns to prevent committing sensitive files, dependencies, and build artifacts (auto-fixable)
@@ -112,18 +326,15 @@
112
326
  repopo now exports all included policies individually so users can opt in and out of them in their config.
113
327
 
114
328
  - New policies _[`#31`](https://github.com/tylerbutler/tools-monorepo/pull/31) [`c97a565`](https://github.com/tylerbutler/tools-monorepo/commit/c97a56518d9726667531aa71de9445fed8d56b96) [@tylerbutler](https://github.com/tylerbutler)_
115
-
116
329
  - JsTsFileHeaders
117
330
  - HtmlFileHeaders
118
331
  - PackageScripts
119
332
 
120
333
  - API changes: _[`#120`](https://github.com/tylerbutler/tools-monorepo/pull/120) [`1108950`](https://github.com/tylerbutler/tools-monorepo/commit/1108950a7732dcc3ac9b8da10bd014bfec6c45b7) [@tylerbutler](https://github.com/tylerbutler)_
121
-
122
334
  - **Breaking change**: `PolicyConfig` was renamed to `RepopoConfig`.
123
335
  - **Breaking change**: Removed several flags from the check command.
124
336
 
125
337
  Other changes:
126
-
127
338
  - Refactor check command for clarity (more to do)
128
339
 
129
340
  - Functions to more easily create package.json handlers _[`#190`](https://github.com/tylerbutler/tools-monorepo/pull/190) [`84c4185`](https://github.com/tylerbutler/tools-monorepo/commit/84c4185e76186c3489a4b70e3a3015ba289df139) [@tylerbutler](https://github.com/tylerbutler)_
@@ -27,7 +27,7 @@ OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHE
27
27
 
28
28
  The following npm package may be included in this product:
29
29
 
30
- - @rushstack/node-core-library@5.18.0
30
+ - @rushstack/node-core-library@5.19.1
31
31
 
32
32
  This package contains the following license:
33
33
 
@@ -60,7 +60,37 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
60
60
 
61
61
  The following npm package may be included in this product:
62
62
 
63
- - @fluid-tools/build-infrastructure@0.60.0
63
+ - resolve-workspace-root@2.0.0
64
+
65
+ This package contains the following license:
66
+
67
+ # The MIT License (MIT)
68
+
69
+ Copyright (c) 2024-present Cedric van Putten <me@cedric.dev>
70
+
71
+ > Permission is hereby granted, free of charge, to any person obtaining a copy
72
+ > of this software and associated documentation files (the "Software"), to deal
73
+ > in the Software without restriction, including without limitation the rights
74
+ > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
75
+ > copies of the Software, and to permit persons to whom the Software is
76
+ > furnished to do so, subject to the following conditions:
77
+ >
78
+ > The above copyright notice and this permission notice shall be included in
79
+ > all copies or substantial portions of the Software.
80
+ >
81
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
82
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
83
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
84
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
85
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
86
+ > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
87
+ > THE SOFTWARE.
88
+
89
+ -----------
90
+
91
+ The following npm package may be included in this product:
92
+
93
+ - @fluid-tools/build-infrastructure@0.63.0
64
94
 
65
95
  This package contains the following license:
66
96
 
@@ -112,11 +142,12 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
112
142
 
113
143
  -----------
114
144
 
115
- The following npm package may be included in this product:
145
+ The following npm packages may be included in this product:
116
146
 
147
+ - effection@4.0.0
117
148
  - simple-git@3.30.0
118
149
 
119
- This package contains the following license:
150
+ These packages each contain the following license:
120
151
 
121
152
  MIT
122
153
 
@@ -125,7 +156,7 @@ MIT
125
156
  The following npm packages may be included in this product:
126
157
 
127
158
  - @oclif/core@4.8.0
128
- - @oclif/plugin-help@6.2.35
159
+ - @oclif/plugin-help@6.2.36
129
160
 
130
161
  These packages each contain the following license:
131
162
 
@@ -183,6 +214,36 @@ SOFTWARE.
183
214
 
184
215
  -----------
185
216
 
217
+ The following npm package may be included in this product:
218
+
219
+ - tinyglobby@0.2.15
220
+
221
+ This package contains the following license:
222
+
223
+ MIT License
224
+
225
+ Copyright (c) 2024 Madeline Gurriarán
226
+
227
+ Permission is hereby granted, free of charge, to any person obtaining a copy
228
+ of this software and associated documentation files (the "Software"), to deal
229
+ in the Software without restriction, including without limitation the rights
230
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
231
+ copies of the Software, and to permit persons to whom the Software is
232
+ furnished to do so, subject to the following conditions:
233
+
234
+ The above copyright notice and this permission notice shall be included in all
235
+ copies or substantial portions of the Software.
236
+
237
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
238
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
239
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
240
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
241
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
242
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
243
+ SOFTWARE.
244
+
245
+ -----------
246
+
186
247
  The following npm package may be included in this product:
187
248
 
188
249
  - defu@6.1.4
@@ -213,6 +274,62 @@ SOFTWARE.
213
274
 
214
275
  -----------
215
276
 
277
+ The following npm package may be included in this product:
278
+
279
+ - consola@3.4.2
280
+
281
+ This package contains the following license:
282
+
283
+ MIT License
284
+
285
+ Copyright (c) Pooya Parsa <pooya@pi0.io>
286
+
287
+ Permission is hereby granted, free of charge, to any person obtaining a copy
288
+ of this software and associated documentation files (the "Software"), to deal
289
+ in the Software without restriction, including without limitation the rights
290
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
291
+ copies of the Software, and to permit persons to whom the Software is
292
+ furnished to do so, subject to the following conditions:
293
+
294
+ The above copyright notice and this permission notice shall be included in all
295
+ copies or substantial portions of the Software.
296
+
297
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
298
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
299
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
300
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
301
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
302
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
303
+ SOFTWARE.
304
+
305
+ ---
306
+
307
+ Prompt support is based on https://github.com/bombshell-dev/clack
308
+
309
+ MIT License
310
+
311
+ Copyright (c) Nate Moore
312
+
313
+ 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:
314
+
315
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
316
+
317
+ 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.
318
+
319
+ ---
320
+
321
+ Color support is based on https://github.com/jorgebucaran/colorette
322
+
323
+ Copyright © Jorge Bucaran <https://jorgebucaran.com>
324
+
325
+ 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:
326
+
327
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
328
+
329
+ 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.
330
+
331
+ -----------
332
+
216
333
  The following npm package may be included in this product:
217
334
 
218
335
  - pathe@2.0.3
@@ -292,5 +409,35 @@ DEALINGS IN THE SOFTWARE.
292
409
 
293
410
  -----------
294
411
 
412
+ The following npm package may be included in this product:
413
+
414
+ - picomatch@4.0.3
415
+
416
+ This package contains the following license:
417
+
418
+ The MIT License (MIT)
419
+
420
+ Copyright (c) 2017-present, Jon Schlinkert.
421
+
422
+ Permission is hereby granted, free of charge, to any person obtaining a copy
423
+ of this software and associated documentation files (the "Software"), to deal
424
+ in the Software without restriction, including without limitation the rights
425
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
426
+ copies of the Software, and to permit persons to whom the Software is
427
+ furnished to do so, subject to the following conditions:
428
+
429
+ The above copyright notice and this permission notice shall be included in
430
+ all copies or substantial portions of the Software.
431
+
432
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
433
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
434
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
435
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
436
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
437
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
438
+ THE SOFTWARE.
439
+
440
+ -----------
441
+
295
442
  This file was generated with the generate-license-file npm package!
296
443
  https://www.npmjs.com/package/generate-license-file
@@ -0,0 +1,103 @@
1
+ import type { PolicyDefinition } from "../policy.js";
2
+ /**
3
+ * A FluidFramework build-tools policy handler interface.
4
+ *
5
+ * This interface matches the `Handler` interface from `@fluidframework/build-tools`.
6
+ *
7
+ * @alpha
8
+ */
9
+ export interface FluidHandler {
10
+ /**
11
+ * The name of the handler, used for filtering and display.
12
+ */
13
+ name: string;
14
+ /**
15
+ * A regex pattern that determines which files this handler applies to.
16
+ */
17
+ match: RegExp;
18
+ /**
19
+ * The handler function that checks a file against the policy.
20
+ *
21
+ * @param file - Absolute path to the file.
22
+ * @param root - Path to the repo root.
23
+ * @returns `undefined` if the check passes, otherwise an error message string.
24
+ */
25
+ handler: (file: string, root: string) => Promise<string | undefined>;
26
+ /**
27
+ * Optional resolver function that attempts to fix policy violations.
28
+ *
29
+ * @param file - Absolute path to the file.
30
+ * @param root - Path to the repo root.
31
+ * @returns An object indicating whether the fix was successful.
32
+ */
33
+ resolver?: (file: string, root: string) => Promise<{
34
+ resolved: boolean;
35
+ message?: string;
36
+ }> | {
37
+ resolved: boolean;
38
+ message?: string;
39
+ };
40
+ }
41
+ /**
42
+ * Options for converting FluidFramework handlers to repopo policies.
43
+ *
44
+ * @alpha
45
+ */
46
+ export interface FluidAdapterOptions {
47
+ /**
48
+ * Optional prefix to add to policy names. Useful for namespacing Fluid policies.
49
+ *
50
+ * @example "Fluid:" would result in "Fluid:my-handler-name"
51
+ */
52
+ namePrefix?: string;
53
+ }
54
+ /**
55
+ * Converts FluidFramework handlers to repopo PolicyDefinitions.
56
+ *
57
+ * This adapter bridges the gap between FluidFramework's build-tools policy system
58
+ * and repopo's policy system, allowing you to reuse existing Fluid policies in repopo.
59
+ *
60
+ * @remarks
61
+ *
62
+ * Key differences handled by this adapter:
63
+ *
64
+ * - **Handler signature**: Fluid uses `(file, root) => string | undefined`,
65
+ * repopo uses `(args) => PolicyHandlerResult`
66
+ *
67
+ * - **File paths**: Fluid passes absolute paths, repopo passes repo-relative paths.
68
+ * The adapter converts between the two.
69
+ *
70
+ * - **Return types**: Fluid returns `string | undefined` (error message or success),
71
+ * repopo returns `true | PolicyFailure | PolicyFixResult`
72
+ *
73
+ * For a single handler, wrap it in an array: `fromFluidHandlers([handler])`.
74
+ *
75
+ * @example
76
+ * ```typescript
77
+ * import { fromFluidHandlers, makePolicy } from "repopo";
78
+ * import { copyrightFileHeaderHandlers, fluidCaseHandler } from "@fluidframework/build-tools";
79
+ *
80
+ * // Convert multiple handlers with a namespace prefix
81
+ * const FluidCopyrightPolicies = fromFluidHandlers(copyrightFileHeaderHandlers, {
82
+ * namePrefix: "Fluid:",
83
+ * });
84
+ *
85
+ * // For a single handler, wrap it in an array
86
+ * const [FluidCasePolicy] = fromFluidHandlers([fluidCaseHandler]);
87
+ *
88
+ * const config: RepopoConfig = {
89
+ * policies: [
90
+ * ...FluidCopyrightPolicies.map(p => makePolicy(p)),
91
+ * makePolicy(FluidCasePolicy),
92
+ * ],
93
+ * };
94
+ * ```
95
+ *
96
+ * @param fluidHandlers - An array of FluidFramework Handler objects to convert.
97
+ * @param options - Optional configuration applied to all conversions.
98
+ * @returns An array of repopo PolicyDefinitions.
99
+ *
100
+ * @alpha
101
+ */
102
+ export declare function fromFluidHandlers(fluidHandlers: FluidHandler[], options?: FluidAdapterOptions): PolicyDefinition[];
103
+ //# sourceMappingURL=fluidFramework.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fluidFramework.d.ts","sourceRoot":"","sources":["../../src/adapters/fluidFramework.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACX,gBAAgB,EAIhB,MAAM,cAAc,CAAC;AAEtB;;;;;;GAMG;AACH,MAAM,WAAW,YAAY;IAC5B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IAEd;;;;;;OAMG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IAErE;;;;;;OAMG;IACH,QAAQ,CAAC,EAAE,CACV,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,KAEV,OAAO,CAAC;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,GAChD;QAAE,QAAQ,EAAE,OAAO,CAAC;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CAC3C;AAED;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IACnC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAwFD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AACH,wBAAgB,iBAAiB,CAChC,aAAa,EAAE,YAAY,EAAE,EAC7B,OAAO,CAAC,EAAE,mBAAmB,GAC3B,gBAAgB,EAAE,CAEpB"}