Releases: samualtnorman/hackmud-script-manager
Hackmud Script Manager 0.10
Fixed
- no longer breaks scripts that were already using quine cheats - this means this tool now really lets you drop any script in for minification with 0 modifications necessary
Changed
- made the error message a bit more relaxed when the detected sec level does not match the specified one (it will now only throw if it's lower)
hsm push
andhsm watch
now colours user's names with actual hackmud colours that appear in chat
Hackmud Script Manager 0.9
Added
- new
hsm golf
command for golfing a single file
Changed
- Generated declaration
- subscript args should be more accurate
- Logging from
hsm push
,hsm watch
, andhsm test
will now be more informative - script processing is now waayy more robust
- autcompletes are back (supports
@seclevel
comment tag again) - that feature from my old script processor where you could leave out the surrounding function body is back
- golfing is now ridiculously efficient with quine cheats
- fixed most bugs
- source length is back
- works out what the character count would be before minifying but after general processing (like typescript and inserting surrounding function body)
- autcompletes are back (supports
Added
@seclevel
comment tag for verifying seclevel of script- specifying seclevel in subscript is now optional
- swaps out
.protototype
and.__proto__
for index notation since scripts fail on upload otherwise - Support for Node 12 (the oldest currently supported node version)
Hackmud Script Manager 0.8.3
Fixed
hsm test
command andtest
function might be faster.- Optional subscript parameter not being optional.
- You should now always be able to declare types before the function in a script.
Hackmud Script Manager 0.8.2
Changed
- Player script declaration generator no longer exports anything.
- Instead it generates interfaces in a declared global scope.
Hackmud Script Manager 0.2.2
Made the subscript and db call detector more generic overall.
Also disabled the booleans_as_integers
option when minifying since I think that was causing some funk.
Hackmud Script Manager 0.2.1
Just a simple fix, no longer processes db and subscript calls over multiple lines.
Hackmud Script Manager 0.2
Biggest changes yet!
Command
Added
- More helpful help
- Proper TypeScript support!
Removed
build
,clear
,push-built
commands.- Characters saved log when using
push
command.
Fixed
push
command updates config now.- More errors related to config.
API
Overall, everything should be smarter.
Added
minifyScript
for in case you want to do the rest yourself.
Changed
- So many changes in this one that I will miss a lot.
pushBuilt
has been renamed topush
, and its parameters have changed.push
now directly pushes scripts from the src directorybuild has been merged into
push`.
Removed
- Removed original
push
function. - No more
build
orclear
functions.
Hackmud Script Manager 0.1.3
Just a simple fix that effects the API which effects the command.
Catches and logs error when minifying code.
Hackmud Script Manager 0.1.2
Hackmud Script Manager is an API now.
hackmud_env-tools
is being depreciated, and its functions have now been merged into this package
Command
For the command, not much has changed, just added some more helpful text when you use hsm clear
wrong, and may have fixed an error related to the config.
API
build
▸ build(target
: string, distPath
: string): Promise<{ minLength: number ; name: string ; oldLength: number }[]>
Defined in index.ts:69
Builds target file or files in target folder and dumps them in specified directory.
Parameters:
Name | Type | Description |
---|---|---|
target |
string | file or folder to be built |
distPath |
string | folder to dump built files |
Returns: Promise<{ minLength: number ; name: string ; oldLength: number }[]>
clear
▸ clear(target
: string, hackmudPath
: string, user
: string): Promise<{ pushedRemoved: number ; targetRemoved: number }>
Defined in index.ts:44
Deletes target file or files in target folder and equivalent in hackmud folder.
Parameters:
Name | Type | Description |
---|---|---|
target |
string | file or folder to be cleared |
hackmudPath |
string | hackmud directory |
user |
string | hackmud user to target |
Returns: Promise<{ pushedRemoved: number ; targetRemoved: number }>
pull
▸ pull(srcPath
: string, hackmudPath
: string, scriptName
: string): Promise<void>
Defined in index.ts:330
Copies script from hackmud to local source folder.
Parameters:
Name | Type | Description |
---|---|---|
srcPath |
string | path to folder containing source files |
hackmudPath |
string | path to hackmud directory |
scriptName |
string | script to pull in user.script format |
Returns: Promise<void>
push
▸ push(srcPath
: string, hackmudPath
: string, users
: string[], scripts
: string[], callback?
: undefined | (info: Info) => void): Promise<Info[]>
Defined in index.ts:220
Push a specific or all scripts to a specific or all users.
In source directory, scripts in folders will override scripts with same name for user with folder name.
e.g. foo/bar.js overrides other bar.js script just for user foo.
Parameters:
Name | Type | Description |
---|---|---|
srcPath |
string | path to folder containing source files |
hackmudPath |
string | path to hackmud directory |
users |
string[] | users to push to (pushes to all if empty) |
scripts |
string[] | scripts to push from (pushes from all if empty) |
callback? |
undefined | (info: Info) => void | function that's called after each script has been built and written |
Returns: Promise<Info[]>
pushBuilt
▸ pushBuilt(target
: string, hackmudPath
: string, user
: string): Promise<{ pushedCount: number = 1 }>
Defined in index.ts:13
Copies target file or files in target folder to hackmud folder.
Parameters:
Name | Type | Description |
---|---|---|
target |
string | file or folder to be pushed |
hackmudPath |
string | hackmud directory |
user |
string | hackmud user to target |
Returns: Promise<{ pushedCount: number = 1 }>
watch
▸ watch(srcPath
: string, hackmudPath
: string, users
: string[], scripts
: string[], onUpdate?
: undefined | (info: Info) => void): void
Defined in index.ts:101
Watches target file or folder for updates and builds and pushes updated file.
Parameters:
Name | Type | Description |
---|---|---|
srcPath |
string | path to folder containing source files |
hackmudPath |
string | path to hackmud directory |
users |
string[] | users to push to (pushes to all if empty) |
scripts |
string[] | scripts to push from (pushes from all if empty) |
onUpdate? |
undefined | (info: Info) => void | function that's called after each script has been built and written |
Returns: void
v0.1.1
Fixed
- Error when pulling a script that does not exist
- It now warns you.
- Version command actually works now
(Also updated to new hackmud_env-tools
version).