hackmud-script-manager 0.21.2-6d8b74e → 0.21.2-8993a56

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
@@ -11,7 +11,6 @@ import { generateTypeDeclaration } from "../generateTypeDeclaration.js"
11
11
  import { pull } from "../pull.js"
12
12
  import { syncMacros } from "../syncMacros.js"
13
13
  import "@samual/lib/readDirectoryWithStats"
14
- import "path/posix"
15
14
  import "@samual/lib/copyFilePersistent"
16
15
  const formatOption = name => colourN(`-${1 == name.length ? "" : "-"}${name}`),
17
16
  options = new Map(),
@@ -64,7 +63,7 @@ if (process.version.startsWith("v21.")) {
64
63
  )
65
64
  }
66
65
  if ("v" == commands[0] || "version" == commands[0] || popOption("version", "v")?.value) {
67
- console.log("0.21.2-6d8b74e")
66
+ console.log("0.21.2-8993a56")
68
67
  process.exit()
69
68
  }
70
69
  let warnedDeprecatedEmitDtsAlias = !1
@@ -412,7 +411,7 @@ function logHelp() {
412
411
  default:
413
412
  console.log(
414
413
  colourS(
415
- `${colourJ("Hackmud Script Manager")}\n${colourN("Version") + colourS(": ") + colourV("0.21.2-6d8b74e")}\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.2-8993a56")}\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
415
  )
417
416
  )
418
417
  }
@@ -1,6 +1,5 @@
1
1
  import { readDirectoryWithStats } from "@samual/lib/readDirectoryWithStats"
2
2
  import { basename, resolve } from "path"
3
- import * as PathPosix from "path/posix"
4
3
  async function generateTypeDeclaration(sourceDirectory, hackmudPath) {
5
4
  const users = new Set()
6
5
  if (hackmudPath)
@@ -32,14 +31,14 @@ async function generateTypeDeclaration(sourceDirectory, hackmudPath) {
32
31
  }
33
32
  })
34
33
  )
35
- sourceDirectory = PathPosix.resolve(sourceDirectory)
36
34
  let o = ""
37
- for (const script of wildScripts) o += `type $${script}$ = typeof import("${sourceDirectory}/${script}").default\n`
35
+ for (const script of wildScripts)
36
+ o += `type $${script}$ = typeof import(${JSON.stringify(resolve(sourceDirectory, script))}).default\n`
38
37
  o += "\n"
39
38
  for (const user in allScripts) {
40
39
  const scripts = allScripts[user]
41
40
  for (const script of scripts)
42
- o += `type $${user}$${script}$ = typeof import("${sourceDirectory}/${user}/${script}").default\n`
41
+ o += `type $${user}$${script}$ = typeof import(${JSON.stringify(resolve(sourceDirectory, user, script))}).default\n`
43
42
  }
44
43
  o +=
45
44
  "\ntype ArrayRemoveFirst<A> = A extends [ infer FirstItem, ...infer Rest ] ? Rest : never\n\ntype Subscript<T extends (...args: any) => any> =\n\t(...args: ArrayRemoveFirst<Parameters<T>>) => ReturnType<T> | ScriptFailure\n\ntype WildFullsec = Record<string, () => ScriptFailure> & {\n"
package/index.js CHANGED
@@ -7,7 +7,6 @@ export { syncMacros } from "./syncMacros.js"
7
7
  export { watch } from "./watch.js"
8
8
  import "@samual/lib/readDirectoryWithStats"
9
9
  import "path"
10
- import "path/posix"
11
10
  import "@babel/generator"
12
11
  import "@babel/parser"
13
12
  import "@babel/plugin-proposal-decorators"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hackmud-script-manager",
3
- "version": "0.21.2-6d8b74e",
3
+ "version": "0.21.2-8993a56",
4
4
  "description": "Script manager for game hackmud, with minification, TypeScript support, and player script type definition generation.",
5
5
  "keywords": [
6
6
  "api",
package/watch.js CHANGED
@@ -9,7 +9,6 @@ import { extname, basename, resolve } from "path"
9
9
  import { supportedExtensions } from "./constants.js"
10
10
  import { generateTypeDeclaration } from "./generateTypeDeclaration.js"
11
11
  import { processScript } from "./processScript/index.js"
12
- import "path/posix"
13
12
  import "@babel/generator"
14
13
  import "@babel/parser"
15
14
  import "@babel/plugin-proposal-decorators"