UNPKG

synchro

Version:
60 lines (34 loc) 2.94 kB
# synchro -- Synchro Command Line Interface Testing and Publishing Note: These instructions are for internal Synchro developers testing and then publishing to npmjs. To test the Synchro CLI from source, go to the top level Synchro CLI source directory and do: npm link This will create a global synchro command and symlinks back to the implementation in the source directory. You can now edit source in place and test that code by running “synchro” (in any directory). When you have a version you feel is ready to publish: Update the version number in package.json Generate a new npm-shrinkwrap.json (this will pick up the new version number, and any dependency changes): npm shrinkwrap Unlink/uninstall the dev source directory package: npm uninstall -g synchro (Note: Just doing npm unlink will remove the npm symlink to the project, but will not remove the top level “synchro” command symlink). To test installing and running CLI as it will be installed when published to npmjs and installed from there, we have a couple of options. 1) Install the local code globally (this will copy the code from the local directory and install it globally). In the source directory, do: npm install -g 2) Alternatively, you can create and install a package archive (this is closer to what npm publish / npm install does). In the source directory, do: npm pack npm install -g synchro-X.X.X.tgz The archive you make with pack, which will have been named using current version, is what you want to pass to install above. That archive should be equivalent to what will be published to npmjs when you publish later. You may inspect the archive if desired (to verify bundledDependencies, for example). Once you have installed the CLI globally, you can test by running “synchro” in any directory (and of course, testing various subcommands). When you are ready to publish: Note: first delete any archive created with npm pack (above) npm publish --tag test npm uninstall -g synchro npm install -g synchro@test This will publish the current version with the “dist tag” of “test”. That allows us to test installing it using that tag to make sure it works before making it available to the public via the “latest” tag. Once you are happy that the test install is working as desired, remove the “test" tag and promote the release to “latest", then test installing latest: npm dist-tag add synchro@X.X.X latest (Note: use the version number you published with the test tag earlier) npm dist-tag rm synchro test npm uninstall -g synchro npm install -g synchro You will now have the “latest” (and now public) release installed. Perform any desired final testing. When you are happy with the release and want to go back to developing, remove the global package and relink your dev code (from the dev directory): npm remove -g synchro npm link