mirror of
https://github.com/nostalgic-css/NES.css.git
synced 2025-08-30 17:30:23 +02:00
Add storybook as docs; add eslint as javascript styleguide with AirBnb Style.
This commit is contained in:
3
.eslintrc.json
Normal file
3
.eslintrc.json
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "airbnb-base"
|
||||
}
|
9
.storybook/config.js
Normal file
9
.storybook/config.js
Normal file
@@ -0,0 +1,9 @@
|
||||
import { configure } from '@storybook/html';
|
||||
|
||||
// automatically import all files ending in *.stories.js
|
||||
const req = require.context('../docs', true, /.stories.js$/);
|
||||
function loadStories() {
|
||||
req.keys().forEach(filename => req(filename));
|
||||
}
|
||||
|
||||
configure(loadStories, module);
|
17
docs/index.stories.js
Normal file
17
docs/index.stories.js
Normal file
@@ -0,0 +1,17 @@
|
||||
import { storiesOf } from '@storybook/html';
|
||||
|
||||
import '../css/nes.css';
|
||||
|
||||
storiesOf('Containers', module)
|
||||
.add('default', () => `<div class="container with-title">
|
||||
<p class="title">Container</p>
|
||||
<p>Good morning. Thou hast had a good night's sleep, I hope.</p>
|
||||
</div>`)
|
||||
.add('.is-center', () => `<div class="container with-title is-center">
|
||||
<p class="title">Container.is-center</p>
|
||||
<p>Good morning. Thou hast had a good night's sleep, I hope.</p>
|
||||
</div>`)
|
||||
.add('.is-right', () => `<div class="container with-title is-right">
|
||||
<p class="title">Container.is-right</p>
|
||||
<p>Good morning. Thou hast had a good night's sleep, I hope.</p>
|
||||
</div>`);
|
13
package.json
13
package.json
@@ -4,14 +4,16 @@
|
||||
"description": "NES.css is NES-style CSS Framework.",
|
||||
"scripts": {
|
||||
"watch": "npm run build:sass -- --watch",
|
||||
"build": "npm run build:clean && npm run build:stylelint && npm run build:sass && npm run build:autoprefix && npm run build:cleancss",
|
||||
"build": "npm run build:clean && npm run build:stylelint && npm run build:sass && npm run build:autoprefix && npm run build:cleancss && npm run build-storybook",
|
||||
"stylelint": "stylelint scss/**/*.scss",
|
||||
"build:stylelint": "npm run stylelint -- --fix",
|
||||
"build:clean": "rimraf css",
|
||||
"build:sass": "node-sass --output-style expanded --source-map true scss/nes.scss css/nes.css",
|
||||
"build:autoprefix": "postcss --use autoprefixer --map false --output css/nes.css css/nes.css",
|
||||
"build:cleancss": "cleancss -o css/nes.min.css css/nes.css",
|
||||
"deploy": "npm run build"
|
||||
"deploy": "npm run build",
|
||||
"storybook": "start-storybook -p 6006",
|
||||
"build-storybook": "build-storybook"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
@@ -30,8 +32,12 @@
|
||||
},
|
||||
"homepage": "https://github.com/BcRikko/NES.css#readme",
|
||||
"devDependencies": {
|
||||
"@storybook/html": "^4.0.11",
|
||||
"autoprefixer": "^9.1.5",
|
||||
"clean-css-cli": "^4.2.1",
|
||||
"eslint": "^5.9.0",
|
||||
"eslint-config-airbnb-base": "^13.1.0",
|
||||
"eslint-plugin-import": "^2.14.0",
|
||||
"husky": "^1.0.0",
|
||||
"lint-staged": "^7.3.0",
|
||||
"node-sass": "^4.9.3",
|
||||
@@ -79,5 +85,8 @@
|
||||
"at-rule-no-unknown": null,
|
||||
"scss/at-rule-no-unknown": true
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"babel-loader": "^8.0.4"
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user