factoriomod-debug 1.1.26 → 1.1.28
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/CHANGELOG.md +26 -0
- package/dist/Flamegraph.js +1 -1
- package/dist/fmtk.js +498 -290
- package/doc/debugadapter.md +4 -4
- package/doc/language-lua.md +5 -1
- package/doc/package.md +15 -1
- package/doc/workspace.md +1 -1
- package/language/factorio-locale.tmLanguage.json +2 -10
- package/package.json +24 -15
- package/readme.md +1 -1
- package/schema/datainfo.json +6 -3
- package/schema/modinfo.json +55 -1
package/doc/debugadapter.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Using Factorio Mod Debug
|
|
4
4
|
|
|
5
|
-
* Install the **Factorio Mod
|
|
5
|
+
* Install the **Factorio Mod Tool Kit** extension in VS Code.
|
|
6
6
|
* Switch to the run/debug view (View->Run) and select "create a launch.json file"
|
|
7
7
|
* Select the debug environment "Factorio Mod Debug".
|
|
8
8
|
* Adjust the paths and launch settings as required. Check Intellisense for additional launch options.
|
|
@@ -14,7 +14,7 @@ If [Zip File Explorer](https://marketplace.visualstudio.com/items?itemName=sleve
|
|
|
14
14
|
|
|
15
15
|
## Steam
|
|
16
16
|
|
|
17
|
-
If you use a Steam install, a file `steam_appid.txt` with content `427520` in the same
|
|
17
|
+
If you use a Steam install, a file `steam_appid.txt` with content `427520` in the same folder as the factorio binary (there will also be one of `steam_api64.dll`, `libsteam_api.dylib` or `libsteam_api.so` here) is required. If the Debug Adapter has write access to this folder, it will create this automatically. On macs, you may need to "Show Package Contents" to locate the correct folder.
|
|
18
18
|
|
|
19
19
|
## Runtime Lua Diagnostics
|
|
20
20
|
|
|
@@ -25,5 +25,5 @@ The debugger also injects runtime diagnostics into all hooked mods:
|
|
|
25
25
|
|
|
26
26
|
## Advanced Features
|
|
27
27
|
|
|
28
|
-
* [Debugger Mod API](
|
|
29
|
-
* [Custom Debug Views](
|
|
28
|
+
* [Debugger Mod API](debugapi.md)
|
|
29
|
+
* [Custom Debug Views](variables.md)
|
package/doc/language-lua.md
CHANGED
|
@@ -79,4 +79,8 @@ remote.__typed_interfaces.foo.bar("arg 1", "arg 2")
|
|
|
79
79
|
|
|
80
80
|
### LuaObject Type Tests
|
|
81
81
|
|
|
82
|
-
To allow the Language Server to see that `LuaObject.object_name` is "like `type()`" for type tests, such as `if obj.object_name == "LuaPlayer" then end`, the plugin rewrites it to appear as an internal function `if __object_name(obj) == "LuaPlayer" then end`, and this function is marked as "like `type()`" in the configuration.
|
|
82
|
+
To allow the Language Server to see that `LuaObject.object_name` is "like `type()`" for type tests, such as `if obj.object_name == "LuaPlayer" then end`, the plugin rewrites it to appear as an internal function `if __object_name(obj) == "LuaPlayer" then end`, and this function is marked as "like `type()`" in the configuration.
|
|
83
|
+
|
|
84
|
+
### Commands
|
|
85
|
+
|
|
86
|
+
In-game lua commands `/c`, `/command`, `/silent-command`, `/sc`, and `/measured-command` will be ignored at teh start of any line.
|
package/doc/package.md
CHANGED
|
@@ -4,7 +4,11 @@ Mods can be automatically Packaged and Published from the "Factorio Mod Packages
|
|
|
4
4
|
|
|
5
5
|
## API Key
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Interacting with the Mod Portal requires an API key, which you can create at https://factorio.com/profile. You will be prompted for this key when it is required by tasks, and then it will be stored in the OS keychain (Windows Credential Manager, macOS Keychain, Linux Secret Service API/libsecret) if available. You can also provide the API key as an environment variable `FACTORIO_UPLOAD_API_KEY` to the cli tool `fmtk`, which will take precedence over the keychain.
|
|
8
|
+
|
|
9
|
+
Uploading new releases (`upload`, `publish` commands) requires a key with the `ModPortal: Upload Mods` permission.
|
|
10
|
+
|
|
11
|
+
Updating mod details (`details`, `publish` commands) requires a key with the `ModPortal: Edit Mods` permission.
|
|
8
12
|
|
|
9
13
|
## Tasks
|
|
10
14
|
|
|
@@ -31,6 +35,15 @@ These tasks can also be accessed in VSCode's Tasks system. Custom scripts will r
|
|
|
31
35
|
* select a package in mod directory
|
|
32
36
|
* upload to mod portal
|
|
33
37
|
|
|
38
|
+
### Details
|
|
39
|
+
* update mod portal information:
|
|
40
|
+
* title, homepage, summary from `info.json#/title`, `info.json#/homepage`, `info.json#/description`
|
|
41
|
+
* upload readme.md (or file named in `info.json#/package/readme`) to mod portal long description
|
|
42
|
+
* upload faq.md (or file named in `info.json#/package/faq`) to mod portal long description
|
|
43
|
+
* sync gallery:
|
|
44
|
+
* images listed in `info.json#/package/gallery` if set
|
|
45
|
+
* any local images used by readme/faq will be added to the end of the gallery
|
|
46
|
+
|
|
34
47
|
### Publish
|
|
35
48
|
|
|
36
49
|
All-in-one command.
|
|
@@ -43,6 +56,7 @@ All-in-one command.
|
|
|
43
56
|
* git tag, unless `info.json#/package/no_git_tag` is set
|
|
44
57
|
* run `info.json#/package/scripts/publish` if set
|
|
45
58
|
* upload to mod portal, unless `info.json#/package/no_portal_upload` is set
|
|
59
|
+
* also run **Details** if `info.json#/package/sync_portal_details` is set
|
|
46
60
|
* run `info.json#/package/scripts/postpublish` if set, with extra environment variable `FACTORIO_MODPACKAGE` with the filename of the built zip in a temporary folder.
|
|
47
61
|
* run **Increment Version**
|
|
48
62
|
* commit "moved to version x.y.z"
|
package/doc/workspace.md
CHANGED
|
@@ -24,7 +24,7 @@ I open the Factorio `mods` directory as the root of my workspace in VSCode, and
|
|
|
24
24
|
|
|
25
25
|
I use [VScode](https://code.visualstudio.com/) (imagine that!), but it needs a few extensions to really shine in this context:
|
|
26
26
|
|
|
27
|
-
* [Factorio
|
|
27
|
+
* [Factorio Modding Tool Kit](https://marketplace.visualstudio.com/items?itemName=justarandomgeek.factoriomod-debug) - You are here
|
|
28
28
|
* A Lua language server. I like to use [sumneko.lua](https://marketplace.visualstudio.com/items?itemName=sumneko.lua), and the Factorio Mod Debugger has some extended support for it.
|
|
29
29
|
* Optional: [Zip File Explorer](https://marketplace.visualstudio.com/items?itemName=slevesque.vscode-zipexplorer). Enables viewing files inside zips, which allows breakpoints/stepping inside them as well.
|
|
30
30
|
* Optional: [indent-rainbow](https://marketplace.visualstudio.com/items?itemName=oderwat.indent-rainbow)
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
{
|
|
16
16
|
"name": "meta.plural.factorio-locale",
|
|
17
|
-
"match": "(__)(plural_for_parameter)(_)([0-9]+)(_\\{)(
|
|
17
|
+
"match": "(__)(plural_for_parameter)(_)([0-9]+)(_\\{)(.*?)(\\}__)",
|
|
18
18
|
"captures": {
|
|
19
19
|
"1": {"name": "punctuation.definition.tag.begin.factorio-locale"},
|
|
20
20
|
"2": {"name": "support.function.plural.factorio-locale"},
|
|
@@ -179,14 +179,6 @@
|
|
|
179
179
|
},
|
|
180
180
|
"5":{"name": "punctuation.definition.tag.end.factorio-locale"}
|
|
181
181
|
}
|
|
182
|
-
},
|
|
183
|
-
{
|
|
184
|
-
"match": "(__)(.+?)(__)",
|
|
185
|
-
"captures": {
|
|
186
|
-
"1":{"name":"punctuation.definition.tag.begin.factorio-locale"},
|
|
187
|
-
"2":{"name":"invalid.variable.factorio-locale"},
|
|
188
|
-
"3":{"name":"punctuation.definition.tag.end.factorio-locale"}
|
|
189
|
-
}
|
|
190
182
|
}
|
|
191
183
|
]
|
|
192
184
|
}
|
|
@@ -209,7 +201,7 @@
|
|
|
209
201
|
"name": "comment.line.factorio-locale"
|
|
210
202
|
},
|
|
211
203
|
{
|
|
212
|
-
"match": "^[ \t\r]*(
|
|
204
|
+
"match": "^[ \t\r]*(.*?)(=)(.*)$",
|
|
213
205
|
"name": "meta.record.factorio-locale",
|
|
214
206
|
"captures": {
|
|
215
207
|
"1": {"name": "variable.factorio-locale"},
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "factoriomod-debug",
|
|
3
3
|
"displayName": "Factorio Modding Tool Kit",
|
|
4
|
-
"version": "1.1.
|
|
4
|
+
"version": "1.1.28",
|
|
5
5
|
"publisher": "justarandomgeek",
|
|
6
6
|
"description": "Debug Tools for developing Factorio Mods",
|
|
7
7
|
"author": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
],
|
|
15
15
|
"engines": {
|
|
16
16
|
"vscode": "^1.66.0",
|
|
17
|
-
"node": ">=
|
|
17
|
+
"node": ">=18"
|
|
18
18
|
},
|
|
19
19
|
"icon": "images/factoriomod-debug-icon.png",
|
|
20
20
|
"categories": [
|
|
@@ -35,20 +35,22 @@
|
|
|
35
35
|
"typecheck-watch": "tsc -p tsconfig.json --noEmit --watch",
|
|
36
36
|
"esbuild": "ts-node ./build.ts",
|
|
37
37
|
"watch": "npm run esbuild -- --watch",
|
|
38
|
-
"stats": "npm run esbuild -- --meta && esbuild-visualizer --metadata ./out/meta.json --filename ./out/stats.html",
|
|
38
|
+
"stats": "npm run esbuild -- --minify --meta && esbuild-visualizer --metadata ./out/meta.json --filename ./out/stats.html",
|
|
39
39
|
"vscode:prepublish": "npm run prepare",
|
|
40
|
-
"prepare": "rimraf dist && npm run esbuild",
|
|
40
|
+
"prepare": "rimraf dist && npm run esbuild -- --minify",
|
|
41
41
|
"package": "vsce package",
|
|
42
42
|
"publish-vscode": "vsce publish",
|
|
43
43
|
"publish-vscode-prerelease": "vsce publish --pre-release",
|
|
44
44
|
"test": "npm run typecheck && npm run lint"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@types/archiver": "^3.1
|
|
47
|
+
"@types/archiver": "^5.3.1",
|
|
48
48
|
"@types/buffers": "^0.1.31",
|
|
49
49
|
"@types/d3": "^7.4.0",
|
|
50
|
+
"@types/dot-object": "^2.1.2",
|
|
50
51
|
"@types/ini": "^1.3.31",
|
|
51
|
-
"@types/
|
|
52
|
+
"@types/inquirer": "^9.0.3",
|
|
53
|
+
"@types/node": "^18.11.18",
|
|
52
54
|
"@types/node-fetch": "^2.6.1",
|
|
53
55
|
"@types/request": "^2.48.8",
|
|
54
56
|
"@types/semver": "^7.3.9",
|
|
@@ -61,27 +63,33 @@
|
|
|
61
63
|
"@vscode/vsce": "^2.7.0",
|
|
62
64
|
"archiver": "^5.3.0",
|
|
63
65
|
"commander": "^9.4.0",
|
|
64
|
-
"d3": "^7.
|
|
66
|
+
"d3": "^7.8.1",
|
|
65
67
|
"d3-flame-graph": "^4.1.3",
|
|
66
|
-
"
|
|
68
|
+
"dot-object": "^2.1.4",
|
|
69
|
+
"esbuild": "^0.16.17",
|
|
67
70
|
"esbuild-plugin-import-glob": "^0.1.1",
|
|
68
|
-
"esbuild-visualizer": "^0.
|
|
71
|
+
"esbuild-visualizer": "^0.4.0",
|
|
69
72
|
"eslint": "^8.12.0",
|
|
70
|
-
"
|
|
71
|
-
"
|
|
73
|
+
"ini": "^3.0.1",
|
|
74
|
+
"inquirer": "^9.1.4",
|
|
72
75
|
"jsonc-parser": "^3.1.0",
|
|
73
|
-
"
|
|
76
|
+
"mimer": "^2.0.2",
|
|
77
|
+
"node-fetch": "^3.3.0",
|
|
74
78
|
"readdir-glob": "^1.1.2",
|
|
75
|
-
"
|
|
79
|
+
"remark": "^14.0.2",
|
|
80
|
+
"rimraf": "^4.0.4",
|
|
76
81
|
"semver": "^7.3.7",
|
|
77
82
|
"tree-kill": "^1.2.2",
|
|
78
83
|
"ts-node": "^10.9.1",
|
|
79
84
|
"typescript": "^4.7.4",
|
|
80
85
|
"vscode-languageclient": "^8.0.2",
|
|
81
86
|
"vscode-languageserver": "^8.0.2",
|
|
82
|
-
"vscode-languageserver-textdocument": "^1.0.
|
|
87
|
+
"vscode-languageserver-textdocument": "^1.0.8",
|
|
83
88
|
"vscode-uri": "^3.0.3"
|
|
84
89
|
},
|
|
90
|
+
"dependencies": {
|
|
91
|
+
"keytar": "^7.9.0"
|
|
92
|
+
},
|
|
85
93
|
"main": "./dist/fmtk.js",
|
|
86
94
|
"bin": {
|
|
87
95
|
"fmtk": "./dist/fmtk.js"
|
|
@@ -435,7 +443,7 @@
|
|
|
435
443
|
"description": "Use lua `integer` type for specialized integer types",
|
|
436
444
|
"default": true
|
|
437
445
|
},
|
|
438
|
-
"factorio.docs.
|
|
446
|
+
"factorio.docs.docLinksVersion": {
|
|
439
447
|
"description": "What version to use when generating docs links",
|
|
440
448
|
"enumDescriptions": [
|
|
441
449
|
"Always link to the `latest` docs available online",
|
|
@@ -484,6 +492,7 @@
|
|
|
484
492
|
"package",
|
|
485
493
|
"version",
|
|
486
494
|
"upload",
|
|
495
|
+
"details",
|
|
487
496
|
"publish",
|
|
488
497
|
"run",
|
|
489
498
|
"adjustMods"
|
package/readme.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Factorio Modding Tool Kit
|
|
2
2
|
|
|
3
|
-
A collection of tools for developing Factorio mods. This package is both an npm package providing the command line tool `fmtk`, and a VS Code Extension providing additional editor integration.
|
|
3
|
+
A collection of tools for developing Factorio mods. This package is both [an npm package](https://www.npmjs.com/package/factoriomod-debug) providing the command line tool `fmtk`, and a [VS Code Extension](https://marketplace.visualstudio.com/items?itemName=justarandomgeek.factoriomod-debug) providing additional editor integration.
|
|
4
4
|
|
|
5
5
|
* [Debug Adapter](doc/debugadapter.md)
|
|
6
6
|
* [Mod Profiling](doc/profile.md)
|
package/schema/datainfo.json
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
"type":"string",
|
|
8
8
|
"title": "Internal name of the mod",
|
|
9
9
|
"pattern": "[a-zA-Z0-9_-]+",
|
|
10
|
-
"maxLength": 100
|
|
10
|
+
"maxLength": 100,
|
|
11
|
+
"minLength": 1
|
|
11
12
|
},
|
|
12
13
|
"version": {
|
|
13
14
|
"type":"string",
|
|
@@ -31,12 +32,14 @@
|
|
|
31
32
|
"homepage": {
|
|
32
33
|
"type": "string",
|
|
33
34
|
"title": "Homepage for the mod",
|
|
34
|
-
"description": "Please don't put \"None\" here, just leave it empty if none"
|
|
35
|
+
"description": "Please don't put \"None\" here, just leave it empty if none",
|
|
36
|
+
"pattern": "^($|http(s?):)"
|
|
35
37
|
},
|
|
36
38
|
"description": {
|
|
37
39
|
"type": "string",
|
|
38
40
|
"title": "A short description of the mod to show in-game",
|
|
39
|
-
"description": "Can be overwritten by locale entry in the `mod-description` category"
|
|
41
|
+
"description": "Can be overwritten by locale entry in the `mod-description` category",
|
|
42
|
+
"maxLength": 500
|
|
40
43
|
},
|
|
41
44
|
"factorio_version": {
|
|
42
45
|
"type":"string",
|
package/schema/modinfo.json
CHANGED
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"package": {
|
|
31
31
|
"type":"object",
|
|
32
|
-
"description": "Configuration for automatically packaging and publishing this mod [
|
|
32
|
+
"description": "Configuration for automatically packaging and publishing this mod [FMTK]",
|
|
33
33
|
"properties": {
|
|
34
34
|
"ignore":{
|
|
35
35
|
"type":"array",
|
|
@@ -66,6 +66,56 @@
|
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
|
+
"gallery":{
|
|
70
|
+
"type":"array",
|
|
71
|
+
"description": "Globs to sync to gallery",
|
|
72
|
+
"items": {
|
|
73
|
+
"type":"string",
|
|
74
|
+
"format": "glob"
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"prune_gallery": {
|
|
78
|
+
"type":"boolean",
|
|
79
|
+
"description": "Remove unreferenced images from gallery"
|
|
80
|
+
},
|
|
81
|
+
"readme": {
|
|
82
|
+
"type":"string",
|
|
83
|
+
"description": "Markdown file to be uploaded to the portal as long description"
|
|
84
|
+
},
|
|
85
|
+
"faq": {
|
|
86
|
+
"type":"string",
|
|
87
|
+
"description": "Markdown file to be uploaded to the portal as faq"
|
|
88
|
+
},
|
|
89
|
+
"markdown": {
|
|
90
|
+
"type": "object",
|
|
91
|
+
"description": "Options for transforming markdown files uploaded to the portal",
|
|
92
|
+
"properties":{
|
|
93
|
+
"strip_first_header": {
|
|
94
|
+
"type": "boolean",
|
|
95
|
+
"description": "Strip the first header",
|
|
96
|
+
"default": true
|
|
97
|
+
},
|
|
98
|
+
"images": {
|
|
99
|
+
"default": "gallery",
|
|
100
|
+
"enum": ["gallery", "url"]
|
|
101
|
+
},
|
|
102
|
+
"links": {
|
|
103
|
+
"default": "url",
|
|
104
|
+
"enum": ["url"]
|
|
105
|
+
},
|
|
106
|
+
"base_url": {
|
|
107
|
+
"type":"string",
|
|
108
|
+
"format": "uri",
|
|
109
|
+
"description": "Base url for `url` rewrites. If not set, links will not be rewritten."
|
|
110
|
+
},
|
|
111
|
+
"url_match": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"format": "regex",
|
|
114
|
+
"default": "^((http(s?)|data):|#)",
|
|
115
|
+
"description": "Urls matching this regex will *not* be rewritten"
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
},
|
|
69
119
|
"no_git_push": {
|
|
70
120
|
"type":"boolean",
|
|
71
121
|
"description": "Don't automatically `git push` in Publish"
|
|
@@ -82,6 +132,10 @@
|
|
|
82
132
|
"type":"boolean",
|
|
83
133
|
"description": "Don't automatically upload to the mod portal in Publish"
|
|
84
134
|
},
|
|
135
|
+
"sync_portal_details": {
|
|
136
|
+
"type":"boolean",
|
|
137
|
+
"description": "Automatically update mod details and gallery in Publish"
|
|
138
|
+
},
|
|
85
139
|
"scripts":{
|
|
86
140
|
"type":"object",
|
|
87
141
|
"description": "Additional scripts to run while packaging/publishing mods",
|