@gitpagedocs/cli 1.1.61 → 1.1.63

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 (72) hide show
  1. package/README.md +193 -191
  2. package/ai/application/ai-command.ts +24 -24
  3. package/ai/application/ai-provider-factory.ts +22 -22
  4. package/ai/application/docs-pattern.ts +68 -68
  5. package/ai/application/run-ai-cli-command.ts +167 -167
  6. package/ai/config.ts +50 -50
  7. package/ai/core/models/ai-cli-config.ts +33 -33
  8. package/ai/core/models/parse-ai-cli-config.ts +78 -78
  9. package/ai/core/ports/illm-provider.ts +32 -32
  10. package/ai/infrastructure/ai-config-file.ts +101 -101
  11. package/ai/infrastructure/file-system-adapter.ts +85 -85
  12. package/ai/infrastructure/llm/tools-llm-provider.ts +54 -54
  13. package/ai/infrastructure/version-docs-writer.ts +143 -143
  14. package/ai/presentation/ai-prompts.ts +239 -239
  15. package/application/config-only/handler.mjs +2 -0
  16. package/application/home/handler.mjs +2 -0
  17. package/application/ports/cli-runtime-ports.ts +91 -87
  18. package/application/report/config-only-reporter.mjs +64 -63
  19. package/application/use-cases/dispatch-mode.ts +18 -18
  20. package/builders/config-orchestrator.mjs +34 -34
  21. package/builders/project-links.mjs +50 -26
  22. package/builders/root-config-builder.d.mts +16 -0
  23. package/builders/root-config-builder.mjs +61 -53
  24. package/builders/route-builders.mjs +136 -136
  25. package/builders/theme-template.mjs +76 -76
  26. package/builders/version-config-builder.mjs +186 -186
  27. package/content/docs-en.mjs +549 -545
  28. package/content/docs-es.mjs +462 -460
  29. package/content/docs-pt.mjs +462 -460
  30. package/contracts/doc-versions.mjs +3 -3
  31. package/contracts/index.mjs +10 -0
  32. package/contracts/layouts-paths.d.mts +17 -0
  33. package/contracts/layouts-paths.mjs +68 -0
  34. package/data/default-site-config.mjs +321 -321
  35. package/data/i18n-langmenu.mjs +347 -347
  36. package/data/layouts.mjs +436 -436
  37. package/data/path-mappings.mjs +26 -26
  38. package/data/route-metas.mjs +93 -93
  39. package/data/theme-colors.mjs +443 -443
  40. package/data/urls.mjs +12 -12
  41. package/domain/models/cli-options.ts +33 -18
  42. package/domain/services/layouts-migration.d.mts +15 -0
  43. package/domain/services/layouts-migration.mjs +60 -0
  44. package/home/constants.mjs +4 -4
  45. package/index.mjs +37 -37
  46. package/infrastructure/gitpagedocs-config-file.ts +47 -47
  47. package/infrastructure/home/runtime.mjs +37 -37
  48. package/package.json +3 -3
  49. package/presentation/commands/ai-info.ts +57 -57
  50. package/presentation/commands/config-clear.ts +23 -23
  51. package/presentation/commands/config-info.ts +24 -24
  52. package/presentation/commands/diagnostics.ts +164 -164
  53. package/presentation/commands/docs.ts +37 -37
  54. package/presentation/commands/mcp.ts +20 -20
  55. package/presentation/commands/pages.ts +101 -101
  56. package/presentation/commands/password.ts +62 -62
  57. package/presentation/commands/run-command.ts +70 -70
  58. package/presentation/index.ts +124 -116
  59. package/presentation/options/parser.ts +119 -104
  60. package/presentation/options/resolver.ts +46 -48
  61. package/presentation/options/schema.ts +4 -0
  62. package/presentation/ui/clack.ts +91 -91
  63. package/presentation/ui/layouts-prompts.ts +124 -0
  64. package/presentation/ui/prompts.ts +146 -138
  65. package/presentation/ui/tty.ts +37 -0
  66. package/runtime/git-ops.mjs +110 -110
  67. package/runtime/layouts-migrator.d.mts +11 -0
  68. package/runtime/layouts-migrator.mjs +103 -0
  69. package/runtime/output.mjs +159 -146
  70. package/runtime/workflow.mjs +129 -129
  71. package/start.mjs +12 -12
  72. package/ui/logger.mjs +9 -9
@@ -1,3 +1,3 @@
1
- export const PACKAGE_VERSION = "1.1.61";
2
-
3
- export const DOC_VERSIONS = [PACKAGE_VERSION];
1
+ export const PACKAGE_VERSION = "1.1.63";
2
+
3
+ export const DOC_VERSIONS = [PACKAGE_VERSION];
@@ -1 +1,11 @@
1
1
  export { DOC_VERSIONS } from "./doc-versions.mjs";
2
+ export {
3
+ DEFAULT_LAYOUTS_DIR,
4
+ LAYOUTS_CONFIG_FILENAME,
5
+ LAYOUTS_FALLBACK_CONFIG_FILENAME,
6
+ LAYOUTS_TEMPLATES_DIRNAME,
7
+ LEGACY_LAYOUTS_SUBDIR,
8
+ normalizeLayoutsDir,
9
+ legacyLayoutsDir,
10
+ layoutsArtifactPaths,
11
+ } from "./layouts-paths.mjs";
@@ -0,0 +1,17 @@
1
+ /** Repo-relative paths owned by a layouts folder. */
2
+ export interface LayoutsArtifactPaths {
3
+ root: string;
4
+ config: string;
5
+ fallbackConfig: string;
6
+ templates: string;
7
+ }
8
+
9
+ export declare const DEFAULT_LAYOUTS_DIR: string;
10
+ export declare const LAYOUTS_CONFIG_FILENAME: string;
11
+ export declare const LAYOUTS_FALLBACK_CONFIG_FILENAME: string;
12
+ export declare const LAYOUTS_TEMPLATES_DIRNAME: string;
13
+ export declare const LEGACY_LAYOUTS_SUBDIR: string;
14
+
15
+ export declare function normalizeLayoutsDir(dir: string): string;
16
+ export declare function legacyLayoutsDir(outputDir: string): string;
17
+ export declare function layoutsArtifactPaths(layoutsDir: string): LayoutsArtifactPaths;
@@ -0,0 +1,68 @@
1
+ /**
2
+ * Canonical locations for layout artifacts.
3
+ *
4
+ * Local layouts are generated into the standalone `gitpagelayouts/` home at the
5
+ * project root. `<outputDir>/layouts/` is the legacy location that earlier
6
+ * versions wrote: the viewer still reads it, and the CLI offers to migrate it,
7
+ * but nothing is generated there any more.
8
+ *
9
+ * Every consumer derives its paths from here so the folder name exists in one
10
+ * place only.
11
+ */
12
+
13
+ /** Standalone layouts home, relative to the project root. */
14
+ export const DEFAULT_LAYOUTS_DIR = "gitpagelayouts";
15
+
16
+ /** Index file listing every layout, inside a layouts folder. */
17
+ export const LAYOUTS_CONFIG_FILENAME = "layoutsConfig.json";
18
+
19
+ /** Fallback index used when a layout id cannot be resolved. */
20
+ export const LAYOUTS_FALLBACK_CONFIG_FILENAME = "layoutsFallbackConfig.json";
21
+
22
+ /** Folder holding one JSON template per layout, inside a layouts folder. */
23
+ export const LAYOUTS_TEMPLATES_DIRNAME = "templates";
24
+
25
+ /** Sub-folder of the docs output dir that older versions generated into. */
26
+ export const LEGACY_LAYOUTS_SUBDIR = "layouts";
27
+
28
+ /**
29
+ * Normalize a user-supplied folder name to a repo-relative POSIX path with no
30
+ * leading/trailing separators, so it can be joined and stored in config.json
31
+ * identically on every platform.
32
+ *
33
+ * @param {string} dir Raw folder name (may use either separator).
34
+ * @returns {string} Normalized path, or `DEFAULT_LAYOUTS_DIR` when empty.
35
+ */
36
+ export function normalizeLayoutsDir(dir) {
37
+ const normalized = String(dir ?? "")
38
+ .replace(/[\\/]+/g, "/")
39
+ .replace(/^\/+|\/+$/g, "")
40
+ .trim();
41
+ return normalized || DEFAULT_LAYOUTS_DIR;
42
+ }
43
+
44
+ /**
45
+ * Legacy layouts folder for a given docs output dir.
46
+ *
47
+ * @param {string} outputDir Docs output dir (e.g. `gitpagedocs`).
48
+ * @returns {string} Repo-relative POSIX path (e.g. `gitpagedocs/layouts`).
49
+ */
50
+ export function legacyLayoutsDir(outputDir) {
51
+ return `${normalizeLayoutsDir(outputDir)}/${LEGACY_LAYOUTS_SUBDIR}`;
52
+ }
53
+
54
+ /**
55
+ * Repo-relative paths of every artifact a layouts folder owns.
56
+ *
57
+ * @param {string} layoutsDir Layouts folder, repo-relative.
58
+ * @returns {{ root: string, config: string, fallbackConfig: string, templates: string }}
59
+ */
60
+ export function layoutsArtifactPaths(layoutsDir) {
61
+ const root = normalizeLayoutsDir(layoutsDir);
62
+ return {
63
+ root,
64
+ config: `${root}/${LAYOUTS_CONFIG_FILENAME}`,
65
+ fallbackConfig: `${root}/${LAYOUTS_FALLBACK_CONFIG_FILENAME}`,
66
+ templates: `${root}/${LAYOUTS_TEMPLATES_DIRNAME}`,
67
+ };
68
+ }