create-chanom-app 0.3.0 → 0.4.0
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/README.md +1 -1
- package/dist/index.js +7 -5
- package/dist/templates/README.md.template +1 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -68,7 +68,7 @@ pnpm create chanom-app my-app --yes --no-install
|
|
|
68
68
|
|
|
69
69
|
A minimal Vite + React + TS app wired to the chanom shared configs:
|
|
70
70
|
|
|
71
|
-
- `package.json` - dependencies pinned to the versions the scaffolder bundles, plus `dev` / `build` / `preview` / `lint` / `format` / `format:check` / `test` / `test:watch` scripts
|
|
71
|
+
- `package.json` - dependencies pinned to the versions the scaffolder bundles, plus `dev` / `build` / `preview` / `typecheck` / `lint` / `format` / `format:check` / `test` / `test:watch` scripts
|
|
72
72
|
- `vite.config.ts` - using `@vitejs/plugin-react` and [`@chanom/vite-config`](../vite-config)
|
|
73
73
|
- `tsconfig.json` - extending `@tsconfig/vite-react`
|
|
74
74
|
- `oxlint.config.ts` / `oxfmt.config.ts` - re-exporting the [`@chanom/dev-config`](../dev-config) presets
|
package/dist/index.js
CHANGED
|
@@ -231,7 +231,7 @@ const codingStandardsSkill = {
|
|
|
231
231
|
},
|
|
232
232
|
{
|
|
233
233
|
"path": "SKILL.md",
|
|
234
|
-
"contents": "---\nname: coding-standards\ndescription: Coding standards for this Vite + React + TypeScript app. Use when writing or changing components, hooks, utils, or tests, and before committing.\n---\n\n# Coding standards\n\nVite + React 19 + TypeScript, scaffolded with `create-chanom-app`. oxlint lints,\noxfmt formats, vitest tests. Read the reference for what you touch **before**\nwriting, so new code matches the code already here.\n\n## Which reference to load\n\n| You are writing… | Load |\n| -------------------------------------------- | -------------------------- |\n| Any `.ts` / `.tsx` file | `references/typescript.md` |\n| A component, hook, or anything rendering JSX | `references/react.md` |\n| A `*.test.ts` / `*.test.tsx` file | `references/vitest.md` |\n\nThese layer: a new component with a test reads all three. Load every row that\napplies.\n\n## Universal rules\n\n- Filenames are kebab-case: `user-card.tsx`, `use-current-user.ts`, `format-date.ts`.\n- Before adding a file, open two neighbouring files of the same kind and match\n their shape — import order, export style, test naming.\n- Source lives under `src/`. Colocate a test beside the code it covers:\n `src/utils/format-date.ts` → `src/utils/format-date.test.ts`.\n\n## Verify\n\nAfter implementing, from the project root:\n\n```sh\npnpm lint\npnpm test\npnpm build\n```\n\nDone only when all
|
|
234
|
+
"contents": "---\nname: coding-standards\ndescription: Coding standards for this Vite + React + TypeScript app. Use when writing or changing components, hooks, utils, or tests, and before committing.\n---\n\n# Coding standards\n\nVite + React 19 + TypeScript, scaffolded with `create-chanom-app`. oxlint lints,\noxfmt formats, vitest tests. Read the reference for what you touch **before**\nwriting, so new code matches the code already here.\n\n## Which reference to load\n\n| You are writing… | Load |\n| -------------------------------------------- | -------------------------- |\n| Any `.ts` / `.tsx` file | `references/typescript.md` |\n| A component, hook, or anything rendering JSX | `references/react.md` |\n| A `*.test.ts` / `*.test.tsx` file | `references/vitest.md` |\n\nThese layer: a new component with a test reads all three. Load every row that\napplies.\n\n## Universal rules\n\n- Filenames are kebab-case: `user-card.tsx`, `use-current-user.ts`, `format-date.ts`.\n- Before adding a file, open two neighbouring files of the same kind and match\n their shape — import order, export style, test naming.\n- Source lives under `src/`. Colocate a test beside the code it covers:\n `src/utils/format-date.ts` → `src/utils/format-date.test.ts`.\n\n## Verify\n\nAfter implementing, from the project root:\n\n```sh\npnpm lint\npnpm test\npnpm build\npnpm typecheck\n```\n\nDone only when all four exit clean. On failure, fix and rerun until they do.\nRun `pnpm format` before committing. Comment- or doc-only changes may skip all\nfour.\n\n## Committing\n\nAsk before committing. Use conventional commits under 100 characters:\n`<type>(<scope>): <subject>`, e.g. `feat(auth): add sign-out button`. Scope is\nthe area you touched, not the repo name.\n"
|
|
235
235
|
}
|
|
236
236
|
]
|
|
237
237
|
};
|
|
@@ -281,10 +281,10 @@ const depVersions = {
|
|
|
281
281
|
"@commitlint/cli": "21.2.0",
|
|
282
282
|
"@commitlint/config-conventional": "21.2.0",
|
|
283
283
|
"@chanom/dev-config": "0.0.3",
|
|
284
|
-
"@chanom/vite-config": "0.1.
|
|
284
|
+
"@chanom/vite-config": "0.1.1"
|
|
285
285
|
};
|
|
286
286
|
/** This package's own version, for `--version`. */
|
|
287
|
-
const pkgVersion = "0.
|
|
287
|
+
const pkgVersion = "0.4.0";
|
|
288
288
|
//#endregion
|
|
289
289
|
//#region src/domain/args.ts
|
|
290
290
|
const PACKAGE_MANAGERS = [
|
|
@@ -381,10 +381,11 @@ function parseArgs(argv) {
|
|
|
381
381
|
/**
|
|
382
382
|
* Validates a project name / target directory. Returns an error message to
|
|
383
383
|
* reject it, or `undefined` when it is acceptable. `.` (scaffold into the
|
|
384
|
-
* current directory) is allowed.
|
|
384
|
+
* current directory) is allowed. Accepts `undefined` so it can be handed
|
|
385
|
+
* straight to a prompt, where an empty submission arrives as `undefined`.
|
|
385
386
|
*/
|
|
386
387
|
function validateProjectName(name) {
|
|
387
|
-
if (name.trim() === "") return "Please enter a project name.";
|
|
388
|
+
if (name === void 0 || name.trim() === "") return "Please enter a project name.";
|
|
388
389
|
if (name === ".") return void 0;
|
|
389
390
|
if (!/^[a-z0-9._-]+$/i.test(name)) return "Use letters, numbers, dots, dashes, and underscores only.";
|
|
390
391
|
if (name.startsWith(".")) return "Name cannot start with a dot.";
|
|
@@ -653,6 +654,7 @@ const baseline = {
|
|
|
653
654
|
dev: "vite",
|
|
654
655
|
build: "tsc -b && vite build",
|
|
655
656
|
preview: "vite preview",
|
|
657
|
+
typecheck: "tsc --noEmit",
|
|
656
658
|
lint: "oxlint",
|
|
657
659
|
format: "oxfmt",
|
|
658
660
|
"format:check": "oxfmt --check",
|
|
@@ -9,6 +9,7 @@ Brewed with [create-chanom-app](https://github.com/peeranat-dan/chanom).
|
|
|
9
9
|
| `pnpm dev` | Start the Vite dev server |
|
|
10
10
|
| `pnpm build` | Type-check, then build for production |
|
|
11
11
|
| `pnpm preview` | Preview the production build |
|
|
12
|
+
| `pnpm typecheck` | Type-check the project |
|
|
12
13
|
| `pnpm lint` | Lint with oxlint |
|
|
13
14
|
| `pnpm format` | Format with oxfmt |
|
|
14
15
|
| `pnpm format:check` | Check formatting without writing |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-chanom-app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Scaffold a Vite + React + TypeScript app, wired to the chanom shared configs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"create",
|
|
@@ -50,6 +50,7 @@
|
|
|
50
50
|
"dev": "tsdown --watch",
|
|
51
51
|
"test": "vitest run",
|
|
52
52
|
"test:coverage": "vitest run --coverage",
|
|
53
|
-
"test:watch": "vitest"
|
|
53
|
+
"test:watch": "vitest",
|
|
54
|
+
"typecheck": "tsc --noEmit"
|
|
54
55
|
}
|
|
55
56
|
}
|