@ykdz/template 0.0.26 → 0.0.27
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/node_modules/@ykdz/template-builtin-presets/templates/foundation/pnpm-workspace.dynamic.txt +3 -0
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/pnpm-workspace.yaml +3 -0
- package/node_modules/@ykdz/template-core/dist/dependency-catalog.js +11 -3
- package/package.json +1 -1
|
@@ -2,6 +2,7 @@ import { existsSync, readFileSync } from "node:fs";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
const exactNpmPackageIdentityPattern = /^(?:@[a-z0-9][a-z0-9._~-]*\/)?[a-z0-9][a-z0-9._~-]*$/;
|
|
5
|
+
const defaultGeneratedMinimumReleaseAgeExclusions = ["@ykdz/template"];
|
|
5
6
|
function assertMinimumReleaseAgeExclusions(exclusions) {
|
|
6
7
|
if (exclusions.some((dependency) => dependency.length === 0)) {
|
|
7
8
|
throw new Error("Dependency maturity exclusions must be non-empty");
|
|
@@ -199,7 +200,14 @@ export function pnpmWorkspaceYamlWithCatalogDependencies(workspaceYaml, dependen
|
|
|
199
200
|
].join("\n");
|
|
200
201
|
}
|
|
201
202
|
export function renderGeneratedPnpmWorkspaceYaml(options) {
|
|
202
|
-
|
|
203
|
+
const configuredMinimumReleaseAgeExclusions = options.minimumReleaseAgeExclude ?? [];
|
|
204
|
+
assertMinimumReleaseAgeExclusions(configuredMinimumReleaseAgeExclusions);
|
|
205
|
+
const minimumReleaseAgeExclude = [
|
|
206
|
+
...new Set([
|
|
207
|
+
...defaultGeneratedMinimumReleaseAgeExclusions,
|
|
208
|
+
...configuredMinimumReleaseAgeExclusions,
|
|
209
|
+
]),
|
|
210
|
+
];
|
|
203
211
|
if (options.dependencyLinker?.kind === "hoisted" &&
|
|
204
212
|
(options.dependencyLinker.evidence.trim().length === 0 ||
|
|
205
213
|
options.dependencyLinker.evidence.includes("\n"))) {
|
|
@@ -228,8 +236,8 @@ export function renderGeneratedPnpmWorkspaceYaml(options) {
|
|
|
228
236
|
"minimumReleaseAgeStrict: true",
|
|
229
237
|
"",
|
|
230
238
|
];
|
|
231
|
-
if (
|
|
232
|
-
lines.push("minimumReleaseAgeExclude:", ...
|
|
239
|
+
if (minimumReleaseAgeExclude.length) {
|
|
240
|
+
lines.push("minimumReleaseAgeExclude:", ...minimumReleaseAgeExclude
|
|
233
241
|
.toSorted()
|
|
234
242
|
.map((dependency) => ` - ${JSON.stringify(dependency)}`), "");
|
|
235
243
|
}
|