Skip to content

Commit

Permalink
Now using Yarn.
Browse files Browse the repository at this point in the history
Fixes #16.
  • Loading branch information
jaydenseric committed Jan 15, 2017
1 parent 2926a82 commit 3e716e9
Show file tree
Hide file tree
Showing 5 changed files with 4,453 additions and 21 deletions.
2 changes: 1 addition & 1 deletion index.html
Expand Up @@ -24,7 +24,7 @@
<h1>Getting started</h1>
<p>After <a href="https://github.com/jaydenseric/Barebones#setup" target="_blank">setup</a> and inspecting these example components:</p>
<ol>
<li>Remove Barebones examples and references. Within the project directory in Terminal run <code>npm run init</code>. This script also deletes itself.</li>
<li>Remove Barebones examples and references. Within the project directory in Terminal run <code>yarn run init</code>. This script also deletes itself.</li>
<li>Customize the meta in <code>/index.html</code>.</li>
<li>Customize the icons in <code>/content</code>.</li>
<li><a href="https://github.com/ai/browserslist#config-file" target="_blank">Configure</a> browser support in <code>/browserslist</code> for tools such as <a href="https://github.com/postcss/autoprefixer" target="_blank">Autoprefixer</a>.</li>
Expand Down
6 changes: 3 additions & 3 deletions package.json
Expand Up @@ -3,11 +3,11 @@
"scripts": {
"init": "tasks/init.sh",
"clean": "rimraf bundle",
"prebuild": "npm run clean",
"prebuild": "yarn run clean",
"build": "webpack --progress",
"build:watch": "npm run build -- --watch",
"build:watch": "yarn run build -- --watch",
"lint:js": "eslint .",
"lint:js:fix": "npm run lint:js -- --fix",
"lint:js:fix": "yarn run lint:js -- --fix",
"lint:css": "stylelint '**/*.css'",
"start": "http-server -o"
},
Expand Down
33 changes: 17 additions & 16 deletions readme.md
Expand Up @@ -8,7 +8,7 @@ A barebones boilerplate for getting started on a bespoke front end.

- Environment agnostic; setup your own backend and component templating.
- Simple ES6 class module component architecture with some (easily removed) examples.
- [NPM](https://npmjs.com) dependancies and tools.
- [NPM](https://npmjs.com) and [Yarn](https://yarnpkg.com) for dependancies and tools.
- [webpack](https://webpack.github.io) for builds.
- ES6 via [Babel](https://babeljs.io).
- [DOM4](https://github.com/WebReflection/dom4) polyfills modern DOM and [Animation Frames](https://html.spec.whatwg.org/multipage/webappapis.html#animation-frames) functionalities.
Expand All @@ -25,9 +25,10 @@ A barebones boilerplate for getting started on a bespoke front end.
For development tools and building:

1. Install the latest [Node.js and NPM](https://nodejs.org).
2. Run `npm install` within the project root directory in Terminal.
3. Run `npm run build:watch`.
4. Run `npm start` in another tab. Tada!
2. Install the latest [Yarn](https://yarnpkg.com/en/docs/install).
3. Run `yarn` within the project root directory in Terminal.
4. Run `yarn run build:watch`.
5. Run `yarn run start` in another tab. Tada!

Ensure your editor supports:

Expand All @@ -37,7 +38,7 @@ Ensure your editor supports:

After inspecting the example components:

1. Remove Barebones examples and references. Within the project directory in Terminal run `npm run init`. This script also deletes itself.
1. Remove Barebones examples and references. Within the project directory in Terminal run `yarn run init`. This script also deletes itself.
2. Customize the meta in `/index.html`.
3. Customize the icons in `/content`.
4. [Configure](https://github.com/ai/browserslist#config-file) browser support in `/browserslist` for tools such as [Autoprefixer](https://github.com/postcss/autoprefixer).
Expand All @@ -53,20 +54,20 @@ After inspecting the example components:

## Scripts

Command | Purpose
:-------------------- | :----------------------------------------------
`npm run init` | Remove Barebones examples and references.
`npm run lint:js` | Lint JS (see `eslintConfig` in `package.json`).
`npm run lint:js:fix` | Lint JS and automatically fix issues.
`npm run lint:css` | Lint CSS (see `stylelint` in `package.json`).
`npm run clean` | Delete `/bundle`.
`npm run build` | Compile JS and CSS to `/bundle`.
`npm run build:watch` | Build, rebuilding on source file changes.
`npm start` | Start a dev server and open in browser.
Command | Purpose
:--------------------- | :----------------------------------------------
`yarn run init` | Remove Barebones examples and references.
`yarn run lint:js` | Lint JS (see `eslintConfig` in `package.json`).
`yarn run lint:js:fix` | Lint JS and automatically fix issues.
`yarn run lint:css` | Lint CSS (see `stylelint` in `package.json`).
`yarn run clean` | Delete `/bundle`.
`yarn run build` | Compile JS and CSS to `/bundle`.
`yarn run build:watch` | Build, rebuilding on source file changes.
`yarn run start` | Start a dev server and open in browser.

## Tips

- Use NPM to manage 3rd party dependencies.
- Use [NPM](https://www.npmjs.com) with [Yarn](https://yarnpkg.com) to manage 3rd party dependencies.
- Avoid adding already minified assets for better sourcemap assisted debugging.
- Use [JSDoc](http://usejsdoc.org) when writing JS.
- Don't vendor prefix CSS rules that are on a standards track; [Autoprefixer](https://github.com/postcss/autoprefixer) will take care of it.
Expand Down
2 changes: 1 addition & 1 deletion tasks/init.sh
Expand Up @@ -9,7 +9,7 @@ sed -i '' '1,3d' components/app/index.css
sed -i '' '19,47d' index.html

# Purge readme
sed -i '' '3,22d;38,46d;58d;75,81d' readme.md
sed -i '' '3,22d;39,47d;59d;76,82d' readme.md

# Delete self
sed -i '' '4d' package.json
Expand Down

0 comments on commit 3e716e9

Please sign in to comment.