@nestia/migrate 12.0.0-rc.4 → 12.0.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/lib/bundles/NEST_TEMPLATE.js +7 -6
- package/lib/bundles/NEST_TEMPLATE.js.map +1 -1
- package/lib/bundles/NEST_TEMPLATE.mjs +7 -6
- package/lib/bundles/SDK_TEMPLATE.js +7 -8
- package/lib/bundles/SDK_TEMPLATE.js.map +1 -1
- package/lib/bundles/SDK_TEMPLATE.mjs +7 -8
- package/package.json +8 -8
- package/src/bundles/NEST_TEMPLATE.ts +7 -6
- package/src/bundles/SDK_TEMPLATE.ts +7 -8
- package/src/executable/bundle.js +24 -25
package/src/executable/bundle.js
CHANGED
|
@@ -57,29 +57,25 @@ const migratePackageJson = (parsed) => {
|
|
|
57
57
|
};
|
|
58
58
|
|
|
59
59
|
// Stamp the template's pnpm-workspace.yaml catalogs with this repository's
|
|
60
|
-
// current versions.
|
|
61
|
-
//
|
|
62
|
-
//
|
|
63
|
-
// them.
|
|
60
|
+
// current versions. Keep the rewrite line-targeted so quoted package names,
|
|
61
|
+
// comments, ordering, and any anchors supplied by the upstream template remain
|
|
62
|
+
// intact.
|
|
64
63
|
const updateWorkspaceCatalog = (content) => {
|
|
65
|
-
const replace = (line
|
|
66
|
-
if (typeof specifier !== "string") return line;
|
|
64
|
+
const replace = (line) => {
|
|
67
65
|
const match = line.match(
|
|
68
|
-
|
|
66
|
+
/^(\s+(?:"([^"]+)"|'([^']+)'|([^:\s]+)): (?:&[A-Za-z0-9_-]+ )?)\S[^\r\n]*(\r?)$/,
|
|
69
67
|
);
|
|
70
|
-
|
|
68
|
+
if (match === null) return line;
|
|
69
|
+
|
|
70
|
+
const name = match[2] ?? match[3] ?? match[4];
|
|
71
|
+
const specifier =
|
|
72
|
+
name === "nestia" || name.startsWith("@nestia/")
|
|
73
|
+
? `^${version}`
|
|
74
|
+
: (TYPIA[name]?.specifier ?? TYPESCRIPT[name]?.specifier);
|
|
75
|
+
if (typeof specifier !== "string") return line;
|
|
76
|
+
return `${match[1]}${specifier}${match[5]}`;
|
|
71
77
|
};
|
|
72
|
-
return content
|
|
73
|
-
.split("\n")
|
|
74
|
-
.map((line) => {
|
|
75
|
-
line = replace(line, "nestia", `^${version}`);
|
|
76
|
-
for (const name of ["tgrid", "tstl", "typia"])
|
|
77
|
-
line = replace(line, name, TYPIA[name]?.specifier);
|
|
78
|
-
for (const name of ["ttsc", "typescript"])
|
|
79
|
-
line = replace(line, name, TYPESCRIPT[name]?.specifier);
|
|
80
|
-
return line;
|
|
81
|
-
})
|
|
82
|
-
.join("\n");
|
|
78
|
+
return content.split("\n").map(replace).join("\n");
|
|
83
79
|
};
|
|
84
80
|
|
|
85
81
|
const trimTemplateDependencies = (parsed) => {
|
|
@@ -330,11 +326,9 @@ const main = async () => {
|
|
|
330
326
|
await bundle({
|
|
331
327
|
mode: "nest",
|
|
332
328
|
repository: "nestia-start",
|
|
333
|
-
//
|
|
334
|
-
//
|
|
335
|
-
|
|
336
|
-
// workspace dependencies, so the archive works with a plain `pnpm install`.
|
|
337
|
-
revision: "314d77f2e4ef41b18ba1ab7d14ba97f5f74897f3",
|
|
329
|
+
// Pin the reviewed pnpm monorepo template after its catalog, rolldown, and
|
|
330
|
+
// package self-reference migrations.
|
|
331
|
+
revision: "8188661cb1c1b0fb30e6184b06422764d64a5f68",
|
|
338
332
|
exceptions: [
|
|
339
333
|
".git",
|
|
340
334
|
".github/dependabot.yml",
|
|
@@ -366,12 +360,17 @@ const main = async () => {
|
|
|
366
360
|
await bundle({
|
|
367
361
|
mode: "sdk",
|
|
368
362
|
repository: "nestia-sdk-template",
|
|
369
|
-
|
|
363
|
+
// Pin the reviewed pnpm-native SDK template.
|
|
364
|
+
revision: "37a019e2b8dea3d02237137aaec2f242f53dcd2d",
|
|
370
365
|
exceptions: [
|
|
371
366
|
".git",
|
|
372
367
|
".github/dependabot.yml",
|
|
373
368
|
".github/workflows/build.yml",
|
|
374
369
|
".github/workflows/dependabot-automerge.yml",
|
|
370
|
+
// update() stamps the current Nestia version into package.json. The
|
|
371
|
+
// template repository's lockfile resolves its own version, so let the
|
|
372
|
+
// first pnpm install create a lockfile that matches the migrated output.
|
|
373
|
+
"pnpm-lock.yaml",
|
|
375
374
|
"src/functional",
|
|
376
375
|
"src/structures",
|
|
377
376
|
"test/features",
|