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 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 [![npm](https://img.shields.io/npm/v/amxxpack.svg)](https://www.npmjs.com/package/amxxpack)
1
+ # πŸ“¦ AMXXPack πŸ‡ΊπŸ‡¦ [![npm](https://img.shields.io/npm/v/amxxpack.svg)](https://www.npmjs.com/package/amxxpack)
2
2
  Simple build system and **CLI** for **AMX Mod X** projects.
3
3
 
4
- # πŸ“„ About
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
@@ -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 fileName = "".concat(parsedPath.name, ".").concat(PLUGIN_EXT);
94
- var dest = path_1.default.join(params.dest, fileName);
95
- mkdirp_1.default.sync(params.dest);
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) {
@@ -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 config;
4
- constructor(config: IProjectConfig);
5
- build(): Promise<void>;
6
- watch(): Promise<void>;
7
- buildSrc(): Promise<void>;
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
- watchSrc(): Promise<void>;
15
+ watchScripts(compileOptions: CompileOptions): Promise<void>;
11
16
  watchInclude(): Promise<void>;
12
17
  watchAssets(): Promise<void>;
13
- updatePlugin(filePath: string): Promise<void>;
14
- updateScript(filePath: string): Promise<void>;
15
- updateAsset(filePath: string): Promise<void>;
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(filePath: string): Promise<void>;
23
+ compilePlugin(srcDir: string, srcFile: string, compileOptions?: CompileOptions): Promise<void>;
19
24
  private buildDir;
20
25
  private watchDir;
26
+ private initPluginCache;
21
27
  }