From eba0b1c2dc83ead796f9edc15d59df07400d8e3e Mon Sep 17 00:00:00 2001 From: Pavel Klibani Date: Mon, 19 Feb 2024 10:25:14 +0100 Subject: [PATCH] Feat(codemod): Introduce codemod package --- .eslintrc.js | 1 + packages/codemod/.eslintignore | 18 ++ packages/codemod/.eslintrc.cjs | 46 +++++ packages/codemod/.gitignore | 11 ++ packages/codemod/CHANGELOG.md | 0 packages/codemod/LICENSE.md | 21 +++ packages/codemod/README.md | 5 + packages/codemod/config/jest.config.js | 45 +++++ packages/codemod/config/tsconfig.eslint.json | 4 + packages/codemod/config/tsconfig.prod.json | 7 + packages/codemod/config/tsup.config.ts | 9 + packages/codemod/package.json | 58 ++++++ packages/codemod/src/bin/spirit-codemod.js | 1 + packages/codemod/src/index.ts | 0 .../v2/react/transformAttributeExample.ts | 50 ++++++ packages/codemod/tsconfig.json | 32 ++++ yarn.lock | 170 +++++++++++++++--- 17 files changed, 458 insertions(+), 20 deletions(-) create mode 100644 packages/codemod/.eslintignore create mode 100644 packages/codemod/.eslintrc.cjs create mode 100644 packages/codemod/.gitignore create mode 100644 packages/codemod/CHANGELOG.md create mode 100644 packages/codemod/LICENSE.md create mode 100644 packages/codemod/README.md create mode 100644 packages/codemod/config/jest.config.js create mode 100644 packages/codemod/config/tsconfig.eslint.json create mode 100644 packages/codemod/config/tsconfig.prod.json create mode 100644 packages/codemod/config/tsup.config.ts create mode 100644 packages/codemod/package.json create mode 100644 packages/codemod/src/bin/spirit-codemod.js create mode 100644 packages/codemod/src/index.ts create mode 100644 packages/codemod/src/transforms/v2/react/transformAttributeExample.ts create mode 100644 packages/codemod/tsconfig.json diff --git a/.eslintrc.js b/.eslintrc.js index efbb4511c7..f1b0214233 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -20,6 +20,7 @@ module.exports = { 'packages/web-react', 'packages/web', 'packages/form-validations', + 'packages/codemod', 'exporters/scss', 'exporters/js', ], diff --git a/packages/codemod/.eslintignore b/packages/codemod/.eslintignore new file mode 100644 index 0000000000..cc36ce8bf9 --- /dev/null +++ b/packages/codemod/.eslintignore @@ -0,0 +1,18 @@ +# .eslintignore + +node_modules + +# NOTE: +# The following directives are only relevant when linting the whole +# project directory, ie. running `eslint .` ⚠️ + +# If you compile JavaScript into some output folder, exclude it here +dist +build + +# Highly recommended to re-include JavaScript dotfiles to lint them +# (This will cause .eslintrc.js to be linted by ESLint 🤘) +!.*.js + +# Some tools use this pattern for their configuration files. Lint them! +!*.config.js diff --git a/packages/codemod/.eslintrc.cjs b/packages/codemod/.eslintrc.cjs new file mode 100644 index 0000000000..ad264426bb --- /dev/null +++ b/packages/codemod/.eslintrc.cjs @@ -0,0 +1,46 @@ +module.exports = { + extends: [ + '../../.eslintrc', + 'plugin:@typescript-eslint/recommended', + 'prettier', + 'plugin:prettier/recommended', + '@lmc-eu/eslint-config-jest', + ], + + parser: '@typescript-eslint/parser', // the TypeScript parser we installed earlier + + parserOptions: { + ecmaVersion: 'latest', + project: './config/tsconfig.eslint.json', + }, + + settings: { + 'import/resolver': { + node: { + extensions: ['.js', '.ts'], + }, + }, + }, + + plugins: ['promise', '@typescript-eslint', 'prettier'], + rules: { + // disable for `scripts` and `config` + '@typescript-eslint/no-var-requires': 'off', + // allow ++ in for loops + 'no-plusplus': ['error', { allowForLoopAfterthoughts: true }], + // disabled due to typescript + 'no-shadow': 'off', + '@typescript-eslint/no-shadow': ['error', { allow: ['resolve', 'reject', 'done', 'next', 'error'] }], + // disabled due to typescript + 'no-use-before-define': 'off', + '@typescript-eslint/no-use-before-define': 'warn', + // We are using typescript, disable jsdoc rules + 'jsdoc/require-jsdoc': 'off', + 'jsdoc/require-returns': 'off', + 'jsdoc/require-param-type': 'off', + // allow reassign in properties + 'no-param-reassign': ['warn', { props: false }], + // support monorepos + 'import/no-extraneous-dependencies': ['error', { packageDir: ['./', '../../'] }], + }, +}; diff --git a/packages/codemod/.gitignore b/packages/codemod/.gitignore new file mode 100644 index 0000000000..1492cd3aa6 --- /dev/null +++ b/packages/codemod/.gitignore @@ -0,0 +1,11 @@ +# Dependency directory +node_modules + +# Caches +.cache + +# Log files +*.log + +# Code coverage +.coverage diff --git a/packages/codemod/CHANGELOG.md b/packages/codemod/CHANGELOG.md new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/codemod/LICENSE.md b/packages/codemod/LICENSE.md new file mode 100644 index 0000000000..61ac703bd3 --- /dev/null +++ b/packages/codemod/LICENSE.md @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 LMC s.r.o. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/packages/codemod/README.md b/packages/codemod/README.md new file mode 100644 index 0000000000..d55c82e9be --- /dev/null +++ b/packages/codemod/README.md @@ -0,0 +1,5 @@ +# @lmc-eu/spirit-codemod + +## Install + +## Usage diff --git a/packages/codemod/config/jest.config.js b/packages/codemod/config/jest.config.js new file mode 100644 index 0000000000..fa007dbbf0 --- /dev/null +++ b/packages/codemod/config/jest.config.js @@ -0,0 +1,45 @@ +const config = { + // The root directory that Jest should scan for tests and modules within. + // https://jestjs.io/docs/configuration#rootdir-string + rootDir: '../', + + // This option tells Jest that all imported modules in your tests should be mocked automatically. + // https://jestjs.io/docs/configuration#automock-boolean + automock: false, + + // Indicates whether each individual test should be reported during the run. + // https://jestjs.io/docs/configuration#verbose-boolean + verbose: false, + + // A map from regular expressions to paths to transformers + // https://jestjs.io/docs/configuration#transform-objectstring-pathtotransformer--pathtotransformer-object + transform: { + '^.+\\.(t|j)s?$': ['/../../node_modules/@swc/jest'], + }, + + // An array of regexp pattern strings that are matched against all test paths before executing the test + // https://jestjs.io/docs/configuration#testpathignorepatterns-arraystring + testPathIgnorePatterns: ['/dist/', '/node_modules/', '.*__tests__/.*DataProvider.ts'], + + // The directory where Jest should output its coverage files. + // https://jestjs.io/docs/configuration#coveragedirectory-string + coverageDirectory: './.coverage', + + // An array of glob patterns indicating a set of files for which coverage information should be collected. + // https://jestjs.io/docs/configuration#collectcoveragefrom-array + collectCoverageFrom: ['/src/**/*.{js,ts}', '!/src/**/*.d.ts'], + + // An array of regexp pattern strings that are matched against all file paths before executing the test. + // https://jestjs.io/docs/configuration#coveragepathignorepatterns-arraystring + coveragePathIgnorePatterns: ['__fixtures__', 'bin'], + + // A list of reporter names that Jest uses when writing coverage reports. Any istanbul reporter can be used. + // https://jestjs.io/docs/configuration#coveragereporters-arraystring--string-options + coverageReporters: ['text', 'text-summary', ['lcov', { projectRoot: '../../' }]], + + // An array of regexp pattern strings that are matched against all source file paths before transformation. + // https://jestjs.io/docs/configuration#transformignorepatterns-arraystring + transformIgnorePatterns: ['/../../node_modules/zx'], +}; + +export default config; diff --git a/packages/codemod/config/tsconfig.eslint.json b/packages/codemod/config/tsconfig.eslint.json new file mode 100644 index 0000000000..e290cf579b --- /dev/null +++ b/packages/codemod/config/tsconfig.eslint.json @@ -0,0 +1,4 @@ +{ + "extends": "../tsconfig.json", + "include": ["../", "../.eslintrc.cjs"] +} diff --git a/packages/codemod/config/tsconfig.prod.json b/packages/codemod/config/tsconfig.prod.json new file mode 100644 index 0000000000..ffbbbe8b52 --- /dev/null +++ b/packages/codemod/config/tsconfig.prod.json @@ -0,0 +1,7 @@ +{ + "extends": "../tsconfig.json", + "compilerOptions": { + "noEmit": false + }, + "exclude": ["../docs/**/*", "../src/**/__tests__/**/*"] +} diff --git a/packages/codemod/config/tsup.config.ts b/packages/codemod/config/tsup.config.ts new file mode 100644 index 0000000000..44ef9792b9 --- /dev/null +++ b/packages/codemod/config/tsup.config.ts @@ -0,0 +1,9 @@ +import { defineConfig } from 'tsup'; + +export default defineConfig({ + entry: ['src/index.ts'], + format: ['esm', 'cjs'], + dts: true, + splitting: true, + clean: true, +}); diff --git a/packages/codemod/package.json b/packages/codemod/package.json new file mode 100644 index 0000000000..a8521434de --- /dev/null +++ b/packages/codemod/package.json @@ -0,0 +1,58 @@ +{ + "name": "@lmc-eu/spirit-codemod", + "version": "0.1.0", + "description": "Codemod scripts for Spirit Design System packages", + "license": "MIT", + "keywords": [ + "spirit", + "codemod", + "design-system" + ], + "repository": { + "type": "git", + "url": "https://github.com/lmc-eu/spirit-design-system.git", + "directory": "packages/codemod" + }, + "publishConfig": { + "access": "public", + "directory": "dist" + }, + "main": "./index.cjs", + "module": "./index.js", + "types": "./index.d.ts", + "bin": "./bin/spirit-codemod.js", + "type": "module", + "exports": { + ".": { + "import": "./index.js", + "require": "./index.cjs" + }, + "./package.json": "./package.json" + }, + "scripts": { + "prebuild": "shx rm -rf dist && shx mkdir -p dist", + "build": "tsup --config ./config/tsup.config.ts", + "postbuild": "shx cp -r package.json README.md src/bin dist/", + "start": "tsup src/index.ts --watch", + "types": "tsc", + "lint": "eslint ./", + "lint:fix": "yarn lint --fix", + "test": "npm-run-all --serial lint test:unit:coverage types", + "test:unit": "jest --config ./config/jest.config.js", + "test:unit:watch": "yarn test:unit --watchAll", + "test:unit:coverage": "yarn test:unit --coverage" + }, + "devDependencies": { + "@lmc-eu/eslint-config-jest": "3.0.2", + "@types/jest": "29.5.11", + "@types/node": "20.10.7", + "@typescript-eslint/eslint-plugin": "6.18.0", + "@typescript-eslint/parser": "6.18.0", + "jest": "29.7.0", + "shx": "0.3.4", + "tsup": "7.2.0" + }, + "dependencies": { + "jscodeshift": "^0.15.1" + } +} diff --git a/packages/codemod/src/bin/spirit-codemod.js b/packages/codemod/src/bin/spirit-codemod.js new file mode 100644 index 0000000000..1a1b4c4516 --- /dev/null +++ b/packages/codemod/src/bin/spirit-codemod.js @@ -0,0 +1 @@ +console.log('spirit-codemod'); diff --git a/packages/codemod/src/index.ts b/packages/codemod/src/index.ts new file mode 100644 index 0000000000..e69de29bb2 diff --git a/packages/codemod/src/transforms/v2/react/transformAttributeExample.ts b/packages/codemod/src/transforms/v2/react/transformAttributeExample.ts new file mode 100644 index 0000000000..6a812a9876 --- /dev/null +++ b/packages/codemod/src/transforms/v2/react/transformAttributeExample.ts @@ -0,0 +1,50 @@ +const transform = (fileInfo, api) => { + const j = api.jscodeshift; + const root = j(fileInfo.source); + + // Find import statements for the specific module and Button specifier + const importStatements = root.find(j.ImportDeclaration, { + source: { + // value: '@lmc-eu/spirit-web-react', + value: '../../src/components/Button', // local import (testing file) + }, + }); + + // Check if the module is imported + if (importStatements.length > 0) { + const buttonSpecifier = importStatements.find(j.ImportSpecifier, { + imported: { + type: 'Identifier', + name: 'Button', + }, + }); + + // Check if Button specifier is present + if (buttonSpecifier.length > 0) { + // Find Button components in the module + const buttonComponents = root.find(j.JSXOpeningElement, { + name: { + type: 'JSXIdentifier', + name: 'Button', + }, + }); + + // Rename 'buttonLabel' attribute to 'buttonText' + buttonComponents + .find(j.JSXAttribute, { + name: { + type: 'JSXIdentifier', + name: 'buttonLabel', + }, + }) + .forEach((attributePath) => { + // Change attribute name to 'buttonText' + attributePath.node.name.name = 'buttonText'; + }); + } + } + + return root.toSource(); +}; + +export default transform; diff --git a/packages/codemod/tsconfig.json b/packages/codemod/tsconfig.json new file mode 100644 index 0000000000..7fddbedf05 --- /dev/null +++ b/packages/codemod/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compileOnSave": true, + "compilerOptions": { + "moduleResolution": "node", + "baseUrl": ".", + "sourceMap": true, + "declaration": true, + "noEmit": true, + "removeComments": true, + "noEmitOnError": true, + "forceConsistentCasingInFileNames": true, + "strictNullChecks": true, + "strictPropertyInitialization": true, + "strictFunctionTypes": true, + "resolveJsonModule": true, + "allowUnreachableCode": false, + "allowSyntheticDefaultImports": true, + "noImplicitThis": true, + "alwaysStrict": true, + "noImplicitReturns": true, + "noUnusedParameters": false, + "noUnusedLocals": true, + "noImplicitAny": true, + "esModuleInterop": true, + "skipLibCheck": true, + "typeRoots": ["../../node_modules/@types"], + "types": ["node", "jest"], + "module": "es2020" + }, + "include": ["./", "./.eslintrc.js"], + "exclude": ["./node_modules"] +} diff --git a/yarn.lock b/yarn.lock index 9ddd3f06f9..544160c5fa 100644 --- a/yarn.lock +++ b/yarn.lock @@ -193,6 +193,27 @@ json5 "^2.2.2" semver "^6.3.1" +"@babel/core@^7.23.0": + version "7.23.9" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.23.9.tgz#b028820718000f267870822fec434820e9b1e4d1" + integrity sha512-5q0175NOjddqpvvzU+kDiSOAk4PfdO6FvwCWoQ6RO7rTzEe8vlo+4HVfcnAREhD4npMs0e9uZypjTwzZPCf/cw== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.23.5" + "@babel/generator" "^7.23.6" + "@babel/helper-compilation-targets" "^7.23.6" + "@babel/helper-module-transforms" "^7.23.3" + "@babel/helpers" "^7.23.9" + "@babel/parser" "^7.23.9" + "@babel/template" "^7.23.9" + "@babel/traverse" "^7.23.9" + "@babel/types" "^7.23.9" + convert-source-map "^2.0.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.3" + semver "^6.3.1" + "@babel/core@^7.23.5": version "7.23.6" resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.23.6.tgz#8be77cd77c55baadcc1eae1c33df90ab6d2151d4" @@ -919,6 +940,15 @@ "@babel/traverse" "^7.23.7" "@babel/types" "^7.23.6" +"@babel/helpers@^7.23.9": + version "7.23.9" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.23.9.tgz#c3e20bbe7f7a7e10cb9b178384b4affdf5995c7d" + integrity sha512-87ICKgU5t5SzOT7sBMfCOZQ2rHjRU+Pcb9BoILMYz600W6DkVRLFBPwQ18gwUVvggqXivaUakpnxWQGbpywbBQ== + dependencies: + "@babel/template" "^7.23.9" + "@babel/traverse" "^7.23.9" + "@babel/types" "^7.23.9" + "@babel/highlight@^7.16.7": version "7.16.10" resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.16.10.tgz#744f2eb81579d6eea753c227b0f570ad785aba88" @@ -1023,6 +1053,11 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.6.tgz#ba1c9e512bda72a47e285ae42aff9d2a635a9e3b" integrity sha512-Z2uID7YJ7oNvAI20O9X0bblw7Qqs8Q2hFy0R9tAfnfLkp5MW0UH9eUvnDSnFwKZ0AvgS1ucqR4KzvVHgnke1VQ== +"@babel/parser@^7.23.9": + version "7.23.9" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.23.9.tgz#7b903b6149b0f8fa7ad564af646c4c38a77fc44b" + integrity sha512-9tcKgqKbs3xGJ+NtKF2ndOBBLVwPjl1SHxPQkd36r3Dlirw3xWUeGaTbqr7uGZcTaxkVNwc+03SVP7aCdWrTlA== + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.22.5.tgz#87245a21cd69a73b0b81bcda98d443d6df08f05e" @@ -1142,6 +1177,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" +"@babel/plugin-syntax-flow@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-flow/-/plugin-syntax-flow-7.23.3.tgz#084564e0f3cc21ea6c70c44cff984a1c0509729a" + integrity sha512-YZiAIpkJAwQXBJLIQbRFayR5c+gJ35Vcz3bg954k7cd73zqjvhacJuL9RbrzPz8qPmZdgqP6EUKwy0PCNhaaPA== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-import-assertions@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.22.5.tgz#07d252e2aa0bc6125567f742cd58619cb14dce98" @@ -1550,6 +1592,14 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-flow" "^7.22.5" +"@babel/plugin-transform-flow-strip-types@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-flow-strip-types/-/plugin-transform-flow-strip-types-7.23.3.tgz#cfa7ca159cc3306fab526fc67091556b51af26ff" + integrity sha512-26/pQTf9nQSNVJCrLB1IkHUKyPxR+lMrH2QDPG89+Znu9rAMbtrybdbWeE9bb7gzjmE5iXHEY+e0HUwM6Co93Q== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/plugin-syntax-flow" "^7.23.3" + "@babel/plugin-transform-for-of@^7.22.5": version "7.22.5" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.22.5.tgz#ab1b8a200a8f990137aff9a084f8de4099ab173f" @@ -1668,7 +1718,7 @@ "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-simple-access" "^7.22.5" -"@babel/plugin-transform-modules-commonjs@^7.23.3": +"@babel/plugin-transform-modules-commonjs@^7.23.0", "@babel/plugin-transform-modules-commonjs@^7.23.3": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.23.3.tgz#661ae831b9577e52be57dd8356b734f9700b53b4" integrity sha512-aVS0F65LKsdNOtcz6FRCpE4OgsP2OFnW46qNxNIX9h3wuzaNcSQsJysuMwqSibC98HPrf2vCgtxKNwS0DAlgcA== @@ -1735,18 +1785,18 @@ dependencies: "@babel/helper-plugin-utils" "^7.22.5" -"@babel/plugin-transform-nullish-coalescing-operator@^7.22.5": - version "7.22.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.22.5.tgz#f8872c65776e0b552e0849d7596cddd416c3e381" - integrity sha512-6CF8g6z1dNYZ/VXok5uYkkBBICHZPiGEl7oDnAx2Mt1hlHVHOSIKWJaXHjQJA5VB43KZnXZDIexMchY4y2PGdA== +"@babel/plugin-transform-nullish-coalescing-operator@^7.22.11", "@babel/plugin-transform-nullish-coalescing-operator@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.23.4.tgz#45556aad123fc6e52189ea749e33ce090637346e" + integrity sha512-jHE9EVVqHKAQx+VePv5LLGHjmHSJR76vawFPTdlxR/LVJPfOEGxREQwQfjuZEOPTwG92X3LINSh3M40Rv4zpVA== dependencies: "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" -"@babel/plugin-transform-nullish-coalescing-operator@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.23.4.tgz#45556aad123fc6e52189ea749e33ce090637346e" - integrity sha512-jHE9EVVqHKAQx+VePv5LLGHjmHSJR76vawFPTdlxR/LVJPfOEGxREQwQfjuZEOPTwG92X3LINSh3M40Rv4zpVA== +"@babel/plugin-transform-nullish-coalescing-operator@^7.22.5": + version "7.22.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-nullish-coalescing-operator/-/plugin-transform-nullish-coalescing-operator-7.22.5.tgz#f8872c65776e0b552e0849d7596cddd416c3e381" + integrity sha512-6CF8g6z1dNYZ/VXok5uYkkBBICHZPiGEl7oDnAx2Mt1hlHVHOSIKWJaXHjQJA5VB43KZnXZDIexMchY4y2PGdA== dependencies: "@babel/helper-plugin-utils" "^7.22.5" "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" @@ -1839,19 +1889,19 @@ "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" "@babel/plugin-syntax-optional-chaining" "^7.8.3" -"@babel/plugin-transform-optional-chaining@^7.23.3": - version "7.23.3" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.23.3.tgz#92fc83f54aa3adc34288933fa27e54c13113f4be" - integrity sha512-zvL8vIfIUgMccIAK1lxjvNv572JHFJIKb4MWBz5OGdBQA0fB0Xluix5rmOby48exiJc987neOmP/m9Fnpkz3Tg== +"@babel/plugin-transform-optional-chaining@^7.23.0", "@babel/plugin-transform-optional-chaining@^7.23.4": + version "7.23.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.23.4.tgz#6acf61203bdfc4de9d4e52e64490aeb3e52bd017" + integrity sha512-ZU8y5zWOfjM5vZ+asjgAPwDaBjJzgufjES89Rs4Lpq63O300R/kOz30WCLo6BxxX6QVEilwSlpClnG5cZaikTA== dependencies: "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" "@babel/plugin-syntax-optional-chaining" "^7.8.3" -"@babel/plugin-transform-optional-chaining@^7.23.4": - version "7.23.4" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.23.4.tgz#6acf61203bdfc4de9d4e52e64490aeb3e52bd017" - integrity sha512-ZU8y5zWOfjM5vZ+asjgAPwDaBjJzgufjES89Rs4Lpq63O300R/kOz30WCLo6BxxX6QVEilwSlpClnG5cZaikTA== +"@babel/plugin-transform-optional-chaining@^7.23.3": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-optional-chaining/-/plugin-transform-optional-chaining-7.23.3.tgz#92fc83f54aa3adc34288933fa27e54c13113f4be" + integrity sha512-zvL8vIfIUgMccIAK1lxjvNv572JHFJIKb4MWBz5OGdBQA0fB0Xluix5rmOby48exiJc987neOmP/m9Fnpkz3Tg== dependencies: "@babel/helper-plugin-utils" "^7.22.5" "@babel/helper-skip-transparent-expression-wrappers" "^7.22.5" @@ -2380,6 +2430,15 @@ "@babel/helper-validator-option" "^7.22.5" "@babel/plugin-transform-flow-strip-types" "^7.22.5" +"@babel/preset-flow@^7.22.15": + version "7.23.3" + resolved "https://registry.yarnpkg.com/@babel/preset-flow/-/preset-flow-7.23.3.tgz#8084e08b9ccec287bd077ab288b286fab96ffab1" + integrity sha512-7yn6hl8RIv+KNk6iIrGZ+D06VhVY35wLVf23Cz/mMu1zOr7u4MMP4j0nZ9tLf8+4ZFpnib8cFYgB/oYg9hfswA== + dependencies: + "@babel/helper-plugin-utils" "^7.22.5" + "@babel/helper-validator-option" "^7.22.15" + "@babel/plugin-transform-flow-strip-types" "^7.23.3" + "@babel/preset-modules@0.1.6-no-external-plugins": version "0.1.6-no-external-plugins" resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.6-no-external-plugins.tgz#ccb88a2c49c817236861fee7826080573b8a923a" @@ -2413,7 +2472,7 @@ "@babel/plugin-transform-react-jsx-development" "^7.22.5" "@babel/plugin-transform-react-pure-annotations" "^7.22.5" -"@babel/preset-typescript@7.23.3": +"@babel/preset-typescript@7.23.3", "@babel/preset-typescript@^7.23.0": version "7.23.3" resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.23.3.tgz#14534b34ed5b6d435aa05f1ae1c5e7adcc01d913" integrity sha512-17oIGVlqz6CchO9RFYn5U6ZpWRZIngayYCtrPRSgANSwC2V1Jb+iP74nVxzzXJte8b8BYxrL1yY96xfhTBrNNQ== @@ -2446,6 +2505,17 @@ pirates "^4.0.5" source-map-support "^0.5.16" +"@babel/register@^7.22.15": + version "7.23.7" + resolved "https://registry.yarnpkg.com/@babel/register/-/register-7.23.7.tgz#485a5e7951939d21304cae4af1719fdb887bc038" + integrity sha512-EjJeB6+kvpk+Y5DAkEAmbOBEFkh9OASx0huoEkqYTFxAZHzOAX2Oh5uwAUuL2rUddqfM0SA+KPXV2TbzoZ2kvQ== + dependencies: + clone-deep "^4.0.1" + find-cache-dir "^2.0.0" + make-dir "^2.1.0" + pirates "^4.0.6" + source-map-support "^0.5.16" + "@babel/regjsgen@^0.8.0": version "0.8.0" resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" @@ -2520,6 +2590,15 @@ "@babel/parser" "^7.22.5" "@babel/types" "^7.22.5" +"@babel/template@^7.23.9": + version "7.23.9" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.23.9.tgz#f881d0487cba2828d3259dcb9ef5005a9731011a" + integrity sha512-+xrD2BWLpvHKNmX2QbpdpsBaWnRxahMwJjO+KZk2JOElj5nSmKezyS1B4u+QbHMTX69t4ukm6hh9lsYQ7GHCKA== + dependencies: + "@babel/code-frame" "^7.23.5" + "@babel/parser" "^7.23.9" + "@babel/types" "^7.23.9" + "@babel/traverse@^7.1.6", "@babel/traverse@^7.22.10", "@babel/traverse@^7.22.8": version "7.22.10" resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.22.10.tgz#20252acb240e746d27c2e82b4484f199cf8141aa" @@ -2632,6 +2711,22 @@ debug "^4.3.1" globals "^11.1.0" +"@babel/traverse@^7.23.9": + version "7.23.9" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.23.9.tgz#2f9d6aead6b564669394c5ce0f9302bb65b9d950" + integrity sha512-I/4UJ9vs90OkBtY6iiiTORVMyIhJ4kAVmsKo9KFc8UOxMeUfi2hvtIBsET5u9GizXE6/GFSuKCTNfgCswuEjRg== + dependencies: + "@babel/code-frame" "^7.23.5" + "@babel/generator" "^7.23.6" + "@babel/helper-environment-visitor" "^7.22.20" + "@babel/helper-function-name" "^7.23.0" + "@babel/helper-hoist-variables" "^7.22.5" + "@babel/helper-split-export-declaration" "^7.22.6" + "@babel/parser" "^7.23.9" + "@babel/types" "^7.23.9" + debug "^4.3.1" + globals "^11.1.0" + "@babel/types@^7.0.0", "@babel/types@^7.3.0", "@babel/types@^7.3.3": version "7.16.7" resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.16.7.tgz#4ed19d51f840ed4bd5645be6ce40775fecf03159" @@ -2700,6 +2795,15 @@ "@babel/helper-validator-identifier" "^7.22.20" to-fast-properties "^2.0.0" +"@babel/types@^7.23.9": + version "7.23.9" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.23.9.tgz#1dd7b59a9a2b5c87f8b41e52770b5ecbf492e002" + integrity sha512-dQjSq/7HaSjRM43FFGnv5keM2HsxpmyV1PfaSVm0nzzjwwTmjOe6J4bC8e3+pTEIgHaHj+1ZlLThRJ2auc/w1Q== + dependencies: + "@babel/helper-string-parser" "^7.23.4" + "@babel/helper-validator-identifier" "^7.22.20" + to-fast-properties "^2.0.0" + "@base2/pretty-print-object@1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@base2/pretty-print-object/-/pretty-print-object-1.0.1.tgz#371ba8be66d556812dc7fb169ebc3c08378f69d4" @@ -16474,6 +16578,32 @@ jscodeshift@^0.14.0: temp "^0.8.4" write-file-atomic "^2.3.0" +jscodeshift@^0.15.1: + version "0.15.1" + resolved "https://registry.yarnpkg.com/jscodeshift/-/jscodeshift-0.15.1.tgz#6c7a9572acdfa4f54098e958f71a05716a4e546b" + integrity sha512-hIJfxUy8Rt4HkJn/zZPU9ChKfKZM1342waJ1QC2e2YsPcWhM+3BJ4dcfQCzArTrk1jJeNLB341H+qOcEHRxJZg== + dependencies: + "@babel/core" "^7.23.0" + "@babel/parser" "^7.23.0" + "@babel/plugin-transform-class-properties" "^7.22.5" + "@babel/plugin-transform-modules-commonjs" "^7.23.0" + "@babel/plugin-transform-nullish-coalescing-operator" "^7.22.11" + "@babel/plugin-transform-optional-chaining" "^7.23.0" + "@babel/plugin-transform-private-methods" "^7.22.5" + "@babel/preset-flow" "^7.22.15" + "@babel/preset-typescript" "^7.23.0" + "@babel/register" "^7.22.15" + babel-core "^7.0.0-bridge.0" + chalk "^4.1.2" + flow-parser "0.*" + graceful-fs "^4.2.4" + micromatch "^4.0.4" + neo-async "^2.5.0" + node-dir "^0.1.17" + recast "^0.23.3" + temp "^0.8.4" + write-file-atomic "^2.3.0" + jsdoc-type-pratt-parser@~4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz#136f0571a99c184d84ec84662c45c29ceff71114" @@ -20035,7 +20165,7 @@ pirates@^4.0.1, pirates@^4.0.4: resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.4.tgz#07df81e61028e402735cdd49db701e4885b4e6e6" integrity sha512-ZIrVPH+A52Dw84R0L3/VS9Op04PuQ2SEoJL6bkshmiTic/HldyW9Tf7oH5mhJZBK7NmDx27vSMrYEXPXclpDKw== -pirates@^4.0.5: +pirates@^4.0.5, pirates@^4.0.6: version "4.0.6" resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.6.tgz#3018ae32ecfcff6c29ba2267cbf21166ac1f36b9" integrity sha512-saLsH7WeYYPiD25LDuLRRY/i+6HaPYr6G1OUlN39otzkSTxKnubR9RTxS3/Kk50s1g2JTgFwWQDQyplC5/SHZg== @@ -21102,7 +21232,7 @@ real-require@^0.2.0: resolved "https://registry.yarnpkg.com/real-require/-/real-require-0.2.0.tgz#209632dea1810be2ae063a6ac084fee7e33fba78" integrity sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg== -recast@0.23.4, recast@^0.23.1: +recast@0.23.4, recast@^0.23.1, recast@^0.23.3: version "0.23.4" resolved "https://registry.yarnpkg.com/recast/-/recast-0.23.4.tgz#ca1bac7bfd3011ea5a28dfecb5df678559fb1ddf" integrity sha512-qtEDqIZGVcSZCHniWwZWbRy79Dc6Wp3kT/UmDA2RJKBPg7+7k51aQBZirHmUGn5uvHf2rg8DkjizrN26k61ATw==