spec-snake 0.0.1-beta.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.ja.md +333 -0
- package/README.md +335 -0
- package/dist/cli.js +783 -0
- package/dist/cli.js.map +7 -0
- package/dist/client/assets/ChevronRightIcon-BcBiiChF.js +1 -0
- package/dist/client/assets/DocumentIcon-jB6zASay.js +1 -0
- package/dist/client/assets/Header-DN39nNWE.js +1 -0
- package/dist/client/assets/PlusIcon-DqYOBije.js +1 -0
- package/dist/client/assets/index-CSjjObwb.css +1 -0
- package/dist/client/assets/index-CT_VQ59w.js +1 -0
- package/dist/client/assets/index-D6usLrOW.js +26 -0
- package/dist/client/assets/index-DQxQHK-0.js +1 -0
- package/dist/client/assets/index-DYnzYTb1.js +1 -0
- package/dist/client/assets/index-Q_AobJB0.js +1 -0
- package/dist/client/assets/index-pyqED_5G.js +1 -0
- package/dist/client/assets/useStepFormStore-CBcs2c-9.js +41 -0
- package/dist/client/index.html +13 -0
- package/dist/types.d.ts +848 -0
- package/dist/types.js +99 -0
- package/package.json +85 -0
package/dist/types.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Core type definitions for spec-snake
|
|
3
|
+
*
|
|
4
|
+
* This module defines all TypeScript types used throughout the application,
|
|
5
|
+
* including form fields, sections, steps, scenarios, and configuration.
|
|
6
|
+
*
|
|
7
|
+
* @module types
|
|
8
|
+
*/
|
|
9
|
+
// =============================================================================
|
|
10
|
+
// Helper Functions
|
|
11
|
+
// =============================================================================
|
|
12
|
+
/**
|
|
13
|
+
* Helper function to define a scenario with type-safe formData
|
|
14
|
+
*
|
|
15
|
+
* This function uses TypeScript's const type parameters to infer
|
|
16
|
+
* literal types from the steps array, enabling type-safe access
|
|
17
|
+
* to formData in hooks, prompts, and overrides.
|
|
18
|
+
*
|
|
19
|
+
* **Usage**: Define your steps with `as const satisfies Step[]` for best results.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* import { defineScenario, type Step, type Config } from '@cut0/spec-snake';
|
|
24
|
+
*
|
|
25
|
+
* const steps = [
|
|
26
|
+
* {
|
|
27
|
+
* slug: 'basic-info',
|
|
28
|
+
* title: 'Basic Info',
|
|
29
|
+
* description: 'Enter basic information',
|
|
30
|
+
* section: {
|
|
31
|
+
* type: 'single',
|
|
32
|
+
* name: 'basicInfo',
|
|
33
|
+
* fields: [
|
|
34
|
+
* { id: 'projectName', type: 'input', label: 'Project Name', description: '' },
|
|
35
|
+
* { id: 'overview', type: 'textarea', label: 'Overview', description: '' },
|
|
36
|
+
* ],
|
|
37
|
+
* },
|
|
38
|
+
* },
|
|
39
|
+
* {
|
|
40
|
+
* slug: 'features',
|
|
41
|
+
* title: 'Features',
|
|
42
|
+
* description: 'List features',
|
|
43
|
+
* section: {
|
|
44
|
+
* type: 'array',
|
|
45
|
+
* name: 'features',
|
|
46
|
+
* fields: [
|
|
47
|
+
* { id: 'name', type: 'input', label: 'Feature Name', description: '' },
|
|
48
|
+
* ],
|
|
49
|
+
* },
|
|
50
|
+
* },
|
|
51
|
+
* ] as const satisfies Step[];
|
|
52
|
+
*
|
|
53
|
+
* const scenario = defineScenario({
|
|
54
|
+
* id: 'my-scenario',
|
|
55
|
+
* name: 'My Scenario',
|
|
56
|
+
* steps,
|
|
57
|
+
* prompt: '...',
|
|
58
|
+
* outputDir: 'docs',
|
|
59
|
+
* overrides: {
|
|
60
|
+
* filename: ({ formData }) => {
|
|
61
|
+
* // formData is now type-safe!
|
|
62
|
+
* // formData.basicInfo?.projectName is typed as string | undefined
|
|
63
|
+
* return `${formData.basicInfo?.projectName ?? 'untitled'}.md`;
|
|
64
|
+
* },
|
|
65
|
+
* },
|
|
66
|
+
* });
|
|
67
|
+
*
|
|
68
|
+
* const config: Config = {
|
|
69
|
+
* scenarios: [scenario],
|
|
70
|
+
* permissions: { allowSave: true },
|
|
71
|
+
* };
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export function defineScenario(scenario) {
|
|
75
|
+
return scenario;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Helper function to define a config object
|
|
79
|
+
*
|
|
80
|
+
* This is a simple identity function that provides better type inference
|
|
81
|
+
* and editor support when defining config files.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* import { defineConfig, defineScenario } from '@cut0/spec-snake';
|
|
86
|
+
*
|
|
87
|
+
* export default defineConfig({
|
|
88
|
+
* scenarios: [
|
|
89
|
+
* defineScenario({ ... }),
|
|
90
|
+
* ],
|
|
91
|
+
* permissions: {
|
|
92
|
+
* allowSave: true,
|
|
93
|
+
* },
|
|
94
|
+
* });
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
export function defineConfig(config) {
|
|
98
|
+
return config;
|
|
99
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "spec-snake",
|
|
3
|
+
"version": "0.0.1-beta.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/cut0/spec-snake.git"
|
|
8
|
+
},
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"types": "./dist/types.d.ts",
|
|
13
|
+
"main": "./dist/types.js",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/types.d.ts",
|
|
17
|
+
"import": "./dist/types.js",
|
|
18
|
+
"default": "./dist/types.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"bin": {
|
|
22
|
+
"spec-snake": "./dist/cli.js"
|
|
23
|
+
},
|
|
24
|
+
"files": ["dist"],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "pnpm build:types && pnpm build:cli && pnpm build:client",
|
|
27
|
+
"build:cli": "tsx scripts/build-cli.ts",
|
|
28
|
+
"build:client": "vite build",
|
|
29
|
+
"build:types": "tsc src/types.ts --declaration --outDir dist --skipLibCheck --module ESNext --moduleResolution bundler --target ES2022",
|
|
30
|
+
"dev": "NODE_ENV=development SPEC_SNAKE_CONFIG=examples/spec-snake.ts vite",
|
|
31
|
+
"prd": "pnpm build && pnpm build:client && node dist/cli.js",
|
|
32
|
+
"i18n": "lingui extract && lingui compile",
|
|
33
|
+
"i18n:compile": "lingui compile",
|
|
34
|
+
"i18n:extract": "lingui extract",
|
|
35
|
+
"lint:check": "biome check .",
|
|
36
|
+
"lint:fix": "biome check --write .",
|
|
37
|
+
"typecheck": "tsc --noEmit",
|
|
38
|
+
"prepublishOnly": "pnpm build",
|
|
39
|
+
"release": "pnpm build && changeset publish"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@anthropic-ai/claude-agent-sdk": "0.1.75",
|
|
43
|
+
"@hono/node-server": "1.19.7",
|
|
44
|
+
"citty": "0.1.6",
|
|
45
|
+
"consola": "3.4.2",
|
|
46
|
+
"hono": "4.11.1",
|
|
47
|
+
"jiti": "2.6.1",
|
|
48
|
+
"valibot": "1.2.0"
|
|
49
|
+
},
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"@base-ui/react": "1.0.0",
|
|
52
|
+
"@biomejs/biome": "1.9.4",
|
|
53
|
+
"@changesets/cli": "2.28.1",
|
|
54
|
+
"@hono/vite-dev-server": "0.23.0",
|
|
55
|
+
"@hookform/resolvers": "5.2.2",
|
|
56
|
+
"@lingui/babel-plugin-lingui-macro": "5.7.0",
|
|
57
|
+
"@lingui/cli": "5.7.0",
|
|
58
|
+
"@lingui/conf": "5.7.0",
|
|
59
|
+
"@lingui/core": "5.7.0",
|
|
60
|
+
"@lingui/react": "5.7.0",
|
|
61
|
+
"@lingui/vite-plugin": "5.7.0",
|
|
62
|
+
"@tailwindcss/typography": "0.5.19",
|
|
63
|
+
"@tailwindcss/vite": "4.1.18",
|
|
64
|
+
"@tanstack/react-query": "5.35.1",
|
|
65
|
+
"@tanstack/react-router": "1.141.6",
|
|
66
|
+
"@tanstack/router-plugin": "1.141.7",
|
|
67
|
+
"@types/node": "^25.0.3",
|
|
68
|
+
"@types/react": "19.1.8",
|
|
69
|
+
"@types/react-dom": "19.1.6",
|
|
70
|
+
"@vitejs/plugin-react": "4.5.2",
|
|
71
|
+
"esbuild": "0.27.2",
|
|
72
|
+
"motion": "12.23.26",
|
|
73
|
+
"react": "19.2.3",
|
|
74
|
+
"react-dom": "19.2.3",
|
|
75
|
+
"react-hook-form": "7.69.0",
|
|
76
|
+
"react-markdown": "10.1.0",
|
|
77
|
+
"remark-gfm": "4.0.1",
|
|
78
|
+
"tailwindcss": "4.1.18",
|
|
79
|
+
"tsx": "4.20.6",
|
|
80
|
+
"typescript": "5.8.3",
|
|
81
|
+
"vite": "7.3.0",
|
|
82
|
+
"zustand": "5.0.9"
|
|
83
|
+
},
|
|
84
|
+
"packageManager": "pnpm@10.26.2"
|
|
85
|
+
}
|