@0x-jerry/x 2.7.3 → 2.7.4

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.
@@ -1,5 +1,5 @@
1
1
  // package.json
2
- var version = "2.7.3";
2
+ var version = "2.7.4";
3
3
 
4
4
  export {
5
5
  version
package/dist/x.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  version
4
- } from "./chunk-ZU5F6V34.js";
4
+ } from "./chunk-Q6TKVCKX.js";
5
5
 
6
6
  // src/x.ts
7
7
  import { sliver } from "@0x-jerry/silver";
package/dist/xn.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-TTBHFDNB.js";
7
7
  import {
8
8
  version
9
- } from "./chunk-ZU5F6V34.js";
9
+ } from "./chunk-Q6TKVCKX.js";
10
10
 
11
11
  // src/xn.ts
12
12
  import { sliver } from "@0x-jerry/silver";
@@ -247,9 +247,10 @@ async function removeAction(_, opt) {
247
247
  function getParameters(opt) {
248
248
  const params = opt._;
249
249
  const otherOpt = { ...opt };
250
- otherOpt.L = void 0;
251
- otherOpt._ = void 0;
252
- otherOpt["--"] = void 0;
250
+ const blockOptions = ["_", "--", "L"];
251
+ for (const opt2 of blockOptions) {
252
+ Reflect.deleteProperty(otherOpt, opt2);
253
+ }
253
254
  return {
254
255
  params,
255
256
  options: otherOpt
package/dist/xr.js CHANGED
@@ -4,7 +4,7 @@ import {
4
4
  } from "./chunk-TTBHFDNB.js";
5
5
  import {
6
6
  version
7
- } from "./chunk-ZU5F6V34.js";
7
+ } from "./chunk-Q6TKVCKX.js";
8
8
 
9
9
  // src/xr.ts
10
10
  import { sliver } from "@0x-jerry/silver";
package/package.json CHANGED
@@ -1,70 +1,70 @@
1
- {
2
- "name": "@0x-jerry/x",
3
- "version": "2.7.3",
4
- "repository": {
5
- "type": "git",
6
- "url": "git+https://github.com/0x-jerry/x.git"
7
- },
8
- "author": "Jerry Wang <x.jerry.wang@gmail.com>",
9
- "license": "MIT",
10
- "type": "module",
11
- "publishConfig": {
12
- "access": "public",
13
- "registry": "https://registry.npmjs.org"
14
- },
15
- "files": [
16
- "dist"
17
- ],
18
- "bin": {
19
- "xr": "dist/xr.js",
20
- "xn": "dist/xn.js",
21
- "x": "dist/x.js"
22
- },
23
- "scripts": {
24
- "build": "tsup",
25
- "dev:xr": "tsx src/xr.ts",
26
- "dev:xn": "tsx src/xn.ts",
27
- "dev:x": "tsx src/x.ts",
28
- "test": "vitest run",
29
- "test:watch": "vitest",
30
- "prepublishOnly": "npm run build",
31
- "release": "x-release"
32
- },
33
- "tsup": {
34
- "entry": [
35
- "src/xr.ts",
36
- "src/xn.ts",
37
- "src/x.ts"
38
- ],
39
- "format": [
40
- "esm"
41
- ],
42
- "clean": true
43
- },
44
- "dependencies": {
45
- "@0x-jerry/silver": "^1.1.1",
46
- "@0x-jerry/utils": "^4.2.2",
47
- "decompress": "^4.2.1",
48
- "fs-extra": "^11.3.0",
49
- "global-agent": "^3.0.0",
50
- "got": "^14.4.5",
51
- "jsonc-parser": "^3.3.1",
52
- "ora": "^8.1.1",
53
- "picocolors": "^1.1.1",
54
- "prompts": "^2.4.2"
55
- },
56
- "devDependencies": {
57
- "@0x-jerry/x-release": "^2.2.2",
58
- "@biomejs/biome": "^1.9.4",
59
- "@types/decompress": "^4.2.7",
60
- "@types/fs-extra": "^11.0.4",
61
- "@types/global-agent": "^2.1.3",
62
- "@types/node": "^22.10.10",
63
- "@types/prompts": "^2.4.9",
64
- "@vitest/coverage-v8": "^3.0.4",
65
- "tsup": "^8.3.6",
66
- "tsx": "^4.19.2",
67
- "typescript": "^5.7.3",
68
- "vitest": "^3.0.4"
69
- }
1
+ {
2
+ "name": "@0x-jerry/x",
3
+ "version": "2.7.4",
4
+ "repository": {
5
+ "type": "git",
6
+ "url": "git+https://github.com/0x-jerry/x.git"
7
+ },
8
+ "author": "Jerry Wang <x.jerry.wang@gmail.com>",
9
+ "license": "MIT",
10
+ "type": "module",
11
+ "publishConfig": {
12
+ "access": "public",
13
+ "registry": "https://registry.npmjs.org"
14
+ },
15
+ "files": [
16
+ "dist"
17
+ ],
18
+ "bin": {
19
+ "xr": "dist/xr.js",
20
+ "xn": "dist/xn.js",
21
+ "x": "dist/x.js"
22
+ },
23
+ "scripts": {
24
+ "build": "tsup",
25
+ "dev:xr": "tsx src/xr.ts",
26
+ "dev:xn": "tsx src/xn.ts",
27
+ "dev:x": "tsx src/x.ts",
28
+ "test": "vitest run",
29
+ "test:watch": "vitest",
30
+ "prepublishOnly": "npm run build",
31
+ "release": "x-release"
32
+ },
33
+ "tsup": {
34
+ "entry": [
35
+ "src/xr.ts",
36
+ "src/xn.ts",
37
+ "src/x.ts"
38
+ ],
39
+ "format": [
40
+ "esm"
41
+ ],
42
+ "clean": true
43
+ },
44
+ "dependencies": {
45
+ "@0x-jerry/silver": "^1.1.1",
46
+ "@0x-jerry/utils": "^4.2.2",
47
+ "decompress": "^4.2.1",
48
+ "fs-extra": "^11.3.0",
49
+ "global-agent": "^3.0.0",
50
+ "got": "^14.4.5",
51
+ "jsonc-parser": "^3.3.1",
52
+ "ora": "^8.1.1",
53
+ "picocolors": "^1.1.1",
54
+ "prompts": "^2.4.2"
55
+ },
56
+ "devDependencies": {
57
+ "@0x-jerry/x-release": "^2.2.2",
58
+ "@biomejs/biome": "^1.9.4",
59
+ "@types/decompress": "^4.2.7",
60
+ "@types/fs-extra": "^11.0.4",
61
+ "@types/global-agent": "^2.1.3",
62
+ "@types/node": "^22.10.10",
63
+ "@types/prompts": "^2.4.9",
64
+ "@vitest/coverage-v8": "^3.0.4",
65
+ "tsup": "^8.3.6",
66
+ "tsx": "^4.19.2",
67
+ "typescript": "^5.7.3",
68
+ "vitest": "^3.0.4"
69
+ }
70
70
  }
package/readme.md CHANGED
@@ -1,94 +1,94 @@
1
- # X
2
-
3
- Some useful command for myself.
4
-
5
- ## Install
6
-
7
- ```sh
8
- pnpm i -g @0x-jerry/x
9
- ```
10
-
11
- ## Run task `xr`
12
-
13
- `xr` command can auto detect tasks in `package.json/scripts`, `deno.json/tasks`, and run it. you can also append any parameters.
14
-
15
- Example: In a node project with `pnpm-lock.yaml`. And `package.json` has a script `"test": "vitest run"`
16
-
17
- ```sh
18
- xr test test/*.ts
19
- # equals
20
- vitest run test/*.ts
21
-
22
- # you can also execute binary file in `node_modules/.bin` folder.
23
- xr vite --port 4004
24
- ```
25
-
26
- Example: In a deno project with `deno.json` or `deno.jsonc`. And have a task `"dev": "deno run -A main.ts"`
27
-
28
- ```sh
29
- xr dev
30
- # equals
31
- deno run -A main.ts
32
- ```
33
-
34
- ## Dependency Manager `xn`
35
-
36
- `xn` command can install modules by detect the correct tool, it detects lockfile to decide which dependency manager tools should be used.
37
-
38
- Example: install packages in a node project with `pnpm-lock.yaml`
39
-
40
- ```sh
41
- xn i lodash-es
42
- # equals
43
- pnpm i lodash-es
44
-
45
- xn i lodash-es -D
46
- # equals
47
- pnpm i lodash-es -D
48
-
49
- # -t/--types option support install @types/xx package in one command.
50
- xn i lodash-es --types
51
- # equals
52
- pnpm i lodash-es && pnpm i @types/lodash-es -D
53
- ```
54
-
55
- Example: remove packages in a node project with `pnpm-lock.yaml`
56
-
57
- ```sh
58
- xn rm lodash-es
59
- # equals
60
- pnpm uninstall lodash-es
61
-
62
- xn rm lodash-es -D
63
- # equals
64
- pnpm uninstall lodash-es -D
65
-
66
- # -t/--types option support remove @types/xx package in one command.
67
- xn rm lodash-es --types
68
- # equals
69
- pnpm uninstall lodash-es @types/lodash-es
70
- ```
71
-
72
- `xn` also support rust project.
73
-
74
- Example: in a rust project with `Cargo.toml`
75
-
76
- ```sh
77
- xn i log
78
- # equals
79
- cargo add log
80
-
81
- xn rm log
82
- # equals
83
- cargo remove log
84
- ```
85
-
86
- ## Command Completions
87
-
88
- Add this code to `~/.zshrc`
89
-
90
- ```zsh
91
- source <(x completions)
92
- source <(xr completions)
93
- source <(xn completions)
94
- ```
1
+ # X
2
+
3
+ Some useful command for myself.
4
+
5
+ ## Install
6
+
7
+ ```sh
8
+ pnpm i -g @0x-jerry/x
9
+ ```
10
+
11
+ ## Run task `xr`
12
+
13
+ `xr` command can auto detect tasks in `package.json/scripts`, `deno.json/tasks`, and run it. you can also append any parameters.
14
+
15
+ Example: In a node project with `pnpm-lock.yaml`. And `package.json` has a script `"test": "vitest run"`
16
+
17
+ ```sh
18
+ xr test test/*.ts
19
+ # equals
20
+ vitest run test/*.ts
21
+
22
+ # you can also execute binary file in `node_modules/.bin` folder.
23
+ xr vite --port 4004
24
+ ```
25
+
26
+ Example: In a deno project with `deno.json` or `deno.jsonc`. And have a task `"dev": "deno run -A main.ts"`
27
+
28
+ ```sh
29
+ xr dev
30
+ # equals
31
+ deno run -A main.ts
32
+ ```
33
+
34
+ ## Dependency Manager `xn`
35
+
36
+ `xn` command can install modules by detect the correct tool, it detects lockfile to decide which dependency manager tools should be used.
37
+
38
+ Example: install packages in a node project with `pnpm-lock.yaml`
39
+
40
+ ```sh
41
+ xn i lodash-es
42
+ # equals
43
+ pnpm i lodash-es
44
+
45
+ xn i lodash-es -D
46
+ # equals
47
+ pnpm i lodash-es -D
48
+
49
+ # -t/--types option support install @types/xx package in one command.
50
+ xn i lodash-es --types
51
+ # equals
52
+ pnpm i lodash-es && pnpm i @types/lodash-es -D
53
+ ```
54
+
55
+ Example: remove packages in a node project with `pnpm-lock.yaml`
56
+
57
+ ```sh
58
+ xn rm lodash-es
59
+ # equals
60
+ pnpm uninstall lodash-es
61
+
62
+ xn rm lodash-es -D
63
+ # equals
64
+ pnpm uninstall lodash-es -D
65
+
66
+ # -t/--types option support remove @types/xx package in one command.
67
+ xn rm lodash-es --types
68
+ # equals
69
+ pnpm uninstall lodash-es @types/lodash-es
70
+ ```
71
+
72
+ `xn` also support rust project.
73
+
74
+ Example: in a rust project with `Cargo.toml`
75
+
76
+ ```sh
77
+ xn i log
78
+ # equals
79
+ cargo add log
80
+
81
+ xn rm log
82
+ # equals
83
+ cargo remove log
84
+ ```
85
+
86
+ ## Command Completions
87
+
88
+ Add this code to `~/.zshrc`
89
+
90
+ ```zsh
91
+ source <(x completions)
92
+ source <(xr completions)
93
+ source <(xn completions)
94
+ ```