@lukoweb/create-apitogo 0.1.5 → 0.1.7

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
- /** @type {import('@lukoweb/apitogo').ZudokuConfig} */
1
+ /** @type {import('@lukoweb/apitogo').ApitogoConfig} */
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",
@@ -1,13 +1,17 @@
1
- import type { ZudokuConfig } from "@lukoweb/apitogo";
1
+ import type { ApitogoConfig } from "@lukoweb/apitogo";
2
2
 
3
- const config: ZudokuConfig = {
3
+ const config: ApitogoConfig = {
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",
@@ -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. */
@@ -1,11 +1,11 @@
1
- import type { ZudokuConfig } from "@lukoweb/apitogo";
1
+ import type { ApitogoConfig } from "@lukoweb/apitogo";
2
2
 
3
3
  /**
4
4
  * Developer Portal Configuration
5
5
  * For more information, see:
6
6
  * https://zuplo.com/docs/dev-portal/zudoku/configuration/overview
7
7
  */
8
- const config: ZudokuConfig = {
8
+ const config: ApitogoConfig = {
9
9
  site: {
10
10
  title: "My Developer Portal",
11
11
  logo: {
@@ -18,6 +18,7 @@ const config: ZudokuConfig = {
18
18
  metadata: {
19
19
  title: "Developer Portal",
20
20
  description: "Developer Portal",
21
+ favicon: "https://cdn.zuplo.com/assets/my-dev-portal-light.svg",
21
22
  },
22
23
  navigation: [
23
24
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lukoweb/create-apitogo",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "keywords": [
5
5
  "react",
6
6
  "apitogo"