hackmud-script-manager 0.21.1-d4bf990 → 0.21.1-e0cdb53

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 CHANGED
@@ -63,7 +63,7 @@ if (process.version.startsWith("v21.")) {
63
63
  )
64
64
  }
65
65
  if ("v" == commands[0] || "version" == commands[0] || popOption("version", "v")?.value) {
66
- console.log("0.21.1-d4bf990")
66
+ console.log("0.21.1-e0cdb53")
67
67
  process.exit()
68
68
  }
69
69
  let warnedDeprecatedEmitDtsAlias = !1
@@ -411,7 +411,7 @@ function logHelp() {
411
411
  default:
412
412
  console.log(
413
413
  colourS(
414
- `${colourJ("Hackmud Script Manager")}\n${colourN("Version") + colourS(": ") + colourV("0.21.1-d4bf990")}\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`
414
+ `${colourJ("Hackmud Script Manager")}\n${colourN("Version") + colourS(": ") + colourV("0.21.1-e0cdb53")}\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`
415
415
  )
416
416
  )
417
417
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hackmud-script-manager",
3
- "version": "0.21.1-d4bf990",
3
+ "version": "0.21.1-e0cdb53",
4
4
  "description": "Script manager for game hackmud, with minification, TypeScript support, and player script type definition generation.",
5
5
  "keywords": [
6
6
  "api",
@@ -1,21 +1,21 @@
1
- import awpz3osbzbgie0diqla53jdp from "@babel/generator"
1
+ import kw4mqitfesprjelxpcglr7bo from "@babel/generator"
2
2
  import { parse } from "@babel/parser"
3
- import n7j5rk65x3x68f0977sx3p32 from "@babel/plugin-proposal-decorators"
4
- import ta0frirmi3s2jq08l6cht3uk from "@babel/plugin-proposal-destructuring-private"
5
- import k3l88m4rzomnxi1nyaws0uf4 from "@babel/plugin-proposal-explicit-resource-management"
6
- import d8vrbov1hvzild8irq5ej6a5 from "@babel/plugin-transform-class-properties"
7
- import yluenyq31jclk2gspvfqqhdw from "@babel/plugin-transform-class-static-block"
8
- import s83tktwy1wj5yii2modwcpsu from "@babel/plugin-transform-exponentiation-operator"
9
- import gjxa6uc9geesg3fse9p6nz2t from "@babel/plugin-transform-json-strings"
10
- import hpo770a0fczabe5gqnfx5zuh from "@babel/plugin-transform-logical-assignment-operators"
11
- import kzbxvgtuqrrh91fwlvcsrheu from "@babel/plugin-transform-nullish-coalescing-operator"
12
- import meo269rn6bx4ct4wluvbjqan from "@babel/plugin-transform-numeric-separator"
13
- import o997fnadhqb0j0fcvivsfr58 from "@babel/plugin-transform-object-rest-spread"
14
- import sy7mwdqgoccmlrptsvyavb2g from "@babel/plugin-transform-optional-catch-binding"
15
- import ylulmkigu6sywpswowfw2ont from "@babel/plugin-transform-optional-chaining"
16
- import apo7v29f7l9cy104xqjwyavh from "@babel/plugin-transform-private-property-in-object"
17
- import e4n14nj86a5rtu8hkil6ioxe from "@babel/plugin-transform-unicode-sets-regex"
18
- import ons4yi64j2vp9u6vpqkt1emx from "@babel/traverse"
3
+ import n6kwtvbshu6z08m7n6ppve8v from "@babel/plugin-proposal-decorators"
4
+ import katyembxa4zjuk4ago5fe1wf from "@babel/plugin-proposal-destructuring-private"
5
+ import j48vn9jptsm0bh1b5qq7hjzn from "@babel/plugin-proposal-explicit-resource-management"
6
+ import d0sdeyxfpsn92quhb3ke0qtk from "@babel/plugin-transform-class-properties"
7
+ import obublfgsyh6qk69criue3f5c from "@babel/plugin-transform-class-static-block"
8
+ import zm73tzx4bbqdbpkbdp07vjw2 from "@babel/plugin-transform-exponentiation-operator"
9
+ import vddkn7yd5uxy2n5yjs0h6mx0 from "@babel/plugin-transform-json-strings"
10
+ import hhxv6gfrar2wfcukgwjk35g3 from "@babel/plugin-transform-logical-assignment-operators"
11
+ import c1rkpstkzooqen8we55xsro4 from "@babel/plugin-transform-nullish-coalescing-operator"
12
+ import aivwzpktux86j66kkia8n2wj from "@babel/plugin-transform-numeric-separator"
13
+ import zwqleized0bxqeq0klje5t4c from "@babel/plugin-transform-object-rest-spread"
14
+ import qpw7zzdqe5f2f6f851b08o42 from "@babel/plugin-transform-optional-catch-binding"
15
+ import f2jhxfh87voqygi08j2u6xh1 from "@babel/plugin-transform-optional-chaining"
16
+ import ymyx3h3zb0h762jn089d94hz from "@babel/plugin-transform-private-property-in-object"
17
+ import kuyjrgf5jx9tw5o8f7vvtd0h from "@babel/plugin-transform-unicode-sets-regex"
18
+ import x7nkcgsxzau27g4gq6kmxlmn from "@babel/traverse"
19
19
  import t from "@babel/types"
20
20
  import rollupPluginAlias from "@rollup/plugin-alias"
21
21
  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 = awpz3osbzbgie0diqla53jdp.default,
42
- babelPluginProposalDecorators = n7j5rk65x3x68f0977sx3p32.default,
43
- babelPluginProposalDestructuringPrivate = ta0frirmi3s2jq08l6cht3uk.default,
44
- babelPluginProposalExplicitResourceManagement = k3l88m4rzomnxi1nyaws0uf4.default,
45
- babelPluginTransformClassProperties = d8vrbov1hvzild8irq5ej6a5.default,
46
- babelPluginTransformClassStaticBlock = yluenyq31jclk2gspvfqqhdw.default,
47
- babelPluginTransformExponentiationOperator = s83tktwy1wj5yii2modwcpsu.default,
48
- babelPluginTransformJsonStrings = gjxa6uc9geesg3fse9p6nz2t.default,
49
- babelPluginTransformLogicalAssignmentOperators = hpo770a0fczabe5gqnfx5zuh.default,
50
- babelPluginTransformNullishCoalescingOperator = kzbxvgtuqrrh91fwlvcsrheu.default,
51
- babelPluginTransformNumericSeparator = meo269rn6bx4ct4wluvbjqan.default,
52
- babelPluginTransformObjectRestSpread = o997fnadhqb0j0fcvivsfr58.default,
53
- babelPluginTransformOptionalCatchBinding = sy7mwdqgoccmlrptsvyavb2g.default,
54
- babelPluginTransformOptionalChaining = ylulmkigu6sywpswowfw2ont.default,
55
- babelPluginTransformPrivatePropertyInObject = apo7v29f7l9cy104xqjwyavh.default,
56
- babelPluginTransformUnicodeSetsRegex = e4n14nj86a5rtu8hkil6ioxe.default,
57
- traverse = ons4yi64j2vp9u6vpqkt1emx.default,
41
+ const generate = kw4mqitfesprjelxpcglr7bo.default,
42
+ babelPluginProposalDecorators = n6kwtvbshu6z08m7n6ppve8v.default,
43
+ babelPluginProposalDestructuringPrivate = katyembxa4zjuk4ago5fe1wf.default,
44
+ babelPluginProposalExplicitResourceManagement = j48vn9jptsm0bh1b5qq7hjzn.default,
45
+ babelPluginTransformClassProperties = d0sdeyxfpsn92quhb3ke0qtk.default,
46
+ babelPluginTransformClassStaticBlock = obublfgsyh6qk69criue3f5c.default,
47
+ babelPluginTransformExponentiationOperator = zm73tzx4bbqdbpkbdp07vjw2.default,
48
+ babelPluginTransformJsonStrings = vddkn7yd5uxy2n5yjs0h6mx0.default,
49
+ babelPluginTransformLogicalAssignmentOperators = hhxv6gfrar2wfcukgwjk35g3.default,
50
+ babelPluginTransformNullishCoalescingOperator = c1rkpstkzooqen8we55xsro4.default,
51
+ babelPluginTransformNumericSeparator = aivwzpktux86j66kkia8n2wj.default,
52
+ babelPluginTransformObjectRestSpread = zwqleized0bxqeq0klje5t4c.default,
53
+ babelPluginTransformOptionalCatchBinding = qpw7zzdqe5f2f6f851b08o42.default,
54
+ babelPluginTransformOptionalChaining = f2jhxfh87voqygi08j2u6xh1.default,
55
+ babelPluginTransformPrivatePropertyInObject = ymyx3h3zb0h762jn089d94hz.default,
56
+ babelPluginTransformUnicodeSetsRegex = kuyjrgf5jx9tw5o8f7vvtd0h.default,
57
+ traverse = x7nkcgsxzau27g4gq6kmxlmn.default,
58
58
  { format } = prettier
59
59
  async function processScript(
60
60
  code,
@@ -1,5 +1,5 @@
1
- import awpz3osbzbgie0diqla53jdp from "@babel/generator"
2
- import ons4yi64j2vp9u6vpqkt1emx from "@babel/traverse"
1
+ import kw4mqitfesprjelxpcglr7bo from "@babel/generator"
2
+ import x7nkcgsxzau27g4gq6kmxlmn 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 = awpz3osbzbgie0diqla53jdp.default,
11
- traverse = ons4yi64j2vp9u6vpqkt1emx.default,
10
+ const generate = kw4mqitfesprjelxpcglr7bo.default,
11
+ traverse = x7nkcgsxzau27g4gq6kmxlmn.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 awpz3osbzbgie0diqla53jdp from "@babel/generator"
1
+ import kw4mqitfesprjelxpcglr7bo from "@babel/generator"
2
2
  import { parse } from "@babel/parser"
3
- import ons4yi64j2vp9u6vpqkt1emx from "@babel/traverse"
3
+ import x7nkcgsxzau27g4gq6kmxlmn 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 = awpz3osbzbgie0diqla53jdp.default,
9
- traverse = ons4yi64j2vp9u6vpqkt1emx.default
8
+ const generate = kw4mqitfesprjelxpcglr7bo.default,
9
+ traverse = x7nkcgsxzau27g4gq6kmxlmn.default
10
10
  async function preprocess(code, { uniqueId = "00000000000" } = {}) {
11
11
  assert(/^\w{11}$/.test(uniqueId), "src/processScript/preprocess.ts:18:36")
12
12
  const sourceCode = code
@@ -1,10 +1,10 @@
1
- import ons4yi64j2vp9u6vpqkt1emx from "@babel/traverse"
1
+ import x7nkcgsxzau27g4gq6kmxlmn 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 = ons4yi64j2vp9u6vpqkt1emx.default,
7
+ const traverse = x7nkcgsxzau27g4gq6kmxlmn.default,
8
8
  globalFunctionsUnder7Characters = [
9
9
  "Map",
10
10
  "Set",
@@ -723,17 +723,7 @@ function transform(file, sourceCode, { uniqueId = "00000000000", scriptUser, scr
723
723
  !parent.superClass && thisIsReferenced && (parent.superClass = t.identifier("Object"))
724
724
  },
725
725
  VariableDeclaration({ node: variableDeclaration }) {
726
- if ("const" == variableDeclaration.kind) {
727
- variableDeclaration.kind = "let"
728
- variableDeclaration.extra = { ...variableDeclaration.extra, usedToBeConst: !0 }
729
- }
730
- },
731
- AssignmentExpression({ node: assignment, scope }) {
732
- const lhs = assignment.left
733
- if ("Identifier" != lhs.type) return
734
- const binding = scope.getBinding(lhs.name)
735
- if (binding?.path?.parentPath?.node?.extra?.usedToBeConst)
736
- throw Error(`Reassignment to const variable ${lhs.name} is not allowed!`)
726
+ "const" == variableDeclaration.kind && (variableDeclaration.kind = "let")
737
727
  },
738
728
  ThisExpression: path => {
739
729
  path.replaceWith(t.identifier("undefined"))
@@ -759,23 +749,23 @@ function transform(file, sourceCode, { uniqueId = "00000000000", scriptUser, scr
759
749
  }
760
750
  function processFakeSubscriptObject(fakeSubscriptObjectName, seclevel) {
761
751
  for (const referencePath of getReferencePathsToGlobal(fakeSubscriptObjectName, program)) {
762
- assert("MemberExpression" == referencePath.parent.type, "src/processScript/transform.ts:928:60")
752
+ assert("MemberExpression" == referencePath.parent.type, "src/processScript/transform.ts:914:60")
763
753
  assert("Identifier" == referencePath.parent.property.type)
764
754
  assert(
765
755
  "MemberExpression" == referencePath.parentPath.parentPath?.node.type,
766
- "src/processScript/transform.ts:930:81"
756
+ "src/processScript/transform.ts:916:81"
767
757
  )
768
758
  assert(
769
759
  "Identifier" == referencePath.parentPath.parentPath.node.property.type,
770
- "src/processScript/transform.ts:931:83"
760
+ "src/processScript/transform.ts:917:83"
771
761
  )
772
762
  assert(
773
763
  /^[_a-z][\d_a-z]{0,24}$/.test(referencePath.parent.property.name),
774
- `src/processScript/transform.ts:935:8 invalid user "${referencePath.parent.property.name}" in subscript`
764
+ `src/processScript/transform.ts:921:8 invalid user "${referencePath.parent.property.name}" in subscript`
775
765
  )
776
766
  assert(
777
767
  /^[_a-z][\d_a-z]{0,24}$/.test(referencePath.parentPath.parentPath.node.property.name),
778
- `src/processScript/transform.ts:940:8 invalid script name "${referencePath.parentPath.parentPath.node.property.name}" in subscript`
768
+ `src/processScript/transform.ts:926:8 invalid script name "${referencePath.parentPath.parentPath.node.property.name}" in subscript`
779
769
  )
780
770
  if ("CallExpression" == referencePath.parentPath.parentPath.parentPath?.type)
781
771
  referencePath.parentPath.parentPath.replaceWith(