Просмотр исходного кода

imprv: Omit textlint-rule-en-capitalization (#4403)

* omit textlint-rule-en-capitalization

* turn on bundle analyzer when ci

* add report to .gitignore
Yuki Takei 4 лет назад
Родитель
Сommit
59e186f0bf

+ 8 - 0
.github/workflows/ci.yml

@@ -208,6 +208,8 @@ jobs:
     - name: Build
       run: |
         yarn lerna run build
+      env:
+        ANALYZE_BUNDLE_SIZE: ${{ matrix.node-version == '14.x' }}
     - name: lerna bootstrap --production
       run: |
         npx lerna bootstrap -- --production
@@ -235,6 +237,12 @@ jobs:
       env:
         MONGO_URI: mongodb://localhost:${{ job.services.mongodb36.ports['27017'] }}/growi-${{ steps.getdbname.outputs.suffix }}
 
+    - name: Upload report as artifact
+      uses: actions/upload-artifact@v2
+      with:
+        name: Bundle Analyzing Report
+        path: packages/app/report/bundle-analyzer.html
+
     - name: Slack Notification
       uses: weseek/ghaction-slack-notification@master
       if: failure()

+ 1 - 0
packages/app/.gitignore

@@ -5,6 +5,7 @@
 # dist
 /dist/
 /transpiled/
+/report/
 /public/static/js
 /public/static/styles
 /public/uploads

+ 2 - 2
packages/app/config/webpack.prod.js

@@ -15,7 +15,7 @@ const { BundleAnalyzerPlugin } = require('webpack-bundle-analyzer');
 /**
   * Webpack Constants
   */
-const { ANALYZE } = process.env;
+const { ANALYZE_BUNDLE_SIZE } = process.env;
 
 module.exports = require('./webpack.common')({
   mode: 'production',
@@ -60,7 +60,7 @@ module.exports = require('./webpack.common')({
     }),
 
     new BundleAnalyzerPlugin({
-      analyzerMode: ANALYZE ? 'static' : 'disabled',
+      analyzerMode: ANALYZE_BUNDLE_SIZE ? 'static' : 'disabled',
       reportFilename: path.resolve(__dirname, '../report/bundle-analyzer.html'),
       openAnalyzer: false,
     }),

+ 4 - 4
packages/app/src/components/Me/EditorSettings.tsx

@@ -46,10 +46,10 @@ const commonRulesMenuItems = [
     name: 'sentence-length',
     description: 'editor_settings.common_settings.sentence_length',
   },
-  {
-    name: 'en-capitalization',
-    description: 'editor_settings.common_settings.en_capitalization',
-  },
+  // {  // omit because en-pos package is too big
+  //   name: 'en-capitalization',
+  //   description: 'editor_settings.common_settings.en_capitalization',
+  // },
   {
     name: 'no-unmatched-pair',
     description: 'editor_settings.common_settings.no_unmatched_pair',

+ 0 - 1
packages/codemirror-textlint/package.json

@@ -19,7 +19,6 @@
     "textlint-plugin-markdown": "^4.0.6",
     "textlint-rule-common-misspellings": "^1.0.1",
     "textlint-rule-date-weekday-mismatch": "^1.0.6",
-    "textlint-rule-en-capitalization": "^2.0.3",
     "textlint-rule-ja-hiragana-keishikimeishi": "^1.1.0",
     "textlint-rule-ja-no-abusage": "^3.0.0",
     "textlint-rule-ja-no-inappropriate-words": "^2.0.0",

+ 2 - 2
packages/codemirror-textlint/src/index.ts

@@ -3,7 +3,7 @@ import textlintToCodeMirror from 'textlint-message-to-codemirror';
 import textlintRuleNoUnmatchedPair from '@textlint-rule/textlint-rule-no-unmatched-pair';
 import textlintRuleCommonMisspellings from 'textlint-rule-common-misspellings';
 import textlintRuleDateWeekdayMismatch from 'textlint-rule-date-weekday-mismatch';
-import textlintRuleEnCapitalization from 'textlint-rule-en-capitalization';
+// import textlintRuleEnCapitalization from 'textlint-rule-en-capitalization';  // omit because en-pos package is too big
 import textlintRuleJaHiraganaKeishikimeishi from 'textlint-rule-ja-hiragana-keishikimeishi';
 import textlintRuleJaNoAbusage from 'textlint-rule-ja-no-abusage';
 import textlintRuleJaNoInappropriateWords from 'textlint-rule-ja-no-inappropriate-words';
@@ -45,7 +45,7 @@ const ruleModulesList = {
   'no-unmatched-pair': textlintRuleNoUnmatchedPair,
   'common-misspellings': textlintRuleCommonMisspellings,
   'date-weekday-mismatch': textlintRuleDateWeekdayMismatch,
-  'en-capitalization': textlintRuleEnCapitalization,
+  // 'en-capitalization': textlintRuleEnCapitalization, // omit because en-pos package is too big
   'ja-hiragana-keishikimeishi': textlintRuleJaHiraganaKeishikimeishi,
   'ja-no-abusage': textlintRuleJaNoAbusage,
   'ja-no-inappropriate-words': textlintRuleJaNoInappropriateWords,

+ 0 - 48
yarn.lock

@@ -5716,11 +5716,6 @@ circular-json@^0.3.1:
   resolved "https://registry.yarnpkg.com/circular-json/-/circular-json-0.3.3.tgz#815c99ea84f6809529d2f45791bdf82711352d66"
   integrity sha512-UZK3NBx2Mca+b5LsG7bY183pHWt5Y1xts4P3Pz7ENTwGVnJOUWbRb3ocjvX7hx9tq/yTAdclXm9sZ38gNuem4A==
 
-cities-list@^1.0.3:
-  version "1.0.3"
-  resolved "https://registry.yarnpkg.com/cities-list/-/cities-list-1.0.3.tgz#cb217d19ea1f355fc833d173a752ad9992f1240c"
-  integrity sha1-yyF9GeofNV/IM9Fzp1KtmZLxJAw=
-
 cjs-module-lexer@^1.0.0:
   version "1.2.2"
   resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.2.2.tgz#9f84ba3244a512f3a54e5277e8eef4c489864e40"
@@ -7657,35 +7652,6 @@ emotion-theming@^10.0.7:
     "@emotion/weak-memoize" "0.2.5"
     hoist-non-react-statics "^3.3.0"
 
-en-inflectors@^1.0.7:
-  version "1.0.12"
-  resolved "https://registry.yarnpkg.com/en-inflectors/-/en-inflectors-1.0.12.tgz#fd334776608a021cb4202157f20d52ab934af78a"
-  integrity sha1-/TNHdmCKAhy0ICFX8g1Sq5NK94o=
-  dependencies:
-    en-stemmer "^1.0.2"
-
-en-lexicon@^1.0.8:
-  version "1.0.11"
-  resolved "https://registry.yarnpkg.com/en-lexicon/-/en-lexicon-1.0.11.tgz#3f4da8a9cca9a906f510b8ece11631be3fd1105f"
-  integrity sha1-P02oqcypqQb1ELjs4RYxvj/REF8=
-  dependencies:
-    en-inflectors "^1.0.7"
-
-en-pos@^1.0.16:
-  version "1.0.16"
-  resolved "https://registry.yarnpkg.com/en-pos/-/en-pos-1.0.16.tgz#5b6ee67eed52a8e11267f3d15fa7501101123fb0"
-  integrity sha1-W27mfu1SqOESZ/PRX6dQEQESP7A=
-  dependencies:
-    cities-list "^1.0.3"
-    en-inflectors "^1.0.7"
-    en-lexicon "^1.0.8"
-    humannames "^1.0.5"
-
-en-stemmer@^1.0.2:
-  version "1.0.3"
-  resolved "https://registry.yarnpkg.com/en-stemmer/-/en-stemmer-1.0.3.tgz#2d22fb5db9005a88d6fc58026b38a831c8bc7c19"
-  integrity sha1-LSL7XbkAWojW/FgCazioMci8fBk=
-
 encodeurl@~1.0.1:
   version "1.0.1"
   resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.1.tgz#79e3d58655346909fe6f0f45a5de68103b294d20"
@@ -10496,11 +10462,6 @@ humanize-ms@^1.2.1:
   dependencies:
     ms "^2.0.0"
 
-humannames@^1.0.5:
-  version "1.0.5"
-  resolved "https://registry.yarnpkg.com/humannames/-/humannames-1.0.5.tgz#a4d60d4168df8737f4b262efd23f2ee32974f1c5"
-  integrity sha1-pNYNQWjfhzf0smLv0j8u4yl08cU=
-
 hyphenate-style-name@^1.0.2:
   version "1.0.4"
   resolved "https://registry.yarnpkg.com/hyphenate-style-name/-/hyphenate-style-name-1.0.4.tgz#691879af8e220aea5750e8827db4ef62a54e361d"
@@ -20485,15 +20446,6 @@ textlint-rule-date-weekday-mismatch@^1.0.6:
     moment "^2.29.1"
     textlint-tester "^12.0.2"
 
-textlint-rule-en-capitalization@^2.0.3:
-  version "2.0.3"
-  resolved "https://registry.yarnpkg.com/textlint-rule-en-capitalization/-/textlint-rule-en-capitalization-2.0.3.tgz#6b05e5adcc58caed87abfe6fefea88e20c89d7e5"
-  integrity sha512-tIx2gzm3okWfK5+0NNV1ap21LHk9PTc2/IXNqFhd7RDVSqv7YFaZnhwL+UrBZXTEfOh6VgnTQd81Os2Akzas5g==
-  dependencies:
-    en-pos "^1.0.16"
-    sentence-splitter "^3.0.11"
-    textlint-rule-helper "^2.1.1"
-
 textlint-rule-helper@2.0.1:
   version "2.0.1"
   resolved "https://registry.yarnpkg.com/textlint-rule-helper/-/textlint-rule-helper-2.0.1.tgz#f28dc20d3e06f60373aa04a97b965daa77d196b9"