zephyr-cli 0.0.0 → 0.0.2

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 ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Lois
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,40 @@
1
+ # Zephyr CLI
2
+
3
+ A command-line utility for Zephyr projects.
4
+
5
+ ## Installation
6
+
7
+ ### Global Installation
8
+
9
+ ```bash
10
+ npm install -g zephyr
11
+ ```
12
+
13
+ ### Using npx
14
+
15
+ ```bash
16
+ npx zephyr <command>
17
+ ```
18
+
19
+ ## Usage
20
+
21
+ ### Clean Cache
22
+
23
+ Remove the Zephyr cache directory:
24
+
25
+ ```bash
26
+ zephyr clean cache
27
+ ```
28
+
29
+ Or with npx:
30
+
31
+ ```bash
32
+ npx zephyr clean cache
33
+ ```
34
+
35
+ ## Development
36
+
37
+ ```bash
38
+ npm install
39
+ npm run build
40
+ ```
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || function (mod) {
20
+ if (mod && mod.__esModule) return mod;
21
+ var result = {};
22
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
23
+ __setModuleDefault(result, mod);
24
+ return result;
25
+ };
26
+ var __importDefault = (this && this.__importDefault) || function (mod) {
27
+ return (mod && mod.__esModule) ? mod : { "default": mod };
28
+ };
29
+ Object.defineProperty(exports, "__esModule", { value: true });
30
+ const child_process_1 = require("child_process");
31
+ const fs_1 = require("fs");
32
+ const path_1 = require("path");
33
+ const os = __importStar(require("os"));
34
+ const chalk_1 = __importDefault(require("chalk"));
35
+ function main() {
36
+ const args = process.argv.slice(2);
37
+ if (args.length >= 2 && args[0] === 'clean' && args[1] === 'cache') {
38
+ cleanCache();
39
+ }
40
+ else {
41
+ printUsage();
42
+ }
43
+ }
44
+ function cleanCache() {
45
+ const homeDir = os.homedir();
46
+ const cacheDir = (0, path_1.join)(homeDir, '.zephyr');
47
+ console.log(chalk_1.default.blue('🧹 Cleaning Zephyr cache...'));
48
+ if (!(0, fs_1.existsSync)(cacheDir)) {
49
+ console.log(chalk_1.default.yellow('Cache directory doesn\'t exist. Nothing to clean.'));
50
+ return;
51
+ }
52
+ try {
53
+ const command = process.platform === 'win32'
54
+ ? `rd /s /q "${cacheDir}"`
55
+ : `rm -rf "${cacheDir}"`;
56
+ (0, child_process_1.execSync)(command);
57
+ console.log(chalk_1.default.green('✨ Cache cleaned successfully!'));
58
+ }
59
+ catch (error) {
60
+ console.error(chalk_1.default.red(`Error cleaning cache: ${error instanceof Error ? error.message : String(error)}`));
61
+ }
62
+ }
63
+ function printUsage() {
64
+ console.log(chalk_1.default.cyan('Zephyr CLI'));
65
+ console.log(chalk_1.default.yellow('Usage:'));
66
+ console.log(' zephyr clean cache - Clean the Zephyr cache directory');
67
+ }
68
+ main();
package/package.json CHANGED
@@ -1,12 +1,31 @@
1
1
  {
2
2
  "name": "zephyr-cli",
3
- "version": "0.0.0",
4
- "main": "index.js",
3
+ "version": "0.0.2",
4
+ "description": "CLI utility for Zephyr projects",
5
+ "main": "dist/index.js",
6
+ "bin": {
7
+ "zephyr": "dist/index.js"
8
+ },
5
9
  "scripts": {
10
+ "build": "tsc",
11
+ "prepare": "npm run build",
6
12
  "test": "echo \"Error: no test specified\" && exit 1"
7
13
  },
8
- "keywords": [],
9
- "author": "Lois Z. <loisisar@outlook.com> (https://loiszhao.com/)",
14
+ "keywords": [
15
+ "cli",
16
+ "zephyr",
17
+ "tool"
18
+ ],
19
+ "author": "Zephyr Team",
10
20
  "license": "MIT",
11
- "description": ""
21
+ "files": [
22
+ "dist"
23
+ ],
24
+ "dependencies": {
25
+ "chalk": "^4.1.2"
26
+ },
27
+ "devDependencies": {
28
+ "@types/node": "^16.11.12",
29
+ "typescript": "^4.5.4"
30
+ }
12
31
  }