-
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 06ea3d1
Showing
24 changed files
with
8,574 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
.DS_Store | ||
*.log | ||
|
||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
# tooling | ||
|
||
[](https://npmjs.com/package/tooling) [](https://npmjs.com/package/tooling) [](https://circleci.com/gh/egoist/tooling) [](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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
document.write('<h1>Hello World!<h1>') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
}] | ||
] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} | ||
}) |
Oops, something went wrong.