From f77807316d25300f1733a0042d79a9cdeadb9d00 Mon Sep 17 00:00:00 2001 From: fabianmoronzirfas Date: Tue, 9 Jun 2020 18:42:54 +0200 Subject: [PATCH 1/6] use @inpyjamas/script --- .eslintignore | 4 + .eslintrc.js | 1 + .npmignore | 13 + husky.config.js | 1 + jest.config.js | 11 + lint-staged.config.js | 1 + package-lock.json | 943 ++++++++++++++++++++++++++++++++++++++++++ package.json | 71 +--- prettier.config.js | 1 + 9 files changed, 979 insertions(+), 67 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc.js create mode 100644 .npmignore create mode 100644 husky.config.js create mode 100644 jest.config.js create mode 100644 lint-staged.config.js create mode 100644 prettier.config.js diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..64e8662 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,4 @@ +node_modules +dist +coverage +generators/index.js \ No newline at end of file diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..cd92b4b --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1 @@ +module.exports = require("@inpyjamas/scripts/dist/config/eslint/typescript"); diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..9af4266 --- /dev/null +++ b/.npmignore @@ -0,0 +1,13 @@ +.vscode +node_modules +.eslintrc.js +.gitignore +husky.config.js +jest.config.js +LICENSE +lint-staged.config.js +prettier.config.js +renovate.json +tsconfig.json +coverage +.github \ No newline at end of file diff --git a/husky.config.js b/husky.config.js new file mode 100644 index 0000000..60c8fed --- /dev/null +++ b/husky.config.js @@ -0,0 +1 @@ +module.exports = require("@inpyjamas/scripts/dist/config/husky"); diff --git a/jest.config.js b/jest.config.js new file mode 100644 index 0000000..e39fe15 --- /dev/null +++ b/jest.config.js @@ -0,0 +1,11 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +const utils = require("@inpyjamas/scripts/dist/utlities"); +const config = require("@inpyjamas/scripts/dist/config/jest/typescript"); +module.exports = utils.merge(config, { + modulePathIgnorePatterns: ["/generators/templates"], + testPathIgnorePatterns: [ + "node_modules/", + "/generators/app", + "/generators/templates/*", + ], +}); diff --git a/lint-staged.config.js b/lint-staged.config.js new file mode 100644 index 0000000..dfbefd5 --- /dev/null +++ b/lint-staged.config.js @@ -0,0 +1 @@ +module.exports = require("@inpyjamas/scripts/dist/config/lint-staged"); diff --git a/package-lock.json b/package-lock.json index 632fb4c..f4ecebe 100644 --- a/package-lock.json +++ b/package-lock.json @@ -368,6 +368,302 @@ "resolve-global": "^1.0.0" } }, + "@inpyjamas/scripts": { + "version": "0.1.0-alpha", + "resolved": "https://registry.npmjs.org/@inpyjamas/scripts/-/scripts-0.1.0-alpha.tgz", + "integrity": "sha512-nhuhAQK91RDSXVOqfPG8UgmnhFgraIQ8go88MAX5kLS3y9Aqzid++eYImeCVs+ND2yh/nBCr8KNOshV+XvEhVQ==", + "dev": true, + "requires": { + "@types/jest": "25.2.3", + "@types/lodash.merge": "4.6.6", + "@types/node": "12.12.6", + "@typescript-eslint/eslint-plugin": "3.1.0", + "@typescript-eslint/parser": "3.1.0", + "cross-env": "7.0.2", + "eslint": "7.1.0", + "eslint-config-prettier": "6.11.0", + "eslint-plugin-jest": "23.13.2", + "eslint-plugin-prettier": "3.1.3", + "husky": "4.2.5", + "jest": "26.0.1", + "lint-staged": "10.2.7", + "lodash.merge": "4.6.2", + "prettier": "2.0.5", + "rimraf": "3.0.2", + "ts-jest": "26.1.0", + "typescript": "3.9.3" + }, + "dependencies": { + "@types/node": { + "version": "12.12.6", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.6.tgz", + "integrity": "sha512-FjsYUPzEJdGXjwKqSpE0/9QEh6kzhTAeObA54rn6j3rR4C/mzpI9L0KNfoeASSPMMdxIsoJuCLDWcM/rVjIsSA==", + "dev": true + }, + "@typescript-eslint/eslint-plugin": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.1.0.tgz", + "integrity": "sha512-D52KwdgkjYc+fmTZKW7CZpH5ZBJREJKZXRrveMiRCmlzZ+Rw9wRVJ1JAmHQ9b/+Ehy1ZeaylofDB9wwXUt83wg==", + "dev": true, + "requires": { + "@typescript-eslint/experimental-utils": "3.1.0", + "functional-red-black-tree": "^1.0.1", + "regexpp": "^3.0.0", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + } + }, + "@typescript-eslint/experimental-utils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.1.0.tgz", + "integrity": "sha512-Zf8JVC2K1svqPIk1CB/ehCiWPaERJBBokbMfNTNRczCbQSlQXaXtO/7OfYz9wZaecNvdSvVADt6/XQuIxhC79w==", + "dev": true, + "requires": { + "@types/json-schema": "^7.0.3", + "@typescript-eslint/typescript-estree": "3.1.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0" + } + }, + "@typescript-eslint/parser": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.1.0.tgz", + "integrity": "sha512-NcDSJK8qTA2tPfyGiPes9HtVKLbksmuYjlgGAUs7Ld2K0swdWibnCq9IJx9kJN8JJdgUJSorFiGaPHBgH81F/Q==", + "dev": true, + "requires": { + "@types/eslint-visitor-keys": "^1.0.0", + "@typescript-eslint/experimental-utils": "3.1.0", + "@typescript-eslint/typescript-estree": "3.1.0", + "eslint-visitor-keys": "^1.1.0" + } + }, + "@typescript-eslint/typescript-estree": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.1.0.tgz", + "integrity": "sha512-+4nfYauqeQvK55PgFrmBWFVYb6IskLyOosYEmhH3mSVhfBp9AIJnjExdgDmKWoOBHRcPM8Ihfm2BFpZf0euUZQ==", + "dev": true, + "requires": { + "debug": "^4.1.1", + "eslint-visitor-keys": "^1.1.0", + "glob": "^7.1.6", + "is-glob": "^4.0.1", + "lodash": "^4.17.15", + "semver": "^7.3.2", + "tsutils": "^3.17.1" + } + }, + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "eslint": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.1.0.tgz", + "integrity": "sha512-DfS3b8iHMK5z/YLSme8K5cge168I8j8o1uiVmFCgnnjxZQbCGyraF8bMl7Ju4yfBmCuxD7shOF7eqGkcuIHfsA==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^5.0.0", + "eslint-utils": "^2.0.0", + "eslint-visitor-keys": "^1.1.0", + "espree": "^7.0.0", + "esquery": "^1.2.0", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob-parent": "^5.0.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^7.0.0", + "is-glob": "^4.0.0", + "js-yaml": "^3.13.1", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash": "^4.17.14", + "minimatch": "^3.0.4", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "progress": "^2.0.0", + "regexpp": "^3.1.0", + "semver": "^7.2.1", + "strip-ansi": "^6.0.0", + "strip-json-comments": "^3.1.0", + "table": "^5.2.3", + "text-table": "^0.2.0", + "v8-compile-cache": "^2.0.3" + } + }, + "glob-parent": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "semver": { + "version": "7.3.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + }, + "strip-json-comments": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.0.tgz", + "integrity": "sha512-e6/d0eBu7gHtdCqFt0xJr642LdToM5/cN4Qb9DbHjVx1CP5RyeM+zH7pbecEmDv/lBqb0QH+6Uqq75rxFPkM0w==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "typescript": { + "version": "3.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.3.tgz", + "integrity": "sha512-D/wqnB2xzNFIcoBG9FG8cXRDjiqSTbG2wd8DMZeQyJlP1vfTkIxH4GKveWaEBYySKIg+USu+E+EDIR47SqnaMQ==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", @@ -1506,6 +1802,21 @@ "integrity": "sha512-8+KAKzEvSUdeo+kmqnKrqgeE+LcA0tjYWFY7RPProVYwnqDjukzO+3b6dLD56rYX5TdWejnEOLJYOIeh4CXKuA==", "dev": true }, + "@types/lodash": { + "version": "4.14.155", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.155.tgz", + "integrity": "sha512-vEcX7S7aPhsBCivxMwAANQburHBtfN9RdyXFk84IJmu2Z4Hkg1tOFgaslRiEqqvoLtbCBi6ika1EMspE+NZ9Lg==", + "dev": true + }, + "@types/lodash.merge": { + "version": "4.6.6", + "resolved": "https://registry.npmjs.org/@types/lodash.merge/-/lodash.merge-4.6.6.tgz", + "integrity": "sha512-IB90krzMf7YpfgP3u/EvZEdXVvm4e3gJbUvh5ieuI+o+XqiNEt6fCzqNRaiLlPVScLI59RxIGZMQ3+Ko/DJ8vQ==", + "dev": true, + "requires": { + "@types/lodash": "*" + } + }, "@types/minimatch": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", @@ -1522,6 +1833,12 @@ "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==" }, + "@types/parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", + "dev": true + }, "@types/prettier": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/@types/prettier/-/prettier-2.0.1.tgz", @@ -1704,6 +2021,16 @@ "integrity": "sha512-wdlPY2tm/9XBr7QkKlq0WQVgiuGTX6YWPyRyBviSoScBuLfTVQhvwg6wJ369GJ/1nPfTLMfnrFIfjqVg6d+jQQ==", "dev": true }, + "aggregate-error": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.0.1.tgz", + "integrity": "sha512-quoaXsZ9/BLNae5yiNoUz+Nhkwz83GhWwtYFglcjEQB2NDHCIpApbqXxIFnm4Pq/Nvhrsq5sYJFyohrrxnTGAA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, "ajv": { "version": "6.12.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.2.tgz", @@ -2291,6 +2618,12 @@ } } }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, "cli-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", @@ -2307,6 +2640,60 @@ "colors": "1.0.3" } }, + "cli-truncate": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", + "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", + "dev": true, + "requires": { + "slice-ansi": "^3.0.0", + "string-width": "^4.2.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "slice-ansi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", + "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + } + } + } + }, "cli-width": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.1.tgz", @@ -2445,6 +2832,12 @@ "delayed-stream": "~1.0.0" } }, + "commander": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-5.1.0.tgz", + "integrity": "sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==", + "dev": true + }, "commitizen": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/commitizen/-/commitizen-4.1.2.tgz", @@ -2620,6 +3013,12 @@ "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=" }, + "compare-versions": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", + "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", + "dev": true + }, "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", @@ -2722,6 +3121,58 @@ "capture-stack-trace": "^1.0.0" } }, + "cross-env": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/cross-env/-/cross-env-7.0.2.tgz", + "integrity": "sha512-KZP/bMEOJEDCkDQAyRhu3RL2ZO/SUVrxQVI0G3YEQ+OLbRA3c6zgixe8Mq8a/z7+HKlNEjo8oiLUs8iRijY2Rw==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.1" + }, + "dependencies": { + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "cross-spawn": { "version": "6.0.5", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", @@ -3344,6 +3795,15 @@ } } }, + "eslint-plugin-prettier": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.3.tgz", + "integrity": "sha512-+HG5jmu/dN3ZV3T6eCD7a4BlAySdN7mLIbJYo0z1cFQuI+r2DiTJEFeF68ots93PsnrMxbzIZ2S/ieX+mkrBeQ==", + "dev": true, + "requires": { + "prettier-linter-helpers": "^1.0.0" + } + }, "eslint-scope": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.0.0.tgz", @@ -3752,6 +4212,12 @@ "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.1.tgz", "integrity": "sha512-8UEa58QDLauDNfpbrX55Q9jrGHThw2ZMdOky5Gl1CDtVeJDPVrG4Jxx1N8jw2gkWaff5UUuX1KJd+9zGe2B+ZA==" }, + "fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, "fast-glob": { "version": "2.2.7", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-2.2.7.tgz", @@ -3847,6 +4313,15 @@ "locate-path": "^3.0.0" } }, + "find-versions": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz", + "integrity": "sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==", + "dev": true, + "requires": { + "semver-regex": "^2.0.0" + } + }, "findup-sync": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/findup-sync/-/findup-sync-3.0.0.tgz", @@ -4016,6 +4491,12 @@ "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, + "get-own-enumerable-property-symbols": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", + "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==", + "dev": true + }, "get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", @@ -4296,6 +4777,101 @@ "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==" }, + "husky": { + "version": "4.2.5", + "resolved": "https://registry.npmjs.org/husky/-/husky-4.2.5.tgz", + "integrity": "sha512-SYZ95AjKcX7goYVZtVZF2i6XiZcHknw50iXvY7b0MiGoj5RwdgRQNEHdb+gPDPCXKlzwrybjFjkL6FOj8uRhZQ==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "ci-info": "^2.0.0", + "compare-versions": "^3.6.0", + "cosmiconfig": "^6.0.0", + "find-versions": "^3.2.0", + "opencollective-postinstall": "^2.0.2", + "pkg-dir": "^4.2.0", + "please-upgrade-node": "^3.2.0", + "slash": "^3.0.0", + "which-pm-runs": "^1.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "cosmiconfig": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", + "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", + "dev": true, + "requires": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.7.2" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -4343,6 +4919,12 @@ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", @@ -4581,6 +5163,12 @@ } } }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true + }, "is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", @@ -4605,6 +5193,12 @@ "resolved": "https://registry.npmjs.org/is-redirect/-/is-redirect-1.0.0.tgz", "integrity": "sha1-HQPd7VO9jbDzDCbk+V02/HyH3CQ=" }, + "is-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", + "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=", + "dev": true + }, "is-retry-allowed": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/is-retry-allowed/-/is-retry-allowed-1.2.0.tgz", @@ -7087,6 +7681,219 @@ "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=" }, + "lint-staged": { + "version": "10.2.7", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.2.7.tgz", + "integrity": "sha512-srod2bTpF8riaLz+Bgr6v0mI/nSntE8M9jbh4WwAhoosx0G7RKEUIG7mI5Nu5SMbTF9o8GROPgK0Lhf5cDnUUw==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "cli-truncate": "2.1.0", + "commander": "^5.1.0", + "cosmiconfig": "^6.0.0", + "debug": "^4.1.1", + "dedent": "^0.7.0", + "execa": "^4.0.1", + "listr2": "^2.0.2", + "log-symbols": "^4.0.0", + "micromatch": "^4.0.2", + "normalize-path": "^3.0.0", + "please-upgrade-node": "^3.2.0", + "string-argv": "0.3.1", + "stringify-object": "^3.3.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "cosmiconfig": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-6.0.0.tgz", + "integrity": "sha512-xb3ZL6+L8b9JLLCx3ZdoZy4+2ECphCMo2PwqgP1tlfVq6M6YReyzBJtvWWtbDSpNr9hn96pkCiZqUcFEc+54Qg==", + "dev": true, + "requires": { + "@types/parse-json": "^4.0.0", + "import-fresh": "^3.1.0", + "parse-json": "^5.0.0", + "path-type": "^4.0.0", + "yaml": "^1.7.2" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "log-symbols": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", + "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "dev": true, + "requires": { + "chalk": "^4.0.0" + } + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + } + } + }, + "listr2": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-2.1.3.tgz", + "integrity": "sha512-6oy3QhrZAlJGrG8oPcRp1hix1zUpb5AvyvZ5je979HCyf48tIj3Hn1TG5+rfyhz30t7HfySH/OIaVbwrI2kruA==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "cli-truncate": "^2.1.0", + "figures": "^3.2.0", + "indent-string": "^4.0.0", + "log-update": "^4.0.0", + "p-map": "^4.0.0", + "rxjs": "^6.5.5", + "through": "^2.3.8" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", @@ -7119,6 +7926,12 @@ "integrity": "sha1-vMbEmkKihA7Zl/Mj6tpezRguC/4=", "dev": true }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, "lodash.sortby": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", @@ -7133,6 +7946,62 @@ "chalk": "^2.0.1" } }, + "log-update": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz", + "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", + "dev": true, + "requires": { + "ansi-escapes": "^4.3.0", + "cli-cursor": "^3.1.0", + "slice-ansi": "^4.0.0", + "wrap-ansi": "^6.2.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", + "dev": true, + "requires": { + "@types/color-name": "^1.1.1", + "color-convert": "^2.0.1" + } + }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + } + } + } + }, "longest": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/longest/-/longest-2.0.1.tgz", @@ -7627,6 +8496,12 @@ "mimic-fn": "^2.1.0" } }, + "opencollective-postinstall": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", + "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", + "dev": true + }, "optionator": { "version": "0.8.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", @@ -7673,6 +8548,15 @@ "p-limit": "^2.0.0" } }, + "p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", @@ -7863,6 +8747,15 @@ } } }, + "please-upgrade-node": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", + "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", + "dev": true, + "requires": { + "semver-compare": "^1.0.0" + } + }, "posix-character-classes": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", @@ -7885,6 +8778,15 @@ "integrity": "sha512-7PtVymN48hGcO4fGjybyBSIWDsLU4H4XlvOHfq91pz9kkGlonzwTfYkaIEwiRg/dAJF9YlbsduBAgtYLi+8cFg==", "dev": true }, + "prettier-linter-helpers": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", + "dev": true, + "requires": { + "fast-diff": "^1.1.2" + } + }, "pretty-bytes": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.3.0.tgz", @@ -8326,6 +9228,18 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" }, + "semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", + "dev": true + }, + "semver-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz", + "integrity": "sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==", + "dev": true + }, "set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -8716,6 +9630,12 @@ "integrity": "sha1-NbCYdbT/SfJqd35QmzCQoyJr8ks=", "dev": true }, + "string-argv": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", + "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==", + "dev": true + }, "string-length": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.1.tgz", @@ -8770,6 +9690,17 @@ "safe-buffer": "~5.2.0" } }, + "stringify-object": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", + "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==", + "dev": true, + "requires": { + "get-own-enumerable-property-symbols": "^3.0.0", + "is-obj": "^1.0.1", + "is-regexp": "^1.0.0" + } + }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", @@ -9462,6 +10393,12 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, + "which-pm-runs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", + "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", + "dev": true + }, "with-open-file": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/with-open-file/-/with-open-file-0.1.7.tgz", @@ -9580,6 +10517,12 @@ "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, + "yaml": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", + "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==", + "dev": true + }, "yargs": { "version": "15.3.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.3.1.tgz", diff --git a/package.json b/package.json index 2e63a6a..002ba1e 100644 --- a/package.json +++ b/package.json @@ -3,11 +3,12 @@ "version": "0.5.0", "description": "my personal opinionated generator for typescript eslint prettier express jest nodemon husky", "scripts": { - "test": "jest", + "test": "jest --watch", "test:ci": "jest --collect-coverage", "build": "tsc -p .", "dev": "tsc -p . --watch", - "prepare": "npm run build" + "prepare": "npm run build", + "lint-staged": "lint-staged" }, "keywords": [ "yeoman-generator" @@ -23,6 +24,7 @@ }, "main": "generators/index.js", "devDependencies": { + "@inpyjamas/scripts": "0.1.0-alpha", "@types/jest": "25.2.3", "@types/node": "12.12.45", "@types/rimraf": "3.0.0", @@ -54,70 +56,5 @@ "commitizen": { "path": "./node_modules/cz-conventional-changelog" } - }, - "jest": { - "preset": "ts-jest", - "testEnvironment": "node", - "testMatch": [ - "/**/?(*.)+(test).[jt]s?(x)" - ], - "modulePathIgnorePatterns": [ - "/generators/templates" - ], - "testPathIgnorePatterns": [ - "node_modules/", - "/generators/app", - "/generators/templates/*" - ], - "collectCoverage": true, - "coverageReporters": [ - "lcov", - "text" - ], - "coverageThreshold": { - "global": { - "branches": 80, - "functions": 80, - "lines": 80, - "statements": 80 - } - } - }, - "prettier": { - "printWidth": 80 - }, - "eslintConfig": { - "ignorePatterns": [ - "node_modules", - "dist", - "coverage", - "generators/index.js" - ], - "env": { - "jest/globals": true - }, - "root": true, - "parser": "@typescript-eslint/parser", - "plugins": [ - "@typescript-eslint", - "jest" - ], - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended", - "prettier/@typescript-eslint", - "plugin:jest/recommended" - ], - "rules": { - "@typescript-eslint/no-unused-vars": [ - "warn", - { - "args": "after-used", - "varsIgnorePattern": "_", - "argsIgnorePattern": "_" - } - ] - } } } diff --git a/prettier.config.js b/prettier.config.js new file mode 100644 index 0000000..59f04c4 --- /dev/null +++ b/prettier.config.js @@ -0,0 +1 @@ +module.exports = require("@inpyjamas/scripts/dist/config/prettier"); From bf1e8c9a39a9618b4fdb42df7077a37bb4c893be Mon Sep 17 00:00:00 2001 From: fabianmoronzirfas Date: Tue, 9 Jun 2020 19:07:40 +0200 Subject: [PATCH 2/6] use @inpyjamas/script in templates --- .nvmrc | 2 +- generators/app/lib/dev-dependencies.js | 77 ++++++++++--------- generators/common/.eslintignore | 0 generators/common/.eslintrc.js | 1 + generators/common/husky.config.js | 1 + generators/common/jest.config.js | 13 ++++ generators/common/lint-staged.config.js | 1 + generators/common/prettier.config.js | 1 + generators/common/renovate.json | 3 + generators/src/lib/dependencies.ts | 2 +- generators/src/lib/dev-dependencies.ts | 29 +++---- .../templates/typescript-express/package.json | 73 ------------------ .../typescript-jekyll-webpack/package.json | 76 ------------------ .../webpack/webpack.config.prod.js | 8 +- 14 files changed, 80 insertions(+), 207 deletions(-) create mode 100644 generators/common/.eslintignore create mode 100644 generators/common/.eslintrc.js create mode 100644 generators/common/husky.config.js create mode 100644 generators/common/jest.config.js create mode 100644 generators/common/lint-staged.config.js create mode 100644 generators/common/prettier.config.js create mode 100644 generators/common/renovate.json diff --git a/.nvmrc b/.nvmrc index a983b8e..db386c5 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v13.10.1 +v12.18.0 diff --git a/generators/app/lib/dev-dependencies.js b/generators/app/lib/dev-dependencies.js index 2086ab6..a006502 100644 --- a/generators/app/lib/dev-dependencies.js +++ b/generators/app/lib/dev-dependencies.js @@ -2,42 +2,43 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.devDependencies = void 0; exports.devDependencies = { - shared: [ - "@types/jest", - "@types/node", - "@typescript-eslint/eslint-plugin", - "@typescript-eslint/parser", - "cz-conventional-changelog", - "eslint-config-prettier", - "eslint-plugin-jest", - "eslint-plugin-prettier", - "eslint", - "jest", - "prettier", - "ts-jest", - "typescript", - "husky", - "lint-staged" - ], - "typescript-express": ["@types/express", "@types/morgan", "nodemon"], - "typescript-jekyll-webpack": [ - "tslib", - "autoprefixer", - "cross-env", - "css-loader", - "cssnano", - "extract-loader", - "file-loader", - "node-sass", - "npm-run-all", - "postcss-cli", - "postcss-load-config", - "postcss-loader", - "sass-loader", - "ts-loader", - "webpack", - "webpack-cli", - "webpack-merge" - ], - basiljs: [] + shared: [ + "@types/jest", + "@types/node", + // "@typescript-eslint/eslint-plugin", + // "@typescript-eslint/parser", + "cz-conventional-changelog", + // "eslint-config-prettier", + // "eslint-plugin-jest", + // "eslint-plugin-prettier", + // "eslint", + // "jest", + // "prettier", + // "ts-jest", + // "typescript", + // "husky", + // "lint-staged", + "@inpyjamas/scripts", + ], + "typescript-express": ["@types/express", "@types/morgan", "nodemon"], + "typescript-jekyll-webpack": [ + "tslib", + "autoprefixer", + "cross-env", + "css-loader", + "cssnano", + "extract-loader", + "file-loader", + "node-sass", + "npm-run-all", + "postcss-cli", + "postcss-load-config", + "postcss-loader", + "sass-loader", + "ts-loader", + "webpack", + "webpack-cli", + "webpack-merge", + ], + basiljs: [], }; diff --git a/generators/common/.eslintignore b/generators/common/.eslintignore new file mode 100644 index 0000000..e69de29 diff --git a/generators/common/.eslintrc.js b/generators/common/.eslintrc.js new file mode 100644 index 0000000..cd92b4b --- /dev/null +++ b/generators/common/.eslintrc.js @@ -0,0 +1 @@ +module.exports = require("@inpyjamas/scripts/dist/config/eslint/typescript"); diff --git a/generators/common/husky.config.js b/generators/common/husky.config.js new file mode 100644 index 0000000..60c8fed --- /dev/null +++ b/generators/common/husky.config.js @@ -0,0 +1 @@ +module.exports = require("@inpyjamas/scripts/dist/config/husky"); diff --git a/generators/common/jest.config.js b/generators/common/jest.config.js new file mode 100644 index 0000000..ebdc88d --- /dev/null +++ b/generators/common/jest.config.js @@ -0,0 +1,13 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +/** + * You might need to configure your jest a little more + * Depending on what you are testing. + * frontend? use the jsdom environment + * Backend? node is the default for @inpyjamas scripts + */ +const utils = require("@inpyjamas/scripts/dist/utlities"); +const config = require("@inpyjamas/scripts/dist/config/jest/typescript"); +module.exports = utils.merge(config, { + // testEnvironment: "node", + // testEnvironment: "jsdom", +}); diff --git a/generators/common/lint-staged.config.js b/generators/common/lint-staged.config.js new file mode 100644 index 0000000..dfbefd5 --- /dev/null +++ b/generators/common/lint-staged.config.js @@ -0,0 +1 @@ +module.exports = require("@inpyjamas/scripts/dist/config/lint-staged"); diff --git a/generators/common/prettier.config.js b/generators/common/prettier.config.js new file mode 100644 index 0000000..59f04c4 --- /dev/null +++ b/generators/common/prettier.config.js @@ -0,0 +1 @@ +module.exports = require("@inpyjamas/scripts/dist/config/prettier"); diff --git a/generators/common/renovate.json b/generators/common/renovate.json new file mode 100644 index 0000000..78998d8 --- /dev/null +++ b/generators/common/renovate.json @@ -0,0 +1,3 @@ +{ + "extends": ["config:base", "github>inpyjamas/scripts"] +} diff --git a/generators/src/lib/dependencies.ts b/generators/src/lib/dependencies.ts index 8761096..9ad6454 100644 --- a/generators/src/lib/dependencies.ts +++ b/generators/src/lib/dependencies.ts @@ -2,5 +2,5 @@ import { Dependencies } from "./common/interfaces"; export const dependencies: Dependencies = { "typescript-express": ["cors", "dotenv", "express", "morgan"], "typescript-jekyll-webpack": ["bulma"], - basiljs: ["basiljs/basil.js#develop"] + basiljs: ["basiljs/basil.js#develop"], }; diff --git a/generators/src/lib/dev-dependencies.ts b/generators/src/lib/dev-dependencies.ts index 00501ea..8f4121f 100644 --- a/generators/src/lib/dev-dependencies.ts +++ b/generators/src/lib/dev-dependencies.ts @@ -3,19 +3,20 @@ export const devDependencies: Dependencies = { shared: [ "@types/jest", "@types/node", - "@typescript-eslint/eslint-plugin", - "@typescript-eslint/parser", + // "@typescript-eslint/eslint-plugin", + // "@typescript-eslint/parser", "cz-conventional-changelog", - "eslint-config-prettier", - "eslint-plugin-jest", - "eslint-plugin-prettier", - "eslint", - "jest", - "prettier", - "ts-jest", - "typescript", - "husky", - "lint-staged" + // "eslint-config-prettier", + // "eslint-plugin-jest", + // "eslint-plugin-prettier", + // "eslint", + // "jest", + // "prettier", + // "ts-jest", + // "typescript", + // "husky", + // "lint-staged", + "@inpyjamas/scripts", ], "typescript-express": ["@types/express", "@types/morgan", "nodemon"], "typescript-jekyll-webpack": [ @@ -35,7 +36,7 @@ export const devDependencies: Dependencies = { "ts-loader", "webpack", "webpack-cli", - "webpack-merge" + "webpack-merge", ], - basiljs: [] + basiljs: [], }; diff --git a/generators/templates/typescript-express/package.json b/generators/templates/typescript-express/package.json index f8a0c6e..767cd96 100644 --- a/generators/templates/typescript-express/package.json +++ b/generators/templates/typescript-express/package.json @@ -15,14 +15,6 @@ "license": "MIT", "devDependencies": {}, "dependencies": {}, - "jest": { - "preset": "ts-jest", - "testEnvironment": "jest-environment-node", - "testPathIgnorePatterns": [ - "node_modules/", - "/dist" - ] - }, "nodemonConfig": { "ignore": [ "**/*.test.ts", @@ -42,71 +34,6 @@ "NODE_DOCKER_ENV": "0" } }, - "prettier": { - "printWidth": 80 - }, - "renovate": { - "extends": [ - "config:base" - ], - "packageRules": [ - { - "updateTypes": [ - "minor", - "patch", - "pin", - "digest" - ], - "automerge": true - } - ] - }, - "eslintConfig": { - "ignorePatterns": [ - "node_modules", - "dist", - "coverage" - ], - "env": { - "jest/globals": true - }, - "root": true, - "parser": "@typescript-eslint/parser", - "plugins": [ - "@typescript-eslint", - "jest" - ], - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended", - "prettier/@typescript-eslint", - "plugin:jest/recommended" - ], - "rules": { - "@typescript-eslint/no-unused-vars": [ - "warn", - { - "args": "after-used", - "varsIgnorePattern": "^_", - "argsIgnorePattern": "^_" - } - ] - } - }, - "lint-staged": { - "**/*.+(js|jsx|ts|tsx)": [ - "eslint --fix" - ], - "**/*.+(js|jsx|json|yml|yaml|css|scss|ts|tsx|md)": [ - "prettier --write" - ] - }, - "husky": { - "hooks": { - "pre-commit": "npm t && npm run lint-staged" - } - }, "config": { "commitizen": { "path": "./node_modules/cz-conventional-changelog" diff --git a/generators/templates/typescript-jekyll-webpack/package.json b/generators/templates/typescript-jekyll-webpack/package.json index 0a308ab..7ccb255 100644 --- a/generators/templates/typescript-jekyll-webpack/package.json +++ b/generators/templates/typescript-jekyll-webpack/package.json @@ -22,82 +22,6 @@ "license": "", "devDependencies": {}, "dependencies": {}, - "lint-staged": { - "**/*.+(js|jsx|ts|tsx)": [ - "eslint --fix" - ], - "**/*.+(js|jsx|json|yml|yaml|css|scss|ts|tsx|md)": [ - "prettier --write" - ] - }, - "husky": { - "hooks": { - "pre-commit": "npm t && npm run lint-staged" - } - }, - "jest": { - "preset": "ts-jest", - "testEnvironment": "jest-environment-node", - "testPathIgnorePatterns": [ - "node_modules/", - "/assets/js" - ] - }, - "eslintConfig": { - "parser": "@typescript-eslint/parser", - "plugins": [ - "@typescript-eslint", - "jest" - ], - "root": true, - "env": { - "browser": true, - "es6": true, - "jest/globals": true, - "node": true - }, - "extends": [ - "eslint:recommended", - "plugin:@typescript-eslint/eslint-recommended", - "plugin:@typescript-eslint/recommended", - "prettier/@typescript-eslint", - "plugin:jest/recommended" - ], - "globals": { - "Atomics": "readonly", - "SharedArrayBuffer": "readonly" - }, - "parserOptions": { - "sourceType": "module", - "ecmaVersion": 2018 - }, - "rules": { - "@typescript-eslint/no-unused-vars": [ - "warn", - { - "args": "after-used", - "varsIgnorePattern": "^_", - "argsIgnorePattern": "^_" - } - ], - "indent": [ - "error", - 2 - ], - "linebreak-style": [ - "error", - "unix" - ], - "quotes": [ - "error", - "double" - ], - "semi": [ - "error", - "always" - ] - } - }, "browserslist": [ ">5%", "last 2 versions", diff --git a/generators/templates/typescript-jekyll-webpack/webpack/webpack.config.prod.js b/generators/templates/typescript-jekyll-webpack/webpack/webpack.config.prod.js index 2bb77b4..f388efd 100644 --- a/generators/templates/typescript-jekyll-webpack/webpack/webpack.config.prod.js +++ b/generators/templates/typescript-jekyll-webpack/webpack/webpack.config.prod.js @@ -10,11 +10,11 @@ module.exports = merge(common, { bail: true, output: { filename: "index.bundle.js", - chunkFilename: "[name].[chunkhash:8].chunk.js" + chunkFilename: "[name].[chunkhash:8].chunk.js", }, plugins: [ new Webpack.DefinePlugin({ - "process.env.NODE_ENV": JSON.stringify("production") - }) - ] + "process.env.NODE_ENV": JSON.stringify("production"), + }), + ], }); From 4e35a064b24d96e6fd31bf07e597f7967f9e0d35 Mon Sep 17 00:00:00 2001 From: fabianmoronzirfas Date: Tue, 9 Jun 2020 19:11:46 +0200 Subject: [PATCH 3/6] housekeeping --- .eslintignore | 3 ++- .prettierignore | 1 + generators/app/lib/dependencies.js | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 .prettierignore diff --git a/.eslintignore b/.eslintignore index 64e8662..62bfb11 100644 --- a/.eslintignore +++ b/.eslintignore @@ -1,4 +1,5 @@ node_modules dist coverage -generators/index.js \ No newline at end of file +generators/index.js +generators/app/ \ No newline at end of file diff --git a/.prettierignore b/.prettierignore new file mode 100644 index 0000000..9ec25b8 --- /dev/null +++ b/.prettierignore @@ -0,0 +1 @@ +generators/app/* \ No newline at end of file diff --git a/generators/app/lib/dependencies.js b/generators/app/lib/dependencies.js index bfceec7..717f5e5 100644 --- a/generators/app/lib/dependencies.js +++ b/generators/app/lib/dependencies.js @@ -4,5 +4,5 @@ exports.dependencies = void 0; exports.dependencies = { "typescript-express": ["cors", "dotenv", "express", "morgan"], "typescript-jekyll-webpack": ["bulma"], - basiljs: ["basiljs/basil.js#develop"] + basiljs: ["basiljs/basil.js#develop"], }; From 3cda8db4c9181ce0578f856daa5dce6dc3fac185 Mon Sep 17 00:00:00 2001 From: fabianmoronzirfas Date: Tue, 9 Jun 2020 19:13:04 +0200 Subject: [PATCH 4/6] remove build dir --- .gitignore | 1 + generators/app/index.js | 3 - generators/app/lib/InPyjamasGenerator.js | 105 ----------------- generators/app/lib/common/interfaces.js | 2 - generators/app/lib/common/types.js | 2 - generators/app/lib/dependencies.js | 8 -- generators/app/lib/dev-dependencies.js | 44 ------- generators/app/lib/in-pyjamas-generator.js | 128 --------------------- generators/app/lib/util.js | 7 -- 9 files changed, 1 insertion(+), 299 deletions(-) delete mode 100644 generators/app/index.js delete mode 100644 generators/app/lib/InPyjamasGenerator.js delete mode 100644 generators/app/lib/common/interfaces.js delete mode 100644 generators/app/lib/common/types.js delete mode 100644 generators/app/lib/dependencies.js delete mode 100644 generators/app/lib/dev-dependencies.js delete mode 100644 generators/app/lib/in-pyjamas-generator.js delete mode 100644 generators/app/lib/util.js diff --git a/.gitignore b/.gitignore index 5c7bb11..af41c60 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +generators/app/* # Logs logs *.log diff --git a/generators/app/index.js b/generators/app/index.js deleted file mode 100644 index bd5ff9b..0000000 --- a/generators/app/index.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -const in_pyjamas_generator_1 = require("./lib/in-pyjamas-generator"); -module.exports = in_pyjamas_generator_1.InPyjamasGenerator; diff --git a/generators/app/lib/InPyjamasGenerator.js b/generators/app/lib/InPyjamasGenerator.js deleted file mode 100644 index 0edd017..0000000 --- a/generators/app/lib/InPyjamasGenerator.js +++ /dev/null @@ -1,105 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const yeoman_generator_1 = __importDefault(require("yeoman-generator")); -const path_1 = __importDefault(require("path")); -const util_1 = require("./util"); -// type ProjectTypes = "typescript-express"; -const projectTypeChoices = ["typescript-express"]; -// let type: ProjectTypes = projectTypeChoices[0]; -class InPyjamasGenerator extends yeoman_generator_1.default { - constructor(args, options) { - super(args, options); - this.sourceRoot(path_1.default.resolve(__dirname, "../../templates")); - } - prompting() { - return __awaiter(this, void 0, void 0, function* () { - const questions = [ - { - type: "input", - name: "name", - message: "What is your projects name (no special characters please)?", - default: this.appname // Default to current folder name - }, - { - type: "list", - name: "type", - message: "Select your setup type", - choices: projectTypeChoices, - filter: util_1.toLowerCase - }, - { - type: "list", - name: "upgrade", - choices: [ - { name: "No", value: false }, - { name: "Yes", value: true } - ], - message: "Should I force upgrade all packages?", - default: 0 - } - ]; - this.answers = yield this.prompt(questions); - this.answers.name = this.answers.name.replace(/[^a-zA-Z]/g, ""); - this.answers.name = this.answers.name.replace(/ /g, "-"); - this.log(JSON.stringify(this.answers)); - }); - } - writing() { - if (this.answers === undefined) { - throw new Error("answers not defined"); - } - // let pgkTemplateName = ""; - // switch (this.answers.type as ProjectTypes) { - // case "typescript-express": { - // pgkTemplateName = `${this.answers.type}/package.json`; - // break; - // } - // default: { - // throw new Error("No default case defiend"); - // } - // } - /** - * Copy all the files from the commons directory - * - */ - this.fs.copy(`${path_1.default.resolve(__dirname, "../../common")}/**/*`, this.destinationPath(), { - globOptions: { dot: true } - }); - /** - * Copy all files from the selected templates directory - * and replace all the ejs template strings - * uses https://github.com/SBoudrias/mem-fs-editor under the hood - */ - this.fs.copyTpl(`${path_1.default.resolve(this.templatePath(), this.answers.type)}/**/*`, this.destinationPath(), - // this.templatePath(pgkTemplateName), - // this.destinationPath("package.json"), - { - name: this.answers.name - }); - } - install() { - this.installDependencies({ - npm: true, - bower: false - }); - } - end() { - if (this.answers && this.answers.upgrade === true) { - this.spawnCommand("npx", ["npm-check-updates", "-u"]); - this.spawnCommand("npm", ["i"]); - } - } -} -exports.InPyjamasGenerator = InPyjamasGenerator; diff --git a/generators/app/lib/common/interfaces.js b/generators/app/lib/common/interfaces.js deleted file mode 100644 index c8ad2e5..0000000 --- a/generators/app/lib/common/interfaces.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/generators/app/lib/common/types.js b/generators/app/lib/common/types.js deleted file mode 100644 index c8ad2e5..0000000 --- a/generators/app/lib/common/types.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/generators/app/lib/dependencies.js b/generators/app/lib/dependencies.js deleted file mode 100644 index 717f5e5..0000000 --- a/generators/app/lib/dependencies.js +++ /dev/null @@ -1,8 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.dependencies = void 0; -exports.dependencies = { - "typescript-express": ["cors", "dotenv", "express", "morgan"], - "typescript-jekyll-webpack": ["bulma"], - basiljs: ["basiljs/basil.js#develop"], -}; diff --git a/generators/app/lib/dev-dependencies.js b/generators/app/lib/dev-dependencies.js deleted file mode 100644 index a006502..0000000 --- a/generators/app/lib/dev-dependencies.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.devDependencies = void 0; -exports.devDependencies = { - shared: [ - "@types/jest", - "@types/node", - // "@typescript-eslint/eslint-plugin", - // "@typescript-eslint/parser", - "cz-conventional-changelog", - // "eslint-config-prettier", - // "eslint-plugin-jest", - // "eslint-plugin-prettier", - // "eslint", - // "jest", - // "prettier", - // "ts-jest", - // "typescript", - // "husky", - // "lint-staged", - "@inpyjamas/scripts", - ], - "typescript-express": ["@types/express", "@types/morgan", "nodemon"], - "typescript-jekyll-webpack": [ - "tslib", - "autoprefixer", - "cross-env", - "css-loader", - "cssnano", - "extract-loader", - "file-loader", - "node-sass", - "npm-run-all", - "postcss-cli", - "postcss-load-config", - "postcss-loader", - "sass-loader", - "ts-loader", - "webpack", - "webpack-cli", - "webpack-merge", - ], - basiljs: [], -}; diff --git a/generators/app/lib/in-pyjamas-generator.js b/generators/app/lib/in-pyjamas-generator.js deleted file mode 100644 index ad215c8..0000000 --- a/generators/app/lib/in-pyjamas-generator.js +++ /dev/null @@ -1,128 +0,0 @@ -"use strict"; -var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { - function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } - return new (P || (P = Promise))(function (resolve, reject) { - function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } - function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } - function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } - step((generator = generator.apply(thisArg, _arguments || [])).next()); - }); -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.InPyjamasGenerator = void 0; -const dev_dependencies_1 = require("./dev-dependencies"); -const dependencies_1 = require("./dependencies"); -const yeoman_generator_1 = __importDefault(require("yeoman-generator")); -const path_1 = __importDefault(require("path")); -const util_1 = require("./util"); -const projectTypeChoices = [ - "typescript-express", - "typescript-jekyll-webpack", - "basiljs" -]; -class InPyjamasGenerator extends yeoman_generator_1.default { - constructor(args, options) { - super(args, options); - this.answers = {}; - this.sourceRoot(path_1.default.resolve(__dirname, "../../templates")); - } - prompting() { - return __awaiter(this, void 0, void 0, function* () { - const questions = [ - { - type: "input", - name: "name", - message: "What is your projects name (no special characters please)?", - default: this.appname // Default to current folder name - }, - { - type: "list", - name: "type", - message: "Select your setup type", - choices: projectTypeChoices, - filter: util_1.toLowerCase - }, - { - type: "list", - name: "upgrade", - choices: [ - { name: "No", value: false }, - { name: "Yes", value: true } - ], - message: "Should I force upgrade all packages?", - default: 0 - } - ]; - this.answers = yield this.prompt(questions); - this.answers.name = this.answers.name.replace(/[^a-zA-Z]/g, ""); - this.answers.name = this.answers.name.replace(/ /g, "-"); - // this.log(JSON.stringify(this.answers)); - }); - } - writing() { - // let pgkTemplateName = ""; - // switch (this.answers.type as ProjectTypes) { - // case "typescript-express": { - // pgkTemplateName = `${this.answers.type}/package.json`; - // break; - // } - // default: { - // throw new Error("No default case defiend"); - // } - // } - /** - * Copy all the files from the commons directory - * - */ - this.fs.copy(`${path_1.default.resolve(__dirname, "../../common")}/**/*`, this.destinationPath(), { - globOptions: { dot: true } - }); - /** - * Copy all files from the selected templates directory - * and replace all the ejs template strings - * uses https://github.com/SBoudrias/mem-fs-editor under the hood - */ - this.fs.copyTpl(`${path_1.default.resolve(this.templatePath(), this.answers.type)}/**/*`, this.destinationPath(), { - name: this.answers.name - }); - } - install() { - switch (this.answers.type) { - case "typescript-express": - case "typescript-jekyll-webpack": { - this.npmInstall(dependencies_1.dependencies[this.answers.type], { - "save-exact": true - }); - this.npmInstall([...dev_dependencies_1.devDependencies[this.answers.type], ...dev_dependencies_1.devDependencies["shared"]], { - "save-exact": true, - "save-dev": true - }); - break; - } - case "basiljs": { - this.npmInstall(dependencies_1.dependencies[this.answers.type], { - "save-exact": true - }); - break; - } - } - // this.npmInstall(); - // this.installDependencies({ - // npm: true, - // bower: false - // }); - } - end() { - if (this.answers.upgrade === true) { - this.spawnCommand("npx", ["npm-check-updates", "-u"]); - this.spawnCommand("npm", ["i"]); - } - if (this.answers.type === "typescript-jekyll-webpack") { - this.log("Run `npm run dev` to start webpack and jekyll"); - } - } -} -exports.InPyjamasGenerator = InPyjamasGenerator; diff --git a/generators/app/lib/util.js b/generators/app/lib/util.js deleted file mode 100644 index a6d28b7..0000000 --- a/generators/app/lib/util.js +++ /dev/null @@ -1,7 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.toLowerCase = void 0; -function toLowerCase(val) { - return val.toLowerCase(); -} -exports.toLowerCase = toLowerCase; From 2e2caa4a33d22c6e4270af3351dba603ee9f43a8 Mon Sep 17 00:00:00 2001 From: fabianmoronzirfas Date: Tue, 9 Jun 2020 19:29:36 +0200 Subject: [PATCH 5/6] housekeeping conditional --- .github/workflows/tests.yml | 25 ++++--- README.md | 129 ++++++++++++++++++------------------ 2 files changed, 76 insertions(+), 78 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 070d2ce..c21f066 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -5,26 +5,25 @@ name: Node.js Test CI on: push: - branches: [ master ] + branches: [master] pull_request: jobs: build: - runs-on: ubuntu-latest - + if: "!contains(github.event.head_commit.message, 'ci skip') || !contains(github.event.head_commit.message, 'skip ci')" strategy: matrix: node-version: [10.x, 12.x] steps: - - uses: actions/checkout@v2 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 - with: - node-version: ${{ matrix.node-version }} - - run: npm ci - - run: npm run build --if-present - - run: npm run test:ci -- --no-color - env: - CI: true \ No newline at end of file + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm run build --if-present + - run: npm run test:ci -- --no-color + env: + CI: true diff --git a/README.md b/README.md index f72705f..bd9126b 100644 --- a/README.md +++ b/README.md @@ -1,65 +1,64 @@ -# @inpyjamas/generator-defaults - -[![npm (scoped)](https://img.shields.io/npm/v/@inpyjamas/generator-defaults)](https://www.npmjs.com/package/@inpyjamas/generator-defaults) [![Node.js Test CI](https://github.com/inpyjamas/generator-defaults/workflows/Node.js%20Test%20CI/badge.svg)](https://github.com/inpyjamas/generator-defaults/actions?query=workflow%3A%22Node.js+Test+CI%22) ![Build with love](https://img.shields.io/badge/build%20with-%E2%9D%A4%EF%B8%8F-success) - -## About - -my personal opinionated [Yeoman](https://yeoman.io/) generator for Typescript, Eslint, Prettier, Jest, Nodemon, Husky, Jekyll, Webpack… - -With force upgrade all packages build in. - -All configuration that can use cosmic config is located in `package.json`. - -Except for - -- [`.prettierignore`](https://github.com/prettier/prettier/issues/3460) -- Jekyll `_config.yml` and `Gemfile` - -## Installing - -```bash -npm install yo -g -``` - -```bash -npm install @inpyjamas/generator-defaults -g -``` - -## Usage - -```bash -yo @inpyjamas/defaults -# Will prompt for your projects name and what type of project you want -# currently typescript only -``` - -This will create (in the current working directory) the following setup(s) - -### Type `typescript-express` - -Creates a setup with: - - -- Typescript -- Jest -- Eslint -- Prettier -- Nodemon -- Husky -- Lint-Staged -- Express with Morgan, Cors and Dotenv -- CZ Conventional Change-log -- Renovate Bot - -### Type `typescript-jeykll-webpack` - -- Typescript -- Jekyll -- Webpack (for Ts and scss/postcss) -- Jest -- Eslint -- Prettier -- Husky -- Lint-Staged -- CZ Conventional Change-log -- Renovate Bot +# @inpyjamas/generator-defaults + +[![npm (scoped)](https://img.shields.io/npm/v/@inpyjamas/generator-defaults)](https://www.npmjs.com/package/@inpyjamas/generator-defaults) [![Node.js Test CI](https://github.com/inpyjamas/generator-defaults/workflows/Node.js%20Test%20CI/badge.svg)](https://github.com/inpyjamas/generator-defaults/actions?query=workflow%3A%22Node.js+Test+CI%22) ![Build with love](https://img.shields.io/badge/build%20with-%E2%9D%A4%EF%B8%8F-success) + +## About + +my personal opinionated [Yeoman](https://yeoman.io/) generator for Typescript, Eslint, Prettier, Jest, Nodemon, Husky, Jekyll, Webpack… + +With force upgrade all packages build in. + +Most configuration is handled using [@inpyjamas/scripts](https://github.com/inpyjamas/scripts). + +Except for + +- [`.prettierignore`](https://github.com/prettier/prettier/issues/3460) +- Jekyll `_config.yml` and `Gemfile` + +## Installing + +```bash +npm install yo -g +``` + +```bash +npm install @inpyjamas/generator-defaults -g +``` + +## Usage + +```bash +yo @inpyjamas/defaults +# Will prompt for your projects name and what type of project you want +# currently typescript only +``` + +This will create (in the current working directory) the following setup(s) + +### Type `typescript-express` + +Creates a setup with: + +- Typescript +- Jest +- Eslint +- Prettier +- Nodemon +- Husky +- Lint-Staged +- Express with Morgan, Cors and Dotenv +- CZ Conventional Change-log +- Renovate Bot + +### Type `typescript-jeykll-webpack` + +- Typescript +- Jekyll +- Webpack (for Ts and scss/postcss) +- Jest +- Eslint +- Prettier +- Husky +- Lint-Staged +- CZ Conventional Change-log +- Renovate Bot From 83726393b4024d47df5898af571f69eeeb7c94b8 Mon Sep 17 00:00:00 2001 From: fabianmoronzirfas Date: Tue, 9 Jun 2020 19:30:43 +0200 Subject: [PATCH 6/6] add actions to common --- generators/common/.github/workflows/tests.yml | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 generators/common/.github/workflows/tests.yml diff --git a/generators/common/.github/workflows/tests.yml b/generators/common/.github/workflows/tests.yml new file mode 100644 index 0000000..c21f066 --- /dev/null +++ b/generators/common/.github/workflows/tests.yml @@ -0,0 +1,29 @@ +# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions + +name: Node.js Test CI + +on: + push: + branches: [master] + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + if: "!contains(github.event.head_commit.message, 'ci skip') || !contains(github.event.head_commit.message, 'skip ci')" + strategy: + matrix: + node-version: [10.x, 12.x] + + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v1 + with: + node-version: ${{ matrix.node-version }} + - run: npm ci + - run: npm run build --if-present + - run: npm run test:ci -- --no-color + env: + CI: true