diff --git a/.babelrc b/.babelrc index 454f09d6a..a89509275 100644 --- a/.babelrc +++ b/.babelrc @@ -1,6 +1,6 @@ { - "presets": ["es2015"], + "presets": ["env"], "plugins": [ ["transform-react-jsx", {"pragma": "element"}] ] -} \ No newline at end of file +} diff --git a/css/base/font.css b/css/base/font.css index 2ad38c180..cba7efa99 100644 --- a/css/base/font.css +++ b/css/base/font.css @@ -9,4 +9,4 @@ code { color: #c7254e; background-color: #f9f2f4; border-radius: 4px; -} \ No newline at end of file +} diff --git a/css/base/margin-padding.css b/css/base/margin-padding.css index 7fdab501b..8f3215df2 100644 --- a/css/base/margin-padding.css +++ b/css/base/margin-padding.css @@ -16,4 +16,4 @@ p { ul { margin: 0; padding: auto 0; -} \ No newline at end of file +} diff --git a/css/color.css b/css/color.css index a8241f952..d4016baec 100644 --- a/css/color.css +++ b/css/color.css @@ -2,7 +2,7 @@ --MainBackgroundColor: white; --BackgroundColor: #f4f4f4; --AccentColor: #5acbe3; - --MenuLinkColor: #0F0F0F; - --LeadingTextColor: #3D454E; - --TextColor: #30363D; -} \ No newline at end of file + --MenuLinkColor: #0f0f0f; + --LeadingTextColor: #3d454e; + --TextColor: #30363d; +} diff --git a/css/components/AddTextlintRule.css b/css/components/AddTextlintRule.css index db59be9a2..9acf5d356 100644 --- a/css/components/AddTextlintRule.css +++ b/css/components/AddTextlintRule.css @@ -4,4 +4,4 @@ .AddTextlintRule input { margin: 0 0.2rem; -} \ No newline at end of file +} diff --git a/css/components/App.css b/css/components/App.css index 95df63a8d..7940529f4 100644 --- a/css/components/App.css +++ b/css/components/App.css @@ -1,5 +1,6 @@ @import "../color.css"; -html, body { +html, +body { background-color: var(--BackgroundColor); -} \ No newline at end of file +} diff --git a/css/components/DisabledTextlintRuleList.css b/css/components/DisabledTextlintRuleList.css index 7f91fe64a..e98d8502f 100644 --- a/css/components/DisabledTextlintRuleList.css +++ b/css/components/DisabledTextlintRuleList.css @@ -1,7 +1,8 @@ -.DisabledTextlintRuleListBox, .DisabledTextlintRuleList { +.DisabledTextlintRuleListBox, +.DisabledTextlintRuleList { margin: 0; } .DisabledTextlintRuleList { padding-left: 32px; -} \ No newline at end of file +} diff --git a/css/components/EnabledTextlintRuleList.css b/css/components/EnabledTextlintRuleList.css index 69d68de7e..1337f0d36 100644 --- a/css/components/EnabledTextlintRuleList.css +++ b/css/components/EnabledTextlintRuleList.css @@ -1,7 +1,8 @@ -.EnabledTextlintRuleListBox, .EnabledTextlintRuleList { +.EnabledTextlintRuleListBox, +.EnabledTextlintRuleList { margin: 0; } .EnabledTextlintRuleList { padding-left: 32px; -} \ No newline at end of file +} diff --git a/css/components/Footer.css b/css/components/Footer.css index 5e187a778..827cbe1dd 100644 --- a/css/components/Footer.css +++ b/css/components/Footer.css @@ -12,4 +12,4 @@ .Footer-list-item a { color: var(--MenuLinkColor); -} \ No newline at end of file +} diff --git a/css/components/Header.css b/css/components/Header.css index 02157d48c..c9ce99506 100644 --- a/css/components/Header.css +++ b/css/components/Header.css @@ -1,7 +1,7 @@ @import "../color.css"; @import "./_var-layout.css"; .Header { - background-color: #FBFBFB; + background-color: #fbfbfb; padding: 5px 0; display: flex; } @@ -23,7 +23,8 @@ padding-right: var(--right-end-padding); } -.HeaderMenus, .HeaderMenuItem { +.HeaderMenus, +.HeaderMenuItem { display: inline-block; } @@ -54,4 +55,4 @@ .Logo-img { height: 40px; -} \ No newline at end of file +} diff --git a/css/components/Leading.css b/css/components/Leading.css index aa6dda02d..a0c322173 100644 --- a/css/components/Leading.css +++ b/css/components/Leading.css @@ -1,7 +1,7 @@ @import "../color.css"; -:root{ - --leadingColor : white; +:root { + --leadingColor: white; } .Leading { background-color: var(--AccentColor); @@ -34,6 +34,6 @@ .Leading-downloadButton:hover { color: var(--AccentColor); text-shadow: none; - background-color: #FFF; - border-color: #FFF; + background-color: #fff; + border-color: #fff; } diff --git a/css/components/TextlintDemo.css b/css/components/TextlintDemo.css index 80ff8f14c..2b2ca751f 100644 --- a/css/components/TextlintDemo.css +++ b/css/components/TextlintDemo.css @@ -1,16 +1,23 @@ @import "./_var-layout.css"; @import "../color.css"; +:root { + --TextlintDemo-height: 100%; +} + .TextlintDemo { background-color: var(--MainBackgroundColor); + height: 100%; } -.TextlintDemo-title, .TextlintDemo-lead { +.TextlintDemo-title, +.TextlintDemo-lead { padding-left: var(--left-start-padding); padding-right: var(--right-end-padding); } -.TextlintDemo-ruleBox, .TextlintDemo-errorBox { +.TextlintDemo-ruleBox, +.TextlintDemo-errorBox { padding-bottom: 1rem; } @@ -22,37 +29,41 @@ } .TextlintDemo-Editor { - border-right: 1px solid #ddd + border-right: 1px solid #ddd; } .TextlintDemo-Setting { - border-left: 1px solid #ddd + border-left: 1px solid #ddd; } -.TextlintDemo-Editor, .TextlintEditor .TextlintDemo-Setting, .TextlintErrorList { +.TextlintDemo-Editor, +.TextlintEditor .TextlintDemo-Setting, +.TextlintErrorList { width: 100%; } +.TextlintDemo-errorBox, +.TextlintDemo-ruleBox { + overflow: scroll; +} + /*TextlintDemo-Editor | TextlintDemo-Setting*/ -.TextlintDemo-Editor, .TextlintEditor, .TextlintDemo-Setting { - height: 100%; +.TextlintEditor, +.TextlintDemo-Setting { + height: var(--TextlintDemo-height); } -.TextlintDemo-Editor h3, .TextlintDemo-Setting h3 { - /* 縦位置をめにゅーと揃える */ - padding: 0; +.TextlintDemo-Editor h3, +.TextlintDemo-Setting h3 { margin: 0; - padding-right: var(--right-end-padding); + padding: 0 var(--right-end-padding) 0 0; text-align: right; background-color: #f4f4f4; color: var(--TextColor); } -.CodeMirrorEditor { - height: 100%; -} - -.CodeMirror { - height: auto; +.CodeMirrorEditor, +.CodeMirrorEditor .CodeMirror { + height: var(--TextlintDemo-height); font-size: 14px; -} \ No newline at end of file +} diff --git a/css/components/TextlintRuleListItem.css b/css/components/TextlintRuleListItem.css index c6723e468..bfee97f83 100644 --- a/css/components/TextlintRuleListItem.css +++ b/css/components/TextlintRuleListItem.css @@ -5,4 +5,4 @@ .TextLintRuleListItem p { padding: 0; margin: 0; -} \ No newline at end of file +} diff --git a/css/components/TextlintRuleListSet.css b/css/components/TextlintRuleListSet.css index 9398210a4..de7cc0db3 100644 --- a/css/components/TextlintRuleListSet.css +++ b/css/components/TextlintRuleListSet.css @@ -1,3 +1,3 @@ .TextlintRuleListSet { margin: 0.5rem 0; -} \ No newline at end of file +} diff --git a/css/components/WhatIsTextLint.css b/css/components/WhatIsTextLint.css index ee37653aa..74a1af71d 100644 --- a/css/components/WhatIsTextLint.css +++ b/css/components/WhatIsTextLint.css @@ -14,5 +14,5 @@ } .WhatIsTextLint-philosophy-list { - padding-left: calc(var(--left-start-padding) + 1em) -} \ No newline at end of file + padding-left: calc(var(--left-start-padding) + 1em); +} diff --git a/css/components/_shared_header.css b/css/components/_shared_header.css index c37806745..41da47792 100644 --- a/css/components/_shared_header.css +++ b/css/components/_shared_header.css @@ -1,6 +1,6 @@ .header-has-icon:before { - content:""; + content: ""; background: url("../img/textlint-icon_black-white-128x128.png") no-repeat left center; background-size: 0.8em; padding-right: 1em; -} \ No newline at end of file +} diff --git a/css/components/_var-layout.css b/css/components/_var-layout.css index a725debf8..178393207 100644 --- a/css/components/_var-layout.css +++ b/css/components/_var-layout.css @@ -7,4 +7,4 @@ :root { --right-end-padding: 1.5rem; --left-start-padding: 1.5rem; -} \ No newline at end of file +} diff --git a/css/index.css b/css/index.css index ed96dc845..24dfc9024 100644 --- a/css/index.css +++ b/css/index.css @@ -22,4 +22,4 @@ @import "./components/_shared_header.css"; /* Utils */ @import "./utils/padding.css"; -@import "./utils/image.css"; \ No newline at end of file +@import "./utils/image.css"; diff --git a/css/layout/Body.css b/css/layout/Body.css index fd612bcb2..d6a07c1f5 100644 --- a/css/layout/Body.css +++ b/css/layout/Body.css @@ -1,4 +1,5 @@ -html, body { +html, +body { padding: 0; margin: 0; } @@ -9,4 +10,4 @@ html, body { .MainContent { padding: 0 5px; -} \ No newline at end of file +} diff --git a/css/utils/image.css b/css/utils/image.css index 0d39d5610..ccb3269c6 100644 --- a/css/utils/image.css +++ b/css/utils/image.css @@ -1,4 +1,4 @@ .u-inline-icon { display: inline !important; height: 1em !important; -} \ No newline at end of file +} diff --git a/package.json b/package.json index 2d420acbe..d12ac997c 100644 --- a/package.json +++ b/package.json @@ -19,43 +19,66 @@ "test": "test" }, "scripts": { + "start": "npm-run-all clean --parallel watch:css server", "build:css": "suitcss --import-root css/ css/index.css bundle/build.css", "build:js": "webpack -p", "build": "npm-run-all --parallel build:*", - "watch:css": "suitcss --watch --import-root css/ css/index.css bundle/build.css", + "watch:css": "suitcss --watch --import-root css/ css/index.css public/build/build.css", "watch:js": "webpack -d --watch", "watch": "npm-run-all --parallel watch:*", - "deploy": "gh-pages -b master -d ./ --repo git@github.com:textlint/textlint.github.io.git" + "deploy": "gh-pages -b master -d ./public --repo git@github.com:textlint/textlint.github.io.git", + "server": "cross-env NODE_ENV=development webpack-dev-server --hot --content-base ./public --open", + "prettier": "prettier --write \"**/*.{js,jsx,ts,tsx,css}\"", + "precommit": "lint-staged", + "postcommit": "git reset", + "clean": "rimraf public/build/" }, "dependencies": { - "camelcase": "^2.0.1", - "codemirror": "^5.10.0", - "codemirror-textlint": "^1.0.1", - "decca": "^2.0.1", + "@textlint/kernel": "^2.0.3", + "camelcase": "^4.1.0", + "codemirror": "^5.33.0", + "decca": "^2.3.0", "isomorphic-fetch": "^2.2.1", "lodash.debounce": "^4.0.0", - "redux": "^3.0.5", - "redux-logger": "^2.3.1", - "textlint": "^7.2.2", + "redux": "^3.7.2", + "redux-logger": "^3.0.6", "textlint-message-to-codemirror": "^1.0.0", + "textlint-plugin-markdown": "^4.0.4", "textlint-rule-alex": "^1.0.1", - "textlint-rule-no-todo": "^1.0.3", + "textlint-rule-no-todo": "^2.0.0", "textlint-rule-rousseau": "^1.3.2", "textlint-rule-sjsj": "^1.0.5", "textlint-rule-unexpanded-acronym": "^1.2.1" }, "devDependencies": { - "babel-loader": "^6.2.1", - "babel-plugin-transform-react-jsx": "^6.3.13", - "babel-preset-es2015": "^6.3.13", - "css-loader": "0.26.1", - "gh-pages": "0.12.0", - "json-loader": "^0.5.4", - "npm-run-all": "4.0.1", + "babel-core": "^6.26.0", + "babel-loader": "^7.1.2", + "babel-plugin-transform-react-jsx": "^6.24.1", + "babel-preset-env": "^1.6.1", + "cross-env": "^5.1.3", + "css-loader": "0.28.8", + "gh-pages": "1.1.0", + "husky": "^0.14.3", + "lint-staged": "^6.0.0", + "npm-run-all": "4.1.2", + "prettier": "^1.10.2", + "rimraf": "^2.6.2", "shebang-loader": "^0.0.1", - "style-loader": "^0.13.0", - "suitcss-preprocessor": "3.0.1", - "suitcss-utils": "2.0.0", - "webpack": "^2.2.0" + "style-loader": "^0.19.1", + "suitcss-preprocessor": "4.0.0", + "suitcss-utils": "3.0.0", + "webpack": "^3.10.0", + "webpack-dev-server": "^2.10.1" + }, + "prettier": { + "singleQuote": false, + "printWidth": 120, + "tabWidth": 4 + }, + "lint-staged": { + "*.{js,jsx,ts,tsx,css}": [ + "prettier --write", + "git add" + ] } } diff --git a/img/banner_1420x512.png b/public/img/banner_1420x512.png similarity index 100% rename from img/banner_1420x512.png rename to public/img/banner_1420x512.png diff --git a/img/textlint-icon-no-circle_128x128.png b/public/img/textlint-icon-no-circle_128x128.png similarity index 100% rename from img/textlint-icon-no-circle_128x128.png rename to public/img/textlint-icon-no-circle_128x128.png diff --git a/img/textlint-icon_256x256.png b/public/img/textlint-icon_256x256.png similarity index 100% rename from img/textlint-icon_256x256.png rename to public/img/textlint-icon_256x256.png diff --git a/img/textlint-icon_black-white-128x128.png b/public/img/textlint-icon_black-white-128x128.png similarity index 100% rename from img/textlint-icon_black-white-128x128.png rename to public/img/textlint-icon_black-white-128x128.png diff --git a/img/textlint-logo.png b/public/img/textlint-logo.png similarity index 100% rename from img/textlint-logo.png rename to public/img/textlint-logo.png diff --git a/index.html b/public/index.html similarity index 70% rename from index.html rename to public/index.html index 2f8754d3f..8c4266f27 100644 --- a/index.html +++ b/public/index.html @@ -7,17 +7,17 @@