diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..6f67564 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "airbnb-base" +} \ No newline at end of file diff --git a/.storybook/config.js b/.storybook/config.js new file mode 100644 index 0000000..a8fc685 --- /dev/null +++ b/.storybook/config.js @@ -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); diff --git a/docs/index.stories.js b/docs/index.stories.js new file mode 100644 index 0000000..820f386 --- /dev/null +++ b/docs/index.stories.js @@ -0,0 +1,17 @@ +import { storiesOf } from '@storybook/html'; + +import '../css/nes.css'; + +storiesOf('Containers', module) + .add('default', () => `
+

Container

+

Good morning. Thou hast had a good night's sleep, I hope.

+
`) + .add('.is-center', () => `
+

Container.is-center

+

Good morning. Thou hast had a good night's sleep, I hope.

+
`) + .add('.is-right', () => `
+

Container.is-right

+

Good morning. Thou hast had a good night's sleep, I hope.

+
`); diff --git a/package.json b/package.json index dac6c84..89f8452 100644 --- a/package.json +++ b/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" } }