@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.
@@ -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
- : ` - name: Build static site with target repository path
24
- run: pnpm exec next build frontend && mv frontend/out out
25
- working-directory: .gitpagedocs-runtime`;
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: true
45
+ cancel-in-progress: false
43
46
 
44
47
  jobs:
45
- build:
46
- runs-on: ubuntu-latest
47
- env:
48
- GITHUB_ACTIONS: "true"
49
- GITHUB_REPOSITORY: \${{ github.repository }}
50
- GITPAGEDOCS_REPOSITORY_SEARCH: "true"
51
- steps:
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: "20"
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(` ✓ ${msg}`);
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
+ }