smart-registry 0.6.4 → 0.7.0

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 CHANGED
@@ -76,10 +76,8 @@ Manual maintenance of `registry.json` files can lead to errors due to missing de
76
76
  ## Table of Contents
77
77
 
78
78
  - [Usage](#usage)
79
- - [Configure Alias](#configure-alias)
80
79
  - [Automatic Detection](#automatic-detection)
81
- - [From Specific Files](#from-specific-files)
82
- - [From Specific Directories](#from-specific-directories)
80
+ - [Advanced Usage](#advanced-usage)
83
81
  - [How it Works](#how-it-works)
84
82
  - [Extending Properties](#extending-properties)
85
83
  - [With zero-configuration](#with-zero-configuration)
@@ -88,6 +86,10 @@ Manual maintenance of `registry.json` files can lead to errors due to missing de
88
86
  - [External registry dependencies](#external-registry-dependencies)
89
87
  - [Specify dependency version](#specify-dependency-version)
90
88
  - [Directory Structure](#directory-structure)
89
+ - [For `registry` directory](#for-registry-directory)
90
+ - [For `registry` directory with multiple registries](#for-registry-directory-with-multiple-registries)
91
+ - [For `components` directory](#for-components-directory)
92
+ - [For `components` directory with multiple registries](#for-components-directory-with-multiple-registries)
91
93
 
92
94
  ## Usage
93
95
 
@@ -99,14 +101,34 @@ If your project contains a `registry`, `components`, or `src/components` directo
99
101
  npx smart-registry
100
102
  ```
101
103
 
102
- ![Demo Image](https://github-production-user-asset-6210df.s3.amazonaws.com/58145505/418180611-fd6070a5-6a89-4582-8ad0-df125c222883.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20250302%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20250302T212923Z&X-Amz-Expires=300&X-Amz-Signature=81a0324e67c77ab068c96e9f666e1b930cf32d497f8aa0a39c28caa0b902c7d3&X-Amz-SignedHeaders=host)
104
+ ### Advanced Usage
103
105
 
104
- ### From Specific Files or Directories
106
+ You can customize the output directory, working directory, and provide files or directories to build the registry from.
105
107
 
106
- If you want to generate the registry from specific files or directories, you can pass them as arguments.
108
+ ```plaintext
109
+ Version:
110
+ smart-registry@x.y.z
111
+
112
+ Usage:
113
+ $ smart-registry [files/directories] ... [options]
114
+
115
+ Arguments:
116
+ files/directories files or directories to build the registry from (optional)
117
+
118
+ Options:
119
+ -o, --output <path> destination directory for json files (default: "./public/r")
120
+ -c, --cwd <cwd> the working directory (default: "./")
121
+ -v, --version display version
122
+ -h, --help display help
123
+
124
+ Author:
125
+ ${author.name} <${author.email}> (${author.url})
126
+ ```
127
+
128
+ e.g. To generate the registry in the `public/r` directory.
107
129
 
108
130
  ```bash
109
- npx smart-registry path/to/file.ts path/to/directory ...
131
+ npx smart-registry path/to/file.ext path/to/directory ... --output public/r --cwd .
110
132
  ```
111
133
 
112
134
  ## How it Works
@@ -123,9 +145,9 @@ registry/
123
145
  └── dialog.tsx
124
146
  ```
125
147
 
126
- 1. `Smart Registry` will scan the `registry` directory and its sub-directories to find all the files. If no `registry` directory is found, it will scan the `components` or `src/components` directory.
148
+ 1. `Smart Registry` will scan the `registry` directory and its sub-directories to find all the files (if no `registry` directory is found, it will scan the `components` or `src/components` directory).
127
149
  2. For each file, it will generate a `<registry-item>.json` file by reading the file's content and extracting the imports for registry dependencies, dependencies, and files recursively.
128
- 3. It will then generate a `registry.json` file by combining all the `<registry-item>.json` files with all the properties required for `shadcn add` or `open in v0`.
150
+ 3. It will then generate a `registry.json` file by combining all the `<registry-item>.json` files and `<registry-item>.json` files with all the properties required for `shadcn add` or `open in v0`.
129
151
 
130
152
  ```plaintext
131
153
  public/
@@ -439,12 +461,13 @@ Generates the following items in `public/r` directory.
439
461
  ```plaintext
440
462
  public/
441
463
  └── r/
442
- ├── new-york/
443
- ├── toasty.json name: new-york/toasty target: blocks/new-york/toasty.tsx
444
- ├── toaster.json name: new-york/toaster target: components/new-york/toaster.tsx
445
- ├── use-toast.json name: new-york/use-toast target: hooks/new-york/use-toast.ts
446
- ├── utils.json name: new-york/utils target: lib/new-york/utils.ts
447
- └── toast.json name: new-york/toast target: components/ui/new-york/toast.tsx
464
+ ├── registry.json
465
+ └── new-york/
466
+ ├── toasty.json name: new-york/toasty target: blocks/new-york/toasty.tsx
467
+ ├── toaster.json name: new-york/toaster target: components/new-york/toaster.tsx
468
+ ├── use-toast.json name: new-york/use-toast target: hooks/new-york/use-toast.ts
469
+ ├── utils.json name: new-york/utils target: lib/new-york/utils.ts
470
+ └── toast.json name: new-york/toast target: components/ui/new-york/toast.tsx
448
471
  ```
449
472
 
450
473
  ### For `components` directory.
@@ -469,6 +492,7 @@ Generates the following items in `public/r` directory.
469
492
  ```plaintext
470
493
  public/
471
494
  └── r/
495
+ ├── registry.json
472
496
  ├── toasty.json name: toasty target: blocks/toasty.tsx
473
497
  ├── component.json name: toaster target: components/toaster.tsx
474
498
  ├── use-toast.json name: use-toast target: hooks/use-toast.ts
@@ -503,10 +527,11 @@ Generates the following items in `public/r` directory.
503
527
  ```plaintext
504
528
  public/
505
529
  └── r/
506
- └── new-york/
507
- ├── toasty.json name: new-york/toasty target: blocks/new-york/toasty.tsx
508
- ├── toaster.json name: new-york/toaster target: components/new-york/toaster.tsx
509
- ├── use-toast.json name: new-york/use-toast target: hooks/new-york/use-toast.ts
510
- ├── utils.json name: new-york/utils target: lib/new-york/utils.ts
511
- └── toast.json name: new-york/toast target: components/ui/new-york/toast.tsx
530
+ ├── registry.json
531
+ └── new-york/
532
+ ├── toasty.json name: new-york/toasty target: blocks/new-york/toasty.tsx
533
+ ├── toaster.json name: new-york/toaster target: components/new-york/toaster.tsx
534
+ ├── use-toast.json name: new-york/use-toast target: hooks/new-york/use-toast.ts
535
+ ├── utils.json name: new-york/utils target: lib/new-york/utils.ts
536
+ └── toast.json name: new-york/toast target: components/ui/new-york/toast.tsx
512
537
  ```
package/dist/bin/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- var Q=Object.defineProperty,X=Object.defineProperties;var Y=Object.getOwnPropertyDescriptors;var I=Object.getOwnPropertySymbols;var Z=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var J=(i,t,s)=>t in i?Q(i,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[t]=s,u=(i,t)=>{for(var s in t||(t={}))Z.call(t,s)&&J(i,s,t[s]);if(I)for(var s of I(t))C.call(t,s)&&J(i,s,t[s]);return i},F=(i,t)=>X(i,Y(t));import _ from"node:fs";import h from"node:path";import{parseArgs as oe}from"node:util";var M=["registry/**",["blocks/**","components/**","helpers/**","hooks/**","lib/**","ui/**","utils/**"],["src/blocks/**","src/components/**","src/helpers/**","src/hooks/**","src/lib/**","src/ui/**","src/utils/**"]],j={default:["$schema","name","homepage","items"],items:{default:["$schema","name","type","description","title","author","dependencies","devDependencies","registryDependencies","files","tailwind","cssVars","meta","docs","categories"],type:{default:["registry:ui","registry:hook","registry:lib","registry:theme","registry:page","registry:file","registry:component","registry:block"]},files:{default:["type","target","content","path"],type:{default:["registry:block","registry:component","registry:file","registry:page","registry:theme","registry:lib","registry:hook","registry:ui"]}}}};import S from"node:fs";import E from"node:path";import ee from"strip-json-comments";var V=async i=>{let t={},s=["tsconfig.json","jsconfig.json"].find(n=>S.existsSync(E.resolve(i,n)));if(s){let n=await S.promises.readFile(E.resolve(i,s),"utf8"),{compilerOptions:e}=JSON.parse(ee(n,{trailingCommas:!0}));e.paths&&(t=Object.entries(e.paths).reduce((r,[o,[a]])=>(o.endsWith("*")&&a.endsWith("*")&&(r[o.replace(/\*$/,"")]=a.replace(/\*$/,"")),r),{}))}return t["@/"]||(t["@/"]=S.existsSync(E.resolve(i,"src"))?"./src/":"./"),t=Object.entries(t).sort(([n],[e])=>e.length-n.length).reduce((n,[e,r])=>(n[e]=r,n),{}),t};import B from"node:fs";import te from"node:path";var q=async i=>{let t=te.resolve(i,"registry.json"),s={$schema:"https://ui.shadcn.com/schema/registry.json",name:"nrjdalal",homepage:"https://nrjdalal.com",items:[]};return B.existsSync(t)&&(s=u({},JSON.parse(await B.promises.readFile(t,"utf8")))),s};import z from"node:fs";import T from"node:path";import{glob as se}from"tinyglobby";var v=async({cwd:i,patterns:t=["**",".**"],ignore:s=[]})=>{t=Array.isArray(t)?t:[t],t=t.map(e=>e.replace(/^'|'$/g,"").replace(/^"|"$/g,"").trim()),t=[...t,...t.flatMap(e=>e.includes("*")?[]:[e+".**",e+"**"])],t=t.filter(Boolean),s=typeof s=="string"?s.split(",").map(e=>e.trim()):s,s=s.filter(Boolean);let n=await se(t,{cwd:i,ignore:s.filter(e=>!t.includes(e))});if(!n.length)for(let e of t)try{let r=T.resolve(i,e),o=await z.promises.stat(r);if(o.isDirectory()){let a=(await z.promises.readdir(r)).map(g=>T.resolve(e,g));n.push(...a)}else o.isFile()&&n.push(e)}catch(r){continue}return n};var U=async({cwd:i,patterns:t,ignore:s})=>{let n=[];if(t.length)n=await v({cwd:i,patterns:t,ignore:s});else for(let e of M)if(n=await v({cwd:i,patterns:e,ignore:s}),n.length)break;if(!n.length)throw new Error("No files/directories found to build the registry from!");return n};import G from"node:fs";import H from"node:path";var k={imports:/import\s+type\s+[\s\S]+?from\s+['"][^'"]+['"]|import\s+['"][^'"]+['"]|import\s+[\s\S]+?from\s+['"][^'"]+['"]/g};var W=async({cwd:i,aliases:t,filepaths:s,resolved:n})=>{n=n!=null?n:new Set;let e={dependencies:[],files:[],content:{}};for(let r of s){if(n.has(r))continue;n.add(r),e.files.push(r),e.content[r]||(e.content[r]=await G.promises.readFile(H.resolve(i,r),"utf8"));let{dependencies:o,files:a,transformations:g}=await K({cwd:i,aliases:t,filepath:r,content:e.content[r]});e.content[r]=e.content[r].replace(k.imports,c=>{let y=c.match(/['"](.*)['"]/);return y&&g[y[1]]?c.replace(y[1],g[y[1]].import):c}),a.forEach(c=>e.files.push(c)),o.forEach(c=>e.dependencies.push(c))}for(let r of e.files){let{dependencies:o,files:a,content:g}=await W({cwd:i,aliases:t,filepaths:[r],resolved:n});e.content[r]||(e.content[r]=g[r]||await G.promises.readFile(H.resolve(i,r),"utf8")),a.forEach(c=>e.files.push(c)),o.forEach(c=>e.dependencies.push(c))}return e.dependencies=[...new Set(e.dependencies)].sort(),e.files=[...new Set(e.files)].sort(),e};import A from"node:path";import re from"node:path";var f=({cwd:i,aliases:t,filepath:s})=>{var r;let n=s;for(let o in t)s=s.replace(t[o].replaceAll("./","").replaceAll("../",""),"");let e=s.startsWith("registry/")?s.replace(/^registry\//,"").replace(/^(?:([^\/]*)\/)?blocks\//,(o,a)=>`blocks/${a?a+"/":""}`).replace(/^(?:([^\/]*)\/)?components\/ui\//,(o,a)=>`${a?a+"/":""}ui/`).replace(/^(?:([^\/]*)\/)?components\//,(o,a)=>`components/${a?a+"/":""}`).replace(/^(?:([^\/]*)\/)?hooks\//,(o,a)=>`hooks/${a?a+"/":""}`).replace(/^(?:([^\/]*)\/)?lib\//,(o,a)=>`lib/${a?a+"/":""}`).replace(/^(?:([^\/]*)\/)?ui\//,(o,a)=>`components/ui/${a?a+"/":""}`).replace(/\/default\//,"/").replace(/\.\.\//g,"").replace(/\.\//g,""):s.replace(/\/default\//,"/").replace(/\.\.\//g,"").replace(/\.\//g,"");return{type:e.endsWith("page.tsx")?"registry:page":((r=e.match(/^(blocks|components\/ui|components|hooks|lib|utils|helpers)/))==null?void 0:r[1].replace("blocks","registry:block").replace("components/ui","registry:ui").replace("components","registry:component").replace("hooks","registry:hook").replace("lib","registry:lib").replace("utils","registry:lib").replace("helpers","registry:lib"))||"registry:file",name:e.replace(/^(blocks|components\/ui|components|hooks|lib|utils|helpers)\//,"").replace(/\.[^\/.]+$/,"").replace(/\/index$/,"").replace(/\/route$/,"").replace(/\/\[.*\]$/,""),import:"@/"+e.replace(i+re.sep,"").replace(/\.[^/.]+$/,"").replace(/\/index$/,""),target:n.split("/").length>1?e:`~/${e}`,path:s}};var ie=async({cwd:i,current:t,aliases:s})=>{t=t.replace(new RegExp(`^${Object.keys(s).find(e=>t.startsWith(e.replace(/\.\//g,"").replace(/\.\.\//g,"")))}`),s[Object.keys(s).find(e=>t.startsWith(e.replace(/\.\//g,"").replace(/\.\.\//g,"")))]),t=t.replace(/\.\//g,"").replace(/\.\.\//g,"");let n=await v({cwd:i,patterns:t});return t=n.find(e=>e.startsWith(t+"."))||n.find(e=>e.startsWith(t+"/index"))||t,t.replace(i+"/","")},ne=async({cwd:i,filepath:t,current:s})=>{s=A.relative(i,A.resolve(i,A.dirname(t),s));let n=await v({cwd:i,patterns:s});return s=n.find(e=>e.startsWith(s+"."))||n.find(e=>e.startsWith(s+"/index"))||s,s.replace(i+"/","")},K=async({cwd:i,aliases:t,filepath:s,content:n})=>{let e={dependencies:[],files:[],transformations:{}},r=n.match(k.imports)||[];if(!r.length)return e;r=r.map(o=>{var a;return(a=o.match(/['"](.*)['"]/))==null?void 0:a[1].replace(/\/\//g,"/")});for(let o of r){let a=o;Object.keys(t).some(c=>o.startsWith(c.replace(/\.\//g,"").replace(/\.\.\//g,"")))?(o=await ie({cwd:i,aliases:t,current:o}),e.transformations[a]=f({cwd:i,aliases:t,filepath:o}),e.files.push(o)):o.startsWith(".")?(o=await ne({cwd:i,filepath:s,current:o}),e.transformations[a]=f({cwd:i,aliases:t,filepath:o}),e.files.push(o)):o.startsWith("@")?e.dependencies.push(o.split("/").slice(0,2).join("/")):e.dependencies.push(o.replace(/\/.*/,""))}return e};var R="smart-registry",P="0.6.2";var O={name:"Neeraj Dalal",email:"admin@nrjdalal.com",url:"https://nrjdalal.com"};var L=`Version:
2
+ var Q=Object.defineProperty,X=Object.defineProperties;var Y=Object.getOwnPropertyDescriptors;var I=Object.getOwnPropertySymbols;var Z=Object.prototype.hasOwnProperty,C=Object.prototype.propertyIsEnumerable;var J=(i,t,s)=>t in i?Q(i,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):i[t]=s,u=(i,t)=>{for(var s in t||(t={}))Z.call(t,s)&&J(i,s,t[s]);if(I)for(var s of I(t))C.call(t,s)&&J(i,s,t[s]);return i},F=(i,t)=>X(i,Y(t));import _ from"node:fs";import h from"node:path";import{parseArgs as oe}from"node:util";var M=["registry/**",["blocks/**","components/**","helpers/**","hooks/**","lib/**","ui/**","utils/**"],["src/blocks/**","src/components/**","src/helpers/**","src/hooks/**","src/lib/**","src/ui/**","src/utils/**"]],j={default:["$schema","name","homepage","items"],items:{default:["$schema","name","type","description","title","author","dependencies","devDependencies","registryDependencies","files","tailwind","cssVars","meta","docs","categories"],type:{default:["registry:ui","registry:hook","registry:lib","registry:theme","registry:page","registry:file","registry:component","registry:block"]},files:{default:["type","target","content","path"],type:{default:["registry:block","registry:component","registry:file","registry:page","registry:theme","registry:lib","registry:hook","registry:ui"]}}}};import S from"node:fs";import E from"node:path";import ee from"strip-json-comments";var V=async i=>{let t={},s=["tsconfig.json","jsconfig.json"].find(n=>S.existsSync(E.resolve(i,n)));if(s){let n=await S.promises.readFile(E.resolve(i,s),"utf8"),{compilerOptions:e}=JSON.parse(ee(n,{trailingCommas:!0}));e.paths&&(t=Object.entries(e.paths).reduce((r,[o,[a]])=>(o.endsWith("*")&&a.endsWith("*")&&(r[o.replace(/\*$/,"")]=a.replace(/\*$/,"")),r),{}))}return t["@/"]||(t["@/"]=S.existsSync(E.resolve(i,"src"))?"./src/":"./"),t=Object.entries(t).sort(([n],[e])=>e.length-n.length).reduce((n,[e,r])=>(n[e]=r,n),{}),t};import B from"node:fs";import te from"node:path";var q=async i=>{let t=te.resolve(i,"registry.json"),s={$schema:"https://ui.shadcn.com/schema/registry.json",name:"nrjdalal",homepage:"https://nrjdalal.com",items:[]};return B.existsSync(t)&&(s=u({},JSON.parse(await B.promises.readFile(t,"utf8")))),s};import z from"node:fs";import T from"node:path";import{glob as se}from"tinyglobby";var v=async({cwd:i,patterns:t=["**",".**"],ignore:s=[]})=>{t=Array.isArray(t)?t:[t],t=t.map(e=>e.replace(/^'|'$/g,"").replace(/^"|"$/g,"").trim()),t=[...t,...t.flatMap(e=>e.includes("*")?[]:[e+".**",e+"**"])],t=t.filter(Boolean),s=typeof s=="string"?s.split(",").map(e=>e.trim()):s,s=s.filter(Boolean);let n=await se(t,{cwd:i,ignore:s.filter(e=>!t.includes(e))});if(!n.length)for(let e of t)try{let r=T.resolve(i,e),o=await z.promises.stat(r);if(o.isDirectory()){let a=(await z.promises.readdir(r)).map(g=>T.resolve(e,g));n.push(...a)}else o.isFile()&&n.push(e)}catch(r){continue}return n};var U=async({cwd:i,patterns:t,ignore:s})=>{let n=[];if(t.length)n=await v({cwd:i,patterns:t,ignore:s});else for(let e of M)if(n=await v({cwd:i,patterns:e,ignore:s}),n.length)break;if(!n.length)throw new Error("No files/directories found to build the registry from!");return n};import G from"node:fs";import H from"node:path";var k={imports:/import\s+type\s+[\s\S]+?from\s+['"][^'"]+['"]|import\s+['"][^'"]+['"]|import\s+[\s\S]+?from\s+['"][^'"]+['"]/g};var W=async({cwd:i,aliases:t,filepaths:s,resolved:n})=>{n=n!=null?n:new Set;let e={dependencies:[],files:[],content:{}};for(let r of s){if(n.has(r))continue;n.add(r),e.files.push(r),e.content[r]||(e.content[r]=await G.promises.readFile(H.resolve(i,r),"utf8"));let{dependencies:o,files:a,transformations:g}=await K({cwd:i,aliases:t,filepath:r,content:e.content[r]});e.content[r]=e.content[r].replace(k.imports,c=>{let y=c.match(/['"](.*)['"]/);return y&&g[y[1]]?c.replace(y[1],g[y[1]].import):c}),a.forEach(c=>e.files.push(c)),o.forEach(c=>e.dependencies.push(c))}for(let r of e.files){let{dependencies:o,files:a,content:g}=await W({cwd:i,aliases:t,filepaths:[r],resolved:n});e.content[r]||(e.content[r]=g[r]||await G.promises.readFile(H.resolve(i,r),"utf8")),a.forEach(c=>e.files.push(c)),o.forEach(c=>e.dependencies.push(c))}return e.dependencies=[...new Set(e.dependencies)].sort(),e.files=[...new Set(e.files)].sort(),e};import A from"node:path";import re from"node:path";var f=({cwd:i,aliases:t,filepath:s})=>{var r;let n=s;for(let o in t)s=s.replace(t[o].replaceAll("./","").replaceAll("../",""),"");let e=s.startsWith("registry/")?s.replace(/^registry\//,"").replace(/^(?:([^\/]*)\/)?blocks\//,(o,a)=>`blocks/${a?a+"/":""}`).replace(/^(?:([^\/]*)\/)?components\/ui\//,(o,a)=>`${a?a+"/":""}ui/`).replace(/^(?:([^\/]*)\/)?components\//,(o,a)=>`components/${a?a+"/":""}`).replace(/^(?:([^\/]*)\/)?hooks\//,(o,a)=>`hooks/${a?a+"/":""}`).replace(/^(?:([^\/]*)\/)?lib\//,(o,a)=>`lib/${a?a+"/":""}`).replace(/^(?:([^\/]*)\/)?ui\//,(o,a)=>`components/ui/${a?a+"/":""}`).replace(/\/default\//,"/").replace(/\.\.\//g,"").replace(/\.\//g,""):s.replace(/\/default\//,"/").replace(/\.\.\//g,"").replace(/\.\//g,"");return{type:e.endsWith("page.tsx")?"registry:page":((r=e.match(/^(blocks|components\/ui|components|hooks|lib|utils|helpers)/))==null?void 0:r[1].replace("blocks","registry:block").replace("components/ui","registry:ui").replace("components","registry:component").replace("hooks","registry:hook").replace("lib","registry:lib").replace("utils","registry:lib").replace("helpers","registry:lib"))||"registry:file",name:e.replace(/^(blocks|components\/ui|components|hooks|lib|utils|helpers)\//,"").replace(/\.[^\/.]+$/,"").replace(/\/index$/,"").replace(/\/route$/,"").replace(/\/\[.*\]$/,""),import:"@/"+e.replace(i+re.sep,"").replace(/\.[^/.]+$/,"").replace(/\/index$/,""),target:n.split("/").length>1?e:`~/${e}`,path:s}};var ie=async({cwd:i,current:t,aliases:s})=>{t=t.replace(new RegExp(`^${Object.keys(s).find(e=>t.startsWith(e.replace(/\.\//g,"").replace(/\.\.\//g,"")))}`),s[Object.keys(s).find(e=>t.startsWith(e.replace(/\.\//g,"").replace(/\.\.\//g,"")))]),t=t.replace(/\.\//g,"").replace(/\.\.\//g,"");let n=await v({cwd:i,patterns:t});return t=n.find(e=>e.startsWith(t+"."))||n.find(e=>e.startsWith(t+"/index"))||t,t.replace(i+"/","")},ne=async({cwd:i,filepath:t,current:s})=>{s=A.relative(i,A.resolve(i,A.dirname(t),s));let n=await v({cwd:i,patterns:s});return s=n.find(e=>e.startsWith(s+"."))||n.find(e=>e.startsWith(s+"/index"))||s,s.replace(i+"/","")},K=async({cwd:i,aliases:t,filepath:s,content:n})=>{let e={dependencies:[],files:[],transformations:{}},r=n.match(k.imports)||[];if(!r.length)return e;r=r.map(o=>{var a;return(a=o.match(/['"](.*)['"]/))==null?void 0:a[1].replace(/\/\//g,"/")});for(let o of r){let a=o;Object.keys(t).some(c=>o.startsWith(c.replace(/\.\//g,"").replace(/\.\.\//g,"")))?(o=await ie({cwd:i,aliases:t,current:o}),e.transformations[a]=f({cwd:i,aliases:t,filepath:o}),e.files.push(o)):o.startsWith(".")?(o=await ne({cwd:i,filepath:s,current:o}),e.transformations[a]=f({cwd:i,aliases:t,filepath:o}),e.files.push(o)):o.startsWith("@")?e.dependencies.push(o.split("/").slice(0,2).join("/")):e.dependencies.push(o.replace(/\/.*/,""))}return e};var R="smart-registry",P="0.7.0";var O={name:"Neeraj Dalal",email:"admin@nrjdalal.com",url:"https://nrjdalal.com"};var L=`Version:
3
3
  ${R}@${P}
4
4
 
5
5
  Usage:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smart-registry",
3
- "version": "0.6.4",
3
+ "version": "0.7.0",
4
4
  "description": "A zero-configuration (no registry.json required), shadcn add / open in v0 compatible registry builder.",
5
5
  "keywords": [
6
6
  "smart-registry"