@ykdz/template 0.0.25 → 0.0.26
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/.github/workflows/check-playwright.yml +1 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-rust.yml +1 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check.dynamic.template +1 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check.yml +1 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/foundation/pnpm-workspace.yaml +1 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/.github/workflows/check.yml +1 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/Cargo.lock +2 -2
- package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/Cargo.toml +1 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/shared/devcontainer/node-pnpm.Dockerfile +5 -2
- package/node_modules/@ykdz/template-builtin-presets/templates/ts-lib/.github/workflows/check.yml +1 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/Dockerfile +2 -2
- package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.json +1 -1
- package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/.github/workflows/check.yml +1 -1
- package/node_modules/@ykdz/template-core/dist/Cargo.lock +2 -2
- package/node_modules/@ykdz/template-core/dist/Cargo.toml +1 -1
- package/node_modules/@ykdz/template-core/dist/pnpm-workspace.yaml +5 -5
- package/node_modules/@ykdz/template-core/dist/project-github.js +1 -1
- package/node_modules/@ykdz/template-core/dist/renderer.js +38 -21
- package/package.json +1 -1
|
@@ -11,7 +11,7 @@ jobs:
|
|
|
11
11
|
runs-on: ubuntu-latest{{DEPLOYMENT_MATRIX}}
|
|
12
12
|
steps:
|
|
13
13
|
- uses: actions/checkout@v7
|
|
14
|
-
- uses: actions/setup-node@
|
|
14
|
+
- uses: actions/setup-node@v7
|
|
15
15
|
with:
|
|
16
16
|
node-version-file: package.json
|
|
17
17
|
- run: corepack enable{{RUST_CI_PREPARATION}}{{DEPLOYMENT_DOCKER_PREPARATION}}
|
|
@@ -4,9 +4,9 @@ version = 4
|
|
|
4
4
|
|
|
5
5
|
[[package]]
|
|
6
6
|
name = "anyhow"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.104"
|
|
8
8
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
-
checksum = "
|
|
9
|
+
checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470"
|
|
10
10
|
|
|
11
11
|
[[package]]
|
|
12
12
|
name = "{{CARGO_PACKAGE_NAME}}"
|
|
@@ -5,8 +5,11 @@ SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
|
|
5
5
|
ARG PACKAGE_MANAGER_PIN
|
|
6
6
|
ENV COREPACK_HOME="/corepack"
|
|
7
7
|
ENV PNPM_HOME="/pnpm"
|
|
8
|
-
ENV PATH="$PNPM_HOME:$PATH"
|
|
9
|
-
RUN
|
|
8
|
+
ENV PATH="$PNPM_HOME/bin:$PNPM_HOME:$PATH"
|
|
9
|
+
RUN apt-get update \
|
|
10
|
+
&& apt-get install -y --no-install-recommends ca-certificates \
|
|
11
|
+
&& rm -rf /var/lib/apt/lists/* \
|
|
12
|
+
&& install -d -m 0755 "$COREPACK_HOME" "$PNPM_HOME" "$PNPM_HOME/bin" \
|
|
10
13
|
&& corepack enable --install-directory "$PNPM_HOME" \
|
|
11
14
|
&& corepack prepare "${PACKAGE_MANAGER_PIN}" --activate \
|
|
12
15
|
&& chmod -R a+rX "$COREPACK_HOME" "$PNPM_HOME"
|
|
@@ -6,9 +6,9 @@ FROM node:{{NODE_VERSION}}-bookworm-slim AS base
|
|
|
6
6
|
ARG PACKAGE_MANAGER_PIN="{{PACKAGE_MANAGER_PIN}}"
|
|
7
7
|
ENV COREPACK_HOME="/corepack"
|
|
8
8
|
ENV PNPM_HOME="/pnpm"
|
|
9
|
-
ENV PATH="$PNPM_HOME:$PATH"
|
|
9
|
+
ENV PATH="$PNPM_HOME/bin:$PNPM_HOME:$PATH"
|
|
10
10
|
WORKDIR /repo
|
|
11
|
-
RUN install -d -m 0755 "$COREPACK_HOME" "$PNPM_HOME" \
|
|
11
|
+
RUN install -d -m 0755 "$COREPACK_HOME" "$PNPM_HOME" "$PNPM_HOME/bin" \
|
|
12
12
|
&& corepack enable --install-directory "$PNPM_HOME" \
|
|
13
13
|
&& for attempt in 1 2 3; do \
|
|
14
14
|
if corepack prepare "$PACKAGE_MANAGER_PIN" --activate; then break; fi; \
|
|
@@ -4,9 +4,9 @@ version = 4
|
|
|
4
4
|
|
|
5
5
|
[[package]]
|
|
6
6
|
name = "anyhow"
|
|
7
|
-
version = "1.0.
|
|
7
|
+
version = "1.0.104"
|
|
8
8
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
9
|
-
checksum = "
|
|
9
|
+
checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470"
|
|
10
10
|
|
|
11
11
|
[[package]]
|
|
12
12
|
name = "template-cargo-dependencies"
|
|
@@ -26,24 +26,24 @@ catalog:
|
|
|
26
26
|
"@tailwindcss/vite": ^4.3.2
|
|
27
27
|
"@types/node": ^24.13.3
|
|
28
28
|
"@types/web-bluetooth": ^0.0.21
|
|
29
|
-
"@vitejs/plugin-vue": ^6.0.
|
|
29
|
+
"@vitejs/plugin-vue": ^6.0.8
|
|
30
30
|
"@vikejs/hono": ^0.2.1
|
|
31
31
|
"@vue/tsconfig": ^0.9.1
|
|
32
32
|
drizzle-kit: 1.0.0-rc.4
|
|
33
33
|
drizzle-orm: 1.0.0-rc.4
|
|
34
|
-
execa: ^
|
|
35
|
-
hono: ^4.12.
|
|
34
|
+
execa: ^10.0.0
|
|
35
|
+
hono: ^4.12.31
|
|
36
36
|
oxfmt: ^0.58.0
|
|
37
37
|
oxlint: ^1.73.0
|
|
38
38
|
oxlint-tsgolint: ^0.24.0
|
|
39
39
|
semver: ^7.8.5
|
|
40
40
|
"@types/semver": ^7.7.1
|
|
41
41
|
pinia: ^3.0.4
|
|
42
|
-
srvx: ^0.
|
|
42
|
+
srvx: ^0.12.1
|
|
43
43
|
tailwindcss: ^4.3.2
|
|
44
44
|
telefunc: ^0.2.22
|
|
45
45
|
tsc-alias: ^1.8.17
|
|
46
|
-
turbo: 2.10.
|
|
46
|
+
turbo: 2.10.5
|
|
47
47
|
typescript: npm:@typescript/typescript6@^6.0.2
|
|
48
48
|
typescript-7: npm:typescript@^7.0.2
|
|
49
49
|
valibot: ^1.4.2
|
|
@@ -39,7 +39,7 @@ export function projectCheckWorkflow(options) {
|
|
|
39
39
|
" - uses: actions/checkout@v7",
|
|
40
40
|
];
|
|
41
41
|
if (environmentPreparation.nodeFromPackageMetadata) {
|
|
42
|
-
lines.push(" - uses: actions/setup-node@
|
|
42
|
+
lines.push(" - uses: actions/setup-node@v7", " with:", " node-version-file: package.json", " - run: corepack enable");
|
|
43
43
|
}
|
|
44
44
|
if (hasDeploymentTask && needsDocker) {
|
|
45
45
|
lines.push(" - uses: docker/setup-buildx-action@v3", " if: matrix.check == 'deployment'");
|
|
@@ -461,19 +461,27 @@ export async function renderProjectAtomically(options) {
|
|
|
461
461
|
const parent = path.dirname(targetRoot);
|
|
462
462
|
const stagingRoot = await mkdtemp(path.join(parent, `.${path.basename(targetRoot)}.template-update-`));
|
|
463
463
|
const backupRoot = await mkdtemp(path.join(parent, `.${path.basename(targetRoot)}.template-backup-`));
|
|
464
|
-
const
|
|
464
|
+
const changedPaths = changedOutputPaths(options.operations);
|
|
465
465
|
let committed = false;
|
|
466
466
|
try {
|
|
467
|
-
await cp(targetRoot, stagingRoot, {
|
|
467
|
+
await cp(targetRoot, stagingRoot, {
|
|
468
|
+
recursive: true,
|
|
469
|
+
filter: generatedDependencyTreeCopyFilter,
|
|
470
|
+
});
|
|
468
471
|
await renderProject({ ...options, targetRoot: stagingRoot });
|
|
469
|
-
// Commit only the
|
|
472
|
+
// Commit only the files changed by the staged plan. In particular, do
|
|
470
473
|
// not rename the target directory: callers commonly run `template add`
|
|
471
474
|
// from that directory, and renaming it leaves their shell on a deleted
|
|
472
|
-
// inode. Each
|
|
473
|
-
for (const
|
|
474
|
-
const current = path.join(targetRoot,
|
|
475
|
+
// inode. Each path has a rollback copy before it is made visible.
|
|
476
|
+
for (const changedPath of changedPaths) {
|
|
477
|
+
const current = path.join(targetRoot, changedPath);
|
|
475
478
|
try {
|
|
476
|
-
|
|
479
|
+
const backup = path.join(backupRoot, changedPath);
|
|
480
|
+
await mkdir(path.dirname(backup), { recursive: true });
|
|
481
|
+
await cp(current, backup, {
|
|
482
|
+
recursive: true,
|
|
483
|
+
filter: generatedDependencyTreeCopyFilter,
|
|
484
|
+
});
|
|
477
485
|
}
|
|
478
486
|
catch (error) {
|
|
479
487
|
if (!isNodeError(error) || error.code !== "ENOENT")
|
|
@@ -481,16 +489,19 @@ export async function renderProjectAtomically(options) {
|
|
|
481
489
|
}
|
|
482
490
|
}
|
|
483
491
|
try {
|
|
484
|
-
for (const
|
|
485
|
-
|
|
492
|
+
for (const changedPath of changedPaths) {
|
|
493
|
+
const target = path.join(targetRoot, changedPath);
|
|
494
|
+
await mkdir(path.dirname(target), { recursive: true });
|
|
495
|
+
await cp(path.join(stagingRoot, changedPath), target, {
|
|
486
496
|
recursive: true,
|
|
487
497
|
force: true,
|
|
498
|
+
filter: generatedDependencyTreeCopyFilter,
|
|
488
499
|
});
|
|
489
500
|
}
|
|
490
501
|
committed = true;
|
|
491
502
|
}
|
|
492
503
|
catch (error) {
|
|
493
|
-
await
|
|
504
|
+
await rollbackStagedPaths({ targetRoot, backupRoot, changedPaths });
|
|
494
505
|
throw error;
|
|
495
506
|
}
|
|
496
507
|
}
|
|
@@ -502,25 +513,31 @@ export async function renderProjectAtomically(options) {
|
|
|
502
513
|
await rm(stagingRoot, { recursive: true, force: true });
|
|
503
514
|
}
|
|
504
515
|
}
|
|
505
|
-
function
|
|
506
|
-
const
|
|
516
|
+
function changedOutputPaths(operations) {
|
|
517
|
+
const changedPaths = new Set();
|
|
507
518
|
for (const operation of operations) {
|
|
508
519
|
const outputPath = operation.kind === "setExecutable" || operation.kind === "replaceAnchors"
|
|
509
520
|
? operation.path
|
|
510
521
|
: operation.to;
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
entries.add(entry);
|
|
522
|
+
if (outputPath.length > 0)
|
|
523
|
+
changedPaths.add(path.normalize(outputPath));
|
|
514
524
|
}
|
|
515
|
-
return [...
|
|
525
|
+
return [...changedPaths];
|
|
516
526
|
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
527
|
+
function generatedDependencyTreeCopyFilter(source) {
|
|
528
|
+
return !source.split(/[\\/]/).includes("node_modules");
|
|
529
|
+
}
|
|
530
|
+
async function rollbackStagedPaths(options) {
|
|
531
|
+
for (const changedPath of options.changedPaths) {
|
|
532
|
+
const target = path.join(options.targetRoot, changedPath);
|
|
533
|
+
const backup = path.join(options.backupRoot, changedPath);
|
|
521
534
|
await rm(target, { recursive: true, force: true });
|
|
522
535
|
try {
|
|
523
|
-
await
|
|
536
|
+
await mkdir(path.dirname(target), { recursive: true });
|
|
537
|
+
await cp(backup, target, {
|
|
538
|
+
recursive: true,
|
|
539
|
+
filter: generatedDependencyTreeCopyFilter,
|
|
540
|
+
});
|
|
524
541
|
}
|
|
525
542
|
catch (error) {
|
|
526
543
|
if (!isNodeError(error) || error.code !== "ENOENT")
|