Skip to content

Commit 9e072ac

Browse files
committed
feat: vpcar CLI tool
1 parent 66b7fd6 commit 9e072ac

File tree

10 files changed

+98
-46
lines changed

10 files changed

+98
-46
lines changed

package.json

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"dev": "pnpm --filter vitepress-carbon-demo run dev",
1212
"demo-build": "vitepress build ./packages/demo",
1313
"lint": "prettier --check --write --parser typescript \"{__tests__,docs,packages,types}/**/*.ts\"",
14-
"lint:fail": "prettier --check --parser typescript \"{__tests__,docs,packages,types}/**/*.ts\""
14+
"lint:fail": "prettier --check --parser typescript \"{__tests__,docs,packages,types}/**/*.ts\"",
15+
"release": "changelogen --release && pnpm --filter vpcar run release && pnpm --filter vitepress-carbon release && git push --follow-tags"
1516
},
1617
"author": "Breno A.",
1718
"license": "MIT",
@@ -26,6 +27,7 @@
2627
"dependencies": {
2728
"@algolia/client-search": "^5.7.0",
2829
"@types/node": "^22.7.4",
30+
"changelogen": "^0.5.7",
2931
"mark.js": "^8.11.1",
3032
"search-insights": "^2.17.2",
3133
"vite": "^5.4.8",

packages/cli/CHANGELOG.md

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Changelog
2+
3+
4+
## v0.0.2
5+
6+
[compare changes](https://github.com/brenoepics/vitepress-carbon/compare/1.3.3...v0.0.2)
7+
8+
### 🚀 Enhancements
9+
10+
- Add templates package ([59dc6a6](https://github.com/brenoepics/vitepress-carbon/commit/59dc6a6))
11+
- Add cli package ([8dd5ce4](https://github.com/brenoepics/vitepress-carbon/commit/8dd5ce4))
12+
13+
### 🩹 Fixes
14+
15+
- Add demo config files ([6e28781](https://github.com/brenoepics/vitepress-carbon/commit/6e28781))
16+
- Add `vite` and extend searchForWorkspaceRoot ([4b5e287](https://github.com/brenoepics/vitepress-carbon/commit/4b5e287))
17+
- Add missing dependencies ([ebbe979](https://github.com/brenoepics/vitepress-carbon/commit/ebbe979))
18+
19+
### 🏡 Chore
20+
21+
- Bump vitepress dependency ([9de56f3](https://github.com/brenoepics/vitepress-carbon/commit/9de56f3))
22+
- **deps-dev:** Bump @types/node from 20.16.1 to 22.4.1 ([a67296c](https://github.com/brenoepics/vitepress-carbon/commit/a67296c))
23+
- Migrate to pnpm and monorepo structure ([63647d1](https://github.com/brenoepics/vitepress-carbon/commit/63647d1))
24+
- Migrate to pnpm and monorepo structure ([65026cc](https://github.com/brenoepics/vitepress-carbon/commit/65026cc))
25+
- Un-ignore `pnpm-lock.yml` ([92d9a5e](https://github.com/brenoepics/vitepress-carbon/commit/92d9a5e))
26+
- Un-ignore `pnpm-lock.yml` ([96f7787](https://github.com/brenoepics/vitepress-carbon/commit/96f7787))
27+
- Bump `pnpm-lock.yml` ([b6453eb](https://github.com/brenoepics/vitepress-carbon/commit/b6453eb))
28+
- Update README.md ([dbc2f63](https://github.com/brenoepics/vitepress-carbon/commit/dbc2f63))
29+
- Remove unused package detector ([66b7fd6](https://github.com/brenoepics/vitepress-carbon/commit/66b7fd6))
30+
31+
### 🤖 CI
32+
33+
- Update `actions/upload-pages-artifact` version ([5bc48cf](https://github.com/brenoepics/vitepress-carbon/commit/5bc48cf))
34+
- Fix demo build command ([922ab76](https://github.com/brenoepics/vitepress-carbon/commit/922ab76))
35+
36+
### ❤️ Contributors
37+
38+
- Breno A. ([@brenoepics](http://github.com/brenoepics))
39+

packages/cli/README.md

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# vpcar
2+
3+
vpcar is a CLI tool for initializing and managing VitePress Carbon projects. It simplifies the setup process and
4+
provides useful commands to streamline your development workflow.
5+
6+
![NPM Version](https://img.shields.io/npm/v/vpcar)
7+
![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/brenoepics/vitepress-carbon/node.js.yml)
8+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=brenoepics_vitepress-carbon&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=brenoepics_vitepress-carbon)
9+
![GitHub Repo stars](https://img.shields.io/github/stars/brenoepics/vitepress-carbon)
10+
11+
## Documentation
12+
13+
Check out the [VitePress Carbon Docs](https://carbon.breno.tech) for detailed information on how to use VitePress
14+
Carbon.
15+
16+
## Usage
17+
18+
To create a new VitePress Carbon project, run:
19+
20+
```sh
21+
npx vpcar init <project-name>
22+
```
23+
24+
This will prompt you to select various options and set up your project accordingly.
25+
26+
## Contributing
27+
28+
If you encounter any issues or have suggestions for improvements, feel free
29+
to [open an issue](https://github.com/brenoepics/vitepress-carbon/issues)
30+
or [submit a pull request](https://github.com/brenoepics/vitepress-carbon/pulls). Your contributions and ⭐ are greatly
31+
appreciated!
32+
33+
## Acknowledgements
34+
35+
Special thanks to the Nuxi devs and other dependencies for their inspiration and base code that helped shape this CLI
36+
tool.
File renamed without changes.

packages/cli/package.json

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "vpcli",
2+
"name": "vpcar",
33
"version": "0.0.1",
44
"description": "VitePress Carbon CLI",
55
"repository": {
@@ -11,12 +11,12 @@
1111
"type": "module",
1212
"exports": {
1313
".": "./dist/index.mjs",
14-
"./cli": "./bin/vpcli.mjs"
14+
"./cli": "./bin/vpcar.mjs"
1515
},
1616
"types": "./dist/index.d.ts",
1717
"bin": {
18-
"vpcli": "./bin/vpcli.mjs",
19-
"vp-cli": "./bin/vpcli.mjs"
18+
"vpcar": "./bin/vpcar.mjs",
19+
"vp-car": "./bin/vpcar.mjs"
2020
},
2121
"files": [
2222
"bin",
@@ -26,16 +26,15 @@
2626
"dev:prepare": "unbuild --stub",
2727
"build": "unbuild",
2828
"build:stub": "unbuild --stub",
29-
"cli": "node ./bin/vpcli.mjs",
30-
"vpcli": "node ./bin/vpcli.mjs",
31-
"vpcli-bun": "bun --bun ./bin/vpcli.mjs",
29+
"cli": "node ./bin/vpcar.mjs",
30+
"vpcar": "node ./bin/vpcar.mjs",
31+
"vpcar-bun": "bun --bun ./bin/vpcar.mjs",
3232
"prepack": "unbuild",
33-
"release": "changelogen --release && npm publish && git push --follow-tags"
33+
"release": "npm publish"
3434
},
3535
"devDependencies": {
3636
"@types/node": "^20.16.10",
3737
"@types/semver": "^7.5.8",
38-
"changelogen": "^0.5.7",
3938
"citty": "^0.1.6",
4039
"consola": "^3.2.3",
4140
"execa": "^9.4.0",

packages/cli/src/commands/init.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export default defineCommand({
102102
force: Boolean(ctx.args.force),
103103
offline: Boolean(ctx.args.offline),
104104
preferOffline: Boolean(ctx.args.preferOffline),
105-
registry: process.env.vpcli_INIT_REGISTRY ?? DEFAULT_REGISTRY
105+
registry: process.env.vpcar_INIT_REGISTRY ?? DEFAULT_REGISTRY
106106
})
107107
} catch (err) {
108108
if (process.env.DEBUG) {

packages/cli/src/main.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import { defineCommand } from 'citty'
2-
import vpcliPkg from '../package.json' assert { type: 'json' }
2+
import vpcarPkg from '../package.json' assert { type: 'json' }
33
import { commands } from './commands'
44
import { checkEngines } from './utils/engines'
55

66
export const main = defineCommand({
77
meta: {
8-
name: vpcliPkg.name,
9-
version: vpcliPkg.version,
10-
description: vpcliPkg.description
8+
name: vpcarPkg.name,
9+
version: vpcarPkg.version,
10+
description: vpcarPkg.description
1111
},
1212
subCommands: commands,
1313
async setup(ctx) {

packages/cli/src/run.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ globalThis.__vp_cli__ = globalThis.__vp_cli__ || {
1010
entry: fileURLToPath(
1111
new URL(
1212
import.meta.url.endsWith('.ts')
13-
? '../bin/vpcli.mjs'
14-
: '../../bin/vpcli.mjs',
13+
? '../bin/vpcar.mjs'
14+
: '../../bin/vpcar.mjs',
1515
import.meta.url,
1616
),
1717
),

packages/theme/package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@
3030
},
3131
"packageManager": "pnpm@9.9.0",
3232
"scripts": {
33-
"preinstall": "npx only-allow pnpm"
33+
"preinstall": "npx only-allow pnpm",
34+
"release": "npm publish"
3435
},
3536
"dependencies": {
3637
"@clack/prompts": "^0.7.0",

pnpm-lock.yaml

+3-28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)