@h3ravel/musket 0.1.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.
Files changed (2) hide show
  1. package/README.md +107 -0
  2. package/package.json +96 -0
package/README.md ADDED
@@ -0,0 +1,107 @@
1
+ <div align="center">
2
+ <a href="https://h3ravel.toneflix.net" target="_blank">
3
+ <img src="https://raw.githubusercontent.com/h3ravel/assets/refs/heads/main/logo-full.svg" width="200" alt="H3ravel Logo">
4
+ </a>
5
+ <h1 align="center"><a href="https://h3ravel.toneflix.net/guide/deeper/musket">Musket CLI</a></h1>
6
+
7
+ [![Framework][ix]][lx]
8
+ [![Musket Version][i1]][l1]
9
+ [![Downloads][d1]][d1]
10
+ [![Tests][tei]][tel]
11
+ [![License][lini]][linl]
12
+
13
+ </div>
14
+
15
+ # About Musket CLI
16
+
17
+ Musket CLI is a framework-agnostic CLI framework designed to allow you build artisan-like CLI apps and for use in the [H3ravel](https://h3ravel.toneflix.net) framework.
18
+
19
+ ## Installation
20
+
21
+ To use **Musket CLI**, you may install it by running:
22
+
23
+ ```sh
24
+
25
+ npm install @h3ravel/musket
26
+ # or
27
+ pnpm add @h3ravel/musket
28
+ # or
29
+ yarn add @h3ravel/musket
30
+ ```
31
+
32
+ ## Quick Setup
33
+
34
+ The base requirement fo setting up **Musket CLI** is an application class that it can bind itself to:
35
+
36
+ ```ts
37
+ class Application {}
38
+ ```
39
+
40
+ Once bound, **Musket CLI** will bind itself to the application class as `musket` and can be accessed as:
41
+
42
+ ```ts
43
+ const app = new Application();
44
+
45
+ // Initialize Musket CLI here
46
+
47
+ console.log(app.musket);
48
+ ```
49
+
50
+ ### Initialization
51
+
52
+ To initialize **Musket CLI** you can follow the example below:
53
+
54
+ ```ts
55
+ import { Kernel } from 'h3ravel/musket';
56
+
57
+ const app = new Application();
58
+
59
+ Kernel.init(app);
60
+ ```
61
+
62
+ The `init` method returs and instance of `commanderjs`'s `Command` class allowing to further extend and customize your app if there is a need for that.
63
+
64
+ ### Passing Configuration
65
+
66
+ Musket allows passing a `config` object that alters it's behavior and provide some level of customizations
67
+
68
+ ```ts
69
+ Kernel.init(app, {
70
+ packages: ['@h3ravel/shared', '@h3ravel/support'],
71
+ cliName: 'musket-cli',
72
+ discoveryPaths: [path.join(process.cwd(), 'tests/Commands/*.ts')],
73
+ });
74
+ ```
75
+
76
+ ## Contributing
77
+
78
+ Thank you for considering contributing to the H3ravel framework! The [Contribution Guide](https://h3ravel.toneflix.net/contributing) can be found in the H3ravel documentation and will provide you with all the information you need to get started.
79
+
80
+ ## Code of Conduct
81
+
82
+ In order to ensure that the H3ravel community is welcoming to all, please review and abide by the [Code of Conduct](#).
83
+
84
+ ## Security Vulnerabilities
85
+
86
+ If you discover a security vulnerability within H3ravel, please send an e-mail to Legacy via hamzas.legacy@toneflix.ng. All security vulnerabilities will be promptly addressed.
87
+
88
+ ## License
89
+
90
+ The H3ravel framework is open-sourced software licensed under the [MIT license](LICENSE).
91
+
92
+ [ix]: https://img.shields.io/npm/v/%40h3ravel%2Fcore?style=flat-square&label=Framework&color=%230970ce
93
+ [lx]: https://www.npmjs.com/package/@h3ravel/core
94
+ [i1]: https://img.shields.io/npm/v/%40h3ravel%2Fmusket?style=flat-square&label=@h3ravel/musket&color=%230970ce
95
+ [l1]: https://www.npmjs.com/package/@h3ravel/musket
96
+ [d1]: https://img.shields.io/npm/dt/%40h3ravel%2Fmusket?style=flat-square&label=Downloads&link=https%3A%2F%2Fwww.npmjs.com%2Fpackage%2F%40h3ravel%2Fmusket
97
+ [linl]: https://github.com/h3ravel/framework/blob/main/LICENSE
98
+ [lini]: https://img.shields.io/github/license/h3ravel/framework
99
+ [tel]: https://github.com/h3ravel/framework/actions/workflows/test.yml
100
+ [tei]: https://github.com/h3ravel/framework/actions/workflows/test.yml/badge.svg
101
+
102
+ ````
103
+
104
+ ```
105
+
106
+ ```
107
+ ````
package/package.json ADDED
@@ -0,0 +1,96 @@
1
+ {
2
+ "name": "@h3ravel/musket",
3
+ "version": "0.1.0",
4
+ "description": "Musket CLI is a framework-agnostic CLI framework designed to allow you build artisan-like CLI apps and for use in the H3ravel framework.",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "import": "./dist/index.js",
9
+ "require": "./dist/index.cjs"
10
+ },
11
+ "./Utils": {
12
+ "import": "./dist/Utils.js",
13
+ "require": "./dist/Utils.cjs"
14
+ }
15
+ },
16
+ "typesVersions": {
17
+ "*": {
18
+ "Utils": [
19
+ "dist/Utils.d.ts"
20
+ ],
21
+ "*": [
22
+ "dist/index.d.ts"
23
+ ]
24
+ }
25
+ },
26
+ "files": [
27
+ "dist"
28
+ ],
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "homepage": "https://h3ravel.toneflix.net/guide/deeper/musket",
33
+ "repository": {
34
+ "type": "git",
35
+ "url": "git+https://github.com/h3ravel/musket.git"
36
+ },
37
+ "keywords": [
38
+ "h3ravel",
39
+ "modern",
40
+ "web",
41
+ "H3",
42
+ "framework",
43
+ "nodejs",
44
+ "typescript",
45
+ "laravel",
46
+ "artisan",
47
+ "musket",
48
+ "commander",
49
+ "command",
50
+ "CLI",
51
+ "build",
52
+ "console"
53
+ ],
54
+ "peerDependencies": {
55
+ "@h3ravel/support": "^0.14.1"
56
+ },
57
+ "devDependencies": {
58
+ "@types/node": "^24.7.2",
59
+ "@typescript-eslint/eslint-plugin": "^8.44.0",
60
+ "@typescript-eslint/parser": "^8.44.0",
61
+ "@vitest/coverage-v8": "^3.2.4",
62
+ "barrelize": "^1.6.4",
63
+ "eslint": "^9.36.0",
64
+ "husky": "^9.1.7",
65
+ "tsdown": "^0.15.7",
66
+ "typescript": "^5.9.2",
67
+ "vite-tsconfig-paths": "^5.1.4",
68
+ "vitest": "^3.2.4"
69
+ },
70
+ "dependencies": {
71
+ "@h3ravel/shared": "^0.22.2",
72
+ "chalk": "^5.6.2",
73
+ "commander": "^14.0.1",
74
+ "dayjs": "^1.11.18",
75
+ "execa": "^9.6.0",
76
+ "glob": "^11.0.3",
77
+ "preferred-pm": "^4.1.1",
78
+ "radashi": "^12.6.2",
79
+ "resolve-from": "^5.0.0",
80
+ "tsx": "^4.20.5"
81
+ },
82
+ "engines": {
83
+ "node": "^20.19.0 || >=22.12.0"
84
+ },
85
+ "scripts": {
86
+ "build": "tsdown --config-loader unconfig",
87
+ "lint": "eslint . --ext .ts",
88
+ "barrel": "barrelize >/dev/null",
89
+ "test": "vitest",
90
+ "coverage": "vitest --coverage",
91
+ "cmd": "tsx --experimental-specifier-resolution=node tests/run",
92
+ "release:patch": "pnpm build && pnpm version patch && git add . && git commit -m \"version: bump console package version\" && pnpm publish --tag latest",
93
+ "version-patch": "pnpm version patch",
94
+ "postinstall": "pnpm barrel"
95
+ }
96
+ }