-
Notifications
You must be signed in to change notification settings - Fork 0
Prerelease test instructions
The last step in a Pull Request is to verify that a new feature or defect fix really works. 😄
Artifact repositories like NPM and JFrog ("OneArtifactory") store the Node.js distributions as *.tgz
"bundles. So whenever you run npm install cold-blooded-module
, the Node Package Manager sends a request to an artifact registry, which responds by downloading a bundled file (in this case cold-blooded-module.tgz
).
npm pack
lets you do the same thing on your local machine. And, instead of requesting a package using HTTPS, you can request a local package with a physical file path, e.g.:
npm i /path/to/your/local/npm/pack/distribution.tgz
Run the following instructions in a Terminal (command-line interface).
-
Clone the repo
git clone https://github.com/commonality/archetypes-quantity.git cd archetypes-quantity/
-
Checkout the topic branch you want to test.
# Example feature branch git checkout 10-feat-extend-object-variable
-
"Build" the distribution package.
Run:
npm run bundle
Sample output:
The last line will output the absolute path to the package, e.g.:
Package location: /path/to/local/repo/archetypes-quantity/archetypes-quantity-1.1.0.tgz
Click/tap to view full
npm pack
output...npm notice npm notice 📦 @archetypes/[email protected] npm notice === Tarball Contents === npm notice 1.4kB LICENSE npm notice 21.7kB dist/@archetypes/quantity.esm.js npm notice 34.9kB dist/@archetypes/quantity.js npm notice 739.7kB npm-shrinkwrap.json npm notice 8.1kB package.json npm notice 18.8kB README.md npm notice === Tarball Details === npm notice name: @archetypes/quantity npm notice version: 1.0.0 npm notice filename: archetypes-quantity-1.0.0.tgz npm notice package size: 184.0 kB npm notice unpacked size: 824.5 kB npm notice shasum: c743d5f8ef2d2e7790283ca4c48f516d4d687fec npm notice integrity: sha512-1LISGVzU1ODki[...]deiUKukOsFSLQ== npm notice total files: 6 npm notice archetypes-quantity-1.0.0.tgz
-
Copy the full path to the packaged module
# This works on MacOS (bash); dunno about PowerShell echo "$(pwd)/$(ls *.tgz)" | pbcopy
-
Create another directory somewhere else on your hard-drive:
mkdir -p /path/to/temp/test/directory/ && cd $_
-
Initialize with npm (the --yes argument accepts all defaults):
npm init --yes
-
Install your local package with npm
npm i /path/to/local/repo/archetypes-quantity/archetypes-quantity-1.1.0.tgz
-
Start a Node.js REPL
node
-
Import/
require
the archetypes-quantity moduleconst quantity = require('@archetypes/quantity') # OR import quantity from '@archetypes/quantity'
-
Try stuff out!