@inditextech/docouture-cli 0.1.0-SNAPSHOT.40.1

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 (94) hide show
  1. package/build/bin.js +321 -0
  2. package/build/commands/build.js +22 -0
  3. package/build/commands/completion.js +69 -0
  4. package/build/commands/dev.js +67 -0
  5. package/build/commands/doctor.js +156 -0
  6. package/build/commands/eject.js +71 -0
  7. package/build/commands/new.js +512 -0
  8. package/build/commands/publish.js +111 -0
  9. package/build/commands/teardown.js +66 -0
  10. package/build/commands/upgrade.js +156 -0
  11. package/build/commands/version.js +60 -0
  12. package/build/lib/agents-md.js +67 -0
  13. package/build/lib/antora-log.js +36 -0
  14. package/build/lib/antora-yml.js +47 -0
  15. package/build/lib/args.js +26 -0
  16. package/build/lib/cli-context.js +17 -0
  17. package/build/lib/cli-info.js +20 -0
  18. package/build/lib/config-resolver.js +23 -0
  19. package/build/lib/copy-template.js +162 -0
  20. package/build/lib/debug-log.js +21 -0
  21. package/build/lib/detect-package-manager.js +79 -0
  22. package/build/lib/dev-server.js +337 -0
  23. package/build/lib/doctor-checks.js +240 -0
  24. package/build/lib/global-flags.js +31 -0
  25. package/build/lib/kroki-compose.js +54 -0
  26. package/build/lib/playbook-yml.js +90 -0
  27. package/build/lib/repo-root.js +21 -0
  28. package/build/lib/run-script.js +50 -0
  29. package/build/lib/theme.js +51 -0
  30. package/build/templates/agent-support/.claude/skills/docs-internals/SKILL.md +53 -0
  31. package/build/templates/agent-support/.claude/skills/docs-internals/reference/antora-extensions.md +54 -0
  32. package/build/templates/agent-support/.claude/skills/docs-internals/reference/naming.md +41 -0
  33. package/build/templates/agent-support/.claude/skills/docs-internals/reference/page-patterns.md +238 -0
  34. package/build/templates/agent-support/.claude/skills/docs-versioning.versioned/SKILL.md +37 -0
  35. package/build/templates/agent-support/.claude/skills/docs-versioning.versioned/reference/releasing.md +106 -0
  36. package/build/templates/agent-support/.claude/skills/documenting-your-repo/SKILL.md +55 -0
  37. package/build/templates/agent-support/.claude/skills/documenting-your-repo/reference/content-sourcing.md +55 -0
  38. package/build/templates/agent-support/.claude/skills/documenting-your-repo/reference/maintenance-loop.md +68 -0
  39. package/build/templates/agent-support/.claude/skills/documenting-your-repo/reference/structure-planning.md +102 -0
  40. package/build/templates/agent-support/.claude/skills/writing-docs-pages/SKILL.md +112 -0
  41. package/build/templates/agent-support/.claude/skills/writing-docs-pages/reference/docouture-blocks.md +170 -0
  42. package/build/templates/agent-support/.claude/skills/writing-docs-pages/reference/language-basics.md +402 -0
  43. package/build/templates/agent-support/.opencode/skills/docs-internals/SKILL.md +53 -0
  44. package/build/templates/agent-support/.opencode/skills/docs-internals/reference/antora-extensions.md +54 -0
  45. package/build/templates/agent-support/.opencode/skills/docs-internals/reference/naming.md +41 -0
  46. package/build/templates/agent-support/.opencode/skills/docs-internals/reference/page-patterns.md +238 -0
  47. package/build/templates/agent-support/.opencode/skills/docs-versioning.versioned/SKILL.md +37 -0
  48. package/build/templates/agent-support/.opencode/skills/docs-versioning.versioned/reference/releasing.md +106 -0
  49. package/build/templates/agent-support/.opencode/skills/documenting-your-repo/SKILL.md +55 -0
  50. package/build/templates/agent-support/.opencode/skills/documenting-your-repo/reference/content-sourcing.md +55 -0
  51. package/build/templates/agent-support/.opencode/skills/documenting-your-repo/reference/maintenance-loop.md +68 -0
  52. package/build/templates/agent-support/.opencode/skills/documenting-your-repo/reference/structure-planning.md +102 -0
  53. package/build/templates/agent-support/.opencode/skills/writing-docs-pages/SKILL.md +112 -0
  54. package/build/templates/agent-support/.opencode/skills/writing-docs-pages/reference/docouture-blocks.md +170 -0
  55. package/build/templates/agent-support/.opencode/skills/writing-docs-pages/reference/language-basics.md +402 -0
  56. package/build/templates/agent-support/AGENTS.md +72 -0
  57. package/build/templates/starter/antora-playbook.local.yml +99 -0
  58. package/build/templates/starter/antora-playbook.versioned.yml +167 -0
  59. package/build/templates/starter/antora-playbook.yml +189 -0
  60. package/build/templates/starter/gitignore +3 -0
  61. package/build/templates/starter/package.json +37 -0
  62. package/build/templates/starter/scripts/check-links.mjs +178 -0
  63. package/build/templates/starter/src/antora.yml +85 -0
  64. package/build/templates/starter/src/modules/ROOT/images/card-placeholder.png +0 -0
  65. package/build/templates/starter/src/modules/ROOT/images/feature-placeholder-dark.png +0 -0
  66. package/build/templates/starter/src/modules/ROOT/images/feature-placeholder.png +0 -0
  67. package/build/templates/starter/src/modules/ROOT/images/hero-placeholder.png +0 -0
  68. package/build/templates/starter/src/modules/ROOT/pages/index.adoc +124 -0
  69. package/build/templates/starter/src/modules/main/nav.adoc +19 -0
  70. package/build/templates/starter/src/modules/main/pages/app.adoc +5 -0
  71. package/build/templates/starter/src/modules/main/pages/architecture.adoc +6 -0
  72. package/build/templates/starter/src/modules/main/pages/changelog/index.adoc +9 -0
  73. package/build/templates/starter/src/modules/main/pages/components.adoc +701 -0
  74. package/build/templates/starter/src/modules/main/pages/contributing.adoc +6 -0
  75. package/build/templates/starter/src/modules/main/pages/getting-started.adoc +169 -0
  76. package/build/templates/starter/src/modules/main/pages/glossary.adoc +8 -0
  77. package/build/templates/starter/src/modules/main/pages/index.adoc +9 -0
  78. package/build/templates/starter/src/modules/main/pages/prerequisites.adoc +55 -0
  79. package/build/templates/starter/src/modules/main/pages/quickstart.adoc +21 -0
  80. package/build/templates/starter/src/modules/main/pages/release-notes/index.adoc +9 -0
  81. package/build/templates/starter/src/modules/main/pages/requirements.adoc +8 -0
  82. package/build/templates/starter/src/modules/main/pages/roadmap.adoc +4 -0
  83. package/build/templates/starter/src/modules/main/pages/structure.adoc +5 -0
  84. package/build/templates/starter/src/release-version.versioned +1 -0
  85. package/build/templates/starter/supplemental-ui/favicon.ico +0 -0
  86. package/build/templates/starter/supplemental-ui/product-logo-dark.png +0 -0
  87. package/build/templates/starter/supplemental-ui/product-logo.png +0 -0
  88. package/build/templates/workflows/docouture-kroki-cache-warm.yml +101 -0
  89. package/build/templates/workflows/docouture-pr-verify.yml +120 -0
  90. package/build/templates/workflows/docouture-publish-prerelease.yml +122 -0
  91. package/build/templates/workflows/docouture-publish.yml +138 -0
  92. package/build/templates/workflows/docouture-release-preview.yml +198 -0
  93. package/build/templates/workflows/docouture-release.yml +414 -0
  94. package/package.json +38 -0
@@ -0,0 +1,138 @@
1
+ name: docouture-publish
2
+
3
+ # Builds this site, then publishes it with `docouture publish <target>` — see
4
+ # that command's own usage (`docouture --help`) and
5
+ # @inditextech/docouture-cli's publish.ts for the mechanism: `<target>` resolves
6
+ # by convention to the npm package `@inditextech/docouture-publish-<target>`
7
+ # (e.g. `gh-pages` → `@inditextech/docouture-publish-gh-pages`), which this site
8
+ # must add to its own devDependencies to opt in, alongside a
9
+ # `"docouture": { "publish": { "<target>": { ... } } }` block in this site's own
10
+ # package.json for that driver's options. There is no publish-target Antora
11
+ # extension and no `antora.extensions` involvement at all — publishing is a
12
+ # CLI concern, decoupled from `antora build`, which is why Build and Publish
13
+ # are two separate steps below: re-publishing an already-built site never
14
+ # needs a rebuild.
15
+ #
16
+ # Replace `gh-pages` in the Publish step with whatever target this site's
17
+ # own devDependencies declare a driver for, or drop the step entirely for a
18
+ # site that only wants a build artifact for now — this file makes no
19
+ # platform assumption.
20
+ #
21
+ # `permissions: contents: write` and `GITHUB_TOKEN` below are only ever used
22
+ # by @inditextech/docouture-publish-gh-pages specifically (pushing to a
23
+ # `gh-pages` branch needs both); harmless to leave granted for any other
24
+ # driver, which simply never reads them.
25
+ #
26
+ # Not triggered by push — docouture-release.yml calls this workflow directly
27
+ # (as a reusable job, via `uses:` + `needs:`) as its last step, once a
28
+ # release has actually been cut, so ordering is a real dependency rather
29
+ # than a coincidence of two workflows independently reacting to the same
30
+ # git push. `workflow_call` is what makes that direct call possible.
31
+ # `workflow_dispatch` is kept alongside it for a manual rebuild+republish
32
+ # of whatever is currently on `main`, without cutting a new release.
33
+ on:
34
+ workflow_call: {}
35
+ workflow_dispatch: {}
36
+
37
+ concurrency:
38
+ group: docouture-publish
39
+ cancel-in-progress: false
40
+
41
+ jobs:
42
+ publish:
43
+ name: Build and publish
44
+ runs-on: ubuntu-latest
45
+ timeout-minutes: 15
46
+ # Needed only by @inditextech/docouture-publish-gh-pages, if this site uses
47
+ # it — pushing to a `gh-pages` branch needs write access to repository
48
+ # contents. Harmless to leave granted for any other publish target.
49
+ permissions:
50
+ contents: write
51
+ # `docouture new` scaffolds this site's package.json, antora-playbook.yml
52
+ # etc. under docs/ (not the repository root) — see the docs-site-package
53
+ # skill's reference/versioning-modes.md. Every step below runs from
54
+ # there; only .github/workflows itself has to live at the true repo
55
+ # root, since that is the one path GitHub Actions requires.
56
+ defaults:
57
+ run:
58
+ working-directory: docs
59
+ steps:
60
+ - name: Checkout
61
+ uses: actions/checkout@v4
62
+ with:
63
+ # Antora aggregates every ref content.sources[] matches into one
64
+ # build, not just whichever ref triggered this run — a shallow,
65
+ # single-branch checkout would leave the others unreachable.
66
+ fetch-depth: 0
67
+
68
+ # __DOCOUTURE_PM_SETUP_STEP__
69
+ - name: Setup Node
70
+ uses: actions/setup-node@v4
71
+ with:
72
+ # Reads engines.node from docs/package.json — no separate version
73
+ # file to keep in sync.
74
+ node-version-file: docs/package.json
75
+ cache: __DOCOUTURE_PM_CACHE__
76
+ # `defaults.run.working-directory: docs` above only applies to
77
+ # `run:` steps, not to this action's own inputs — without this,
78
+ # setup-node looks for a lockfile from the repo root and fails.
79
+ cache-dependency-path: docs/__DOCOUTURE_LOCKFILE__
80
+
81
+ - name: Install dependencies
82
+ run: __DOCOUTURE_INSTALL_CI__
83
+
84
+ # See docouture-pr-verify.yml's own comment: this build reads the real
85
+ # antora-playbook.yml (Build below), unlike pr-verify/release which
86
+ # build antora-playbook.local.yml — so the enabled check looks at the
87
+ # same file this job actually builds.
88
+ - name: Kroki / Detect enabled
89
+ id: kroki-check
90
+ run: |
91
+ if grep -qE "^\s*kroki-enabled:\s*['\"]?true['\"]?\s*(#.*)?$" antora-playbook.yml; then
92
+ echo "enabled=true" >> "$GITHUB_OUTPUT"
93
+ else
94
+ echo "enabled=false" >> "$GITHUB_OUTPUT"
95
+ fi
96
+
97
+ # See docouture-pr-verify.yml's own comment: primes the runner's Docker
98
+ # image store before Build's implicit Kroki startup, so a fresh runner
99
+ # doesn't pull all 4 images from scratch on every publish.
100
+ - name: Kroki / Docker image cache
101
+ id: kroki-cache
102
+ if: steps.kroki-check.outputs.enabled == 'true'
103
+ uses: actions/cache@v4
104
+ with:
105
+ path: /tmp/kroki-images.tar
106
+ key: ${{ runner.os }}-kroki-images-${{ hashFiles('**/kroki-compose.yml') }}
107
+
108
+ - name: Kroki / Load cached images
109
+ if: steps.kroki-check.outputs.enabled == 'true' && steps.kroki-cache.outputs.cache-hit == 'true'
110
+ run: docker load -i /tmp/kroki-images.tar
111
+
112
+ - name: Kroki / Pull and save images
113
+ if: steps.kroki-check.outputs.enabled == 'true' && steps.kroki-cache.outputs.cache-hit != 'true'
114
+ run: |
115
+ compose_file="$(find . -name kroki-compose.yml 2>/dev/null | head -1)"
116
+ docker compose -f "$compose_file" pull
117
+ docker save -o /tmp/kroki-images.tar $(docker compose -f "$compose_file" config --images)
118
+
119
+ - name: Build
120
+ run: __DOCOUTURE_PM__ run build
121
+
122
+ # See docouture-pr-verify.yml's own comment: Antora's strict mode already
123
+ # catches broken cross-references during Build above; check-links
124
+ # (package.json's own script, see scripts/check-links.mjs) covers what
125
+ # it can't — raw http(s) links in content — before this site actually
126
+ # gets published. Only a broken EXTERNAL link fails this step; a
127
+ # broken local one is a warning only.
128
+ - name: Check links
129
+ run: __DOCOUTURE_PM__ run check-links
130
+
131
+ # `GITHUB_TOKEN` is read by @inditextech/docouture-publish-gh-pages
132
+ # specifically (unused, and unnecessary to set, for any other publish
133
+ # target). See this file's own header comment for the `<target>`
134
+ # naming convention and where its options come from.
135
+ - name: Publish
136
+ run: npx docouture publish gh-pages
137
+ env:
138
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,198 @@
1
+ name: docouture-release-preview
2
+
3
+ # Comments on a pull request labeled `docs/release`, previewing what
4
+ # docouture-release.yml (this workflow's sibling) will do when the PR merges —
5
+ # same 3-job shape as this monorepo's own .github/workflows/code-release_preview.yml
6
+ # (check-changes-in-paths / release-preview / release-preview-no-*-changes /
7
+ # release-preview-no-release-label), adapted to docs-release's own signal
8
+ # (the `docs/release` label + versioning-mode detection) instead of
9
+ # code-release's (`release-type/*` labels + a CHANGELOG.md diff).
10
+ #
11
+ # Read-only: this workflow never touches git, tags, or docs/antora.yml — it
12
+ # only reports what docouture-release.yml would do, so a reviewer can catch a
13
+ # missing docs/.release-version (versioned mode) or an about-to-be-overwritten
14
+ # tag before merging, not after.
15
+ #
16
+ # Reuses docouture-release.yml's own "Detect mode" (grep antora-playbook.yml's
17
+ # content.sources[] tags) and "Resolve version" (stable, or
18
+ # docs/.release-version's contents) logic verbatim — see that workflow's own
19
+ # comments, and the docs-site-package skill's reference/versioning-modes.md,
20
+ # for the full mechanism.
21
+ on:
22
+ pull_request:
23
+ types: [labeled, synchronize, ready_for_review, opened]
24
+ branches: ['main*']
25
+
26
+ concurrency:
27
+ group: release-preview
28
+ cancel-in-progress: true
29
+
30
+ jobs:
31
+ check-changes-in-paths:
32
+ name: Check for changes in corresponding paths
33
+ runs-on: ubuntu-latest
34
+ if: ${{ github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'docs/release') }}
35
+ outputs:
36
+ detected: ${{ steps.changes.outputs.paths }}
37
+ steps:
38
+ - name: Check for changed files in specific paths
39
+ id: changes
40
+ uses: dorny/paths-filter@ebc4d7e9ebcb0b1eb21480bb8f43113e996ac77a # v3
41
+ with:
42
+ filters: |
43
+ paths:
44
+ - 'docs/**'
45
+ - '.github/workflows/docouture-release*.yml'
46
+
47
+ release-preview:
48
+ name: Release Preview
49
+ needs: check-changes-in-paths
50
+ if: ${{ contains(github.event.pull_request.labels.*.name, 'docs/release') && needs.check-changes-in-paths.outputs.detected == 'true' }}
51
+ runs-on: ubuntu-latest
52
+ permissions:
53
+ contents: read
54
+ pull-requests: write
55
+ # `docouture new` scaffolds this site's antora-playbook.yml, docs/antora.yml
56
+ # etc. under docs/ (not the repository root) — same layout
57
+ # docouture-release.yml itself runs against. Every step below runs from
58
+ # there; only .github/workflows itself has to live at the true repo
59
+ # root.
60
+ defaults:
61
+ run:
62
+ working-directory: docs
63
+ steps:
64
+ - name: Checkout
65
+ uses: actions/checkout@v4
66
+
67
+ # Same signal docouture-release.yml's own "Detect mode" step reads:
68
+ # antora-playbook.yml's content.sources[] tags, not docs/antora.yml
69
+ # (identical on main for both modes, so it carries no mode signal).
70
+ - name: Detect mode
71
+ id: detect
72
+ run: |
73
+ line=$(grep -E "tags:" antora-playbook.yml | head -1)
74
+
75
+ case "$line" in
76
+ *"v*"*) mode=versioned ;;
77
+ *stable*) mode=standalone ;;
78
+ *)
79
+ echo "::error::antora-playbook.yml's content.sources[] has tags: '${line}' — expected something matching 'v*' (versioned) or 'stable' (standalone)."
80
+ exit 1
81
+ ;;
82
+ esac
83
+
84
+ echo "mode=${mode}" >> "$GITHUB_OUTPUT"
85
+ echo "Detected ${mode} (antora-playbook.yml: ${line})"
86
+
87
+ # Standalone always targets 'stable'; versioned reads the plain-text
88
+ # docs/.release-version this PR is expected to have committed — same
89
+ # source docouture-release.yml's pull_request trigger reads (there is no
90
+ # workflow_dispatch input to fall back to here, since this workflow
91
+ # only ever runs on pull_request).
92
+ - name: Resolve version
93
+ id: resolve
94
+ env:
95
+ MODE: ${{ steps.detect.outputs.mode }}
96
+ run: |
97
+ if [ "$MODE" = "versioned" ]; then
98
+ if [ -f .release-version ]; then
99
+ version=$(tr -d '[:space:]' < .release-version)
100
+ else
101
+ version=""
102
+ fi
103
+ tag="v${version}"
104
+ else
105
+ version="stable"
106
+ tag="stable"
107
+ fi
108
+
109
+ echo "version=${version}" >> "$GITHUB_OUTPUT"
110
+ echo "tag=${tag}" >> "$GITHUB_OUTPUT"
111
+
112
+ # Query the remote directly — no local tag fetch needed. A hit here
113
+ # means docouture-release.yml's "Push release tag" step will force-move an
114
+ # existing tag (a republish) rather than create a new one.
115
+ - name: Check for existing tag
116
+ id: check
117
+ env:
118
+ MODE: ${{ steps.detect.outputs.mode }}
119
+ TAG: ${{ steps.resolve.outputs.tag }}
120
+ run: |
121
+ if [ "$MODE" = "versioned" ] && [ -z "${{ steps.resolve.outputs.version }}" ]; then
122
+ echo "existed=unknown" >> "$GITHUB_OUTPUT"
123
+ exit 0
124
+ fi
125
+
126
+ if git ls-remote --exit-code --tags origin "refs/tags/${TAG}" >/dev/null 2>&1; then
127
+ echo "existed=true" >> "$GITHUB_OUTPUT"
128
+ else
129
+ echo "existed=false" >> "$GITHUB_OUTPUT"
130
+ fi
131
+
132
+ - name: Comment on PR
133
+ env:
134
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
135
+ MODE: ${{ steps.detect.outputs.mode }}
136
+ VERSION: ${{ steps.resolve.outputs.version }}
137
+ TAG: ${{ steps.resolve.outputs.tag }}
138
+ EXISTED: ${{ steps.check.outputs.existed }}
139
+ run: |
140
+ if [ "$MODE" = "versioned" ] && [ -z "$VERSION" ]; then
141
+ gh pr comment ${{ github.event.number }} --body "
142
+ ### :x: docs/release: no target version
143
+ This site is on Versioned (Full History) mode, but no \`docs/.release-version\` file was found in this PR — add one with the target version (e.g. \`1.2.0\`) before merging with the \`docs/release\` label, or the release workflow will fail on merge."
144
+ exit 0
145
+ fi
146
+
147
+ MESSAGE="
148
+ ### :rocket: Docs Release Preview
149
+ Merging this Pull Request will release **\`${TAG}\`**."
150
+
151
+ if [ "$EXISTED" = "true" ]; then
152
+ MESSAGE="${MESSAGE}
153
+
154
+ ### :warning: Tag already exists
155
+ \`${TAG}\` already exists and will be **force-overwritten** on merge."
156
+ fi
157
+
158
+ gh pr comment ${{ github.event.number }} --body "$(echo -e "$MESSAGE")"
159
+
160
+ release-preview-no-docs-changes:
161
+ name: Add PR comment with configuration management information
162
+ needs: check-changes-in-paths
163
+ if: ${{ contains(github.event.pull_request.labels.*.name, 'docs/release') && needs.check-changes-in-paths.outputs.detected == 'false' }}
164
+ runs-on: ubuntu-latest
165
+ permissions:
166
+ contents: read
167
+ pull-requests: write
168
+ env:
169
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
170
+ steps:
171
+ - name: Checkout
172
+ uses: actions/checkout@v4
173
+
174
+ - name: Add PR comment with release preview
175
+ run: |
176
+ gh pr comment ${{ github.event.number }} --body "
177
+ ### :exclamation: This Pull Request will not trigger a meaningful release
178
+ The \`docs/release\` label is set, but this Pull Request has no changes under \`docs/**\` — merging it will still cut a release, just with nothing new in it."
179
+
180
+ release-preview-no-release-label:
181
+ name: Add PR comment with release information
182
+ needs: check-changes-in-paths
183
+ if: ${{ !contains(github.event.pull_request.labels.*.name, 'docs/release') && needs.check-changes-in-paths.outputs.detected == 'true' && github.event.pull_request.draft == false }}
184
+ runs-on: ubuntu-latest
185
+ permissions:
186
+ contents: read
187
+ pull-requests: write
188
+ env:
189
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
190
+ steps:
191
+ - name: Checkout
192
+ uses: actions/checkout@v4
193
+
194
+ - name: Add PR comment with release preview
195
+ run: |
196
+ gh pr comment ${{ github.event.number }} --body "
197
+ ### :exclamation: This Pull Request will not trigger a release
198
+ A Pull Request with no \`docs/release\` label will not trigger a release — label it \`docs/release\` if you want this merge to release the docs site."