@noarka/cli 0.1.1 → 0.1.4
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 +19 -19
- package/dist/cli.js +13 -4
- package/package.json +37 -36
package/README.md
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
# @noarka/cli
|
|
2
|
-
|
|
3
|
-
Scaffold Noarka UI primitives into your project
|
|
4
|
-
|
|
5
|
-
```bash
|
|
6
|
-
npx @noarka/cli init
|
|
7
|
-
npx @noarka/cli add button
|
|
8
|
-
npx @noarka/cli list
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
- `init` writes `utils/cn.ts` once per project.
|
|
12
|
-
- `add <component>` copies the primitive to `components/ui/` (lowercase
|
|
13
|
-
basenames, same-dir imports rewritten) and writes `utils/cn.ts` if missing.
|
|
14
|
-
Components that use another primitive print a follow-up `add` command.
|
|
15
|
-
- Templates ship inside `@noarka/ui` itself, so scaffolded code always
|
|
16
|
-
matches the installed library version.
|
|
17
|
-
|
|
18
|
-
Options: `--dir <path>` scaffolds into another project root, `--overwrite`
|
|
19
|
-
replaces existing files.
|
|
1
|
+
# @noarka/cli
|
|
2
|
+
|
|
3
|
+
Scaffold Noarka UI primitives into your project.
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npx @noarka/cli init
|
|
7
|
+
npx @noarka/cli add button
|
|
8
|
+
npx @noarka/cli list
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
- `init` writes `utils/cn.ts` once per project.
|
|
12
|
+
- `add <component>` copies the primitive to `components/ui/` (lowercase
|
|
13
|
+
basenames, same-dir imports rewritten) and writes `utils/cn.ts` if missing.
|
|
14
|
+
Components that use another primitive print a follow-up `add` command.
|
|
15
|
+
- Templates ship inside `@noarka/ui` itself, so scaffolded code always
|
|
16
|
+
matches the installed library version.
|
|
17
|
+
|
|
18
|
+
Options: `--dir <path>` scaffolds into another project root, `--overwrite`
|
|
19
|
+
replaces existing files.
|
package/dist/cli.js
CHANGED
|
@@ -85,10 +85,19 @@ function peerDeps(dir) {
|
|
|
85
85
|
function cmdInit(projectDir, overwrite) {
|
|
86
86
|
const { target, status } = ensureCn(projectDir, overwrite);
|
|
87
87
|
console.log(`${status}: ${path.relative(process.cwd(), target)}`);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
88
|
+
const cssTarget = path.join(projectDir, "styles", "globals.css");
|
|
89
|
+
const cssContent = `@import "@noarka/ui/styles/tokens.css";
|
|
90
|
+
@import "@noarka/ui/styles/base.css";
|
|
91
|
+
|
|
92
|
+
/* Required: node_modules is skipped by Tailwind v4's automatic content detection. */
|
|
93
|
+
@source "../node_modules/@noarka/ui/dist/**/*.js";
|
|
94
|
+
`;
|
|
95
|
+
const cssStatus = writeFile(cssTarget, cssContent, overwrite);
|
|
96
|
+
console.log(`${cssStatus}: ${path.relative(process.cwd(), cssTarget)}`);
|
|
97
|
+
console.log("\nNext: import the scaffolded stylesheet once in your app entry:");
|
|
98
|
+
console.log(' import "./styles/globals.css";');
|
|
99
|
+
console.log("\nDesign tokens (incl. --surface) are now available as utilities:");
|
|
100
|
+
console.log(" bg-surface, text-foreground, bg-muted, ...");
|
|
92
101
|
}
|
|
93
102
|
function cmdAdd(name, projectDir, overwrite) {
|
|
94
103
|
const dir = findDir(name);
|
package/package.json
CHANGED
|
@@ -1,36 +1,37 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@noarka/cli",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Scaffold Noarka UI primitives into your project
|
|
5
|
-
"license": "MIT",
|
|
6
|
-
"type": "module",
|
|
7
|
-
"bin": {
|
|
8
|
-
"noarka": "./dist/cli.js"
|
|
9
|
-
},
|
|
10
|
-
"files": [
|
|
11
|
-
"dist",
|
|
12
|
-
"README.md",
|
|
13
|
-
"LICENSE"
|
|
14
|
-
],
|
|
15
|
-
"keywords": [
|
|
16
|
-
"noarka",
|
|
17
|
-
"ui",
|
|
18
|
-
"cli",
|
|
19
|
-
"scaffold",
|
|
20
|
-
"components"
|
|
21
|
-
],
|
|
22
|
-
"publishConfig": {
|
|
23
|
-
"access": "public"
|
|
24
|
-
},
|
|
25
|
-
"
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
},
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@noarka/cli",
|
|
3
|
+
"version": "0.1.4",
|
|
4
|
+
"description": "Scaffold Noarka UI primitives into your project.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"noarka": "./dist/cli.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"keywords": [
|
|
16
|
+
"noarka",
|
|
17
|
+
"ui",
|
|
18
|
+
"cli",
|
|
19
|
+
"scaffold",
|
|
20
|
+
"components"
|
|
21
|
+
],
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsup src/cli.ts --format esm --clean",
|
|
27
|
+
"typecheck": "tsc --noEmit"
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@noarka/ui": "workspace:^0.1.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/node": "^20.19.43",
|
|
34
|
+
"tsup": "^8.3.5",
|
|
35
|
+
"typescript": "^5"
|
|
36
|
+
}
|
|
37
|
+
}
|