From eb3af0fa69e92166867091338686f79a2ec95aee Mon Sep 17 00:00:00 2001 From: Maximilian <787658+mfranzke@users.noreply.github.com> Date: Sun, 28 Mar 2021 19:12:21 +0200 Subject: [PATCH 01/10] refactor: updated husky and pretty-quick dependencies and updated to the new config storage model and removed husky and pretty-quick from packages/core, as this should be possible to get triggered from root --- .husky/.gitignore | 1 + .husky/pre-commit | 4 ++ package.json | 6 +- packages/core/package.json | 2 - yarn.lock | 113 +++++++++++++++++++++---------------- 5 files changed, 73 insertions(+), 53 deletions(-) create mode 100644 .husky/.gitignore create mode 100755 .husky/pre-commit diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 000000000..31354ec13 --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 000000000..f91359dc2 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +npx --no-install pretty-quick --staged diff --git a/package.json b/package.json index 17be6b991..0b0485bc6 100644 --- a/package.json +++ b/package.json @@ -19,10 +19,11 @@ "eslint-plugin-import": "^2.18.2", "eslint-plugin-prettier": "^3.1.0", "prettier": "^1.14.3", + "husky": "^5.2.0", "lerna": "3.17.0", - "pretty-quick": "^1.11.1", "auto": "^9.40.5", "@auto-it/released": "^9.40.5" + "pretty-quick": "^3.1.0" }, "repository": { "type": "git", @@ -41,7 +42,8 @@ "publish": "npx lerna publish -m \"[skip travis] chore(release): publish %s\"", "postpublish": "auto release", "preview:docs": "cd packages/docs && yarn production", - "preview:hbs": "cd packages/development-edition-engine-handlebars && yarn pl:starterkit && yarn pl:build" + "preview:hbs": "cd packages/development-edition-engine-handlebars && yarn pl:starterkit && yarn pl:build", + "prepare": "husky install" }, "nyc": { "exclude": [ diff --git a/packages/core/package.json b/packages/core/package.json index 056d988b9..6c1262012 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -30,10 +30,8 @@ "eslint-config-prettier": "^6.0.0", "eslint-plugin-import": "^2.18.2", "eslint-plugin-prettier": "^3.1.0", - "husky": "0.14.3", "jsdoc-to-markdown": "5.0.1", "prettier": "^1.14.3", - "pretty-quick": "^1.11.1", "rewire": "2.5.2", "standard-version": "9.0.0", "tap": "14.6.4" diff --git a/yarn.lock b/yarn.lock index def8c7443..1030cc065 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2881,6 +2881,11 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.3.tgz#3dca0e3f33b200fc7d1139c0cd96c1268cadfd9d" integrity sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA== +"@types/minimatch@^3.0.3": + version "3.0.4" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-3.0.4.tgz#f0ec25dbf2f0e4b18647313ac031134ca5b24b21" + integrity sha512-1z8k4wzFnNjVK/tlxvrWuK5WMt6mydWWP7+zvH5eFep4oj+UkrfiJTRtjCeBXNpwaA/FYqqtb4/QS4ianFpIRA== + "@types/minimist@^1.2.0": version "1.2.0" resolved "https://registry.yarnpkg.com/@types/minimist/-/minimist-1.2.0.tgz#69a23a3ad29caf0097f06eda59b361ee2f0639f6" @@ -3645,6 +3650,11 @@ array-differ@^2.0.3: resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-2.1.0.tgz#4b9c1c3f14b906757082925769e8ab904f4801b1" integrity sha512-KbUpJgx909ZscOc/7CLATBFam7P1Z1QRQInvgT0UztM9Q72aGKCunKASAl7WNW0tnPmPyEMeMhdsfWhfmW037w== +array-differ@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/array-differ/-/array-differ-3.0.0.tgz#3cbb3d0f316810eafcc47624734237d6aee4ae6b" + integrity sha512-THtfYS6KtME/yIAhKjZ2ul7XI96lQGHRputJQHO80LAWQnuGP4iCIN8vdMRboGbIEYBwU33q8Tch1os2+X0kMg== + array-each@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/array-each/-/array-each-1.0.1.tgz#a794af0c05ab1752846ee753a1f211a05ba0c44f" @@ -3690,6 +3700,11 @@ array-union@^1.0.1, array-union@^1.0.2: dependencies: array-uniq "^1.0.1" +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + array-uniq@^1.0.1, array-uniq@^1.0.2: version "1.0.3" resolved "https://registry.yarnpkg.com/array-uniq/-/array-uniq-1.0.3.tgz#af6ac877a25cc7f74e058894753858dfdb24fdb6" @@ -3710,6 +3725,11 @@ arrify@^1.0.0, arrify@^1.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= +arrify@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/arrify/-/arrify-2.0.1.tgz#c9655e9331e0abcd588d2a7cad7e9956f66701fa" + integrity sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug== + asap@^2.0.0, asap@^2.0.3, asap@~2.0.3: version "2.0.6" resolved "https://registry.yarnpkg.com/asap/-/asap-2.0.6.tgz#e50347611d7e690943208bbdafebcbc2fb866d46" @@ -5060,6 +5080,14 @@ chalk@^2.0.0, chalk@^2.0.1, chalk@^2.1.0, chalk@^2.3.0, chalk@^2.3.1, chalk@^2.3 escape-string-regexp "^1.0.5" supports-color "^5.3.0" +chalk@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-3.0.0.tgz#3f73c2bf526591f574cc492c51e2456349f844e4" + integrity sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + chalk@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.0.0.tgz#6e98081ed2d17faab615eb52ac66ec1fe6209e72" @@ -5237,7 +5265,7 @@ chrome-trace-event@^1.0.2: dependencies: tslib "^1.9.0" -ci-info@^1.5.0, ci-info@^1.6.0: +ci-info@^1.6.0: version "1.6.0" resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-1.6.0.tgz#2ca20dbb9ceb32d4524a683303313f0304b1e497" integrity sha512-vsGdkwSCDpWmP80ncATX7iea5DWQemg1UgCW5J8tqjU3lYw4FBYuj89J0CTVomA7BEfvSZd84GmHko+MxFQU2A== @@ -7966,19 +7994,6 @@ execa@^0.7.0: signal-exit "^3.0.0" strip-eof "^1.0.0" -execa@^0.8.0: - version "0.8.0" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.8.0.tgz#d8d76bbc1b55217ed190fd6dd49d3c774ecfc8da" - integrity sha1-2NdrvBtVIX7RkP1t1J08d07PyNo= - dependencies: - cross-spawn "^5.0.1" - get-stream "^3.0.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - execa@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/execa/-/execa-1.0.0.tgz#c6236a5bb4df6d6f15e88e7f017798216749ddd8" @@ -10017,14 +10032,10 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" -husky@0.14.3: - version "0.14.3" - resolved "https://registry.yarnpkg.com/husky/-/husky-0.14.3.tgz#c69ed74e2d2779769a17ba8399b54ce0b63c12c3" - integrity sha512-e21wivqHpstpoiWA/Yi8eFti8E+sQDSS53cpJsPptPs295QTOQR0ZwnHo2TXy1XOpZFD9rPOd3NpmqTK6uMLJA== - dependencies: - is-ci "^1.0.10" - normalize-path "^1.0.0" - strip-indent "^2.0.0" +husky@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/husky/-/husky-5.2.0.tgz#fc5e1c2300d34855d47de4753607d00943fc0802" + integrity sha512-AM8T/auHXRBxlrfPVLKP6jt49GCM2Zz47m8G3FOMsLmTv8Dj/fKVWE0Rh2d4Qrvmy131xEsdQnb3OXRib67PGg== iconv-lite@0.4.24, iconv-lite@^0.4.17, iconv-lite@^0.4.19, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: version "0.4.24" @@ -10062,7 +10073,7 @@ ignore-walk@^3.0.1: dependencies: minimatch "^3.0.4" -ignore@^3.3.3, ignore@^3.3.5, ignore@^3.3.7: +ignore@^3.3.3, ignore@^3.3.5: version "3.3.10" resolved "https://registry.yarnpkg.com/ignore/-/ignore-3.3.10.tgz#0a97fb876986e8081c631160f8f9f389157f0043" integrity sha512-Pgs951kaMm5GXP7MOvxERINe3gsaVjUWFm+UZPSq9xYriQAksyhg0csnS0KXSNRD5NmNdapXEpjxG49+AKh/ug== @@ -10072,6 +10083,11 @@ ignore@^4.0.3, ignore@^4.0.6: resolved "https://registry.yarnpkg.com/ignore/-/ignore-4.0.6.tgz#750e3db5862087b4737ebac8207ffd1ef27b25fc" integrity sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg== +ignore@^5.1.4: + version "5.1.8" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57" + integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw== + image-size@^0.5.1: version "0.5.5" resolved "https://registry.yarnpkg.com/image-size/-/image-size-0.5.5.tgz#09dfd4ab9d20e29eb1c3e80b8990378df9e3cb9c" @@ -10472,13 +10488,6 @@ is-callable@^1.1.4: resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.4.tgz#1e1adf219e1eeb684d691f9d6a05ff0d30a24d75" integrity sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA== -is-ci@^1.0.10: - version "1.2.1" - resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.2.1.tgz#e3779c8ee17fccf428488f6e281187f2e632841c" - integrity sha512-s6tfsaQaQi3JNciBH6shVqEDvhGut0SUXr31ag8Pd8BBbVVlcGfWhpPmEOoM6RJ5TFhbypvf5yyRw/VXW1IiWg== - dependencies: - ci-info "^1.5.0" - is-ci@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-2.0.0.tgz#6bc6334181810e04b5c22b3d589fdca55026404c" @@ -12849,10 +12858,10 @@ move-concurrently@^1.0.1: rimraf "^2.5.4" run-queue "^1.0.3" -mri@^1.1.0: - version "1.1.4" - resolved "https://registry.yarnpkg.com/mri/-/mri-1.1.4.tgz#7cb1dd1b9b40905f1fac053abe25b6720f44744a" - integrity sha512-6y7IjGPm8AzlvoUrwAaw1tLnUBudaS3752vcd8JtrpGGQn+rXIe63LFVHm/YMwtqAuh+LJPCFdlLYPWM1nYn6w== +mri@^1.1.5: + version "1.1.6" + resolved "https://registry.yarnpkg.com/mri/-/mri-1.1.6.tgz#49952e1044db21dbf90f6cd92bc9c9a777d415a6" + integrity sha512-oi1b3MfbyGa7FJMP9GmLTttni5JoICpYBRlq+x5V16fZbLsnL9N3wFqqIm/nIG43FjUFkFh9Epzp/kzUGUnJxQ== ms@2.0.0: version "2.0.0" @@ -12879,6 +12888,17 @@ multimatch@^3.0.0: arrify "^1.0.1" minimatch "^3.0.4" +multimatch@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/multimatch/-/multimatch-4.0.0.tgz#8c3c0f6e3e8449ada0af3dd29efb491a375191b3" + integrity sha512-lDmx79y1z6i7RNx0ZGCPq1bzJ6ZoDDKbvh7jxr9SJcWLkShMzXrHbYVpTdnhNM5MXpDUxCQ4DgqVttVXlBgiBQ== + dependencies: + "@types/minimatch" "^3.0.3" + array-differ "^3.0.0" + array-union "^2.1.0" + arrify "^2.0.1" + minimatch "^3.0.4" + multipipe@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/multipipe/-/multipipe-0.1.2.tgz#2a8f2ddf70eed564dff2d57f1e1a137d9f05078b" @@ -13229,11 +13249,6 @@ normalize-package-data@^2.0.0, normalize-package-data@^2.3.0, normalize-package- semver "2 || 3 || 4 || 5" validate-npm-package-license "^3.0.1" -normalize-path@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-1.0.0.tgz#32d0e472f91ff345701c15a8311018d3b0a90379" - integrity sha1-MtDkcvkf80VwHBWoMRAY07CpA3k= - normalize-path@^2.0.0, normalize-path@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" @@ -14750,17 +14765,17 @@ pretty-ms@^0.2.1: dependencies: parse-ms "^0.1.0" -pretty-quick@^1.11.1: - version "1.11.1" - resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-1.11.1.tgz#462ffa2b93d24c05b7a0c3a001e08601a0c55ee4" - integrity sha512-kSXCkcETfak7EQXz6WOkCeCqpbC4GIzrN/vaneTGMP/fAtD8NerA9bPhCUqHAks1geo7biZNl5uEMPceeneLuA== +pretty-quick@^3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/pretty-quick/-/pretty-quick-3.1.0.tgz#cb172e9086deb57455dea7c7e8f136cd0a4aef6c" + integrity sha512-DtxIxksaUWCgPFN7E1ZZk4+Aav3CCuRdhrDSFZENb404sYMtuo9Zka823F+Mgeyt8Zt3bUiCjFzzWYE9LYqkmQ== dependencies: - chalk "^2.3.0" - execa "^0.8.0" - find-up "^2.1.0" - ignore "^3.3.7" - mri "^1.1.0" - multimatch "^3.0.0" + chalk "^3.0.0" + execa "^4.0.0" + find-up "^4.1.0" + ignore "^5.1.4" + mri "^1.1.5" + multimatch "^4.0.0" pretty-time@^1.1.0: version "1.1.0" From 569687afbdb3ef99b223f8e371c1495fc358eba4 Mon Sep 17 00:00:00 2001 From: Maximilian <787658+mfranzke@users.noreply.github.com> Date: Sun, 28 Mar 2021 22:32:05 +0200 Subject: [PATCH 02/10] refactor: updated prettier dependency and removed rules "trailingComma": "es5" as this is the new default --- .prettierrc | 1 - package.json | 2 +- packages/cli/package.json | 2 +- packages/core/package.json | 2 +- packages/docs/package.json | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.prettierrc b/.prettierrc index d81dbaeb5..3baced411 100644 --- a/.prettierrc +++ b/.prettierrc @@ -1,5 +1,4 @@ { "singleQuote": true, - "trailingComma": "es5", "endOfLine": "auto" } diff --git a/package.json b/package.json index 0b0485bc6..6d9f948c1 100644 --- a/package.json +++ b/package.json @@ -18,11 +18,11 @@ "eslint-config-prettier": "^6.0.0", "eslint-plugin-import": "^2.18.2", "eslint-plugin-prettier": "^3.1.0", - "prettier": "^1.14.3", "husky": "^5.2.0", "lerna": "3.17.0", "auto": "^9.40.5", "@auto-it/released": "^9.40.5" + "prettier": "^2.2.1", "pretty-quick": "^3.1.0" }, "repository": { diff --git a/packages/cli/package.json b/packages/cli/package.json index 40a00abe1..dfd23e277 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -34,7 +34,7 @@ "eslint": "4.18.2", "eslint-config-prettier": "2.9.0", "eslint-plugin-prettier": "2.6.0", - "prettier": "1.11.1", + "prettier": "2.2.1", "proxyquire": "2.0.1", "tap": "14.6.4" }, diff --git a/packages/core/package.json b/packages/core/package.json index 6c1262012..c85d874d5 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -31,7 +31,7 @@ "eslint-plugin-import": "^2.18.2", "eslint-plugin-prettier": "^3.1.0", "jsdoc-to-markdown": "5.0.1", - "prettier": "^1.14.3", + "prettier": "^2.2.1", "rewire": "2.5.2", "standard-version": "9.0.0", "tap": "14.6.4" diff --git a/packages/docs/package.json b/packages/docs/package.json index 468655851..0406bbf38 100755 --- a/packages/docs/package.json +++ b/packages/docs/package.json @@ -23,7 +23,7 @@ "chokidar-cli": "^2.1.0", "cross-env": "^5.2.0", "make-dir-cli": "^2.0.0", - "prettier": "^1.18.2", + "prettier": "^2.2.1", "rollup": "^1.16.1", "rollup-plugin-commonjs": "^10.0.0", "rollup-plugin-json": "^4.0.0", From 2e28f60d83ecdf886de7f3f02d25adafbaf400ee Mon Sep 17 00:00:00 2001 From: Maximilian <787658+mfranzke@users.noreply.github.com> Date: Sun, 28 Mar 2021 22:33:57 +0200 Subject: [PATCH 03/10] fix: added missing comma --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6d9f948c1..66fb9b314 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "husky": "^5.2.0", "lerna": "3.17.0", "auto": "^9.40.5", - "@auto-it/released": "^9.40.5" + "@auto-it/released": "^9.40.5", "prettier": "^2.2.1", "pretty-quick": "^3.1.0" }, From ab2c2b0d570a68e865f987538bbd3bcd4d71b96b Mon Sep 17 00:00:00 2001 From: Maximilian <787658+mfranzke@users.noreply.github.com> Date: Sun, 28 Mar 2021 22:36:51 +0200 Subject: [PATCH 04/10] refactor: regenerated yarn.lock file --- yarn.lock | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/yarn.lock b/yarn.lock index 1030cc065..8fa1cd49d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14725,20 +14725,10 @@ prettier-linter-helpers@^1.0.0: dependencies: fast-diff "^1.1.2" -prettier@1.11.1: - version "1.11.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.11.1.tgz#61e43fc4cd44e68f2b0dfc2c38cd4bb0fccdcc75" - integrity sha512-T/KD65Ot0PB97xTrG8afQ46x3oiVhnfGjGESSI9NWYcG92+OUPZKkwHqGWXH2t9jK1crnQjubECW0FuOth+hxw== - -prettier@^1.14.3: - version "1.18.2" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.18.2.tgz#6823e7c5900017b4bd3acf46fe9ac4b4d7bda9ea" - integrity sha512-OeHeMc0JhFE9idD4ZdtNibzY0+TPHSpSSb9h8FqtP+YnoZZ1sl8Vc9b1sasjfymH3SonAF4QcA2+mzHPhMvIiw== - -prettier@^1.18.2: - version "1.19.1" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" - integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== +prettier@2.2.1, prettier@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5" + integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q== pretty-error@^2.0.2, pretty-error@^2.1.1: version "2.1.1" From afef966fec13cfcf0a6aab5605ad575a64693f0a Mon Sep 17 00:00:00 2001 From: Maximilian <787658+mfranzke@users.noreply.github.com> Date: Sun, 28 Mar 2021 23:11:46 +0200 Subject: [PATCH 05/10] refactor(husky): made additional necessary changes for the installation as well as moved husky to the devDependencies, as defined by the software doc itself --- package.json | 10 +++++++--- yarn.lock | 12 ++++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 66fb9b314..436b7d298 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,6 @@ "eslint-config-prettier": "^6.0.0", "eslint-plugin-import": "^2.18.2", "eslint-plugin-prettier": "^3.1.0", - "husky": "^5.2.0", "lerna": "3.17.0", "auto": "^9.40.5", "@auto-it/released": "^9.40.5", @@ -31,7 +30,7 @@ }, "private": true, "scripts": { - "postinstall": "lerna run postbootstrap", + "postinstall": "husky install && lerna run postbootstrap", "setup": "yarn", "build:uikit": "cd packages/uikit-workshop && npm run build", "precommit": "pretty-quick --staged", @@ -40,7 +39,8 @@ "test": "lerna run test", "clean": "git clean -dfx", "publish": "npx lerna publish -m \"[skip travis] chore(release): publish %s\"", - "postpublish": "auto release", + "prepublishOnly": "pinst --disable", + "postpublish": "pinst --enable && auto release", "preview:docs": "cd packages/docs && yarn production", "preview:hbs": "cd packages/development-edition-engine-handlebars && yarn pl:starterkit && yarn pl:build", "prepare": "husky install" @@ -52,5 +52,9 @@ "packages/core/test", "packages/live-server" ] + }, + "devDependencies": { + "husky": "^5.2.0", + "pinst": "^2.1.6" } } diff --git a/yarn.lock b/yarn.lock index 8fa1cd49d..36325e37e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8692,6 +8692,11 @@ fromentries@^1.2.0: resolved "https://registry.yarnpkg.com/fromentries/-/fromentries-1.2.0.tgz#e6aa06f240d6267f913cea422075ef88b63e7897" integrity sha512-33X7H/wdfO99GdRLLgkjUrD4geAFdq/Uv0kl3HD4da6HDixd2GUg8Mw7dahLCV9r/EARkmtYBB6Tch4EEokFTQ== +fromentries@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/fromentries/-/fromentries-1.3.2.tgz#e4bca6808816bf8f93b52750f1127f5a6fd86e3a" + integrity sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg== + fs-access@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/fs-access/-/fs-access-1.0.1.tgz#d6a87f262271cefebec30c553407fb995da8777a" @@ -14267,6 +14272,13 @@ pinkie@^2.0.0: resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= +pinst@^2.1.6: + version "2.1.6" + resolved "https://registry.yarnpkg.com/pinst/-/pinst-2.1.6.tgz#8d968b8ec1dac5dddcfc976c735592dbec58b42c" + integrity sha512-B4dYmf6nEXg1NpDSB+orYWvKa5Kfmz5KzWC29U59dpVM4S/+xp0ak/JMEsw04UQTNNKps7klu0BUalr343Gt9g== + dependencies: + fromentries "^1.3.2" + pirates@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/pirates/-/pirates-3.0.2.tgz#7e6f85413fd9161ab4e12b539b06010d85954bb9" From b552401940257e174fca098120f40fde779d3e2d Mon Sep 17 00:00:00 2001 From: Maximilian <787658+mfranzke@users.noreply.github.com> Date: Sun, 28 Mar 2021 23:27:09 +0200 Subject: [PATCH 06/10] refactor(pinst): remove that solution again see https://github.com/typicode/husky/issues/884 --- package.json | 8 +++----- yarn.lock | 12 ------------ 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/package.json b/package.json index 436b7d298..7c383f7ee 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ }, "private": true, "scripts": { - "postinstall": "husky install && lerna run postbootstrap", + "postinstall": "lerna run postbootstrap", "setup": "yarn", "build:uikit": "cd packages/uikit-workshop && npm run build", "precommit": "pretty-quick --staged", @@ -39,8 +39,7 @@ "test": "lerna run test", "clean": "git clean -dfx", "publish": "npx lerna publish -m \"[skip travis] chore(release): publish %s\"", - "prepublishOnly": "pinst --disable", - "postpublish": "pinst --enable && auto release", + "postpublish": "auto release", "preview:docs": "cd packages/docs && yarn production", "preview:hbs": "cd packages/development-edition-engine-handlebars && yarn pl:starterkit && yarn pl:build", "prepare": "husky install" @@ -54,7 +53,6 @@ ] }, "devDependencies": { - "husky": "^5.2.0", - "pinst": "^2.1.6" + "husky": "^5.2.0" } } diff --git a/yarn.lock b/yarn.lock index 36325e37e..8fa1cd49d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8692,11 +8692,6 @@ fromentries@^1.2.0: resolved "https://registry.yarnpkg.com/fromentries/-/fromentries-1.2.0.tgz#e6aa06f240d6267f913cea422075ef88b63e7897" integrity sha512-33X7H/wdfO99GdRLLgkjUrD4geAFdq/Uv0kl3HD4da6HDixd2GUg8Mw7dahLCV9r/EARkmtYBB6Tch4EEokFTQ== -fromentries@^1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/fromentries/-/fromentries-1.3.2.tgz#e4bca6808816bf8f93b52750f1127f5a6fd86e3a" - integrity sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg== - fs-access@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/fs-access/-/fs-access-1.0.1.tgz#d6a87f262271cefebec30c553407fb995da8777a" @@ -14272,13 +14267,6 @@ pinkie@^2.0.0: resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= -pinst@^2.1.6: - version "2.1.6" - resolved "https://registry.yarnpkg.com/pinst/-/pinst-2.1.6.tgz#8d968b8ec1dac5dddcfc976c735592dbec58b42c" - integrity sha512-B4dYmf6nEXg1NpDSB+orYWvKa5Kfmz5KzWC29U59dpVM4S/+xp0ak/JMEsw04UQTNNKps7klu0BUalr343Gt9g== - dependencies: - fromentries "^1.3.2" - pirates@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/pirates/-/pirates-3.0.2.tgz#7e6f85413fd9161ab4e12b539b06010d85954bb9" From 48066efbf8fea75b2982cb6765d15b60f6128acb Mon Sep 17 00:00:00 2001 From: Maximilian <787658+mfranzke@users.noreply.github.com> Date: Mon, 29 Mar 2021 00:01:16 +0200 Subject: [PATCH 07/10] refactor(code): integrated prettier feedback that was enforced like this by eslint --- packages/core/src/lib/addPattern.js | 2 +- packages/core/src/lib/annotation_exporter.js | 10 +-- packages/core/src/lib/buildFooter.js | 6 +- packages/core/src/lib/buildListItems.js | 2 +- packages/core/src/lib/buildPatterns.js | 24 +++-- packages/core/src/lib/changes_hunter.js | 12 +-- packages/core/src/lib/cleanBuildDirectory.js | 4 +- packages/core/src/lib/compose.js | 10 +-- packages/core/src/lib/copier.js | 10 +-- packages/core/src/lib/copyFile.js | 4 +- packages/core/src/lib/dataMerger.js | 6 +- packages/core/src/lib/data_loader.js | 2 +- packages/core/src/lib/decompose.js | 4 +- packages/core/src/lib/expandPartials.js | 11 +-- packages/core/src/lib/exportData.js | 2 +- packages/core/src/lib/findModules.js | 8 +- packages/core/src/lib/get.js | 2 +- packages/core/src/lib/isScopedPackage.js | 2 +- packages/core/src/lib/lineage_hunter.js | 8 +- packages/core/src/lib/list_item_hunter.js | 4 +- packages/core/src/lib/loadPattern.js | 4 +- packages/core/src/lib/loaduikits.js | 4 +- packages/core/src/lib/log.js | 4 +- packages/core/src/lib/markModifiedPatterns.js | 10 +-- packages/core/src/lib/markdown_parser.js | 4 +- packages/core/src/lib/object_factory.js | 36 ++++---- packages/core/src/lib/parameter_hunter.js | 6 +- packages/core/src/lib/parseAllLinks.js | 2 +- packages/core/src/lib/parseLink.js | 8 +- packages/core/src/lib/pattern_engines.js | 20 ++--- packages/core/src/lib/pattern_exporter.js | 9 +- packages/core/src/lib/pattern_graph.js | 72 +++++++-------- packages/core/src/lib/pattern_graph_dot.js | 4 +- packages/core/src/lib/pattern_registry.js | 18 ++-- packages/core/src/lib/patternlab.js | 28 +++--- packages/core/src/lib/plugin_manager.js | 10 +-- packages/core/src/lib/processIterative.js | 2 +- packages/core/src/lib/processMetaPattern.js | 4 +- packages/core/src/lib/processRecursive.js | 4 +- packages/core/src/lib/pseudopattern_hunter.js | 9 +- packages/core/src/lib/readDocumentation.js | 2 +- packages/core/src/lib/render.js | 2 +- packages/core/src/lib/replaceParameter.js | 2 +- packages/core/src/lib/resolver.js | 2 +- packages/core/src/lib/server.js | 6 +- packages/core/src/lib/starterkit_manager.js | 34 +++---- .../core/src/lib/style_modifier_hunter.js | 4 +- packages/core/src/lib/ui_builder.js | 89 ++++++++++--------- packages/core/src/lib/watchAssets.js | 6 +- packages/core/src/lib/watchPatternLabFiles.js | 24 ++--- 50 files changed, 282 insertions(+), 280 deletions(-) diff --git a/packages/core/src/lib/addPattern.js b/packages/core/src/lib/addPattern.js index 12c0c9429..0534c5dfd 100644 --- a/packages/core/src/lib/addPattern.js +++ b/packages/core/src/lib/addPattern.js @@ -2,7 +2,7 @@ const logger = require('./log'); -module.exports = function(pattern, patternlab) { +module.exports = function (pattern, patternlab) { //add the link to the global object if (!patternlab.data.link) { patternlab.data.link = {}; diff --git a/packages/core/src/lib/annotation_exporter.js b/packages/core/src/lib/annotation_exporter.js index 7ed86da28..dffb01253 100644 --- a/packages/core/src/lib/annotation_exporter.js +++ b/packages/core/src/lib/annotation_exporter.js @@ -6,7 +6,7 @@ const _ = require('lodash'); const mp = require('./markdown_parser'); const logger = require('./log'); -const annotations_exporter = function(pl) { +const annotations_exporter = function (pl) { const paths = pl.config.paths; let oldAnnotations; @@ -68,7 +68,7 @@ const annotations_exporter = function(pl) { //let annotations = annotations; const markdown_parser = parser; - return function(filePath) { + return function (filePath) { const annotationsMD = fs.readFileSync(path.resolve(filePath), 'utf8'); //take the annotation snippets and split them on our custom delimiter @@ -110,13 +110,13 @@ const annotations_exporter = function(pl) { } return { - gather: function() { + gather: function () { return gatherAnnotations(); }, - gatherJS: function() { + gatherJS: function () { return parseAnnotationsJS(); }, - gatherMD: function() { + gatherMD: function () { return parseAnnotationsMD(); }, }; diff --git a/packages/core/src/lib/buildFooter.js b/packages/core/src/lib/buildFooter.js index 1a4a56652..6d0c4351c 100644 --- a/packages/core/src/lib/buildFooter.js +++ b/packages/core/src/lib/buildFooter.js @@ -13,7 +13,7 @@ let render = require('./render'); //eslint-disable-line prefer-const * @param patternPartial - the partial key to build this for, either viewall-patternPartial or a viewall-patternGroup-all * @returns A promise which resolves with the HTML */ -module.exports = function(patternlab, patternPartial, uikit) { +module.exports = function (patternlab, patternPartial, uikit) { //first render the general footer return render(Pattern.createEmpty({ extendedTemplate: uikit.footer }), { patternData: JSON.stringify({ @@ -21,7 +21,7 @@ module.exports = function(patternlab, patternPartial, uikit) { }), cacheBuster: patternlab.cacheBuster, }) - .then(footerPartial => { + .then((footerPartial) => { let allFooterData; try { allFooterData = jsonCopy( @@ -36,7 +36,7 @@ module.exports = function(patternlab, patternPartial, uikit) { return render(patternlab.userFoot, allFooterData); }) - .catch(reason => { + .catch((reason) => { console.log(reason); logger.error('Error building buildFooterHTML'); }); diff --git a/packages/core/src/lib/buildListItems.js b/packages/core/src/lib/buildListItems.js index af9ba783d..7eb214f12 100644 --- a/packages/core/src/lib/buildListItems.js +++ b/packages/core/src/lib/buildListItems.js @@ -26,7 +26,7 @@ const items = [ 'twenty', ]; -module.exports = function(container) { +module.exports = function (container) { //combine all list items into one structure const list = []; for (const item in container.listitems) { diff --git a/packages/core/src/lib/buildPatterns.js b/packages/core/src/lib/buildPatterns.js index b5929c4f7..476a373c6 100644 --- a/packages/core/src/lib/buildPatterns.js +++ b/packages/core/src/lib/buildPatterns.js @@ -119,7 +119,7 @@ module.exports = async (deletePatternDir, patternlab, additionalData) => { cacheBuster: patternlab.cacheBuster, } ) - .then(results => { + .then((results) => { patternlab.data.patternLabHead = results; // If deletePatternDir == true or graph needs to be updated @@ -133,7 +133,7 @@ module.exports = async (deletePatternDir, patternlab, additionalData) => { if (patternlab.incrementalBuildsEnabled) { // When the graph was loaded from file, some patterns might have been moved/deleted between runs // so the graph data become out of sync - patternlab.graph.sync().forEach(n => { + patternlab.graph.sync().forEach((n) => { logger.info('[Deleted/Moved] ' + n); }); @@ -150,14 +150,10 @@ module.exports = async (deletePatternDir, patternlab, additionalData) => { } //render all patterns last, so lineageR works const allPatternsPromise = patternsToBuild.map( - async pattern => - await compose( - pattern, - patternlab - ) + async (pattern) => await compose(pattern, patternlab) ); //copy non-pattern files like JavaScript - const allJS = patternsToBuild.map(pattern => { + const allJS = patternsToBuild.map((pattern) => { const { name, patternPartial, subdir } = pattern; const { source: { patterns: sourceDir }, @@ -165,7 +161,7 @@ module.exports = async (deletePatternDir, patternlab, additionalData) => { } = patternlab.config.paths; const src = path.join(sourceDir, subdir); const dest = path.join(publicDir, name); - return map(patternlab.uikits, uikit => { + return map(patternlab.uikits, (uikit) => { return copy( src, path.resolve(process.cwd(), uikit.outputDir, dest), @@ -203,27 +199,27 @@ module.exports = async (deletePatternDir, patternlab, additionalData) => { //export patterns if necessary pattern_exporter.export_patterns(patternlab); }) - .catch(reason => { + .catch((reason) => { console.log(reason); logger.error('Error rendering patterns'); }); }) - .catch(reason => { + .catch((reason) => { console.log(reason); logger.error('Error rendering pattern lab header'); }); }) - .catch(reason => { + .catch((reason) => { console.log(reason); logger.error('Error processing meta patterns'); }); }) - .catch(reason => { + .catch((reason) => { console.log(reason); logger.error('Error processing patterns recursively'); }); }) - .catch(reason => { + .catch((reason) => { console.log(reason); logger.error('Error in buildPatterns()'); }); diff --git a/packages/core/src/lib/changes_hunter.js b/packages/core/src/lib/changes_hunter.js index 038be8b41..ee4a4d52c 100644 --- a/packages/core/src/lib/changes_hunter.js +++ b/packages/core/src/lib/changes_hunter.js @@ -12,7 +12,7 @@ let fs = require('fs-extra'); //eslint-disable-line prefer-const * For detecting changed patterns. * @constructor */ -const ChangesHunter = function() {}; +const ChangesHunter = function () {}; ChangesHunter.prototype = { /** @@ -25,7 +25,7 @@ ChangesHunter.prototype = { * * @see {@link CompileState} */ - checkBuildState: function(pattern, patternlab) { + checkBuildState: function (pattern, patternlab) { //write the compiled template to the public patterns directory const renderedTemplatePath = patternlab.config.paths.public.patterns + @@ -40,12 +40,12 @@ ChangesHunter.prototype = { pattern.compileState = CompileState.NEEDS_REBUILD; } - _.each(patternlab.uikits, uikit => { + _.each(patternlab.uikits, (uikit) => { try { // renderedTemplatePath required to display a single element // Markup only is required for "View All" pages. It will get loaded later on. // If any of these is missing, mark pattern for recompile - [renderedTemplatePath, markupOnlyPath].forEach(renderedFile => { + [renderedTemplatePath, markupOnlyPath].forEach((renderedFile) => { // Prevent error message if file does not exist fs.accessSync( path.join(process.cwd(), uikit.outputDir, renderedFile), @@ -94,7 +94,7 @@ ChangesHunter.prototype = { * @param {Pattern} currentPattern * @param {string} file */ - checkLastModified: function(currentPattern, file) { + checkLastModified: function (currentPattern, file) { if (file && fs.pathExistsSync(file)) { try { const stat = fs.statSync(file); @@ -110,7 +110,7 @@ ChangesHunter.prototype = { } }, - needsRebuild: function(lastModified, p) { + needsRebuild: function (lastModified, p) { if (p.compileState !== CompileState.CLEAN || !p.lastModified) { return true; } diff --git a/packages/core/src/lib/cleanBuildDirectory.js b/packages/core/src/lib/cleanBuildDirectory.js index 11d78c01e..0cfc300e0 100644 --- a/packages/core/src/lib/cleanBuildDirectory.js +++ b/packages/core/src/lib/cleanBuildDirectory.js @@ -15,12 +15,12 @@ module.exports = (incrementalBuildsEnabled, patternlab) => { return Promise.resolve(); } else { return Promise.all( - _.map(patternlab.uikits, uikit => { + _.map(patternlab.uikits, (uikit) => { return fs.emptyDir( path.join(process.cwd(), uikit.outputDir, paths.public.patterns) ); }) - ).catch(reason => { + ).catch((reason) => { logger.error(reason); }); } diff --git a/packages/core/src/lib/compose.js b/packages/core/src/lib/compose.js index 1816b1dfc..6eeeb50fd 100644 --- a/packages/core/src/lib/compose.js +++ b/packages/core/src/lib/compose.js @@ -15,7 +15,7 @@ const pluginManager = new pm(); const Pattern = require('./object_factory').Pattern; const CompileState = require('./object_factory').CompileState; -module.exports = async function(pattern, patternlab) { +module.exports = async function (pattern, patternlab) { // Pattern does not need to be built and recompiled more than once if (!pattern.isPattern || pattern.compileState === CompileState.CLEAN) { return Promise.resolve(false); @@ -41,7 +41,7 @@ module.exports = async function(pattern, patternlab) { ); return Promise.all( - _.map(patternlab.uikits, uikit => { + _.map(patternlab.uikits, (uikit) => { // exclude pattern from uikit rendering if (uikitExcludePattern(pattern, uikit)) { return Promise.resolve(); @@ -154,7 +154,7 @@ module.exports = async function(pattern, patternlab) { patternPartialPromise, footerPartialPromise, ]) - .then(intermediateResults => { + .then((intermediateResults) => { // retrieve results of promises const headHTML = intermediateResults[0]; //headPromise pattern.patternPartialCode = intermediateResults[1]; //patternPartialPromise @@ -178,7 +178,7 @@ module.exports = async function(pattern, patternlab) { allFooterData.patternLabFoot = footerPartial; return render(patternlab.userFoot, allFooterData).then( - async footerHTML => { + async (footerHTML) => { /////////////// // WRITE FILES /////////////// @@ -212,7 +212,7 @@ module.exports = async function(pattern, patternlab) { } ); }) - .catch(reason => { + .catch((reason) => { console.log(reason); }); }) diff --git a/packages/core/src/lib/copier.js b/packages/core/src/lib/copier.js index 441ffdf5b..ef7990ec5 100644 --- a/packages/core/src/lib/copier.js +++ b/packages/core/src/lib/copier.js @@ -8,7 +8,7 @@ const watchAssets = require('./watchAssets'); const watchPatternLabFiles = require('./watchPatternLabFiles'); const copier = () => { - const transform_paths = directories => { + const transform_paths = (directories) => { //create array with all source keys minus our blacklist const dirs = {}; const blackList = [ @@ -66,7 +66,7 @@ const copier = () => { } else { //just copy copyPromises.push( - _.map(patternlab.uikits, uikit => { + _.map(patternlab.uikits, (uikit) => { copyFile( dir.source, path.join(basePath, uikit.outputDir, dir.public), @@ -79,7 +79,7 @@ const copier = () => { // copy the styleguide copyPromises.push( - _.map(patternlab.uikits, uikit => { + _.map(patternlab.uikits, (uikit) => { copyFile( path.join(uikit.modulePath, assetDirectories.source.styleguide), path.join(basePath, uikit.outputDir, assetDirectories.public.root), @@ -90,7 +90,7 @@ const copier = () => { // copy the favicon copyPromises.push( - _.map(patternlab.uikits, uikit => { + _.map(patternlab.uikits, (uikit) => { copyFile( `${assetDirectories.source.root}/favicon.ico`, path.join( @@ -116,7 +116,7 @@ const copier = () => { copyAndWatch: (assetDirectories, patternlab, options) => { return copyAndWatch(assetDirectories, patternlab, options); }, - transformConfigPaths: paths => { + transformConfigPaths: (paths) => { return transform_paths(paths); }, }; diff --git a/packages/core/src/lib/copyFile.js b/packages/core/src/lib/copyFile.js index ce1bc056a..c8202afe1 100644 --- a/packages/core/src/lib/copyFile.js +++ b/packages/core/src/lib/copyFile.js @@ -7,10 +7,10 @@ let copy = require('recursive-copy'); // eslint-disable-line prefer-const const copyFile = (p, dest, options) => { return copy(p, dest, options) - .on(copy.events.ERROR, function(error, copyOperation) { + .on(copy.events.ERROR, function (error, copyOperation) { logger.error('Unable to copy ' + copyOperation.dest); }) - .on(copy.events.COPY_FILE_ERROR, error => { + .on(copy.events.COPY_FILE_ERROR, (error) => { logger.error(error); }) .on(copy.events.COPY_FILE_COMPLETE, () => { diff --git a/packages/core/src/lib/dataMerger.js b/packages/core/src/lib/dataMerger.js index 5ebdd21bb..08544c320 100644 --- a/packages/core/src/lib/dataMerger.js +++ b/packages/core/src/lib/dataMerger.js @@ -9,7 +9,11 @@ const _ = require('lodash'); * @param {*} dataToMergeWithObject the object that should be merged with the original data * @param {*} patternlabConfig the patternlab configuration object */ -module.exports = function(dataObject, dataToMergeWithObject, patternlabConfig) { +module.exports = function ( + dataObject, + dataToMergeWithObject, + patternlabConfig +) { return _.mergeWith( {}, dataObject, diff --git a/packages/core/src/lib/data_loader.js b/packages/core/src/lib/data_loader.js index f1ac874c2..594f4b700 100644 --- a/packages/core/src/lib/data_loader.js +++ b/packages/core/src/lib/data_loader.js @@ -53,7 +53,7 @@ function loadDataFromFolder(dataFilesPath, excludeFileNames, fsDep) { const dataFiles = glob.sync(dataFilesFullPath, globOptions); let mergeObject = {}; - dataFiles.forEach(function(filePath) { + dataFiles.forEach(function (filePath) { try { const jsonData = yaml.safeLoad( fsDep.readFileSync(path.resolve(filePath), 'utf8') diff --git a/packages/core/src/lib/decompose.js b/packages/core/src/lib/decompose.js index e541708b5..4c35cd694 100644 --- a/packages/core/src/lib/decompose.js +++ b/packages/core/src/lib/decompose.js @@ -16,7 +16,7 @@ const list_item_hunter = new lih(); * @param patternlab - global data store * @param ignoreLineage - whether or not to hunt for lineage for this pattern */ -module.exports = function(pattern, patternlab, ignoreLineage) { +module.exports = function (pattern, patternlab, ignoreLineage) { //set the extendedTemplate to operate on later if we find partials to replace if (!pattern.extendedTemplate) { pattern.extendedTemplate = pattern.template; @@ -51,7 +51,7 @@ module.exports = function(pattern, patternlab, ignoreLineage) { expandPartialPromise, lineagePromise, addPromise, - ]).catch(reason => { + ]).catch((reason) => { logger.error(reason); }); }; diff --git a/packages/core/src/lib/expandPartials.js b/packages/core/src/lib/expandPartials.js index 0a9200052..908b6377a 100644 --- a/packages/core/src/lib/expandPartials.js +++ b/packages/core/src/lib/expandPartials.js @@ -9,7 +9,7 @@ const getPartial = require('./get'); const parameter_hunter = new ph(); const style_modifier_hunter = new smh(); -module.exports = function(currentPattern, patternlab) { +module.exports = function (currentPattern, patternlab) { const processRecursive = require('./processRecursive'); //find how many partials there may be for the given pattern @@ -20,7 +20,8 @@ module.exports = function(currentPattern, patternlab) { // results if ( currentPattern.engine.expandPartials && - (foundPatternPartials !== null && foundPatternPartials.length > 0) + foundPatternPartials !== null && + foundPatternPartials.length > 0 ) { logger.debug(`found partials for ${currentPattern.patternPartial}`); @@ -30,7 +31,7 @@ module.exports = function(currentPattern, patternlab) { .find_parameters(currentPattern, patternlab) .then(() => { //do something with the regular old partials - foundPatternPartials.forEach(foundPartial => { + foundPatternPartials.forEach((foundPartial) => { const partial = currentPattern.findPartial(foundPartial); const partialPattern = getPartial(partial, patternlab); @@ -75,13 +76,13 @@ module.exports = function(currentPattern, patternlab) { return Promise.resolve(); }) - .catch(reason => { + .catch((reason) => { console.log(reason); logger.error(reason); }); }); }) - .catch(reason => { + .catch((reason) => { console.log(reason); logger.error(reason); }); diff --git a/packages/core/src/lib/exportData.js b/packages/core/src/lib/exportData.js index 034f1f294..a229cc815 100644 --- a/packages/core/src/lib/exportData.js +++ b/packages/core/src/lib/exportData.js @@ -11,7 +11,7 @@ let fs = require('fs-extra'); //eslint-disable-line prefer-const * Write out our pattern information for use by the front end * @param patternlab - global data store */ -module.exports = function(patternlab, uikit) { +module.exports = function (patternlab, uikit) { const annotation_exporter = new ae(patternlab); const paths = patternlab.config.paths; diff --git a/packages/core/src/lib/findModules.js b/packages/core/src/lib/findModules.js index 246612ec8..f54f80d4f 100644 --- a/packages/core/src/lib/findModules.js +++ b/packages/core/src/lib/findModules.js @@ -6,7 +6,7 @@ const isScopedPackage = require('./isScopedPackage'); let fs = require('fs-extra'); // eslint-disable-line -const isDir = fPath => { +const isDir = (fPath) => { const stats = fs.lstatSync(fPath); return stats.isDirectory() || stats.isSymbolicLink(); }; @@ -27,7 +27,7 @@ module.exports = (dir, filter) => { */ const dirList = fs .readdirSync(fPath) - .filter(p => isDir(path.join(fPath, p))); + .filter((p) => isDir(path.join(fPath, p))); /** * @name m @@ -35,7 +35,7 @@ module.exports = (dir, filter) => { * @type {Array} */ const m = foundModules.concat( - dirList.filter(filter).map(mod => { + dirList.filter(filter).map((mod) => { return { name: filter(mod), modulePath: path.join(fPath, mod), @@ -52,7 +52,7 @@ module.exports = (dir, filter) => { ...m, ...dirList .filter(isScopedPackage) // 2 - .map(scope => findModules(path.join(fPath, scope), m)) // 3 + .map((scope) => findModules(path.join(fPath, scope), m)) // 3 ); }; diff --git a/packages/core/src/lib/get.js b/packages/core/src/lib/get.js index 2feccc135..4852670eb 100644 --- a/packages/core/src/lib/get.js +++ b/packages/core/src/lib/get.js @@ -2,7 +2,7 @@ const logger = require('./log'); -module.exports = function(partialName, patternlab, reportWarning = true) { +module.exports = function (partialName, patternlab, reportWarning = true) { //look for exact partial matches for (let i = 0; i < patternlab.patterns.length; i++) { if (patternlab.patterns[i].patternPartial === partialName) { diff --git a/packages/core/src/lib/isScopedPackage.js b/packages/core/src/lib/isScopedPackage.js index cffd1d811..53b607ad7 100644 --- a/packages/core/src/lib/isScopedPackage.js +++ b/packages/core/src/lib/isScopedPackage.js @@ -10,7 +10,7 @@ const scopeMatch = /^@(.*)$/; * @param {string} filePath - The pathname to check * @return {Boolean} - Returns a bool when found, false othersie */ -module.exports = filePath => { +module.exports = (filePath) => { const baseName = path.basename(filePath); return scopeMatch.test(baseName); }; diff --git a/packages/core/src/lib/lineage_hunter.js b/packages/core/src/lib/lineage_hunter.js index 657897d21..3a90a0f65 100644 --- a/packages/core/src/lib/lineage_hunter.js +++ b/packages/core/src/lib/lineage_hunter.js @@ -2,7 +2,7 @@ const getPartial = require('./get'); const logger = require('./log'); -const lineage_hunter = function() { +const lineage_hunter = function () { function findlineage(pattern, patternlab) { // As we are adding edges from pattern to ancestor patterns, ensure it is known to the graph patternlab.graph.add(pattern); @@ -10,7 +10,7 @@ const lineage_hunter = function() { //find the {{> template-name }} within patterns const matches = pattern.findPartials(); if (matches !== null) { - matches.forEach(function(match) { + matches.forEach(function (match) { //get the ancestorPattern const ancestorPattern = getPartial( pattern.findPartial(match), @@ -158,10 +158,10 @@ const lineage_hunter = function() { } return { - find_lineage: function(pattern, patternlab) { + find_lineage: function (pattern, patternlab) { findlineage(pattern, patternlab); }, - cascade_pattern_states: function(patternlab) { + cascade_pattern_states: function (patternlab) { cascadePatternStates(patternlab); }, }; diff --git a/packages/core/src/lib/list_item_hunter.js b/packages/core/src/lib/list_item_hunter.js index e6fd3818b..7d6346161 100644 --- a/packages/core/src/lib/list_item_hunter.js +++ b/packages/core/src/lib/list_item_hunter.js @@ -1,6 +1,6 @@ 'use strict'; -const list_item_hunter = function() { +const list_item_hunter = function () { const logger = require('./log'); function processListItemPartials(pattern) { @@ -39,7 +39,7 @@ const list_item_hunter = function() { } return { - process_list_item_partials: function(pattern) { + process_list_item_partials: function (pattern) { return processListItemPartials(pattern); }, }; diff --git a/packages/core/src/lib/loadPattern.js b/packages/core/src/lib/loadPattern.js index 4a74743a4..8a53088f5 100644 --- a/packages/core/src/lib/loadPattern.js +++ b/packages/core/src/lib/loadPattern.js @@ -19,7 +19,7 @@ let fs = require('fs-extra'); //eslint-disable-line prefer-const // loads a pattern from disk, creates a Pattern object from it and // all its associated files, and records it in patternlab.patterns[] -module.exports = function(relPath, patternlab) { +module.exports = function (relPath, patternlab) { const relativeDepth = (relPath.match(/\w(?=\\)|\w(?=\/)/g) || []).length; if (relativeDepth > 3) { logger.warning(''); @@ -145,7 +145,7 @@ module.exports = function(relPath, patternlab) { `${listJsonFileName}.json`, `${listJsonFileName}.yml`, `${listJsonFileName}.yaml`, - ].forEach(file => { + ].forEach((file) => { changes_hunter.checkLastModified(currentPattern, file); }); diff --git a/packages/core/src/lib/loaduikits.js b/packages/core/src/lib/loaduikits.js index b83f94dcb..79de4556f 100644 --- a/packages/core/src/lib/loaduikits.js +++ b/packages/core/src/lib/loaduikits.js @@ -24,11 +24,11 @@ const readModuleFile = (uikitLocation, subPath) => { * [4] Reads files from uikit that apply to every template * @param {object} patternlab */ -module.exports = patternlab => { +module.exports = (patternlab) => { const paths = patternlab.config.paths; const uikitConfigs = _.filter(patternlab.config.uikits, 'enabled'); // [1] - uikitConfigs.forEach(uikitConfig => { + uikitConfigs.forEach((uikitConfig) => { let uikitLocation = null; if ('package' in uikitConfig) { try { diff --git a/packages/core/src/lib/log.js b/packages/core/src/lib/log.js index 87a7cd587..f55ff4aa1 100644 --- a/packages/core/src/lib/log.js +++ b/packages/core/src/lib/log.js @@ -63,8 +63,8 @@ const error = log.error.bind(log); * @param {string} - a message to report * @returns {function} - a callback to be passed to a Promise's .catch() */ -const reportError = function(message) { - return function(err) { +const reportError = function (message) { + return function (err) { console.log(message); console.log(err); }; diff --git a/packages/core/src/lib/markModifiedPatterns.js b/packages/core/src/lib/markModifiedPatterns.js index aa80b25bb..6eede313e 100644 --- a/packages/core/src/lib/markModifiedPatterns.js +++ b/packages/core/src/lib/markModifiedPatterns.js @@ -17,7 +17,7 @@ let fs = require('fs-extra'); //eslint-disable-line prefer-const * @param lastModified * @param patternlab */ -module.exports = function(lastModified, patternlab) { +module.exports = function (lastModified, patternlab) { /** * If the given array exists, apply a function to each of its elements * @param {Array} array @@ -28,13 +28,13 @@ module.exports = function(lastModified, patternlab) { array.forEach(func); } }; - const modifiedOrNot = _.groupBy(patternlab.patterns, p => + const modifiedOrNot = _.groupBy(patternlab.patterns, (p) => changes_hunter.needsRebuild(lastModified, p) ? 'modified' : 'notModified' ); // For all unmodified patterns load their rendered template output - forEachExisting(modifiedOrNot.notModified, cleanPattern => { - _.each(patternlab.uikits, uikit => { + forEachExisting(modifiedOrNot.notModified, (cleanPattern) => { + _.each(patternlab.uikits, (uikit) => { const xp = path.join( process.cwd(), uikit.outputDir, @@ -50,7 +50,7 @@ module.exports = function(lastModified, patternlab) { // For all patterns that were modified, schedule them for rebuild forEachExisting( modifiedOrNot.modified, - p => (p.compileState = CompileState.NEEDS_REBUILD) + (p) => (p.compileState = CompileState.NEEDS_REBUILD) ); return modifiedOrNot; }; diff --git a/packages/core/src/lib/markdown_parser.js b/packages/core/src/lib/markdown_parser.js index 19dcb7a9d..ec962e89e 100644 --- a/packages/core/src/lib/markdown_parser.js +++ b/packages/core/src/lib/markdown_parser.js @@ -3,7 +3,7 @@ const md = require('markdown-it')(); const yaml = require('js-yaml'); const logger = require('./log'); -const markdown_parser = function() { +const markdown_parser = function () { /** * Converts a markdown block with frontmatter (each is optional, technically) to a well-formed object. * @param block - the ".md" file, which can contain frontmatter or not, or only frontmatter. @@ -47,7 +47,7 @@ const markdown_parser = function() { } return { - parse: function(block) { + parse: function (block) { return parseMarkdownBlock(block); }, }; diff --git a/packages/core/src/lib/object_factory.js b/packages/core/src/lib/object_factory.js index efb6e1b4e..0b0337dfc 100644 --- a/packages/core/src/lib/object_factory.js +++ b/packages/core/src/lib/object_factory.js @@ -27,7 +27,7 @@ const prefixMatcherDeprecationCheckHidden = /^_.+/; * @param {Patternlab} patternlab The actual pattern lab instance * @param {boolean} isPromoteToFlatPatternRun specifies if the pattern needs to be removed from its deep nesting folder */ -const Pattern = function( +const Pattern = function ( relPath, jsonFileData, patternlab, @@ -201,7 +201,7 @@ const Pattern = function( Pattern.prototype = { // render function - acts as a proxy for the PatternEngine's - render: function(data, partials) { + render: function (data, partials) { if (!this.extendedTemplate) { this.extendedTemplate = this.template; } @@ -213,17 +213,17 @@ Pattern.prototype = { partials ); return promise - .then(results => { + .then((results) => { return results; }) - .catch(reason => { + .catch((reason) => { return Promise.reject(reason); }); } return Promise.reject('where is the engine?'); }, - registerPartial: function() { + registerPartial: function () { if (this.engine && typeof this.engine.registerPartial === 'function') { this.engine.registerPartial(this); } @@ -239,7 +239,7 @@ Pattern.prototype = { * @param {string} suffixType File suffix * @param {string} customFileExtension Custom extension */ - getPatternLink: function(patternlab, suffixType, customFileExtension) { + getPatternLink: function (patternlab, suffixType, customFileExtension) { // if no suffixType is provided, we default to rendered const suffixConfig = patternlab.config.outputFileSuffixes; const suffix = suffixType @@ -261,23 +261,23 @@ Pattern.prototype = { * The finders all delegate to the PatternEngine, which also * encapsulates all appropriate regex's */ - findPartials: function() { + findPartials: function () { return this.engine.findPartials(this); }, - findPartialsWithStyleModifiers: function() { + findPartialsWithStyleModifiers: function () { return this.engine.findPartialsWithStyleModifiers(this); }, - findPartialsWithPatternParameters: function() { + findPartialsWithPatternParameters: function () { return this.engine.findPartialsWithPatternParameters(this); }, - findListItems: function() { + findListItems: function () { return this.engine.findListItems(this); }, - findPartial: function(partialString) { + findPartial: function (partialString) { return this.engine.findPartial(partialString); }, @@ -287,7 +287,7 @@ Pattern.prototype = { * @param {Number} level Level of folder to get * @param {Object} pInfo general information about the pattern */ - getDirLevel: function(level, pInfo) { + getDirLevel: function (level, pInfo) { const items = this.subdir.split(path.sep); pInfo && pInfo.patternHasOwnDir && items.pop(); @@ -309,7 +309,7 @@ Pattern.prototype = { * * @param {Patternlab} patternlab Current patternlab instance */ - promoteFromDirectoryToFlatPattern: function(patternlab) { + promoteFromDirectoryToFlatPattern: function (patternlab) { const p = new Pattern(this.relPath, this.jsonFileData, patternlab, true); // Only reset the specific fields, not everything Object.assign(this, { @@ -330,7 +330,7 @@ Pattern.prototype = { * @param {*} pathStr the path that needs to be checked for number prefixes * @returns the order number or 0 when no prefix is available */ - setPatternOrderDataForInfo: pathStr => { + setPatternOrderDataForInfo: (pathStr) => { const match = pathStr.match(prefixMatcherDeprecationCheckOrder); return match && match.length >= 1 ? pathStr.match(prefixMatcherDeprecationCheckOrder)[1].replace('-', '') @@ -358,7 +358,7 @@ Pattern.prototype = { }; info.dir = info.patternHasOwnDir ? pathObj.dir.split(path.sep).pop() : ''; - info.dirLevel = pathObj.dir.split(path.sep).filter(s => !!s).length; + info.dirLevel = pathObj.dir.split(path.sep).filter((s) => !!s).length; // Only relevant for deprecation check and message if (path.parse(pathObj.dir).base === '_meta') { @@ -399,7 +399,7 @@ Pattern.prototype = { .replace(new RegExp(`-${info.dir}$`), ''); info.verbosePartial = pathObj.dir .split(/\/|\\/, 2) - .map(o => o.replace(prefixMatcher, '')) + .map((o) => o.replace(prefixMatcher, '')) .join('/') .replace(new RegExp(`-${info.dir}$`), ''); } @@ -417,7 +417,7 @@ Pattern.prototype = { * @param {Object} customProps Properties to apply to new pattern * @param {Patternlab} patternlab Current patternlab instance */ -Pattern.createEmpty = function(customProps, patternlab) { +Pattern.createEmpty = function (customProps, patternlab) { let relPath = ''; if (customProps) { if (customProps.relPath) { @@ -436,7 +436,7 @@ Pattern.createEmpty = function(customProps, patternlab) { * parameters that replace the positional parameters that the Pattern * constructor takes. */ -Pattern.create = function(relPath, data, customProps, patternlab) { +Pattern.create = function (relPath, data, customProps, patternlab) { const newPattern = new Pattern(relPath || '', data || null, patternlab); return Object.assign(newPattern, customProps); }; diff --git a/packages/core/src/lib/parameter_hunter.js b/packages/core/src/lib/parameter_hunter.js index aa2ce38dc..748c113d4 100644 --- a/packages/core/src/lib/parameter_hunter.js +++ b/packages/core/src/lib/parameter_hunter.js @@ -9,7 +9,7 @@ const parseLink = require('./parseLink'); const jsonCopy = require('./json_copy'); const replaceParameter = require('./replaceParameter'); -const parameter_hunter = function() { +const parameter_hunter = function () { /** * This function is really to accommodate the lax JSON-like syntax allowed by * Pattern Lab PHP for parameter submissions to partials. Unfortunately, no @@ -331,7 +331,7 @@ const parameter_hunter = function() { //todo: this no longer needs to be a promise return Promise.resolve(); }) - .catch(reason => { + .catch((reason) => { console.log(reason); logger.error(reason); }); @@ -342,7 +342,7 @@ const parameter_hunter = function() { } return { - find_parameters: function(pattern, patternlab) { + find_parameters: function (pattern, patternlab) { return findparameters(pattern, patternlab); }, }; diff --git a/packages/core/src/lib/parseAllLinks.js b/packages/core/src/lib/parseAllLinks.js index 894ad6f83..e69383bd7 100644 --- a/packages/core/src/lib/parseAllLinks.js +++ b/packages/core/src/lib/parseAllLinks.js @@ -4,7 +4,7 @@ const parseLink = require('./parseLink'); //look for pattern links included in data files. //these will be in the form of link.* WITHOUT {{}}, which would still be there from direct pattern inclusion -module.exports = function(patternlab) { +module.exports = function (patternlab) { //look for link.* such as link.pages-blog as a value patternlab.data = parseLink(patternlab, patternlab.data, 'data.json'); diff --git a/packages/core/src/lib/parseLink.js b/packages/core/src/lib/parseLink.js index 0193144b3..5b383b45e 100644 --- a/packages/core/src/lib/parseLink.js +++ b/packages/core/src/lib/parseLink.js @@ -5,7 +5,7 @@ const path = require('path'); const logger = require('./log'); const getPartial = require('./get'); -module.exports = function(patternlab, obj, key) { +module.exports = function (patternlab, obj, key) { //check for 'link.patternPartial' const linkRE = /(?:'|")(link\.[A-z0-9-_]+)(?:'|")/g; @@ -20,7 +20,7 @@ module.exports = function(patternlab, obj, key) { const linkMatches = dataObjAsString.match(linkRE); if (linkMatches) { - linkMatches.forEach(dataLink => { + linkMatches.forEach((dataLink) => { if (dataLink && dataLink.split('.').length >= 2) { //get the partial the link refers to const linkPatternPartial = dataLink.split('.')[1].replace(/'|"/g, ''); @@ -34,7 +34,7 @@ module.exports = function(patternlab, obj, key) { .replace('viewall-', '') .replace('-all', ''); const pattern = patternlab.patterns.find( - p => p.patternGroup === partial + (p) => p.patternGroup === partial ); if (pattern) { @@ -45,7 +45,7 @@ module.exports = function(patternlab, obj, key) { // group and subgroup there will be a view all page for that group) const partial = linkPatternPartial.replace('viewall-', ''); const pattern = patternlab.patterns.find( - p => `${p.patternGroup}-${p.patternSubgroup}` === partial + (p) => `${p.patternGroup}-${p.patternSubgroup}` === partial ); if (pattern) { diff --git a/packages/core/src/lib/pattern_engines.js b/packages/core/src/lib/pattern_engines.js index cde010125..9049cacbb 100644 --- a/packages/core/src/lib/pattern_engines.js +++ b/packages/core/src/lib/pattern_engines.js @@ -77,12 +77,12 @@ const PatternEngines = Object.create({ * @param patternLabConfig * @memberof PatternEngines */ - loadAllEngines: function(patternLabConfig) { + loadAllEngines: function (patternLabConfig) { const self = this; // Try to load engines! We scan for engines at each path specified above. This // function is kind of a big deal. - enginesDirectories.forEach(function(engineDirectory) { + enginesDirectories.forEach(function (engineDirectory) { const enginesInThisDir = findEngineModulesInDirectory( engineDirectory.path ); @@ -91,7 +91,7 @@ const PatternEngines = Object.create({ // find all engine-named things in this directory and try to load them, // unless it's already been loaded. - enginesInThisDir.forEach(function(engineDiscovery) { + enginesInThisDir.forEach(function (engineDiscovery) { let errorMessage; const successMessage = 'good to go'; @@ -138,7 +138,7 @@ const PatternEngines = Object.create({ * @param pattern * @returns engine name matching pattern */ - getEngineNameForPattern: function(pattern) { + getEngineNameForPattern: function (pattern) { // avoid circular dependency by putting this in here. TODO: is this slow? const of = require('./object_factory'); if ( @@ -175,7 +175,7 @@ const PatternEngines = Object.create({ * @param pattern * @returns name of engine for pattern */ - getEngineForPattern: function(pattern) { + getEngineForPattern: function (pattern) { if (pattern.isPseudoPattern) { return this.getEngineForPattern(pattern.basePattern); } else { @@ -189,9 +189,9 @@ const PatternEngines = Object.create({ * @memberof PatternEngines * @returns Array all supported file extensions */ - getSupportedFileExtensions: function() { + getSupportedFileExtensions: function () { const engineNames = Object.keys(PatternEngines); - const allEnginesExtensions = engineNames.map(engineName => { + const allEnginesExtensions = engineNames.map((engineName) => { return PatternEngines[engineName].engineFileExtension; }); return [].concat.apply([], allEnginesExtensions); @@ -203,7 +203,7 @@ const PatternEngines = Object.create({ * @param fileExtension * @returns Boolean */ - isFileExtensionSupported: function(fileExtension) { + isFileExtensionSupported: function (fileExtension) { const supportedExtensions = PatternEngines.getSupportedFileExtensions(); return supportedExtensions.lastIndexOf(fileExtension) !== -1; }, @@ -214,7 +214,7 @@ const PatternEngines = Object.create({ * @param filename * @return boolean */ - isPseudoPatternJSON: function(filename) { + isPseudoPatternJSON: function (filename) { const extension = path.extname(filename); return extension === '.json' && filename.indexOf('~') > -1; }, @@ -229,7 +229,7 @@ const PatternEngines = Object.create({ * @param filename * @returns boolean */ - isPatternFile: function(filename) { + isPatternFile: function (filename) { // skip hidden patterns/files without a second thought const extension = path.extname(filename); if ( diff --git a/packages/core/src/lib/pattern_exporter.js b/packages/core/src/lib/pattern_exporter.js index 8eb4e1a88..221415bf8 100644 --- a/packages/core/src/lib/pattern_exporter.js +++ b/packages/core/src/lib/pattern_exporter.js @@ -14,10 +14,7 @@ function exportSinglePattern(patternlab, pattern) { // Extract the first part of the pattern partial as the directory in which // it should go. patternDir = path.join(patternDir, pattern.patternPartial.split('-')[0]); - patternName = pattern.patternPartial - .split('-') - .slice(1) - .join('-'); + patternName = pattern.patternPartial.split('-').slice(1).join('-'); } if (patternlab.config.patternExportRaw) { @@ -31,7 +28,7 @@ function exportSinglePattern(patternlab, pattern) { ); } -const pattern_exporter = function() { +const pattern_exporter = function () { /** * Exports all pattern's final HTML as defined in patternlab-config.json to desired location. * Originally created to help facilitate easier consumption by jekyll. @@ -66,7 +63,7 @@ const pattern_exporter = function() { } return { - export_patterns: function(patternlab) { + export_patterns: function (patternlab) { exportPatterns(patternlab); }, }; diff --git a/packages/core/src/lib/pattern_graph.js b/packages/core/src/lib/pattern_graph.js index 4c1d568cb..a5320292d 100644 --- a/packages/core/src/lib/pattern_graph.js +++ b/packages/core/src/lib/pattern_graph.js @@ -35,7 +35,7 @@ const PATTERN_GRAPH_VERSION = 1; * @see PatternGraph#fromJson * @see #540 */ -const PatternGraph = function(graph, timestamp, version) { +const PatternGraph = function (graph, timestamp, version) { this.graph = graph || new Graph({ @@ -51,7 +51,7 @@ const PatternGraph = function(graph, timestamp, version) { }; // shorthand. Use relPath as it is always unique, even with subPatternGroup -const nodeName = p => (p instanceof Pattern ? p.relPath : p); +const nodeName = (p) => (p instanceof Pattern ? p.relPath : p); PatternGraph.prototype = { /** @@ -61,11 +61,11 @@ PatternGraph.prototype = { * * @see {@link https://github.com/pattern-lab/patternlab-node/issues/580|Issue #580} */ - sync: function() { + sync: function () { // Remove any patterns that are in the graph data, but that haven't been discovered when // walking all patterns iteratively - const nodesToRemove = this.nodes().filter(n => !this.patterns.has(n)); - nodesToRemove.forEach(n => this.remove(n)); + const nodesToRemove = this.nodes().filter((n) => !this.patterns.has(n)); + nodesToRemove.forEach((n) => this.remove(n)); return nodesToRemove; }, @@ -73,7 +73,7 @@ PatternGraph.prototype = { * Creates an independent copy of the graph where nodes and edges can be modified without * affecting the source. */ - clone: function() { + clone: function () { const json = graphlib.json.write(this.graph); const graph = graphlib.json.read(json); return new PatternGraph(graph, this.timestamp, this.version); @@ -85,7 +85,7 @@ PatternGraph.prototype = { * * @param {Pattern} pattern */ - add: function(pattern) { + add: function (pattern) { const n = nodeName(pattern); if (!this.patterns.has(n)) { this.graph.setNode(n, { @@ -96,7 +96,7 @@ PatternGraph.prototype = { } }, - remove: function(pattern) { + remove: function (pattern) { const n = nodeName(pattern); this.graph.removeNode(n); this.patterns.remove(n); @@ -106,8 +106,8 @@ PatternGraph.prototype = { * Removes nodes from this graph for which the given predicate function returns false. * @param {function} fn which takes a node name as argument */ - filter: function(fn) { - this.graph.nodes().forEach(n => { + filter: function (fn) { + this.graph.nodes().forEach((n) => { if (!fn(n)) { this.remove(n); } @@ -123,7 +123,7 @@ PatternGraph.prototype = { * * @throws {Error} If the pattern is unknown */ - link: function(patternFrom, patternTo) { + link: function (patternFrom, patternTo) { const nameFrom = nodeName(patternFrom); const nameTo = nodeName(patternTo); for (const name of [nameFrom, nameTo]) { @@ -141,7 +141,7 @@ PatternGraph.prototype = { * * @return {boolean} */ - hasLink: function(patternFrom, patternTo) { + hasLink: function (patternFrom, patternTo) { const nameFrom = nodeName(patternFrom); const nameTo = nodeName(patternTo); return this.graph.hasEdge(nameFrom, nameTo); @@ -157,8 +157,8 @@ PatternGraph.prototype = { * @return {Array} An Array of {@link Pattern}s in the order by which the changed patters must be * compiled. */ - compileOrder: function() { - const compileStateFilter = function(patterns, n) { + compileOrder: function () { + const compileStateFilter = function (patterns, n) { const node = patterns.get(n); return node.compileState !== CompileState.CLEAN; }; @@ -173,10 +173,10 @@ PatternGraph.prototype = { }); const nodes = this.graph.nodes(); - const changedNodes = nodes.filter(n => + const changedNodes = nodes.filter((n) => compileStateFilter(this.patterns, n) ); - this.nodes2patterns(changedNodes).forEach(pattern => { + this.nodes2patterns(changedNodes).forEach((pattern) => { const patternNode = nodeName(pattern); if (!compileGraph.hasNode(patternNode)) { compileGraph.setNode(patternNode); @@ -211,7 +211,7 @@ PatternGraph.prototype = { * @param fn A function that takes the currently viewed pattern and node data. Allows synching data * between patterns and node metadata. */ - applyReverse: function(pattern, fn) { + applyReverse: function (pattern, fn) { for (const p of this.lineageR(pattern)) { fn(p, pattern); this.applyReverse(p, fn); @@ -225,7 +225,7 @@ PatternGraph.prototype = { * * @return [null|Pattern] */ - node: function(pattern) { + node: function (pattern) { return this.graph.node(nodeName(pattern)); }, @@ -234,8 +234,8 @@ PatternGraph.prototype = { * @param nodes {Array} * @return {Array} An Array of Patterns */ - nodes2patterns: function(nodes) { - return nodes.map(n => this.patterns.get(n)); + nodes2patterns: function (nodes) { + return nodes.map((n) => this.patterns.get(n)); }, // TODO cache result in a Map[String, Array]? @@ -246,7 +246,7 @@ PatternGraph.prototype = { * @param pattern * @return {*|Array} */ - lineage: function(pattern) { + lineage: function (pattern) { const nodes = this.graph.successors(nodeName(pattern)); return this.nodes2patterns(nodes); }, @@ -256,7 +256,7 @@ PatternGraph.prototype = { * @param {Pattern} pattern * @return {*|Array} */ - lineageR: function(pattern) { + lineageR: function (pattern) { const nodes = this.graph.predecessors(nodeName(pattern)); return this.nodes2patterns(nodes); }, @@ -267,9 +267,9 @@ PatternGraph.prototype = { * * @see {@link PatternGraph.lineage(pattern)} */ - lineageIndex: function(pattern) { + lineageIndex: function (pattern) { const lineage = this.lineage(pattern); - return lineage.map(p => p.patternPartial); + return lineage.map((p) => p.patternPartial); }, /** @@ -280,16 +280,16 @@ PatternGraph.prototype = { * * @see {@link PatternGraph.lineageRIndex(pattern)} */ - lineageRIndex: function(pattern) { + lineageRIndex: function (pattern) { const lineageR = this.lineageR(pattern); - return lineageR.map(p => p.patternPartial); + return lineageR.map((p) => p.patternPartial); }, /** * Creates an object representing the graph and meta data. * @returns {{timestamp: number, graph}} */ - toJson: function() { + toJson: function () { return { version: this.version, timestamp: this.timestamp, @@ -300,14 +300,14 @@ PatternGraph.prototype = { /** * @return {Array} An array of all node names. */ - nodes: function() { + nodes: function () { return this.graph.nodes(); }, /** * Updates the version to the most recent one */ - upgradeVersion: function() { + upgradeVersion: function () { this.version = PATTERN_GRAPH_VERSION; }, }; @@ -317,7 +317,7 @@ PatternGraph.prototype = { * @param {int} [version=PATTERN_GRAPH_VERSION] * @return {PatternGraph} */ -PatternGraph.empty = function(version) { +PatternGraph.empty = function (version) { return new PatternGraph(null, 0, version || PATTERN_GRAPH_VERSION); }; @@ -326,7 +326,7 @@ PatternGraph.empty = function(version) { * @param {PatternGraph|Object} graphOrJson * @return {boolean} */ -PatternGraph.checkVersion = function(graphOrJson) { +PatternGraph.checkVersion = function (graphOrJson) { return graphOrJson.version === PATTERN_GRAPH_VERSION; }; @@ -346,7 +346,7 @@ function VersionMismatch(oldVersion) { * @param {object} o The JSON object to read from * @return {PatternGraph} */ -PatternGraph.fromJson = function(o) { +PatternGraph.fromJson = function (o) { if (!PatternGraph.checkVersion(o)) { throw new VersionMismatch(o.version); } @@ -360,7 +360,7 @@ PatternGraph.fromJson = function(o) { * @param {string} [fileName='dependencyGraph.json'] Name of the graph file * @return {string} */ -PatternGraph.resolveJsonGraphFile = function( +PatternGraph.resolveJsonGraphFile = function ( filePath = process.cwd(), fileName = 'dependencyGraph.json' ) { @@ -377,7 +377,7 @@ PatternGraph.resolveJsonGraphFile = function( * @see {@link PatternGraph.fromJson} * @see {@link PatternGraph.resolveJsonGraphFile} */ -PatternGraph.loadFromFile = function(filePath, fileName) { +PatternGraph.loadFromFile = function (filePath, fileName) { const jsonGraphFile = this.resolveJsonGraphFile(filePath, fileName); // File is fresh, so simply construct an empty graph in memory @@ -399,7 +399,7 @@ PatternGraph.loadFromFile = function(filePath, fileName) { * * @see {@link PatternGraph.resolveJsonGraphFile} */ -PatternGraph.storeToFile = function(patternlab) { +PatternGraph.storeToFile = function (patternlab) { if (process.env.PATTERNLAB_ENV === 'CI') { return; } @@ -413,7 +413,7 @@ PatternGraph.storeToFile = function(patternlab) { * @param patternlab @ @param {string} fileName Output filename */ -PatternGraph.exportToDot = function(patternlab, fileName) { +PatternGraph.exportToDot = function (patternlab, fileName) { const dotFile = this.resolveJsonGraphFile(undefined, fileName); const g = PatternGraphDot.generate(patternlab.graph); fs.outputFileSync(dotFile, g); diff --git a/packages/core/src/lib/pattern_graph_dot.js b/packages/core/src/lib/pattern_graph_dot.js index 14bd7a64f..f4da40e18 100644 --- a/packages/core/src/lib/pattern_graph_dot.js +++ b/packages/core/src/lib/pattern_graph_dot.js @@ -23,7 +23,7 @@ function header() { * @param name * @return {string} */ -const niceKey = function(name) { +const niceKey = function (name) { return 'O' + name.replace('-', ''); }; @@ -84,7 +84,7 @@ const PatternGraphDot = {}; * @param patternGraph * @return {string} */ -PatternGraphDot.generate = function(patternGraph) { +PatternGraphDot.generate = function (patternGraph) { const g = patternGraph.graph; const patterns = patternGraph.patterns; const buckets = new Map(); diff --git a/packages/core/src/lib/pattern_registry.js b/packages/core/src/lib/pattern_registry.js index 95145234c..041cb109e 100644 --- a/packages/core/src/lib/pattern_registry.js +++ b/packages/core/src/lib/pattern_registry.js @@ -4,7 +4,7 @@ * Allows lookups for patterns via a central registry. * @constructor */ -const PatternRegistry = function() { +const PatternRegistry = function () { this.key2pattern = new Map(); /** For lookups by {@link Pattern#partialKey} */ @@ -12,15 +12,15 @@ const PatternRegistry = function() { }; PatternRegistry.prototype = { - allPatterns: function() { + allPatterns: function () { return Array.from(this.key2pattern.values()); }, - has: function(name) { + has: function (name) { return this.key2pattern.has(name); }, - get: function(name) { + get: function (name) { return this.key2pattern.get(name); }, @@ -28,18 +28,18 @@ PatternRegistry.prototype = { * Adds the given pattern to the registry. If a pattern with the same key exists, it is replaced. * @param pattern {Pattern|*} */ - put: function(pattern) { + put: function (pattern) { const name = PatternRegistry.partialName(pattern); this.partials.set(name, pattern); const key = PatternRegistry.patternKey(pattern); this.key2pattern.set(key, pattern); }, - remove: function(name) { + remove: function (name) { this.key2pattern.delete(name); }, - getPartial: function(partialName) { + getPartial: function (partialName) { /* Code in here has been moved from getPartial() to prepare for some refactoring. There are a few advantages to this method: @@ -83,7 +83,7 @@ PatternRegistry.prototype = { }, }; -PatternRegistry.patternKey = function(pattern) { +PatternRegistry.patternKey = function (pattern) { return pattern.relPath; }; @@ -93,7 +93,7 @@ PatternRegistry.patternKey = function(pattern) { * @param pattern {Pattern} * @return {string} */ -PatternRegistry.partialName = function(pattern) { +PatternRegistry.partialName = function (pattern) { return pattern.patternPartial; }; diff --git a/packages/core/src/lib/patternlab.js b/packages/core/src/lib/patternlab.js index ce0be9ca6..405da4fc9 100644 --- a/packages/core/src/lib/patternlab.js +++ b/packages/core/src/lib/patternlab.js @@ -215,10 +215,10 @@ module.exports = class PatternLab { } writePatternFiles(headHTML, pattern, footerHTML, outputBasePath) { - const nullFormatter = str => str; - const defaultFormatter = codeString => + const nullFormatter = (str) => str; + const defaultFormatter = (codeString) => cleanHtml(codeString, { indent_size: 2 }); - const makePath = type => + const makePath = (type) => path.join( this.config.paths.public.patterns, pattern.getPatternLink(this, type) @@ -258,7 +258,7 @@ module.exports = class PatternLab { ); //write the compiled template to the public patterns directory - outputFiles.forEach(outFile => + outputFiles.forEach((outFile) => fs.outputFileSync( path.join(process.cwd(), outputBasePath, outFile.path), outFile.content @@ -274,22 +274,22 @@ module.exports = class PatternLab { */ registerLogger(logLevel) { if (logLevel === undefined) { - logger.log.on('info', msg => console.info(msg)); - logger.log.on('warning', msg => console.info(msg)); - logger.log.on('error', msg => console.info(msg)); + logger.log.on('info', (msg) => console.info(msg)); + logger.log.on('warning', (msg) => console.info(msg)); + logger.log.on('error', (msg) => console.info(msg)); } else { if (logLevel === 'quiet') { return; } switch (logLevel) { case 'debug': - logger.log.on('debug', msg => console.info(msg)); + logger.log.on('debug', (msg) => console.info(msg)); case 'info': - logger.log.on('info', msg => console.info(msg)); + logger.log.on('info', (msg) => console.info(msg)); case 'warning': - logger.log.on('warning', msg => console.info(msg)); + logger.log.on('warning', (msg) => console.info(msg)); case 'error': - logger.log.on('error', msg => console.info(msg)); + logger.log.on('error', (msg) => console.info(msg)); } } } @@ -312,7 +312,7 @@ module.exports = class PatternLab { // deleted pattern would still be present in the patterns array this.patterns = []; - const promiseAllPatternFiles = new Promise(function(resolve) { + const promiseAllPatternFiles = new Promise(function (resolve) { dive( patterns_dir, (err, file) => { @@ -338,7 +338,7 @@ module.exports = class PatternLab { }); return promiseAllPatternFiles.then(() => { return Promise.all( - this.patterns.map(pattern => { + this.patterns.map((pattern) => { return processIterative(pattern, self); }) ).then(() => { @@ -353,7 +353,7 @@ module.exports = class PatternLab { processAllPatternsRecursive(patterns_dir) { const self = this; - const promiseAllPatternFiles = new Promise(function(resolve) { + const promiseAllPatternFiles = new Promise(function (resolve) { dive( patterns_dir, (err, file) => { diff --git a/packages/core/src/lib/plugin_manager.js b/packages/core/src/lib/plugin_manager.js index aabaf965e..f79307beb 100644 --- a/packages/core/src/lib/plugin_manager.js +++ b/packages/core/src/lib/plugin_manager.js @@ -1,6 +1,6 @@ 'use strict'; -const plugin_manager = function() { +const plugin_manager = function () { const logger = require('./log'); /** @@ -9,7 +9,7 @@ const plugin_manager = function() { */ function initializePlugins(patternlab) { const foundPlugins = Object.keys(patternlab.config.plugins || {}); - foundPlugins.forEach(plugin => { + foundPlugins.forEach((plugin) => { logger.info(`Found plugin: ${plugin}`); logger.info(`Attempting to load and initialize plugin.`); const pluginModule = require(plugin); @@ -19,8 +19,8 @@ const plugin_manager = function() { async function raiseEvent(patternlab, eventName, args) { patternlab.events.emit(eventName, args); - await (async function() { - const hookHandlers = (patternlab.hooks[eventName] || []).map(h => + await (async function () { + const hookHandlers = (patternlab.hooks[eventName] || []).map((h) => h(args) ); @@ -29,7 +29,7 @@ const plugin_manager = function() { } return { - intialize_plugins: patternlab => { + intialize_plugins: (patternlab) => { initializePlugins(patternlab); }, raiseEvent: async (patternlab, eventName, ...args) => { diff --git a/packages/core/src/lib/processIterative.js b/packages/core/src/lib/processIterative.js index 1c65c85ca..e2433b1c8 100644 --- a/packages/core/src/lib/processIterative.js +++ b/packages/core/src/lib/processIterative.js @@ -5,7 +5,7 @@ const pph = require('./pseudopattern_hunter'); // This is now solely for analysis; loading of the pattern file is // above, in loadPatternIterative() -module.exports = function(pattern, patternlab) { +module.exports = function (pattern, patternlab) { //look for a pseudo pattern by checking if there is a file //containing same name, with ~ in it, ending in .json return pph diff --git a/packages/core/src/lib/processMetaPattern.js b/packages/core/src/lib/processMetaPattern.js index f793a103a..dea8fbe70 100644 --- a/packages/core/src/lib/processMetaPattern.js +++ b/packages/core/src/lib/processMetaPattern.js @@ -9,7 +9,7 @@ const logger = require('./log'); //this may be mocked in unit tests, so let it be overridden let fs = require('fs-extra'); // eslint-disable-line -module.exports = function(fileName, metaType, patternlab) { +module.exports = function (fileName, metaType, patternlab) { const metaPath = path.resolve(patternlab.config.paths.source.meta, fileName); const metaPattern = new Pattern(metaPath, null, patternlab); metaPattern.template = fs.readFileSync(metaPath, 'utf8'); @@ -19,7 +19,7 @@ module.exports = function(fileName, metaType, patternlab) { .then(() => { patternlab[metaType] = metaPattern; }) - .catch(reason => { + .catch((reason) => { logger.warning( `Could not find the user-editable template ${fileName}, currently configured to be at ${patternlab.config.paths.source.meta}. Your configured path may be incorrect (check paths.source.meta in your config file), the file may have been deleted, or it may have been left in the wrong place during a migration or update.` ); diff --git a/packages/core/src/lib/processRecursive.js b/packages/core/src/lib/processRecursive.js index 97c4ac560..3c541c85c 100644 --- a/packages/core/src/lib/processRecursive.js +++ b/packages/core/src/lib/processRecursive.js @@ -4,7 +4,7 @@ const logger = require('./log'); const decompose = require('./decompose'); const getPartial = require('./get'); -module.exports = function(file, patternlab) { +module.exports = function (file, patternlab) { //find current pattern in patternlab object using file as a partial const currentPattern = getPartial(file, patternlab, false); @@ -19,7 +19,7 @@ module.exports = function(file, patternlab) { } //call our helper method to actually unravel the pattern with any partials - return decompose(currentPattern, patternlab).catch(reason => { + return decompose(currentPattern, patternlab).catch((reason) => { console.log(reason); logger.error(reason); }); diff --git a/packages/core/src/lib/pseudopattern_hunter.js b/packages/core/src/lib/pseudopattern_hunter.js index 1d1ee92a3..1f3a9f530 100644 --- a/packages/core/src/lib/pseudopattern_hunter.js +++ b/packages/core/src/lib/pseudopattern_hunter.js @@ -15,9 +15,9 @@ const changes_hunter = new ch(); const yaml = require('js-yaml'); const dataMerger = require('./dataMerger'); -const pseudopattern_hunter = function() {}; +const pseudopattern_hunter = function () {}; -pseudopattern_hunter.prototype.find_pseudopatterns = function( +pseudopattern_hunter.prototype.find_pseudopatterns = function ( currentPattern, patternlab ) { @@ -70,10 +70,7 @@ pseudopattern_hunter.prototype.find_pseudopatterns = function( const variantName = pseudoPatterns[i] .substring(pseudoPatterns[i].indexOf('~') + 1) .split('.')[0]; - const variantExtension = pseudoPatterns[i] - .split('.') - .slice(-1) - .pop(); + const variantExtension = pseudoPatterns[i].split('.').slice(-1).pop(); const variantFilePath = path.join( currentPattern.subdir, currentPattern.fileName + '~' + variantName + '.' + variantExtension diff --git a/packages/core/src/lib/readDocumentation.js b/packages/core/src/lib/readDocumentation.js index d17364d61..efb6f6cd9 100644 --- a/packages/core/src/lib/readDocumentation.js +++ b/packages/core/src/lib/readDocumentation.js @@ -14,7 +14,7 @@ const markdown_parser = new mp(); const FILE_EXTENSION = '.md'; const GROUP_DOC_PREFIX = '_'; -module.exports = function(pattern, patternlab, isVariant) { +module.exports = function (pattern, patternlab, isVariant) { try { const markdownFileName = path.resolve( patternlab.config.paths.source.patterns, diff --git a/packages/core/src/lib/render.js b/packages/core/src/lib/render.js index 3ba1f2589..b73d5369f 100644 --- a/packages/core/src/lib/render.js +++ b/packages/core/src/lib/render.js @@ -2,7 +2,7 @@ const logger = require('./log'); -module.exports = function(pattern, data, partials) { +module.exports = function (pattern, data, partials) { logger.debug( `render: ${ pattern.patternPartial !== '-.' diff --git a/packages/core/src/lib/replaceParameter.js b/packages/core/src/lib/replaceParameter.js index 7b0cd6734..b045b58b2 100644 --- a/packages/core/src/lib/replaceParameter.js +++ b/packages/core/src/lib/replaceParameter.js @@ -2,7 +2,7 @@ const logger = require('./log'); -module.exports = function(template, prop, data) { +module.exports = function (template, prop, data) { let t = template; const valueRE = new RegExp(`{{{?\\s*[${prop}]+\\s*}?}}`); diff --git a/packages/core/src/lib/resolver.js b/packages/core/src/lib/resolver.js index ae0bc9fee..d70961413 100644 --- a/packages/core/src/lib/resolver.js +++ b/packages/core/src/lib/resolver.js @@ -34,7 +34,7 @@ const resolveFileInPackage = (packageName, ...pathElements) => { * @func resolvePackageFolder * Resolves the location of a package on disc */ -const resolvePackageFolder = packageName => { +const resolvePackageFolder = (packageName) => { return path.dirname(resolveFileInPackage(packageName, 'package.json')); }; diff --git a/packages/core/src/lib/server.js b/packages/core/src/lib/server.js index c55e2c4ab..3f71e1bba 100644 --- a/packages/core/src/lib/server.js +++ b/packages/core/src/lib/server.js @@ -6,7 +6,7 @@ const liveServer = require('@pattern-lab/live-server'); const events = require('./events'); const logger = require('./log'); -const server = patternlab => { +const server = (patternlab) => { const _module = { serve: () => { let serverReady = false; @@ -20,7 +20,7 @@ const server = patternlab => { port: 3000, }; - const servers = Object.keys(patternlab.uikits).map(kit => { + const servers = Object.keys(patternlab.uikits).map((kit) => { const uikit = patternlab.uikits[kit]; defaults.root = path.resolve( path.join( @@ -104,7 +104,7 @@ const server = patternlab => { return Promise.all(servers); }, - reload: data => { + reload: (data) => { const _data = data || { file: '', action: '', diff --git a/packages/core/src/lib/starterkit_manager.js b/packages/core/src/lib/starterkit_manager.js index f355a8f55..737aadd9a 100644 --- a/packages/core/src/lib/starterkit_manager.js +++ b/packages/core/src/lib/starterkit_manager.js @@ -1,6 +1,6 @@ 'use strict'; -const starterkit_manager = function(config) { +const starterkit_manager = function (config) { const path = require('path'); const fetch = require('node-fetch'); const fs = require('fs-extra'); @@ -78,7 +78,7 @@ const starterkit_manager = function(config) { }, } ) - .then(function(res) { + .then(function (res) { const contentType = res.headers.get('content-type'); if (contentType && contentType.indexOf('application/json') === -1) { throw new TypeError( @@ -87,15 +87,15 @@ const starterkit_manager = function(config) { } return res.json(); }) - .then(function(json) { + .then(function (json) { if (!json.items || !Array.isArray(json.items)) { return false; } - return json.items.map(function(repo) { + return json.items.map(function (repo) { return { name: repo.name, url: repo.html_url }; }); }) - .catch(function(err) { + .catch(function (err) { logger.error(err); return false; }); @@ -111,27 +111,29 @@ const starterkit_manager = function(config) { //TODO review for deletion or convert callers to use findModules() function detectStarterKits() { const node_modules_path = path.join(process.cwd(), 'node_modules'); - const npm_modules = fs.readdirSync(node_modules_path).filter(function(dir) { - const module_path = path.join(process.cwd(), 'node_modules', dir); - return ( - fs.statSync(module_path).isDirectory() && - dir.indexOf('starterkit-') === 0 - ); - }); + const npm_modules = fs + .readdirSync(node_modules_path) + .filter(function (dir) { + const module_path = path.join(process.cwd(), 'node_modules', dir); + return ( + fs.statSync(module_path).isDirectory() && + dir.indexOf('starterkit-') === 0 + ); + }); return npm_modules; } return { - load_starterkit: function(starterkitName, clean) { + load_starterkit: function (starterkitName, clean) { loadStarterKit(starterkitName, clean); }, - list_starterkits: function() { + list_starterkits: function () { return listStarterkits(); }, - pack_starterkit: function() { + pack_starterkit: function () { packStarterkit(); }, - detect_starterkits: function() { + detect_starterkits: function () { return detectStarterKits(); }, }; diff --git a/packages/core/src/lib/style_modifier_hunter.js b/packages/core/src/lib/style_modifier_hunter.js index 13a7ff2d1..bd62c773a 100644 --- a/packages/core/src/lib/style_modifier_hunter.js +++ b/packages/core/src/lib/style_modifier_hunter.js @@ -2,7 +2,7 @@ const logger = require('./log'); -const style_modifier_hunter = function() { +const style_modifier_hunter = function () { /** * Modifies a patterns partial with any styleModifiers found on the supplied partial * @@ -36,7 +36,7 @@ const style_modifier_hunter = function() { } return { - consume_style_modifier: function(pattern, partial, patternlab) { + consume_style_modifier: function (pattern, partial, patternlab) { consumestylemodifier(pattern, partial, patternlab); }, }; diff --git a/packages/core/src/lib/ui_builder.js b/packages/core/src/lib/ui_builder.js index 1d20fd218..c994f724b 100644 --- a/packages/core/src/lib/ui_builder.js +++ b/packages/core/src/lib/ui_builder.js @@ -13,7 +13,7 @@ let fs = require('fs-extra'); //eslint-disable-line prefer-const let buildFooter = require('./buildFooter'); //eslint-disable-line prefer-const let exportData = require('./exportData'); //eslint-disable-line prefer-const -const ui_builder = function() { +const ui_builder = function () { /** * Registers the pattern to the patternPaths object for the appropriate patternGroup and basename * patternGroup + patternBaseName are what comprise the patternPartial (atoms-colors) @@ -361,7 +361,7 @@ const ui_builder = function() { patternGroups: {}, }; - _.forEach(patternlab.patterns, function(pattern) { + _.forEach(patternlab.patterns, function (pattern) { // ignore patterns we can omit from rendering directly pattern.omitFromStyleguide = isPatternExcluded( pattern, @@ -432,7 +432,8 @@ const ui_builder = function() { function getFlatPatternItems(patternlab, patternGroup) { const patterns = _.filter( patternlab.patterns, - pattern => pattern.patternGroup === patternGroup && pattern.isFlatPattern + (pattern) => + pattern.patternGroup === patternGroup && pattern.isFlatPattern ); if (patterns) { return getSortedPatterns(patterns); @@ -462,7 +463,7 @@ const ui_builder = function() { patternSection: uikit.patternSection, patternSectionSubgroup: uikit.patternSectionSubgroup, } - ).catch(reason => { + ).catch((reason) => { console.log(reason); logger.error('Error building buildViewAllHTML'); }); @@ -482,15 +483,15 @@ const ui_builder = function() { patternlab ) { return _.sortBy(_.values(patternGroup), [ - pSubgroup => { + (pSubgroup) => { const group = patternlab.patternGroups.find( - g => g.patternGroup === patternGroupName + (g) => g.patternGroup === patternGroupName ); if (group) { - const sg = group.patternGroupItems.find(item => { + const sg = group.patternGroupItems.find((item) => { const firstPattern = _.first( - _.values(pSubgroup).filter(p => p.patternBaseName !== '.') + _.values(pSubgroup).filter((p) => p.patternBaseName !== '.') ); return ( item && @@ -526,7 +527,7 @@ const ui_builder = function() { // loop through the grouped styleguide patterns, building at each level const allPatternGroupPromises = _.map( patternlab.patternGroups, - patternGroup => { + (patternGroup) => { const patternGroupName = patternGroup.patternGroup; const group = styleguidePatterns.patternGroups[patternGroupName]; let groupedPatterns = []; @@ -542,7 +543,7 @@ const ui_builder = function() { let p; const samplePattern = _.find( patternSubgroups, - st => !st.patternPartial.startsWith('viewall-') + (st) => !st.patternPartial.startsWith('viewall-') ); const patternName = Object.keys( _.values(originalPatternGroup)[patternSubgroup] @@ -560,14 +561,14 @@ const ui_builder = function() { // render the footer needed for the viewall template return buildFooter(patternlab, `viewall-${patternPartial}`, uikit) - .then(footerHTML => { + .then((footerHTML) => { // render the viewall template by finding these smallest subgroup-grouped patterns const subgroupPatterns = getSortedPatterns( _.values(patternSubgroups) ); // determine if we should write at this time by checking if these are flat patterns or grouped patterns - p = _.find(subgroupPatterns, function(pat) { + p = _.find(subgroupPatterns, function (pat) { return pat.isDocPattern; }); @@ -577,7 +578,8 @@ const ui_builder = function() { styleGuideExcludes.length && _.some( styleGuideExcludes, - exclude => exclude === `${patternGroupName}/${patternName}` + (exclude) => + exclude === `${patternGroupName}/${patternName}` ); if (omitPatternGroup) { logger.debug( @@ -598,7 +600,7 @@ const ui_builder = function() { patternPartial, uikit ) - .then(viewAllHTML => { + .then((viewAllHTML) => { return fs.outputFile( path.join( process.cwd(), @@ -611,12 +613,12 @@ const ui_builder = function() { mainPageHeadHtml + viewAllHTML + footerHTML ); }) - .catch(reason => { + .catch((reason) => { console.log(reason); logger.error('Error building ViewAllHTML'); }); }) - .catch(reason => { + .catch((reason) => { console.log(reason); logger.error('Error building footer HTML'); }); @@ -634,7 +636,7 @@ const ui_builder = function() { `viewall-${patternGroupName}-all`, uikit ) - .then(footerHTML => { + .then((footerHTML) => { const sortedFlatPatterns = getFlatPatternItems( patternlab, patternGroupName @@ -646,9 +648,12 @@ const ui_builder = function() { } // get the appropriate patternGroup - const anyPatternOfType = _.find(groupedPatterns, function(pat) { - return pat.patternGroup && pat.patternGroup !== ''; - }); + const anyPatternOfType = _.find( + groupedPatterns, + function (pat) { + return pat.patternGroup && pat.patternGroup !== ''; + } + ); if (!anyPatternOfType || !groupedPatterns.length) { logger.debug( @@ -664,7 +669,7 @@ const ui_builder = function() { patternGroupName, uikit ) - .then(viewAllHTML => { + .then((viewAllHTML) => { fs.outputFileSync( path.join( process.cwd(), @@ -681,7 +686,7 @@ const ui_builder = function() { const omitPatternGroup = styleGuideExcludes && styleGuideExcludes.length && - _.some(styleGuideExcludes, function(exclude) { + _.some(styleGuideExcludes, function (exclude) { return exclude === patternGroupName; }); if (omitPatternGroup) { @@ -698,17 +703,17 @@ const ui_builder = function() { } return Promise.resolve(patterns); }) - .catch(reason => { + .catch((reason) => { console.log(reason); logger.error('Error building ViewAllHTML'); }); }) - .catch(reason => { + .catch((reason) => { console.log(reason); logger.error('Error building footerHTML'); }); }) - .catch(reason => { + .catch((reason) => { console.log(reason); logger.error('Error during buildViewAllPages'); }); @@ -716,10 +721,10 @@ const ui_builder = function() { ); return Promise.all(allPatternGroupPromises) - .then(allPatterns => - Promise.resolve(_.filter(allPatterns, p => p.length)) + .then((allPatterns) => + Promise.resolve(_.filter(allPatterns, (p) => p.length)) ) - .catch(reason => { + .catch((reason) => { console.log(reason); logger.error('Error during buildViewAllPages'); }); @@ -746,15 +751,15 @@ const ui_builder = function() { function uniqueAllPatterns(allPatterns, patternlab) { return _.uniq( _.flatMapDeep( - _.map(allPatterns, patterns => [ + _.map(allPatterns, (patterns) => [ injectDocumentationBlock( - _.find(patterns, p => !p.patternPartial.startsWith('viewall-')), + _.find(patterns, (p) => !p.patternPartial.startsWith('viewall-')), patternlab, false ), ...patterns, ]), - pattern => pattern + (pattern) => pattern ) ); } @@ -767,7 +772,7 @@ const ui_builder = function() { function buildFrontend(patternlabGlobal) { const paths = patternlabGlobal.config.paths; - const uikitPromises = _.map(patternlabGlobal.uikits, uikit => { + const uikitPromises = _.map(patternlabGlobal.uikits, (uikit) => { //we need to make sure the patternlab object gets manipulated per uikit const patternlab = Object.assign({}, patternlabGlobal); @@ -775,7 +780,7 @@ const ui_builder = function() { //determine which patterns should be included in the front-end rendering const styleguidePatterns = groupPatterns(patternlab, uikit); - return new Promise(resolve => { + return new Promise((resolve) => { // set the pattern-specific header by compiling the general-header with data, and then adding it to the meta header const headerPromise = render( Pattern.createEmpty({ extendedTemplate: uikit.header }, patternlab), @@ -783,13 +788,13 @@ const ui_builder = function() { cacheBuster: patternlab.cacheBuster, } ) - .then(headerPartial => { + .then((headerPartial) => { const headFootData = patternlab.data; headFootData.patternLabHead = headerPartial; headFootData.cacheBuster = patternlab.cacheBuster; return render(patternlab.userHead, headFootData); }) - .catch(reason => { + .catch((reason) => { console.log(reason); logger.error('error during header render()'); }); @@ -802,18 +807,18 @@ const ui_builder = function() { cacheBuster: patternlab.cacheBuster, } ) - .then(footerPartial => { + .then((footerPartial) => { const headFootData = patternlab.data; headFootData.patternLabFoot = footerPartial; return render(patternlab.userFoot, headFootData); }) - .catch(reason => { + .catch((reason) => { console.log(reason); logger.error('error during footer render()'); }); return Promise.all([headerPromise, footerPromise]).then( - headFootPromiseResults => { + (headFootPromiseResults) => { // build the viewall pages return buildViewAllPages( @@ -822,7 +827,7 @@ const ui_builder = function() { styleguidePatterns, uikit ) - .then(allPatterns => { + .then((allPatterns) => { // todo track down why we need to make this unique in the first place const uniquePatterns = uniqueAllPatterns( allPatterns, @@ -851,7 +856,7 @@ const ui_builder = function() { patternSectionSubgroup: uikit.patternSectionSubgroup, } ) - .then(styleguideHtml => { + .then((styleguideHtml) => { fs.outputFileSync( path.resolve( path.join( @@ -902,12 +907,12 @@ const ui_builder = function() { exportData(patternlab, uikit); resolve(); }) - .catch(reason => { + .catch((reason) => { console.log(reason); logger.error('error during buildFrontend()'); }); }) - .catch(reason => { + .catch((reason) => { console.log(reason); logger.error('error during buildViewAllPages()'); }); diff --git a/packages/core/src/lib/watchAssets.js b/packages/core/src/lib/watchAssets.js index f087b8a28..6f07626e7 100644 --- a/packages/core/src/lib/watchAssets.js +++ b/packages/core/src/lib/watchAssets.js @@ -10,7 +10,7 @@ let copyFile = require('./copyFile'); // eslint-disable-line prefer-const function onWatchTripped(patternlab, p, assetBase, basePath, dir, copyOptions) { const subPath = p.replace(assetBase, ''); - _.each(patternlab.uikits, uikit => { + _.each(patternlab.uikits, (uikit) => { const destination = path.resolve( basePath, uikit.outputDir, @@ -57,10 +57,10 @@ const watchAssets = ( //watch for changes and copy assetWatcher - .on('add', p => { + .on('add', (p) => { onWatchTripped(patternlab, p, assetBase, basePath, dir, copyOptions); }) - .on('change', p => { + .on('change', (p) => { onWatchTripped(patternlab, p, assetBase, basePath, dir, copyOptions); }); diff --git a/packages/core/src/lib/watchPatternLabFiles.js b/packages/core/src/lib/watchPatternLabFiles.js index 6af0bcbb8..c2eb681ab 100644 --- a/packages/core/src/lib/watchPatternLabFiles.js +++ b/packages/core/src/lib/watchPatternLabFiles.js @@ -20,11 +20,11 @@ const watchPatternLabFiles = ( assetDirectories.source.data, assetDirectories.source.meta, ]; - const globalPaths = globalSources.map(globalSource => + const globalPaths = globalSources.map((globalSource) => path.join(path.resolve(basePath, globalSource), '*') ); - _.each(globalPaths, globalPath => { + _.each(globalPaths, (globalPath) => { logger.debug(`Pattern Lab is watching ${globalPath} for changes!`); if (patternlab.watchers[globalPath]) { @@ -43,7 +43,7 @@ const watchPatternLabFiles = ( //watch for changes and rebuild globalWatcher - .on('addDir', async p => { + .on('addDir', async (p) => { await pluginMananger.raiseEvent( patternlab, events.PATTERNLAB_GLOBAL_CHANGE, @@ -52,7 +52,7 @@ const watchPatternLabFiles = ( } ); }) - .on('add', async p => { + .on('add', async (p) => { await pluginMananger.raiseEvent( patternlab, events.PATTERNLAB_GLOBAL_CHANGE, @@ -61,7 +61,7 @@ const watchPatternLabFiles = ( } ); }) - .on('change', async p => { + .on('change', async (p) => { await pluginMananger.raiseEvent( patternlab, events.PATTERNLAB_GLOBAL_CHANGE, @@ -78,13 +78,13 @@ const watchPatternLabFiles = ( const baseFileExtensions = ['.json', '.yml', '.yaml', '.md']; const patternWatches = baseFileExtensions .concat(patternlab.engines.getSupportedFileExtensions()) - .map(dotExtension => + .map((dotExtension) => path.join( path.resolve(basePath, assetDirectories.source.patterns), `/**/*${dotExtension}` ) ); - _.each(patternWatches, patternWatchPath => { + _.each(patternWatches, (patternWatchPath) => { logger.debug( `Pattern Lab is watching ${patternWatchPath} for changes - local!` ); @@ -105,7 +105,7 @@ const watchPatternLabFiles = ( //watch for changes and rebuild patternWatcher - .on('addDir', async p => { + .on('addDir', async (p) => { await pluginMananger.raiseEvent( patternlab, events.PATTERNLAB_PATTERN_CHANGE, @@ -114,7 +114,7 @@ const watchPatternLabFiles = ( } ); }) - .on('add', async p => { + .on('add', async (p) => { await pluginMananger.raiseEvent( patternlab, events.PATTERNLAB_PATTERN_CHANGE, @@ -123,7 +123,7 @@ const watchPatternLabFiles = ( } ); }) - .on('change', async p => { + .on('change', async (p) => { await pluginMananger.raiseEvent( patternlab, events.PATTERNLAB_PATTERN_CHANGE, @@ -134,7 +134,7 @@ const watchPatternLabFiles = ( }) // the watcher does not react on unlink and unlinkDir // events, so patterns are never removed - .on('unlink', async p => { + .on('unlink', async (p) => { patternlab.graph.sync(); patternlab.graph.upgradeVersion(); await pluginMananger.raiseEvent( @@ -145,7 +145,7 @@ const watchPatternLabFiles = ( } ); }) - .on('unlinkDir', async p => { + .on('unlinkDir', async (p) => { patternlab.graph.sync(); patternlab.graph.upgradeVersion(); await pluginMananger.raiseEvent( From e834b42a1848099c03d61dec20f135e2d60e12cc Mon Sep 17 00:00:00 2001 From: Maximilian <787658+mfranzke@users.noreply.github.com> Date: Mon, 29 Mar 2021 21:28:32 +0200 Subject: [PATCH 08/10] refactor(husky): updated husky and added pinst Yarn 2 doesn't support prepare lifecycle script, so husky needs to be installed differently (this doesn't apply to Yarn 1 though) --- package.json | 9 +++++---- yarn.lock | 20 ++++++++++++++++---- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 7c383f7ee..fb3e6db8c 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ }, "private": true, "scripts": { - "postinstall": "lerna run postbootstrap", + "postinstall": "husky install && lerna run postbootstrap", "setup": "yarn", "build:uikit": "cd packages/uikit-workshop && npm run build", "precommit": "pretty-quick --staged", @@ -39,10 +39,10 @@ "test": "lerna run test", "clean": "git clean -dfx", "publish": "npx lerna publish -m \"[skip travis] chore(release): publish %s\"", - "postpublish": "auto release", + "postpublish": "pinst --enable && auto release", "preview:docs": "cd packages/docs && yarn production", "preview:hbs": "cd packages/development-edition-engine-handlebars && yarn pl:starterkit && yarn pl:build", - "prepare": "husky install" + "prepublishOnly": "pinst --disable" }, "nyc": { "exclude": [ @@ -53,6 +53,7 @@ ] }, "devDependencies": { - "husky": "^5.2.0" + "husky": "^6.0.0", + "pinst": "^2.1.6" } } diff --git a/yarn.lock b/yarn.lock index 8fa1cd49d..417e3976d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8692,6 +8692,11 @@ fromentries@^1.2.0: resolved "https://registry.yarnpkg.com/fromentries/-/fromentries-1.2.0.tgz#e6aa06f240d6267f913cea422075ef88b63e7897" integrity sha512-33X7H/wdfO99GdRLLgkjUrD4geAFdq/Uv0kl3HD4da6HDixd2GUg8Mw7dahLCV9r/EARkmtYBB6Tch4EEokFTQ== +fromentries@^1.3.2: + version "1.3.2" + resolved "https://registry.yarnpkg.com/fromentries/-/fromentries-1.3.2.tgz#e4bca6808816bf8f93b52750f1127f5a6fd86e3a" + integrity sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg== + fs-access@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/fs-access/-/fs-access-1.0.1.tgz#d6a87f262271cefebec30c553407fb995da8777a" @@ -10032,10 +10037,10 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" -husky@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/husky/-/husky-5.2.0.tgz#fc5e1c2300d34855d47de4753607d00943fc0802" - integrity sha512-AM8T/auHXRBxlrfPVLKP6jt49GCM2Zz47m8G3FOMsLmTv8Dj/fKVWE0Rh2d4Qrvmy131xEsdQnb3OXRib67PGg== +husky@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/husky/-/husky-6.0.0.tgz#810f11869adf51604c32ea577edbc377d7f9319e" + integrity sha512-SQS2gDTB7tBN486QSoKPKQItZw97BMOd+Kdb6ghfpBc0yXyzrddI0oDV5MkDAbuB4X2mO3/nj60TRMcYxwzZeQ== iconv-lite@0.4.24, iconv-lite@^0.4.17, iconv-lite@^0.4.19, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: version "0.4.24" @@ -14267,6 +14272,13 @@ pinkie@^2.0.0: resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= +pinst@^2.1.6: + version "2.1.6" + resolved "https://registry.yarnpkg.com/pinst/-/pinst-2.1.6.tgz#8d968b8ec1dac5dddcfc976c735592dbec58b42c" + integrity sha512-B4dYmf6nEXg1NpDSB+orYWvKa5Kfmz5KzWC29U59dpVM4S/+xp0ak/JMEsw04UQTNNKps7klu0BUalr343Gt9g== + dependencies: + fromentries "^1.3.2" + pirates@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/pirates/-/pirates-3.0.2.tgz#7e6f85413fd9161ab4e12b539b06010d85954bb9" From 243068f43f7095eaae9cff9109114de48c939a5d Mon Sep 17 00:00:00 2001 From: Maximilian <787658+mfranzke@users.noreply.github.com> Date: Mon, 29 Mar 2021 21:36:39 +0200 Subject: [PATCH 09/10] Revert "refactor(husky): updated husky and added pinst" This reverts commit e834b42a1848099c03d61dec20f135e2d60e12cc. --- package.json | 9 ++++----- yarn.lock | 20 ++++---------------- 2 files changed, 8 insertions(+), 21 deletions(-) diff --git a/package.json b/package.json index fb3e6db8c..7c383f7ee 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ }, "private": true, "scripts": { - "postinstall": "husky install && lerna run postbootstrap", + "postinstall": "lerna run postbootstrap", "setup": "yarn", "build:uikit": "cd packages/uikit-workshop && npm run build", "precommit": "pretty-quick --staged", @@ -39,10 +39,10 @@ "test": "lerna run test", "clean": "git clean -dfx", "publish": "npx lerna publish -m \"[skip travis] chore(release): publish %s\"", - "postpublish": "pinst --enable && auto release", + "postpublish": "auto release", "preview:docs": "cd packages/docs && yarn production", "preview:hbs": "cd packages/development-edition-engine-handlebars && yarn pl:starterkit && yarn pl:build", - "prepublishOnly": "pinst --disable" + "prepare": "husky install" }, "nyc": { "exclude": [ @@ -53,7 +53,6 @@ ] }, "devDependencies": { - "husky": "^6.0.0", - "pinst": "^2.1.6" + "husky": "^5.2.0" } } diff --git a/yarn.lock b/yarn.lock index 417e3976d..8fa1cd49d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8692,11 +8692,6 @@ fromentries@^1.2.0: resolved "https://registry.yarnpkg.com/fromentries/-/fromentries-1.2.0.tgz#e6aa06f240d6267f913cea422075ef88b63e7897" integrity sha512-33X7H/wdfO99GdRLLgkjUrD4geAFdq/Uv0kl3HD4da6HDixd2GUg8Mw7dahLCV9r/EARkmtYBB6Tch4EEokFTQ== -fromentries@^1.3.2: - version "1.3.2" - resolved "https://registry.yarnpkg.com/fromentries/-/fromentries-1.3.2.tgz#e4bca6808816bf8f93b52750f1127f5a6fd86e3a" - integrity sha512-cHEpEQHUg0f8XdtZCc2ZAhrHzKzT0MrFUTcvx+hfxYu7rGMDc5SKoXFh+n4YigxsHXRzc6OrCshdR1bWH6HHyg== - fs-access@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/fs-access/-/fs-access-1.0.1.tgz#d6a87f262271cefebec30c553407fb995da8777a" @@ -10037,10 +10032,10 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" -husky@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/husky/-/husky-6.0.0.tgz#810f11869adf51604c32ea577edbc377d7f9319e" - integrity sha512-SQS2gDTB7tBN486QSoKPKQItZw97BMOd+Kdb6ghfpBc0yXyzrddI0oDV5MkDAbuB4X2mO3/nj60TRMcYxwzZeQ== +husky@^5.2.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/husky/-/husky-5.2.0.tgz#fc5e1c2300d34855d47de4753607d00943fc0802" + integrity sha512-AM8T/auHXRBxlrfPVLKP6jt49GCM2Zz47m8G3FOMsLmTv8Dj/fKVWE0Rh2d4Qrvmy131xEsdQnb3OXRib67PGg== iconv-lite@0.4.24, iconv-lite@^0.4.17, iconv-lite@^0.4.19, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: version "0.4.24" @@ -14272,13 +14267,6 @@ pinkie@^2.0.0: resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA= -pinst@^2.1.6: - version "2.1.6" - resolved "https://registry.yarnpkg.com/pinst/-/pinst-2.1.6.tgz#8d968b8ec1dac5dddcfc976c735592dbec58b42c" - integrity sha512-B4dYmf6nEXg1NpDSB+orYWvKa5Kfmz5KzWC29U59dpVM4S/+xp0ak/JMEsw04UQTNNKps7klu0BUalr343Gt9g== - dependencies: - fromentries "^1.3.2" - pirates@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/pirates/-/pirates-3.0.2.tgz#7e6f85413fd9161ab4e12b539b06010d85954bb9" From e12aa1ba2b07df5fb4311febc1e1fb3ec5a3feff Mon Sep 17 00:00:00 2001 From: Maximilian <787658+mfranzke@users.noreply.github.com> Date: Mon, 29 Mar 2021 21:39:18 +0200 Subject: [PATCH 10/10] refactor(husky): updated husky --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 7c383f7ee..b35078a90 100644 --- a/package.json +++ b/package.json @@ -53,6 +53,6 @@ ] }, "devDependencies": { - "husky": "^5.2.0" + "husky": "^6.0.0" } } diff --git a/yarn.lock b/yarn.lock index 8fa1cd49d..08016c8ab 100644 --- a/yarn.lock +++ b/yarn.lock @@ -10032,10 +10032,10 @@ humanize-ms@^1.2.1: dependencies: ms "^2.0.0" -husky@^5.2.0: - version "5.2.0" - resolved "https://registry.yarnpkg.com/husky/-/husky-5.2.0.tgz#fc5e1c2300d34855d47de4753607d00943fc0802" - integrity sha512-AM8T/auHXRBxlrfPVLKP6jt49GCM2Zz47m8G3FOMsLmTv8Dj/fKVWE0Rh2d4Qrvmy131xEsdQnb3OXRib67PGg== +husky@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/husky/-/husky-6.0.0.tgz#810f11869adf51604c32ea577edbc377d7f9319e" + integrity sha512-SQS2gDTB7tBN486QSoKPKQItZw97BMOd+Kdb6ghfpBc0yXyzrddI0oDV5MkDAbuB4X2mO3/nj60TRMcYxwzZeQ== iconv-lite@0.4.24, iconv-lite@^0.4.17, iconv-lite@^0.4.19, iconv-lite@^0.4.24, iconv-lite@^0.4.4, iconv-lite@~0.4.13: version "0.4.24"