hackmud-script-manager 0.21.1-e4d0877 → 0.21.1-ea9322a
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 +2 -2
- package/env.d.ts +10 -12
- package/package.json +1 -1
- package/processScript/index.js +2 -1
package/bin/hsm.js
CHANGED
@@ -64,7 +64,7 @@ if (process.version.startsWith("v21.")) {
|
|
64
64
|
)
|
65
65
|
}
|
66
66
|
if ("v" == commands[0] || "version" == commands[0] || popOption("version", "v")?.value) {
|
67
|
-
console.log("0.21.1-
|
67
|
+
console.log("0.21.1-ea9322a")
|
68
68
|
process.exit()
|
69
69
|
}
|
70
70
|
let warnedDeprecatedEmitDtsAlias = !1
|
@@ -412,7 +412,7 @@ function logHelp() {
|
|
412
412
|
default:
|
413
413
|
console.log(
|
414
414
|
colourS(
|
415
|
-
`${colourJ("Hackmud Script Manager")}\n${colourN("Version") + colourS(": ") + colourV("0.21.1-
|
415
|
+
`${colourJ("Hackmud Script Manager")}\n${colourN("Version") + colourS(": ") + colourV("0.21.1-ea9322a")}\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`
|
416
416
|
)
|
417
417
|
)
|
418
418
|
}
|
package/env.d.ts
CHANGED
@@ -699,7 +699,7 @@ type Nullsec = Lowsec & PlayerNullsec & {
|
|
699
699
|
// database
|
700
700
|
type MongoPrimitive = null | boolean | number | Date | string
|
701
701
|
type MongoValue = MongoPrimitive | MongoValue[] | MongoObject
|
702
|
-
type MongoObject = { [k: string]: MongoValue
|
702
|
+
type MongoObject = { [k: string]: MongoValue }
|
703
703
|
type MongoQueryValue = MongoPrimitive | MongoQueryValue[] | MongoQueryObject
|
704
704
|
|
705
705
|
type MongoQueryObject =
|
@@ -755,11 +755,16 @@ type MongoQuerySelector<T extends MongoValue> = Partial<
|
|
755
755
|
|
756
756
|
type MongoQuery<T extends MongoObject> = { [K in keyof T]?: T[K] | MongoQuerySelector<T[K]> } & { _id?: MongoId }
|
757
757
|
|
758
|
-
type
|
758
|
+
type MongoUpdateArrayOperatorUniversalModifiers<T> = { $each?: T extends [] ? T : T[] }
|
759
|
+
|
760
|
+
type MongoUpdateArrayOperatorModifiers<T> = MongoUpdateArrayOperatorUniversalModifiers<T> &
|
761
|
+
{ $position?: number, $slice?: number, $sort?: 1 | -1 }
|
762
|
+
|
763
|
+
type MongoUpdateCommand<T extends MongoObject> = Partial<{
|
759
764
|
/* Universal operators */
|
760
|
-
$set: Partial<Record<string
|
761
|
-
$setOnInsert: Partial<Record<string
|
762
|
-
$unset: Partial<Record<string, ""
|
765
|
+
$set: Partial<Record<(string & {}) | keyof T, MongoCommandValue>>
|
766
|
+
$setOnInsert: Partial<Record<(string & {}) | keyof T, MongoCommandValue>>
|
767
|
+
$unset: Partial<Record<(string & {}) | keyof T, "">>
|
763
768
|
|
764
769
|
$rename: Partial<Record<string, string> & { [key in keyof T]: string }>
|
765
770
|
|
@@ -792,13 +797,6 @@ type MongoUpdateOperators<T extends MongoObject> = Partial<{
|
|
792
797
|
$pullAll: Record<string, MongoCommandValue> & { [K in keyof T as T[K] extends [] ? K : never]?: T[K] }
|
793
798
|
}>
|
794
799
|
|
795
|
-
type MongoUpdateArrayOperatorUniversalModifiers<T> = { $each?: T extends [] ? T : T[] }
|
796
|
-
|
797
|
-
type MongoUpdateArrayOperatorModifiers<T> = MongoUpdateArrayOperatorUniversalModifiers<T> &
|
798
|
-
{ $position?: number, $slice?: number, $sort?: 1 | -1 }
|
799
|
-
|
800
|
-
type MongoUpdateCommand<Schema extends MongoObject> = MongoUpdateOperators<Schema>
|
801
|
-
|
802
800
|
type SortOrder = { [key: string]: 1 | -1 | SortOrder }
|
803
801
|
|
804
802
|
type Cursor<T> = {
|
package/package.json
CHANGED
package/processScript/index.js
CHANGED
@@ -210,7 +210,8 @@ async function processScript(
|
|
210
210
|
{
|
211
211
|
name: "hackmud-script-manager",
|
212
212
|
async transform(code, id) {
|
213
|
-
if (!id.includes("/node_modules/"))
|
213
|
+
if (id.startsWith("/") && !id.includes("/node_modules/"))
|
214
|
+
return (await preprocess(code, { uniqueId })).code
|
214
215
|
let program
|
215
216
|
traverse(parse(code, { sourceType: "module" }), {
|
216
217
|
Program(path) {
|