README
@artlabx/logo
Very simple NPM package that contains the artlab logo. Created to understand the process for building and deploying packages to https://www.npmjs.com/.
Usage
TBD. Ultimately need to determine what content is appropriate for installation by package consumers. For example, should they only have access to a /dist folder with the final compiled assets? What are the approprate package.json attributes to enforce this?
npmjs
Tips
A package is a file or directory that is described by a
package.jsonfile. A module is any file or directory (typically found in thenode_modulesdirectory) that can be loaded by the Noderequire()function. So the npm registry contains packages, many of which contain Node modules.A valid javascript file defined for
maininside of yourpackage.jsonallows for some additional functionality such asrequire.resolve()
Process
Scope is critical.
Account Setup
Create an organization within your account which serves as the scope (ie. @artlabx).
Within the organization there needs to be a team. npmjs adds a "developers" team by default.
Users must then be added to the team.
Teams must also be given read/write permissions on a package after its initial publication.
Publish
A valid npm user must be added to your .npmrc file.
# NOTE the scope
$ npm adduser --scope=@artlabx
Once added, publish can be executed. Setting --access public is only necessary on the initial publish.
$ npm publish --access public
When returning to publish again, simply log back in:
When dealing with scoped packages it is critical to flag as such during login.
$ npm login --scope=@artlabx
# login without scope
$ npm login
>> Logged in as illustr8r on https://registry.npmjs.org/.
# login without scope
$ npm login --scope=@artlabx
>> Logged in as illustr8r to scope @artlabx on https://registry.npmjs.org/.
New Version
Recommended sequence:
- Commit any outstanding stages
npm version ${update_type}npm publishgit pushgit push --tags
npm version ${update_type} stages git commit and creates a tag. Only need to execute git push and git push --tags.
# ${update_type} options = ["major", "minor", "patch"]
$ npm version ${update_type}