components-differ 1.0.7 → 1.0.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.
Files changed (60) hide show
  1. package/README.md +191 -16
  2. package/dist/components.d.ts +6 -0
  3. package/dist/components.d.ts.map +1 -0
  4. package/dist/components.js +119 -0
  5. package/dist/components.js.map +1 -0
  6. package/dist/create-diff.d.ts +14 -0
  7. package/dist/create-diff.d.ts.map +1 -0
  8. package/dist/create-diff.js +61 -0
  9. package/dist/create-diff.js.map +1 -0
  10. package/dist/git.d.ts +5 -0
  11. package/dist/git.d.ts.map +1 -0
  12. package/dist/git.js +120 -0
  13. package/dist/git.js.map +1 -0
  14. package/dist/index.d.ts +3 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +132 -0
  17. package/dist/index.js.map +1 -0
  18. package/dist/parse-file-path.d.ts +3 -0
  19. package/dist/parse-file-path.d.ts.map +1 -0
  20. package/dist/parse-file-path.js +53 -0
  21. package/dist/parse-file-path.js.map +1 -0
  22. package/dist/registry.d.ts +3 -0
  23. package/dist/registry.d.ts.map +1 -0
  24. package/dist/registry.js +112 -0
  25. package/dist/registry.js.map +1 -0
  26. package/dist/shadcn-init.d.ts +11 -0
  27. package/dist/shadcn-init.d.ts.map +1 -0
  28. package/dist/shadcn-init.js +208 -0
  29. package/dist/shadcn-init.js.map +1 -0
  30. package/dist/types.d.ts +42 -0
  31. package/dist/types.d.ts.map +1 -0
  32. package/dist/types.js +2 -0
  33. package/dist/types.js.map +1 -0
  34. package/package.json +19 -8
  35. package/index.mjs +0 -114
  36. package/src/components.mjs +0 -98
  37. package/src/create-diff.mjs +0 -91
  38. package/src/git.mjs +0 -141
  39. package/src/parse-file-path.mjs +0 -32
  40. package/tests/fixtures/non-src-dir/app/page.tsx +0 -1
  41. package/tests/fixtures/non-src-dir/components/comp.tsx +0 -1
  42. package/tests/fixtures/non-src-dir/components/ui/new-ui-comp.tsx +0 -1
  43. package/tests/fixtures/non-src-dir/components/ui/select.tsx +0 -1
  44. package/tests/fixtures/non-src-dir/components.json +0 -20
  45. package/tests/fixtures/non-src-dir/hooks/hook.ts +0 -1
  46. package/tests/fixtures/non-src-dir/lib/lib.ts +0 -1
  47. package/tests/fixtures/non-src-dir/non-src-sub/test.ts +0 -1
  48. package/tests/fixtures/non-src-dir/package.json +0 -42
  49. package/tests/fixtures/src-dir/components.json +0 -20
  50. package/tests/fixtures/src-dir/non-src-sub/test.ts +0 -1
  51. package/tests/fixtures/src-dir/package.json +0 -42
  52. package/tests/fixtures/src-dir/src/app/page.tsx +0 -1
  53. package/tests/fixtures/src-dir/src/components/comp.tsx +0 -1
  54. package/tests/fixtures/src-dir/src/components/ui/new-ui-comp.tsx +0 -1
  55. package/tests/fixtures/src-dir/src/components/ui/select.tsx +0 -1
  56. package/tests/fixtures/src-dir/src/hooks/hook.ts +0 -1
  57. package/tests/fixtures/src-dir/src/lib/lib.ts +0 -1
  58. package/tests/tests/__snapshots__/test-fixtures.spec.mjs.snap +0 -129
  59. package/tests/tests/parse-file-path.spec.mjs +0 -105
  60. package/tests/tests/test-fixtures.spec.mjs +0 -86
package/README.md CHANGED
@@ -1,31 +1,206 @@
1
- # ShadCN Project Differ
1
+ # components-differ
2
2
 
3
- This CLI tool figures out the difference between the initial commit of a ShadCN project and the current state of the project and creates a new ShadCN JSON output file with the changes. This ShadCN JSON file can then be used with the ShadCN CLI to generate a new project or add to an existing project.
3
+ `components-differ` is a companion CLI for shadcn/ui projects. It compares the current state of a codebase to its initial shadcn scaffold, then emits an installable registry entry that captures only the changes you made. You can pipe that output straight into the official shadcn CLI to bootstrap new projects, patch existing installs, or maintain a fully fledged custom registry.
4
4
 
5
- # Steps
5
+ ## Features
6
6
 
7
- 1. Create a new NextJS app
8
- 2. Add ShadCN to the app
9
- 3. Create a new initial commit; `rm -fr .git && git init && git add . && git commit -m "Initial commit"` or `npx components-differ --init`
10
- 4. Make your updates to the project
11
- 5. Run the CLI tool; `npx components-differ`
7
+ - Generates shadcn-compatible registry items from real projects
8
+ - Detects component dependencies based on the latest shadcn/ui catalog
9
+ - Understands both `src/` and app-root layouts
10
+ - Skips built-in primitives so the diff contains only custom code
11
+ - Creates or updates `registry.json` in-place (schema: [`registry.json`](https://ui.shadcn.com/docs/registry/registry-json))
12
+ - Supports environment-based configuration for registry metadata
13
+ - Ships with TypeScript types, tests, and build scripts for local development
12
14
 
13
- The reason we are recreating the initial commit is so that the resulting JSON output is only the changes to the project after ShadCN was added, and not the entire project history.
15
+ ## Prerequisites
14
16
 
15
- You can then take the resulting JSON ouput and host it on a URL, then use that with the ShadCN CLI to generate a new project or add to an existing project.
17
+ - Node.js 18+
18
+ - `pnpm` (recommended) or `npm`
19
+ - A project that has already been initialised with the shadcn CLI
20
+
21
+ ## Installation
22
+
23
+ Install globally or run via `npx`:
24
+
25
+ ```bash
26
+ pnpm add -g components-differ
27
+ # or
28
+ npx components-differ --help
29
+ ```
30
+
31
+ During local development, clone the repo and install dependencies:
32
+
33
+ ```bash
34
+ git clone https://github.com/componentshost/components-differ.git
35
+ cd components-differ
36
+ pnpm install
37
+ ```
38
+
39
+ ## Quick Start
40
+
41
+ 1. Create a fresh Next.js app.
42
+ 2. Initialise shadcn/ui (`npx shadcn@latest init`).
43
+ 3. Commit the baseline scaffold:
44
+
45
+ ```bash
46
+ rm -fr .git && git init
47
+ git add .
48
+ git commit -m "Initial shadcn scaffold"
49
+ ```
50
+
51
+ _Tip: use `npx components-differ --init` to automate the reset + commit._
52
+
53
+ 4. Build out your custom components, hooks, utilities, and pages.
54
+ 5. Run the differ:
55
+
56
+ ```bash
57
+ npx components-differ > registry-item.json
58
+ ```
59
+
60
+ 6. Publish or host the JSON output, then use it with the shadcn CLI:
61
+
62
+ ```bash
63
+ npx shadcn@latest add https://example.com/registry-item.json
64
+ ```
65
+
66
+ ## CLI Usage
67
+
68
+ ```bash
69
+ npx components-differ [options]
70
+ ```
71
+
72
+ | Option | Description |
73
+ | --- | --- |
74
+ | `-n, --name <name>` | Override the generated item name (defaults to the current directory name). |
75
+ | `--init` | Reset the git repository and recreate the initial commit (useful for fresh scaffolds). |
76
+ | `--registry [path]` | Create or update a `registry.json` file. If no path is provided, `./registry.json` is used. |
77
+ | `--initshadcn [type]` | Configure shadcn/ui for your project. Detects project type automatically; pass `next` or `vite` to force a specific scaffold. |
78
+
79
+ When `--registry` is omitted, the CLI prints a single registry item (JSON) to stdout. The item includes inferred dependencies, registry dependencies, file payloads, and metadata compatible with the shadcn registry tooling.
80
+
81
+ ### Bootstrapping shadcn/ui
82
+
83
+ Use `--initshadcn` to apply the official shadcn setup steps for supported frameworks:
84
+
85
+ ```bash
86
+ # Auto-detect (looks at package.json)
87
+ npx components-differ --initshadcn
88
+
89
+ # Explicit Vite support (adds Tailwind deps, config files, and runs the shadcn CLI)
90
+ npx components-differ --initshadcn vite
91
+
92
+ # Explicit Next.js support (runs the shadcn CLI in your project)
93
+ npx components-differ --initshadcn next
94
+ ```
95
+
96
+ For Vite projects the command will:
97
+
98
+ - Add `tailwindcss`, `@tailwindcss/vite`, and `@types/node`
99
+ - Locate the first CSS file imported by the Vite entry file (`src/main.{ts,tsx,js,jsx}`) and replace its contents with the Tailwind entrypoint
100
+ - Inject the required `baseUrl`/`paths` aliases into `tsconfig.json` and `tsconfig.app.json`
101
+ - Overwrite `vite.config.ts` with the recommended configuration (includes Tailwind and path aliases)
102
+ - Run the interactive `shadcn@latest init` command
103
+
104
+ Next.js projects skip the file edits (Next provides the required Tailwind setup) and go straight to the `shadcn` CLI.
105
+
106
+ ## Working with `registry.json`
107
+
108
+ Passing `--registry` switches the CLI into registry mode:
109
+
110
+ ```bash
111
+ npx components-differ --registry # writes ./registry.json
112
+ npx components-differ --registry configs/registry.json
113
+ ```
114
+
115
+ - Existing files are parsed and updated; if the item already exists (matching `name`), it is replaced.
116
+ - New files are created with the official schema URL and project metadata.
117
+ - Parent directories are created automatically.
118
+
119
+ ### Registry metadata
120
+
121
+ By default the generated file uses:
122
+
123
+ - `name`: `shadcn`
124
+ - `homepage`: `https://ui.shadcn.com`
125
+
126
+ Override these values by defining environment variables at runtime:
127
+
128
+ ```bash
129
+ REGISTRY_NAME=acme \
130
+ REGISTRY_HOMEPAGE=https://acme.dev \
131
+ npx components-differ --registry
132
+ ```
133
+
134
+ If the variables are absent, the CLI also reads a `.env` file in the project root:
135
+
136
+ ```
137
+ REGISTRY_NAME=acme
138
+ REGISTRY_HOMEPAGE=https://acme.dev
139
+ ```
140
+
141
+ ## Building registry artifacts
142
+
143
+ Add a script to your `package.json` so you can build the registry payload with the official shadcn toolchain:
144
+
145
+ ```json
146
+ {
147
+ "scripts": {
148
+ "registry:build": "shadcn build"
149
+ }
150
+ }
151
+ ```
152
+
153
+ Then run:
16
154
 
17
155
  ```bash
18
- npx shadcn@latest init http://your-json-output-url
156
+ pnpm registry:build
19
157
  ```
20
158
 
21
- You can use the `--src-dir` flag if you want to use the `src` directory in your project.
159
+ Combine this with the differ to capture changes, sync `registry.json`, and ship ready-to-install artifacts in a single workflow.
160
+
161
+ ## Recommended Workflow
22
162
 
23
- Or you can add the JSON output to an existing project:
163
+ 1. Run `pnpm build && pnpm test` to ensure your project is green.
164
+ 2. Execute `npx components-differ --registry` to keep `registry.json` current.
165
+ 3. Publish the updated registry (via HTTP or a git-backed registry).
166
+ 4. Consumers install the latest slice using `npx shadcn@latest add <url>`.
167
+
168
+ ## Development Scripts
169
+
170
+ | Command | Description |
171
+ | --- | --- |
172
+ | `pnpm build` | Compile TypeScript sources to `dist/`. |
173
+ | `pnpm test` | Run the Vitest suite once. |
174
+ | `pnpm test:watch` | Run tests in watch mode. |
175
+ | `pnpm bump` | Increment the package version (patch) and update `package.json`. |
176
+ | `pnpm registry:build` | Run the shadcn CLI build pipeline (requires `shadcn` CLI). |
177
+
178
+ During development you can execute the CLI locally:
24
179
 
25
180
  ```bash
26
- npx shadcn@latest add http://your-json-output-url
181
+ pnpm build
182
+ node dist/index.js --registry
27
183
  ```
28
184
 
29
- # Why is this useful?
185
+ Or link it globally:
186
+
187
+ ```bash
188
+ pnpm link --global
189
+ components-differ --help
190
+ ```
191
+
192
+ ## Releasing
193
+
194
+ 1. Bump the version: `pnpm bump` (or adjust `package.json` manually).
195
+ 2. Rebuild and test: `pnpm build && pnpm test`.
196
+ 3. Publish: `npm publish`.
197
+
198
+ Ensure you are authenticated with an npm account that has publish rights (`npm whoami`).
199
+
200
+ ## Contributing
201
+
202
+ Contributions are welcome! Please open an issue or pull request with a clear description of the change. Run the full test suite before submitting (`pnpm test`), and include updates to the documentation where relevant.
203
+
204
+ ## License
30
205
 
31
- This allows library maintainers or SaaS services to create a one step installer for their library or service into an existing project, or to bootstrap a new project with the library or service.
206
+ MIT © Izet Molla
@@ -0,0 +1,6 @@
1
+ import type { ComponentsConfig, FileEntry } from "./types.js";
2
+ export declare function findComponentFiles(config: ComponentsConfig, originalFiles: FileEntry[]): string[];
3
+ export declare function readComponentsManifest(dir: string): ComponentsConfig;
4
+ export declare function getAliasedPaths(config: ComponentsConfig): string[];
5
+ export declare function isBuiltinComponent(config: ComponentsConfig, filePath: string): boolean;
6
+ //# sourceMappingURL=components.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAyE9D,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,EAAE,aAAa,EAAE,SAAS,EAAE,GAAG,MAAM,EAAE,CAoBjG;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,CAepE;AAED,wBAAgB,eAAe,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,EAAE,CAQlE;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAQtF"}
@@ -0,0 +1,119 @@
1
+ import path from "node:path";
2
+ import fs from "node:fs";
3
+ const WHITELISTED_COMPONENTS = new Set([
4
+ "accordion",
5
+ "alert-dialog",
6
+ "alert",
7
+ "aspect-ratio",
8
+ "avatar",
9
+ "badge",
10
+ "breadcrumb",
11
+ "button-group",
12
+ "button",
13
+ "calendar",
14
+ "card",
15
+ "carousel",
16
+ "chart",
17
+ "checkbox",
18
+ "collapsible",
19
+ "combobox",
20
+ "command",
21
+ "context-menu",
22
+ "data-table",
23
+ "date-picker",
24
+ "dialog",
25
+ "drawer",
26
+ "dropdown-menu",
27
+ "empty",
28
+ "field",
29
+ "form",
30
+ "hover-card",
31
+ "input-group",
32
+ "input-otp",
33
+ "input",
34
+ "item",
35
+ "kbd",
36
+ "label",
37
+ "menubar",
38
+ "native-select",
39
+ "navigation-menu",
40
+ "pagination",
41
+ "popover",
42
+ "progress",
43
+ "radio-group",
44
+ "resizable",
45
+ "scroll-area",
46
+ "select",
47
+ "separator",
48
+ "sheet",
49
+ "sidebar",
50
+ "skeleton",
51
+ "slider",
52
+ "sonner",
53
+ "spinner",
54
+ "switch",
55
+ "table",
56
+ "tabs",
57
+ "textarea",
58
+ "toast",
59
+ "toggle-group",
60
+ "toggle",
61
+ "tooltip",
62
+ "typography",
63
+ ]);
64
+ function resolveAlias(config, key) {
65
+ const alias = config[key];
66
+ if (typeof alias !== "string") {
67
+ throw new Error(`Missing alias for ${key.toString()} in components configuration`);
68
+ }
69
+ return alias.replace("@/", config.isSrcDir ? "src/" : "");
70
+ }
71
+ export function findComponentFiles(config, originalFiles) {
72
+ const registryDependencies = [];
73
+ const componentDirectory = resolveAlias(config, "ui");
74
+ for (const { path: filePath } of originalFiles) {
75
+ if (!filePath.startsWith(componentDirectory)) {
76
+ continue;
77
+ }
78
+ const extension = path.extname(filePath);
79
+ if (extension !== ".tsx" && extension !== ".jsx") {
80
+ continue;
81
+ }
82
+ const fileName = path.basename(filePath, extension);
83
+ if (WHITELISTED_COMPONENTS.has(fileName)) {
84
+ registryDependencies.push(fileName);
85
+ }
86
+ }
87
+ return registryDependencies;
88
+ }
89
+ export function readComponentsManifest(dir) {
90
+ const manifestPath = path.join(dir, "./components.json");
91
+ if (!fs.existsSync(manifestPath)) {
92
+ throw new Error("Components manifest not found");
93
+ }
94
+ const contents = fs.readFileSync(manifestPath, "utf-8");
95
+ const manifest = JSON.parse(contents);
96
+ const config = manifest.aliases;
97
+ if (!config) {
98
+ throw new Error("Invalid components manifest format: missing aliases");
99
+ }
100
+ return config;
101
+ }
102
+ export function getAliasedPaths(config) {
103
+ return [
104
+ config.components.replace("@/", ""),
105
+ config.utils.replace("@/", ""),
106
+ config.ui.replace("@/", ""),
107
+ config.lib.replace("@/", ""),
108
+ config.hooks.replace("@/", ""),
109
+ ];
110
+ }
111
+ export function isBuiltinComponent(config, filePath) {
112
+ const uiDirectory = config.ui.replace("@/", "");
113
+ if (!filePath.startsWith(uiDirectory)) {
114
+ return false;
115
+ }
116
+ const componentName = path.basename(filePath, path.extname(filePath));
117
+ return WHITELISTED_COMPONENTS.has(componentName);
118
+ }
119
+ //# sourceMappingURL=components.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"components.js","sourceRoot":"","sources":["../src/components.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,MAAM,SAAS,CAAC;AAIzB,MAAM,sBAAsB,GAAG,IAAI,GAAG,CAAC;IACrC,WAAW;IACX,cAAc;IACd,OAAO;IACP,cAAc;IACd,QAAQ;IACR,OAAO;IACP,YAAY;IACZ,cAAc;IACd,QAAQ;IACR,UAAU;IACV,MAAM;IACN,UAAU;IACV,OAAO;IACP,UAAU;IACV,aAAa;IACb,UAAU;IACV,SAAS;IACT,cAAc;IACd,YAAY;IACZ,aAAa;IACb,QAAQ;IACR,QAAQ;IACR,eAAe;IACf,OAAO;IACP,OAAO;IACP,MAAM;IACN,YAAY;IACZ,aAAa;IACb,WAAW;IACX,OAAO;IACP,MAAM;IACN,KAAK;I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MAAwB,EAAE,QAAgB;IAC3E,MAAM,WAAW,GAAG,MAAM,CAAC,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;IAChD,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,WAAW,CAAC,EAAE,CAAC;QACtC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,aAAa,GAAG,IAAI,CAAC,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;IACtE,OAAO,sBAAsB,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC;AACnD,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { ComponentsConfig, DiffResult, FileEntry } from "./types.js";
2
+ interface CreateDiffParams {
3
+ name: string;
4
+ config: ComponentsConfig & {
5
+ isSrcDir: boolean;
6
+ };
7
+ alteredFiles: FileEntry[];
8
+ specificFiles: Record<string, string>;
9
+ currentFiles: FileEntry[];
10
+ currentPackageJson: string;
11
+ }
12
+ export declare function createDiff({ name, config, alteredFiles, specificFiles, currentFiles, currentPackageJson, }: CreateDiffParams): DiffResult;
13
+ export {};
14
+ //# sourceMappingURL=create-diff.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-diff.d.ts","sourceRoot":"","sources":["../src/create-diff.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAE1E,UAAU,gBAAgB;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,gBAAgB,GAAG;QAAE,QAAQ,EAAE,OAAO,CAAA;KAAE,CAAC;IACjD,YAAY,EAAE,SAAS,EAAE,CAAC;IAC1B,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,YAAY,EAAE,SAAS,EAAE,CAAC;IAC1B,kBAAkB,EAAE,MAAM,CAAC;CAC5B;AAyDD,wBAAgB,UAAU,CAAC,EACzB,IAAI,EACJ,MAAM,EACN,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,kBAAkB,GACnB,EAAE,gBAAgB,GAAG,UAAU,CAwB/B"}
@@ -0,0 +1,61 @@
1
+ import { findComponentFiles, getAliasedPaths, isBuiltinComponent } from "./components.js";
2
+ import { parseFilePath } from "./parse-file-path.js";
3
+ function addFile(output, config, inSrcDir, relativeFilePath, content) {
4
+ if (isBuiltinComponent(config, relativeFilePath)) {
5
+ return;
6
+ }
7
+ output.files.push(parseFilePath(inSrcDir, config, `./${relativeFilePath}`, content));
8
+ }
9
+ function addDependencies(output, initialPackageContents, currentPackageContents) {
10
+ const initialPackageJson = initialPackageContents ? JSON.parse(initialPackageContents) : {};
11
+ const currentPackageJson = JSON.parse(currentPackageContents);
12
+ const initialDependencies = (initialPackageJson.dependencies ?? {});
13
+ const initialDevDependencies = (initialPackageJson.devDependencies ?? {});
14
+ const currentDependencies = (currentPackageJson.dependencies ?? {});
15
+ const currentDevDependencies = (currentPackageJson.devDependencies ?? {});
16
+ output.dependencies = Object.keys(currentDependencies).filter((dep) => !(dep in initialDependencies));
17
+ output.devDependencies = Object.keys(currentDevDependencies).filter((dep) => !(dep in initialDevDependencies));
18
+ }
19
+ function scanWithSrcDir(output, config, alteredFiles) {
20
+ for (const { path, content } of alteredFiles) {
21
+ if (path.startsWith("src/")) {
22
+ addFile(output, config, true, path.replace(/^src\//, ""), content);
23
+ }
24
+ else {
25
+ addFile(output, config, false, path, content);
26
+ }
27
+ }
28
+ }
29
+ function isInAppDir(filePath) {
30
+ return filePath.startsWith("app/");
31
+ }
32
+ function scanWithoutSrcDir(output, config, alteredFiles) {
33
+ const aliasedPaths = new Set(getAliasedPaths(config));
34
+ for (const { path, content } of alteredFiles) {
35
+ const inSrcDir = aliasedPaths.has(path) || isInAppDir(path);
36
+ addFile(output, config, inSrcDir, path, content);
37
+ }
38
+ }
39
+ export function createDiff({ name, config, alteredFiles, specificFiles, currentFiles, currentPackageJson, }) {
40
+ const output = {
41
+ name,
42
+ type: "registry:block",
43
+ dependencies: [],
44
+ devDependencies: [],
45
+ registryDependencies: [],
46
+ files: [],
47
+ tailwind: {},
48
+ cssVars: {},
49
+ meta: {},
50
+ };
51
+ if (config.isSrcDir) {
52
+ scanWithSrcDir(output, config, alteredFiles);
53
+ }
54
+ else {
55
+ scanWithoutSrcDir(output, config, alteredFiles);
56
+ }
57
+ output.registryDependencies = findComponentFiles(config, currentFiles);
58
+ addDependencies(output, specificFiles["./package.json"], currentPackageJson);
59
+ return output;
60
+ }
61
+ //# sourceMappingURL=create-diff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"create-diff.js","sourceRoot":"","sources":["../src/create-diff.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC1F,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAYrD,SAAS,OAAO,CACd,MAAkB,EAClB,MAAwB,EACxB,QAAiB,EACjB,gBAAwB,EACxB,OAAe;IAEf,IAAI,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,CAAC,EAAE,CAAC;QACjD,OAAO;IACT,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,gBAAgB,EAAE,EAAE,OAAO,CAAC,CAAC,CAAC;AACvF,CAAC;AAED,SAAS,eAAe,CACtB,MAAkB,EAClB,sBAA0C,EAC1C,sBAA8B;IAE9B,MAAM,kBAAkB,GAAG,sBAAsB,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IAC5F,MAAM,kBAAkB,GAAG,IAAI,CAAC,KAAK,CAAC,sBAAsB,CAAC,CAAC;IAE9D,MAAM,mBAAmB,GAAG,CAAC,kBAAkB,CAAC,YAAY,IAAI,EAAE,C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,GAAG,IAAI,GAAG,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC;IAEtD,KAAK,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,YAAY,EAAE,CAAC;QAC7C,MAAM,QAAQ,GAAG,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC;QAC5D,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACnD,CAAC;AACH,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,EACzB,IAAI,EACJ,MAAM,EACN,YAAY,EACZ,aAAa,EACb,YAAY,EACZ,kBAAkB,GACD;IACjB,MAAM,MAAM,GAAe;QACzB,IAAI;QACJ,IAAI,EAAE,gBAAgB;QACtB,YAAY,EAAE,EAAE;QAChB,eAAe,EAAE,EAAE;QACnB,oBAAoB,EAAE,EAAE;QACxB,KAAK,EAAE,EAAE;QACT,QAAQ,EAAE,EAAE;QACZ,OAAO,EAAE,EAAE;QACX,IAAI,EAAE,EAAE;KACT,CAAC;IAEF,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;IAC/C,CAAC;SAAM,CAAC;QACN,iBAAiB,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,CAAC,CAAC;IAClD,CAAC;IAED,MAAM,CAAC,oBAAoB,GAAG,kBAAkB,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAEvE,eAAe,CAAC,MAAM,EAAE,aAAa,CAAC,gBAAgB,CAAC,EAAE,kBAAkB,CAAC,CAAC;IAE7E,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/dist/git.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ import type { AlteredFilesResult, FileEntry } from "./types.js";
2
+ export declare function scanForFiles(startDir: string, checkFile?: boolean): FileEntry[];
3
+ export declare function scanForAlteredFiles(specificFilesToReturn?: string[]): AlteredFilesResult;
4
+ export declare function hasSrcDir(dir: string): boolean;
5
+ //# sourceMappingURL=git.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AAuEhE,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,UAAQ,GAAG,SAAS,EAAE,CA4C7E;AAED,wBAAgB,mBAAmB,CAAC,qBAAqB,GAAE,MAAM,EAAO,GAAG,kBAAkB,CAmB5F;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAE9C"}
package/dist/git.js ADDED
@@ -0,0 +1,120 @@
1
+ import fs from "node:fs";
2
+ import path from "node:path";
3
+ import { execSync } from "node:child_process";
4
+ import ignore from "ignore";
5
+ const INITIAL_DIR = "_initial";
6
+ const EXCLUDE_DIRS = new Set([
7
+ "node_modules",
8
+ "dist",
9
+ "fonts",
10
+ "build",
11
+ "public",
12
+ "static",
13
+ ".next",
14
+ ".git",
15
+ INITIAL_DIR,
16
+ ]);
17
+ const EXCLUDE_FILES = new Set([
18
+ ".DS_Store",
19
+ "next-env.d.ts",
20
+ "package-lock.json",
21
+ "yarn.lock",
22
+ "pnpm-lock.yaml",
23
+ "bun.lockb",
24
+ "package.json",
25
+ "tailwind.config.ts",
26
+ "tailwind.config.js",
27
+ "components.json",
28
+ "favicon.ico",
29
+ ]);
30
+ function cloneInitialCommit() {
31
+ deleteInitialDir();
32
+ try {
33
+ const initialCommit = execSync("git rev-list --max-parents=0 HEAD").toString().trim();
34
+ execSync(`git worktree add -f ${INITIAL_DIR} ${initialCommit}`, { stdio: "ignore" });
35
+ }
36
+ catch (error) {
37
+ const message = error instanceof Error ? error.message : String(error);
38
+ console.error("Error cloning initial commit:", message);
39
+ process.exit(1);
40
+ }
41
+ }
42
+ function deleteInitialDir() {
43
+ if (!fs.existsSync(INITIAL_DIR)) {
44
+ return;
45
+ }
46
+ fs.rmSync(INITIAL_DIR, { recursive: true, force: true });
47
+ try {
48
+ execSync("git worktree prune", { stdio: "ignore" });
49
+ }
50
+ catch (error) {
51
+ const message = error instanceof Error ? error.message : String(error);
52
+ console.error("Error pruning git worktree:", message);
53
+ }
54
+ }
55
+ function checkIfFileIsChanged(relativeFilePath) {
56
+ const initialFilePath = path.join(INITIAL_DIR, relativeFilePath);
57
+ const fullPath = path.join(process.cwd(), relativeFilePath);
58
+ if (!fs.existsSync(initialFilePath)) {
59
+ return true;
60
+ }
61
+ const currentContent = fs.readFileSync(fullPath, "utf-8");
62
+ const initialContent = fs.readFileSync(initialFilePath, "utf-8");
63
+ return currentContent !== initialContent;
64
+ }
65
+ export function scanForFiles(startDir, checkFile = false) {
66
+ const foundFiles = [];
67
+ let ignorer;
68
+ const gitignorePath = path.join(startDir, ".gitignore");
69
+ if (fs.existsSync(gitignorePath)) {
70
+ const gitIgnore = ignore().add(fs.readFileSync(gitignorePath).toString());
71
+ ignorer = (relativeFilePath) => gitIgnore.ignores(relativeFilePath);
72
+ }
73
+ function scanDirectory(dir, relativePath = "") {
74
+ const entries = fs.readdirSync(dir, { withFileTypes: true });
75
+ for (const entry of entries) {
76
+ const fullPath = path.join(dir, entry.name);
77
+ const relativeFilePath = path.join(relativePath, entry.name);
78
+ if (entry.isDirectory()) {
79
+ if (!EXCLUDE_DIRS.has(entry.name)) {
80
+ scanDirectory(fullPath, relativeFilePath);
81
+ }
82
+ continue;
83
+ }
84
+ if (EXCLUDE_FILES.has(entry.name)) {
85
+ continue;
86
+ }
87
+ if (ignorer?.(relativeFilePath)) {
88
+ continue;
89
+ }
90
+ if (!checkFile || checkIfFileIsChanged(relativeFilePath)) {
91
+ foundFiles.push({
92
+ path: relativeFilePath,
93
+ content: fs.readFileSync(fullPath, "utf-8"),
94
+ });
95
+ }
96
+ }
97
+ }
98
+ scanDirectory(startDir);
99
+ return foundFiles;
100
+ }
101
+ export function scanForAlteredFiles(specificFilesToReturn = []) {
102
+ cloneInitialCommit();
103
+ const alteredFiles = scanForFiles(process.cwd(), true);
104
+ const specificFiles = specificFilesToReturn.reduce((acc, file) => {
105
+ const fullPath = path.join(process.cwd(), INITIAL_DIR, file);
106
+ if (fs.existsSync(fullPath)) {
107
+ acc[file] = fs.readFileSync(fullPath, "utf-8");
108
+ }
109
+ return acc;
110
+ }, {});
111
+ deleteInitialDir();
112
+ return {
113
+ alteredFiles,
114
+ specificFiles,
115
+ };
116
+ }
117
+ export function hasSrcDir(dir) {
118
+ return fs.existsSync(path.join(dir, "src"));
119
+ }
120
+ //# sourceMappingURL=git.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,MAAM,MAAM,QAAQ,CAAC;AAI5B,MAAM,WAAW,GAAG,UAAU,CAAC;AAE/B,MAAM,YAAY,GAAG,IAAI,GAAG,CAAC;IAC3B,cAAc;IACd,MAAM;IACN,OAAO;IACP,OAAO;IACP,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,MAAM;IACN,WAAW;CACZ,CAAC,CAAC;AAEH,MAAM,aAAa,GAAG,IAAI,GAAG,CAAC;IAC5B,WAAW;IACX,eAAe;IACf,mBAAmB;IACnB,WAAW;IACX,gBAAgB;IAChB,WAAW;IACX,cAAc;IACd,oBAAoB;IACpB,oBAAoB;IACpB,iBAAiB;IACjB,aAAa;CACd,CAAC,CAAC;AAEH,SAAS,kBAAkB;IACzB,gBAAgB,EAAE,CAAC;IAEnB,IAAI,CAAC;QACH,MAAM,aAAa,GAAG,QAAQ,CAAC,mCAAmC,CAAC,CAAC,QAAQ,EAAE,CAAC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