create-minista 4.0.11 → 5.0.0-alpha.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.
Files changed (71) hide show
  1. package/README.md +21 -7
  2. package/agents/bootstrap.md +10 -0
  3. package/package.json +4 -3
  4. package/src/agents.js +15 -0
  5. package/src/index.js +34 -10
  6. package/templates/basic-js/_gitignore +7 -0
  7. package/templates/basic-js/package.json +19 -0
  8. package/templates/basic-js/project.json +21 -0
  9. package/templates/basic-js/public/favicon.png +0 -0
  10. package/templates/basic-js/src/assets/entries/scripts.js +3 -0
  11. package/templates/basic-js/src/assets/images/icon.svg +1 -0
  12. package/templates/basic-js/src/components/footer/index.jsx +13 -0
  13. package/templates/basic-js/src/components/footer/style.module.css +9 -0
  14. package/templates/basic-js/src/components/header/index.jsx +15 -0
  15. package/templates/basic-js/src/components/header/style.module.css +15 -0
  16. package/templates/basic-js/src/components/nav/index.jsx +22 -0
  17. package/templates/basic-js/src/components/nav/style.module.css +16 -0
  18. package/templates/basic-js/src/layouts/index.jsx +31 -0
  19. package/templates/basic-js/src/layouts/style.css +33 -0
  20. package/templates/basic-js/src/pages/about.jsx +17 -0
  21. package/templates/basic-js/src/pages/index.jsx +17 -0
  22. package/templates/basic-js/src/pages/nest/page-1.md +10 -0
  23. package/templates/basic-js/src/pages/nest/page-2.mdx +10 -0
  24. package/templates/basic-js/vite.config.js +8 -0
  25. package/templates/basic-ts/.minista/diagnostics.json +16 -0
  26. package/templates/basic-ts/.minista/manifest.json +337 -0
  27. package/templates/basic-ts/_gitignore +7 -0
  28. package/templates/basic-ts/dist/about.html +1 -0
  29. package/templates/basic-ts/dist/assets/bundle-D116MDVJ.css +1 -0
  30. package/templates/basic-ts/dist/assets/icon-EK5G3fti.svg +1 -0
  31. package/templates/basic-ts/dist/assets/scripts-CN8bi563.js +1 -0
  32. package/templates/basic-ts/dist/favicon.png +0 -0
  33. package/templates/basic-ts/dist/index.html +1 -0
  34. package/templates/basic-ts/dist/nest/page-1.html +3 -0
  35. package/templates/basic-ts/dist/nest/page-2.html +3 -0
  36. package/templates/basic-ts/node_modules/.minista/glob/__minista-ssg.js +3 -0
  37. package/templates/basic-ts/node_modules/.minista/ssr/__minista-ssg.mjs +232 -0
  38. package/templates/basic-ts/node_modules/.minista/ssr/assets/bundle-D116MDVJ.css +1 -0
  39. package/templates/basic-ts/node_modules/.minista/ssr/assets/icon-EK5G3fti.svg +1 -0
  40. package/templates/basic-ts/node_modules/.minista/ssr/favicon.png +0 -0
  41. package/templates/basic-ts/node_modules/.minista/through/__minista-ssg.js +1 -0
  42. package/templates/basic-ts/node_modules/.vite/deps/_metadata.json +8 -0
  43. package/templates/basic-ts/node_modules/.vite/deps/package.json +3 -0
  44. package/templates/basic-ts/package.json +23 -0
  45. package/templates/basic-ts/project.json +21 -0
  46. package/templates/basic-ts/public/favicon.png +0 -0
  47. package/templates/basic-ts/src/assets/entries/scripts.ts +3 -0
  48. package/templates/basic-ts/src/assets/images/icon.svg +1 -0
  49. package/templates/basic-ts/src/components/footer/index.tsx +12 -0
  50. package/templates/basic-ts/src/components/footer/style.module.css +9 -0
  51. package/templates/basic-ts/src/components/header/index.tsx +18 -0
  52. package/templates/basic-ts/src/components/header/style.module.css +15 -0
  53. package/templates/basic-ts/src/components/nav/index.tsx +24 -0
  54. package/templates/basic-ts/src/components/nav/style.module.css +16 -0
  55. package/templates/basic-ts/src/layouts/index.tsx +32 -0
  56. package/templates/basic-ts/src/layouts/style.css +33 -0
  57. package/templates/basic-ts/src/pages/about.tsx +17 -0
  58. package/templates/basic-ts/src/pages/index.tsx +17 -0
  59. package/templates/basic-ts/src/pages/nest/page-1.md +10 -0
  60. package/templates/basic-ts/src/pages/nest/page-2.mdx +10 -0
  61. package/templates/basic-ts/tsconfig.json +14 -0
  62. package/templates/basic-ts/vite.config.ts +8 -0
  63. package/templates/minimal-js/_gitignore +1 -0
  64. package/templates/minimal-js/package.json +7 -4
  65. package/templates/minimal-ts/_gitignore +1 -0
  66. package/templates/minimal-ts/node_modules/.minista/glob/__minista-ssg.js +3 -0
  67. package/templates/minimal-ts/node_modules/.vite/deps/_metadata.json +15 -0
  68. package/templates/minimal-ts/node_modules/.vite/deps/package.json +3 -0
  69. package/templates/minimal-ts/node_modules/.vite/deps/react_jsx-dev-runtime.js +968 -0
  70. package/templates/minimal-ts/node_modules/.vite/deps/react_jsx-dev-runtime.js.map +1 -0
  71. package/templates/minimal-ts/package.json +10 -7
package/README.md CHANGED
@@ -2,22 +2,24 @@
2
2
 
3
3
  ## About
4
4
 
5
- 簡単なコマンド入力で[minista](https://minista.qranoko.jp/)のプロジェクトを開始できます。
5
+ Start a [minista](https://minista.qranoko.jp/) project with a simple command.
6
6
 
7
7
  ## How To Use
8
8
 
9
9
  ```sh
10
10
  # Interactive
11
- $ npm create minista@latest
11
+ npm create minista@latest
12
12
 
13
13
  # Shortcut
14
- $ npm create minista@latest my-minista-project -- --template minimal-ts
14
+ npm create minista@latest my-minista-project -- --template minimal-ts
15
15
  ```
16
16
 
17
- |テンプレート|内容 |
18
- | ------------ | ------------------------------- |
19
- | `minimal-js` | JavaScriptを使った最低限の構成|
20
- | `minimal-ts` | TypeScriptを使った最低限の構成|
17
+ | Template | Description |
18
+ | ------------ | ----------------------------- |
19
+ | `basic-js` | Basic setup with JavaScript |
20
+ | `basic-ts` | Basic setup with TypeScript |
21
+ | `minimal-js` | Minimal setup with JavaScript |
22
+ | `minimal-ts` | Minimal setup with TypeScript |
21
23
 
22
24
  ## License
23
25
 
@@ -27,3 +29,15 @@ $ npm create minista@latest my-minista-project -- --template minimal-ts
27
29
 
28
30
  - Author: [Qrac](https://qrac.jp)
29
31
  - Organization: [QRANOKO](https://qranoko.jp)
32
+
33
+ ## Agent Guide
34
+
35
+ Every template creates a short `AGENTS.md` that points to `npx --no-install minista agents`.
36
+
37
+ Existing instructions are preserved. After installation, run the following command to add or update only the minista block:
38
+
39
+ ```sh
40
+ npx --no-install minista agents --write
41
+ ```
42
+
43
+ The detailed guide is included with the installed version of minista.
@@ -0,0 +1,10 @@
1
+ <!-- minista:agents:start -->
2
+ ## minista
3
+
4
+ Before changing minista configuration, routes, pages, layouts, plugins, or build behavior,
5
+ run `npx --no-install minista agents` to read the guide shipped with the installed version.
6
+ Run `npx --no-install minista agents --json` to locate generated workspace metadata.
7
+ Use `npx --no-install minista inspect --manifest --json` to inspect the last build;
8
+ use `check --json` or `inspect --json` when current source analysis is needed.
9
+ Generated metadata may be stale. Do not edit generated workspace files manually.
10
+ <!-- minista:agents:end -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-minista",
3
- "version": "4.0.11",
3
+ "version": "5.0.0-alpha.0",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "create-minista": "./bin/create-minista.js"
@@ -8,7 +8,8 @@
8
8
  "files": [
9
9
  "bin",
10
10
  "src",
11
- "templates"
11
+ "templates",
12
+ "agents"
12
13
  ],
13
14
  "license": "MIT",
14
15
  "homepage": "https://minista.qranoko.jp",
@@ -28,7 +29,7 @@
28
29
  "minista"
29
30
  ],
30
31
  "engines": {
31
- "node": ">=20.0.0"
32
+ "node": "^20.19.0 || >=22.12.0"
32
33
  },
33
34
  "dependencies": {
34
35
  "cac": "^7.0.0",
package/src/agents.js ADDED
@@ -0,0 +1,15 @@
1
+ import fs from "node:fs/promises"
2
+ import path from "node:path"
3
+
4
+ /** Seed every template with the same entry point, retaining existing instructions.
5
+ * @param {string} root
6
+ */
7
+ export async function writeAgentBootstrap(root) {
8
+ const block = await fs.readFile(new URL("../agents/bootstrap.md", import.meta.url), "utf8")
9
+ try {
10
+ await fs.writeFile(path.join(root, "AGENTS.md"), block, { encoding: "utf8", flag: "wx" })
11
+ } catch (error) {
12
+ if (!error || typeof error !== "object" || Reflect.get(error, "code") !== "EEXIST") throw error
13
+ console.log("AGENTS.md preserved. Run npx --no-install minista agents --write after installation to add the minista guide.")
14
+ }
15
+ }
package/src/index.js CHANGED
@@ -9,13 +9,24 @@ import path from "node:path"
9
9
  import pc from "picocolors"
10
10
  import { cac } from "cac"
11
11
  import prompts from "prompts"
12
+ import { writeAgentBootstrap } from "./agents.js"
12
13
 
13
14
  /** @type {{ title: string, value: string }[]} */
14
15
  const TEMPLATES = [
15
- { title: "Minimal (JavaScript)", value: "minimal-js" },
16
- { title: "Minimal (Typescript)", value: "minimal-ts" },
16
+ { title: "Basic", value: "basic" },
17
+ { title: "Minimal", value: "minimal" },
17
18
  ]
18
19
 
20
+ /** @type {{ title: string, value: string }[]} */
21
+ const LANGUAGES = [
22
+ { title: "TypeScript", value: "ts" },
23
+ { title: "JavaScript", value: "js" },
24
+ ]
25
+
26
+ const TEMPLATE_NAMES = TEMPLATES.flatMap((template) =>
27
+ LANGUAGES.map((language) => `${template.value}-${language.value}`),
28
+ )
29
+
19
30
  /**
20
31
  * @returns {string}
21
32
  */
@@ -51,7 +62,7 @@ function resolveTemplateDir(template) {
51
62
  * @returns {boolean}
52
63
  */
53
64
  function hasTemplate(template) {
54
- return TEMPLATES.some((item) => item.value === template)
65
+ return TEMPLATE_NAMES.includes(template)
55
66
  }
56
67
 
57
68
  /**
@@ -90,6 +101,12 @@ async function main(root, options) {
90
101
  message: "Which template would you like to use?",
91
102
  choices: TEMPLATES,
92
103
  },
104
+ language: {
105
+ type: "select",
106
+ name: "language",
107
+ message: "Which language would you like to use?",
108
+ choices: LANGUAGES,
109
+ },
93
110
  }
94
111
 
95
112
  if (fs.existsSync(cwd)) {
@@ -102,19 +119,25 @@ async function main(root, options) {
102
119
  if (!current) mkdirp(cwd)
103
120
  }
104
121
 
105
- const configs = template
106
- ? { template }
107
- : /** @type {{ template: string }} */ (await prompts(questions.template))
122
+ let selectedTemplate = template
123
+ if (!selectedTemplate) {
124
+ const answers = /** @type {{ template?: string, language?: string }} */ (
125
+ await prompts([questions.template, questions.language], {
126
+ onCancel: () => process.exit(1),
127
+ })
128
+ )
129
+ selectedTemplate = `${answers.template}-${answers.language}`
130
+ }
108
131
 
109
- if (!hasTemplate(configs.template)) {
110
- console.error(pc.red(`Unknown template: ${configs.template}`))
132
+ if (!hasTemplate(selectedTemplate)) {
133
+ console.error(pc.red(`Unknown template: ${selectedTemplate}`))
111
134
  console.error(
112
- pc.gray(`Available templates: ${TEMPLATES.map((item) => item.value).join(", ")}`),
135
+ pc.gray(`Available templates: ${TEMPLATE_NAMES.join(", ")}`),
113
136
  )
114
137
  process.exit(1)
115
138
  }
116
139
 
117
- const templateDir = resolveTemplateDir(configs.template)
140
+ const templateDir = resolveTemplateDir(selectedTemplate)
118
141
 
119
142
  try {
120
143
  console.log(`${pc.green(">")} ${pc.gray("Copying project files...")}`)
@@ -124,6 +147,7 @@ async function main(root, options) {
124
147
  errorOnExist: false,
125
148
  })
126
149
  await renameGitignore(cwd)
150
+ await writeAgentBootstrap(cwd)
127
151
  } catch (err) {
128
152
  console.error(
129
153
  pc.red(err instanceof Error && err.message ? err.message : String(err)),
@@ -0,0 +1,7 @@
1
+ .DS_Store
2
+ Thumbs.db
3
+ db.json
4
+ *.log
5
+ node_modules
6
+ dist
7
+ .minista
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "minista-project",
3
+ "private": true,
4
+ "type": "module",
5
+ "engines": {
6
+ "node": "^20.19.0 || >=22.12.0"
7
+ },
8
+ "scripts": {
9
+ "dev": "minista",
10
+ "build": "minista build",
11
+ "preview": "minista preview"
12
+ },
13
+ "devDependencies": {
14
+ "minista": "^5.0.0-alpha.0",
15
+ "react": "^19.3.0",
16
+ "react-dom": "^19.3.0",
17
+ "vite": "^8.3.0"
18
+ }
19
+ }
@@ -0,0 +1,21 @@
1
+ {
2
+ "siteName": "minista project",
3
+ "navItems": [
4
+ {
5
+ "label": "Home",
6
+ "url": "/"
7
+ },
8
+ {
9
+ "label": "About",
10
+ "url": "/about"
11
+ },
12
+ {
13
+ "label": "Page 1",
14
+ "url": "/nest/page-1"
15
+ },
16
+ {
17
+ "label": "Page 2",
18
+ "url": "/nest/page-2"
19
+ }
20
+ ]
21
+ }
@@ -0,0 +1,3 @@
1
+ console.log("Hello!")
2
+
3
+ export {}
@@ -0,0 +1 @@
1
+ <svg viewBox="0 0 152 152" xmlns="http://www.w3.org/2000/svg"><path d="m65.34 95.32c.37-.63.56-1.7.56-2.76h-40.53c-4.28 0-7.79-3.51-7.79-7.79v-50.63c0-4.28 3.51-7.79 7.79-7.79h62.32c4.28 0 6.01 3.02 3.84 6.71l-10.94 18.6h18.07l6.3-10.7c3.89-6.61 4.11-14.23.6-20.38-3.52-6.15-10.19-9.82-17.86-9.82h-62.33c-12.89 0-23.37 10.48-23.37 23.37v50.63c0 12.89 10.48 23.37 23.37 23.37h32.43z" fill="#00c3df"/><path d="m126.63 59.45c4.28 0 7.79 3.51 7.79 7.79v50.63c0 4.28-3.51 7.79-7.79 7.79h-62.32c-4.28 0-6.01-3.02-3.84-6.71l11.57-19.68c2.17-3.69 2.17-9.74 0-13.43l-11.57-19.68c-2.17-3.69-.44-6.71 3.84-6.71zm0-15.58h-62.32c-7.67 0-14.35 3.67-17.86 9.82-3.52 6.15-3.29 13.76.6 20.38l10.88 18.49-10.88 18.49c-3.89 6.61-4.11 14.23-.6 20.38 3.52 6.15 10.19 9.82 17.86 9.82h62.32c12.89 0 23.37-10.48 23.37-23.37v-50.63c0-12.89-10.48-23.37-23.37-23.37z" fill="#fc6adf"/></svg>
@@ -0,0 +1,13 @@
1
+ import styles from "./style.module.css"
2
+
3
+ /** @param {{ siteName: string }} props */
4
+ export default function Footer({ siteName }) {
5
+ const year = new Date().getFullYear()
6
+ return (
7
+ <footer className={styles.footer}>
8
+ <p className={styles.copyright}>
9
+ © {year} {siteName}
10
+ </p>
11
+ </footer>
12
+ )
13
+ }
@@ -0,0 +1,9 @@
1
+ .footer {
2
+ padding: 32px;
3
+ }
4
+
5
+ .copyright {
6
+ margin: 0;
7
+ color: var(--theme-tx-3);
8
+ font-size: 0.875rem;
9
+ }
@@ -0,0 +1,15 @@
1
+ import Nav from "../nav"
2
+
3
+ import styles from "./style.module.css"
4
+
5
+ /** @param {{ siteName: string, currentUrl: string, navItems: { label: string, url: string }[] }} props */
6
+ export default function Header(props) {
7
+ return (
8
+ <header className={styles.header}>
9
+ <a href="/" className={styles.siteName}>
10
+ {props.siteName}
11
+ </a>
12
+ <Nav currentUrl={props.currentUrl} navItems={props.navItems} />
13
+ </header>
14
+ )
15
+ }
@@ -0,0 +1,15 @@
1
+ .header {
2
+ display: flex;
3
+ align-items: center;
4
+ gap: 1rem;
5
+ flex-wrap: wrap;
6
+ padding: 32px;
7
+ }
8
+
9
+ .siteName {
10
+ flex: 1 0;
11
+ color: var(--theme-tx-1);
12
+ font-weight: 700;
13
+ text-decoration: none;
14
+ white-space: nowrap;
15
+ }
@@ -0,0 +1,22 @@
1
+ import styles from "./style.module.css"
2
+
3
+ /** @param {{ currentUrl: string, navItems: { label: string, url: string }[] }} props */
4
+ export default function Nav(props) {
5
+ return (
6
+ <nav>
7
+ <ul className={styles.list}>
8
+ {props.navItems.map((item) => (
9
+ <li key={item.url}>
10
+ <a
11
+ className={styles.link}
12
+ href={item.url}
13
+ aria-current={props.currentUrl === item.url ? "page" : undefined}
14
+ >
15
+ {item.label}
16
+ </a>
17
+ </li>
18
+ ))}
19
+ </ul>
20
+ </nav>
21
+ )
22
+ }
@@ -0,0 +1,16 @@
1
+ .list {
2
+ display: flex;
3
+ gap: 1rem;
4
+ padding: 0;
5
+ list-style: none;
6
+ }
7
+
8
+ .link {
9
+ font-size: 0.875rem;
10
+ color: var(--theme-tx-3);
11
+ text-decoration: none;
12
+ }
13
+
14
+ .link[aria-current="page"] {
15
+ color: var(--theme-tx-1);
16
+ }
@@ -0,0 +1,31 @@
1
+ import Header from "../components/header"
2
+ import Footer from "../components/footer"
3
+ import "./style.css"
4
+
5
+ import pjt from "../../project.json"
6
+
7
+ /** @param {import("minista/types").LayoutProps} props */
8
+ export default function (props) {
9
+ const { siteName, navItems } = pjt
10
+ const title = props.title ? `${props.title} - ${siteName}` : siteName
11
+ return (
12
+ <html lang="en">
13
+ <head>
14
+ <meta charSet="utf-8" />
15
+ <meta name="viewport" content="width=device-width" />
16
+ <title>{title}</title>
17
+ <script src="/src/assets/entries/scripts.js" type="module" />
18
+ <link rel="icon" href="/favicon.png" />
19
+ </head>
20
+ <body>
21
+ <Header
22
+ siteName={siteName}
23
+ currentUrl={props.url}
24
+ navItems={navItems}
25
+ />
26
+ <main>{props.children}</main>
27
+ <Footer siteName={siteName} />
28
+ </body>
29
+ </html>
30
+ )
31
+ }
@@ -0,0 +1,33 @@
1
+ :root {
2
+ --theme-bg: #18212f;
3
+ --theme-tx-1: oklch(94% 0.02 277.99);
4
+ --theme-tx-2: oklab(83.222% -0.00085 -0.00903);
5
+ --theme-tx-3: oklab(0.56 0 -0.02);
6
+ --font-sans:
7
+ system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans",
8
+ sans-serif;
9
+ }
10
+
11
+ body {
12
+ color-scheme: dark;
13
+ display: grid;
14
+ grid-template-columns: minmax(0, 1fr);
15
+ grid-template-rows: auto 1fr auto;
16
+ min-height: 100svh;
17
+ margin: 0;
18
+ background-color: var(--theme-bg);
19
+ color: var(--theme-tx-1);
20
+ font-family: var(--font-sans);
21
+ }
22
+
23
+ main {
24
+ padding: 0 32px;
25
+ }
26
+
27
+ h1 {
28
+ color: var(--theme-tx-1);
29
+ }
30
+
31
+ p {
32
+ color: var(--theme-tx-2);
33
+ }
@@ -0,0 +1,17 @@
1
+ /** @type {import("minista/types").Metadata} */
2
+ export const metadata = {
3
+ title: "About",
4
+ draft: false, // true = Don't build the page
5
+ }
6
+
7
+ /** @param {import("minista/types").PageProps} props */
8
+ export default function (props) {
9
+ return (
10
+ <>
11
+ <h1>{props.title}</h1>
12
+ <p>
13
+ This is a sample page. You can edit this page at "src/pages/about.jsx".
14
+ </p>
15
+ </>
16
+ )
17
+ }
@@ -0,0 +1,17 @@
1
+ import icon from "../assets/images/icon.svg"
2
+
3
+ /** @type {import("minista/types").Metadata} */
4
+ export const metadata = {}
5
+
6
+ /** @param {import("minista/types").PageProps} props */
7
+ export default function (props) {
8
+ return (
9
+ <>
10
+ <h1>Hello!</h1>
11
+ <p>
12
+ This is a sample page. You can edit this page at "src/pages/index.jsx".
13
+ </p>
14
+ <img src={icon} alt="Hero" width="60" height="60" />
15
+ </>
16
+ )
17
+ }
@@ -0,0 +1,10 @@
1
+ ---
2
+ title: Page 1
3
+ draft: false
4
+ ---
5
+
6
+ # Page 1
7
+
8
+ This is a sample page. You can edit this page at "src/pages/nest/page-1.md".
9
+
10
+ You can use MDX files instead of Markdown files.
@@ -0,0 +1,10 @@
1
+ ---
2
+ title: Page 2
3
+ draft: false
4
+ ---
5
+
6
+ # {props.title}
7
+
8
+ This is a sample page. You can edit this page at "src/pages/nest/page-2.mdx".
9
+
10
+ You can also use Markdown files instead of MDX files.
@@ -0,0 +1,8 @@
1
+ import { defineConfig, pluginSsg } from "minista"
2
+
3
+ export default defineConfig({
4
+ plugins: [pluginSsg()],
5
+ build: {
6
+ assetsInlineLimit: 0,
7
+ },
8
+ })
@@ -0,0 +1,16 @@
1
+ {
2
+ "buildId": "acafc040-bf89-4827-94f7-dcdcc63d859e",
3
+ "command": "build",
4
+ "createdAt": "2026-09-06T15:58:08.264Z",
5
+ "diagnostics": [],
6
+ "generator": {
7
+ "name": "minista",
8
+ "version": "5.0.0"
9
+ },
10
+ "schemaVersion": "1",
11
+ "summary": {
12
+ "errors": 0,
13
+ "info": 0,
14
+ "warnings": 0
15
+ }
16
+ }