@icebreakers/monorepo-templates 0.1.16 → 1.0.1

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 (92) hide show
  1. package/README.md +12 -0
  2. package/assets/.changeset/config.json +7 -2
  3. package/assets/.github/workflows/ci.yml +8 -2
  4. package/assets/.github/workflows/release.yml +2 -2
  5. package/assets/.husky/commit-msg +1 -1
  6. package/assets/.husky/pre-commit +1 -1
  7. package/assets/.husky/pre-push +5 -0
  8. package/assets/AGENTS.md +8 -7
  9. package/assets/Dockerfile +5 -14
  10. package/assets/commitlint.config.ts +2 -2
  11. package/assets/eslint.config.js +2 -6
  12. package/assets/lint-staged.config.js +3 -0
  13. package/assets/package.json +41 -31
  14. package/assets/repoctl.config.ts +68 -0
  15. package/assets/stylelint.config.js +2 -2
  16. package/assets/tsconfig.json +1 -49
  17. package/assets/turbo.json +17 -6
  18. package/assets/vitest.config.ts +2 -125
  19. package/assets-data.mjs +3 -2
  20. package/dist/index.d.mts +22 -1
  21. package/dist/index.mjs +114 -32
  22. package/package.json +12 -8
  23. package/template-data.mjs +48 -8
  24. package/templates/cli/bin/index.js +1 -1
  25. package/templates/cli/package.json +5 -2
  26. package/templates/cli/{tsup.config.ts → tsdown.config.ts} +3 -2
  27. package/templates/client/eslint.config.js +5 -5
  28. package/templates/client/gitignore +0 -1
  29. package/templates/client/package.json +22 -22
  30. package/templates/client/vite.config.ts +4 -3
  31. package/templates/client/worker-configuration.d.ts +13557 -0
  32. package/templates/client/wrangler.jsonc +4 -6
  33. package/templates/server/eslint.config.js +8 -0
  34. package/templates/server/gitignore +0 -1
  35. package/templates/server/package.json +9 -8
  36. package/templates/server/src/app.ts +4 -4
  37. package/templates/server/tsconfig.json +1 -2
  38. package/templates/server/{tsup.config.ts → tsdown.config.ts} +2 -1
  39. package/templates/server/vitest.config.ts +7 -5
  40. package/templates/server/worker-configuration.d.ts +13557 -0
  41. package/templates/server/wrangler.jsonc +4 -6
  42. package/templates/tsdown/package.json +2 -1
  43. package/templates/tsdown/test-d/index.test-d.ts +5 -0
  44. package/templates/tsdown/tsconfig.json +1 -2
  45. package/templates/tsdown/vitest.config.ts +7 -5
  46. package/templates/vitepress/.vitepress/config.ts +34 -36
  47. package/templates/vitepress/getting-started.md +243 -0
  48. package/templates/vitepress/gitignore +2 -1
  49. package/templates/vitepress/index.md +144 -79
  50. package/templates/vitepress/monorepo/commands.md +291 -0
  51. package/templates/vitepress/monorepo/index.md +103 -34
  52. package/templates/vitepress/monorepo/manage.md +181 -80
  53. package/templates/vitepress/monorepo/publish.md +128 -57
  54. package/templates/vitepress/monorepo/templates.md +67 -0
  55. package/templates/vitepress/monorepo/troubleshooting.md +226 -0
  56. package/templates/vitepress/package.json +5 -5
  57. package/templates/vitepress/thinking.md +1 -1
  58. package/templates/vitepress/tools/husky.md +7 -2
  59. package/templates/vitepress/tools/lint-staged.md +15 -1
  60. package/templates/vitepress/why/examples/3.npm-basic-package/package-lock.json +605 -2770
  61. package/templates/vitepress/why/examples/3.npm-basic-package/package.json +5 -6
  62. package/templates/vitepress/why/examples/3.npm-basic-package/tsdown.config.ts +16 -0
  63. package/templates/vitepress/why/examples/usage-cjs/index.js +2 -6
  64. package/templates/vitepress/why/examples/usage-cjs/package-lock.json +7 -13
  65. package/templates/vitepress/why/examples/usage-cjs/package.json +2 -2
  66. package/templates/vitepress/why/examples/usage-esm/index.js +2 -2
  67. package/templates/vitepress/why/examples/usage-esm/package-lock.json +7 -13
  68. package/templates/vitepress/why/examples/usage-esm/package.json +2 -2
  69. package/templates/vitepress/why/modern/bundlers.md +19 -46
  70. package/templates/vue-lib/eslint.config.js +4 -4
  71. package/templates/vue-lib/package.json +15 -10
  72. package/templates/vue-lib/test-d/index.test-d.ts +6 -0
  73. package/templates/vue-lib/tsconfig.test.json +1 -1
  74. package/templates/vue-lib/vitest.config.ts +6 -5
  75. package/assets/monorepo.config.ts +0 -22
  76. package/assets/nano-staged.js +0 -18
  77. package/templates/tsup/build.config.ts +0 -24
  78. package/templates/tsup/package.json +0 -49
  79. package/templates/tsup/src/index.ts +0 -12
  80. package/templates/tsup/test/index.test.ts +0 -18
  81. package/templates/tsup/tsconfig.json +0 -15
  82. package/templates/tsup/tsup.config.ts +0 -18
  83. package/templates/tsup/vitest.config.ts +0 -15
  84. package/templates/unbuild/build.config.ts +0 -24
  85. package/templates/unbuild/package.json +0 -49
  86. package/templates/unbuild/src/index.ts +0 -9
  87. package/templates/unbuild/src/utils.ts +0 -5
  88. package/templates/unbuild/test/index.test.ts +0 -18
  89. package/templates/unbuild/tsconfig.json +0 -15
  90. package/templates/unbuild/vitest.config.ts +0 -15
  91. package/templates/vitepress/why/examples/3.npm-basic-package/build.config.ts +0 -24
  92. package/templates/vitepress/why/examples/3.npm-basic-package/tsup.config.ts +0 -16
@@ -2,6 +2,9 @@
2
2
  "$schema": "./node_modules/wrangler/config-schema.json",
3
3
  "name": "monorepo-client",
4
4
  "compatibility_date": "2025-10-16",
5
+ "compatibility_flags": [
6
+ "nodejs_compat"
7
+ ],
5
8
  "main": "./worker/fetch-entry.ts",
6
9
  "assets": {
7
10
  "not_found_handling": "single-page-application",
@@ -12,12 +15,7 @@
12
15
  "dev": {
13
16
  "port": 8787
14
17
  },
15
- "routes": [
16
- {
17
- "custom_domain": true,
18
- "pattern": "client.monorepo.icebreaker.top"
19
- }
20
- ],
18
+ // Add "routes" here when you bind a real custom domain.
21
19
  "observability": {
22
20
  "enabled": true
23
21
  }
@@ -0,0 +1,8 @@
1
+ import { defineEslintConfig } from 'repoctl/tooling'
2
+
3
+ export default await defineEslintConfig({
4
+ options: {
5
+ typescript: true,
6
+ ignores: ['worker-configuration.d.ts'],
7
+ },
8
+ })
@@ -1,2 +1 @@
1
1
  .wrangler
2
- worker-configuration.d.ts
@@ -2,7 +2,7 @@
2
2
  "name": "@icebreakers/server",
3
3
  "type": "module",
4
4
  "version": "0.0.0",
5
- "description": "tsup(esbuild) build package template",
5
+ "description": "tsdown build package template",
6
6
  "author": "ice breaker <hi@sonofmagic.top>",
7
7
  "license": "MIT",
8
8
  "repository": {
@@ -25,12 +25,12 @@
25
25
  ],
26
26
  "scripts": {
27
27
  "dev": "wrangler dev",
28
- "build": "tsup",
29
- "build:watch": "tsup --watch --sourcemap",
28
+ "build": "tsdown",
29
+ "build:watch": "tsdown --watch --sourcemap",
30
30
  "node:build:watch": "pnpm build:watch",
31
31
  "node:build": "pnpm build",
32
32
  "node:dev": "tsx watch src/node-entry.ts",
33
- "node:start": "node dist/node-entry.js",
33
+ "node:start": "node dist/node-entry.mjs",
34
34
  "test": "vitest run",
35
35
  "test:dev": "vitest",
36
36
  "release": "pnpm publish",
@@ -54,10 +54,11 @@
54
54
  "types": "./dist/index.d.ts"
55
55
  },
56
56
  "devDependencies": {
57
- "@hono/node-server": "^1.19.11",
57
+ "@hono/node-server": "^2.0.1",
58
58
  "consola": "^3.4.2",
59
- "hono": "^4.12.8",
60
- "wrangler": "^4.74.0",
61
- "zod": "^4.3.6"
59
+ "hono": "^4.12.17",
60
+ "tsdown": "0.21.10",
61
+ "wrangler": "^4.88.0",
62
+ "zod": "^4.4.3"
62
63
  }
63
64
  }
@@ -117,13 +117,13 @@ const grads: ColorStop[][] = [
117
117
  ]
118
118
 
119
119
  // Convert hour to CSS gradient
120
- async function toCSSGradient(hour: number): Promise<string> {
120
+ function toCSSGradient(hour: number): string {
121
121
  let css = 'linear-gradient(to bottom,'
122
- const data = grads[hour]
122
+ const data = grads[hour] ?? grads[0]!
123
123
  const len = data.length
124
124
 
125
125
  for (let i = 0; i < len; i++) {
126
- const item = data[i]
126
+ const item = data[i]!
127
127
  css += ` #${item.color} ${item.position}%`
128
128
  if (i < len - 1) {
129
129
  css += ','
@@ -168,7 +168,7 @@ app.get('*', async (c) => {
168
168
  html_content += `<p>${timezone}<br/></p>`
169
169
 
170
170
  // Add background gradient based on hour
171
- html_style += `body{background:${await toCSSGradient(hour)};}`
171
+ html_style += `body{background:${toCSSGradient(hour)};}`
172
172
 
173
173
  // Complete HTML document
174
174
  const html = `
@@ -5,10 +5,9 @@
5
5
  "ES2022",
6
6
  "WebWorker"
7
7
  ],
8
- "baseUrl": ".",
9
8
  "paths": {
10
9
  "@/*": [
11
- "src/*"
10
+ "./src/*"
12
11
  ]
13
12
  },
14
13
  "types": [
@@ -1,4 +1,4 @@
1
- import { defineConfig } from 'tsup'
1
+ import { defineConfig } from 'tsdown'
2
2
 
3
3
  export default defineConfig({
4
4
  entry: ['src/node-entry.ts'],
@@ -6,4 +6,5 @@ export default defineConfig({
6
6
  format: ['esm'],
7
7
  clean: true,
8
8
  dts: false,
9
+ target: 'node18',
9
10
  })
@@ -1,15 +1,17 @@
1
1
  import path from 'node:path'
2
+ import { fileURLToPath } from 'node:url'
3
+ import { defineVitestProjectConfig } from 'repoctl/tooling'
2
4
  import { defineProject } from 'vitest/config'
3
5
 
4
- export default defineProject({
5
- test: {
6
+ const __dirname = path.dirname(fileURLToPath(import.meta.url))
7
+
8
+ export default defineProject(await defineVitestProjectConfig({
9
+ options: {
6
10
  alias: [
7
11
  {
8
12
  find: '@',
9
13
  replacement: path.resolve(__dirname, './src'),
10
14
  },
11
15
  ],
12
- globals: true,
13
- testTimeout: 60_000,
14
16
  },
15
- })
17
+ }))