ui-thing 0.0.3 → 0.0.5
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/.github/workflows/main.yml +19 -19
- package/.prettierrc +12 -12
- package/CHANGELOG.md +32 -17
- package/README.md +69 -67
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/package.json +6 -3
- package/src/commands/add.ts +237 -237
- package/src/commands/init.ts +72 -72
- package/src/commands/prettier.ts +47 -47
- package/src/commands/theme.ts +61 -61
- package/src/comp.ts +2134 -2134
- package/src/index.ts +30 -30
- package/src/templates/css.ts +641 -641
- package/src/templates/prettier.ts +16 -16
- package/src/templates/tailwind.ts +101 -101
- package/src/types.ts +13 -13
- package/src/utils/addPrettierConfig.ts +24 -24
- package/src/utils/compareUIConfig.ts +35 -35
- package/src/utils/config.ts +84 -84
- package/src/utils/constants.ts +36 -36
- package/src/utils/fileExists.ts +10 -10
- package/src/utils/installPackages.ts +28 -28
- package/src/utils/printFancyBoxMessage.ts +19 -19
- package/src/utils/promptForComponents.ts +17 -17
- package/src/utils/uiConfigPrompt.ts +73 -73
- package/src/utils/writeFile.ts +18 -18
- package/tsconfig.json +16 -16
- package/tsup.config.ts +12 -12
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches:
|
|
6
|
-
- main
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
build:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
steps:
|
|
12
|
-
- uses: actions/checkout@v3
|
|
13
|
-
- name: Install dependencies
|
|
14
|
-
run: npm install
|
|
15
|
-
- uses: actions/setup-node@v4
|
|
16
|
-
with:
|
|
17
|
-
node-version: "18.x"
|
|
18
|
-
- name: Build
|
|
19
|
-
run: npm run format && npm run build
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
build:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v3
|
|
13
|
+
- name: Install dependencies
|
|
14
|
+
run: npm install
|
|
15
|
+
- uses: actions/setup-node@v4
|
|
16
|
+
with:
|
|
17
|
+
node-version: "18.x"
|
|
18
|
+
- name: Build
|
|
19
|
+
run: npm run format && npm run build
|
package/.prettierrc
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
{
|
|
2
|
-
"arrowParens": "always",
|
|
3
|
-
"endOfLine": "lf",
|
|
4
|
-
"plugins": ["@ianvs/prettier-plugin-sort-imports"],
|
|
5
|
-
"printWidth": 100,
|
|
6
|
-
"semi": true,
|
|
7
|
-
"singleQuote": false,
|
|
8
|
-
"tabWidth": 2,
|
|
9
|
-
"trailingComma": "es5",
|
|
10
|
-
"useTabs": false,
|
|
11
|
-
"importOrder": ["<BUILTIN_MODULES>", "<THIRD_PARTY_MODULES>", "<TYPES>", "", "^[.]"]
|
|
12
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"arrowParens": "always",
|
|
3
|
+
"endOfLine": "lf",
|
|
4
|
+
"plugins": ["@ianvs/prettier-plugin-sort-imports"],
|
|
5
|
+
"printWidth": 100,
|
|
6
|
+
"semi": true,
|
|
7
|
+
"singleQuote": false,
|
|
8
|
+
"tabWidth": 2,
|
|
9
|
+
"trailingComma": "es5",
|
|
10
|
+
"useTabs": false,
|
|
11
|
+
"importOrder": ["<BUILTIN_MODULES>", "<THIRD_PARTY_MODULES>", "<TYPES>", "", "^[.]"]
|
|
12
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,26 +1,41 @@
|
|
|
1
|
-
# Changelog
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## v0.0.5
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
[compare changes](https://github.com/BayBreezy/ui-thing-cli/compare/v0.0.2...v0.0.3)
|
|
5
|
+
[compare changes](https://github.com/BayBreezy/ui-thing-cli/compare/v0.0.3...v0.0.5)
|
|
6
6
|
|
|
7
7
|
### 🏡 Chore
|
|
8
8
|
|
|
9
|
-
- Update
|
|
10
|
-
-
|
|
11
|
-
-
|
|
9
|
+
- Update release script ([c53b0d4](https://github.com/BayBreezy/ui-thing-cli/commit/c53b0d4))
|
|
10
|
+
- Update readme ([1d95ccb](https://github.com/BayBreezy/ui-thing-cli/commit/1d95ccb))
|
|
11
|
+
- Split cli from website repo ([66f2b3c](https://github.com/BayBreezy/ui-thing-cli/commit/66f2b3c))
|
|
12
|
+
- Update deps ([3d90848](https://github.com/BayBreezy/ui-thing-cli/commit/3d90848))
|
|
12
13
|
|
|
13
14
|
### ❤️ Contributors
|
|
14
15
|
|
|
15
16
|
- Behon Baker <behon.baker@yahoo.com>
|
|
16
17
|
|
|
17
|
-
## v0.0.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
18
|
+
## v0.0.3
|
|
19
|
+
|
|
20
|
+
[compare changes](https://github.com/BayBreezy/ui-thing-cli/compare/v0.0.2...v0.0.3)
|
|
21
|
+
|
|
22
|
+
### 🏡 Chore
|
|
23
|
+
|
|
24
|
+
- Update readme ([88be325](https://github.com/BayBreezy/ui-thing-cli/commit/88be325))
|
|
25
|
+
- Change package name ([bd17f8d](https://github.com/BayBreezy/ui-thing-cli/commit/bd17f8d))
|
|
26
|
+
- Set version back to 0.0.2 ([1c7b6b2](https://github.com/BayBreezy/ui-thing-cli/commit/1c7b6b2))
|
|
27
|
+
|
|
28
|
+
### ❤️ Contributors
|
|
29
|
+
|
|
30
|
+
- Behon Baker <behon.baker@yahoo.com>
|
|
31
|
+
|
|
32
|
+
## v0.0.2
|
|
33
|
+
|
|
34
|
+
### 🏡 Chore
|
|
35
|
+
|
|
36
|
+
- Add 1st changeset ([ec0083c](https://github.com/BayBreezy/ui-thing-cli/commit/ec0083c))
|
|
37
|
+
- Add release script ([ea11cae](https://github.com/BayBreezy/ui-thing-cli/commit/ea11cae))
|
|
38
|
+
|
|
39
|
+
### ❤️ Contributors
|
|
40
|
+
|
|
41
|
+
- Behon Baker <behon.baker@yahoo.com>
|
package/README.md
CHANGED
|
@@ -1,67 +1,69 @@
|
|
|
1
|
-
# UI Thing CLI
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
```
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
|
|
1
|
+
# UI Thing CLI
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
## Credits
|
|
6
|
+
|
|
7
|
+
- shadcn/ui
|
|
8
|
+
- Radiv-Vue
|
|
9
|
+
- TailwindCSS
|
|
10
|
+
- Nuxt
|
|
11
|
+
- Nuxt UI
|
|
12
|
+
|
|
13
|
+
Thanks to the maintainers of the other third party libraries used in this project.
|
|
14
|
+
|
|
15
|
+
## Getting Started
|
|
16
|
+
|
|
17
|
+
- Create a Nuxt 3 project
|
|
18
|
+
- Install the dependencies
|
|
19
|
+
- Run the init command
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx ui-thing@latest init
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
- Start the dev server
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
npm run dev
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
- Add components to your project with the `add` command
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npx ui-thing@latest add
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Commands
|
|
38
|
+
|
|
39
|
+
### `init`
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npx ui-thing@latest init
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
This command will install the dependencies and add the required configuration to your project.
|
|
46
|
+
|
|
47
|
+
### `add`
|
|
48
|
+
|
|
49
|
+
```bash
|
|
50
|
+
npx ui-thing@latest add
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
This command will add the components to your project.
|
|
54
|
+
|
|
55
|
+
### `theme`
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
npx ui-thing@latest theme
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
This command will add the theme to your project.
|
|
62
|
+
|
|
63
|
+
### `prettier`
|
|
64
|
+
|
|
65
|
+
```bash
|
|
66
|
+
npx ui-thing@latest prettier
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
This command will add the prettier configuration to your project.
|
package/dist/index.js
CHANGED
|
@@ -7177,7 +7177,7 @@ ${" ".repeat(6+n)}^`),c));s+=`
|
|
|
7177
7177
|
${l.join(`
|
|
7178
7178
|
`)}
|
|
7179
7179
|
`}this.message=s}},ep=new Set(["Literal","StringLiteral","NumericLiteral","BooleanLiteral","NullLiteral","RegExpLiteral","BigIntLiteral"]),ma=new Set(["string","number","boolean","bigint","symbol","undefined"]),Z=Xt;function tp(r){return/^[$A-Z_a-z][\w$]*$/.test(r)}var ur="__magicast_proxy";function he(r,s=new Set){if(r===void 0)return Z.identifier("undefined");if(r===null)return Z.literal(null);if(ma.has(typeof r))return Z.literal(r);if(s.has(r))throw new me("Can not serialize circular reference");if(s.add(r),r[ur])return r.$ast;if(r instanceof RegExp){let e=Z.regExpLiteral(r.source,r.flags);return delete e.extra.raw,e}return r instanceof Set?Z.newExpression(Z.identifier("Set"),[Z.arrayExpression([...r].map(e=>he(e,s)))]):r instanceof Date?Z.newExpression(Z.identifier("Date"),[Z.literal(r.toISOString())]):r instanceof Map?Z.newExpression(Z.identifier("Map"),[Z.arrayExpression([...r].map(([e,t])=>Z.arrayExpression([he(e,s),he(t,s)])))]):Array.isArray(r)?Z.arrayExpression(r.map(e=>he(e,s))):typeof r=="object"?Z.objectExpression(Object.entries(r).map(([e,t])=>Z.property("init",/^[$A-Z_a-z][\w$]*$/g.test(e)?Z.identifier(e):Z.literal(e),he(t,s)))):Z.literal(r)}function sp(r,s={}){let e=s;return e[ur]=!0,e.$ast=r,e.$type||(e.$type="object"),e}var np={enumerable:!0,configurable:!0};function je(r,s,e){let t=sp(r,s);return new Proxy({},{ownKeys(){return Object.keys(t).filter(n=>n!==ur&&!n.startsWith("$"))},getOwnPropertyDescriptor(){return np},has(n,i){return i in t},...e,get(n,i,a){if(i in t)return t[i];if(e.get)return e.get(n,i,a)},set(n,i,a,o){return i in t?(t[i]=a,!0):e.set?e.set(n,i,a,o):!1}})}var ve=Xt,Jn=new WeakMap;function rp(r,s,e){if(Jn.has(s))return Jn.get(s);let t=je(s,{get $declaration(){return r},get imported(){return s.type==="ImportDefaultSpecifier"?"default":s.type==="ImportNamespaceSpecifier"?"*":s.imported.type==="Identifier"?s.imported.name:s.imported.value},set imported(n){if(s.type!=="ImportSpecifier")throw new me("Changing import name is not yet implemented");s.imported.type==="Identifier"?s.imported.name=n:s.imported.value=n},get local(){return s.local.name},set local(n){s.local.name=n},get from(){return r.source.value},set from(n){if(n===r.source.value)return;r.specifiers=r.specifiers.filter(a=>a!==s),r.specifiers.length===0&&(e.body=e.body.filter(a=>a!==r));let i=e.body.find(a=>a.type==="ImportDeclaration"&&a.source.value===n);i?i.specifiers.push(s):e.body.unshift(ve.importDeclaration([s],ve.stringLiteral(n)))},toJSON(){return{imported:this.imported,local:this.local,from:this.from}}},{ownKeys(){return["imported","local","from","toJSON"]}});return Jn.set(s,t),t}function ip(r,s){let e=()=>{let a=[];for(let o of r.body)if(o.type==="ImportDeclaration")for(let l of o.specifiers)a.push(rp(o,l,r));return a},t=(a,o)=>{let l=e(),c=l.find(m=>m.local===a),p=o.local||a;if(c)return c.imported=o.imported,c.local=p,c.from=o.from,!0;let u=o.imported==="default"?ve.importDefaultSpecifier(ve.identifier(p)):o.imported==="*"?ve.importNamespaceSpecifier(ve.identifier(p)):ve.importSpecifier(ve.identifier(o.imported),ve.identifier(p)),f=l.find(m=>m.from===o.from)?.$declaration;return f?f.specifiers.push(u):r.body.unshift(ve.importDeclaration([u],ve.stringLiteral(o.from))),!0},n=a=>{let o=e().find(p=>p.local===a);if(!o)return!1;let l=o.$declaration,c=o.$ast;return l.specifiers=l.specifiers.filter(p=>p!==c),l.specifiers.length===0&&(r.body=r.body.filter(p=>p!==l)),!0},i=je(r,{$type:"imports",$add(a){i[a.local||a.imported]=a},get $items(){return e()},toJSON(){return e().reduce((a,o)=>(a[o.local]=o,a),{})}},{get(a,o){return e().find(l=>l.local===o)},set(a,o,l){return t(o,l)},deleteProperty(a,o){return n(o)},ownKeys(){return e().map(a=>a.local)},has(a,o){return e().some(l=>l.local===o)}});return i}function dr(r,s,e){let t=i=>s[i],n=(i,a)=>{s[i]=a};return je(r,{$type:"array",push(i){s.push(he(i))},pop(){return le(s.pop(),e)},unshift(i){s.unshift(he(i))},shift(){return le(s.shift(),e)},splice(i,a,...o){return s.splice(i,a,...o.map(c=>he(c))).map(c=>le(c,e))},find(i){return s.map(a=>le(a,e)).find(i)},findIndex(i){return s.map(a=>le(a,e)).findIndex(i)},includes(i){return s.map(a=>le(a,e)).includes(i)},toJSON(){return s.map(i=>le(i,e))}},{get(i,a){if(a==="length")return s.length;if(a===Symbol.iterator)return function*(){for(let c of s)yield le(c,e)};if(typeof a=="symbol")return;let o=+a;if(Number.isNaN(o))return;let l=t(o);if(l)return le(l,e)},set(i,a,o){if(typeof a=="symbol")return!1;let l=+a;return Number.isNaN(l)?!1:(n(l,he(o)),!0)},deleteProperty(i,a){if(typeof a=="symbol")return!1;let o=+a;return Number.isNaN(o)?!1:(s[o]=he(void 0),!0)},ownKeys(){return["length",...s.map((i,a)=>a.toString())]}})}function ap(r,s){if("elements"in r)return dr(r,r.elements,s)}function op(r,s){if(r.type!=="CallExpression")throw new me("Not a function call");function e(n){if(n.type==="Identifier")return n.name;if(n.type==="MemberExpression")return`${e(n.object)}.${e(n.property)}`;throw new me("Not implemented")}let t=dr(r,r.arguments,s);return je(r,{$type:"function-call",$callee:e(r.callee),$args:t},{})}var lp=Xt;function cp(r,s){if(!("properties"in r))return;let e=i=>{for(let a of r.properties){if("key"in a&&"name"in a.key&&a.key.name===i)return a.value;if(a.type==="ObjectProperty"&&(a.key.type==="StringLiteral"||a.key.type==="NumericLiteral"||a.key.type==="BooleanLiteral")&&a.key.value===i)return a.value.value}},t=(i,a=!1)=>{if("key"in i&&"name"in i.key)return i.key.name;if(i.type==="ObjectProperty"&&(i.key.type==="StringLiteral"||i.key.type==="NumericLiteral"||i.key.type==="BooleanLiteral"))return i.key.value.toString();if(a)throw new me(`Casting "${i.type}" is not supported`,{ast:i,code:s?.$code})},n=(i,a)=>{let o=r.properties.find(l=>t(l)===i);o?o.value=a:tp(i)?r.properties.push({type:"Property",key:{type:"Identifier",name:i},value:a}):r.properties.push({type:"ObjectProperty",key:lp.stringLiteral(i),value:a})};return je(r,{$type:"object",toJSON(){return r.properties.reduce((i,a)=>("key"in a&&"name"in a.key&&(i[a.key.name]=le(a.value,s)),i),{})}},{get(i,a){let o=e(a);if(o)return le(o,s)},set(i,a,o){return typeof a!="string"&&(a=String(a)),n(a,he(o)),!0},deleteProperty(i,a){typeof a!="string"&&(a=String(a));let o=r.properties.findIndex(l=>"key"in l&&"name"in l.key&&l.key.name===a);return o!==-1&&r.properties.splice(o,1),!0},ownKeys(){return r.properties.map(i=>t(i,!0)).filter(Boolean)}})}function pp(r,s){if(r.type!=="NewExpression")throw new me("Not a new expression");function e(n){if(n.type==="Identifier")return n.name;if(n.type==="MemberExpression")return`${e(n.object)}.${e(n.property)}`;throw new me("Not implemented")}let t=dr(r,r.arguments,s);return je(r,{$type:"new-expression",$callee:e(r.callee),$args:t},{})}function up(r){if(r.type!=="Identifier")throw new me("Not an identifier");return je(r,{$type:"identifier",$name:r.name},{})}var Xn=new WeakMap;function le(r,s){if(ma.has(typeof r))return r;if(ep.has(r.type))return r.value;if(Xn.has(r))return Xn.get(r);let e;switch(r.type){case"ObjectExpression":{e=cp(r,s);break}case"ArrayExpression":{e=ap(r,s);break}case"CallExpression":{e=op(r,s);break}case"NewExpression":{e=pp(r,s);break}case"Identifier":{e=up(r);break}case"TSAsExpression":case"TSSatisfiesExpression":{e=le(r.expression,s);break}default:throw new me(`Casting "${r.type}" is not supported`,{ast:r,code:s?.$code})}return Xn.set(r,e),e}var $t=Xt;function dp(r,s){let e=n=>{let i=n==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration";for(let a of r.body)if(a.type===i){if(n==="default")return a.declaration;if(a.declaration&&"declarations"in a.declaration){let o=a.declaration.declarations[0];if("name"in o.id&&o.id.name===n)return o.init}}},t=(n,i)=>{let a=n==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration",o=he(i);for(let l of r.body)if(l.type===a){if(n==="default"){l.declaration=o;return}if(l.declaration&&"declarations"in l.declaration){let c=l.declaration.declarations[0];if("name"in c.id&&c.id.name===n){c.init=o;return}}}r.body.push(n==="default"?$t.exportDefaultDeclaration(o):$t.exportNamedDeclaration($t.variableDeclaration("const",[$t.variableDeclarator($t.identifier(n),o)])))};return je(r,{$type:"exports"},{get(n,i){let a=e(i);if(a)return le(a,s)},set(n,i,a){return t(i,a),!0},ownKeys(){return r.body.flatMap(n=>n.type==="ExportDefaultDeclaration"?["default"]:n.type==="ExportNamedDeclaration"&&n.declaration&&"declarations"in n.declaration?n.declaration.declarations.map(i=>"name"in i.id?i.id.name:""):[]).filter(Boolean)},deleteProperty(n,i){let a=i==="default"?"ExportDefaultDeclaration":"ExportNamedDeclaration";for(let o=0;o<r.body.length;o++){let l=r.body[o];if(l.type===a){if(i==="default")return r.body.splice(o,1),!0;if(l.declaration&&"declarations"in l.declaration){let c=l.declaration.declarations[0];if("name"in c.id&&c.id.name===i)return r.body.splice(o,1),!0}}}return!1}})}function fp(r,s){let e=r.program;if(e.type!=="Program")throw new me(`Cannot proxify ${r.type} as module`);let t={$code:s,$type:"module"},n=je(e,t,{ownKeys(){return["imports","exports","generate"]}});return t.exports=dp(e,n),t.imports=ip(e),t.generate=i=>ya(n,i),n}function hp(r,s={}){let e={wrapColumn:s.wrapColumn===void 0,indent:s.tabWidth===void 0||s.useTabs===void 0,quote:s.quote===void 0,arrowParens:s.arrowParensAlways===void 0,trailingComma:s.trailingComma===void 0},t=2,n=0,i=0,a=0,o=0,l=/(?<doubleQuote>"[^"]+")|(?<singleQuote>'[^']+')|(?<singleParam>\([^),]+\)\s*=>)|(?<trailingComma>,\s*[\]}])/g,c={doubleQuote:0,singleQuote:0,singleParam:0,trailingComma:0},p=(r||"").split(`
|
|
7180
|
-
`),u=!1;for(let f of p){let m=f.trim();if(m.length!==0){if(e.wrapColumn&&f.length>a&&(a=f.length),e.indent){let d=f.match(/^\s+/)?.[0]||"";d.length>0&&(d.length>0&&d.length<t&&(t=d.length),d[0]===" "?n++:d.length>0&&n--)}if(m.at(-1)===";"?i++:m.length>0&&i--,e.quote||e.arrowParens){let d=m.matchAll(l);for(let g of d)if(g.groups)for(let h in c)g.groups[h]&&c[h]++}e.trailingComma&&((f.startsWith("}")||f.startsWith("]"))&&(u?o++:o--),u=m.endsWith(","))}}return{wrapColumn:a,useTabs:n>0,tabWidth:t,quote:c.singleQuote>c.doubleQuote?"single":"double",arrowParensAlways:c.singleParam>0,trailingComma:o>0||c.trailingComma>0,useSemi:i>0,arrayBracketSpacing:void 0,objectCurlySpacing:void 0,...s}}function mp(r,s){let e=Dc(r,{parser:s?.parser||Xc(),...s});return fp(e,r)}function ya(r,s={}){let e=r.$ast||r,t=s.format===!1||!("$code"in r)?{}:hp(r.$code,s.format),{code:n,map:i}=Jc(e,{...s,...t});return{code:n,map:i}}async function ga(r,s={}){let e=await Yn.readFile(r,"utf8");return s.sourceFileName=s.sourceFileName??r,mp(e,s)}async function ba(r,s,e){let t="$ast"in r?r.$ast:r,{code:n,map:i}=ya(t,e);await Yn.writeFile(s,n),i&&await Yn.writeFile(s+".map",i)}var Vu=es(un(),1),$u=es(Gn(),1);function xa(r,s){if(typeof s=="object")for(let e in s)typeof r[e]=="object"&&typeof s[e]=="object"?xa(r[e],s[e]):r[e]=s[e]}function fr(r){return yp(r.exports.default)}function yp(r){return r.$type==="function-call"?r.$args[0]:r}function va(r,s,e,t){let n=fr(r);n.modules||(n.modules=[]),n.modules.includes(s)||n.modules.push(s),e&&(n[e]||(n[e]={}),xa(n[e],t))}import wp from"prompts";import gp from"kleur";import bp from"prompts";var Pa=["radix-vue","tailwind-variants"],wa=["typescript","tailwindcss-animate","nuxt-icon","nuxt-lodash","prettier-plugin-tailwindcss","prettier","@nuxtjs/tailwindcss","@nuxtjs/color-mode","@ianvs/prettier-plugin-sort-imports","@vueuse/nuxt"],Ta=["@nuxtjs/tailwindcss","@nuxtjs/color-mode","@vueuse/nuxt","nuxt-lodash","nuxt-icon"],Rs=[{title:"Zinc",value:"zinc"},{title:"Slate",value:"slate"},{title:"Stone",value:"stone"},{title:"Gray",value:"gray"},{title:"Neutral",value:"neutral"},{title:"Red",value:"red"},{title:"Rose",value:"rose"},{title:"Orange",value:"orange"},{title:"Green",value:"green"},{title:"Blue",value:"blue"},{title:"Yellow",value:"yellow"},{title:"Violet",value:"violet"}];var Sa=async()=>{let r=await bp([{name:"theme",type:"autocomplete",message:"Which theme do you want to start with?",choices:Rs},{name:"tailwindCSSLocation",type:"text",message:"Where is your tailwind.css file located?",initial:"assets/css/tailwind.css"},{name:"tailwindConfigLocation",type:"text",message:"Where is your tailwind.config file located?",initial:"tailwind.config.js"},{name:"componentsLocation",type:"text",message:"Where should your components be stored?",initial:"components/UI"},{name:"composablesLocation",type:"text",message:"Where should your composables be stored?",initial:"composables"},{name:"utilsLocation",type:"text",message:"Where should your utils be stored?",initial:"utils"},{name:"force",type:"confirm",message:"Should we
|
|
7180
|
+
`),u=!1;for(let f of p){let m=f.trim();if(m.length!==0){if(e.wrapColumn&&f.length>a&&(a=f.length),e.indent){let d=f.match(/^\s+/)?.[0]||"";d.length>0&&(d.length>0&&d.length<t&&(t=d.length),d[0]===" "?n++:d.length>0&&n--)}if(m.at(-1)===";"?i++:m.length>0&&i--,e.quote||e.arrowParens){let d=m.matchAll(l);for(let g of d)if(g.groups)for(let h in c)g.groups[h]&&c[h]++}e.trailingComma&&((f.startsWith("}")||f.startsWith("]"))&&(u?o++:o--),u=m.endsWith(","))}}return{wrapColumn:a,useTabs:n>0,tabWidth:t,quote:c.singleQuote>c.doubleQuote?"single":"double",arrowParensAlways:c.singleParam>0,trailingComma:o>0||c.trailingComma>0,useSemi:i>0,arrayBracketSpacing:void 0,objectCurlySpacing:void 0,...s}}function mp(r,s){let e=Dc(r,{parser:s?.parser||Xc(),...s});return fp(e,r)}function ya(r,s={}){let e=r.$ast||r,t=s.format===!1||!("$code"in r)?{}:hp(r.$code,s.format),{code:n,map:i}=Jc(e,{...s,...t});return{code:n,map:i}}async function ga(r,s={}){let e=await Yn.readFile(r,"utf8");return s.sourceFileName=s.sourceFileName??r,mp(e,s)}async function ba(r,s,e){let t="$ast"in r?r.$ast:r,{code:n,map:i}=ya(t,e);await Yn.writeFile(s,n),i&&await Yn.writeFile(s+".map",i)}var Vu=es(un(),1),$u=es(Gn(),1);function xa(r,s){if(typeof s=="object")for(let e in s)typeof r[e]=="object"&&typeof s[e]=="object"?xa(r[e],s[e]):r[e]=s[e]}function fr(r){return yp(r.exports.default)}function yp(r){return r.$type==="function-call"?r.$args[0]:r}function va(r,s,e,t){let n=fr(r);n.modules||(n.modules=[]),n.modules.includes(s)||n.modules.push(s),e&&(n[e]||(n[e]={}),xa(n[e],t))}import wp from"prompts";import gp from"kleur";import bp from"prompts";var Pa=["radix-vue","tailwind-variants"],wa=["typescript","tailwindcss-animate","nuxt-icon","nuxt-lodash","prettier-plugin-tailwindcss","prettier","@nuxtjs/tailwindcss","@nuxtjs/color-mode","@ianvs/prettier-plugin-sort-imports","@vueuse/nuxt"],Ta=["@nuxtjs/tailwindcss","@nuxtjs/color-mode","@vueuse/nuxt","nuxt-lodash","nuxt-icon"],Rs=[{title:"Zinc",value:"zinc"},{title:"Slate",value:"slate"},{title:"Stone",value:"stone"},{title:"Gray",value:"gray"},{title:"Neutral",value:"neutral"},{title:"Red",value:"red"},{title:"Rose",value:"rose"},{title:"Orange",value:"orange"},{title:"Green",value:"green"},{title:"Blue",value:"blue"},{title:"Yellow",value:"yellow"},{title:"Violet",value:"violet"}];var Sa=async()=>{let r=await bp([{name:"theme",type:"autocomplete",message:"Which theme do you want to start with?",choices:Rs},{name:"tailwindCSSLocation",type:"text",message:"Where is your tailwind.css file located?",initial:"assets/css/tailwind.css"},{name:"tailwindConfigLocation",type:"text",message:"Where is your tailwind.config file located?",initial:"tailwind.config.js"},{name:"componentsLocation",type:"text",message:"Where should your components be stored?",initial:"components/UI"},{name:"composablesLocation",type:"text",message:"Where should your composables be stored?",initial:"composables"},{name:"utilsLocation",type:"text",message:"Where should your utils be stored?",initial:"utils"},{name:"force",type:"confirm",message:"Should we just replace component files if they already exist?",initial:!0},{name:"useDefaultFilename",type:"confirm",message:"Would you like to use the default filename when adding components?",initial:!0},{name:"packageManager",type:"select",message:"Which package manager do you use?",choices:[{title:"NPM",value:"npm"},{title:"Yarn",value:"yarn"},{title:"PNPM",value:"pnpm"},{title:"Bun",value:"bun"}]}]);return!r||Object.keys(r).length<9?(console.log(gp.red("Incomplete configuration submitted. Exiting...")),process.exit(0)):r};var Tp=process.cwd(),hr="ui-thing.config.ts",Bs=async()=>{if(!Se.existsSync("nuxt.config.ts"))return console.log(Ca.red(`No ${Ca.bgWhite("nuxt.config.ts")} file found. Exiting...`)),process.exit(0);let r=await ga(xp(Tp,"nuxt.config.ts")),s=fr(r);return{nuxtConfig:r,defaultExport:s}},Ce=async r=>{let s=Se.existsSync(hr),e={};if(!s||r?.force){if(e=await Sa(),await Se.writeFile(hr,`export default ${JSON.stringify(e,null,2)}`),e.packageManager==="pnpm")if(Se.existsSync(".npmrc")){let{confirmCreateNpmrc:n}=await wp({type:"confirm",name:"confirmCreateNpmrc",message:"A .npmrc file already exists. Do you want to overwrite it?",initial:!1});n&&await Se.writeFile(".npmrc",`shamefully-hoist=true
|
|
7181
7181
|
strict-peer-dependencies=false
|
|
7182
7182
|
`)}else await Se.writeFile(".npmrc",`shamefully-hoist=true
|
|
7183
7183
|
strict-peer-dependencies=false
|