-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(CLI): change resolve path standard tsconfig to packagejson
- Loading branch information
1 parent
66bb606
commit 20ab8a0
Showing
11 changed files
with
74 additions
and
95 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,5 @@ | ||
{ | ||
"rsc": false, | ||
"tsx": true, | ||
"aliases": { | ||
"components": "@/src/components" | ||
} | ||
"path": "./seed-design" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import "@seed-design/stylesheet/boxButton.css"; | ||
|
||
import * as React from "react"; | ||
import clsx from "clsx"; | ||
import { Slot } from "@radix-ui/react-slot"; | ||
import { boxButton, type BoxButtonVariantProps } from "@seed-design/recipe/boxButton"; | ||
|
||
export interface BoxButtonProps | ||
extends React.ButtonHTMLAttributes<HTMLButtonElement>, | ||
BoxButtonVariantProps { | ||
prefixIcon?: React.ReactNode; | ||
} | ||
|
||
export const BoxButton = React.forwardRef<HTMLButtonElement, BoxButtonProps>( | ||
({ className, variant = "brand", size = "medium", children, prefixIcon, ...otherProps }, ref) => { | ||
const classNames = boxButton({ variant, size }); | ||
return ( | ||
<button ref={ref} className={clsx(classNames.root, className)} {...otherProps}> | ||
{prefixIcon && <Slot className={classNames.prefix}>{prefixIcon}</Slot>} | ||
<span className={classNames.label}>{children}</span> | ||
</button> | ||
); | ||
}, | ||
); | ||
BoxButton.displayName = "BoxButton"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
import path from "path"; | ||
import findup from "findup-sync"; | ||
import fs from "fs-extra"; | ||
import type { PackageJson } from "type-fest"; | ||
|
||
export function getPackageInfo() { | ||
const packageJsonPath = path.join("package.json"); | ||
const PACKAGE_JSON = "package.json"; | ||
|
||
function getPackagePath() { | ||
const packageJsonPath = findup(PACKAGE_JSON); | ||
if (!packageJsonPath) { | ||
throw new Error("No package.json file found in the project."); | ||
} | ||
return packageJsonPath; | ||
} | ||
|
||
return fs.readJSONSync(packageJsonPath) as PackageJson; | ||
export function getPackageInfo() { | ||
return fs.readJSONSync(getPackagePath()) as PackageJson; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters