Skip to content

johnhenry/startled

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Startled

This is a set of initialization scripts that use common tools and shell scripts to help me prototype projects.

It makes heavy use of npm as a script runner and package.json for storing project data.

The project's capabilities can be extended by running scripts (see below).

Pre-requesties

These commands are designed to work on linux and unix machines, including machines running macOS.

If you're running Windows 10 Professional, you can run them using the Windows subsystem for Linux or within a Docker container.

If you're running some other version of Windows, the npm scripts should work, but extension scripts will fail. You might want to try cygwin in this case, or try downloading and running the script source manually.

Ensure that these utilities are installed first:

Usage

In your project directory, run the following script:

sh -c "$(curl -fsSL https://raw.githubusercontent.com/johnhenry/startled/master/init.sh)"

This and also adds get, set, and delete npm scripts that allow manipulation of the package as a key-value store.

Once you've run that script, you can run any of below installation scripts to add functionality to your project.

NPM run Scripts

Running installation scripts will usually add an npm command.

The following commands are installed when adding the above initial script.

get: read a value from package.json

npm run get < path in package.json >

set: add a key to package.json

npm run set < path in package.json > 'value to set'

delete: remove a key from package.json

npm run delete < path in package.json >

included files

.npmrc

set up with 'save=true' to save installed dependencies automatically

.gitignore

set up to ignore 'node_modules/' folder

Installation scripts

Update project capabilities by running scripts in the project directory.

generate-readme.sh

  • Compile a readme from json and ejs

  • Creates script:

    • npm run generate-readme
  • Creates files:

    • readme/readme.md.json
      • readme/readme.md.ejs
    • readme/.script/generate.js
  • Compiles to files:

    • readme.md
sh -c "$(curl -fsSL https://raw.githubusercontent.com/johnhenry/startled/master/.startled/scripts/js-next-browser-slug.sh)"

tag-git-npm-version.sh

  • Tag repo with package version upon running git version <'major'|'minor'|'patch'>

  • Note: must be run after cloning repository or running git init

  • Creates scripts:

    • npm run install < package name >
    • npm run uninstall < package name >
sh -c "$(curl -fsSL https://raw.githubusercontent.com/johnhenry/startled/master/.startled/scripts/tag-git-npm-version.sh)"

js-next-browser-slug.sh

  • Compile latest version of javascript into a self-contained slug for use in the browser
  • Creates script:
    • npm run build-js-browser
  • Creates files:
    • script/index.js
  • Compiles to files:
    • dist/index.js
sh -c "$(curl -fsSL https://raw.githubusercontent.com/johnhenry/startled/master/.startled/scripts/js-next-browser-slug.sh)"

node-next.sh

  • Run a node script written in the latest version of javascript
  • Creates script:
    • npm run node
  • Creates files:
    • node/index.js
sh -c "$(curl -fsSL https://raw.githubusercontent.com/johnhenry/startled/master/.startled/scripts/node-next.sh)"

css-next-slug.sh

  • Compile latest version of css into a self-contained slug
  • Creates script:
    • npm run build-css
  • Creates files:
    • style/index.css
  • Compiles to files:
    • dist/index.css
sh -c "$(curl -fsSL https://raw.githubusercontent.com/johnhenry/startled/master/.startled/scripts/css-next-slug.sh)"

html.sh

  • Compile react components into static html files.
  • Creates script:
    • npm run build-html
  • Creates files:
    • html/.md.jsx.html.js
    • html/index.jsx
  • Compiles to files:
    • dist/index.js
sh -c "$(curl -fsSL https://raw.githubusercontent.com/johnhenry/startled/master/.startled/scripts/html.sh)"

serve-static.sh

  • Run static server
  • Creates script:
    • npm run serve-static
  • Requires files:
    • dist/
sh -c "$(curl -fsSL https://raw.githubusercontent.com/johnhenry/startled/master/.startled/scripts/serve-static.sh)"

unfinished installation scripts

These scripts will be ready soon.

js-next-slug.sh

  • Compile latest version of javascript into a self-contained slug
  • Creates script:
    • npm run build-js
  • Creates files:
    • script/index.js
  • Compiles to files:
    • dist/index.js
sh -c "$(curl -fsSL https://raw.githubusercontent.com/johnhenry/startled/master/.startled/scripts/js-next-slug.sh)"

lint-js.sh

  • Lint JavaScript
  • Creates scripts:
    • npm run lint-js < package name >
sh -c "$(curl -fsSL https://raw.githubusercontent.com/johnhenry/startled/master/.startled/scripts/lint-js.sh)"

lint-css.sh

  • Lint CSS
  • Creates scripts:
    • npm run lint-css < package name >
sh -c "$(curl -fsSL https://raw.githubusercontent.com/johnhenry/startled/master/.startled/scripts/lint-css.sh)"

move.sh

  • Move static files into dist directory
  • Creates script:
    • npm run move
  • Requires files:
    • static/*
    • dist/
sh -c "$(curl -fsSL https://raw.githubusercontent.com/johnhenry/startled/master/.startled/scripts/move.sh)"

deploy-surge.sh

  • Push static site to https://surge.sh
  • Creates script:
    • npm run deploy-surge
  • Requires files:
    • dist/*
sh -c "$(curl -fsSL https://raw.githubusercontent.com/johnhenry/startled/master/.startled/scripts/deploy-surge.sh)"

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages