zephyr-cli 0.0.1 → 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/README.md +40 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +68 -0
- package/package.json +25 -6
- package/Cargo.toml +0 -6
- package/src/main.rs +0 -3
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
|
+
```
|
package/dist/index.d.ts
ADDED
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.
|
|
4
|
-
"description": "",
|
|
5
|
-
"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
|
+
},
|
|
6
9
|
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"prepare": "npm run build",
|
|
7
12
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
8
13
|
},
|
|
9
|
-
"keywords": [
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
"keywords": [
|
|
15
|
+
"cli",
|
|
16
|
+
"zephyr",
|
|
17
|
+
"tool"
|
|
18
|
+
],
|
|
19
|
+
"author": "Zephyr Team",
|
|
20
|
+
"license": "MIT",
|
|
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
|
}
|
package/Cargo.toml
DELETED
package/src/main.rs
DELETED