Skip to content

Latest commit

 

History

History

bin

binstubs

Binstubs are just scripts that can be executed directly: bin/test as opposed to sh bin/test - @brandondees

Imperative convenience scripts Used conjunctively to automate declarative actions. Could potentially be used on "User Land" applications in the near future.

⚠️ For internal use only (for the time being)

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.

Table of Contents

bin/

$ bin/browse [root]

Executes the following step process (in parallel):

  1. serve
  2. Launch BrowserSync
  3. watch

⚠️ See BrowserSync command line options for configuration documentation.

Arguments

  • root - (optional) path to serve from / (Defaults to . current directory)

Environment Options

  • PORT - Server port (Defaults to 3000)
  • BROWSER_PORT - Browser port (Defaults to next available port after server PORT i.e. 3001 when PORT=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):

⚠️ Process will halt & prevent further execution upon failures.

  1. bundle
  2. transpile
  3. shrink
  4. compress
$ 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): ⚠️ Build process will halt & prevent further execution upon failures.

  1. compile
  2. lint
  3. cover
  4. weigh
  5. distribute
  6. deploy
$ bin/deploy

Pushes repository to Δ Now 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.

References

Github Actions

Steps:

CalVer

Annual Major Release

git pull -r origin master
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 -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
npm version prepatch -m "⏰  %s Happy New Year !"
git push origin master --follow-tags

# Create a git release - https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#create-a-release--code-samples

Monthly Minor Release

# Update node
git pull -r origin master
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 -m "⏰  %s CalVer Monthly Minor Release"
npm publish --tag=stable
npm version prepatch -m "⏰  %s It\'s the first of the month!"
git push origin master --follow-tags

# Create a git release - https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#create-a-release--code-samples

Daily Patch Release

# Automated Midnight

git pull -r origin master
npm version patch
npm publish
npm version prepatch -m "😴  %s Night Night !"
git push origin master --follow-tags


# Tools

npm edit <pkg>[/<subpkg>...]
npm explore some-dependency -- git pull origin master
npm test


# Manual Pre Release & Bug fixes

git pull -r origin master
npm version prerelease
npm publish
git push origin master --follow-tags
[
# Create a git release - https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#create-a-release--code-samples
$ 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

Arguments

  • path - (optional) Specific file to run lint check. (Defaults to dist/snuggsi.es)
$ bin/package

🚧 This algorithm will be implemented to minify distribution. (i.e. Tree Shaking)

  1. Packaging components
  2. Containerizing components

References

$ bin/publish

Publishes static assets (i.e. examples, markup, styles, & scripts)

$ bin/serve [root]

Launches web server with root as main entry point.

Environment Options

  • PORT - Server port (Defaults to 80)

Arguments

  • 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

Environment Options

$ 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.

Uses tape and tap-nyc

Arguments

  • 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

Arguments

  • 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.

Arguments

  • 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).

Arguments

  • library - (optional) path to watch for changes (Defaults to dist/snuggsi.min.es.br)

References