Skip to content

Commit f8cb30e

Browse files
committed
fix: executor
1 parent 43f3978 commit f8cb30e

File tree

8 files changed

+26
-30
lines changed

8 files changed

+26
-30
lines changed

bun.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"figlet": "^1.8.1",
1313
"nanoid": "^5.1.5",
1414
"rc9": "^2.1.2",
15-
"shadcn": "^2.6.0",
15+
"shadcn": "^2.7.0",
1616
},
1717
"devDependencies": {
1818
"@biomejs/biome": "^1.9.4",
@@ -1080,7 +1080,7 @@
10801080

10811081
"setprototypeof": ["setprototypeof@1.2.0", "", {}, "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw=="],
10821082

1083-
"shadcn": ["shadcn@2.6.0", "", { "dependencies": { "@antfu/ni": "^23.2.0", "@babel/core": "^7.22.1", "@babel/parser": "^7.22.6", "@babel/plugin-transform-typescript": "^7.22.5", "@modelcontextprotocol/sdk": "^1.10.2", "commander": "^10.0.0", "cosmiconfig": "^8.1.3", "deepmerge": "^4.3.1", "diff": "^5.1.0", "execa": "^7.0.0", "fast-glob": "^3.3.2", "fs-extra": "^11.1.0", "https-proxy-agent": "^6.2.0", "kleur": "^4.1.5", "msw": "^2.7.1", "node-fetch": "^3.3.0", "ora": "^6.1.2", "postcss": "^8.4.24", "prompts": "^2.4.2", "recast": "^0.23.2", "stringify-object": "^5.0.0", "ts-morph": "^18.0.0", "tsconfig-paths": "^4.2.0", "zod": "^3.20.2", "zod-to-json-schema": "^3.24.5" }, "bin": { "shadcn": "dist/index.js" } }, "sha512-Z/yN3TnVPvdnr623Ln4RIOs20++6HFEAEMQObDOsU3+qkoQ0Y/gAP+S8/paAnUAXj849hDNtu4SJEvhW9XqJUA=="],
1083+
"shadcn": ["shadcn@2.7.0", "", { "dependencies": { "@antfu/ni": "^23.2.0", "@babel/core": "^7.22.1", "@babel/parser": "^7.22.6", "@babel/plugin-transform-typescript": "^7.22.5", "@modelcontextprotocol/sdk": "^1.10.2", "commander": "^10.0.0", "cosmiconfig": "^8.1.3", "deepmerge": "^4.3.1", "diff": "^5.1.0", "execa": "^7.0.0", "fast-glob": "^3.3.2", "fs-extra": "^11.1.0", "https-proxy-agent": "^6.2.0", "kleur": "^4.1.5", "msw": "^2.7.1", "node-fetch": "^3.3.0", "ora": "^6.1.2", "postcss": "^8.4.24", "prompts": "^2.4.2", "recast": "^0.23.2", "stringify-object": "^5.0.0", "ts-morph": "^18.0.0", "tsconfig-paths": "^4.2.0", "zod": "^3.20.2", "zod-to-json-schema": "^3.24.5" }, "bin": { "shadcn": "dist/index.js" } }, "sha512-NzkUf58HI3AxcrdnmAgdN3oT0f2J5CyFKMi2exdVLtoRW+A5GxADxWqhWKRvBmdWoiPDuqYeb3ScZxhlS9aflA=="],
10841084

10851085
"shebang-command": ["shebang-command@2.0.0", "", { "dependencies": { "shebang-regex": "^3.0.0" } }, "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA=="],
10861086

package.json

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@
99
"intentui": "dist/index.js",
1010
"shadcnClone": "dist/shadcn/index.js"
1111
},
12-
"files": [
13-
"dist",
14-
"LICENSE",
15-
"README.md",
16-
"package.json"
17-
],
12+
"files": ["dist", "LICENSE", "README.md", "package.json"],
1813
"repository": {
1914
"type": "git",
2015
"url": "git+https://github.com/intentuilabs/cli.git"
@@ -34,12 +29,7 @@
3429
"release": "export GITHUB_TOKEN=$(cat .github_token) && release-it",
3530
"typecheck": "tsc --noEmit"
3631
},
37-
"keywords": [
38-
"cli",
39-
"intentui cli",
40-
"Intent UI",
41-
"design-system"
42-
],
32+
"keywords": ["cli", "intentui cli", "Intent UI", "design-system"],
4333
"author": "Irsyad A. Panjaitan",
4434
"license": "MIT",
4535
"devDependencies": {
@@ -64,7 +54,7 @@
6454
"figlet": "^1.8.1",
6555
"nanoid": "^5.1.5",
6656
"rc9": "^2.1.2",
67-
"shadcn": "^2.6.0"
57+
"shadcn": "^2.7.0"
6858
},
6959
"release-it": {
7060
"git": {

src/commands/add.command.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import {
1818
isNextWithoutSrc,
1919
isRemix,
2020
} from "~/lib/check-current-user-project"
21+
import { resolveShadcnClone } from "~/lib/resolve-shadnc-clone"
2122
import { walkFiles } from "~/lib/walk-files"
2223
import { Component } from "~/schema/component"
2324

@@ -61,7 +62,7 @@ export const addCommand = Command.make(
6162
if (overwrite) args.push("--overwrite")
6263
args.push(...components)
6364
return yield* pipe(
64-
RawCommand.make("shadcnClone", ...args).pipe(
65+
RawCommand.make("node", resolveShadcnClone(), ...args).pipe(
6566
RawCommand.stdin("inherit"),
6667
RawCommand.stdout("inherit"),
6768
RawCommand.stderr("inherit"),
@@ -90,7 +91,7 @@ export const addCommand = Command.make(
9091
args.push(...componentPaths)
9192

9293
const exitCode = yield* pipe(
93-
RawCommand.make("shadcnClone", ...args).pipe(
94+
RawCommand.make("node", resolveShadcnClone(), ...args).pipe(
9495
RawCommand.stdin("inherit"),
9596
RawCommand.stdout("inherit"),
9697
RawCommand.stderr("inherit"),
@@ -141,7 +142,6 @@ export const addCommand = Command.make(
141142
}
142143
}
143144
}
144-
145145
}
146146

147147
return exitCode

src/commands/block.command.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Args, Command, Options } from "@effect/cli"
22
import { Command as RawCommand } from "@effect/platform"
33
import { Console, Effect, pipe } from "effect"
44
import { BLOCKS_REGISTRY_URL } from "~/consts"
5+
import { resolveShadcnClone } from "~/lib/resolve-shadnc-clone"
56
import { getApiKey } from "./login.command"
67

78
export const blockName = Args.text({ name: "blockName" })
@@ -42,7 +43,7 @@ export const addBlockCommand = Command.make(
4243
args.push(componentPath)
4344

4445
return yield* pipe(
45-
RawCommand.make("shadcnClone", ...args).pipe(
46+
RawCommand.make("node", resolveShadcnClone(), ...args).pipe(
4647
RawCommand.stdin("inherit"),
4748
RawCommand.stdout("inherit"),
4849
RawCommand.stderr("inherit"),

src/commands/init.command.ts

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,13 @@ import { Console, Effect } from "effect"
66
import { REGISTRY_URL } from "~/consts"
77

88
import { NodeCommandExecutor } from "@effect/platform-node"
9-
const shadcnInit = RawCommand.make("shadcnClone", "init", `${REGISTRY_URL}/r/style/default`).pipe(
10-
RawCommand.stdin("inherit"),
11-
RawCommand.stdout("inherit"),
12-
RawCommand.stderr("inherit"),
13-
)
9+
import { resolveShadcnClone } from "~/lib/resolve-shadnc-clone"
10+
const shadcnInit = RawCommand.make(
11+
"node",
12+
resolveShadcnClone(),
13+
"init",
14+
`${REGISTRY_URL}/r/style/default`,
15+
).pipe(RawCommand.stdin("inherit"), RawCommand.stdout("inherit"), RawCommand.stderr("inherit"))
1416

1517
export const initCommand = Command.make("init", {}, () =>
1618
Effect.gen(function* () {

src/commands/theme.command.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,15 @@ import { Effect } from "effect"
33
import { REGISTRY_URL } from "~/consts"
44

55
import { Command as RawCommand } from "@effect/platform"
6+
import { resolveShadcnClone } from "~/lib/resolve-shadnc-clone"
67

78
export const theme = Args.text({ name: "theme" })
89

910
export const themeCommand = Command.make("theme", { theme }, (config) =>
1011
Effect.gen(function* () {
1112
const themePath = `${REGISTRY_URL}/r/style/${config.theme}`
1213

13-
const exitCode = yield* RawCommand.make("shadcnClone", "add", themePath).pipe(
14+
const exitCode = yield* RawCommand.make("node", resolveShadcnClone(), "add", themePath).pipe(
1415
RawCommand.stdin("inherit"),
1516
RawCommand.stdout("inherit"),
1617
RawCommand.stderr("inherit"),

src/lib/resolve-shadnc-clone.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import * as Path from "node:path"
2+
3+
export function resolveShadcnClone() {
4+
return Path.resolve(__dirname, "../../dist/shadcn/index.js")
5+
}

src/lib/walk-files.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
1+
import * as Path from "node:path"
12
// biome-ignore lint/style/useImportType: <explanation>
23
import * as FS from "@effect/platform/FileSystem"
3-
import * as Path from "node:path"
44
import { Effect } from "effect"
55

6-
export function walkFiles(
7-
fs: FS.FileSystem,
8-
dir: string,
9-
): Effect.Effect<string[], unknown> {
6+
export function walkFiles(fs: FS.FileSystem, dir: string): Effect.Effect<string[], unknown> {
107
return Effect.gen(function* () {
118
const entries = yield* fs.readDirectory(dir)
129
const out: string[] = []

0 commit comments

Comments
 (0)