hackmud-script-manager 0.19.1-3712be4 → 0.19.1-49ea60d
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 +1 -1
 - package/bin/hsm.js +8 -7
 - package/env.d.ts +1657 -0
 - package/index.d.ts +2 -2
 - package/package.json +4 -1
 - package/processScript/index.d.ts +4 -3
 - package/processScript/index.js +7 -7
 - package/processScript/minify.d.ts +3 -3
 - package/processScript/preprocess.d.ts +5 -4
 - package/processScript/preprocess.js +2 -2
 - package/processScript/transform.d.ts +5 -3
 - package/processScript/transform.js +66 -38
 - package/push.d.ts +5 -5
 - package/push.js +83 -214
 - package/syncMacros.js +1 -1
 - package/watch.d.ts +3 -3
 - package/watch.js +8 -8
 
    
        package/README.md
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # Hackmud Script Manager
         
     | 
| 
       2 
2 
     | 
    
         
             
            Command made for [hackmud-environment](https://github.com/samualtnorman/hackmud-environment), which is a scripting environment for hackmud with minification, autocompletes / intellisense, and TypeScript support.
         
     | 
| 
       3 
3 
     | 
    
         | 
| 
       4 
     | 
    
         
            -
            Install with `npm install hackmud-script-manager 
     | 
| 
      
 4 
     | 
    
         
            +
            Install with `npm install -g hackmud-script-manager` to make the `hsm` command available everywhere.
         
     | 
| 
       5 
5 
     | 
    
         | 
| 
       6 
6 
     | 
    
         
             
            ## Features
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Minification
         
     | 
    
        package/bin/hsm.js
    CHANGED
    
    | 
         @@ -12,7 +12,7 @@ import { pull } from "../pull.js" 
     | 
|
| 
       12 
12 
     | 
    
         
             
            import { syncMacros } from "../syncMacros.js"
         
     | 
| 
       13 
13 
     | 
    
         
             
            import "@samual/lib/readDirectoryWithStats"
         
     | 
| 
       14 
14 
     | 
    
         
             
            import "@samual/lib/copyFilePersistent"
         
     | 
| 
       15 
     | 
    
         
            -
            const version = "0.19.1- 
     | 
| 
      
 15 
     | 
    
         
            +
            const version = "0.19.1-49ea60d",
         
     | 
| 
       16 
16 
     | 
    
         
             
            	options = new Map(),
         
     | 
| 
       17 
17 
     | 
    
         
             
            	commands = [],
         
     | 
| 
       18 
18 
     | 
    
         
             
            	userColours = new Cache(user => {
         
     | 
| 
         @@ -280,7 +280,7 @@ switch (commands[0]) { 
     | 
|
| 
       280 
280 
     | 
    
         
             
            				scriptUser =
         
     | 
| 
       281 
281 
     | 
    
         
             
            					"scripts" == basename(resolve(target, "..")) && "hackmud" == basename(resolve(target, "../../..")) ?
         
     | 
| 
       282 
282 
     | 
    
         
             
            						basename(resolve(target, "../.."))
         
     | 
| 
       283 
     | 
    
         
            -
            					:	 
     | 
| 
      
 283 
     | 
    
         
            +
            					:	void 0,
         
     | 
| 
       284 
284 
     | 
    
         
             
            				optionsHasNoMinify = options.has("no-minify")
         
     | 
| 
       285 
285 
     | 
    
         
             
            			if ((optionsHasNoMinify || options.has("skip-minify")) && options.has("mangle-names")) {
         
     | 
| 
       286 
286 
     | 
    
         
             
            				logError(
         
     | 
| 
         @@ -316,7 +316,7 @@ switch (commands[0]) { 
     | 
|
| 
       316 
316 
     | 
    
         
             
            					: fileBaseName + ".js"
         
     | 
| 
       317 
317 
     | 
    
         
             
            				)
         
     | 
| 
       318 
318 
     | 
    
         
             
            			const golfFile = () =>
         
     | 
| 
       319 
     | 
    
         
            -
            				readFile(target, { encoding: " 
     | 
| 
      
 319 
     | 
    
         
            +
            				readFile(target, { encoding: "utf8" }).then(async source => {
         
     | 
| 
       320 
320 
     | 
    
         
             
            					const timeStart = performance.now(),
         
     | 
| 
       321 
321 
     | 
    
         
             
            						{ script, warnings } = await processScript(source, {
         
     | 
| 
       322 
322 
     | 
    
         
             
            							minify: !(options.get("no-minify") || options.get("skip-minify")),
         
     | 
| 
         @@ -410,11 +410,12 @@ function logHelp() { 
     | 
|
| 
       410 
410 
     | 
    
         
             
            			)
         
     | 
| 
       411 
411 
     | 
    
         
             
            	}
         
     | 
| 
       412 
412 
     | 
    
         
             
            }
         
     | 
| 
       413 
     | 
    
         
            -
            function logInfo({  
     | 
| 
      
 413 
     | 
    
         
            +
            function logInfo({ path, users, characterCount, error }, hackmudPath) {
         
     | 
| 
      
 414 
     | 
    
         
            +
            	path = relative(".", path)
         
     | 
| 
       414 
415 
     | 
    
         
             
            	error ?
         
     | 
| 
       415 
     | 
    
         
            -
            		logError(` 
     | 
| 
       416 
     | 
    
         
            -
            	:	 
     | 
| 
       417 
     | 
    
         
            -
            			` 
     | 
| 
      
 416 
     | 
    
         
            +
            		logError(`Error "${chalk.bold(error.message)}" in ${chalk.bold(path)}`)
         
     | 
| 
      
 417 
     | 
    
         
            +
            	:	log(
         
     | 
| 
      
 418 
     | 
    
         
            +
            			`Pushed ${chalk.bold(path)} to ${users.map(user => chalk.bold(userColours.get(user))).join(", ")} | ${chalk.bold(characterCount + "")} chars | ${chalk.bold(resolve(hackmudPath, users[0], "scripts", basename(path, extname(path))) + ".js")}`
         
     | 
| 
       418 
419 
     | 
    
         
             
            		)
         
     | 
| 
       419 
420 
     | 
    
         
             
            }
         
     | 
| 
       420 
421 
     | 
    
         
             
            function logError(message) {
         
     |