hackmud-script-manager 0.20.5-97101bc → 0.21.1-0b2f476
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/README.md +7 -6
- package/bin/hsm.js +302 -262
- package/env.d.ts +364 -275
- package/generateTypeDeclaration.js +2 -1
- package/index.d.ts +3 -0
- package/index.js +3 -1
- package/package.json +39 -38
- package/processScript/index.d.ts +2 -2
- package/processScript/index.js +14 -11
- package/processScript/minify.js +11 -17
- package/processScript/postprocess.d.ts +1 -1
- package/processScript/postprocess.js +3 -3
- package/processScript/preprocess.js +7 -5
- package/processScript/transform.d.ts +3 -0
- package/processScript/transform.js +115 -97
- package/push.d.ts +10 -1
- package/push.js +40 -18
- package/watch.d.ts +2 -1
- package/watch.js +32 -29
package/README.md
CHANGED
@@ -12,7 +12,7 @@ You can read about how HSM works [in my blog post](https://samual.uk/blog/js-cod
|
|
12
12
|
## Usage
|
13
13
|
1. Run `#dir` in game, then `cd` to that folder
|
14
14
|
2. Name your source script file to `<name>.src.js`
|
15
|
-
3. Run `hsm
|
15
|
+
3. Run `hsm minify <name>.src.js` and it will create a minified script file called `<name>.js`
|
16
16
|
|
17
17
|
> **NOTE:** If you get an error message that looks like this:
|
18
18
|
> ```
|
@@ -20,6 +20,10 @@ You can read about how HSM works [in my blog post](https://samual.uk/blog/js-cod
|
|
20
20
|
> ```
|
21
21
|
> You will need to run `Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser` in PowerShell as an administrator. For more information, see [Microsoft's page about Execution Policies](https://learn.microsoft.com/en-gb/powershell/module/microsoft.powershell.core/about/about_execution_policies?view=powershell-7.4).
|
22
22
|
|
23
|
+

|
24
|
+

|
25
|
+

|
26
|
+
|
23
27
|
## Features
|
24
28
|
- Minification
|
25
29
|
- This includes auto quine cheating.
|
@@ -50,15 +54,12 @@ You can read about how HSM works [in my blog post](https://samual.uk/blog/js-cod
|
|
50
54
|
- `_BUILD_DATE` is replaced with a unix timestamp (`Date.now()`) of the build date of the script.
|
51
55
|
- `_SCRIPT_USER` is replaced with a string of the user the script was pushed to.
|
52
56
|
- This saves characters compared to `context.this_script.split(".")[0]`.
|
53
|
-
- `
|
57
|
+
- `_SCRIPT_SUBNAME` is like `_SCRIPT_USER` but for the name of the script.
|
54
58
|
- Saves characters compared to `context.this_script.split(".")[1]`.
|
55
|
-
- `_FULL_SCRIPT_NAME` is replaced with what would be `context.this_script`.
|
56
|
-
- `#s.` can be used and it'll automatically have the seclevel inserted.
|
59
|
+
- `_FULL_SCRIPT_NAME` is replaced with what would be in `context.this_script`.
|
57
60
|
- Subscript and `#db` methods names are verified.
|
58
61
|
- All references to preprocessor syntax functions not being called are turned into arrow function wrappers e.g. `let debug = #D;` -> `let debug = v => #D(v);`.
|
59
62
|
- `_SECLEVEL` is replaced with a number (`0` to `4`) representing the seclevel of the script.
|
60
|
-
- When `export`s are present in the script, it becomes a script that returns an object of the `export`ed values.
|
61
|
-
- `_EXPORTS` becomes an array of the names of the exported values.
|
62
63
|
- And Neat Weird Fixes
|
63
64
|
- Like `.__proto__` and `.prototype` being converted to `["__proto__"]` and `["prototype"]`.
|
64
65
|
- Illegal and unsafe strings.
|