Skip to content

Commit 911cef1

Browse files
committed
Prepare package publishing workflow
1 parent 665b211 commit 911cef1

14 files changed

Lines changed: 369 additions & 41 deletions

File tree

.github/workflows/ci.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
permissions:
10+
contents: read
11+
12+
env:
13+
BUN_VERSION: "1.3.0"
14+
NODE_VERSION: "20.19.0"
15+
16+
jobs:
17+
verify:
18+
name: Verify
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Bun
26+
uses: oven-sh/setup-bun@v2
27+
with:
28+
bun-version: ${{ env.BUN_VERSION }}
29+
30+
- name: Set up Node
31+
uses: actions/setup-node@v4
32+
with:
33+
node-version: ${{ env.NODE_VERSION }}
34+
35+
- name: Install dependencies
36+
run: bun install --frozen-lockfile
37+
38+
- name: Lint
39+
run: bun run lint
40+
41+
- name: Typecheck
42+
run: bun run typecheck
43+
44+
- name: Test
45+
run: bun test
46+
47+
- name: Build
48+
run: bun run build
49+
50+
- name: Check package contents
51+
run: bun run pack:check

.github/workflows/publish.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
workflow_dispatch:
8+
inputs:
9+
dry_run:
10+
description: Run all checks without publishing to npm.
11+
type: boolean
12+
default: true
13+
14+
permissions:
15+
contents: read
16+
id-token: write
17+
18+
env:
19+
BUN_VERSION: "1.3.0"
20+
NODE_VERSION: "20.19.0"
21+
22+
jobs:
23+
npm:
24+
name: npm
25+
runs-on: ubuntu-latest
26+
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Set up Bun
32+
uses: oven-sh/setup-bun@v2
33+
with:
34+
bun-version: ${{ env.BUN_VERSION }}
35+
36+
- name: Set up Node
37+
uses: actions/setup-node@v4
38+
with:
39+
node-version: ${{ env.NODE_VERSION }}
40+
registry-url: https://registry.npmjs.org
41+
42+
- name: Install dependencies
43+
run: bun install --frozen-lockfile
44+
45+
- name: Lint
46+
run: bun run lint
47+
48+
- name: Typecheck
49+
run: bun run typecheck
50+
51+
- name: Test
52+
run: bun test
53+
54+
- name: Build
55+
run: bun run build
56+
57+
- name: Check package contents
58+
run: bun run pack:check
59+
60+
- name: Publish to npm
61+
if: github.event_name == 'release' || inputs.dry_run == false
62+
env:
63+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
64+
run: npm publish --provenance --access public
65+
66+
- name: Skip publish
67+
if: github.event_name == 'workflow_dispatch' && inputs.dry_run
68+
run: echo "Dry run completed; no package was published."

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
# create-electrobun-stack
22

3+
[![npm version](https://img.shields.io/npm/v/create-electrobun-stack.svg)](https://www.npmjs.com/package/create-electrobun-stack)
4+
[![npm downloads](https://img.shields.io/npm/dm/create-electrobun-stack.svg)](https://www.npmjs.com/package/create-electrobun-stack)
5+
[![Node version](https://img.shields.io/node/v/create-electrobun-stack.svg)](https://www.npmjs.com/package/create-electrobun-stack)
6+
[![Bun >=1.3.0](https://img.shields.io/badge/Bun-%3E%3D1.3.0-000?logo=bun&logoColor=white)](https://bun.sh)
7+
38
Scaffold a production-minded Electrobun desktop app with Bun, React, TypeScript, Vite, Biome, typed Electrobun RPC, and a small set of optional integrations that can be enabled at create time or added later.
49

510
The generator is intentionally explicit: every selected stack option is written to `ces.json`, the generated project README explains what was scaffolded, and the `add` command can use that manifest to enable missing features without asking you to remember the original command.
611

712
## Quick Start
813

914
```bash
10-
bunx create-electrobun-stack my-app
15+
npm create electrobun-stack@latest my-app
1116
cd my-app
1217
bun run dev
1318
```
1419

20+
You can also run it with `npx create-electrobun-stack@latest my-app`, `bunx --bun create-electrobun-stack@latest my-app`, or install it globally with `npm install -g create-electrobun-stack`.
21+
1522
Requirements:
1623

24+
- Node.js `>=20.19.0` to run the published CLI.
1725
- Bun `>=1.3.0`.
1826
- A desktop OS supported by Electrobun for running or building generated apps.
1927

@@ -139,9 +147,13 @@ Some options add commands. For example, `--addons turborepo` adds `bun run check
139147

140148
```bash
141149
bun install
150+
bun run build
142151
bun test
143152
bun run typecheck
144153
bun run lint
154+
npm pack --dry-run
145155
```
146156

147157
The CLI entrypoint is `src/index.ts`. Stack choices live in `src/options.ts`, manifest generation lives in `src/manifest.ts`, and template rendering lives in `src/scaffold.ts`.
158+
159+
The published npm package ships the built CLI from `dist/index.mjs` plus `templates/` and `docs/`. Run `bun run build` before local package checks; `npm pack --dry-run` also runs the build through `prepack`. The bin keeps a Node shebang for npm compatibility; `bunx --bun create-electrobun-stack@latest` forces Bun to run the same built CLI.

biome.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
22
"$schema": "https://biomejs.dev/schemas/2.4.15/schema.json",
3+
"files": {
4+
"includes": ["**", "!dist"]
5+
},
36
"formatter": {
47
"indentStyle": "space",
58
"indentWidth": 2

0 commit comments

Comments
 (0)