@hamedb89/localghost 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
@@ -8,6 +8,8 @@ Buh. Friendly local hostnames for app repos.
8
8
 
9
9
  [![CI](https://github.com/hamedb89/localghost/actions/workflows/ci.yml/badge.svg)](https://github.com/hamedb89/localghost/actions/workflows/ci.yml)
10
10
  [![GitHub Pages](https://github.com/hamedb89/localghost/actions/workflows/pages.yml/badge.svg)](https://github.com/hamedb89/localghost/actions/workflows/pages.yml)
11
+ [![Publish npm](https://github.com/hamedb89/localghost/actions/workflows/publish-npm.yml/badge.svg)](https://github.com/hamedb89/localghost/actions/workflows/publish-npm.yml)
12
+ [![npm version](https://img.shields.io/badge/npm-v0.1.3-CB3837?logo=npm)](https://www.npmjs.com/package/@hamedb89/localghost)
11
13
 
12
14
  Localghost is a tiny Node.js CLI for local HTTPS domains in app repos. It gives each project one small contract for `.localhost` hostnames, Caddy reverse proxies, Vite `allowedHosts`, and the system hosts file, so developers can open `https://app.localhost/` instead of remembering which localhost port belongs to which process.
13
15
 
package/docs/github.md CHANGED
@@ -120,10 +120,48 @@ npm run release:check
120
120
 
121
121
  That command typechecks, builds the package, builds the static site, and runs `npm pack --dry-run`.
122
122
 
123
- `.github/workflows/publish-npm.yml` publishes to npm from a published GitHub release or manual workflow dispatch. The workflow reruns `npm run release:check` before publishing and uses:
123
+ `.github/workflows/publish-npm.yml` publishes to npm when a `v*` tag is pushed, or from manual workflow dispatch. The workflow checks that tag names match `package.json` versions, reruns `npm run release:check`, and then uses:
124
124
 
125
125
  ```sh
126
- npm publish --access public --provenance
126
+ npm run publish:public
127
127
  ```
128
128
 
129
- Configure npm trusted publishing for `hamedb89/localghost` before relying on the release workflow. Local manual publishes are guarded by the `prepublishOnly` package hook, which runs the same release check.
129
+ That package script runs `npm publish --access public --provenance`.
130
+
131
+ Configure npm trusted publishing for `hamedb89/localghost` before relying on the release workflow. On npmjs.com, open the package settings and add a trusted publisher with:
132
+
133
+ ```txt
134
+ Provider: GitHub Actions
135
+ Organization or user: hamedb89
136
+ Repository: localghost
137
+ Workflow filename: publish-npm.yml
138
+ Environment name: npm
139
+ Allowed actions: npm publish
140
+ ```
141
+
142
+ The workflow must keep `id-token: write`, run on a GitHub-hosted runner, and use a recent npm CLI. Trusted publishing does not need an `NPM_TOKEN` secret. npm automatically generates provenance for public packages published from public GitHub repositories through trusted publishing.
143
+
144
+ If the workflow reaches `npm publish` and npm returns `404 Not Found` or a permission-flavored 404 for `@hamedb89/localghost`, recheck the trusted publisher fields above. The package, repository, workflow filename, environment name, and allowed action must match exactly.
145
+
146
+ Local manual publishes are guarded by the `prepublishOnly` package hook, which runs the same release check.
147
+
148
+ ## Patch Release Workflow
149
+
150
+ Use patch releases for docs, packaging metadata, small fixes, and backwards-compatible CLI/API changes. Do not overwrite a published npm version; npm package versions are immutable, and git tags should continue to identify the source that produced that published package.
151
+
152
+ For a normal patch release:
153
+
154
+ ```sh
155
+ git status --short
156
+ npm run release:check
157
+ npm version patch
158
+ git push origin main --tags
159
+ ```
160
+
161
+ Pushing the `v*` tag starts the npm publish workflow automatically. The workflow reruns `npm run release:check` before publishing. Create the GitHub release afterwards if you want release notes on GitHub.
162
+
163
+ If publishing from a local terminal instead of GitHub Actions, omit provenance and provide the npm two-factor code:
164
+
165
+ ```sh
166
+ npm publish --access public --otp=123456
167
+ ```
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@hamedb89/localghost",
3
- "version": "0.1.0",
3
+ "version": "0.1.3",
4
4
  "description": "Friendly local HTTPS hostnames for app repos with .localghost, Caddy, /etc/hosts, and Vite.",
5
5
  "type": "module",
6
6
  "bin": {
7
- "localghost": "./dist/cli.js"
7
+ "localghost": "dist/cli.js"
8
8
  },
9
9
  "exports": {
10
10
  ".": {
@@ -48,6 +48,7 @@
48
48
  "pack:dry": "npm pack --dry-run",
49
49
  "release:check": "npm run typecheck && npm run build && npm run site:build && npm pack --dry-run",
50
50
  "site:build": "node scripts/build-site.mjs",
51
+ "version": "node scripts/sync-readme-version.mjs && git add README.md",
51
52
  "publish:public": "npm publish --access public --provenance"
52
53
  },
53
54
  "dependencies": {