hackmud-script-manager 0.21.1-591fafe → 0.21.1-628a731
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/bin/hsm.js +5 -20
- package/package.json +1 -1
- package/processScript/index.js +34 -34
- package/processScript/minify.js +4 -4
- package/processScript/preprocess.js +4 -4
- package/processScript/transform.js +2 -2
package/bin/hsm.js
CHANGED
@@ -14,8 +14,6 @@ import "@samual/lib/readDirectoryWithStats"
|
|
14
14
|
import "@samual/lib/copyFilePersistent"
|
15
15
|
const options = new Map(),
|
16
16
|
commands = []
|
17
|
-
let didParseOption = !1,
|
18
|
-
didParseOptionAfterCommand = !1
|
19
17
|
for (const argument of process.argv.slice(2))
|
20
18
|
if ("-" == argument[0]) {
|
21
19
|
const argumentEqualsIndex = argument.indexOf("=")
|
@@ -30,11 +28,7 @@ for (const argument of process.argv.slice(2))
|
|
30
28
|
}
|
31
29
|
if ("-" == argument[1]) options.set(key.slice(2), value)
|
32
30
|
else for (const option of key.slice(1)) options.set(option, value)
|
33
|
-
|
34
|
-
} else {
|
35
|
-
didParseOption && (didParseOptionAfterCommand = !0)
|
36
|
-
commands.push(argument)
|
37
|
-
}
|
31
|
+
} else commands.push(argument)
|
38
32
|
const pushModule = import("../push.js"),
|
39
33
|
processScriptModule = import("../processScript/index.js"),
|
40
34
|
watchModule = import("../watch.js"),
|
@@ -60,15 +54,6 @@ const pushModule = import("../push.js"),
|
|
60
54
|
return [colourJ, colourK, colourM, colourW, colourL, colourB][hash % 6](user)
|
61
55
|
}),
|
62
56
|
log = message => console.log(colourS(message))
|
63
|
-
if (didParseOptionAfterCommand) {
|
64
|
-
process.exitCode = 1
|
65
|
-
console.warn(
|
66
|
-
colourF(
|
67
|
-
chalk.bold("Warning:") +
|
68
|
-
" Options should come after commands when calling the script.\n This warning will become an error in the next minor version of HSM."
|
69
|
-
)
|
70
|
-
)
|
71
|
-
}
|
72
57
|
if (process.version.startsWith("v21.")) {
|
73
58
|
process.exitCode = 1
|
74
59
|
console.warn(
|
@@ -78,7 +63,7 @@ if (process.version.startsWith("v21.")) {
|
|
78
63
|
)
|
79
64
|
}
|
80
65
|
if ("v" == commands[0] || "version" == commands[0] || popOption("version", "v")?.value) {
|
81
|
-
console.log("0.21.1-
|
66
|
+
console.log("0.21.1-628a731")
|
82
67
|
process.exit()
|
83
68
|
}
|
84
69
|
let warnedDeprecatedEmitDtsAlias = !1
|
@@ -263,7 +248,7 @@ switch (commands[0]) {
|
|
263
248
|
const typeDeclaration = await generateTypeDeclaration(sourcePath, hackmudPath)
|
264
249
|
declarationPathPromise = writeFile(typeDeclarationPath, typeDeclaration)
|
265
250
|
.catch(error => {
|
266
|
-
assert(error instanceof Error, "src/bin/hsm.ts:
|
251
|
+
assert(error instanceof Error, "src/bin/hsm.ts:300:38")
|
267
252
|
if ("EISDIR" != error.code) throw error
|
268
253
|
typeDeclarationPath = resolve(typeDeclarationPath, "player.d.ts")
|
269
254
|
return writeFile(typeDeclarationPath, typeDeclaration)
|
@@ -345,7 +330,7 @@ switch (commands[0]) {
|
|
345
330
|
typeDeclaration = await generateTypeDeclaration(sourcePath, hackmudPath)
|
346
331
|
let typeDeclarationPath = resolve(outputPath)
|
347
332
|
await writeFile(typeDeclarationPath, typeDeclaration).catch(error => {
|
348
|
-
assert(error instanceof Error, "src/bin/hsm.ts:
|
333
|
+
assert(error instanceof Error, "src/bin/hsm.ts:444:35")
|
349
334
|
if ("EISDIR" != error.code) throw error
|
350
335
|
typeDeclarationPath = resolve(typeDeclarationPath, "player.d.ts")
|
351
336
|
return writeFile(typeDeclarationPath, typeDeclaration)
|
@@ -418,7 +403,7 @@ function logHelp() {
|
|
418
403
|
default:
|
419
404
|
console.log(
|
420
405
|
colourS(
|
421
|
-
`${colourJ("Hackmud Script Manager")}\n${colourN("Version") + colourS(": ") + colourV("0.21.1-
|
406
|
+
`${colourJ("Hackmud Script Manager")}\n${colourN("Version") + colourS(": ") + colourV("0.21.1-628a731")}\n\n${colourA("Commands:")}\n${colourL("push")}\n ${pushCommandDescription}\n${colourL("minify")}\n Minify a script file on the spot\n${colourL("emit-dts")}\n Generate a type declaration file for a directory of scripts\n${colourL("sync-macros")}\n Sync macros across all hackmud users\n${colourL("pull")}\n Pull a script a from a hackmud user's script directory\n\n${colourA("Options:")}\n${colourN("--help")}\n Can be used on any command e.g. ${colourC("hsm")} ${colourL("push")} ${colourN("--help")} to show helpful information`
|
422
407
|
)
|
423
408
|
)
|
424
409
|
}
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "hackmud-script-manager",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.21.1-
|
4
|
+
"version": "0.21.1-628a731",
|
5
5
|
"description": "Script manager for game hackmud, with minification, TypeScript support, and player script type definition generation.",
|
6
6
|
"author": "Samual Norman <me@samual.uk> (https://samual.uk/)",
|
7
7
|
"contributors": [
|
package/processScript/index.js
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
import { relative, isAbsolute, sep } from "path"
|
2
|
-
import
|
2
|
+
import aebzhxabshj61x7158qbcn2x from "@babel/generator"
|
3
3
|
import { parse } from "@babel/parser"
|
4
|
-
import
|
5
|
-
import
|
6
|
-
import
|
7
|
-
import
|
8
|
-
import
|
9
|
-
import
|
10
|
-
import
|
11
|
-
import
|
12
|
-
import
|
13
|
-
import
|
14
|
-
import
|
15
|
-
import
|
16
|
-
import
|
17
|
-
import
|
18
|
-
import
|
19
|
-
import
|
4
|
+
import s2ijmvl7wzm8x394g1t9hy8q from "@babel/plugin-proposal-decorators"
|
5
|
+
import ol4uaa84wjloic2wsoi6umo8 from "@babel/plugin-proposal-destructuring-private"
|
6
|
+
import cbsvdf0g10wznhaefq3xse17 from "@babel/plugin-proposal-explicit-resource-management"
|
7
|
+
import j07gcj286yuti7d039w8qp0u from "@babel/plugin-transform-class-properties"
|
8
|
+
import upwk5e6zb7t9muf3l9ti8udk from "@babel/plugin-transform-class-static-block"
|
9
|
+
import fpgic0shirjc7nvp6qxdbs8u from "@babel/plugin-transform-exponentiation-operator"
|
10
|
+
import f5ic1rjer9khd55x2hcf00m1 from "@babel/plugin-transform-json-strings"
|
11
|
+
import k1omyve9bniu90tg7tbjt9vk from "@babel/plugin-transform-logical-assignment-operators"
|
12
|
+
import yhl3lcharmsmfpq182cxrptq from "@babel/plugin-transform-nullish-coalescing-operator"
|
13
|
+
import mlyvai1hug0j9bjtom8lyrkp from "@babel/plugin-transform-numeric-separator"
|
14
|
+
import y62i7opsnlr2x3j4qu1ufsvv from "@babel/plugin-transform-object-rest-spread"
|
15
|
+
import n5vivjwibw69juzwbc941n4e from "@babel/plugin-transform-optional-catch-binding"
|
16
|
+
import tw1r15cx7xxc8faz7rt7jva9 from "@babel/plugin-transform-optional-chaining"
|
17
|
+
import ik82kk7qeg2vi4ycdwkqr0ws from "@babel/plugin-transform-private-property-in-object"
|
18
|
+
import ea48loi9ddodrbpp8w2ei0uh from "@babel/plugin-transform-unicode-sets-regex"
|
19
|
+
import lc792rc2i7ecp4gwhh6mo7ge from "@babel/traverse"
|
20
20
|
import t from "@babel/types"
|
21
21
|
import rollupPluginAlias from "@rollup/plugin-alias"
|
22
22
|
import { babel } from "@rollup/plugin-babel"
|
@@ -38,23 +38,23 @@ import "acorn"
|
|
38
38
|
import "terser"
|
39
39
|
import "import-meta-resolve"
|
40
40
|
import "@samual/lib/clearObject"
|
41
|
-
const generate =
|
42
|
-
babelPluginProposalDecorators =
|
43
|
-
babelPluginProposalDestructuringPrivate =
|
44
|
-
babelPluginProposalExplicitResourceManagement =
|
45
|
-
babelPluginTransformClassProperties =
|
46
|
-
babelPluginTransformClassStaticBlock =
|
47
|
-
babelPluginTransformExponentiationOperator =
|
48
|
-
babelPluginTransformJsonStrings =
|
49
|
-
babelPluginTransformLogicalAssignmentOperators =
|
50
|
-
babelPluginTransformNullishCoalescingOperator =
|
51
|
-
babelPluginTransformNumericSeparator =
|
52
|
-
babelPluginTransformObjectRestSpread =
|
53
|
-
babelPluginTransformOptionalCatchBinding =
|
54
|
-
babelPluginTransformOptionalChaining =
|
55
|
-
babelPluginTransformPrivatePropertyInObject =
|
56
|
-
babelPluginTransformUnicodeSetsRegex =
|
57
|
-
traverse =
|
41
|
+
const generate = aebzhxabshj61x7158qbcn2x.default,
|
42
|
+
babelPluginProposalDecorators = s2ijmvl7wzm8x394g1t9hy8q.default,
|
43
|
+
babelPluginProposalDestructuringPrivate = ol4uaa84wjloic2wsoi6umo8.default,
|
44
|
+
babelPluginProposalExplicitResourceManagement = cbsvdf0g10wznhaefq3xse17.default,
|
45
|
+
babelPluginTransformClassProperties = j07gcj286yuti7d039w8qp0u.default,
|
46
|
+
babelPluginTransformClassStaticBlock = upwk5e6zb7t9muf3l9ti8udk.default,
|
47
|
+
babelPluginTransformExponentiationOperator = fpgic0shirjc7nvp6qxdbs8u.default,
|
48
|
+
babelPluginTransformJsonStrings = f5ic1rjer9khd55x2hcf00m1.default,
|
49
|
+
babelPluginTransformLogicalAssignmentOperators = k1omyve9bniu90tg7tbjt9vk.default,
|
50
|
+
babelPluginTransformNullishCoalescingOperator = yhl3lcharmsmfpq182cxrptq.default,
|
51
|
+
babelPluginTransformNumericSeparator = mlyvai1hug0j9bjtom8lyrkp.default,
|
52
|
+
babelPluginTransformObjectRestSpread = y62i7opsnlr2x3j4qu1ufsvv.default,
|
53
|
+
babelPluginTransformOptionalCatchBinding = n5vivjwibw69juzwbc941n4e.default,
|
54
|
+
babelPluginTransformOptionalChaining = tw1r15cx7xxc8faz7rt7jva9.default,
|
55
|
+
babelPluginTransformPrivatePropertyInObject = ik82kk7qeg2vi4ycdwkqr0ws.default,
|
56
|
+
babelPluginTransformUnicodeSetsRegex = ea48loi9ddodrbpp8w2ei0uh.default,
|
57
|
+
traverse = lc792rc2i7ecp4gwhh6mo7ge.default,
|
58
58
|
{ format } = prettier
|
59
59
|
async function processScript(
|
60
60
|
code,
|
package/processScript/minify.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
import
|
2
|
-
import
|
1
|
+
import aebzhxabshj61x7158qbcn2x from "@babel/generator"
|
2
|
+
import lc792rc2i7ecp4gwhh6mo7ge from "@babel/traverse"
|
3
3
|
import t from "@babel/types"
|
4
4
|
import { assert } from "@samual/lib/assert"
|
5
5
|
import { countHackmudCharacters } from "@samual/lib/countHackmudCharacters"
|
@@ -7,8 +7,8 @@ import { spliceString } from "@samual/lib/spliceString"
|
|
7
7
|
import { tokenizer, tokTypes } from "acorn"
|
8
8
|
import * as terser from "terser"
|
9
9
|
import { getReferencePathsToGlobal, includesIllegalString, replaceUnsafeStrings } from "./shared.js"
|
10
|
-
const generate =
|
11
|
-
traverse =
|
10
|
+
const generate = aebzhxabshj61x7158qbcn2x.default,
|
11
|
+
traverse = lc792rc2i7ecp4gwhh6mo7ge.default,
|
12
12
|
minifyNumber = async number =>
|
13
13
|
/\$\((?<number>.+)\)/.exec((await terser.minify(`$(${number})`, { ecma: 2015 })).code).groups.number
|
14
14
|
async function minify(file, { uniqueId = "00000000000", mangleNames = !1, forceQuineCheats, autocomplete } = {}) {
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import
|
1
|
+
import aebzhxabshj61x7158qbcn2x from "@babel/generator"
|
2
2
|
import { parse } from "@babel/parser"
|
3
|
-
import
|
3
|
+
import lc792rc2i7ecp4gwhh6mo7ge from "@babel/traverse"
|
4
4
|
import t from "@babel/types"
|
5
5
|
import { assert } from "@samual/lib/assert"
|
6
6
|
import { spliceString } from "@samual/lib/spliceString"
|
7
7
|
import { resolve } from "import-meta-resolve"
|
8
|
-
const generate =
|
9
|
-
traverse =
|
8
|
+
const generate = aebzhxabshj61x7158qbcn2x.default,
|
9
|
+
traverse = lc792rc2i7ecp4gwhh6mo7ge.default
|
10
10
|
async function preprocess(code, { uniqueId = "00000000000" } = {}) {
|
11
11
|
assert(/^\w{11}$/.test(uniqueId), "src/processScript/preprocess.ts:20:36")
|
12
12
|
const sourceCode = code
|
@@ -1,10 +1,10 @@
|
|
1
|
-
import
|
1
|
+
import lc792rc2i7ecp4gwhh6mo7ge from "@babel/traverse"
|
2
2
|
import t from "@babel/types"
|
3
3
|
import { assert } from "@samual/lib/assert"
|
4
4
|
import { clearObject } from "@samual/lib/clearObject"
|
5
5
|
import { validDBMethods } from "../constants.js"
|
6
6
|
import { getReferencePathsToGlobal } from "./shared.js"
|
7
|
-
const traverse =
|
7
|
+
const traverse = lc792rc2i7ecp4gwhh6mo7ge.default,
|
8
8
|
globalFunctionsUnder7Characters = [
|
9
9
|
"Map",
|
10
10
|
"Set",
|