bearnie 0.1.6 → 0.1.7
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 +4 -0
- package/dist/commands/add.d.ts +7 -0
- package/dist/commands/init.d.ts +6 -0
- package/dist/commands/list.d.ts +5 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +5 -0
- package/dist/utils/config.d.ts +22 -0
- package/dist/utils/registry.d.ts +30 -0
- package/dist/utils/ui.d.ts +57 -0
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -62,6 +62,8 @@ This will:
|
|
|
62
62
|
- Create the `cn()` utility function
|
|
63
63
|
- Install `clsx`, `tailwind-merge`, and `tailwindcss` dependencies
|
|
64
64
|
|
|
65
|
+
Projects created with `create-bearnie` already include `bearnie.json` and can skip init.
|
|
66
|
+
|
|
65
67
|
**Options:**
|
|
66
68
|
|
|
67
69
|
- `-y, --yes` - Skip confirmation prompts and use defaults
|
|
@@ -106,6 +108,8 @@ npx bearnie list
|
|
|
106
108
|
npx bearnie list --json
|
|
107
109
|
```
|
|
108
110
|
|
|
111
|
+
Components are grouped by category, including **Theme** (`styles`) and **Meta** (`barrel`).
|
|
112
|
+
|
|
109
113
|
**Options:**
|
|
110
114
|
|
|
111
115
|
- `--json` - Output as JSON
|
package/dist/index.d.ts
ADDED
package/dist/index.js
CHANGED
|
@@ -579,6 +579,8 @@ async function list(options) {
|
|
|
579
579
|
categories.get(cat).push(component);
|
|
580
580
|
}
|
|
581
581
|
const categoryConfig = {
|
|
582
|
+
theme: { emoji: "\u{1F3A8}", label: "Theme" },
|
|
583
|
+
meta: { emoji: "\u{1F4E6}", label: "Meta" },
|
|
582
584
|
foundation: { emoji: "\u{1F3A8}", label: "Foundation" },
|
|
583
585
|
form: { emoji: "\u{1F4DD}", label: "Form" },
|
|
584
586
|
layout: { emoji: "\u{1F4D0}", label: "Layout" },
|
|
@@ -589,6 +591,8 @@ async function list(options) {
|
|
|
589
591
|
other: { emoji: "\u{1F4E6}", label: "Other" }
|
|
590
592
|
};
|
|
591
593
|
const categoryOrder = [
|
|
594
|
+
"theme",
|
|
595
|
+
"meta",
|
|
592
596
|
"foundation",
|
|
593
597
|
"form",
|
|
594
598
|
"layout",
|
|
@@ -617,6 +621,7 @@ async function list(options) {
|
|
|
617
621
|
console.log(` ${brand.muted("\u2192")} Add a component: ${chalk4.cyan("npx bearnie add button")}`);
|
|
618
622
|
console.log(` ${brand.muted("\u2192")} Add everything: ${chalk4.cyan("npx bearnie add --all")}`);
|
|
619
623
|
console.log(` ${brand.muted("\u2192")} Add CSS variables: ${chalk4.cyan("npx bearnie add styles")}`);
|
|
624
|
+
console.log(` ${brand.muted("\u2192")} Add barrel export: ${chalk4.cyan("npx bearnie add barrel")}`);
|
|
620
625
|
print.newline();
|
|
621
626
|
} catch (error) {
|
|
622
627
|
spinner.fail(messages.networkError());
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface ProjectConfig {
|
|
2
|
+
componentsDir: string;
|
|
3
|
+
utilsDir: string;
|
|
4
|
+
stylesDir: string;
|
|
5
|
+
tailwindConfig: string;
|
|
6
|
+
typescript: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const DEFAULT_CONFIG: ProjectConfig;
|
|
9
|
+
export declare const CONFIG_FILE = "bearnie.json";
|
|
10
|
+
export declare function getProjectConfig(cwd: string): Promise<ProjectConfig | null>;
|
|
11
|
+
export declare function saveProjectConfig(cwd: string, config: ProjectConfig): Promise<void>;
|
|
12
|
+
export declare function isAstroProject(cwd: string): Promise<boolean>;
|
|
13
|
+
export declare function hasTailwindInstalled(cwd: string): Promise<boolean>;
|
|
14
|
+
export declare function writeComponentFile(cwd: string, config: ProjectConfig, componentPath: string, content: string, overwrite?: boolean): Promise<{
|
|
15
|
+
written: boolean;
|
|
16
|
+
path: string;
|
|
17
|
+
}>;
|
|
18
|
+
export declare function resolveInstallPath(cwd: string, config: ProjectConfig, filePath: string, componentType?: string): string;
|
|
19
|
+
export declare function writeUtilFile(cwd: string, config: ProjectConfig, utilPath: string, content: string, overwrite?: boolean): Promise<{
|
|
20
|
+
written: boolean;
|
|
21
|
+
path: string;
|
|
22
|
+
}>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export declare const REGISTRY_URL: string;
|
|
2
|
+
export declare const REGISTRY_PATH: string | undefined;
|
|
3
|
+
export declare const REGISTRY_INDEX_URL: string;
|
|
4
|
+
export interface RegistryComponent {
|
|
5
|
+
name: string;
|
|
6
|
+
type?: "component" | "utility" | "styles";
|
|
7
|
+
description: string;
|
|
8
|
+
category: string;
|
|
9
|
+
dependencies?: string[];
|
|
10
|
+
devDependencies?: string[];
|
|
11
|
+
registryDependencies?: string[];
|
|
12
|
+
files: RegistryFile[];
|
|
13
|
+
}
|
|
14
|
+
export interface RegistryFile {
|
|
15
|
+
name: string;
|
|
16
|
+
path: string;
|
|
17
|
+
content: string;
|
|
18
|
+
}
|
|
19
|
+
export interface RegistryIndex {
|
|
20
|
+
name: string;
|
|
21
|
+
version: string;
|
|
22
|
+
components: {
|
|
23
|
+
name: string;
|
|
24
|
+
description: string;
|
|
25
|
+
category: string;
|
|
26
|
+
}[];
|
|
27
|
+
}
|
|
28
|
+
export declare function getRegistryIndex(): Promise<RegistryIndex>;
|
|
29
|
+
export declare function getComponent(name: string): Promise<RegistryComponent>;
|
|
30
|
+
export declare function resolveComponentDependencies(names: string[], resolved?: Set<string>): Promise<string[]>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare const brand: {
|
|
2
|
+
primary: import("chalk").ChalkInstance;
|
|
3
|
+
secondary: import("chalk").ChalkInstance;
|
|
4
|
+
accent: import("chalk").ChalkInstance;
|
|
5
|
+
muted: import("chalk").ChalkInstance;
|
|
6
|
+
success: import("chalk").ChalkInstance;
|
|
7
|
+
warning: import("chalk").ChalkInstance;
|
|
8
|
+
error: import("chalk").ChalkInstance;
|
|
9
|
+
info: import("chalk").ChalkInstance;
|
|
10
|
+
};
|
|
11
|
+
export declare const banner: string;
|
|
12
|
+
export declare const logo: string;
|
|
13
|
+
export declare const messages: {
|
|
14
|
+
greeting: () => string;
|
|
15
|
+
initStart: () => string;
|
|
16
|
+
initSuccess: () => string;
|
|
17
|
+
alreadyInit: () => string;
|
|
18
|
+
addStart: () => string;
|
|
19
|
+
fetching: () => string;
|
|
20
|
+
foundComponents: (count: number) => string;
|
|
21
|
+
resolving: () => string;
|
|
22
|
+
installing: (name: string) => string;
|
|
23
|
+
installed: (name: string) => string;
|
|
24
|
+
installingDeps: () => string;
|
|
25
|
+
listHeader: (version: string) => string;
|
|
26
|
+
listFooter: (count: number) => string;
|
|
27
|
+
success: () => string;
|
|
28
|
+
notAstro: () => string;
|
|
29
|
+
notAstroHelp: () => string;
|
|
30
|
+
networkError: () => string;
|
|
31
|
+
networkErrorHelp: () => string;
|
|
32
|
+
unknownComponent: (names: string[]) => string;
|
|
33
|
+
hint: (text: string) => string;
|
|
34
|
+
nextStep: (step: string) => string;
|
|
35
|
+
};
|
|
36
|
+
export declare function box(content: string, title?: string): string;
|
|
37
|
+
export declare const newline: () => void;
|
|
38
|
+
export declare const space: (n?: number) => void;
|
|
39
|
+
export declare const print: {
|
|
40
|
+
banner: () => void;
|
|
41
|
+
logo: () => void;
|
|
42
|
+
greeting: () => void;
|
|
43
|
+
success: () => void;
|
|
44
|
+
newline: () => void;
|
|
45
|
+
step: (text: string) => void;
|
|
46
|
+
hint: (text: string) => void;
|
|
47
|
+
error: (text: string) => void;
|
|
48
|
+
warning: (text: string) => void;
|
|
49
|
+
info: (text: string) => void;
|
|
50
|
+
nextSteps: (steps: string[]) => void;
|
|
51
|
+
footer: () => void;
|
|
52
|
+
};
|
|
53
|
+
export declare const promptsTheme: {
|
|
54
|
+
prefix: string;
|
|
55
|
+
highlight: import("chalk").ChalkInstance;
|
|
56
|
+
submit: string;
|
|
57
|
+
};
|
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bearnie",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "CLI for installing Bearnie UI components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"bin": "dist/index.js",
|
|
8
|
+
"types": "dist/index.d.ts",
|
|
8
9
|
"files": [
|
|
9
10
|
"dist"
|
|
10
11
|
],
|
|
11
12
|
"scripts": {
|
|
12
|
-
"build": "tsup src/index.ts --format esm --clean",
|
|
13
|
+
"build": "tsup src/index.ts --format esm --clean && tsc --emitDeclarationOnly",
|
|
13
14
|
"dev": "tsup src/index.ts --format esm --watch",
|
|
14
15
|
"typecheck": "tsc --noEmit"
|
|
15
16
|
},
|