@exor404/mdslides 0.1.0 → 0.1.2

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 (2) hide show
  1. package/README.md +49 -16
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -147,33 +147,66 @@ fragments shown). It uses [Playwright](https://playwright.dev) if installed
147
147
  Releases go to the **public npm registry** (npmjs.com), so anyone can
148
148
  `npx @exor404/mdslides`. A tag-triggered GitHub Actions pipeline
149
149
  ([`.github/workflows/package-publish.yml`](.github/workflows/package-publish.yml))
150
- publishes via **OIDC Trusted Publishing** GitHub mints a one-time identity
151
- token for the run, so **no npm token or secret is ever stored**.
150
+ does the publishing for you: it runs **only when you push a `v*` tag**, verifies
151
+ the tag matches `package.json`, and runs `npm publish` against npmjs.com using an
152
+ automation token stored as the `NPM_TOKEN` repository secret.
152
153
 
153
- **One-time setup** (needed once, because Trusted Publishing attaches to an
154
- existing package):
154
+ ### How the pipeline works
155
155
 
156
- ```bash
157
- npm login # browser sign-in to npmjs.com
158
- npm publish --access public # publish the first version by hand
159
156
  ```
157
+ push tag v0.1.2 ──► GitHub Actions ──► checkout ──► setup Node 22
158
+
159
+ ├─ guard: tag (v0.1.2) must equal
160
+ │ package.json "version" (0.1.2),
161
+ │ else the run fails
162
+
163
+ └─ npm publish (auth: NPM_TOKEN)
164
+ └──► npmjs.com
165
+ ```
166
+
167
+ The version guard means the git tag and the published version can never drift —
168
+ if they disagree, the run stops before publishing.
169
+
170
+ ### One-time setup
171
+
172
+ You only do this once. It wires an npm token into the repo so Actions can publish
173
+ on your behalf.
160
174
 
161
- Then on npmjs.com open the package → **Settings Trusted Publisher GitHub
162
- Actions** and register:
175
+ 1. **Create an npm automation token.** On npmjs.com: avatar → **Access Tokens**
176
+ **Generate New Token** → **Automation** (or a **Granular** token scoped to the
177
+ `@exor404/mdslides` package with **Read and write**). Copy the value — npm
178
+ shows it only once.
179
+ 2. **Add it to GitHub as a secret.** Repo → **Settings** → **Secrets and
180
+ variables** → **Actions** → **New repository secret**. Name it exactly
181
+ `NPM_TOKEN`, paste the token, **Add secret**. (It's a *secret*, not a
182
+ *variable* — secrets are encrypted and hidden from logs.)
163
183
 
164
- - **Repository:** `eXor404/mdslides`
165
- - **Workflow filename:** `package-publish.yml`
184
+ > The very first version must exist on npm before automation can update it.
185
+ > If the package isn't published yet, do one manual publish first:
186
+ > `npm login && npm publish --access public`.
166
187
 
167
- After that, every release is automatic:
188
+ ### Cutting a release
189
+
190
+ Once the secret is in place, every release is three commands:
168
191
 
169
192
  ```bash
170
- npm version patch # bumps package.json (0.1.0 → 0.1.1) and tags v0.1.1
193
+ npm version patch # bumps package.json (0.1.1 → 0.1.2) and commits + tags v0.1.2
171
194
  git push origin main # push the version-bump commit
172
- git push origin v0.1.1 # push the tag → the pipeline publishes, tokenlessly
195
+ git push origin v0.1.2 # push the tag → the pipeline publishes
173
196
  ```
174
197
 
175
- `npm version` creates the matching `vX.Y.Z` tag for you. The workflow refuses
176
- to publish if the tag and `package.json` version disagree, so they can't drift.
198
+ `npm version patch` (or `minor` / `major`) bumps `package.json`, makes the commit,
199
+ and creates the matching `vX.Y.Z` tag in one step. Pushing that tag is what
200
+ triggers the workflow. Watch it run under the repo's **Actions** tab; when it goes
201
+ green the new version is live on npm.
202
+
203
+ **Prefer to bump by hand?** Edit `"version"` in `package.json`, then:
204
+
205
+ ```bash
206
+ git commit -am "🔖 Release 0.1.2"
207
+ git tag v0.1.2 # must match package.json exactly, or the guard fails
208
+ git push && git push --tags
209
+ ```
177
210
 
178
211
  ## Requirements
179
212
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@exor404/mdslides",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Markdown in, presentation out.",
5
5
  "type": "module",
6
6
  "bin": {