Skip to content

Commit 21aa306

Browse files
CopilotZeroAurora
andauthored
ci: publish to npm
* Initial plan * Initial analysis complete - ready to create npm publishing workflow Co-authored-by: ZeroAurora <25359455+ZeroAurora@users.noreply.github.com> * Create npm publishing workflow for @zeroaurora/elysia-htmx Co-authored-by: ZeroAurora <25359455+ZeroAurora@users.noreply.github.com> * Update workflows to use Bun instead of npm and test on Node.js 22/24 Co-authored-by: ZeroAurora <25359455+ZeroAurora@users.noreply.github.com> * Use bun pm pack * Remove dep on Node --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: ZeroAurora <25359455+ZeroAurora@users.noreply.github.com> Co-authored-by: ZeroAurora <zeroaurora233@outlook.com>
1 parent c367f4f commit 21aa306

5 files changed

Lines changed: 103 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout
14+
uses: actions/checkout@v4
15+
16+
- name: Setup Bun
17+
uses: oven-sh/setup-bun@v2
18+
19+
- name: Install dependencies
20+
run: bun install
21+
22+
- name: Lint
23+
run: bun run lint
24+
25+
- name: Build
26+
run: bun run build
27+
28+
- name: Check package can be published
29+
run: bun pm pack --dry-run

.github/workflows/publish.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish to NPM
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
contents: read
12+
id-token: write
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v4
16+
17+
- name: Setup Bun
18+
uses: oven-sh/setup-bun@v2
19+
20+
- name: Install dependencies
21+
run: bun install
22+
23+
- name: Lint
24+
run: bun run lint
25+
26+
- name: Build
27+
run: bun run build
28+
29+
- name: Publish to NPM
30+
run: bun publish
31+
env:
32+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# dependencies (bun install)
22
node_modules
3+
package-lock.json
34

45
# output
56
out

README.md

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,26 @@
1-
# elysia-htmx
1+
# @zeroaurora/elysia-htmx
22

33
Make it easier to use HTMX headers with Elysia.
44

5+
## Installation
6+
7+
```bash
8+
npm install @zeroaurora/elysia-htmx
9+
```
10+
511
## Usage
612

713
Refer to `example/` for now. Full docs coming later!
814

15+
## Publishing
16+
17+
This package is automatically published to npm as `@zeroaurora/elysia-htmx` when a new release is created on GitHub. The publishing workflow will:
18+
19+
1. Install dependencies
20+
2. Run linting checks
21+
3. Build the package
22+
4. Publish to npm
23+
924
## License
1025

1126
MIT

package.json

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,35 @@
11
{
2-
"name": "elysia-htmx",
2+
"name": "@zeroaurora/elysia-htmx",
33
"type": "module",
44
"version": "0.1.1",
5+
"description": "Make it easier to use HTMX headers with Elysia",
6+
"author": "ZeroAurora",
7+
"license": "MIT",
8+
"homepage": "https://github.com/ZeroAurora/elysia-htmx",
9+
"repository": {
10+
"type": "git",
11+
"url": "https://github.com/ZeroAurora/elysia-htmx.git"
12+
},
13+
"bugs": {
14+
"url": "https://github.com/ZeroAurora/elysia-htmx/issues"
15+
},
16+
"keywords": ["elysia", "htmx", "typescript", "web", "framework"],
17+
"main": "dist/index.js",
518
"module": "dist/index.js",
19+
"types": "dist/index.d.ts",
20+
"files": [
21+
"LICENSE",
22+
"README.md",
23+
"dist"
24+
],
25+
"publishConfig": {
26+
"access": "public"
27+
},
628
"scripts": {
729
"build": "tsup",
830
"lint": "eslint",
9-
"lint:fix": "eslint --fix"
31+
"lint:fix": "eslint --fix",
32+
"prepublishOnly": "bun run build"
1033
},
1134
"peerDependencies": {
1235
"@elysiajs/html": ">=1.4.0 <2.0.0",

0 commit comments

Comments
 (0)