amxxpack 1.4.7 → 1.5.0-beta.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.
Files changed (113) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +305 -180
  3. package/lib/builder/amxxpc.d.ts +33 -27
  4. package/lib/builder/amxxpc.js +116 -125
  5. package/lib/builder/builder.d.ts +36 -28
  6. package/lib/builder/builder.js +375 -623
  7. package/lib/builder/compiler.d.ts +33 -0
  8. package/lib/builder/compiler.js +112 -0
  9. package/lib/builder/constants.d.ts +1 -3
  10. package/lib/builder/constants.js +10 -6
  11. package/lib/builder/index.d.ts +1 -1
  12. package/lib/builder/index.js +8 -9
  13. package/lib/builder/plugins-cache.d.ts +41 -20
  14. package/lib/builder/plugins-cache.js +243 -190
  15. package/lib/builder/plugins-dependencies.d.ts +7 -0
  16. package/lib/builder/plugins-dependencies.js +34 -0
  17. package/lib/cli/constants/index.d.ts +5 -0
  18. package/lib/cli/constants/index.js +10 -0
  19. package/lib/cli/controller.d.ts +32 -27
  20. package/lib/cli/controller.js +130 -261
  21. package/lib/cli/helpers/command-action.d.ts +1 -0
  22. package/lib/cli/helpers/command-action.js +27 -0
  23. package/lib/cli/helpers/handle-error.d.ts +1 -0
  24. package/lib/cli/helpers/handle-error.js +40 -0
  25. package/lib/cli/index.d.ts +3 -3
  26. package/lib/cli/index.js +19 -13
  27. package/lib/cli/program.d.ts +4 -4
  28. package/lib/cli/program.js +112 -192
  29. package/lib/cli/services/project-creator.d.ts +21 -21
  30. package/lib/cli/services/project-creator.js +160 -315
  31. package/lib/cli/services/template-builder.d.ts +11 -11
  32. package/lib/cli/services/template-builder.js +48 -106
  33. package/lib/cli/types.d.ts +13 -12
  34. package/lib/cli/types.js +2 -2
  35. package/lib/common/cli-error.d.ts +3 -0
  36. package/lib/common/cli-error.js +9 -0
  37. package/lib/config/amxmodx.d.ts +10 -0
  38. package/lib/config/amxmodx.js +11 -0
  39. package/lib/config/index.d.ts +7 -9
  40. package/lib/config/index.js +16 -18
  41. package/lib/config/sourcemod.d.ts +11 -0
  42. package/lib/config/sourcemod.js +12 -0
  43. package/lib/constants/index.d.ts +0 -0
  44. package/lib/constants/index.js +5 -0
  45. package/lib/downloaders/compiler/constants.d.ts +5 -12
  46. package/lib/downloaders/compiler/constants.js +9 -17
  47. package/lib/downloaders/compiler/downloader.d.ts +13 -3
  48. package/lib/downloaders/compiler/downloader.js +135 -190
  49. package/lib/downloaders/compiler/index.d.ts +17 -1
  50. package/lib/downloaders/compiler/index.js +152 -9
  51. package/lib/downloaders/compiler/resolvers.d.ts +6 -19
  52. package/lib/downloaders/compiler/resolvers.js +31 -80
  53. package/lib/downloaders/compiler/types.d.ts +17 -16
  54. package/lib/downloaders/compiler/types.js +2 -2
  55. package/lib/downloaders/index.d.ts +8 -0
  56. package/lib/downloaders/index.js +33 -0
  57. package/lib/downloaders/thirdparty/downloader.d.ts +7 -3
  58. package/lib/downloaders/thirdparty/downloader.js +63 -77
  59. package/lib/downloaders/thirdparty/index.d.ts +7 -1
  60. package/lib/downloaders/thirdparty/index.js +63 -9
  61. package/lib/downloaders/thirdparty/types.d.ts +7 -7
  62. package/lib/downloaders/thirdparty/types.js +2 -2
  63. package/lib/downloaders/types/index.d.ts +3 -0
  64. package/lib/downloaders/types/index.js +2 -0
  65. package/lib/index.d.ts +2 -2
  66. package/lib/index.js +23 -24
  67. package/lib/logger/constants.d.ts +7 -7
  68. package/lib/logger/constants.js +11 -12
  69. package/lib/logger/logger.d.ts +16 -16
  70. package/lib/logger/logger.js +60 -97
  71. package/lib/logger/types.d.ts +3 -3
  72. package/lib/logger/types.js +2 -2
  73. package/lib/project-config/configs/amxmodx.d.ts +3 -0
  74. package/lib/project-config/configs/amxmodx.js +13 -0
  75. package/lib/project-config/configs/sourcemod.d.ts +3 -0
  76. package/lib/project-config/configs/sourcemod.js +13 -0
  77. package/lib/project-config/defaults.d.ts +3 -3
  78. package/lib/project-config/defaults.js +43 -39
  79. package/lib/project-config/index.d.ts +8 -8
  80. package/lib/project-config/index.js +115 -9
  81. package/lib/project-config/load.d.ts +3 -3
  82. package/lib/project-config/load.js +55 -92
  83. package/lib/project-config/resolve.d.ts +4 -4
  84. package/lib/project-config/resolve.js +39 -51
  85. package/lib/project-config/types/index.d.ts +24 -0
  86. package/lib/project-config/types/index.js +2 -0
  87. package/lib/types/index.d.ts +94 -77
  88. package/lib/types/index.js +2 -2
  89. package/lib/utils/accumulator.d.ts +2 -2
  90. package/lib/utils/accumulator.js +10 -10
  91. package/lib/utils/copy-file.d.ts +8 -8
  92. package/lib/utils/copy-file.js +36 -83
  93. package/lib/utils/download.d.ts +6 -6
  94. package/lib/utils/download.js +28 -63
  95. package/lib/utils/parse-includes.d.ts +9 -0
  96. package/lib/utils/parse-includes.js +39 -0
  97. package/lib/utils/setup-watch.d.ts +2 -3
  98. package/lib/utils/setup-watch.js +27 -28
  99. package/lib/utils/string-accumulator.d.ts +2 -0
  100. package/lib/utils/string-accumulator.js +10 -0
  101. package/package.json +73 -75
  102. package/resources/templates/{include.txt → amxmodx/include.txt} +5 -5
  103. package/resources/templates/{library-include.txt → amxmodx/library-include.txt} +6 -6
  104. package/resources/templates/{library-script.txt → amxmodx/library-script.txt} +13 -10
  105. package/resources/templates/{script.txt → amxmodx/script.txt} +7 -5
  106. package/resources/templates/sourcemod/include-directive.txt +1 -0
  107. package/resources/templates/sourcemod/include.txt +5 -0
  108. package/resources/templates/sourcemod/library-include.txt +6 -0
  109. package/resources/templates/sourcemod/library-script.txt +21 -0
  110. package/resources/templates/sourcemod/script.txt +13 -0
  111. package/lib/utils/create-dir-hash.d.ts +0 -9
  112. package/lib/utils/create-dir-hash.js +0 -98
  113. /package/resources/templates/{include-directive.txt → amxmodx/include-directive.txt} +0 -0
package/LICENSE CHANGED
@@ -1,21 +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.
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,180 +1,305 @@
1
- # 📦 AMXXPack 🇺🇦 [![npm](https://img.shields.io/npm/v/amxxpack.svg)](https://www.npmjs.com/package/amxxpack)
2
- Simple build system and **CLI** for **AMX Mod X** projects.
3
-
4
- ## 📄 About
5
-
6
- This system will be useful for projects with multiple plugins and assets. Using the command-line interface you can build an entire project with a single command. It also supports hot rebuild to keep your plugins and assets up to date during the work.
7
-
8
-
9
- ## 📚 Features
10
- - ⚙ Flexible configuration
11
- - 🔥 Hot reload
12
- - 🧸 Assets builder
13
-
14
- ## 🔄Requirements
15
- - Node.js 10.0.0+
16
-
17
- ## 🔧 Installation
18
- **AMXXPack** is available through the npm registry.
19
- Installation can be done using the `npm install` command:
20
- ```
21
- npm install amxxpack
22
- ```
23
-
24
- or install it globally to use as a system command
25
- ```
26
- npm install -g amxxpack
27
- ```
28
-
29
- ## ▶ Quick start
30
- - Open a terminal inside the project directory (existing or create a new one)
31
- - Execute `npm install amxxpack -g` command to install `amxxpack` globally
32
- - Execute `amxxpack create .` command to create a new config
33
- - Execute `amxxpack install` to download project dependencies (compiler, thirdparty etc.)
34
- - Use `amxxpack build` command to build the project
35
- - Use `amxxpack watch` command to build the project and watch changes
36
-
37
- ## 📋 Commands
38
- - `amxxpack create <name>` - create new project
39
- - `--git` - initialize git
40
- - `--nonpm` - don't initialize the npm package
41
- - `--version` - project version
42
- - `--author` - project author
43
- - `--description` - project name
44
- - `amxxpack config` - initialize project config in the current workspace
45
- - `amxxpack install` - install project dependencies
46
- - `--config` - config file
47
- - `amxxpack build` - command to build the project
48
- - `--watch` - flag to watch changes
49
- - `--config` - config file
50
- - `--ignore` - ignore build errors
51
- - `--no-cache` - disable caching
52
- - `amxxpack compile <path|glob>` - compile specific plugin in the project
53
- - `--config` - config file
54
- - `--no-cache` - disable caching
55
- - `amxxpack generate <script|lib|include> [name]` - create a new file in the project workspace
56
- - `--config` - config file
57
- - `--name` - plugin name
58
- - `--version` - plugin version
59
- - `--author` - plugin author
60
- - `--lib` - library name
61
- - `--include` - include list separated by a comma
62
- - `--overwrite` - overwrite the file if it already exists
63
- - `amxxpack cache clean` - clean amxxpack cache
64
- - `amxpack i` - alias to `install` command
65
- - `amxpack g` - alias to `generate` command
66
- - `amxpack b` - alias to `build` command
67
- - `amxpack c` - alias to `compile` command
68
-
69
- ## 🦸 Advanced configuration
70
-
71
- ### Third-party dependencies
72
- In case your project requires third-party modules you can specify a link to third-party archives and these archives will be downloaded and extracted to the third-party directory.
73
- ```json
74
- {
75
- "thirdparty": {
76
- "dir": "./.thirdparty",
77
- "dependencies": [
78
- {
79
- "name": "somemodule",
80
- "url": "https://website/somemodule-v100.zip"
81
- }
82
- ]
83
- }
84
- }
85
- ```
86
-
87
- the configuration above will download `somemodule-v100.zip` archive and extract it to the `./.thirdparty/somemodule` directory then you can use thirparty files in your project. For example, add a third-party directory to the include list:
88
- ```json
89
- {
90
- "include": [
91
- "./.thirdparty/somemodule/include"
92
- ]
93
- }
94
- ```
95
-
96
- ### Multiple directories as an input
97
- You can use multiple directories as builder inputs, just specify an array of directories in the project configuration. Example:
98
-
99
- ```json
100
- {
101
- "input": {
102
- "scripts": ["./src/scripts", "./src/extra-scripts"],
103
- "include": ["./src/include", "./src/extra-include"],
104
- "assets": ["./assets", "./extra-assets"]
105
- }
106
- }
107
- ```
108
-
109
- ### Disabling output
110
- Use `null` value for outputs to disable copying of specific output.
111
-
112
- For example, in this case, include files will not be copied to the output folder:
113
-
114
- ```json
115
- {
116
- "output": {
117
- "include": null
118
- }
119
- }
120
- ```
121
-
122
- ### Assets filtering and subdirectories
123
- Using glob filters you can specify which assets should be copied.
124
-
125
- For example, you can exclude all assets except `*.mdl`:
126
- ```json
127
- {
128
- "input": {
129
- "assets": [
130
- { "dir": "./assets", "filter": "*.mdl" }
131
- ]
132
- }
133
- }
134
- ```
135
-
136
- or exclude `*.tga` and `*.wav` files:
137
- ```json
138
- {
139
- "input": {
140
- "assets": [
141
- { "dir": "./assets", "filter": "*.!(tga|wav)" }
142
- ]
143
- }
144
- }
145
- ```
146
-
147
- You can also specify subdirectories for copying. With this configuration, the builder will copy all files from `./assets/models` to `./models/myproject` of the project build directory.
148
- ```json
149
- {
150
- "input": {
151
- "assets": [
152
- { "dir": "./assets/models", "dest": "./models/myproject" }
153
- ]
154
- }
155
- }
156
- ```
157
-
158
- ### Compiler configuration
159
- Using the `compiler` configuration you can specify the compiler version you want to use.
160
-
161
- For example, if you want to use AmxModX 1.9 with `cstrike` addon in your project, then use this configuration:
162
- ```json
163
- {
164
- "compiler": {
165
- "version": "1.9",
166
- "addons": ["cstrike"]
167
- }
168
- }
169
- ```
170
-
171
- In case you want to use a dev build from `amxxdrop` you should set `dev` flag to `true` and specify the build you want to use in the `version` field:
172
- ```json
173
- {
174
- "compiler": {
175
- "version": "1.10.0-git5467",
176
- "dev": true,
177
- "addons": ["cstrike"]
178
- }
179
- }
180
- ```
1
+ # 📦 AMXXPack 🇺🇦 [![npm](https://img.shields.io/npm/v/amxxpack/beta.svg)](https://www.npmjs.com/package/amxxpack/v/beta)
2
+ Simple build system and **CLI** for **AMX Mod X** projects.
3
+
4
+ ---
5
+
6
+ ## Quick Links
7
+ - [About](#-about)
8
+ - [Features](#-features)
9
+ - [Requirements](#-requirements)
10
+ - [Installation](#-installation)
11
+ - [Quick start](#-quick-start)
12
+ - [Commands](#-commands)
13
+ - [Advanced configuration](#-advanced-configuration)
14
+ - [Using with SourceMod](#using-with-sourcemod)
15
+ - [License](#-license)
16
+
17
+ ---
18
+
19
+ ## 📄 About
20
+
21
+ This system will be useful for projects with multiple plugins and assets. Using the command-line interface you can build an entire project with a single command. It also supports hot rebuild to keep your plugins and assets up to date during the work.
22
+
23
+ ---
24
+
25
+ ## 📚 Features
26
+ - Flexible configuration
27
+ - 🔥 Hot reload
28
+ - 🧸 Assets builder
29
+
30
+ ---
31
+
32
+ ## 🔄Requirements
33
+ - Node.js 10.0.0+
34
+
35
+ ---
36
+
37
+ ## 🔧 Installation
38
+ **AMXXPack** is available through the npm registry.
39
+ Installation can be done using the `npm i amxxpack@1.5.0-beta.2` command:
40
+ ```
41
+ npm install amxxpack
42
+ ```
43
+
44
+ or install it globally to use as a system command
45
+ ```
46
+ npm install -g amxxpack
47
+ ```
48
+
49
+ ---
50
+
51
+
52
+ ## Quick start
53
+ - Open a terminal inside the project directory (existing or create a new one)
54
+ - Execute `npm install amxxpack@1.5.0-beta.2 -g` command to install `amxxpack` globally
55
+ - Execute `amxxpack create .` command to create a new config
56
+ - Execute `amxxpack install` to download project dependencies (compiler, thirdparty etc.)
57
+ - Use `amxxpack build` command to build the project
58
+ - Use `amxxpack watch` command to build the project and watch changes
59
+
60
+ ## 📋 Commands
61
+ - `amxxpack create <name>` - create new project
62
+ - `--git` - initialize git
63
+ - `--nonpm` - don't initialize the npm package
64
+ - `--version` - project version
65
+ - `--author` - project author
66
+ - `--description` - project name
67
+ - `--type` - project type (e.g. `amxmodx`, `amxmodx-legacy`, `sourcemod`)
68
+ - `amxxpack config` - initialize project config in the current workspace
69
+ - `--type` - project type (e.g. `amxmodx`, `amxmodx-legacy`, `sourcemod`)
70
+ - `amxxpack install` - install project dependencies
71
+ - `--config` - config file
72
+ - `amxxpack build` - command to build the project
73
+ - `--watch` - flag to watch changes
74
+ - `--config` - config file
75
+ - `--ignore` - ignore build errors
76
+ - `--no-cache` - disable caching
77
+ - `amxxpack compile <path|glob>` - compile specific plugin in the project
78
+ - `--config` - config file
79
+ - `--no-cache` - disable caching
80
+ - `amxxpack generate <script|lib|include> [name]` - create a new file in the project workspace
81
+ - `--config` - config file
82
+ - `--name` - plugin name
83
+ - `--version` - plugin version
84
+ - `--author` - plugin author
85
+ - `--lib` - library name
86
+ - `--include` - include list separated by a comma
87
+ - `--overwrite` - overwrite the file if it already exists
88
+ - `amxxpack cache clean` - clean amxxpack cache
89
+ - `amxxpack i` - alias to `install` command
90
+ - `amxxpack g` - alias to `generate` command
91
+ - `amxxpack b` - alias to `build` command
92
+ - `amxxpack c` - alias to `compile` command
93
+
94
+ ---
95
+
96
+ ## 🦸 Advanced configuration
97
+
98
+ ### Third-party dependencies
99
+
100
+ #### Archives
101
+ In case your project requires third-party modules you can specify a link to third-party archives and these archives will be downloaded and extracted to the third-party directory.
102
+ ```json
103
+ {
104
+ "thirdparty": {
105
+ "dir": "./.thirdparty",
106
+ "dependencies": [
107
+ {
108
+ "name": "somemodule",
109
+ "url": "https://website/somemodule-v100.zip"
110
+ }
111
+ ]
112
+ }
113
+ }
114
+ ```
115
+
116
+ the configuration above will download `somemodule-v100.zip` archive and extract it to the `./.thirdparty/somemodule` directory then you can use thirdparty files in your project. For example, add a third-party directory to the include list:
117
+ ```json
118
+ {
119
+ "include": [
120
+ "./.thirdparty/somemodule/include"
121
+ ]
122
+ }
123
+ ```
124
+
125
+ You can also specify a `strip` and `filter` options for better control over the extracted files.
126
+ - `strip` - used to remove specific number of directories from the archive.
127
+ - `filter` - used to filter specific files from the archive by glob patterns.
128
+
129
+ ```json
130
+ {
131
+ "thirdparty": {
132
+ "dir": "./.thirdparty",
133
+ "dependencies": [
134
+ {
135
+ "name": "somemodule",
136
+ "url": "https://website/somemodule-v100.zip",
137
+ "strip": 1,
138
+ "filter": [
139
+ "something/**/*.inc"
140
+ ]
141
+ }
142
+ ]
143
+ }
144
+ }
145
+ ```
146
+
147
+ #### Single file
148
+ If you need to download a single file you can provide URL to the file and it will be downloaded to the third-party directory without trying to extract it.
149
+
150
+ ```json
151
+ {
152
+ "thirdparty": {
153
+ "dir": "./.thirdparty",
154
+ "dependencies": [
155
+ {
156
+ "name": "utils",
157
+ "url": "https://website/util.inc"
158
+ }
159
+ ]
160
+ }
161
+ }
162
+ ```
163
+
164
+ ### Multiple directories as an input
165
+ You can use multiple directories as builder inputs, just specify an array of directories in the project configuration. Example:
166
+
167
+ ```json
168
+ {
169
+ "input": {
170
+ "scripts": ["./src/scripts", "./src/extra-scripts"],
171
+ "include": ["./src/include", "./src/extra-include"],
172
+ "assets": ["./assets", "./extra-assets"]
173
+ }
174
+ }
175
+ ```
176
+
177
+ ### Input options
178
+ You can specify additional options for the input directories.
179
+
180
+ #### Flat compilation
181
+ `flat` option is used to specify if the scripts should be compiled in a flat directory structure even if `rules.flatCompilation` is disabled.
182
+
183
+ ```json
184
+ {
185
+ "input": {
186
+ "scripts": ["./src/scripts", { "dir": "./src/scripts", "flat": false }]
187
+ }
188
+ }
189
+ ```
190
+
191
+ #### Prefix
192
+ `prefix` option is used to specify a prefix which will be added to the compiled plugin name.
193
+
194
+ ```json
195
+ {
196
+ "input": {
197
+ "scripts": ["./src/scripts", { "dir": "./src/scripts", "prefix": "test_" }]
198
+ }
199
+ }
200
+ ```
201
+
202
+ #### Destination
203
+
204
+ `dest` option is used to specify a destination directory for the compiled plugin. So plugin will be placed in the `sub` directory of the final compiled plugins directory.
205
+
206
+ ```json
207
+ {
208
+ "input": {
209
+ "scripts": ["./src/scripts", { "dir": "./src/scripts", "dest": "sub" }]
210
+ }
211
+ }
212
+ ```
213
+
214
+ ### Disabling output
215
+ Use `null` value for outputs to disable copying of specific output.
216
+
217
+ For example, in this case, include files will not be copied to the output folder:
218
+
219
+ ```json
220
+ {
221
+ "output": {
222
+ "include": null
223
+ }
224
+ }
225
+ ```
226
+
227
+ ### Assets filtering and subdirectories
228
+ Using glob filters you can specify which assets should be copied.
229
+
230
+ For example, you can exclude all assets except `*.mdl`:
231
+ ```json
232
+ {
233
+ "input": {
234
+ "assets": [
235
+ { "dir": "./assets", "filter": "*.mdl" }
236
+ ]
237
+ }
238
+ }
239
+ ```
240
+
241
+ or exclude `*.tga` and `*.wav` files:
242
+ ```json
243
+ {
244
+ "input": {
245
+ "assets": [
246
+ { "dir": "./assets", "filter": "*.!(tga|wav)" }
247
+ ]
248
+ }
249
+ }
250
+ ```
251
+
252
+ You can also specify subdirectories for copying. With this configuration, the builder will copy all files from `./assets/models` to `./models/myproject` of the project build directory.
253
+ ```json
254
+ {
255
+ "input": {
256
+ "assets": [
257
+ { "dir": "./assets/models", "dest": "./models/myproject" }
258
+ ]
259
+ }
260
+ }
261
+ ```
262
+
263
+ ### Compiler configuration
264
+ Using the `compiler` configuration you can specify the compiler version you want to use.
265
+
266
+ For example, if you want to use AmxModX 1.9 with `cstrike` addon in your project, then use this configuration:
267
+ ```json
268
+ {
269
+ "compiler": {
270
+ "version": "1.9",
271
+ "addons": ["cstrike"]
272
+ }
273
+ }
274
+ ```
275
+
276
+ In case you want to use a dev build from `amxxdrop` you should set `dev` flag to `true` and specify the build you want to use in the `version` field:
277
+ ```json
278
+ {
279
+ "compiler": {
280
+ "version": "1.10.0-git5467",
281
+ "dev": true,
282
+ "addons": ["cstrike"]
283
+ }
284
+ }
285
+ ```
286
+
287
+ ### Using with SourceMod
288
+
289
+ If you use **SourceMod** with **AMXXPack** you should set `type` to `sourcemod` in the project configuration or just use `amxxpack config --type sourcemod` command to crate new configuration file.
290
+
291
+ ```json
292
+ {
293
+ "type": "sourcemod",
294
+ "compiler": {
295
+ "version": "1.12.0",
296
+ }
297
+ }
298
+ ```
299
+
300
+ ---
301
+
302
+ ## 📝 License
303
+ This project is licensed under the MIT License - see the [LICENSE](./LICENSE) file for details.
304
+
305
+ ---
@@ -1,27 +1,33 @@
1
- export declare enum AMXPCMessageType {
2
- Echo = "echo",
3
- Error = "error",
4
- Warning = "warning",
5
- FatalError = "fatal error"
6
- }
7
- interface IMessage {
8
- filename?: string;
9
- startLine?: number;
10
- endLine?: number;
11
- code?: number;
12
- type: AMXPCMessageType;
13
- text: string;
14
- }
15
- interface IParseOutputResult {
16
- messages: IMessage[];
17
- aborted: boolean;
18
- error: boolean;
19
- }
20
- interface ICompileResult {
21
- output: IParseOutputResult;
22
- plugin: string;
23
- error?: string;
24
- success: boolean;
25
- }
26
- declare function compile(params: any): Promise<ICompileResult>;
27
- export default compile;
1
+ export declare enum AMXPCMessageType {
2
+ Echo = "echo",
3
+ Error = "error",
4
+ Warning = "warning",
5
+ FatalError = "fatal error"
6
+ }
7
+ interface ICompileParams {
8
+ path: string;
9
+ dest: string;
10
+ compiler: string;
11
+ includeDir: string[];
12
+ }
13
+ interface IMessage {
14
+ filename?: string;
15
+ startLine?: number;
16
+ endLine?: number;
17
+ code?: number;
18
+ type: AMXPCMessageType;
19
+ text: string;
20
+ }
21
+ interface IParseOutputResult {
22
+ messages: IMessage[];
23
+ aborted: boolean;
24
+ error: boolean;
25
+ }
26
+ interface ICompileResult {
27
+ output: IParseOutputResult;
28
+ plugin: string;
29
+ error?: string;
30
+ success: boolean;
31
+ }
32
+ declare function compile(params: ICompileParams): Promise<ICompileResult>;
33
+ export default compile;