Total rewrite of the build script. There were some issues with the original I built, so I spent some time rewriting it into this. I've been testing it with my mods for a while now, and I believe I've ironed out all of the issues. I wanted to replace the old script before 3.7 dropped.
Notable Changes:
- Dropped the inline ignore array for a `.buildignore` file. The syntax of this file now exactly matches that of a `.gitignore` file.
- Dropped the `bestzip` package for `archiver`.
- Dropped all custom functions that handled file and directory ignoring for the `Ignore` package.
- Includes the `Winston` package for sexy logging.
- Changed any function that touches a file to run asynchronously.
- Changed the build process to use an OS temporary directory instead of creating one in the project directory.
- Added a verbose option to display which files ended up being copied and which were ignored for testing the `.buildignore` file.
- Changed the packaged mod to include the folder structure in which it must be installed: `/user/mods/mod-name-here`.
- Updated some README files to add some more information.
Closes issue #13
Co-authored-by: Refringe <brownelltyler@gmail.com>
Reviewed-on: #14
Co-authored-by: Refringe <refringe@noreply.dev.sp-tarkov.com>
Co-committed-by: Refringe <refringe@noreply.dev.sp-tarkov.com>
Move some code to new class `traderHelper`
More comments
Added example of constructing weapon from scratch
exposed trader update time as parameter instead of hard coding
Add additional example for adding singular item with different params
Added ability to add buy restrictions to items
This update removes the inline build scripts from the `package.json` file and replaces them with an external build script: `packageBuild.ts`. An external script allows for much more flexibility.
Along with the external script change, this PR updates a few other things:
- Moved from `copyfiles` to `fs-extra` for minor speed improvements.
- Generates the mod package name by using the `package.json` information. The format used is `Author-PackageName-Version`.
- Saves the compressed file in the `dist` folder.
- Saves the compressed file using the new mod package name.
- Compressed file now includes a root directory named after the mod package for easy copying to the user's `user/mods` game directory.