From b6cd194deb2aa701fde9544e0ec2592082c703ab Mon Sep 17 00:00:00 2001 From: Ivan Akulov Date: Sun, 15 Mar 2020 22:31:22 +0300 Subject: [PATCH 1/3] Add contributing guidelines --- CONTRIBUTING.md | 23 +++++++++++++++++++++++ README.md | 6 +++++- 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..d88ccc2 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,23 @@ +# Contributing + +Hey! Thanks for your interest in contributing. Here’s how to start: + +1. Fork the repo and clone it to your computer ([GitHub guide](https://help.github.com/en/github/getting-started-with-github/fork-a-repo)) + +2. Install dependencies: + + ``` + yarn + ``` + +3. Head to `index.js` and make your changes! + +4. Once done, test your changes with + + ``` + yarn test + ``` + + Fix any issues and add new tests if necessary. + +5. Commit your changes and submit a PR! diff --git a/README.md b/README.md index de386d0..46f736b 100644 --- a/README.md +++ b/README.md @@ -54,7 +54,11 @@ Be careful! A typo in the `localesToKeep` array with this flag enabled will sile ## Related projects -* [`moment-timezone-data-webpack-plugin`](https://github.com/gilmoreorless/moment-timezone-data-webpack-plugin) – a plugin optimizing the Moment Timezone library. +- [`moment-timezone-data-webpack-plugin`](https://github.com/gilmoreorless/moment-timezone-data-webpack-plugin) – a plugin optimizing the Moment Timezone library. + +## Contributing + +See [CONTRIBUTING.md](https://github.com/iamakulov/moment-locales-webpack-plugin/blob/master/CONTRIBUTING.md) for how to contribute. ## License From f9bb4567cba9ea45a31469b776efc63e16a07ab9 Mon Sep 17 00:00:00 2001 From: Ivan Akulov Date: Sun, 15 Mar 2020 22:31:28 +0300 Subject: [PATCH 2/3] Configure Prettier checks --- package.json | 5 ++++- yarn.lock | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index e560663..1f7fa0d 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,9 @@ "scripts": { "test-webpack-5": "WEBPACK_PACKAGE=webpack jest", "test-webpack-4": "WEBPACK_PACKAGE=webpack-v4 jest", - "test": "yarn test-webpack-5 && yarn test-webpack-4" + "test-code-style": "echo 'If there’re any files listed below, this means they break the code style. Fix them with: yarn fix-code-style' && prettier --list-different '**/*.js'", + "fix-code-style": "prettier --write '**/*.js'", + "test": "yarn test-webpack-5 && yarn test-webpack-4 && yarn test-code-style" }, "repository": "iamakulov/moment-locales-webpack-plugin", "author": "Ivan Akulov (iamakulov.com)", @@ -18,6 +20,7 @@ "devDependencies": { "jest": "^24.8.0", "moment": "^2.21.0", + "prettier": "^1.19.1", "proxyquire": "^2.0.1", "temp-dir": "^1.0.0", "webpack": "^5.0.0-beta.14", diff --git a/yarn.lock b/yarn.lock index a59b2ef..b122c48 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3668,6 +3668,11 @@ prelude-ls@~1.1.2: resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54" integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ= +prettier@^1.19.1: + version "1.19.1" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-1.19.1.tgz#f7d7f5ff8a9cd872a7be4ca142095956a60797cb" + integrity sha512-s7PoyDv/II1ObgQunCbB9PdLmUcBZcnWOcxDh7O0N/UwDEsHyqkW+Qh28jW+mVuCdx7gLB0BotYI1Y6uI9iyew== + pretty-format@^24.9.0: version "24.9.0" resolved "https://registry.yarnpkg.com/pretty-format/-/pretty-format-24.9.0.tgz#12fac31b37019a4eea3c11aa9a959eb7628aa7c9" From 246c4f86dbc1edbc171e46f0af4d7dd0c840bb77 Mon Sep 17 00:00:00 2001 From: Ivan Akulov Date: Sun, 15 Mar 2020 22:38:25 +0300 Subject: [PATCH 3/3] Add cross-env for windows developers --- package.json | 5 +++-- yarn.lock | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1f7fa0d..01eb2d9 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,8 @@ "description": "Strip unused locales from Moment.js", "main": "index.js", "scripts": { - "test-webpack-5": "WEBPACK_PACKAGE=webpack jest", - "test-webpack-4": "WEBPACK_PACKAGE=webpack-v4 jest", + "test-webpack-5": "cross-env WEBPACK_PACKAGE=webpack jest", + "test-webpack-4": "cross-env WEBPACK_PACKAGE=webpack-v4 jest", "test-code-style": "echo 'If there’re any files listed below, this means they break the code style. Fix them with: yarn fix-code-style' && prettier --list-different '**/*.js'", "fix-code-style": "prettier --write '**/*.js'", "test": "yarn test-webpack-5 && yarn test-webpack-4 && yarn test-code-style" @@ -18,6 +18,7 @@ "webpack": "^1 || ^2 || ^3 || ^4 || ^5" }, "devDependencies": { + "cross-env": "^7.0.2", "jest": "^24.8.0", "moment": "^2.21.0", "prettier": "^1.19.1", diff --git a/yarn.lock b/yarn.lock index b122c48..80a6c6a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1365,6 +1365,13 @@ create-hmac@^1.1.0, create-hmac@^1.1.2, create-hmac@^1.1.4: safe-buffer "^5.0.1" sha.js "^2.4.8" +cross-env@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/cross-env/-/cross-env-7.0.2.tgz#bd5ed31339a93a3418ac4f3ca9ca3403082ae5f9" + integrity sha512-KZP/bMEOJEDCkDQAyRhu3RL2ZO/SUVrxQVI0G3YEQ+OLbRA3c6zgixe8Mq8a/z7+HKlNEjo8oiLUs8iRijY2Rw== + dependencies: + cross-spawn "^7.0.1" + cross-spawn@^6.0.0: version "6.0.5" resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-6.0.5.tgz#4a5ec7c64dfae22c3a14124dbacdee846d80cbc4" @@ -1376,6 +1383,15 @@ cross-spawn@^6.0.0: shebang-command "^1.2.0" which "^1.2.9" +cross-spawn@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.1.tgz#0ab56286e0f7c24e153d04cc2aa027e43a9a5d14" + integrity sha512-u7v4o84SwFpD32Z8IIcPZ6z1/ie24O6RU3RbtL5Y316l3KuHVPx9ItBgWQ6VlfAFnRnTtMUrsQ9MUUTuEZjogg== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + crypto-browserify@^3.11.0: version "3.12.0" resolved "https://registry.yarnpkg.com/crypto-browserify/-/crypto-browserify-3.12.0.tgz#396cf9f3137f03e4b8e532c58f698254e00f80ec" @@ -3594,6 +3610,11 @@ path-key@^2.0.0, path-key@^2.0.1: resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" integrity sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A= +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + path-parse@^1.0.6: version "1.0.6" resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" @@ -4103,11 +4124,23 @@ shebang-command@^1.2.0: dependencies: shebang-regex "^1.0.0" +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + shebang-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" integrity sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM= +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + shellwords@^0.1.1: version "0.1.1" resolved "https://registry.yarnpkg.com/shellwords/-/shellwords-0.1.1.tgz#d6b9181c1a48d397324c84871efbcfc73fc0654b" @@ -4854,6 +4887,13 @@ which@^1.2.9, which@^1.3.0: dependencies: isexe "^2.0.0" +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + word-wrap@~1.2.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c"