centoui-cli 0.0.0
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/LICENSE +21 -0
- package/README.md +48 -0
- package/dist/index.d.ts +41 -0
- package/dist/index.js +20 -0
- package/package.json +50 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Favour Emeka
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# centoui-cli
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/centoui-cli)
|
|
4
|
+
[](https://www.npmjs.com/package/centoui-cli)
|
|
5
|
+
[](https://github.com/favorodera/centoui/blob/main/LICENSE)
|
|
6
|
+
|
|
7
|
+
**CentoUI CLI: Manage your components with ease.**
|
|
8
|
+
|
|
9
|
+
`centoui-cli` is the official command-line interface for [CentoUI](https://github.com/favorodera/centoui). It allows you to initialize CentoUI in your project, add new components, and manage their versions directly from your terminal.
|
|
10
|
+
|
|
11
|
+
## Commands
|
|
12
|
+
|
|
13
|
+
- **`init`**: Set up a new CentoUI project (generates `centoui.config.ts` and `tokens.css`).
|
|
14
|
+
- **`add [component]`**: Add specific components to your project. Peer dependencies install automatically.
|
|
15
|
+
- **`remove [component]`**: Cleanly remove components and their dependencies.
|
|
16
|
+
|
|
17
|
+
## Usage
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
# Initialize CentoUI in your project
|
|
21
|
+
npx centoui init
|
|
22
|
+
|
|
23
|
+
# Add components
|
|
24
|
+
npx centoui add button dialog input select
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Configuration
|
|
28
|
+
|
|
29
|
+
The CLI generates a `centoui.config.ts` file in your root directory. You can customize the component directory, theme directory, and utility directory here.
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { defineConfig } from "centoui"
|
|
33
|
+
|
|
34
|
+
export default defineConfig({
|
|
35
|
+
version: "1.0.0",
|
|
36
|
+
componentsDir: "./src/components/centoui",
|
|
37
|
+
themeDir: "./src/assets/css/centoui.css",
|
|
38
|
+
icons: {
|
|
39
|
+
check: "lucide:check",
|
|
40
|
+
close: "lucide:x",
|
|
41
|
+
menu: "lucide:menu",
|
|
42
|
+
},
|
|
43
|
+
})
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## License
|
|
47
|
+
|
|
48
|
+
[MIT](../../LICENSE) © [Favour Emeka](https://github.com/favorodera)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
//#region src/types.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Global registry mirroring the JSON schema shapes
|
|
4
|
+
* Defines global configurations required by all CentoUI components
|
|
5
|
+
*/
|
|
6
|
+
type GlobalsRegistry = {
|
|
7
|
+
/**
|
|
8
|
+
* NPM packages that must be installed in every CentoUI project.
|
|
9
|
+
* Keys are package names, values are semver version ranges.
|
|
10
|
+
*/
|
|
11
|
+
packageDeps: Record<string, string>;
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Component registry mirroring the JSON schema shapes
|
|
15
|
+
* Describes a single installable CentoUI component.
|
|
16
|
+
*/
|
|
17
|
+
type ComponentRegistry = {
|
|
18
|
+
/** Unique component identifier. */name: string; /** Short human-readable description. */
|
|
19
|
+
description?: string; /** Paths to all source files that belong to this component, relative to the repository root. */
|
|
20
|
+
files: string[]; /** Names of other CentoUI components that must be installed alongside this one. */
|
|
21
|
+
componentDeps: string[]; /** NPM packages required specifically by this component, beyond the global dependencies. */
|
|
22
|
+
packageDeps: Record<string, string>;
|
|
23
|
+
};
|
|
24
|
+
/** CentoUI registry, representing the complete component library. */
|
|
25
|
+
type Registry = {
|
|
26
|
+
/** Global configurations required by all CentoUI components */globals: GlobalsRegistry; /** All installable CentoUI components */
|
|
27
|
+
components: ComponentRegistry[];
|
|
28
|
+
};
|
|
29
|
+
/** CentoUI configuration */
|
|
30
|
+
type CentoUIConfig = {
|
|
31
|
+
/** CentoUI library version */version: string; /** Directory path where components will be installed */
|
|
32
|
+
componentsDir: string; /** Path to the CSS file where theme and component styles will be generated */
|
|
33
|
+
themeFilePath: string;
|
|
34
|
+
/**
|
|
35
|
+
* Maps internal icon names to Iconify IDs
|
|
36
|
+
* @example { menu: 'lucide:menu' }
|
|
37
|
+
*/
|
|
38
|
+
icons: Record<string, string>;
|
|
39
|
+
};
|
|
40
|
+
//#endregion
|
|
41
|
+
export { CentoUIConfig, ComponentRegistry, GlobalsRegistry, Registry };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { defineCommand, runMain } from "citty";
|
|
3
|
+
//#endregion
|
|
4
|
+
//#region src/constants.ts
|
|
5
|
+
/** CentoUI current package version */
|
|
6
|
+
const VERSION = "0.0.0";
|
|
7
|
+
/** CentoUI core base API URL */
|
|
8
|
+
const BASE_URL = `https://raw.githubusercontent.com/favorodera/centoui/refs/tags/v${VERSION}/packages/core/src`;
|
|
9
|
+
`${BASE_URL}`;
|
|
10
|
+
`${BASE_URL}`;
|
|
11
|
+
//#endregion
|
|
12
|
+
//#region src/index.ts
|
|
13
|
+
runMain(defineCommand({
|
|
14
|
+
meta: {
|
|
15
|
+
name: "centoui",
|
|
16
|
+
version: VERSION
|
|
17
|
+
},
|
|
18
|
+
subCommands: {}
|
|
19
|
+
}));
|
|
20
|
+
//#endregion
|
package/package.json
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "centoui-cli",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.0",
|
|
5
|
+
"description": "Official CLI for CentoUI.",
|
|
6
|
+
"author": "Favour Emeka <favorodera@gmail.com>",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"homepage": "https://centoui.vercel.app",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/favorodera/centoui.git"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/favorodera/centoui/issues"
|
|
15
|
+
},
|
|
16
|
+
"publishConfig": {
|
|
17
|
+
"access": "public"
|
|
18
|
+
},
|
|
19
|
+
"exports": {
|
|
20
|
+
".": "./dist/index.js",
|
|
21
|
+
"./package.json": "./package.json"
|
|
22
|
+
},
|
|
23
|
+
"types": "./dist/types.d.mts",
|
|
24
|
+
"files": [
|
|
25
|
+
"dist"
|
|
26
|
+
],
|
|
27
|
+
"bin": {
|
|
28
|
+
"centoui": "./dist/index.js"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@types/fs-extra": "^11.0.4",
|
|
32
|
+
"tsdown": "^0.21.7"
|
|
33
|
+
},
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"citty": "^0.2.2",
|
|
36
|
+
"fs-extra": "^11.3.4",
|
|
37
|
+
"nypm": "^0.6.6",
|
|
38
|
+
"pathe": "^2.0.3",
|
|
39
|
+
"@clack/prompts": "^1.2.0"
|
|
40
|
+
},
|
|
41
|
+
"engines": {
|
|
42
|
+
"node": ">=22.0.0"
|
|
43
|
+
},
|
|
44
|
+
"scripts": {
|
|
45
|
+
"build": "tsdown",
|
|
46
|
+
"dev": "tsdown --watch",
|
|
47
|
+
"typecheck": "tsc --noEmit",
|
|
48
|
+
"lint": "eslint . --fix"
|
|
49
|
+
}
|
|
50
|
+
}
|