amxxpack 1.1.0 β 1.2.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.
- package/LICENSE +21 -0
- package/README.md +5 -2
- package/lib/builder/amxxpc.js +6 -3
- package/lib/builder/builder.d.ts +16 -10
- package/lib/builder/builder.js +280 -76
- package/lib/builder/plugins-cache.d.ts +16 -0
- package/lib/builder/plugins-cache.js +151 -0
- package/lib/cli/controller.d.ts +8 -2
- package/lib/cli/controller.js +34 -25
- package/lib/cli/program.js +10 -6
- package/lib/cli/services/project-creator.js +20 -6
- package/lib/config/index.d.ts +1 -0
- package/lib/config/index.js +5 -1
- package/lib/project-config/resolve.d.ts +1 -1
- package/lib/project-config/resolve.js +6 -5
- package/lib/types/index.d.ts +3 -3
- package/lib/utils/copy-file.d.ts +8 -0
- package/lib/utils/copy-file.js +83 -0
- package/lib/utils/setup-watch.d.ts +3 -0
- package/lib/utils/setup-watch.js +28 -0
- package/package.json +8 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2022 Hedgehog Fog
|
|
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,7 +1,7 @@
|
|
|
1
|
-
# π¦ AMXXPack [](https://www.npmjs.com/package/amxxpack)
|
|
1
|
+
# π¦ AMXXPack πΊπ¦ [](https://www.npmjs.com/package/amxxpack)
|
|
2
2
|
Simple build system and **CLI** for **AMX Mod X** projects.
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
## π About
|
|
5
5
|
|
|
6
6
|
This system will be useful for projects with multiple plugins and assets. Using the command-line interface you can build entire project with a single command. It also supports hot rebuild to keep your plugins and assets up to date during the work.
|
|
7
7
|
|
|
@@ -47,8 +47,11 @@ npm install -g amxxpack
|
|
|
47
47
|
- `amxxpack build` - command to build the project
|
|
48
48
|
- `--watch` - flag to watch changes
|
|
49
49
|
- `--config` - config file
|
|
50
|
+
- `--ignore` - ignore build errors
|
|
51
|
+
- `--no-cache` - disable caching
|
|
50
52
|
- `amxxpack compile <path|glob>` - compile specific plugin in the project
|
|
51
53
|
- `--config` - config file
|
|
54
|
+
- `--no-cache` - disable caching
|
|
52
55
|
- `amxxpack new <script|lib|include> [name]` - create new file in the project workspace
|
|
53
56
|
- `--config` - config file
|
|
54
57
|
- `--name` - plugin name
|
package/lib/builder/amxxpc.js
CHANGED
|
@@ -90,9 +90,12 @@ function formatArgs(params, outPath) {
|
|
|
90
90
|
}
|
|
91
91
|
function compile(params) {
|
|
92
92
|
var parsedPath = path_1.default.parse(params.path);
|
|
93
|
-
var
|
|
94
|
-
|
|
95
|
-
|
|
93
|
+
var dest = params.dest.endsWith(".".concat(PLUGIN_EXT))
|
|
94
|
+
? params.dest
|
|
95
|
+
: path_1.default.join(params.dest, "".concat(parsedPath.name, ".").concat(PLUGIN_EXT));
|
|
96
|
+
var parsedDest = path_1.default.parse(dest);
|
|
97
|
+
var fileName = path_1.default.parse(dest).base;
|
|
98
|
+
mkdirp_1.default.sync(parsedDest.dir);
|
|
96
99
|
return new Promise(function (resolve) {
|
|
97
100
|
var output = (0, accumulator_1.default)();
|
|
98
101
|
var done = function (error) {
|
package/lib/builder/builder.d.ts
CHANGED
|
@@ -1,21 +1,27 @@
|
|
|
1
1
|
import { IProjectConfig } from '../types';
|
|
2
|
+
export interface CompileOptions {
|
|
3
|
+
ignoreErrors?: boolean;
|
|
4
|
+
noCache?: boolean;
|
|
5
|
+
}
|
|
2
6
|
export default class AmxxBuilder {
|
|
3
|
-
private
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
private projectConfig;
|
|
8
|
+
private pluginCache;
|
|
9
|
+
constructor(projectConfig: IProjectConfig);
|
|
10
|
+
build(compileOptions: CompileOptions): Promise<void>;
|
|
11
|
+
watch(compileOptions: CompileOptions): Promise<void>;
|
|
12
|
+
buildScripts(compileOptions: CompileOptions): Promise<boolean>;
|
|
8
13
|
buildInclude(): Promise<void>;
|
|
9
14
|
buildAssets(): Promise<void>;
|
|
10
|
-
|
|
15
|
+
watchScripts(compileOptions: CompileOptions): Promise<void>;
|
|
11
16
|
watchInclude(): Promise<void>;
|
|
12
17
|
watchAssets(): Promise<void>;
|
|
13
|
-
updatePlugin(
|
|
14
|
-
updateScript(
|
|
15
|
-
updateAsset(
|
|
18
|
+
updatePlugin(srcDir: string, srcFile: string, compileOptions: CompileOptions): Promise<boolean>;
|
|
19
|
+
updateScript(srcDir: string, srcFile: string): Promise<void>;
|
|
20
|
+
updateAsset(srcDir: string, srcFile: string): Promise<void>;
|
|
16
21
|
updateInclude(filePath: string): Promise<void>;
|
|
17
22
|
findPlugins(pattern: string): Promise<string[]>;
|
|
18
|
-
compilePlugin(
|
|
23
|
+
compilePlugin(srcDir: string, srcFile: string, compileOptions?: CompileOptions): Promise<void>;
|
|
19
24
|
private buildDir;
|
|
20
25
|
private watchDir;
|
|
26
|
+
private initPluginCache;
|
|
21
27
|
}
|