-
Notifications
You must be signed in to change notification settings - Fork 3
Pre release 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-rules.git cd archetypes-rules/
-
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-rules/archetypes-rules-1.1.0.tgz
Click/tap to view full
npm pack
output...npm notice npm notice 📦 [email protected] npm notice === Tarball Contents === npm notice 10.4kB package.json npm notice 5.6kB CHANGELOG.md npm notice 1.1kB LICENSE npm notice 28.5kB README.md npm notice 21.7kB dist/archetypes-rules.js npm notice === Tarball Details === npm notice name: archetypes-rules npm notice version: 1.1.0 npm notice filename: archetypes-rules-1.1.0.tgz npm notice package size: 15.9 kB npm notice unpacked size: 67.4 kB npm notice shasum: 3bfa34ba536ae0da9ad269be437b816666c8db33 npm notice integrity: sha512-uBVSNTpQopypQ[...]AEgNGpHoZIBUQ== npm notice total files: 5 npm notice archetypes-rules-1.1.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-rules/archetypes-rules-1.1.0.tgz
-
Start a Node.js REPL
node
-
Import/
require
the archetypes-rules module# version <= 1.2.0 const archetypesRules = require('archetypes-rules') # version >= 2.x const rules = require('@archetypes/rules')
-
Try stuff out!