srcpack 0.1.7 → 0.1.9
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 +19 -12
- package/dist/bundle.d.ts +2 -1
- package/dist/cli.js +542 -339
- package/dist/config.d.ts +26 -0
- package/dist/index.js +5 -2
- package/package.json +3 -3
- package/src/bundle.ts +63 -5
- package/src/cli.ts +75 -8
- package/src/config.ts +40 -3
package/README.md
CHANGED
|
@@ -48,11 +48,14 @@ Or add to `package.json`:
|
|
|
48
48
|
|
|
49
49
|
### Options
|
|
50
50
|
|
|
51
|
-
| Option
|
|
52
|
-
|
|
|
53
|
-
| `outDir`
|
|
54
|
-
| `
|
|
55
|
-
| `
|
|
51
|
+
| Option | Default | Description |
|
|
52
|
+
| ------------- | ---------- | -------------------------------------- |
|
|
53
|
+
| `outDir` | `.srcpack` | Output directory for bundles |
|
|
54
|
+
| `emptyOutDir` | `true`\* | Empty output directory before bundling |
|
|
55
|
+
| `bundles` | — | Named bundles with glob patterns |
|
|
56
|
+
| `upload` | — | Upload destination(s) |
|
|
57
|
+
|
|
58
|
+
\*`emptyOutDir` defaults to `true` when `outDir` is inside project root. When `outDir` is outside root, a warning is emitted unless explicitly set.
|
|
56
59
|
|
|
57
60
|
### Bundle Config
|
|
58
61
|
|
|
@@ -70,7 +73,8 @@ Or add to `package.json`:
|
|
|
70
73
|
{
|
|
71
74
|
include: "src/**/*",
|
|
72
75
|
outfile: "~/Downloads/bundle.txt", // custom output path
|
|
73
|
-
index: true
|
|
76
|
+
index: true, // include index header (default)
|
|
77
|
+
prompt: "./prompts/review.md" // prepend from file (or inline text)
|
|
74
78
|
}
|
|
75
79
|
```
|
|
76
80
|
|
|
@@ -90,6 +94,7 @@ export default defineConfig({
|
|
|
90
94
|
folderId: "1ABC...", // Google Drive folder ID (from URL)
|
|
91
95
|
clientId: "...",
|
|
92
96
|
clientSecret: "...",
|
|
97
|
+
exclude: ["local"], // skip specific bundles
|
|
93
98
|
},
|
|
94
99
|
});
|
|
95
100
|
```
|
|
@@ -127,12 +132,14 @@ export function utils() {
|
|
|
127
132
|
## CLI
|
|
128
133
|
|
|
129
134
|
```bash
|
|
130
|
-
npx srcpack
|
|
131
|
-
npx srcpack web api
|
|
132
|
-
npx srcpack --dry-run
|
|
133
|
-
npx srcpack --
|
|
134
|
-
npx srcpack
|
|
135
|
-
npx srcpack
|
|
135
|
+
npx srcpack # Bundle all, upload if configured
|
|
136
|
+
npx srcpack web api # Bundle specific bundles only
|
|
137
|
+
npx srcpack --dry-run # Preview without writing files
|
|
138
|
+
npx srcpack --emptyOutDir # Empty output directory before bundling
|
|
139
|
+
npx srcpack --no-emptyOutDir # Keep existing files in output directory
|
|
140
|
+
npx srcpack --no-upload # Bundle only, skip upload
|
|
141
|
+
npx srcpack init # Interactive config setup
|
|
142
|
+
npx srcpack login # Authenticate with Google Drive
|
|
136
143
|
```
|
|
137
144
|
|
|
138
145
|
## API
|
package/dist/bundle.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type BundleConfigInput } from "./config.ts";
|
|
2
2
|
export interface FileEntry {
|
|
3
3
|
path: string;
|
|
4
4
|
lines: number;
|
|
@@ -26,6 +26,7 @@ export declare function resolvePatterns(config: BundleConfigInput, cwd: string):
|
|
|
26
26
|
export declare function formatIndex(index: FileEntry[]): string;
|
|
27
27
|
export interface BundleOptions {
|
|
28
28
|
includeIndex?: boolean;
|
|
29
|
+
prompt?: string;
|
|
29
30
|
}
|
|
30
31
|
/**
|
|
31
32
|
* Create a bundle from a list of files.
|