@lukoweb/apitogo 0.2.31 → 0.2.34

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 (41) hide show
  1. package/dist/cli/cli.js +436 -153
  2. package/dist/declarations/app/entry.server.d.ts +2 -2
  3. package/dist/declarations/app/main.d.ts +3 -1
  4. package/dist/declarations/cli/platform/client/platform-api.d.ts +0 -4
  5. package/dist/declarations/cli/platform/helpers/deploy-artifact-hash.d.ts +1 -1
  6. package/dist/declarations/cli/platform/helpers/package-files.d.ts +1 -1
  7. package/dist/declarations/cli/platform/helpers/zip.d.ts +1 -1
  8. package/dist/declarations/cli/platform/tools/infrastructure.d.ts +0 -4
  9. package/dist/declarations/config/effective-redirects.d.ts +6 -0
  10. package/dist/declarations/config/header-navigation-guard.d.ts +2 -0
  11. package/dist/declarations/config/resolve-modules.d.ts +1 -4
  12. package/dist/declarations/config/validators/HeaderNavigationSchema.d.ts +1 -2
  13. package/docs/cli/commands.md +19 -0
  14. package/docs/configuration/gateway.md +52 -0
  15. package/docs/guides/customer-account.md +11 -1
  16. package/docs/mcp/tools.md +101 -102
  17. package/package.json +2 -1
  18. package/src/app/demo.tsx +78 -77
  19. package/src/app/entry.client.tsx +115 -107
  20. package/src/app/entry.server.tsx +164 -160
  21. package/src/app/main.tsx +175 -167
  22. package/src/app/standalone.tsx +61 -60
  23. package/src/config/effective-redirects.ts +31 -0
  24. package/src/config/header-navigation-guard.ts +13 -0
  25. package/src/config/resolve-modules.ts +331 -354
  26. package/src/config/v2/home-redirect.ts +104 -98
  27. package/src/config/v2/index.ts +127 -126
  28. package/src/config/v2/ledger.ts +242 -235
  29. package/src/config/v2/resolve.ts +12 -4
  30. package/src/config/v2/rules.ts +716 -714
  31. package/src/config/v2/services.ts +799 -663
  32. package/src/config/v2/workspace.ts +17 -1
  33. package/src/config/validators/HeaderNavigationSchema.ts +42 -44
  34. package/src/lib/assets/powered-by-icon.png +0 -0
  35. package/src/lib/authentication/providers/dev-portal-auth-pages.tsx +667 -602
  36. package/src/lib/authentication/providers/dev-portal.tsx +476 -448
  37. package/src/lib/components/HeaderNavigation.tsx +176 -176
  38. package/src/lib/components/MobileTopNavigation.tsx +283 -283
  39. package/src/lib/components/navigation/PoweredByZudoku.tsx +42 -39
  40. package/src/vite/plugin-offroot-resolve.ts +68 -67
  41. package/src/vite/prerender/prerender.ts +242 -242
@@ -1,5 +1,5 @@
1
1
  import { createHash } from "node:crypto";
2
- import { access, lstat, readFile, rm } from "node:fs/promises";
2
+ import { access, lstat, readFile, rm, writeFile } from "node:fs/promises";
3
3
  import path from "node:path";
4
4
  import { glob } from "glob";
5
5
  import { ensureStateDir } from "./layout.js";
@@ -24,6 +24,21 @@ async function relink(target: string, link: string): Promise<void> {
24
24
  await linkDirectory(target, link);
25
25
  }
26
26
 
27
+ /**
28
+ * `generated/` is an ES-module package of its own. The build's output is ES modules, and Vite names the server files
29
+ * `.js` or `.mjs` and Node reads them as modules or not by the nearest `package.json`. Without this file that is the
30
+ * tenant's, which has no `"type": "module"` in many projects (a CommonJS project, or the embedded layout), and then
31
+ * the build failed with "Could not find server config output file".
32
+ */
33
+ const GENERATED_PACKAGE_JSON = '{\n "private": true,\n "type": "module"\n}\n';
34
+
35
+ async function writeGeneratedPackageJson(root: string): Promise<void> {
36
+ const file = path.join(root, "package.json");
37
+ const current = await readFile(file, "utf8").catch(() => undefined);
38
+ if (current !== GENERATED_PACKAGE_JSON)
39
+ await writeFile(file, GENERATED_PACKAGE_JSON, "utf8");
40
+ }
41
+
27
42
  /**
28
43
  * Makes `generated/` a self-contained site root the existing build can run in: the wrapper, an empty site
29
44
  * config, and links to the tenant's files. Tenant files are linked, never copied, edited or patched.
@@ -34,6 +49,7 @@ export async function materializeWorkspace(
34
49
  ): Promise<string> {
35
50
  const root = path.dirname(prepared.wrapperPath);
36
51
  await ensureStateDir(resolved.state);
52
+ await writeGeneratedPackageJson(root);
37
53
  await relink(resolved.configDir, path.join(root, CONTENT_LINK));
38
54
  const publicDir = resolved.portal && path.join(resolved.portal.dir, "public");
39
55
  const publicLink = path.join(root, "public");
@@ -1,44 +1,42 @@
1
- import { z } from "zod";
2
- import { IconNames } from "./icon-types.js";
3
- import { DisplaySchema } from "./InputNavigationSchema.js";
4
-
5
- const IconSchema = z.enum(IconNames);
6
-
7
- const HeaderNavLinkItemSchema = z.object({
8
- label: z.string(),
9
- icon: IconSchema.optional(),
10
- description: z.string().optional(),
11
- to: z.string(),
12
- target: z.enum(["_self", "_blank"]).optional(),
13
- display: DisplaySchema,
14
- });
15
-
16
- const HeaderNavGroupSchema = z.object({
17
- label: z.string(),
18
- items: z.array(HeaderNavLinkItemSchema),
19
- });
20
-
21
- const HeaderNavItemSchema = z.union([
22
- z.object({
23
- label: z.string(),
24
- icon: IconSchema.optional(),
25
- to: z.string(),
26
- target: z.enum(["_self", "_blank"]).optional(),
27
- display: DisplaySchema,
28
- }),
29
- z.object({
30
- label: z.string(),
31
- items: z.array(z.union([HeaderNavLinkItemSchema, HeaderNavGroupSchema])),
32
- }),
33
- ]);
34
-
35
- export const HeaderNavigationSchema = z.array(HeaderNavItemSchema);
36
-
37
- export const isHeaderNavGroup = (
38
- item: HeaderNavItem | HeaderNavLinkItem | HeaderNavGroup,
39
- ): item is HeaderNavGroup => "items" in item;
40
-
41
- export type HeaderNavLinkItem = z.infer<typeof HeaderNavLinkItemSchema>;
42
- export type HeaderNavGroup = z.infer<typeof HeaderNavGroupSchema>;
43
- export type HeaderNavItem = z.infer<typeof HeaderNavItemSchema>;
44
- export type HeaderNavigation = z.infer<typeof HeaderNavigationSchema>;
1
+ import { z } from "zod";
2
+ import { IconNames } from "./icon-types.js";
3
+ import { DisplaySchema } from "./InputNavigationSchema.js";
4
+
5
+ const IconSchema = z.enum(IconNames);
6
+
7
+ const HeaderNavLinkItemSchema = z.object({
8
+ label: z.string(),
9
+ icon: IconSchema.optional(),
10
+ description: z.string().optional(),
11
+ to: z.string(),
12
+ target: z.enum(["_self", "_blank"]).optional(),
13
+ display: DisplaySchema,
14
+ });
15
+
16
+ const HeaderNavGroupSchema = z.object({
17
+ label: z.string(),
18
+ items: z.array(HeaderNavLinkItemSchema),
19
+ });
20
+
21
+ const HeaderNavItemSchema = z.union([
22
+ z.object({
23
+ label: z.string(),
24
+ icon: IconSchema.optional(),
25
+ to: z.string(),
26
+ target: z.enum(["_self", "_blank"]).optional(),
27
+ display: DisplaySchema,
28
+ }),
29
+ z.object({
30
+ label: z.string(),
31
+ items: z.array(z.union([HeaderNavLinkItemSchema, HeaderNavGroupSchema])),
32
+ }),
33
+ ]);
34
+
35
+ export const HeaderNavigationSchema = z.array(HeaderNavItemSchema);
36
+
37
+ export { isHeaderNavGroup } from "../header-navigation-guard.js";
38
+
39
+ export type HeaderNavLinkItem = z.infer<typeof HeaderNavLinkItemSchema>;
40
+ export type HeaderNavGroup = z.infer<typeof HeaderNavGroupSchema>;
41
+ export type HeaderNavItem = z.infer<typeof HeaderNavItemSchema>;
42
+ export type HeaderNavigation = z.infer<typeof HeaderNavigationSchema>;