@icebreakers/monorepo-templates 1.0.0 → 1.0.2
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/Dockerfile +5 -14
- package/assets/commitlint.config.ts +3 -1
- package/assets/eslint.config.js +14 -2
- package/assets/lint-staged.config.js +3 -1
- package/assets/package.json +6 -7
- package/assets/repoctl.config.ts +3 -30
- package/assets/stylelint.config.js +3 -1
- package/assets/vitest.config.ts +3 -1
- package/assets-data.mjs +0 -1
- package/dist/index.mjs +12 -5
- package/package.json +1 -1
- package/templates/cli/bin/index.js +1 -1
- package/templates/cli/package.json +5 -2
- package/templates/cli/{tsup.config.ts → tsdown.config.ts} +3 -2
- package/templates/client/eslint.config.js +2 -4
- package/templates/client/gitignore +0 -1
- package/templates/client/package.json +8 -8
- package/templates/client/worker-configuration.d.ts +13557 -0
- package/templates/client/wrangler.jsonc +3 -0
- package/templates/server/eslint.config.js +8 -0
- package/templates/server/gitignore +0 -1
- package/templates/server/package.json +8 -7
- package/templates/server/{tsup.config.ts → tsdown.config.ts} +2 -1
- package/templates/server/vitest.config.ts +3 -2
- package/templates/server/worker-configuration.d.ts +13557 -0
- package/templates/server/wrangler.jsonc +3 -0
- package/templates/tsdown/vitest.config.ts +3 -2
- package/templates/vitepress/monorepo/commands.md +12 -2
- package/templates/vitepress/monorepo/troubleshooting.md +20 -1
- package/templates/vitepress/package.json +1 -1
- package/templates/vitepress/why/examples/3.npm-basic-package/package-lock.json +605 -2770
- package/templates/vitepress/why/examples/3.npm-basic-package/package.json +5 -6
- package/templates/vitepress/why/examples/3.npm-basic-package/tsdown.config.ts +16 -0
- package/templates/vitepress/why/modern/bundlers.md +11 -0
- package/templates/vue-lib/eslint.config.js +1 -3
- package/templates/vue-lib/package.json +7 -7
- package/templates/vue-lib/test-d/index.test-d.ts +1 -1
- package/templates/vue-lib/vitest.config.ts +1 -3
- package/assets/tooling/ensure-tooling-built.mjs +0 -24
- package/assets/tooling/load-tooling-module.mjs +0 -71
- package/templates/vitepress/why/examples/3.npm-basic-package/build.config.ts +0 -24
- package/templates/vitepress/why/examples/3.npm-basic-package/tsup.config.ts +0 -16
package/assets/Dockerfile
CHANGED
|
@@ -7,21 +7,12 @@ FROM base AS builder
|
|
|
7
7
|
COPY . /usr/src/app
|
|
8
8
|
WORKDIR /usr/src/app
|
|
9
9
|
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile
|
|
10
|
-
RUN pnpm run -r build
|
|
11
|
-
&& pnpm deploy --filter=@icebreakers/foo --prod /prod/foo \
|
|
12
|
-
&& pnpm deploy --filter=@icebreakers/bar --prod /prod/bar
|
|
10
|
+
RUN pnpm run -r build
|
|
13
11
|
|
|
14
|
-
FROM base AS
|
|
15
|
-
COPY --from=builder /
|
|
16
|
-
WORKDIR /
|
|
12
|
+
FROM base AS app
|
|
13
|
+
COPY --from=builder /usr/src/app /app
|
|
14
|
+
WORKDIR /app
|
|
17
15
|
EXPOSE 8000
|
|
18
16
|
CMD [ "pnpm", "start" ]
|
|
19
17
|
|
|
20
|
-
|
|
21
|
-
COPY --from=builder /prod/bar /prod/bar
|
|
22
|
-
WORKDIR /prod/bar
|
|
23
|
-
EXPOSE 8001
|
|
24
|
-
CMD [ "pnpm", "start" ]
|
|
25
|
-
|
|
26
|
-
# docker build . --target foo --tag foo:latest
|
|
27
|
-
# docker build . --target bar --tag bar:latest
|
|
18
|
+
# docker build . --target app --tag app:latest
|
package/assets/eslint.config.js
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { loadMonorepoToolingModule } from './tooling/load-tooling-module.mjs'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const { defineEslintConfig } = await loadMonorepoToolingModule()
|
|
4
|
+
|
|
5
|
+
const config = await defineEslintConfig()
|
|
6
|
+
|
|
7
|
+
export default [
|
|
8
|
+
...config,
|
|
9
|
+
{
|
|
10
|
+
ignores: [
|
|
11
|
+
'packages/monorepo/test/fixtures/demo/**',
|
|
12
|
+
'templates/vitepress/.vitepress/config.ts.timestamp-*.mjs',
|
|
13
|
+
],
|
|
14
|
+
},
|
|
15
|
+
]
|
package/assets/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"type": "module",
|
|
4
4
|
"version": "0.0.0",
|
|
5
5
|
"private": true,
|
|
6
|
-
"packageManager": "pnpm@10.33.
|
|
6
|
+
"packageManager": "pnpm@10.33.3",
|
|
7
7
|
"author": "ice breaker <hi@sonofmagic.top>",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dev": "turbo run dev --parallel",
|
|
22
22
|
"test": "vitest run",
|
|
23
23
|
"test:dev": "vitest",
|
|
24
|
-
"lint": "turbo run lint",
|
|
24
|
+
"lint": "pnpm run tooling:build && turbo run lint",
|
|
25
25
|
"tsd": "turbo run tsd",
|
|
26
26
|
"audit": "pnpm audit --audit-level=moderate",
|
|
27
27
|
"audit:fix": "pnpm audit --fix",
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"format": "eslint . --fix",
|
|
30
30
|
"validate": "pnpm run build && pnpm run lint && pnpm run typecheck && pnpm run tsd && pnpm run test",
|
|
31
31
|
"release": "changeset",
|
|
32
|
-
"publish-packages": "
|
|
32
|
+
"publish-packages": "pnpm run build && pnpm run lint && pnpm run test && changeset version && changeset publish",
|
|
33
33
|
"------": "--------------",
|
|
34
34
|
"preinstall": "npx only-allow pnpm",
|
|
35
35
|
"prepare": "husky",
|
|
@@ -71,19 +71,18 @@
|
|
|
71
71
|
"es-toolkit": "^1.46.1",
|
|
72
72
|
"eslint": "^10.3.0",
|
|
73
73
|
"husky": "^9.1.7",
|
|
74
|
-
"lint-staged": "^
|
|
74
|
+
"lint-staged": "^17.0.2",
|
|
75
75
|
"only-allow": "^1.2.2",
|
|
76
76
|
"pathe": "^2.0.3",
|
|
77
77
|
"pkg-types": "^2.3.1",
|
|
78
78
|
"repoctl": "workspace:*",
|
|
79
|
-
"stylelint": "^17.
|
|
79
|
+
"stylelint": "^17.11.0",
|
|
80
80
|
"tailwindcss": "^4.2.4",
|
|
81
81
|
"tsd": "^0.33.0",
|
|
82
82
|
"tsdown": "0.21.10",
|
|
83
83
|
"tslib": "^2.8.1",
|
|
84
|
-
"tsup": "^8.5.1",
|
|
85
84
|
"tsx": "^4.21.0",
|
|
86
|
-
"turbo": "^2.9.
|
|
85
|
+
"turbo": "^2.9.9",
|
|
87
86
|
"type-fest": "^5.6.0",
|
|
88
87
|
"typescript": "^6.0.3",
|
|
89
88
|
"vitest": "~4.1.5",
|
package/assets/repoctl.config.ts
CHANGED
|
@@ -1,30 +1,5 @@
|
|
|
1
1
|
import type { MonorepoConfig } from 'repoctl'
|
|
2
2
|
|
|
3
|
-
function createLintStagedConfig(monorepoCommand: string) {
|
|
4
|
-
return {
|
|
5
|
-
'*.{js,jsx,mjs,ts,tsx,mts,cts}': [
|
|
6
|
-
'eslint --fix',
|
|
7
|
-
],
|
|
8
|
-
'*.vue': [
|
|
9
|
-
'eslint --fix',
|
|
10
|
-
'stylelint --fix --allow-empty-input',
|
|
11
|
-
],
|
|
12
|
-
'*.{ts,tsx,mts,cts,vue}': (files: string[]) => {
|
|
13
|
-
const uniqueFiles = [...new Set(files)]
|
|
14
|
-
if (uniqueFiles.length === 0) {
|
|
15
|
-
return []
|
|
16
|
-
}
|
|
17
|
-
return `${monorepoCommand} verify staged-typecheck ${uniqueFiles.map(file => `'${file.replaceAll('\'', '\'\\\'\'')}'`).join(' ')}`
|
|
18
|
-
},
|
|
19
|
-
'*.{json,md,mdx,html,yml,yaml}': [
|
|
20
|
-
'eslint --fix',
|
|
21
|
-
],
|
|
22
|
-
'*.{css,scss,sass,less}': [
|
|
23
|
-
'stylelint --fix --allow-empty-input',
|
|
24
|
-
],
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
3
|
export default {
|
|
29
4
|
commands: {
|
|
30
5
|
create: {
|
|
@@ -33,7 +8,7 @@ export default {
|
|
|
33
8
|
},
|
|
34
9
|
clean: {
|
|
35
10
|
autoConfirm: false,
|
|
36
|
-
|
|
11
|
+
includePrivate: true,
|
|
37
12
|
},
|
|
38
13
|
upgrade: {
|
|
39
14
|
skipOverwrite: false,
|
|
@@ -51,13 +26,11 @@ export default {
|
|
|
51
26
|
rules: {},
|
|
52
27
|
},
|
|
53
28
|
lintStaged: {
|
|
54
|
-
|
|
55
|
-
},
|
|
56
|
-
tsconfig: {
|
|
57
|
-
compilerOptions: {},
|
|
29
|
+
monorepoCommand: 'pnpm exec repo',
|
|
58
30
|
},
|
|
59
31
|
vitest: {
|
|
60
32
|
includeWorkspaceRootConfig: false,
|
|
33
|
+
coverageExclude: ['**/dist/**'],
|
|
61
34
|
coverageSkipFull: true,
|
|
62
35
|
},
|
|
63
36
|
vitestProject: {
|
package/assets/vitest.config.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { defineVitestConfig } from 'repoctl/tooling'
|
|
2
1
|
import { defineConfig } from 'vitest/config'
|
|
2
|
+
import { loadMonorepoToolingModule } from './tooling/load-tooling-module.mjs'
|
|
3
|
+
|
|
4
|
+
const { defineVitestConfig } = await loadMonorepoToolingModule()
|
|
3
5
|
|
|
4
6
|
export default defineConfig(async () => await defineVitestConfig())
|
package/assets-data.mjs
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -25,7 +25,6 @@ const coreAssetTargets = [
|
|
|
25
25
|
"AGENTS.md",
|
|
26
26
|
"pnpm-workspace.yaml",
|
|
27
27
|
"scripts",
|
|
28
|
-
"tooling",
|
|
29
28
|
"tsconfig.json",
|
|
30
29
|
"turbo.json",
|
|
31
30
|
"vitest.config.ts",
|
|
@@ -151,8 +150,7 @@ const skipDirs = new Set([
|
|
|
151
150
|
const skipFiles = new Set([
|
|
152
151
|
".DS_Store",
|
|
153
152
|
"CHANGELOG.md",
|
|
154
|
-
"route-map.d.ts"
|
|
155
|
-
"worker-configuration.d.ts"
|
|
153
|
+
"route-map.d.ts"
|
|
156
154
|
]);
|
|
157
155
|
function shouldSkipTemplatePath(rootDir, targetPath) {
|
|
158
156
|
const basename = path.basename(targetPath);
|
|
@@ -212,7 +210,16 @@ async function resetDir(targetDir, overwriteExisting) {
|
|
|
212
210
|
await fs.mkdir(targetDir, { recursive: true });
|
|
213
211
|
}
|
|
214
212
|
async function copyEntry(from, to, overwriteExisting, filter) {
|
|
215
|
-
if (!overwriteExisting && await pathExists$1(to))
|
|
213
|
+
if (!overwriteExisting && await pathExists$1(to)) {
|
|
214
|
+
const [fromStats, toStats] = await Promise.all([fs.stat(from), fs.stat(to)]);
|
|
215
|
+
if (fromStats.isDirectory() && toStats.isDirectory()) await fs.cp(from, to, {
|
|
216
|
+
recursive: true,
|
|
217
|
+
force: false,
|
|
218
|
+
errorOnExist: false,
|
|
219
|
+
filter
|
|
220
|
+
});
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
216
223
|
try {
|
|
217
224
|
await fs.cp(from, to, {
|
|
218
225
|
recursive: true,
|
|
@@ -230,7 +237,7 @@ async function copyAssets(repoRoot, overwriteExisting) {
|
|
|
230
237
|
for (const target of assetTargets$1) {
|
|
231
238
|
const packageAsset = path$1.join(monorepoAssetRoot, toPublishGitignorePath(target));
|
|
232
239
|
const repoAsset = path$1.join(repoRoot, target);
|
|
233
|
-
const from = await pathExists$1(
|
|
240
|
+
const from = await pathExists$1(repoAsset) ? repoAsset : packageAsset;
|
|
234
241
|
if (!await pathExists$1(from)) continue;
|
|
235
242
|
const to = path$1.join(assetsDir, toPublishGitignorePath(target));
|
|
236
243
|
const stats = await fs.stat(from);
|
package/package.json
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import '../dist/cli.
|
|
2
|
+
import '../dist/cli.mjs'
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
},
|
|
20
20
|
"scripts": {
|
|
21
21
|
"start": "tsx src/index.ts",
|
|
22
|
-
"dev": "
|
|
23
|
-
"build": "
|
|
22
|
+
"dev": "tsdown --watch --sourcemap",
|
|
23
|
+
"build": "tsdown",
|
|
24
24
|
"lint": "eslint .",
|
|
25
25
|
"lint:fix": "eslint . --fix",
|
|
26
26
|
"typecheck": "tsc -p tsconfig.json"
|
|
@@ -28,6 +28,9 @@
|
|
|
28
28
|
"dependencies": {
|
|
29
29
|
"consola": "^3.4.2"
|
|
30
30
|
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"tsdown": "0.21.10"
|
|
33
|
+
},
|
|
31
34
|
"publishConfig": {
|
|
32
35
|
"bin": {
|
|
33
36
|
"ice": "./bin/index.js"
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { defineConfig } from '
|
|
1
|
+
import { defineConfig } from 'tsdown'
|
|
2
2
|
|
|
3
3
|
export default defineConfig({
|
|
4
4
|
entry: ['src/index.ts', 'src/cli.ts'],
|
|
5
5
|
shims: true,
|
|
6
|
-
format: ['
|
|
6
|
+
format: ['esm', 'cjs'],
|
|
7
7
|
clean: true,
|
|
8
8
|
dts: true,
|
|
9
|
+
target: 'node18',
|
|
9
10
|
})
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import { fileURLToPath } from 'node:url'
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
const { defineEslintConfig } = await loadRepoctlToolingModule()
|
|
2
|
+
import { defineEslintConfig } from 'repoctl/tooling'
|
|
5
3
|
|
|
6
4
|
const tailwindEntryPoint = fileURLToPath(new URL('./src/style.css', import.meta.url))
|
|
7
5
|
|
|
@@ -12,6 +10,6 @@ export default await defineEslintConfig({
|
|
|
12
10
|
tailwindcss: {
|
|
13
11
|
entryPoint: tailwindEntryPoint,
|
|
14
12
|
},
|
|
15
|
-
ignores: ['**/fixtures/**'],
|
|
13
|
+
ignores: ['**/fixtures/**', 'worker-configuration.d.ts'],
|
|
16
14
|
},
|
|
17
15
|
})
|
|
@@ -16,8 +16,8 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@faker-js/faker": "^10.4.0",
|
|
19
|
-
"@tanstack/vue-query": "^5.100.
|
|
20
|
-
"@tanstack/vue-query-devtools": "^6.1.
|
|
19
|
+
"@tanstack/vue-query": "^5.100.9",
|
|
20
|
+
"@tanstack/vue-query-devtools": "^6.1.28",
|
|
21
21
|
"@tanstack/vue-table": "^8.21.3",
|
|
22
22
|
"@tanstack/vue-virtual": "^3.13.24",
|
|
23
23
|
"@trpc/client": "^11.17.0",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"pinia": "^3.0.4",
|
|
26
26
|
"tailwind-merge": "^3.5.0",
|
|
27
27
|
"tailwind-variants": "^3.2.2",
|
|
28
|
-
"vue": "^3.5.
|
|
28
|
+
"vue": "^3.5.34",
|
|
29
29
|
"vue-i18n": "^11.4.0",
|
|
30
30
|
"vue-router": "^5.0.6"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
|
-
"@cloudflare/vite-plugin": "^1.
|
|
33
|
+
"@cloudflare/vite-plugin": "^1.36.0",
|
|
34
34
|
"@hono/node-server": "^2.0.1",
|
|
35
35
|
"@hono/trpc-server": "^0.4.2",
|
|
36
36
|
"@tailwindcss/vite": "^4.2.4",
|
|
@@ -39,14 +39,14 @@
|
|
|
39
39
|
"@vitejs/plugin-vue-jsx": "^5.1.5",
|
|
40
40
|
"@vue/tsconfig": "^0.9.1",
|
|
41
41
|
"consola": "^3.4.2",
|
|
42
|
-
"hono": "^4.12.
|
|
42
|
+
"hono": "^4.12.18",
|
|
43
43
|
"tailwindcss": "^4.2.4",
|
|
44
44
|
"typescript": "~6.0.3",
|
|
45
45
|
"vite": "^8.0.10",
|
|
46
46
|
"vite-plugin-vue-devtools": "^8.1.1",
|
|
47
47
|
"vite-tsconfig-paths": "^6.1.1",
|
|
48
|
-
"vue-tsc": "3.2.
|
|
49
|
-
"wrangler": "^4.
|
|
50
|
-
"zod": "^4.4.
|
|
48
|
+
"vue-tsc": "3.2.8",
|
|
49
|
+
"wrangler": "^4.88.0",
|
|
50
|
+
"zod": "^4.4.3"
|
|
51
51
|
}
|
|
52
52
|
}
|