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.
- package/LICENSE +21 -21
- package/README.md +305 -180
- package/lib/builder/amxxpc.d.ts +33 -27
- package/lib/builder/amxxpc.js +116 -125
- package/lib/builder/builder.d.ts +36 -28
- package/lib/builder/builder.js +375 -623
- package/lib/builder/compiler.d.ts +33 -0
- package/lib/builder/compiler.js +112 -0
- package/lib/builder/constants.d.ts +1 -3
- package/lib/builder/constants.js +10 -6
- package/lib/builder/index.d.ts +1 -1
- package/lib/builder/index.js +8 -9
- package/lib/builder/plugins-cache.d.ts +41 -20
- package/lib/builder/plugins-cache.js +243 -190
- package/lib/builder/plugins-dependencies.d.ts +7 -0
- package/lib/builder/plugins-dependencies.js +34 -0
- package/lib/cli/constants/index.d.ts +5 -0
- package/lib/cli/constants/index.js +10 -0
- package/lib/cli/controller.d.ts +32 -27
- package/lib/cli/controller.js +130 -261
- package/lib/cli/helpers/command-action.d.ts +1 -0
- package/lib/cli/helpers/command-action.js +27 -0
- package/lib/cli/helpers/handle-error.d.ts +1 -0
- package/lib/cli/helpers/handle-error.js +40 -0
- package/lib/cli/index.d.ts +3 -3
- package/lib/cli/index.js +19 -13
- package/lib/cli/program.d.ts +4 -4
- package/lib/cli/program.js +112 -192
- package/lib/cli/services/project-creator.d.ts +21 -21
- package/lib/cli/services/project-creator.js +160 -315
- package/lib/cli/services/template-builder.d.ts +11 -11
- package/lib/cli/services/template-builder.js +48 -106
- package/lib/cli/types.d.ts +13 -12
- package/lib/cli/types.js +2 -2
- package/lib/common/cli-error.d.ts +3 -0
- package/lib/common/cli-error.js +9 -0
- package/lib/config/amxmodx.d.ts +10 -0
- package/lib/config/amxmodx.js +11 -0
- package/lib/config/index.d.ts +7 -9
- package/lib/config/index.js +16 -18
- package/lib/config/sourcemod.d.ts +11 -0
- package/lib/config/sourcemod.js +12 -0
- package/lib/constants/index.d.ts +0 -0
- package/lib/constants/index.js +5 -0
- package/lib/downloaders/compiler/constants.d.ts +5 -12
- package/lib/downloaders/compiler/constants.js +9 -17
- package/lib/downloaders/compiler/downloader.d.ts +13 -3
- package/lib/downloaders/compiler/downloader.js +135 -190
- package/lib/downloaders/compiler/index.d.ts +17 -1
- package/lib/downloaders/compiler/index.js +152 -9
- package/lib/downloaders/compiler/resolvers.d.ts +6 -19
- package/lib/downloaders/compiler/resolvers.js +31 -80
- package/lib/downloaders/compiler/types.d.ts +17 -16
- package/lib/downloaders/compiler/types.js +2 -2
- package/lib/downloaders/index.d.ts +8 -0
- package/lib/downloaders/index.js +33 -0
- package/lib/downloaders/thirdparty/downloader.d.ts +7 -3
- package/lib/downloaders/thirdparty/downloader.js +63 -77
- package/lib/downloaders/thirdparty/index.d.ts +7 -1
- package/lib/downloaders/thirdparty/index.js +63 -9
- package/lib/downloaders/thirdparty/types.d.ts +7 -7
- package/lib/downloaders/thirdparty/types.js +2 -2
- package/lib/downloaders/types/index.d.ts +3 -0
- package/lib/downloaders/types/index.js +2 -0
- package/lib/index.d.ts +2 -2
- package/lib/index.js +23 -24
- package/lib/logger/constants.d.ts +7 -7
- package/lib/logger/constants.js +11 -12
- package/lib/logger/logger.d.ts +16 -16
- package/lib/logger/logger.js +60 -97
- package/lib/logger/types.d.ts +3 -3
- package/lib/logger/types.js +2 -2
- package/lib/project-config/configs/amxmodx.d.ts +3 -0
- package/lib/project-config/configs/amxmodx.js +13 -0
- package/lib/project-config/configs/sourcemod.d.ts +3 -0
- package/lib/project-config/configs/sourcemod.js +13 -0
- package/lib/project-config/defaults.d.ts +3 -3
- package/lib/project-config/defaults.js +43 -39
- package/lib/project-config/index.d.ts +8 -8
- package/lib/project-config/index.js +115 -9
- package/lib/project-config/load.d.ts +3 -3
- package/lib/project-config/load.js +55 -92
- package/lib/project-config/resolve.d.ts +4 -4
- package/lib/project-config/resolve.js +39 -51
- package/lib/project-config/types/index.d.ts +24 -0
- package/lib/project-config/types/index.js +2 -0
- package/lib/types/index.d.ts +94 -77
- package/lib/types/index.js +2 -2
- package/lib/utils/accumulator.d.ts +2 -2
- package/lib/utils/accumulator.js +10 -10
- package/lib/utils/copy-file.d.ts +8 -8
- package/lib/utils/copy-file.js +36 -83
- package/lib/utils/download.d.ts +6 -6
- package/lib/utils/download.js +28 -63
- package/lib/utils/parse-includes.d.ts +9 -0
- package/lib/utils/parse-includes.js +39 -0
- package/lib/utils/setup-watch.d.ts +2 -3
- package/lib/utils/setup-watch.js +27 -28
- package/lib/utils/string-accumulator.d.ts +2 -0
- package/lib/utils/string-accumulator.js +10 -0
- package/package.json +73 -75
- package/resources/templates/{include.txt → amxmodx/include.txt} +5 -5
- package/resources/templates/{library-include.txt → amxmodx/library-include.txt} +6 -6
- package/resources/templates/{library-script.txt → amxmodx/library-script.txt} +13 -10
- package/resources/templates/{script.txt → amxmodx/script.txt} +7 -5
- package/resources/templates/sourcemod/include-directive.txt +1 -0
- package/resources/templates/sourcemod/include.txt +5 -0
- package/resources/templates/sourcemod/library-include.txt +6 -0
- package/resources/templates/sourcemod/library-script.txt +21 -0
- package/resources/templates/sourcemod/script.txt +13 -0
- package/lib/utils/create-dir-hash.d.ts +0 -9
- package/lib/utils/create-dir-hash.js +0 -98
- /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 🇺🇦 [](https://www.npmjs.com/package/amxxpack)
|
|
2
|
-
Simple build system and **CLI** for **AMX Mod X** projects.
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
##
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
- `amxxpack
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
- `--
|
|
63
|
-
- `
|
|
64
|
-
- `
|
|
65
|
-
- `
|
|
66
|
-
- `
|
|
67
|
-
- `
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
```
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
1
|
+
# 📦 AMXXPack 🇺🇦 [](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
|
+
---
|
package/lib/builder/amxxpc.d.ts
CHANGED
|
@@ -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
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
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;
|