Skip to content

Instantly share code, notes, and snippets.

@matthewstokeley
Last active March 22, 2020 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matthewstokeley/c91423b2f7b56cde97d57a30640a9f83 to your computer and use it in GitHub Desktop.
Save matthewstokeley/c91423b2f7b56cde97d57a30640a9f83 to your computer and use it in GitHub Desktop.
isolated-development
# Isolated Development Environment Installation
# Poor man's storybook for scripts, with glitch
# https://www.lucidchart.com/invitations/accept/d77e6095-bd82-41af-a9cf-a48e056f39ee
# tl;dr
# Problem:
# `return _cache( new Symbol( key ) )` should have been `return ( typeof key === 'Symbol' ) ? _cache( key ) : _cache( new Symbol( key ) )
# Solution:
# Standards - Script, Test, Diagram
# Isolated development with glitch ala storybook - unit testing - perf - prettier - lint
# @todo port to node
ROOT=""
SRC=""
REMOTEURL=""
DEST=""
if $1 == 'update'
then
git pull origin master && npx run ./node_modules/karma &&
fi
if [ ! -e .config ]
then
touch .config && echo 'notebook=glitch' >> .config && echo "notebook-remote-url=$REMOTEURL" >> .config
fi
if [ ! -e "$SRC" ]
then
mkdir $SRC
fi
mv $SRC
if [ ! -f index.js ]
then
touch index.js
fi
if [ ! -f .gitignore ]
then
touch .gitignore && echo "node_modules" >> .gitignore && git init && git remote add origin $REMOTEURL
fi
git pull origin
cp index.js DEST
# Performance and Benchmarking
cd $ROOT
if [ ! -e .config ]
then
touch .config && echo 'perf=js-perf'
fi
npm install js-perf
# Unit Tests
cd $ROOT
if [ ! -e .config ]
then
touch .config && echo 'unit_tests=jasmine'
fi
cd $SRC
npm install jasmine mocha
touch config.js && curl "" >> config,.js && mkdir tests && touch tests/.gitkeep && touch tests/index.spec.js && curl "" >> index.spec.js
npx run
# Machine Analysis
npm install eslint prettier && touch .prettierrc
# Reporting
cd $SRC && mkdir reports && touch reports/.gitkeep npm install allure
# Push
git add -A && git commit -m "scaffold" && git push origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment