diff --git a/babel/eslint-parser.js b/babel/eslint-parser.js deleted file mode 100644 index 79a598ed..00000000 --- a/babel/eslint-parser.js +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Re-exported eslint parser for consumers, eg (.eslintrc): - * {"parser": "sanipack/babel/eslint-parser"} - */ -module.exports = require('@babel/eslint-parser') diff --git a/babel/index.js b/babel/index.js deleted file mode 100644 index 191782c5..00000000 --- a/babel/index.js +++ /dev/null @@ -1,5 +0,0 @@ -/** - * Consumer babel config, eg: - * {"extends": "sanipack/babel"} - */ -module.exports = require('../src/configs/babelrc') diff --git a/package-lock.json b/package-lock.json index b12e7128..5de396e8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,6 @@ "discover-path": "^1.0.0", "email-validator": "^2.0.4", "execa": "^5.1.1", - "find-babel-config": "^1.2.0", "get-it": "^7.0.2", "get-latest-version": "^4.0.0", "git-remote-origin-url": "^3.1.0", @@ -61,7 +60,7 @@ "eslint-plugin-react-hooks": "^4.6.0", "fs-extra": "^10.1.0", "husky": "^8.0.2", - "json5": "^2.2.1", + "json5": "^2.2.3", "lint-staged": "^13.0.3", "npm-run-all": "^4.1.5", "prettier": "^2.7.1", @@ -70,7 +69,7 @@ "rimraf": "^3.0.2", "sanity": "^3.0.0", "sinon": "^14.0.2", - "tap": "^16.3.1", + "tap": "^16.3.2", "ts-node": "^10.9.1", "typescript": "^4.9.4" }, @@ -9387,26 +9386,6 @@ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true }, - "node_modules/find-babel-config": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/find-babel-config/-/find-babel-config-1.2.0.tgz", - "integrity": "sha512-jB2CHJeqy6a820ssiqwrKMeyC6nNdmrcgkKWJWmpoxpE8RKciYJXCcXRq1h2AzCo5I5BJeN2tkGEO3hLTuePRA==", - "dependencies": { - "json5": "^0.5.1", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/find-babel-config/node_modules/json5": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", - "integrity": "sha512-4xrs1aW+6N5DalkqSVA8fxh458CXvR99WU8WLKmq4v8eWAL86Xo3BVqyd3SkA9wEVjCMqyvvRRkshAdOnBp5rw==", - "bin": { - "json5": "lib/cli.js" - } - }, "node_modules/find-cache-dir": { "version": "3.3.2", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", @@ -19705,9 +19684,9 @@ "dev": true }, "node_modules/tap": { - "version": "16.3.1", - "resolved": "https://registry.npmjs.org/tap/-/tap-16.3.1.tgz", - "integrity": "sha512-B4+R/fY7hXuwDQOIpnT8rbXYYKUxX1Mu9e1axeoYtm5loyZRa2eYIL0zz8NaOg6h/dd+J8t25okCVg1RLDM8Yw==", + "version": "16.3.2", + "resolved": "https://registry.npmjs.org/tap/-/tap-16.3.2.tgz", + "integrity": "sha512-4MWMObR8unbv5gAHHVW9F0MNk3opQMnLusSWvt4KBAnKmkwpBRKIfNF64fimQbcR4y9a7U9ISV7pCldlV3J8Pw==", "bundleDependencies": [ "ink", "treport", @@ -19718,18 +19697,18 @@ "dev": true, "dependencies": { "@isaacs/import-jsx": "^4.0.1", - "@types/react": "^17", + "@types/react": "^17.0.52", "chokidar": "^3.3.0", "findit": "^2.0.0", "foreground-child": "^2.0.0", "fs-exists-cached": "^1.0.0", - "glob": "^7.1.6", + "glob": "^7.2.3", "ink": "^3.2.0", "isexe": "^2.0.0", - "istanbul-lib-processinfo": "^2.0.2", - "jackspeak": "^1.4.1", + "istanbul-lib-processinfo": "^2.0.3", + "jackspeak": "^1.4.2", "libtap": "^1.4.0", - "minipass": "^3.1.1", + "minipass": "^3.3.4", "mkdirp": "^1.0.4", "nyc": "^15.1.0", "opener": "^1.5.1", @@ -19738,10 +19717,10 @@ "signal-exit": "^3.0.6", "source-map-support": "^0.5.16", "tap-mocha-reporter": "^5.0.3", - "tap-parser": "^11.0.1", - "tap-yaml": "^1.0.0", + "tap-parser": "^11.0.2", + "tap-yaml": "^1.0.2", "tcompare": "^5.0.7", - "treport": "^3.0.3", + "treport": "^3.0.4", "which": "^2.0.2" }, "bin": { @@ -19841,32 +19820,31 @@ } }, "node_modules/tap/node_modules/@ampproject/remapping": { - "version": "2.2.0", + "version": "2.1.2", "dev": true, "inBundle": true, "license": "Apache-2.0", "dependencies": { - "@jridgewell/gen-mapping": "^0.1.0", - "@jridgewell/trace-mapping": "^0.3.9" + "@jridgewell/trace-mapping": "^0.3.0" }, "engines": { "node": ">=6.0.0" } }, "node_modules/tap/node_modules/@babel/code-frame": { - "version": "7.18.6", + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/highlight": "^7.18.6" + "@babel/highlight": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/tap/node_modules/@babel/compat-data": { - "version": "7.20.1", + "version": "7.17.7", "dev": true, "inBundle": true, "license": "MIT", @@ -19875,25 +19853,25 @@ } }, "node_modules/tap/node_modules/@babel/core": { - "version": "7.20.2", + "version": "7.17.8", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { "@ampproject/remapping": "^2.1.0", - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.2", - "@babel/helper-compilation-targets": "^7.20.0", - "@babel/helper-module-transforms": "^7.20.2", - "@babel/helpers": "^7.20.1", - "@babel/parser": "^7.20.2", - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.1", - "@babel/types": "^7.20.2", + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.17.7", + "@babel/helper-compilation-targets": "^7.17.7", + "@babel/helper-module-transforms": "^7.17.7", + "@babel/helpers": "^7.17.8", + "@babel/parser": "^7.17.8", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.17.3", + "@babel/types": "^7.17.0", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", - "json5": "^2.2.1", + "json5": "^2.1.2", "semver": "^6.3.0" }, "engines": { @@ -19905,54 +19883,40 @@ } }, "node_modules/tap/node_modules/@babel/generator": { - "version": "7.20.4", + "version": "7.17.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.20.2", - "@jridgewell/gen-mapping": "^0.3.2", - "jsesc": "^2.5.1" + "@babel/types": "^7.17.0", + "jsesc": "^2.5.1", + "source-map": "^0.5.0" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/tap/node_modules/@babel/generator/node_modules/@jridgewell/gen-mapping": { - "version": "0.3.2", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "@jridgewell/set-array": "^1.0.1", - "@jridgewell/sourcemap-codec": "^1.4.10", - "@jridgewell/trace-mapping": "^0.3.9" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/tap/node_modules/@babel/helper-annotate-as-pure": { - "version": "7.18.6", + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/tap/node_modules/@babel/helper-compilation-targets": { - "version": "7.20.0", + "version": "7.17.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.20.0", - "@babel/helper-validator-option": "^7.18.6", - "browserslist": "^4.21.3", + "@babel/compat-data": "^7.17.7", + "@babel/helper-validator-option": "^7.16.7", + "browserslist": "^4.17.5", "semver": "^6.3.0" }, "engines": { @@ -19963,72 +19927,88 @@ } }, "node_modules/tap/node_modules/@babel/helper-environment-visitor": { - "version": "7.18.9", + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", + "dependencies": { + "@babel/types": "^7.16.7" + }, "engines": { "node": ">=6.9.0" } }, "node_modules/tap/node_modules/@babel/helper-function-name": { - "version": "7.19.0", + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/template": "^7.18.10", - "@babel/types": "^7.19.0" + "@babel/helper-get-function-arity": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/types": "^7.16.7" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/tap/node_modules/@babel/helper-get-function-arity": { + "version": "7.16.7", + "dev": true, + "inBundle": true, + "license": "MIT", + "dependencies": { + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/tap/node_modules/@babel/helper-hoist-variables": { - "version": "7.18.6", + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/tap/node_modules/@babel/helper-module-imports": { - "version": "7.18.6", + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/tap/node_modules/@babel/helper-module-transforms": { - "version": "7.20.2", + "version": "7.17.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-simple-access": "^7.20.2", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/helper-validator-identifier": "^7.19.1", - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.1", - "@babel/types": "^7.20.2" + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-simple-access": "^7.17.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/helper-validator-identifier": "^7.16.7", + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.17.3", + "@babel/types": "^7.17.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/tap/node_modules/@babel/helper-plugin-utils": { - "version": "7.20.2", + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", @@ -20037,40 +20017,31 @@ } }, "node_modules/tap/node_modules/@babel/helper-simple-access": { - "version": "7.20.2", + "version": "7.17.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.20.2" + "@babel/types": "^7.17.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/tap/node_modules/@babel/helper-split-export-declaration": { - "version": "7.18.6", + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/types": "^7.18.6" + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, - "node_modules/tap/node_modules/@babel/helper-string-parser": { - "version": "7.19.4", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=6.9.0" - } - }, "node_modules/tap/node_modules/@babel/helper-validator-identifier": { - "version": "7.19.1", + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", @@ -20079,7 +20050,7 @@ } }, "node_modules/tap/node_modules/@babel/helper-validator-option": { - "version": "7.18.6", + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", @@ -20088,26 +20059,26 @@ } }, "node_modules/tap/node_modules/@babel/helpers": { - "version": "7.20.1", + "version": "7.17.8", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/template": "^7.18.10", - "@babel/traverse": "^7.20.1", - "@babel/types": "^7.20.0" + "@babel/template": "^7.16.7", + "@babel/traverse": "^7.17.3", + "@babel/types": "^7.17.0" }, "engines": { "node": ">=6.9.0" } }, "node_modules/tap/node_modules/@babel/highlight": { - "version": "7.18.6", + "version": "7.16.10", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/helper-validator-identifier": "^7.18.6", + "@babel/helper-validator-identifier": "^7.16.7", "chalk": "^2.0.0", "js-tokens": "^4.0.0" }, @@ -20116,7 +20087,7 @@ } }, "node_modules/tap/node_modules/@babel/parser": { - "version": "7.20.3", + "version": "7.17.8", "dev": true, "inBundle": true, "license": "MIT", @@ -20128,16 +20099,16 @@ } }, "node_modules/tap/node_modules/@babel/plugin-proposal-object-rest-spread": { - "version": "7.20.2", + "version": "7.17.3", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/compat-data": "^7.20.1", - "@babel/helper-compilation-targets": "^7.20.0", - "@babel/helper-plugin-utils": "^7.20.2", + "@babel/compat-data": "^7.17.0", + "@babel/helper-compilation-targets": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.20.1" + "@babel/plugin-transform-parameters": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -20147,12 +20118,12 @@ } }, "node_modules/tap/node_modules/@babel/plugin-syntax-jsx": { - "version": "7.18.6", + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.18.6" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -20174,12 +20145,12 @@ } }, "node_modules/tap/node_modules/@babel/plugin-transform-destructuring": { - "version": "7.20.2", + "version": "7.17.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -20189,12 +20160,12 @@ } }, "node_modules/tap/node_modules/@babel/plugin-transform-parameters": { - "version": "7.20.3", + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/helper-plugin-utils": "^7.20.2" + "@babel/helper-plugin-utils": "^7.16.7" }, "engines": { "node": ">=6.9.0" @@ -20204,16 +20175,16 @@ } }, "node_modules/tap/node_modules/@babel/plugin-transform-react-jsx": { - "version": "7.19.0", + "version": "7.17.3", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/helper-annotate-as-pure": "^7.18.6", - "@babel/helper-module-imports": "^7.18.6", - "@babel/helper-plugin-utils": "^7.19.0", - "@babel/plugin-syntax-jsx": "^7.18.6", - "@babel/types": "^7.19.0" + "@babel/helper-annotate-as-pure": "^7.16.7", + "@babel/helper-module-imports": "^7.16.7", + "@babel/helper-plugin-utils": "^7.16.7", + "@babel/plugin-syntax-jsx": "^7.16.7", + "@babel/types": "^7.17.0" }, "engines": { "node": ">=6.9.0" @@ -20223,33 +20194,33 @@ } }, "node_modules/tap/node_modules/@babel/template": { - "version": "7.18.10", + "version": "7.16.7", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/parser": "^7.18.10", - "@babel/types": "^7.18.10" + "@babel/code-frame": "^7.16.7", + "@babel/parser": "^7.16.7", + "@babel/types": "^7.16.7" }, "engines": { "node": ">=6.9.0" } }, "node_modules/tap/node_modules/@babel/traverse": { - "version": "7.20.1", + "version": "7.17.3", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/code-frame": "^7.18.6", - "@babel/generator": "^7.20.1", - "@babel/helper-environment-visitor": "^7.18.9", - "@babel/helper-function-name": "^7.19.0", - "@babel/helper-hoist-variables": "^7.18.6", - "@babel/helper-split-export-declaration": "^7.18.6", - "@babel/parser": "^7.20.1", - "@babel/types": "^7.20.0", + "@babel/code-frame": "^7.16.7", + "@babel/generator": "^7.17.3", + "@babel/helper-environment-visitor": "^7.16.7", + "@babel/helper-function-name": "^7.16.7", + "@babel/helper-hoist-variables": "^7.16.7", + "@babel/helper-split-export-declaration": "^7.16.7", + "@babel/parser": "^7.17.3", + "@babel/types": "^7.17.0", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -20258,13 +20229,12 @@ } }, "node_modules/tap/node_modules/@babel/types": { - "version": "7.20.2", + "version": "7.17.0", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@babel/helper-string-parser": "^7.19.4", - "@babel/helper-validator-identifier": "^7.19.1", + "@babel/helper-validator-identifier": "^7.16.7", "to-fast-properties": "^2.0.0" }, "engines": { @@ -20291,30 +20261,8 @@ "node": ">=10" } }, - "node_modules/tap/node_modules/@jridgewell/gen-mapping": { - "version": "0.1.1", - "dev": true, - "inBundle": true, - "license": "MIT", - "dependencies": { - "@jridgewell/set-array": "^1.0.0", - "@jridgewell/sourcemap-codec": "^1.4.10" - }, - "engines": { - "node": ">=6.0.0" - } - }, "node_modules/tap/node_modules/@jridgewell/resolve-uri": { - "version": "3.1.0", - "dev": true, - "inBundle": true, - "license": "MIT", - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/tap/node_modules/@jridgewell/set-array": { - "version": "1.1.2", + "version": "3.0.5", "dev": true, "inBundle": true, "license": "MIT", @@ -20323,23 +20271,23 @@ } }, "node_modules/tap/node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.14", + "version": "1.4.11", "dev": true, "inBundle": true, "license": "MIT" }, "node_modules/tap/node_modules/@jridgewell/trace-mapping": { - "version": "0.3.17", + "version": "0.3.4", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@jridgewell/resolve-uri": "3.1.0", - "@jridgewell/sourcemap-codec": "1.4.14" + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" } }, "node_modules/tap/node_modules/@types/prop-types": { - "version": "15.7.5", + "version": "15.7.4", "dev": true, "inBundle": true, "license": "MIT" @@ -20459,7 +20407,7 @@ } }, "node_modules/tap/node_modules/browserslist": { - "version": "4.21.4", + "version": "4.20.2", "dev": true, "funding": [ { @@ -20474,10 +20422,11 @@ "inBundle": true, "license": "MIT", "dependencies": { - "caniuse-lite": "^1.0.30001400", - "electron-to-chromium": "^1.4.251", - "node-releases": "^2.0.6", - "update-browserslist-db": "^1.0.9" + "caniuse-lite": "^1.0.30001317", + "electron-to-chromium": "^1.4.84", + "escalade": "^3.1.1", + "node-releases": "^2.0.2", + "picocolors": "^1.0.0" }, "bin": { "browserslist": "cli.js" @@ -20520,7 +20469,7 @@ } }, "node_modules/tap/node_modules/caniuse-lite": { - "version": "1.0.30001431", + "version": "1.0.30001319", "dev": true, "funding": [ { @@ -20648,10 +20597,13 @@ "license": "MIT" }, "node_modules/tap/node_modules/convert-source-map": { - "version": "1.9.0", + "version": "1.8.0", "dev": true, "inBundle": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.1" + } }, "node_modules/tap/node_modules/convert-to-spaces": { "version": "1.0.2", @@ -20663,7 +20615,7 @@ } }, "node_modules/tap/node_modules/csstype": { - "version": "3.1.1", + "version": "3.0.11", "dev": true, "inBundle": true, "license": "MIT" @@ -20686,7 +20638,7 @@ } }, "node_modules/tap/node_modules/electron-to-chromium": { - "version": "1.4.284", + "version": "1.4.89", "dev": true, "inBundle": true, "license": "ISC" @@ -21091,7 +21043,7 @@ "license": "MIT" }, "node_modules/tap/node_modules/node-releases": { - "version": "2.0.6", + "version": "2.0.2", "dev": true, "inBundle": true, "license": "MIT" @@ -21233,7 +21185,7 @@ } }, "node_modules/tap/node_modules/react-devtools-core": { - "version": "4.26.1", + "version": "4.24.1", "dev": true, "inBundle": true, "license": "MIT", @@ -21305,6 +21257,12 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/tap/node_modules/safe-buffer": { + "version": "5.1.2", + "dev": true, + "inBundle": true, + "license": "MIT" + }, "node_modules/tap/node_modules/scheduler": { "version": "0.20.2", "dev": true, @@ -21325,13 +21283,10 @@ } }, "node_modules/tap/node_modules/shell-quote": { - "version": "1.7.4", + "version": "1.7.3", "dev": true, "inBundle": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/ljharb" - } + "license": "MIT" }, "node_modules/tap/node_modules/signal-exit": { "version": "3.0.7", @@ -21386,8 +21341,17 @@ "inBundle": true, "license": "MIT" }, + "node_modules/tap/node_modules/source-map": { + "version": "0.5.7", + "dev": true, + "inBundle": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/tap/node_modules/stack-utils": { - "version": "2.0.6", + "version": "2.0.5", "dev": true, "inBundle": true, "license": "MIT", @@ -21579,38 +21543,34 @@ } }, "node_modules/tap/node_modules/unicode-length": { - "version": "2.1.0", + "version": "2.0.2", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "punycode": "^2.0.0" + "punycode": "^2.0.0", + "strip-ansi": "^3.0.1" } }, - "node_modules/tap/node_modules/update-browserslist-db": { - "version": "1.0.10", + "node_modules/tap/node_modules/unicode-length/node_modules/ansi-regex": { + "version": "2.1.1", + "dev": true, + "inBundle": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tap/node_modules/unicode-length/node_modules/strip-ansi": { + "version": "3.0.1", "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/browserslist" - }, - { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/browserslist" - } - ], "inBundle": true, "license": "MIT", "dependencies": { - "escalade": "^3.1.1", - "picocolors": "^1.0.0" + "ansi-regex": "^2.0.0" }, - "bin": { - "browserslist-lint": "cli.js" - }, - "peerDependencies": { - "browserslist": ">= 4.21.0" + "engines": { + "node": ">=0.10.0" } }, "node_modules/tap/node_modules/widest-line": { @@ -21679,7 +21639,7 @@ "license": "ISC" }, "node_modules/tap/node_modules/ws": { - "version": "7.5.9", + "version": "7.5.7", "dev": true, "inBundle": true, "license": "MIT", diff --git a/package.json b/package.json index 82612e34..0ad897cd 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,6 @@ "sanity", "plugin", "development", - "babel", "typescript", "bootstrap" ], @@ -76,7 +75,6 @@ "discover-path": "^1.0.0", "email-validator": "^2.0.4", "execa": "^5.1.1", - "find-babel-config": "^1.2.0", "get-it": "^7.0.2", "get-latest-version": "^4.0.0", "git-remote-origin-url": "^3.1.0", @@ -118,7 +116,7 @@ "eslint-plugin-react-hooks": "^4.6.0", "fs-extra": "^10.1.0", "husky": "^8.0.2", - "json5": "^2.2.1", + "json5": "^2.2.3", "lint-staged": "^13.0.3", "npm-run-all": "^4.1.5", "prettier": "^2.7.1", @@ -127,7 +125,7 @@ "rimraf": "^3.0.2", "sanity": "^3.0.0", "sinon": "^14.0.2", - "tap": "^16.3.1", + "tap": "^16.3.2", "ts-node": "^10.9.1", "typescript": "^4.9.4" }, diff --git a/src/actions/verify/validations.ts b/src/actions/verify/validations.ts index fb704ecb..8d7dfe8c 100644 --- a/src/actions/verify/validations.ts +++ b/src/actions/verify/validations.ts @@ -1,8 +1,6 @@ import outdent from 'outdent' // @ts-expect-error missing types import validateNpmPackageName from 'validate-npm-package-name' -// @ts-expect-error missing types -import findBabelConfig from 'find-babel-config' import {incompatiblePluginPackage, urls} from '../../constants' import {deprecatedDevDeps, mergedPackages} from '../../configs/banned-packages' import path from 'path' @@ -21,6 +19,10 @@ export const expectedScripts = { const expectedModulesFields = ['source', 'exports', 'main', 'module', 'files'] +function filesWithSuffixes(fileBases: string[], suffixes: string[]): string[] { + return fileBases.flatMap((file) => suffixes.map((suffix) => `${file}.${suffix}`)) +} + export function validateNodeEngine(packageJson: PackageJson) { const nodeVersionRange = '>=14' if (!packageJson.engines?.node?.startsWith(nodeVersionRange)) { @@ -241,15 +243,27 @@ export function validateDeprecatedDependencies(packageJson: PackageJson): string } export async function validateBabelConfig({basePath}: {basePath: string}) { - const babelConfig: {file?: string} = await findBabelConfig(basePath) + const suffixes = ['json', 'js', 'cjs', 'mjs'] + const babelFileNames = ['.babelrc', 'babel.config'] + const filenames = ['.babelrc', ...filesWithSuffixes(babelFileNames, suffixes)] - if (babelConfig.file) { + const babelFiles: string[] = [] + for (const filename of filenames) { + const filepath = path.normalize(path.join(basePath, filename)) + if (await fileExists(filepath)) { + babelFiles.push(filename) + } + } + + if (babelFiles.length) { return [ outdent` - Found babel-config file: ${babelConfig.file}. When using default @sanity/plugin-kit build command, + Found babel-config file: [${babelFiles.join( + ', ' + )}]. When using default @sanity/plugin-kit build command, this is probably not needed. - Delete the ${babelConfig.file} file, or disable this check. + Delete the file, or disable this check. `.trimStart(), ] } @@ -258,10 +272,8 @@ export async function validateBabelConfig({basePath}: {basePath: string}) { export async function validateStudioConfig({basePath}: {basePath: string}): Promise { const suffixes = ['ts', 'js', 'tsx', 'jsx'] - const withSuffix = (fileBases: string[]): string[] => - fileBases.flatMap((file) => suffixes.map((suffix) => `${file}.${suffix}`)) - const filenames = withSuffix(['sanity.config', 'sanity.cli']) + const filenames = filesWithSuffixes(['sanity.config', 'sanity.cli'], suffixes) const files: Record = {} @@ -273,7 +285,7 @@ export async function validateStudioConfig({basePath}: {basePath: string}): Prom const sanityJson = await readJson5File({basePath, filename: 'sanity.json'}) const hasConfigFile = (fileBase: string) => - withSuffix([fileBase]).some((filename) => files[filename]) + filesWithSuffixes([fileBase], suffixes).some((filename) => files[filename]) const hasCliConfig = hasConfigFile('sanity.cli') const hasStudioConfig = hasConfigFile('sanity.config')