create-avalon 0.1.8 → 0.1.10
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 +59 -59
- package/dist/cli.js +43 -41
- package/package.json +13 -3
package/README.md
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
# create-avalon
|
|
2
|
-
|
|
3
|
-
Scaffold a new [Avalon](https://useavalon.dev) project in seconds.
|
|
4
|
-
|
|
5
|
-
## Usage
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm create avalon@latest
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
Or with other package managers:
|
|
12
|
-
|
|
13
|
-
```bash
|
|
14
|
-
pnpm create avalon@latest
|
|
15
|
-
yarn create avalon
|
|
16
|
-
bun create avalon
|
|
17
|
-
```
|
|
18
|
-
|
|
19
|
-
The CLI walks you through:
|
|
20
|
-
|
|
21
|
-
- Project name and directory
|
|
22
|
-
- Framework selection (React, Preact, Vue, Svelte, Solid, Lit, Qwik — or multiple)
|
|
23
|
-
- Styling approach (CSS Modules, Tailwind, vanilla CSS)
|
|
24
|
-
- Optional features (API routes, middleware, layouts, MDX)
|
|
25
|
-
- Package manager preference
|
|
26
|
-
|
|
27
|
-
## What you get
|
|
28
|
-
|
|
29
|
-
A ready-to-run Avalon project with file-system routing, islands architecture, and zero JavaScript by default.
|
|
30
|
-
|
|
31
|
-
```
|
|
32
|
-
my-project/
|
|
33
|
-
├── app/
|
|
34
|
-
│ ├── modules/
|
|
35
|
-
│ │ └── home/
|
|
36
|
-
│ │ ├── pages/ # File-system routes
|
|
37
|
-
│ │ ├── components/ # Interactive components
|
|
38
|
-
│ │ └── layouts/ # Module layouts
|
|
39
|
-
│ └── shared/
|
|
40
|
-
│ ├── layouts/ # Root layout
|
|
41
|
-
│ ├── components/ # Shared components
|
|
42
|
-
│ └── styles/ # Global styles & tokens
|
|
43
|
-
├── middleware/ # Server middleware
|
|
44
|
-
├── routes/
|
|
45
|
-
│ └── api/ # API routes
|
|
46
|
-
├── server/ # Server config & env
|
|
47
|
-
├── public/ # Static assets
|
|
48
|
-
├── vite.config.ts
|
|
49
|
-
└── package.json
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
## Links
|
|
53
|
-
|
|
54
|
-
- [Documentation](https://useavalon.dev/docs/introduction)
|
|
55
|
-
- [GitHub](https://github.com/useAvalon/Avalon)
|
|
56
|
-
|
|
57
|
-
## License
|
|
58
|
-
|
|
59
|
-
MIT
|
|
1
|
+
# create-avalon
|
|
2
|
+
|
|
3
|
+
Scaffold a new [Avalon](https://useavalon.dev) project in seconds.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm create avalon@latest
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
Or with other package managers:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pnpm create avalon@latest
|
|
15
|
+
yarn create avalon
|
|
16
|
+
bun create avalon
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The CLI walks you through:
|
|
20
|
+
|
|
21
|
+
- Project name and directory
|
|
22
|
+
- Framework selection (React, Preact, Vue, Svelte, Solid, Lit, Qwik — or multiple)
|
|
23
|
+
- Styling approach (CSS Modules, Tailwind, vanilla CSS)
|
|
24
|
+
- Optional features (API routes, middleware, layouts, MDX)
|
|
25
|
+
- Package manager preference
|
|
26
|
+
|
|
27
|
+
## What you get
|
|
28
|
+
|
|
29
|
+
A ready-to-run Avalon project with file-system routing, islands architecture, and zero JavaScript by default.
|
|
30
|
+
|
|
31
|
+
```
|
|
32
|
+
my-project/
|
|
33
|
+
├── app/
|
|
34
|
+
│ ├── modules/
|
|
35
|
+
│ │ └── home/
|
|
36
|
+
│ │ ├── pages/ # File-system routes
|
|
37
|
+
│ │ ├── components/ # Interactive components
|
|
38
|
+
│ │ └── layouts/ # Module layouts
|
|
39
|
+
│ └── shared/
|
|
40
|
+
│ ├── layouts/ # Root layout
|
|
41
|
+
│ ├── components/ # Shared components
|
|
42
|
+
│ └── styles/ # Global styles & tokens
|
|
43
|
+
├── middleware/ # Server middleware
|
|
44
|
+
├── routes/
|
|
45
|
+
│ └── api/ # API routes
|
|
46
|
+
├── server/ # Server config & env
|
|
47
|
+
├── public/ # Static assets
|
|
48
|
+
├── vite.config.ts
|
|
49
|
+
└── package.json
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Links
|
|
53
|
+
|
|
54
|
+
- [Documentation](https://useavalon.dev/docs/introduction)
|
|
55
|
+
- [GitHub](https://github.com/useAvalon/Avalon)
|
|
56
|
+
|
|
57
|
+
## License
|
|
58
|
+
|
|
59
|
+
MIT
|
package/dist/cli.js
CHANGED
|
@@ -76,11 +76,42 @@ var require_src = __commonJS((exports, module) => {
|
|
|
76
76
|
});
|
|
77
77
|
|
|
78
78
|
// src/cli.ts
|
|
79
|
-
import { parseArgs } from "node:util";
|
|
80
|
-
import { existsSync, readdirSync } from "node:fs";
|
|
81
79
|
import { basename, resolve } from "node:path";
|
|
82
80
|
import { createRequire } from "node:module";
|
|
83
81
|
|
|
82
|
+
// src/cli-utils.ts
|
|
83
|
+
import { parseArgs } from "node:util";
|
|
84
|
+
import { existsSync, readdirSync } from "node:fs";
|
|
85
|
+
function validateDirectory(dir) {
|
|
86
|
+
if (!existsSync(dir)) {
|
|
87
|
+
return { valid: true };
|
|
88
|
+
}
|
|
89
|
+
const entries = readdirSync(dir);
|
|
90
|
+
if (entries.length === 0) {
|
|
91
|
+
return { valid: true };
|
|
92
|
+
}
|
|
93
|
+
return {
|
|
94
|
+
valid: false,
|
|
95
|
+
error: `Directory "${dir}" already exists and is not empty.`
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
function parseCliArgs(argv) {
|
|
99
|
+
const { values, positionals } = parseArgs({
|
|
100
|
+
args: argv,
|
|
101
|
+
options: {
|
|
102
|
+
help: { type: "boolean", default: false, short: "h" },
|
|
103
|
+
version: { type: "boolean", default: false, short: "v" }
|
|
104
|
+
},
|
|
105
|
+
strict: true,
|
|
106
|
+
allowPositionals: true
|
|
107
|
+
});
|
|
108
|
+
return {
|
|
109
|
+
projectName: positionals[0] ?? undefined,
|
|
110
|
+
help: values.help ?? false,
|
|
111
|
+
version: values.version ?? false
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
84
115
|
// ../../node_modules/.bun/@clack+core@1.1.0/node_modules/@clack/core/dist/index.mjs
|
|
85
116
|
import { styleText as D } from "node:util";
|
|
86
117
|
import { stdout as R, stdin as q } from "node:process";
|
|
@@ -1125,7 +1156,12 @@ async function collectProjectConfig(initialName) {
|
|
|
1125
1156
|
const pluginsResult = await Lt2({
|
|
1126
1157
|
message: "Which plugins would you like to include? (use space to toggle, enter to confirm)",
|
|
1127
1158
|
options: [
|
|
1128
|
-
{ value: "agent-optimization", label: "agent-optimization", hint: "LLM/AI optimization" }
|
|
1159
|
+
{ value: "agent-optimization", label: "agent-optimization", hint: "LLM/AI optimization" },
|
|
1160
|
+
{
|
|
1161
|
+
value: "syntax-highlighting",
|
|
1162
|
+
label: "syntax-highlighting",
|
|
1163
|
+
hint: "Code block highlighting for MDX (rehype-highlight)"
|
|
1164
|
+
}
|
|
1129
1165
|
],
|
|
1130
1166
|
required: false
|
|
1131
1167
|
});
|
|
@@ -1192,6 +1228,9 @@ function generatePackageJson(config) {
|
|
|
1192
1228
|
if (config.plugins.includes("agent-optimization")) {
|
|
1193
1229
|
dependencies["@useavalon/agent-optimization"] = "latest";
|
|
1194
1230
|
}
|
|
1231
|
+
if (config.plugins.includes("syntax-highlighting")) {
|
|
1232
|
+
dependencies["rehype-highlight"] = "latest";
|
|
1233
|
+
}
|
|
1195
1234
|
switch (config.middleware) {
|
|
1196
1235
|
case "hono":
|
|
1197
1236
|
dependencies["hono"] = "latest";
|
|
@@ -1719,35 +1758,6 @@ function printSummary(config, scaffoldedInPlace = false) {
|
|
|
1719
1758
|
}
|
|
1720
1759
|
|
|
1721
1760
|
// src/cli.ts
|
|
1722
|
-
function validateDirectory(dir) {
|
|
1723
|
-
if (!existsSync(dir)) {
|
|
1724
|
-
return { valid: true };
|
|
1725
|
-
}
|
|
1726
|
-
const entries = readdirSync(dir);
|
|
1727
|
-
if (entries.length === 0) {
|
|
1728
|
-
return { valid: true };
|
|
1729
|
-
}
|
|
1730
|
-
return {
|
|
1731
|
-
valid: false,
|
|
1732
|
-
error: `Directory "${dir}" already exists and is not empty.`
|
|
1733
|
-
};
|
|
1734
|
-
}
|
|
1735
|
-
function parseCliArgs(argv) {
|
|
1736
|
-
const { values, positionals } = parseArgs({
|
|
1737
|
-
args: argv,
|
|
1738
|
-
options: {
|
|
1739
|
-
help: { type: "boolean", default: false, short: "h" },
|
|
1740
|
-
version: { type: "boolean", default: false, short: "v" }
|
|
1741
|
-
},
|
|
1742
|
-
strict: true,
|
|
1743
|
-
allowPositionals: true
|
|
1744
|
-
});
|
|
1745
|
-
return {
|
|
1746
|
-
projectName: positionals[0] ?? undefined,
|
|
1747
|
-
help: values.help ?? false,
|
|
1748
|
-
version: values.version ?? false
|
|
1749
|
-
};
|
|
1750
|
-
}
|
|
1751
1761
|
async function main() {
|
|
1752
1762
|
const args = parseCliArgs(process.argv.slice(2));
|
|
1753
1763
|
if (args.version) {
|
|
@@ -1788,12 +1798,4 @@ Options:
|
|
|
1788
1798
|
printSummary(config, scaffoldedInPlace);
|
|
1789
1799
|
process.exit(0);
|
|
1790
1800
|
}
|
|
1791
|
-
|
|
1792
|
-
if (process.argv[1] && entryPath === process.argv[1]) {
|
|
1793
|
-
main();
|
|
1794
|
-
}
|
|
1795
|
-
export {
|
|
1796
|
-
validateDirectory,
|
|
1797
|
-
parseCliArgs,
|
|
1798
|
-
main
|
|
1799
|
-
};
|
|
1801
|
+
main();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-avalon",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "Scaffold a new Avalon project with multi-framework islands architecture",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -10,11 +10,21 @@
|
|
|
10
10
|
"directory": "packages/create-avalon"
|
|
11
11
|
},
|
|
12
12
|
"homepage": "https://useavalon.dev",
|
|
13
|
-
"keywords": [
|
|
13
|
+
"keywords": [
|
|
14
|
+
"avalon",
|
|
15
|
+
"create",
|
|
16
|
+
"scaffold",
|
|
17
|
+
"cli",
|
|
18
|
+
"islands",
|
|
19
|
+
"vite"
|
|
20
|
+
],
|
|
14
21
|
"bin": {
|
|
15
22
|
"create-avalon": "dist/cli.js"
|
|
16
23
|
},
|
|
17
|
-
"files": [
|
|
24
|
+
"files": [
|
|
25
|
+
"dist",
|
|
26
|
+
"README.md"
|
|
27
|
+
],
|
|
18
28
|
"scripts": {
|
|
19
29
|
"build": "bun build src/cli.ts --outdir dist --target node --format esm",
|
|
20
30
|
"prepublishOnly": "bun run build"
|