create-ardo 1.1.2 → 1.2.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/dist/index.js +43 -6
- package/package.json +1 -1
- package/templates/minimal/_gitignore +3 -3
- package/templates/minimal/package.json +4 -4
- package/templates/minimal/src/routes/{(docs) → guide}/_layout.tsx +6 -6
- package/templates/minimal/src/routes/index.tsx +1 -0
- package/templates/minimal/vite.config.ts +4 -3
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import fs2 from "fs";
|
|
5
5
|
import path2 from "path";
|
|
6
6
|
import prompts from "prompts";
|
|
7
|
-
import { blue, cyan, green, red, reset, yellow } from "kolorist";
|
|
7
|
+
import { blue, cyan, green, red, reset, yellow, dim } from "kolorist";
|
|
8
8
|
|
|
9
9
|
// src/scaffold.ts
|
|
10
10
|
import fs from "fs";
|
|
@@ -19,11 +19,13 @@ var templates = [
|
|
|
19
19
|
description: "Basic setup with essential files only"
|
|
20
20
|
}
|
|
21
21
|
];
|
|
22
|
-
function createProjectStructure(root, template,
|
|
22
|
+
function createProjectStructure(root, template, options) {
|
|
23
23
|
const templateDir = path.join(templatesRoot, template);
|
|
24
24
|
const vars = {
|
|
25
|
-
SITE_TITLE: siteTitle,
|
|
26
|
-
PROJECT_NAME: projectName
|
|
25
|
+
SITE_TITLE: options.siteTitle,
|
|
26
|
+
PROJECT_NAME: options.projectName,
|
|
27
|
+
TYPEDOC_CONFIG: options.typedoc ? "typedoc: true," : "// typedoc: true, // Uncomment to enable API docs",
|
|
28
|
+
GITHUB_PAGES_CONFIG: options.githubPages ? "// GitHub Pages: base path auto-detected from git remote" : "githubPages: false, // Disabled for non-GitHub Pages deployment"
|
|
27
29
|
};
|
|
28
30
|
copyDir(templateDir, root, vars);
|
|
29
31
|
}
|
|
@@ -120,6 +122,36 @@ async function main() {
|
|
|
120
122
|
name: "siteTitle",
|
|
121
123
|
message: reset("Site title:"),
|
|
122
124
|
initial: "My Documentation"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
type: "select",
|
|
128
|
+
name: "docType",
|
|
129
|
+
message: reset("What are you documenting?"),
|
|
130
|
+
choices: [
|
|
131
|
+
{
|
|
132
|
+
title: `Code library ${dim("- includes TypeDoc API generation")}`,
|
|
133
|
+
value: "library"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
title: `General documentation ${dim("- guides, manuals, etc.")}`,
|
|
137
|
+
value: "general"
|
|
138
|
+
}
|
|
139
|
+
]
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
type: "select",
|
|
143
|
+
name: "githubPages",
|
|
144
|
+
message: reset("Deploy to GitHub Pages?"),
|
|
145
|
+
choices: [
|
|
146
|
+
{
|
|
147
|
+
title: `Yes ${dim("- auto-detects base path from git remote")}`,
|
|
148
|
+
value: true
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
title: `No ${dim("- deploy to other platforms (Netlify, Vercel, etc.)")}`,
|
|
152
|
+
value: false
|
|
153
|
+
}
|
|
154
|
+
]
|
|
123
155
|
}
|
|
124
156
|
],
|
|
125
157
|
{
|
|
@@ -128,7 +160,7 @@ async function main() {
|
|
|
128
160
|
}
|
|
129
161
|
}
|
|
130
162
|
);
|
|
131
|
-
const { overwrite, template: templateChoice, siteTitle } = response;
|
|
163
|
+
const { overwrite, template: templateChoice, siteTitle, docType, githubPages } = response;
|
|
132
164
|
template = templateChoice || template || "minimal";
|
|
133
165
|
const root = path2.join(process.cwd(), targetDir);
|
|
134
166
|
if (overwrite === "yes") {
|
|
@@ -139,7 +171,12 @@ async function main() {
|
|
|
139
171
|
console.log();
|
|
140
172
|
console.log(` ${cyan("Scaffolding project in")} ${root}...`);
|
|
141
173
|
console.log();
|
|
142
|
-
createProjectStructure(root, template,
|
|
174
|
+
createProjectStructure(root, template, {
|
|
175
|
+
siteTitle,
|
|
176
|
+
projectName: targetDir,
|
|
177
|
+
typedoc: docType === "library",
|
|
178
|
+
githubPages: githubPages ?? true
|
|
179
|
+
});
|
|
143
180
|
console.log(` ${green("Done!")} Now run:`);
|
|
144
181
|
console.log();
|
|
145
182
|
if (root !== process.cwd()) {
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@ dist
|
|
|
3
3
|
.DS_Store
|
|
4
4
|
*.local
|
|
5
5
|
|
|
6
|
-
# Auto-generated by ardo (content routes derived from markdown
|
|
7
|
-
src/routes/
|
|
8
|
-
!src/routes/
|
|
6
|
+
# Auto-generated by ardo (content routes derived from markdown)
|
|
7
|
+
src/routes/guide/*.tsx
|
|
8
|
+
!src/routes/guide/_layout.tsx
|
|
9
9
|
src/routeTree.gen.ts
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@tanstack/react-router": "*",
|
|
13
13
|
"@tanstack/react-start": "*",
|
|
14
|
-
"ardo": "^1.
|
|
14
|
+
"ardo": "^1.1.1",
|
|
15
15
|
"react": "*",
|
|
16
16
|
"react-dom": "*"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
|
-
"@types/react": "^19.
|
|
20
|
-
"@types/react-dom": "^19.
|
|
21
|
-
"typescript": "^5.
|
|
19
|
+
"@types/react": "^19.2.10",
|
|
20
|
+
"@types/react-dom": "^19.2.3",
|
|
21
|
+
"typescript": "^5.9.3",
|
|
22
22
|
"vite": "^8.0.0-beta.0"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import { createFileRoute, Outlet } from '@tanstack/react-router'
|
|
2
|
-
import {
|
|
2
|
+
import { Layout } from 'ardo/theme'
|
|
3
3
|
import { PressProvider } from 'ardo/runtime'
|
|
4
4
|
import config from 'virtual:ardo/config'
|
|
5
5
|
import sidebar from 'virtual:ardo/sidebar'
|
|
6
6
|
|
|
7
|
-
export const Route = createFileRoute('/
|
|
8
|
-
component:
|
|
7
|
+
export const Route = createFileRoute('/guide/_layout')({
|
|
8
|
+
component: GuideLayoutComponent,
|
|
9
9
|
})
|
|
10
10
|
|
|
11
|
-
function
|
|
11
|
+
function GuideLayoutComponent() {
|
|
12
12
|
return (
|
|
13
13
|
<PressProvider config={config} sidebar={sidebar}>
|
|
14
|
-
<
|
|
14
|
+
<Layout>
|
|
15
15
|
<Outlet />
|
|
16
|
-
</
|
|
16
|
+
</Layout>
|
|
17
17
|
</PressProvider>
|
|
18
18
|
)
|
|
19
19
|
}
|
|
@@ -2,14 +2,15 @@ import { defineConfig } from 'vite'
|
|
|
2
2
|
import { ardo } from 'ardo/vite'
|
|
3
3
|
|
|
4
4
|
export default defineConfig({
|
|
5
|
-
// For GitHub Pages subdirectory deployments, uncomment and adjust:
|
|
6
|
-
// base: '/{{PROJECT_NAME}}/',
|
|
7
|
-
|
|
8
5
|
plugins: [
|
|
9
6
|
ardo({
|
|
10
7
|
title: '{{SITE_TITLE}}',
|
|
11
8
|
description: 'Built with Ardo',
|
|
12
9
|
|
|
10
|
+
{{TYPEDOC_CONFIG}}
|
|
11
|
+
|
|
12
|
+
{{GITHUB_PAGES_CONFIG}}
|
|
13
|
+
|
|
13
14
|
themeConfig: {
|
|
14
15
|
siteTitle: '{{SITE_TITLE}}',
|
|
15
16
|
|