Binstubs are just scripts that can be executed directly:
bin/test
as opposed tosh bin/test
- @brandondees
Imperative convenience scripts Used conjunctively to automate declarative actions. Could potentially be used on "User Land" applications in the near future.
The following script will clone repository and install developer dependencies
$ git clone https://github.com/devpunks/snuggsi.git
$ cd snuggsi && npm i
If you need support for windows file an issue with this link appended to description.
bin/
browse
bundle
compile
compress
cover
crank
deploy
distribute
integrate
lint
package
publish
serve
shrink
snuggsi
style
test
transpile
watch
weigh
$ bin/browse [root]
Executes the following step process (in parallel):
serve
- Launch BrowserSync
watch
root
- (optional) path to serve from/
(Defaults to.
current directory)
PORT
- Server port (Defaults to 3000)BROWSER_PORT
- Browser port (Defaults to next available port after serverPORT
i.e. 3001 whenPORT=3000
)
$ bin/bundle
Simple cat
script for appending standalone ECMASCript modules into a single file.
$ bin/compile
Compiles distribution into a tiny little file. Executes the following step process (in order of appearance):
$ bin/compress
Compression routine used for
Content-Encoding
negotiation.
Supports
brotli
(.br),
gzip
(.gz),
& deflate
(.zo)
Content Encoding tokens
$ bin/cover
Uses
nyc
$ bin/crank
Executes the following step process (in order of appearance):
$ bin/deploy
Pushes repository to Δ Vercel hosting service.
$ bin/distribute
Used to mark revisions of library upstream on Github and npm.
NOTE: A chronological CalVer strategy is used instead of SemVer.
- https://calver.org/overview.html
- https://github.com/mahmoud/calver
- https://docs.npmjs.com/cli/v6/using-npm/semver
- https://sedimental.org/designing_a_version.html
- https://en.wikipedia.org/wiki/Software_versioning
- Tex Versioning
- Difference between
LTS
andstable
- Building and testing Node.json
- Github Encrypted Secrets - https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets
- Publishing packages to npm directory from Github - https://docs.github.com/en/free-pro-team@latest/actions/guides/publishing-nodejs-packages#publishing-packages-to-the-npm-registry
- Push tags with commits - https://stackoverflow.com/q/3745135/push-git-commits-tags-simultaneously
Steps:
# Tools
npm edit <pkg>[/<subpkg>...]
npm explore some-dependency
npm test
# Pull Request version
npm version prerelease
# Automated Daily
# sign-git-tag to prevent infinite recursion
# ignore-scripts to prevent infinite recursion
npm version patch --tag=dev --sign-git-tag --ignore-scripts \
-m "⏰ %s CalVer Daily Patch Dev Release"
npm publish --tag=dev
git push origin main --tags
# Automated Monthly
git pull -r origin main
npm view
npm ls
npm outdated
npm install -g npm@latest
npm update --also=dev
npm prune
npm dedupe
npm link # https://docs.npmjs.com/cli/v6/commands/npm-link
npm rebuild
npm update
npm pack
npm issues # Github issues
npm bugs # Github issues
npm version minor --tag=latest -m "⏰ %s CalVer Monthly Minor Release"
npm publish --tag=latest
git push origin main --tags
# Automated Yearly
git pull -r origin main
npm whoami
npm owner
npm org devpunks ls
npm token
npm config
npm issues # Github issues
npm doctor
npm audit # Cleanup npm packages
npm ci
npm version major --tag=stable -m "⏰ %s CalVer Annual Major Release"
npm cache add <folder>
npm shrinkwrap # https://docs.npmjs.com/cli/v6/configuring-npm/package-locks
npm deprecate <pkg>[@<previous-year-version>] <message>
npm publish --tag=stable
git push origin main --tags
$ bin/integrate
Hook used for Travis CI continuous integration. This is typically ran after pushes to Github branches.
See .travis.yml for more details.
$ bin/lint [file]
Performs lint check on code in specified file.
Uses JSStandard
path
- (optional) Specific file to run lint check. (Defaults todist/snuggsi.es
)
$ bin/package
🚧 This algorithm will be implemented to minify distribution. (i.e. Tree Shaking)
- Packaging components
- Containerizing components
- Tree Shaking
- Dead Code Elemination
- MDN Tree Shaking
- Dead Code Elemination During Bundling
- Docker Containerization
- Dockerizing a Node.js Web App
$ bin/publish
Publishes static assets (i.e. examples, markup, styles, & scripts)
$ bin/serve [root]
Launches web server with root
as main entry point.
PORT
- Server port (Defaults to 80)
root
- (optional) path to serve from/
(Defaults to.
current directory)
$ bin/shrink
Run uglify-js
and uglify-es
along with minification
$ snuggsi [command]
Main entry point for snuggsi
CLI (Command Line Interface).
The help menu will display if no command is provided.
See list of optional commands above
NODE_PATH
- OverrideNODE_PATH
global location (See Loading from the global folders Node documentation)
$ bin/style [component-directory | style-file.{sss,css}]
Please see style#readme for details.
$ test [path]
Run test suite or specify an optional entry point to test.
path
- (optional) Specific test directory or file. (Defaults to run entire test suite)
$ bin/transpile [input] [output]
Run Buble for transpilation from ECMAScript to Javascript
input
- (optional) path (Defaults to dist/snuggsi.es)output
- (optional) path (Defaults to dist/snuggsi.js)
$ bin/watch [directory]
Watch base directory for changes to markup, styles, and scripts.
directory
- (optional) path to watch for changes (Defaults to current directory.
)
$ bin/weigh [library]
Routine to validate overall weight of library.
Validate snuggsi.min.es.br
is within
one Ethernet frame
(1500 OCTETS).
library
- (optional) path to watch for changes (Defaults todist/snuggsi.min.es.br
)