@gitpagedocs/cli 1.1.55 → 1.1.56
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/README.md +13 -1
- package/ai/application/run-ai-cli-command.ts +16 -5
- package/ai/core/models/parse-ai-cli-config.ts +78 -0
- package/ai/infrastructure/ai-config-file.ts +77 -8
- package/ai/infrastructure/file-system-adapter.ts +5 -3
- package/ai/presentation/ai-prompts.ts +1 -1
- package/application/report/config-only-reporter.mjs +63 -62
- package/builders/config-orchestrator.mjs +34 -34
- package/builders/project-links.mjs +26 -0
- package/builders/root-config-builder.mjs +11 -16
- package/builders/route-builders.mjs +136 -136
- package/builders/theme-template.mjs +76 -75
- package/builders/version-config-builder.mjs +186 -157
- package/content/docs-en.mjs +26 -24
- package/content/docs-es.mjs +20 -20
- package/content/docs-pt.mjs +20 -20
- package/contracts/doc-versions.mjs +3 -3
- package/contracts/index.mjs +0 -0
- package/data/i18n-langmenu.mjs +35 -35
- package/data/path-mappings.mjs +26 -26
- package/data/route-metas.mjs +93 -93
- package/data/urls.mjs +12 -7
- package/package.json +60 -60
- package/presentation/commands/config-clear.ts +23 -0
- package/presentation/commands/diagnostics.ts +1 -1
- package/presentation/commands/run-command.ts +6 -0
- package/presentation/index.ts +1 -1
- package/runtime/output.mjs +35 -35
- package/runtime/workflow.mjs +47 -27
- package/ui/logger.mjs +9 -9
package/runtime/workflow.mjs
CHANGED
|
@@ -6,23 +6,26 @@ function sanitizeDocsPath(docsPath) {
|
|
|
6
6
|
|
|
7
7
|
export async function ensureGitHubPagesWorkflow(getCurrentGitBranch, writeText, docsPath = "") {
|
|
8
8
|
const pathSegment = sanitizeDocsPath(docsPath);
|
|
9
|
-
const buildStepsBlock =
|
|
10
|
-
pathSegment
|
|
11
|
-
? ` - name: Build static site with target repository path
|
|
12
|
-
run: pnpm exec next build frontend && mv frontend/out out
|
|
13
|
-
working-directory: .gitpagedocs-runtime
|
|
14
|
-
env:
|
|
15
|
-
GITPAGEDOCS_PATH: "${pathSegment}"
|
|
16
|
-
|
|
17
|
-
- name: Relocate output to custom docs path
|
|
18
|
-
run: |
|
|
19
|
-
mkdir -p .gitpagedocs-runtime/out_new/${pathSegment}
|
|
9
|
+
const buildStepsBlock =
|
|
10
|
+
pathSegment
|
|
11
|
+
? ` - name: Build static site with target repository path
|
|
12
|
+
run: pnpm exec next build frontend && mv frontend/out out
|
|
13
|
+
working-directory: .gitpagedocs-runtime
|
|
14
|
+
env:
|
|
15
|
+
GITPAGEDOCS_PATH: "${pathSegment}"
|
|
16
|
+
|
|
17
|
+
- name: Relocate output to custom docs path
|
|
18
|
+
run: |
|
|
19
|
+
mkdir -p .gitpagedocs-runtime/out_new/${pathSegment}
|
|
20
20
|
mv .gitpagedocs-runtime/out/* .gitpagedocs-runtime/out_new/${pathSegment}/
|
|
21
21
|
rm -rf .gitpagedocs-runtime/out
|
|
22
|
-
mv .gitpagedocs-runtime/out_new .gitpagedocs-runtime/out
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
mv .gitpagedocs-runtime/out_new .gitpagedocs-runtime/out
|
|
23
|
+
|
|
24
|
+
- name: Redirect site root to custom docs path
|
|
25
|
+
run: printf '%s' '<!doctype html><meta http-equiv="refresh" content="0; url=./${pathSegment}/"><title>Redirecting</title><a href="./${pathSegment}/">Documentation</a>' > .gitpagedocs-runtime/out/index.html`
|
|
26
|
+
: ` - name: Build static site with target repository path
|
|
27
|
+
run: pnpm exec next build frontend && mv frontend/out out
|
|
28
|
+
working-directory: .gitpagedocs-runtime`;
|
|
26
29
|
const currentBranch = getCurrentGitBranch();
|
|
27
30
|
const workflowPath = ".github/workflows/gitpagedocs-pages.yml";
|
|
28
31
|
const workflowContent = `name: Deploy GitPageDocs
|
|
@@ -39,16 +42,20 @@ permissions:
|
|
|
39
42
|
|
|
40
43
|
concurrency:
|
|
41
44
|
group: "pages"
|
|
42
|
-
cancel-in-progress:
|
|
45
|
+
cancel-in-progress: false
|
|
43
46
|
|
|
44
47
|
jobs:
|
|
45
|
-
build:
|
|
46
|
-
runs-on: ubuntu-latest
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
48
|
+
build:
|
|
49
|
+
runs-on: ubuntu-latest
|
|
50
|
+
permissions:
|
|
51
|
+
contents: read
|
|
52
|
+
pages: write
|
|
53
|
+
id-token: write
|
|
54
|
+
env:
|
|
55
|
+
GITHUB_ACTIONS: "true"
|
|
56
|
+
GITHUB_REPOSITORY: \${{ github.repository }}
|
|
57
|
+
GITPAGEDOCS_REPOSITORY_SEARCH: "true"
|
|
58
|
+
steps:
|
|
52
59
|
- name: Checkout target repository
|
|
53
60
|
uses: actions/checkout@v4
|
|
54
61
|
|
|
@@ -58,15 +65,21 @@ jobs:
|
|
|
58
65
|
- name: Setup Node
|
|
59
66
|
uses: actions/setup-node@v4
|
|
60
67
|
with:
|
|
61
|
-
node-version: "
|
|
68
|
+
node-version: "24"
|
|
62
69
|
|
|
63
70
|
- name: Setup Pages
|
|
64
71
|
uses: actions/configure-pages@v5
|
|
72
|
+
with:
|
|
73
|
+
enablement: true
|
|
65
74
|
|
|
66
75
|
- name: Prepare runtime source
|
|
67
76
|
run: |
|
|
68
77
|
git clone --depth 1 https://github.com/Vidigal-code/git-page-docs.git .gitpagedocs-runtime
|
|
69
78
|
cp .gitpagedocs-runtime/gitpagedocs/icon.svg /tmp/default-icon.svg 2>/dev/null || true
|
|
79
|
+
if [ -d gitpagelayouts ]; then
|
|
80
|
+
rm -rf .gitpagedocs-runtime/gitpagelayouts
|
|
81
|
+
cp -R gitpagelayouts .gitpagedocs-runtime/gitpagelayouts
|
|
82
|
+
fi
|
|
70
83
|
if [ -d gitpagedocs ]; then
|
|
71
84
|
rm -rf .gitpagedocs-runtime/gitpagedocs
|
|
72
85
|
cp -R gitpagedocs .gitpagedocs-runtime/gitpagedocs
|
|
@@ -84,9 +97,9 @@ jobs:
|
|
|
84
97
|
run: pnpm install --frozen-lockfile
|
|
85
98
|
working-directory: .gitpagedocs-runtime
|
|
86
99
|
|
|
87
|
-
${buildStepsBlock}
|
|
88
|
-
|
|
89
|
-
- name: Add .nojekyll
|
|
100
|
+
${buildStepsBlock}
|
|
101
|
+
|
|
102
|
+
- name: Add .nojekyll
|
|
90
103
|
run: touch .gitpagedocs-runtime/out/.nojekyll 2>/dev/null || mkdir -p .gitpagedocs-runtime/out && touch .gitpagedocs-runtime/out/.nojekyll
|
|
91
104
|
|
|
92
105
|
- name: Upload artifact
|
|
@@ -100,10 +113,17 @@ ${buildStepsBlock}
|
|
|
100
113
|
url: \${{ steps.deployment.outputs.page_url }}
|
|
101
114
|
runs-on: ubuntu-latest
|
|
102
115
|
needs: build
|
|
116
|
+
permissions:
|
|
117
|
+
pages: write
|
|
118
|
+
id-token: write
|
|
103
119
|
steps:
|
|
104
120
|
- name: Deploy to GitHub Pages
|
|
105
121
|
id: deployment
|
|
106
122
|
uses: actions/deploy-pages@v4
|
|
123
|
+
with:
|
|
124
|
+
timeout: 900000
|
|
125
|
+
error_count: 30
|
|
126
|
+
reporting_interval: 10000
|
|
107
127
|
`;
|
|
108
128
|
await writeText(workflowPath, workflowContent);
|
|
109
129
|
}
|
package/ui/logger.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/** Consistent log formatting */
|
|
2
|
-
|
|
3
|
-
export function logSuccess(msg) {
|
|
4
|
-
console.log(`
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
export function logInfo(msg) {
|
|
8
|
-
console.log(` ${msg}`);
|
|
9
|
-
}
|
|
1
|
+
/** Consistent log formatting */
|
|
2
|
+
|
|
3
|
+
export function logSuccess(msg) {
|
|
4
|
+
console.log(` [ok] ${msg}`);
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function logInfo(msg) {
|
|
8
|
+
console.log(` ${msg}`);
|
|
9
|
+
}
|