Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Commit f8cb30e

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

8 files changed

Lines changed: 26 additions & 30 deletions

File tree

bun.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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)