Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- run: bun install --frozen-lockfile
- run: bun run check
- run: bun prettier --check .
- run: bun test tests/unit/ tests/e2e/
- run: bun run build
2 changes: 1 addition & 1 deletion .vitepress/theme/components/HomeCTA.vue
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function copyCommand() {
</div>
<div class="home-cta__actions">
<a
href="/srcpack/guide/getting-started"
href="/srcpack/getting-started"
class="home-cta__button home-cta__button--primary"
>
Read the Docs
Expand Down
56 changes: 56 additions & 0 deletions .vitepress/theme/components/HomeProductHuntBadge.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<script setup lang="ts">
import { computed } from "vue";

const isDark = computed(() => {
// VitePress specific approach to check if dark mode is active might be needed,
// but for the embed, the theme parameter controls the visual.
// The user requested "Option 2", which has theme=light fixed in the URL.
// We'll keep it simple for now as requested.
return false;
});
</script>

<template>
<div class="ph-container">
<a
href="https://www.producthunt.com/products/srcpack?embed=true&utm_source=badge-featured&utm_medium=badge&utm_campaign=badge-srcpack"
target="_blank"
rel="noopener noreferrer"
class="ph-link"
>
<img
src="https://api.producthunt.com/widgets/embed-image/v1/featured.svg?post_id=1064423&theme=light"
alt="srcpack - Bundle your codebase into LLM-ready context files | Product Hunt"
style="width: 250px; height: 54px"
width="250"
height="54"
/>
</a>
</div>
</template>

<style scoped>
.ph-container {
display: flex;
flex-direction: column;
align-items: center;
margin-top: 24px;
margin-bottom: 24px;
}

.ph-link {
transition: opacity 0.25s;
}

.ph-link:hover {
opacity: 0.8;
}

/* Ensure it looks good on mobile */
@media (max-width: 640px) {
.ph-container {
margin-top: 16px;
margin-bottom: 32px;
}
}
</style>
8 changes: 6 additions & 2 deletions .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
// https://vitepress.dev/guide/custom-theme
import { h } from "vue";
import type { Theme } from "vitepress";
import DefaultTheme from "vitepress/theme";
import { h } from "vue";
import HomeCustomSections from "./components/HomeCustomSections.vue";
import HomeProductHuntBadge from "./components/HomeProductHuntBadge.vue";
import "./style.css";

export default {
extends: DefaultTheme,
Layout: () => {
return h(DefaultTheme.Layout, null, {
// https://vitepress.dev/guide/extending-default-theme#layout-slots
"home-features-after": () => h(HomeCustomSections),
"home-features-after": () => [
h(HomeCustomSections),
h(HomeProductHuntBadge),
],
});
},
} satisfies Theme;
31 changes: 19 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,14 @@ Or add to `package.json`:

### Options

| Option | Default | Description |
| --------- | ---------- | -------------------------------- |
| `outDir` | `.srcpack` | Output directory for bundles |
| `bundles` | — | Named bundles with glob patterns |
| `upload` | — | Upload destination(s) |
| Option | Default | Description |
| ------------- | ---------- | -------------------------------------- |
| `outDir` | `.srcpack` | Output directory for bundles |
| `emptyOutDir` | `true`\* | Empty output directory before bundling |
| `bundles` | — | Named bundles with glob patterns |
| `upload` | — | Upload destination(s) |

\*`emptyOutDir` defaults to `true` when `outDir` is inside project root. When `outDir` is outside root, a warning is emitted unless explicitly set.

### Bundle Config

Expand All @@ -70,7 +73,8 @@ Or add to `package.json`:
{
include: "src/**/*",
outfile: "~/Downloads/bundle.txt", // custom output path
index: true // include index header (default)
index: true, // include index header (default)
prompt: "./prompts/review.md" // prepend from file (or inline text)
}
```

Expand All @@ -90,6 +94,7 @@ export default defineConfig({
folderId: "1ABC...", // Google Drive folder ID (from URL)
clientId: "...",
clientSecret: "...",
exclude: ["local"], // skip specific bundles
},
});
```
Expand Down Expand Up @@ -127,12 +132,14 @@ export function utils() {
## CLI

```bash
npx srcpack # Bundle all, upload if configured
npx srcpack web api # Bundle specific bundles only
npx srcpack --dry-run # Preview without writing files
npx srcpack --no-upload # Bundle only, skip upload
npx srcpack init # Interactive config setup
npx srcpack login # Authenticate with Google Drive
npx srcpack # Bundle all, upload if configured
npx srcpack web api # Bundle specific bundles only
npx srcpack --dry-run # Preview without writing files
npx srcpack --emptyOutDir # Empty output directory before bundling
npx srcpack --no-emptyOutDir # Keep existing files in output directory
npx srcpack --no-upload # Bundle only, skip upload
npx srcpack init # Interactive config setup
npx srcpack login # Authenticate with Google Drive
```

## API
Expand Down
Loading