Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
egoist committed Feb 24, 2017
0 parents commit 06ea3d1
Show file tree
Hide file tree
Showing 24 changed files with 8,574 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
root = true

[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
.DS_Store
*.log

dist
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) egoist <[email protected]> (https://egoistian.com)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
75 changes: 75 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# tooling

[![NPM version](https://img.shields.io/npm/v/tooling.svg?style=flat)](https://npmjs.com/package/tooling) [![NPM downloads](https://img.shields.io/npm/dm/tooling.svg?style=flat)](https://npmjs.com/package/tooling) [![Build Status](https://img.shields.io/circleci/project/egoist/tooling/master.svg?style=flat)](https://circleci.com/gh/egoist/tooling) [![donate](https://img.shields.io/badge/$-donate-ff69b4.svg?maxAge=2592000&style=flat)](https://github.com/egoist/donate)

## Install

```bash
yarn add tooling tooling-preset-web --dev
```

## How to use

Configure npm scripts:

```js
{
"scripts": {
"build": "tooling build",
"dev": "tooling dev"
},
"tooling": {
"presets": [
"web"
]
}
}
```

Populate `index.js` inside your project:

```js
document.write('<h1>Hello World!<h1>')
```

And run `yarn dev` and go to `http://localhost:4000`.

## Command

- `tooling dev`: Run dev server with hot reloading support, then you can code and open browser to preview
- `tooling build`: Build app in production mode.

## Configuration

The surpise is, tooling requires **no configurations!** Oh well, there're a couple CLI options. You can run `tooling --help` and `tooling <command> --help` to check out!

However, `presets` may require options, then you can configure them in:

- a package.json's `tooling` property
- a JSON or YAML "rc file", eg: `.toolingrc.json` or `.toolingrc.yml` or without extension
- a `tooling.config.js` CommonJS module
- a CLI `--config` argument

## Presets

Your app is driven by presets under the hood, just like [babel](https://babeljs.io) is driven by babel presets.

### List of presets

- [Web](./packages/tooling-preset-web): A preset you'll need for modern web apps.

## Contributing

1. Fork it!
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request :D


## Author

**tooling** © [egoist](https://github.com/egoist), Released under the [MIT](./LICENSE) License.<br>
Authored and maintained by egoist with help from contributors ([list](https://github.com/egoist/tooling/contributors)).

> [egoistian.com](https://egoistian.com) · GitHub [@egoist](https://github.com/egoist) · Twitter [@rem_rin_rin](https://twitter.com/rem_rin_rin)
15 changes: 15 additions & 0 deletions circle.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
machine:
node:
version: 7
environment:
PATH: "${PATH}:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"

dependencies:
override:
- yarn
cache_directories:
- ~/.cache/yarn

test:
override:
- yarn test
1 change: 1 addition & 0 deletions example/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
document.write('<h1>Hello World!<h1>')
24 changes: 24 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"private": true,
"name": "tooling",
"version": "0.0.0",
"author": "egoist <[email protected]>",
"license": "MIT",
"scripts": {
"boot": "node scripts/bootstrap.js"
},
"devDependencies": {
"promise.series": "^0.1.0",
"yarn-install": "^0.2.1"
},
"dependencies": {
"chalk": "^1.1.3"
},
"tooling": {
"presets": [
["web", {
"entry": "example/index.js"
}]
]
}
}
73 changes: 73 additions & 0 deletions packages/tooling-preset-web/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
# tooling-preset-web

What this preset does:

- Generate `index.html` and relevant assets files
- Copy `./static/**` to `./dist/**`
- CSS preprocessors (Postcss/Sass/Scss/Less/Stylus)
- CSS extraction
- Babel with `babel-preset-latest`
- Minimize and optimize in `tooling build`
- Hot reloading (Live loading fallbacks) in `tooling dev`

## Install

```bash
yarn add tooling-preset-web --dev
```

## Usage

```js
{
"tooling": {
"presets": [
"web"
]
}
}
```

You can also use options:

```js
{
"tooling": {
"presets": [
["web", {
"entry": "src/index.js"
}]
]
}
}
```

## Options

### entry

Type: `string`<br>
Default: `index.js`

Entry file.

### dist

Type: `string`<br>
Default: `dist`

Dist folder.

### extract

Type: `boolean`<br>
Default: `true` in `tooling build`

Extract CSS.

### sourceMap

Type: `boolean`<br>
Default: `true` in `tooling build`

Generate sourcemaps.
8 changes: 8 additions & 0 deletions packages/tooling-preset-web/dev-client.es6
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require('eventsource-polyfill')
const hotClient = require('webpack-hot-middleware/client?reload=true')

hotClient.subscribe(event => {
if (event.action === 'reload') {
window.location.reload()
}
})
Loading

0 comments on commit 06ea3d1

Please sign in to comment.