@ykdz/template 0.0.25 → 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.
Files changed (21) hide show
  1. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-playwright.yml +1 -1
  2. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check-rust.yml +1 -1
  3. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check.dynamic.template +1 -1
  4. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/.github/workflows/check.yml +1 -1
  5. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/pnpm-workspace.dynamic.txt +3 -0
  6. package/node_modules/@ykdz/template-builtin-presets/templates/foundation/pnpm-workspace.yaml +4 -1
  7. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/.github/workflows/check.yml +1 -1
  8. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/Cargo.lock +2 -2
  9. package/node_modules/@ykdz/template-builtin-presets/templates/rust-bin/Cargo.toml +1 -1
  10. package/node_modules/@ykdz/template-builtin-presets/templates/shared/devcontainer/node-pnpm.Dockerfile +5 -2
  11. package/node_modules/@ykdz/template-builtin-presets/templates/ts-lib/.github/workflows/check.yml +1 -1
  12. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/Dockerfile +2 -2
  13. package/node_modules/@ykdz/template-builtin-presets/templates/vike-app/web/tsconfig.json +1 -1
  14. package/node_modules/@ykdz/template-builtin-presets/templates/vue-app/.github/workflows/check.yml +1 -1
  15. package/node_modules/@ykdz/template-core/dist/Cargo.lock +2 -2
  16. package/node_modules/@ykdz/template-core/dist/Cargo.toml +1 -1
  17. package/node_modules/@ykdz/template-core/dist/dependency-catalog.js +11 -3
  18. package/node_modules/@ykdz/template-core/dist/pnpm-workspace.yaml +5 -5
  19. package/node_modules/@ykdz/template-core/dist/project-github.js +1 -1
  20. package/node_modules/@ykdz/template-core/dist/renderer.js +38 -21
  21. package/package.json +1 -1
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
13
  - uses: actions/checkout@v7
14
- - uses: actions/setup-node@v6
14
+ - uses: actions/setup-node@v7
15
15
  with:
16
16
  node-version-file: package.json
17
17
  - run: corepack enable
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
13
  - uses: actions/checkout@v7
14
- - uses: actions/setup-node@v6
14
+ - uses: actions/setup-node@v7
15
15
  with:
16
16
  node-version-file: package.json
17
17
  - run: corepack enable
@@ -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@v6
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}}
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
13
  - uses: actions/checkout@v7
14
- - uses: actions/setup-node@v6
14
+ - uses: actions/setup-node@v7
15
15
  with:
16
16
  node-version-file: package.json
17
17
  - run: corepack enable
@@ -11,6 +11,9 @@ syncInjectedDepsAfterScripts:
11
11
 
12
12
  minimumReleaseAge: 1440
13
13
  minimumReleaseAgeStrict: true
14
+
15
+ minimumReleaseAgeExclude:
16
+ - "@ykdz/template"
14
17
  {{DEPENDENCY_OVERRIDES_SECTION}}
15
18
  allowBuilds:
16
19
  esbuild: true
@@ -13,6 +13,9 @@ syncInjectedDepsAfterScripts:
13
13
  minimumReleaseAge: 1440
14
14
  minimumReleaseAgeStrict: true
15
15
 
16
+ minimumReleaseAgeExclude:
17
+ - "@ykdz/template"
18
+
16
19
  overrides:
17
20
 
18
21
  allowBuilds:
@@ -23,6 +26,6 @@ catalog:
23
26
  oxfmt: ^0.58.0
24
27
  oxlint: ^1.73.0
25
28
  oxlint-tsgolint: ^0.24.0
26
- turbo: 2.10.2
29
+ turbo: 2.10.5
27
30
  typescript-7: npm:typescript@^7.0.2
28
31
  valibot: ^1.4.2
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
13
  - uses: actions/checkout@v7
14
- - uses: actions/setup-node@v6
14
+ - uses: actions/setup-node@v7
15
15
  with:
16
16
  node-version-file: package.json
17
17
  - run: corepack enable
@@ -4,9 +4,9 @@ version = 4
4
4
 
5
5
  [[package]]
6
6
  name = "anyhow"
7
- version = "1.0.103"
7
+ version = "1.0.104"
8
8
  source = "registry+https://github.com/rust-lang/crates.io-index"
9
- checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3"
9
+ checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470"
10
10
 
11
11
  [[package]]
12
12
  name = "{{CARGO_PACKAGE_NAME}}"
@@ -4,7 +4,7 @@ version = "0.1.0"
4
4
  edition = "2024"
5
5
 
6
6
  [dependencies]
7
- anyhow = "1.0.100"
7
+ anyhow = "1.0.104"
8
8
 
9
9
  [lints]
10
10
  workspace = true
@@ -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 install -d -m 0755 "$COREPACK_HOME" "$PNPM_HOME" \
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"
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
13
  - uses: actions/checkout@v7
14
- - uses: actions/setup-node@v6
14
+ - uses: actions/setup-node@v7
15
15
  with:
16
16
  node-version-file: package.json
17
17
  - run: corepack enable
@@ -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; \
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "files": [],
3
3
  "references": [
4
- { "path": "../../packages/db" },
4
+ { "path": "../../packages/db/tsconfig.json" },
5
5
  { "path": "./tsconfig.app.json" },
6
6
  { "path": "./tsconfig.test.json" },
7
7
  { "path": "./tsconfig.node.json" }
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
13
  - uses: actions/checkout@v7
14
- - uses: actions/setup-node@v6
14
+ - uses: actions/setup-node@v7
15
15
  with:
16
16
  node-version-file: package.json
17
17
  - run: corepack enable
@@ -4,9 +4,9 @@ version = 4
4
4
 
5
5
  [[package]]
6
6
  name = "anyhow"
7
- version = "1.0.103"
7
+ version = "1.0.104"
8
8
  source = "registry+https://github.com/rust-lang/crates.io-index"
9
- checksum = "2a4385e2e34eb35d6b3efe798b9eb88096925d87726c0798709bf56d9ed84af3"
9
+ checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470"
10
10
 
11
11
  [[package]]
12
12
  name = "template-cargo-dependencies"
@@ -9,4 +9,4 @@ name = "template-cargo-dependencies"
9
9
  path = "packages/builtin-presets/templates/rust-bin/src/main.rs"
10
10
 
11
11
  [dependencies]
12
- anyhow = "1.0.100"
12
+ anyhow = "1.0.104"
@@ -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
- assertMinimumReleaseAgeExclusions(options.minimumReleaseAgeExclude ?? []);
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 (options.minimumReleaseAgeExclude?.length) {
232
- lines.push("minimumReleaseAgeExclude:", ...options.minimumReleaseAgeExclude
239
+ if (minimumReleaseAgeExclude.length) {
240
+ lines.push("minimumReleaseAgeExclude:", ...minimumReleaseAgeExclude
233
241
  .toSorted()
234
242
  .map((dependency) => ` - ${JSON.stringify(dependency)}`), "");
235
243
  }
@@ -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.7
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: ^9.6.1
35
- hono: ^4.12.27
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.11.21
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.2
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@v6", " with:", " node-version-file: package.json", " - run: corepack enable");
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 changedEntries = changedRootEntries(options.operations);
464
+ const changedPaths = changedOutputPaths(options.operations);
465
465
  let committed = false;
466
466
  try {
467
- await cp(targetRoot, stagingRoot, { recursive: true });
467
+ await cp(targetRoot, stagingRoot, {
468
+ recursive: true,
469
+ filter: generatedDependencyTreeCopyFilter,
470
+ });
468
471
  await renderProject({ ...options, targetRoot: stagingRoot });
469
- // Commit only the entries changed by the staged plan. In particular, do
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 entry has a rollback copy before it is made visible.
473
- for (const entry of changedEntries) {
474
- const current = path.join(targetRoot, entry);
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
- await cp(current, path.join(backupRoot, entry), { recursive: true });
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 entry of changedEntries) {
485
- await cp(path.join(stagingRoot, entry), path.join(targetRoot, entry), {
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 rollbackStagedEntries({ targetRoot, backupRoot, changedEntries });
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 changedRootEntries(operations) {
506
- const entries = new Set();
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
- const entry = outputPath.split(/[\\/]/)[0];
512
- if (entry !== undefined && entry.length > 0)
513
- entries.add(entry);
522
+ if (outputPath.length > 0)
523
+ changedPaths.add(path.normalize(outputPath));
514
524
  }
515
- return [...entries];
525
+ return [...changedPaths];
516
526
  }
517
- async function rollbackStagedEntries(options) {
518
- for (const entry of options.changedEntries) {
519
- const target = path.join(options.targetRoot, entry);
520
- const backup = path.join(options.backupRoot, entry);
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 cp(backup, target, { recursive: true });
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")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ykdz/template",
3
- "version": "0.0.25",
3
+ "version": "0.0.27",
4
4
  "private": false,
5
5
  "description": "Project template generator for YKDZ starter projects.",
6
6
  "keywords": [