@grimoire-rs/indexer 0.1.0 → 0.1.3

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 CHANGED
@@ -40,8 +40,26 @@ export default defineConfig({
40
40
 
41
41
  ## Status
42
42
 
43
- Skeleton subcommands and the Astro integration are under active
44
- development.
43
+ Pre-1.0. All three subcommands work and are covered by tests, but the
44
+ end-to-end loop — announce, gate, auto-merge, publish — has not yet been
45
+ proven against a live index, so treat it as early.
46
+
47
+ Two things are frozen and safe to build on: the published URL layout
48
+ (`/p/<namespace>/<name>/` and `/all.json`) and the per-record `schema`
49
+ field. Everything else may still move.
50
+
51
+ Theming is CSS custom properties, defined for both light and dark. There
52
+ is deliberately no component-override API yet — publishing one would
53
+ freeze a prop contract per slot, and that is not a promise worth making
54
+ this early.
55
+
56
+ > **Use `0.1.3` or later.** `0.1.0` installs without an executable — npm
57
+ > silently stripped its `bin` entry at publish time. `0.1.1` and `0.1.2`
58
+ > scaffold CI that points at reusable workflows those tags do not contain,
59
+ > so the first push to a scaffolded index fails before any job runs. An
60
+ > index already scaffolded against `0.1.1`/`0.1.2` is fixed by bumping the
61
+ > `@v0.1.x` refs in `.github/workflows/{pages,validate}.yml` — no
62
+ > re-scaffold needed.
45
63
 
46
64
  ## License
47
65
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grimoire-rs/indexer",
3
- "version": "0.1.0",
3
+ "version": "0.1.3",
4
4
  "description": "CLI + Astro integration for running your own grim package index",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -8,7 +8,7 @@
8
8
  "node": ">=22.14.0"
9
9
  },
10
10
  "bin": {
11
- "grim-indexer": "./dist/cli/index.js"
11
+ "grim-indexer": "dist/cli/index.js"
12
12
  },
13
13
  "files": [
14
14
  "dist",
@@ -46,5 +46,13 @@
46
46
  "astro": "^7.1.4",
47
47
  "commander": "^15.0.0",
48
48
  "preact": "^10.29.7"
49
+ },
50
+ "repository": {
51
+ "type": "git",
52
+ "url": "git+https://github.com/grimoire-rs/indexer.git"
53
+ },
54
+ "homepage": "https://github.com/grimoire-rs/indexer#readme",
55
+ "bugs": {
56
+ "url": "https://github.com/grimoire-rs/indexer/issues"
49
57
  }
50
58
  }
@@ -1,80 +0,0 @@
1
- # SPDX-License-Identifier: Apache-2.0
2
- # Copyright 2026 The Grimoire Authors
3
- #
4
- # Reusable workflow: build a grimoire index repo and publish it to GitHub
5
- # Pages. Scaffolded index repos call this by ref rather than inlining the
6
- # job logic, so a fix here reaches every downstream index without anyone
7
- # re-running `grim-indexer init` over their edits. Renovate's built-in
8
- # `github-actions` manager bumps the pinned ref in each caller.
9
- #
10
- # Copy this file to `.github/workflows/index-pages.yml` in this repo — a
11
- # reusable workflow must live directly in `.github/workflows/`, GitHub does
12
- # not resolve subdirectories.
13
- name: grim-indexer pages
14
-
15
- on:
16
- workflow_call:
17
- inputs:
18
- node-version:
19
- description: Node.js version used to run grim-indexer.
20
- type: string
21
- required: false
22
- default: "22"
23
- grim-indexer-version:
24
- description: npm version or range of grim-indexer to run.
25
- type: string
26
- required: false
27
- default: latest
28
- out-dir:
29
- description: Directory `grim-indexer build` writes the site into.
30
- type: string
31
- required: false
32
- default: dist
33
-
34
- permissions: {}
35
-
36
- concurrency:
37
- group: grim-indexer-pages
38
- cancel-in-progress: false
39
-
40
- jobs:
41
- build:
42
- runs-on: ubuntu-latest
43
- permissions:
44
- contents: read
45
- steps:
46
- - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
47
- with:
48
- persist-credentials: false
49
-
50
- - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
51
- with:
52
- node-version: ${{ inputs.node-version }}
53
-
54
- # Inputs reach the shell through env vars, never through `run:`
55
- # interpolation — a caller-supplied value must not be able to close
56
- # the quoting and append a command.
57
- - name: Build index
58
- env:
59
- VERSION: ${{ inputs.grim-indexer-version }}
60
- OUT_DIR: ${{ inputs.out-dir }}
61
- run: npx --yes "@grimoire-rs/indexer@${VERSION}" build --out-dir "${OUT_DIR}"
62
-
63
- - uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
64
-
65
- - uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
66
- with:
67
- path: ${{ inputs.out-dir }}
68
-
69
- deploy:
70
- needs: build
71
- runs-on: ubuntu-latest
72
- permissions:
73
- pages: write
74
- id-token: write
75
- environment:
76
- name: github-pages
77
- url: ${{ steps.deployment.outputs.page_url }}
78
- steps:
79
- - id: deployment
80
- uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0
@@ -1,88 +0,0 @@
1
- # SPDX-License-Identifier: Apache-2.0
2
- # Copyright 2026 The Grimoire Authors
3
- #
4
- # Reusable workflow: the contribution gate for an index repo.
5
- #
6
- # Runs from the TRUSTED base checkout under `pull_request_target`, because
7
- # the gate needs a forge token to resolve numeric namespace-owner ids. The
8
- # PR head is checked out into a SEPARATE directory and consumed as DATA
9
- # ONLY — nothing in it is executed, imported, installed, or interpolated
10
- # into a command. `@grimoire-rs/indexer` itself comes from npm, never from the PR.
11
- #
12
- # Do not add a `run:` step that touches `pr-tree/`, and never add
13
- # `npm ci`/`npm install` — that would execute contributor code with a
14
- # write-capable token.
15
- #
16
- # The gate contract is the exit code of `grim-indexer validate`:
17
- # 0 -> eligible for auto-merge
18
- # non-zero -> manual review required
19
- # so this job's success/failure IS the gate. Branch protection on the
20
- # calling repo turns that into a merge decision.
21
- #
22
- # Copy this file to `.github/workflows/index-validate.yml` in this repo — a
23
- # reusable workflow must live directly in `.github/workflows/`, GitHub does
24
- # not resolve subdirectories.
25
- name: grim-indexer validate
26
-
27
- on:
28
- workflow_call:
29
- inputs:
30
- node-version:
31
- description: Node.js version used to run grim-indexer.
32
- type: string
33
- required: false
34
- default: "22"
35
- grim-indexer-version:
36
- description: npm version or range of grim-indexer to run.
37
- type: string
38
- required: false
39
- default: latest
40
-
41
- permissions: {}
42
-
43
- jobs:
44
- validate:
45
- runs-on: ubuntu-latest
46
- permissions:
47
- contents: read
48
- pull-requests: read
49
- steps:
50
- # Trusted: the committed state the PR proposes to change.
51
- - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
52
- with:
53
- persist-credentials: false
54
-
55
- # Untrusted: PR head, as data. `persist-credentials: false` keeps a
56
- # token out of the tree the contributor controls.
57
- - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
58
- with:
59
- ref: ${{ github.event.pull_request.head.sha }}
60
- path: pr-tree
61
- persist-credentials: false
62
-
63
- - uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
64
- with:
65
- node-version: ${{ inputs.node-version }}
66
-
67
- # Changed paths come from the API, not from a diff of the untrusted
68
- # tree. `jq -r` output is written to a file and passed via `xargs -a`
69
- # so a crafted filename can never reach the shell as syntax.
70
- - name: Collect changed paths
71
- env:
72
- GH_TOKEN: ${{ github.token }}
73
- REPO: ${{ github.repository }}
74
- PR: ${{ github.event.pull_request.number }}
75
- run: |
76
- set -euo pipefail
77
- gh api --paginate "repos/${REPO}/pulls/${PR}/files" \
78
- --jq '.[] | select(.status != "removed") | .filename' \
79
- | grep -E '^index/' > changed.txt || : > changed.txt
80
-
81
- - name: Validate contribution
82
- env:
83
- VERSION: ${{ inputs.grim-indexer-version }}
84
- GITHUB_TOKEN: ${{ github.token }}
85
- run: |
86
- set -euo pipefail
87
- xargs -a changed.txt npx --yes "@grimoire-rs/indexer@${VERSION}" validate \
88
- --forge github --root . --pr-tree pr-tree