@icebreakers/monorepo-templates 1.3.4 → 1.3.5

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/assets/gitignore CHANGED
@@ -37,3 +37,6 @@ vite.config.ts.timestamp-*.mjs
37
37
  config.ts.timestamp-*.mjs
38
38
  .vite-inspect
39
39
  .playwright-cli
40
+
41
+ # local AI task artifacts
42
+ /.qoder/
@@ -75,6 +75,7 @@
75
75
  "@eslint/eslintrc": "^3.3.7",
76
76
  "@icebreakers/commitlint-config": "workspace:*",
77
77
  "@icebreakers/eslint-config": "workspace:*",
78
+ "@icebreakers/monorepo": "workspace:*",
78
79
  "@icebreakers/stylelint-config": "workspace:*",
79
80
  "@next/eslint-plugin-next": "^16.3.4",
80
81
  "@prettier/plugin-xml": "^3.4.2",
@@ -84,7 +85,6 @@
84
85
  "@types/lodash": "^4.17.25",
85
86
  "@types/lodash-es": "^4.17.12",
86
87
  "@types/micromatch": "^4.0.10",
87
- "@icebreakers/monorepo": "workspace:*",
88
88
  "@types/node": "^26.5.0",
89
89
  "@types/semver": "^7.8.0",
90
90
  "@types/set-value": "^4.0.3",
@@ -125,10 +125,10 @@
125
125
  "tsd": "^0.33.0",
126
126
  "tsdown": "0.23.0",
127
127
  "tslib": "^2.8.1",
128
+ "tsup": "^8.5.1",
128
129
  "tsx": "^4.23.13",
129
130
  "turbo": "^2.10.12",
130
131
  "type-fest": "^5.9.0",
131
- "tsup": "^8.5.1",
132
132
  "typescript": "^6.0.3",
133
133
  "unbuild": "^3.6.1",
134
134
  "vitest": "~5.0.0",
package/assets/turbo.json CHANGED
@@ -1,5 +1,8 @@
1
1
  {
2
2
  "$schema": "https://turborepo.com/schema.json",
3
+ "globalDependencies": [
4
+ "pnpm-lock.yaml"
5
+ ],
3
6
  "tasks": {
4
7
  "build": {
5
8
  "dependsOn": [
@@ -8,6 +11,10 @@
8
11
  "inputs": [
9
12
  "src/**",
10
13
  "lib/**",
14
+ "worker/**",
15
+ "wrangler.{json,jsonc,toml}",
16
+ ".dev.vars*",
17
+ ".env*",
11
18
  "package.json",
12
19
  "tsconfig*.json",
13
20
  "*.config.{js,ts,mjs,mts}"
@@ -72,6 +79,10 @@
72
79
  "inputs": [
73
80
  "src/**",
74
81
  "lib/**",
82
+ "worker/**",
83
+ "wrangler.{json,jsonc,toml}",
84
+ ".dev.vars*",
85
+ ".env*",
75
86
  "test/**",
76
87
  "package.json",
77
88
  "tsconfig*.json"
package/dist/cli.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { t as prepareAssets } from "./prepare-D7eJqEqy.mjs";
1
+ import { t as prepareAssets } from "./prepare-DlR-vvls.mjs";
2
2
  import process from "node:process";
3
3
  //#region src/cli.ts
4
4
  async function main() {
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { a as toPublishGitignorePath, c as assetsDir, d as templatesDir, f as assetTargets$1, i as isGitignoreFile, l as packageDir, n as createTemplateCopyFilter, o as toWorkspaceGitignorePath, p as getAssetTargets$1, r as shouldSkipTemplatePath, s as templateChoices$1, t as prepareAssets, u as skeletonDir } from "./prepare-D7eJqEqy.mjs";
1
+ import { a as toPublishGitignorePath, c as assetsDir, d as templatesDir, f as assetTargets$1, i as isGitignoreFile, l as packageDir, n as createTemplateCopyFilter, o as toWorkspaceGitignorePath, p as getAssetTargets$1, r as shouldSkipTemplatePath, s as templateChoices$1, t as prepareAssets, u as skeletonDir } from "./prepare-DlR-vvls.mjs";
2
2
  import path from "node:path";
3
3
  import fs, { access, open, rm } from "node:fs/promises";
4
4
  import exec from "nanoexec";
@@ -144,7 +144,8 @@ const skipDirs = /* @__PURE__ */ new Set([
144
144
  const skipFiles = /* @__PURE__ */ new Set([
145
145
  ".DS_Store",
146
146
  "CHANGELOG.md",
147
- "route-map.d.ts"
147
+ "route-map.d.ts",
148
+ "worker-configuration.d.ts"
148
149
  ]);
149
150
  function shouldSkipTemplatePath(rootDir, targetPath) {
150
151
  const basename = path.basename(targetPath);
@@ -310,6 +311,19 @@ async function removeSourceRepoReleaseToolingBuildStep() {
310
311
  const nextContent = removeSourceRepoReleaseToolingBuildStepContent(content);
311
312
  if (nextContent !== content) await fs.writeFile(releaseWorkflowPath, nextContent, "utf8");
312
313
  }
314
+ async function removeSourceRepoWorkerTypeChecks() {
315
+ const workflowPath = path$1.join(assetsDir, ".github/workflows/ci.yml");
316
+ if (await pathExists(workflowPath)) {
317
+ const workflow = await fs.readFile(workflowPath, "utf8");
318
+ await fs.writeFile(workflowPath, workflow.replace(/\r?\n\s+- name: Check Worker type generation from packaged templates\r?\n\s+run: pnpm test:worker-types\r?\n/g, "\n"));
319
+ }
320
+ const manifestPath = path$1.join(assetsDir, "package.json");
321
+ if (await pathExists(manifestPath)) {
322
+ const manifest = JSON.parse(await fs.readFile(manifestPath, "utf8"));
323
+ delete manifest.scripts?.["test:worker-types"];
324
+ await fs.writeFile(manifestPath, `${JSON.stringify(manifest, null, 2)}\n`);
325
+ }
326
+ }
313
327
  async function copyTemplates(repoRoot, overwriteExisting) {
314
328
  for (const template of templateChoices) {
315
329
  const from = path$1.join(repoRoot, "templates", template.source);
@@ -331,6 +345,7 @@ async function prepareAssets(options = {}) {
331
345
  await removePublishedReleaseState();
332
346
  await writePublishedToolingConfigs();
333
347
  await removeSourceRepoReleaseToolingBuildStep();
348
+ await removeSourceRepoWorkerTypeChecks();
334
349
  await copyTemplates(repoRoot, overwriteExisting);
335
350
  }
336
351
  //#endregion
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@icebreakers/monorepo-templates",
3
3
  "type": "module",
4
- "version": "1.3.4",
4
+ "version": "1.3.5",
5
5
  "description": "Built-in project templates and managed workspace assets for repoctl",
6
6
  "author": "ice breaker <hi@sonofmagic.top>",
7
7
  "license": "MIT",
@@ -25,3 +25,4 @@ dist-ssr
25
25
  src/route-map.d.ts
26
26
  .wrangler
27
27
  .dev.vars*
28
+ worker-configuration.d.ts
@@ -20,15 +20,15 @@
20
20
  "template"
21
21
  ],
22
22
  "scripts": {
23
- "dev": "vite --host",
24
- "build": "vue-tsc -b && vite build",
23
+ "dev": "pnpm cf-typegen && vite --host",
24
+ "build": "pnpm cf-typegen && vue-tsc -b && vite build",
25
25
  "lint": "eslint .",
26
26
  "lint:fix": "eslint . --fix",
27
27
  "preview": "vite preview",
28
28
  "deploy": "wrangler deploy",
29
29
  "cf-typegen": "wrangler types",
30
30
  "cf-typegen:check": "wrangler types --check",
31
- "typecheck": "pnpm cf-typegen:check && vue-tsc -b"
31
+ "typecheck": "pnpm cf-typegen && vue-tsc -b"
32
32
  },
33
33
  "dependencies": {
34
34
  "@faker-js/faker": "^10.6.0",
@@ -46,7 +46,7 @@
46
46
  "vue-router": "^5.3.1"
47
47
  },
48
48
  "devDependencies": {
49
- "@cloudflare/vite-plugin": "^1.54.3",
49
+ "@cloudflare/vite-plugin": "^1.54.5",
50
50
  "@hono/node-server": "^2.1.1",
51
51
  "@hono/trpc-server": "^0.4.2",
52
52
  "@tailwindcss/vite": "^4.3.3",
@@ -62,7 +62,7 @@
62
62
  "vite-plugin-vue-devtools": "^8.2.1",
63
63
  "vite-tsconfig-paths": "^6.1.1",
64
64
  "vue-tsc": "3.3.11",
65
- "wrangler": "^4.128.0",
65
+ "wrangler": "^4.129.1",
66
66
  "zod": "^4.5.4"
67
67
  }
68
68
  }
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": ["//"],
3
+ "tasks": {
4
+ "build": {
5
+ "outputs": ["dist/**", "worker-configuration.d.ts"]
6
+ },
7
+ "typecheck": {
8
+ "outputs": ["worker-configuration.d.ts"]
9
+ }
10
+ }
11
+ }
@@ -1 +1,2 @@
1
1
  .wrangler
2
+ worker-configuration.d.ts
@@ -31,8 +31,8 @@
31
31
  "dist"
32
32
  ],
33
33
  "scripts": {
34
- "dev": "wrangler dev",
35
- "build": "tsdown",
34
+ "dev": "pnpm cf-typegen && wrangler dev",
35
+ "build": "pnpm cf-typegen && tsdown",
36
36
  "build:watch": "tsdown --watch --sourcemap",
37
37
  "node:build:watch": "pnpm build:watch",
38
38
  "node:build": "pnpm build",
@@ -46,7 +46,7 @@
46
46
  "deploy": "wrangler deploy",
47
47
  "cf-typegen": "wrangler types",
48
48
  "cf-typegen:check": "wrangler types --check",
49
- "typecheck": "pnpm cf-typegen:check && tsc -p tsconfig.json && tsc -p tsconfig.worker.json"
49
+ "typecheck": "pnpm cf-typegen && tsc -p tsconfig.json && tsc -p tsconfig.worker.json"
50
50
  },
51
51
  "publishConfig": {
52
52
  "exports": {
@@ -65,7 +65,7 @@
65
65
  "consola": "^3.4.2",
66
66
  "hono": "^4.13.7",
67
67
  "tsdown": "0.23.0",
68
- "wrangler": "^4.128.0",
68
+ "wrangler": "^4.129.1",
69
69
  "zod": "^4.5.4"
70
70
  }
71
71
  }
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": ["//"],
3
+ "tasks": {
4
+ "build": {
5
+ "outputs": ["dist/**", "worker-configuration.d.ts"]
6
+ },
7
+ "typecheck": {
8
+ "outputs": ["worker-configuration.d.ts"]
9
+ }
10
+ }
11
+ }
@@ -49,6 +49,6 @@
49
49
  "vitepress-plugin-llms": "^1.13.5",
50
50
  "vitepress-plugin-mermaid": "^2.0.17",
51
51
  "vue-tsc": "^3.3.11",
52
- "wrangler": "^4.128.0"
52
+ "wrangler": "^4.129.1"
53
53
  }
54
54
  }
@@ -74,6 +74,14 @@ Check first:
74
74
  - `dev`, `build`, and `typecheck` scripts are part of root tasks.
75
75
  - CI needs integration or E2E tests.
76
76
 
77
+ ### Cloudflare Worker types
78
+
79
+ The `vue-hono` and `hono-server` templates generate `worker-configuration.d.ts` from the installed Wrangler version and `wrangler.jsonc` before `dev`, `build`, and `typecheck`. This generated file is ignored by Git and excluded from published templates. Dependency updates do not require committing regenerated declarations.
80
+
81
+ Run `pnpm cf-typegen` in the app workspace to refresh editor types after changing bindings or compatibility settings. `pnpm cf-typegen:check` is a read-only diagnostic: it reports missing or outdated declarations. Build and typecheck regenerate them automatically and still fail on invalid configuration or TypeScript errors.
82
+
83
+ For existing projects, update these scripts and the Turbo inputs/outputs, then remove `worker-configuration.d.ts` from the Git index with `git rm --cached worker-configuration.d.ts` and add it to `.gitignore`.
84
+
77
85
  ### Create a docs site
78
86
 
79
87
  ```bash
@@ -76,6 +76,14 @@ repo new api --template hono-server
76
76
  - `dev`、`build`、`typecheck` 脚本是否接入根任务。
77
77
  - 是否需要在 CI 里加入 E2E 或集成测试。
78
78
 
79
+ ### Cloudflare Worker 类型
80
+
81
+ `vue-hono` 和 `hono-server` 模板会在 `dev`、`build`、`typecheck` 前,根据已安装的 Wrangler 版本和 `wrangler.jsonc` 自动生成 `worker-configuration.d.ts`。该文件由 Git 忽略,也不会打入发布的模板包;依赖升级无需再提交重新生成的声明。
82
+
83
+ 修改 binding 或兼容性配置后,可在应用工作区运行 `pnpm cf-typegen` 刷新编辑器类型。`pnpm cf-typegen:check` 保留为只读诊断命令,文件缺失或过期时会报错。构建和类型检查会自动重新生成,配置错误和真实 TypeScript 错误仍会阻止通过。
84
+
85
+ 已有项目需同步这些脚本和 Turbo 的输入、输出配置,再执行 `git rm --cached worker-configuration.d.ts` 移除 Git 跟踪,并将文件加入 `.gitignore`。
86
+
79
87
  ### 要创建文档站
80
88
 
81
89
  ```bash