Permalink
Fetching contributors…
Cannot retrieve contributors at this time
49 lines (36 sloc) 1.89 KB

Contributing

☁️ Getting Started

  1. Ensure NodeJS version 8.11.1 is installed.
  2. git clone https://github.com/JamieMason/ImageOptim-CLI.git.
  3. npm install.
  4. npm run lint.
  5. npm run build.

🔧 Technologies

OSX is automated using the AppleScript files in ./osascript/*.applescript and those scripts are called from NodeJS by ./src/applescript.ts.

ImageOptim-CLI is written in TypeScript and converted into a standalone executable using nexe so that NodeJS is not needed by its users. This is all handled by the npm run build command.

🚧 Developing Locally

Each time you make a change to the TypeScript or AppleScript, run npm run build to update the executable at ./dist/imageoptim. You can run your local executable from there:

./dist/imageoptim --help

🔬 Testing Before Release

  1. Run npm pack to create a tarball at ./imageoptim-cli-2.0.0.tgz, where 2.0.0 is whatever the current version is defined as in ./package.json.
  2. Run npm install -g ./imageoptim-cli-2.0.0.tgz to globally install the release candidate.
  3. npm ls -g --depth 0 will list your release candidate alongside your other global npm dependencies.
  4. imageoptim --help can be run as normal, the same way it will once published finally.
  5. Remember to run npm uninstall -g ./imageoptim-cli-2.0.0.tgz to remove your local release candidate afterwards.