Skip to content

Commit 9f99ad0

Browse files
authored
ci: add npm publish workflow (#7)
1 parent 0e55627 commit 9f99ad0

4 files changed

Lines changed: 42 additions & 3 deletions

File tree

.github/workflows/release.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags: ["v*"]
6+
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
environment: release
11+
permissions:
12+
id-token: write
13+
contents: read
14+
steps:
15+
- uses: actions/checkout@v6
16+
- uses: oven-sh/setup-bun@v2
17+
with:
18+
bun-version: latest
19+
- uses: actions/setup-node@v4
20+
with:
21+
node-version: 22
22+
registry-url: https://registry.npmjs.org
23+
- run: bun install --frozen-lockfile
24+
- run: bun run build
25+
- run: npm publish --provenance --access public

docs/configuration.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export default defineConfig({
2727
| Option | Type | Default | Description |
2828
| ------------- | --------- | --------------- | -------------------------------------- |
2929
| `root` | `string` | `process.cwd()` | Project root directory |
30-
| `outDir` | `string` | `.srcpack` | Output directory for bundles |
30+
| `outDir` | `string` | `.srcpack` | Output directory (relative to root) |
3131
| `emptyOutDir` | `boolean` | `true`\* | Empty output directory before bundling |
3232
| `bundles` | `object` || Named bundles (required) |
3333
| `upload` | `object` || Upload destination |
@@ -47,6 +47,20 @@ export default defineConfig({
4747
});
4848
```
4949

50+
### outDir
51+
52+
Output directory for bundle files. Can be absolute or relative to project root.
53+
54+
```ts
55+
export default defineConfig({
56+
root: "./packages/app",
57+
outDir: "dist", // writes to packages/app/dist/
58+
bundles: {
59+
app: "src/**/*",
60+
},
61+
});
62+
```
63+
5064
## Bundle Definitions
5165

5266
Each bundle can be defined in three ways:

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "srcpack",
3-
"version": "0.1.13",
3+
"version": "0.1.14",
44
"description": "Zero-config CLI for bundling code into LLM-optimized context files",
55
"keywords": [
66
"llm",

src/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const ConfigSchema = z.object({
7272
* @default process.cwd()
7373
*/
7474
root: z.string().default(""),
75-
/** Output directory for bundle files. Defaults to ".srcpack". */
75+
/** Output directory for bundle files (relative to root). Defaults to ".srcpack". */
7676
outDir: z.string().default(".srcpack"),
7777
/** Empty outDir before bundling. Auto-enabled when outDir is inside project root. */
7878
emptyOutDir: z.boolean().optional(),

0 commit comments

Comments
 (0)