@icebreakers/monorepo-templates 0.1.12 → 0.1.13
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/.husky/pre-commit +1 -1
- package/assets/AGENTS.md +1 -1
- package/assets/eslint.config.js +0 -9
- package/assets/package.json +4 -7
- package/assets/vitest.config.ts +9 -5
- package/assets-data.mjs +1 -1
- package/dist/index.d.mts +7 -2
- package/dist/index.mjs +17 -6
- package/package.json +2 -2
- package/templates/client/gitignore +2 -2
- package/templates/client/package.json +1 -2
- package/templates/client/src/vite-env.d.ts +0 -1
- package/templates/client/vite.config.ts +2 -2
- package/templates/vitepress/package.json +2 -2
- package/templates/vue-lib/package.json +1 -1
- /package/assets/{lint-staged.config.js → nano-staged.js} +0 -0
package/assets/.husky/pre-commit
CHANGED
package/assets/AGENTS.md
CHANGED
|
@@ -17,7 +17,7 @@ This pnpm + Turbo monorepo keeps template sources under `templates/` (`cli`, `cl
|
|
|
17
17
|
|
|
18
18
|
Follow the root `.editorconfig`: two-space indentation, LF line endings, UTF-8. Prefer TypeScript (`.ts`/`.tsx`) and Vue SFCs; name files with kebab-case (`user-table.vue`) and exported symbols with PascalCase for components or camelCase for utilities. ESLint (`@icebreakers/eslint-config`) and Stylelint enforce formatting; run `pnpm lint` before committing, and rely on Husky + lint-staged to auto-fix staged files. Any style-related code changes (CSS, SCSS, Less, Vue style blocks, and similar files) must pass Stylelint checks before commit. All changed code must pass ESLint checks before commit.
|
|
19
19
|
|
|
20
|
-
`
|
|
20
|
+
`nano-staged.js` must include Stylelint checks for staged style files so style validation also runs during pre-commit.
|
|
21
21
|
|
|
22
22
|
When a single code file exceeds 300 lines, treat it as a refactor signal and split it into smaller modules.
|
|
23
23
|
|
package/assets/eslint.config.js
CHANGED
|
@@ -3,14 +3,5 @@ import { icebreaker } from '@icebreakers/eslint-config'
|
|
|
3
3
|
export default icebreaker(
|
|
4
4
|
{
|
|
5
5
|
ignores: ['**/fixtures/**'],
|
|
6
|
-
formatters: {
|
|
7
|
-
css: true,
|
|
8
|
-
graphql: true,
|
|
9
|
-
html: true,
|
|
10
|
-
markdown: true,
|
|
11
|
-
prettierOptions: {
|
|
12
|
-
endOfLine: 'lf',
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
6
|
},
|
|
16
7
|
)
|
package/assets/package.json
CHANGED
|
@@ -49,10 +49,9 @@
|
|
|
49
49
|
"@commitlint/cli": "^20.4.3",
|
|
50
50
|
"@icebreakers/changelog-github": "^0.2.1",
|
|
51
51
|
"@icebreakers/commitlint-config": "^1.2.10",
|
|
52
|
-
"@icebreakers/eslint-config": "^1.6.
|
|
52
|
+
"@icebreakers/eslint-config": "^1.6.27",
|
|
53
53
|
"@icebreakers/monorepo": "workspace:*",
|
|
54
|
-
"@icebreakers/stylelint-config": "^2.0.
|
|
55
|
-
"@types/fs-extra": "^11.0.4",
|
|
54
|
+
"@icebreakers/stylelint-config": "^2.0.4",
|
|
56
55
|
"@types/node": "^25.3.5",
|
|
57
56
|
"@types/semver": "^7.7.1",
|
|
58
57
|
"@vitest/coverage-v8": "~4.0.18",
|
|
@@ -61,15 +60,13 @@
|
|
|
61
60
|
"defu": "^6.1.4",
|
|
62
61
|
"es-toolkit": "^1.45.1",
|
|
63
62
|
"eslint": "^10.0.3",
|
|
64
|
-
"execa": "^9.6.1",
|
|
65
|
-
"fs-extra": "^11.3.4",
|
|
66
63
|
"husky": "^9.1.7",
|
|
67
|
-
"
|
|
64
|
+
"nano-staged": "^0.9.0",
|
|
68
65
|
"only-allow": "^1.2.2",
|
|
69
66
|
"pathe": "^2.0.3",
|
|
70
67
|
"pkg-types": "^2.3.0",
|
|
71
|
-
"rimraf": "^6.1.3",
|
|
72
68
|
"stylelint": "^17.4.0",
|
|
69
|
+
"tailwindcss": "^4.2.1",
|
|
73
70
|
"tsdown": "0.21.1",
|
|
74
71
|
"tslib": "^2.8.1",
|
|
75
72
|
"tsup": "^8.5.1",
|
package/assets/vitest.config.ts
CHANGED
|
@@ -14,6 +14,10 @@ const CONFIG_FILENAMES = [
|
|
|
14
14
|
'vitest.config.cjs',
|
|
15
15
|
'vitest.config.mjs',
|
|
16
16
|
] as const
|
|
17
|
+
const WINDOWS_PATH_SEPARATOR_RE = /\\/g
|
|
18
|
+
const RELATIVE_CURRENT_DIR_RE = /^\.\//
|
|
19
|
+
const GLOB_TOKEN_RE = /[*?[{]/
|
|
20
|
+
const TRAILING_SLASH_RE = /\/+$/
|
|
17
21
|
|
|
18
22
|
function extractBaseDirFromGlob(pattern: string): string | null {
|
|
19
23
|
if (!pattern) {
|
|
@@ -21,14 +25,14 @@ function extractBaseDirFromGlob(pattern: string): string | null {
|
|
|
21
25
|
}
|
|
22
26
|
|
|
23
27
|
const normalized = pattern
|
|
24
|
-
.replace(
|
|
25
|
-
.replace(
|
|
26
|
-
const globIndex = normalized.search(
|
|
28
|
+
.replace(WINDOWS_PATH_SEPARATOR_RE, '/')
|
|
29
|
+
.replace(RELATIVE_CURRENT_DIR_RE, '')
|
|
30
|
+
const globIndex = normalized.search(GLOB_TOKEN_RE)
|
|
27
31
|
const base = globIndex === -1
|
|
28
32
|
? normalized
|
|
29
33
|
: normalized.slice(0, globIndex)
|
|
30
34
|
|
|
31
|
-
const cleaned = base.replace(
|
|
35
|
+
const cleaned = base.replace(TRAILING_SLASH_RE, '')
|
|
32
36
|
return cleaned || null
|
|
33
37
|
}
|
|
34
38
|
|
|
@@ -47,7 +51,7 @@ function loadProjectRootsFromWorkspace(): string[] {
|
|
|
47
51
|
.map(extractBaseDirFromGlob)
|
|
48
52
|
.filter((entry): entry is string => Boolean(entry))
|
|
49
53
|
|
|
50
|
-
return roots.length ?
|
|
54
|
+
return roots.length ? [...new Set(roots)] : []
|
|
51
55
|
}
|
|
52
56
|
catch (error) {
|
|
53
57
|
console.warn('[vitest] Failed to parse pnpm-workspace.yaml, no project roots will be used.', error)
|
package/assets-data.mjs
CHANGED
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { execaCommand } from "execa";
|
|
2
1
|
import checkbox from "@inquirer/checkbox";
|
|
3
2
|
import input from "@inquirer/input";
|
|
4
3
|
import select from "@inquirer/select";
|
|
@@ -57,8 +56,14 @@ declare function scaffoldWorkspace(options: ScaffoldWorkspaceOptions): Promise<v
|
|
|
57
56
|
//#region src/utils/command.d.ts
|
|
58
57
|
interface RunCommandOptions {
|
|
59
58
|
cwd?: string;
|
|
59
|
+
stdio?: 'inherit' | 'pipe';
|
|
60
60
|
}
|
|
61
|
-
declare function runCommand(command: string, args: string[], options?: RunCommandOptions): Promise<
|
|
61
|
+
declare function runCommand(command: string, args: string[], options?: RunCommandOptions): Promise<{
|
|
62
|
+
exitCode: number | null;
|
|
63
|
+
}>;
|
|
64
|
+
declare function execaCommand(command: string, options?: RunCommandOptions): Promise<{
|
|
65
|
+
exitCode: number | null;
|
|
66
|
+
}>;
|
|
62
67
|
//#endregion
|
|
63
68
|
//#region src/utils/gitignore.d.ts
|
|
64
69
|
declare function toPublishGitignorePath(input: string): string;
|
package/dist/index.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import * as path$1 from "node:path";
|
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
import { fileURLToPath } from "node:url";
|
|
4
4
|
import fs, { access, open, rm } from "node:fs/promises";
|
|
5
|
-
import
|
|
5
|
+
import exec from "nanoexec";
|
|
6
6
|
import checkbox from "@inquirer/checkbox";
|
|
7
7
|
import input from "@inquirer/input";
|
|
8
8
|
import select from "@inquirer/select";
|
|
@@ -18,7 +18,7 @@ const coreAssetTargets = [
|
|
|
18
18
|
".npmrc",
|
|
19
19
|
"commitlint.config.ts",
|
|
20
20
|
"eslint.config.js",
|
|
21
|
-
"
|
|
21
|
+
"nano-staged.js",
|
|
22
22
|
"stylelint.config.js",
|
|
23
23
|
"monorepo.config.ts",
|
|
24
24
|
"package.json",
|
|
@@ -149,7 +149,7 @@ const skipDirs = new Set([
|
|
|
149
149
|
const skipFiles = new Set([
|
|
150
150
|
".DS_Store",
|
|
151
151
|
"CHANGELOG.md",
|
|
152
|
-
"
|
|
152
|
+
"route-map.d.ts",
|
|
153
153
|
"worker-configuration.d.ts"
|
|
154
154
|
]);
|
|
155
155
|
function shouldSkipTemplatePath(rootDir, targetPath) {
|
|
@@ -401,10 +401,21 @@ async function scaffoldWorkspace(options) {
|
|
|
401
401
|
//#endregion
|
|
402
402
|
//#region src/utils/command.ts
|
|
403
403
|
async function runCommand(command, args, options = {}) {
|
|
404
|
-
await
|
|
405
|
-
|
|
406
|
-
|
|
404
|
+
const result = await exec(command, args, {
|
|
405
|
+
cwd: options.cwd,
|
|
406
|
+
stdio: options.stdio ?? "inherit"
|
|
407
407
|
});
|
|
408
|
+
if (!result.ok) throw new Error(`Command failed with exit code ${result.code ?? "unknown"}: ${[command, ...args].join(" ")}`);
|
|
409
|
+
return { exitCode: result.code };
|
|
410
|
+
}
|
|
411
|
+
async function execaCommand(command, options = {}) {
|
|
412
|
+
const result = await exec(command, {
|
|
413
|
+
cwd: options.cwd,
|
|
414
|
+
shell: true,
|
|
415
|
+
stdio: options.stdio ?? "pipe"
|
|
416
|
+
});
|
|
417
|
+
if (!result.ok) throw new Error(`Command failed with exit code ${result.code ?? "unknown"}: ${command}`);
|
|
418
|
+
return { exitCode: result.code };
|
|
408
419
|
}
|
|
409
420
|
//#endregion
|
|
410
421
|
//#region src/index.ts
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@icebreakers/monorepo-templates",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.13",
|
|
5
5
|
"description": "Template assets for icebreaker monorepo scaffolding",
|
|
6
6
|
"author": "ice breaker <hi@sonofmagic.top>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"@inquirer/input": "^5.0.8",
|
|
44
44
|
"@inquirer/select": "^5.1.0",
|
|
45
45
|
"commander": "^14.0.3",
|
|
46
|
-
"
|
|
46
|
+
"nanoexec": "^1.1.0"
|
|
47
47
|
},
|
|
48
48
|
"publishConfig": {
|
|
49
49
|
"access": "public"
|
|
@@ -25,7 +25,7 @@
|
|
|
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.30",
|
|
29
29
|
"vue-i18n": "^11.3.0",
|
|
30
30
|
"vue-router": "^5.0.3"
|
|
31
31
|
},
|
|
@@ -42,7 +42,6 @@
|
|
|
42
42
|
"hono": "^4.12.5",
|
|
43
43
|
"tailwindcss": "^4.2.1",
|
|
44
44
|
"typescript": "~5.9.3",
|
|
45
|
-
"unplugin-vue-router": "^0.19.2",
|
|
46
45
|
"vite": "^7.3.1",
|
|
47
46
|
"vite-plugin-vue-devtools": "^8.0.7",
|
|
48
47
|
"vite-tsconfig-paths": "^6.1.1",
|
|
@@ -4,9 +4,9 @@ import { cloudflare } from '@cloudflare/vite-plugin'
|
|
|
4
4
|
import Tailwindcss from '@tailwindcss/vite'
|
|
5
5
|
import Vue from '@vitejs/plugin-vue'
|
|
6
6
|
import VueJsx from '@vitejs/plugin-vue-jsx'
|
|
7
|
-
import VueRouter from 'unplugin-vue-router/vite'
|
|
8
7
|
import { defineConfig } from 'vite'
|
|
9
8
|
import VueDevTools from 'vite-plugin-vue-devtools'
|
|
9
|
+
import VueRouter from 'vue-router/vite'
|
|
10
10
|
|
|
11
11
|
const ensureVitePlugin = <T>(plugin: T) => plugin as unknown as PluginOption
|
|
12
12
|
// https://vite.dev/config/
|
|
@@ -21,7 +21,7 @@ export default defineConfig({
|
|
|
21
21
|
ensureVitePlugin(
|
|
22
22
|
VueRouter(
|
|
23
23
|
{
|
|
24
|
-
dts: path.resolve(import.meta.dirname, 'src/
|
|
24
|
+
dts: path.resolve(import.meta.dirname, 'src/route-map.d.ts'),
|
|
25
25
|
},
|
|
26
26
|
),
|
|
27
27
|
),
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"typecheck": "tsc -p tsconfig.json"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"vue": "^3.5.
|
|
26
|
+
"vue": "^3.5.30"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@braintree/sanitize-url": "^7.1.2",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"cytoscape-cose-bilkent": "^4.1.0",
|
|
33
33
|
"dayjs": "^1.11.19",
|
|
34
34
|
"debug": "^4.4.3",
|
|
35
|
-
"mermaid": "^11.
|
|
35
|
+
"mermaid": "^11.13.0",
|
|
36
36
|
"tailwindcss": "^4.2.1",
|
|
37
37
|
"vitepress": "^1.6.4",
|
|
38
38
|
"vitepress-plugin-mermaid": "^2.0.17"
|
|
File without changes
|