garbage-maker 0.2.0 → 0.2.1

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 CHANGED
@@ -1,21 +1,21 @@
1
- MIT License
2
-
3
- Copyright (c) 2023 Cosmo Lau
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.
1
+ MIT License
2
+
3
+ Copyright (c) 2023 Cosmo Lau
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 CHANGED
@@ -1,113 +1,113 @@
1
- # garbage-maker
2
-
3
- ![GitHub](https://img.shields.io/github/license/CosmoLau/garbage-maker)
4
-
5
- 为项目中的所有 `JavaScript` 和 `TypeScript` 脚本添加垃圾代码。
6
-
7
- ## 背景
8
-
9
- 部分国内小游戏平台可能会对小游戏进行代码检测,未通过检测可能无法过审。
10
-
11
- 如果小游戏发布次数不多,可通过简单粗暴往代码里加垃圾代码的形式提交审核,这就是此项目的用途。
12
-
13
- 如果小游戏被多次发布,使用本项目进行过审的概率会大大降低,可以在本项目的源码中修改部分内容进行多次尝试,或者使用其他方式来完成您的需求,例如 `代码混淆`。
14
-
15
- ## 快速使用
16
-
17
- > 本项目需要安装 [Node](https://nodejs.org/) 环境。
18
-
19
- 使用你喜欢的包管理器全局安装 `garbage-maker`:
20
-
21
- ```shell
22
- npm install -g garbage-maker
23
- ```
24
-
25
- 添加垃圾代码:
26
-
27
- ```shell
28
- garbage-maker add [文件或目录的绝对路径]
29
- ```
30
-
31
- 清理垃圾代码:
32
-
33
- ```shell
34
- garbage-maker clean [文件或目录的绝对路径]
35
- ```
36
-
37
- 查看 `garbage-maker` 所有命令的帮助:
38
-
39
- ```shell
40
- garbage-maker --help
41
- ```
42
-
43
- 查看指定命令的帮助:
44
-
45
- ```shell
46
- garbage-maker add --help
47
- ```
48
-
49
- ## 自定义添加垃圾代码
50
-
51
- 使用 `-c` 或者 `--code` 标志(flag)来添加自定义的垃圾代码:
52
-
53
- ```shell
54
- garbage-maker add [绝对路径] -c "console.log();"
55
- # 或者
56
- garbage-maker add [绝对路径] --code "console.log();"
57
- ```
58
-
59
- > _注意_:自定义添加的垃圾代码最好是未出现在已有代码中的。
60
- > 在使用 `clean` 命令清理代码时,需要传入与 `add` 命令相同的 `--code` 标志,否则会清理默认的 `(1+1);` 垃圾代码。
61
-
62
- 使用 `-r` 或者 `--ratio` 标志(flag)控制添加垃圾代码的百分比,即根据文件的字符数量,来添加垃圾代码的字符数量。
63
-
64
- ```shell
65
- garbage-maker add [绝对路径] -r 50
66
- # 或者
67
- garbage-maker add [绝对路径] --ratio 50
68
- ```
69
-
70
- > _注意_:`--ratio` 标志的值为百分比的数字部分,即示例中的 `50` 相当于 `50%`。
71
-
72
- ## 修改源码
73
-
74
- 该分支使用 [oclif](https://github.com/oclif/oclif) 作为 CLI 框架进行开发,如需对源码进行修改,按照以下方法进行:
75
-
76
- 1. 安装依赖:
77
-
78
- ```shell
79
- npm install
80
- ```
81
-
82
- 2. 调试命令:
83
-
84
- ```shell
85
- # Windows
86
- ./bin/dev.cmd --help
87
- # MacOS 或 Linux
88
- ./bin/dev.js --help
89
- ```
90
-
91
- 3. 构建 CLI:
92
-
93
- ```shell
94
- npm link
95
- ```
96
-
97
- ## 分支说明
98
-
99
- 本项目以 `main` 作为默认分支,老版本的 JavaScript 代码仍包含在本项目中,可以查看 [garbage-maker.js](./garbage-maker.js)。
100
-
101
- 如需查看老版本文档,可以切换至 `master` 分支查看 `README.md`。
102
-
103
- ## 赞助
104
-
105
- 如果该项目对你有帮助,不妨点个 `star` 来支持我。
106
-
107
- 也可以通过其他方式来赞助我,从零开始将我培养成一个开源工具人。
108
-
109
- [爱发电主页](https://afdian.net/a/CosmoLau)
110
-
111
- ## LICENSE
112
-
1
+ # garbage-maker
2
+
3
+ ![GitHub](https://img.shields.io/github/license/CosmoLau/garbage-maker)
4
+
5
+ 为项目中的所有 `JavaScript` 和 `TypeScript` 脚本添加垃圾代码。
6
+
7
+ ## 背景
8
+
9
+ 部分国内小游戏平台可能会对小游戏进行代码检测,未通过检测可能无法过审。
10
+
11
+ 如果小游戏发布次数不多,可通过简单粗暴往代码里加垃圾代码的形式提交审核,这就是此项目的用途。
12
+
13
+ 如果小游戏被多次发布,使用本项目进行过审的概率会大大降低,可以在本项目的源码中修改部分内容进行多次尝试,或者使用其他方式来完成您的需求,例如 `代码混淆`。
14
+
15
+ ## 快速使用
16
+
17
+ > 本项目需要安装 [Node](https://nodejs.org/) 环境。
18
+
19
+ 使用你喜欢的包管理器全局安装 `garbage-maker`:
20
+
21
+ ```shell
22
+ npm install -g garbage-maker
23
+ ```
24
+
25
+ 添加垃圾代码:
26
+
27
+ ```shell
28
+ garbage-maker add [文件或目录的绝对路径]
29
+ ```
30
+
31
+ 清理垃圾代码:
32
+
33
+ ```shell
34
+ garbage-maker clean [文件或目录的绝对路径]
35
+ ```
36
+
37
+ 查看 `garbage-maker` 所有命令的帮助:
38
+
39
+ ```shell
40
+ garbage-maker --help
41
+ ```
42
+
43
+ 查看指定命令的帮助:
44
+
45
+ ```shell
46
+ garbage-maker add --help
47
+ ```
48
+
49
+ ## 自定义添加垃圾代码
50
+
51
+ 使用 `-c` 或者 `--code` 标志(flag)来添加自定义的垃圾代码:
52
+
53
+ ```shell
54
+ garbage-maker add [绝对路径] -c "console.log();"
55
+ # 或者
56
+ garbage-maker add [绝对路径] --code "console.log();"
57
+ ```
58
+
59
+ > _注意_:自定义添加的垃圾代码最好是未出现在已有代码中的。
60
+ > 在使用 `clean` 命令清理代码时,需要传入与 `add` 命令相同的 `--code` 标志,否则会清理默认的 `(1+1);` 垃圾代码。
61
+
62
+ 使用 `-r` 或者 `--ratio` 标志(flag)控制添加垃圾代码的百分比,即根据文件的字符数量,来添加垃圾代码的字符数量。
63
+
64
+ ```shell
65
+ garbage-maker add [绝对路径] -r 50
66
+ # 或者
67
+ garbage-maker add [绝对路径] --ratio 50
68
+ ```
69
+
70
+ > _注意_:`--ratio` 标志的值为百分比的数字部分,即示例中的 `50` 相当于 `50%`。
71
+
72
+ ## 修改源码
73
+
74
+ 该分支使用 [oclif](https://github.com/oclif/oclif) 作为 CLI 框架进行开发,如需对源码进行修改,按照以下方法进行:
75
+
76
+ 1. 安装依赖:
77
+
78
+ ```shell
79
+ npm install
80
+ ```
81
+
82
+ 2. 调试命令:
83
+
84
+ ```shell
85
+ # Windows
86
+ ./bin/dev.cmd --help
87
+ # MacOS 或 Linux
88
+ ./bin/dev.js --help
89
+ ```
90
+
91
+ 3. 构建 CLI:
92
+
93
+ ```shell
94
+ npm link
95
+ ```
96
+
97
+ ## 分支说明
98
+
99
+ 本项目以 `main` 作为默认分支,老版本的 JavaScript 代码仍包含在本项目中,可以查看 [garbage-maker.js](./garbage-maker.js)。
100
+
101
+ 如需查看老版本文档,可以切换至 `master` 分支查看 `README.md`。
102
+
103
+ ## 赞助
104
+
105
+ 如果该项目对你有帮助,不妨点个 `star` 来支持我。
106
+
107
+ 也可以通过其他方式来赞助我,从零开始将我培养成一个开源工具人。
108
+
109
+ [爱发电主页](https://afdian.net/a/CosmoLau)
110
+
111
+ ## LICENSE
112
+
113
113
  [MIT License](./LICENSE)
package/bin/dev.cmd CHANGED
@@ -1,3 +1,3 @@
1
- @echo off
2
-
3
- node --loader ts-node/esm --no-warnings=ExperimentalWarning "%~dp0\dev" %*
1
+ @echo off
2
+
3
+ node --loader ts-node/esm --no-warnings=ExperimentalWarning "%~dp0\dev" %*
package/bin/dev.js CHANGED
@@ -1,5 +1,5 @@
1
- #!/usr/bin/env -S node --loader ts-node/esm --no-warnings=ExperimentalWarning
2
-
3
- import {execute} from '@oclif/core'
4
-
5
- await execute({development: true, dir: import.meta.url})
1
+ #!/usr/bin/env -S node --loader ts-node/esm --no-warnings=ExperimentalWarning
2
+
3
+ import {execute} from '@oclif/core'
4
+
5
+ await execute({development: true, dir: import.meta.url})
package/bin/run.cmd CHANGED
@@ -1,3 +1,3 @@
1
- @echo off
2
-
3
- node "%~dp0\run" %*
1
+ @echo off
2
+
3
+ node "%~dp0\run" %*
package/bin/run.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
-
3
- import {execute} from '@oclif/core'
4
-
5
- await execute({dir: import.meta.url})
2
+
3
+ import {execute} from '@oclif/core'
4
+
5
+ await execute({dir: import.meta.url})
@@ -88,5 +88,5 @@
88
88
  ]
89
89
  }
90
90
  },
91
- "version": "0.2.0"
91
+ "version": "0.2.1"
92
92
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "garbage-maker",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "garbage-maker,向 JS 和 TS 文件中添加垃圾代码",
5
5
  "keywords": [
6
6
  "oclif",
@@ -11,6 +11,9 @@
11
11
  "repository": "CosmoLau/garbage-maker",
12
12
  "license": "MIT",
13
13
  "author": "CosmoLau",
14
+ "publishConfig": {
15
+ "registry": "https://registry.npmjs.org/"
16
+ },
14
17
  "type": "module",
15
18
  "exports": "./lib/index.js",
16
19
  "types": "dist/index.d.ts",
@@ -55,7 +58,7 @@
55
58
  "@types/node": "^18",
56
59
  "chai": "^4",
57
60
  "mocha": "^10",
58
- "oclif": "^4.8.2",
61
+ "oclif": "^4.8.8",
59
62
  "shx": "^0.3.4",
60
63
  "ts-node": "^10.9.2",
61
64
  "typescript": "^5"