@lukoweb/create-apitogo 0.1.4 → 0.1.6
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.
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
/** @type {import('@lukoweb/apitogo').ZudokuConfig} */
|
|
2
2
|
const config = {
|
|
3
3
|
site: {
|
|
4
|
+
title: "__APP_TITLE__",
|
|
4
5
|
logo: {
|
|
5
6
|
src: { light: "/logo-light.png", dark: "/logo-dark.png" },
|
|
6
7
|
alt: "APIToGo",
|
|
7
8
|
width: "130px",
|
|
8
9
|
},
|
|
9
10
|
},
|
|
11
|
+
metadata: {
|
|
12
|
+
favicon: "/logo-light.png",
|
|
13
|
+
},
|
|
10
14
|
navigation: [
|
|
11
15
|
{
|
|
12
16
|
type: "category",
|
|
@@ -2,12 +2,16 @@ import type { ZudokuConfig } from "@lukoweb/apitogo";
|
|
|
2
2
|
|
|
3
3
|
const config: ZudokuConfig = {
|
|
4
4
|
site: {
|
|
5
|
+
title: "__APP_TITLE__",
|
|
5
6
|
logo: {
|
|
6
7
|
src: { light: "/logo-light.png", dark: "/logo-dark.png" },
|
|
7
8
|
alt: "APIToGo",
|
|
8
9
|
width: "130px",
|
|
9
10
|
},
|
|
10
11
|
},
|
|
12
|
+
metadata: {
|
|
13
|
+
favicon: "/logo-light.png",
|
|
14
|
+
},
|
|
11
15
|
navigation: [
|
|
12
16
|
{
|
|
13
17
|
type: "category",
|
package/dist/templates/index.ts
CHANGED
|
@@ -18,6 +18,13 @@ const TEMPLATES_DIR = __dirname.endsWith("dist")
|
|
|
18
18
|
const WORKSPACE_ROOT = path.resolve(PACKAGE_ROOT, "../..");
|
|
19
19
|
const WINDOWS_SHELL = process.env.ComSpec ?? "cmd.exe";
|
|
20
20
|
|
|
21
|
+
const formatAppTitle = (appName: string) =>
|
|
22
|
+
appName
|
|
23
|
+
.split(/[-_\s]+/)
|
|
24
|
+
.filter(Boolean)
|
|
25
|
+
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
|
|
26
|
+
.join(" ");
|
|
27
|
+
|
|
21
28
|
const parseWorkspaceCatalog = async (workspaceFile: string) => {
|
|
22
29
|
const content = await fs.readFile(workspaceFile, "utf8");
|
|
23
30
|
const catalog: Record<string, string> = {};
|
|
@@ -179,6 +186,16 @@ export const installTemplate = async ({
|
|
|
179
186
|
},
|
|
180
187
|
});
|
|
181
188
|
|
|
189
|
+
const appTitle = formatAppTitle(appName);
|
|
190
|
+
const configFilename = mode === "ts" ? "apitogo.config.tsx" : "apitogo.config.jsx";
|
|
191
|
+
const configPath = path.join(root, configFilename);
|
|
192
|
+
const configContents = await fs.readFile(configPath, "utf8");
|
|
193
|
+
await fs.writeFile(
|
|
194
|
+
configPath,
|
|
195
|
+
configContents.split("__APP_TITLE__").join(appTitle),
|
|
196
|
+
"utf8",
|
|
197
|
+
);
|
|
198
|
+
|
|
182
199
|
// update import alias in any files if not using the default
|
|
183
200
|
|
|
184
201
|
/** Copy the version from package.json or override for tests. */
|