diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..0816a09f --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_style = tab +insert_final_newline = true +max_line_length = 100 +trim_trailing_whitespace = true + +[*.json] +indent_style = space + +[*.{yaml,yml}] +indent_style = space diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..dfe07704 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +# Auto detect text files and perform LF normalization +* text=auto diff --git a/pull_request_template.md b/.github/pull_request_template.md similarity index 100% rename from pull_request_template.md rename to .github/pull_request_template.md diff --git a/.github/workflows/ci-legacy.yaml b/.github/workflows/ci-legacy.yaml new file mode 100644 index 00000000..1a4d9195 --- /dev/null +++ b/.github/workflows/ci-legacy.yaml @@ -0,0 +1,41 @@ +name: CI - Legacy + +on: + push: + pull_request: + +permissions: + contents: read + +jobs: + build-test-legacy: + runs-on: ubuntu-latest + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 + with: + egress-policy: audit + + - name: Checkout + uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0 + + - uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0 + name: Install pnpm + with: + version: 10 + run_install: false + + - name: Install Node.js + uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0 + with: + node-version-file: ".nvmrc" + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install + + - name: Build legacy + run: pnpm build:legacy + + - name: Run legacy tests + run: pnpm test:legacy diff --git a/.github/workflows/pr.yaml b/.github/workflows/pr.yaml new file mode 100644 index 00000000..61de0ba9 --- /dev/null +++ b/.github/workflows/pr.yaml @@ -0,0 +1,30 @@ +name: Code quality + +on: + push: + pull_request: + +permissions: + contents: read + +jobs: + quality: + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Harden the runner (Audit all outbound calls) + uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0 + with: + egress-policy: audit + + - name: Checkout + uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 + with: + persist-credentials: false + - name: Setup Biome + uses: biomejs/setup-biome@454fa0d884737805f48d7dc236c1761a0ac3cc13 # v2.6.0 + with: + version: latest + - name: Run Biome + run: biome ci . diff --git a/.github/workflows/publish-legacy.yaml b/.github/workflows/publish-legacy.yaml index 7bd922a4..b82f084b 100644 --- a/.github/workflows/publish-legacy.yaml +++ b/.github/workflows/publish-legacy.yaml @@ -66,7 +66,7 @@ jobs: version: 9 - uses: actions/setup-node@v4 with: - node-version: 20 + node-version-file: ".nvmrc" - name: Install dependencies run: | diff --git a/.husky/pre-commit b/.husky/pre-commit deleted file mode 100644 index a5a29d9f..00000000 --- a/.husky/pre-commit +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh -. "$(dirname -- "$0")/_/husky.sh" - -pnpm lint-staged diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 00000000..a45fd52c --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +24 diff --git a/README.MD b/README.MD index a9ff6ac3..e529c768 100644 --- a/README.MD +++ b/README.MD @@ -12,36 +12,123 @@ Please [chat with us](https://go.codemod.com/community) before making any major To run the transform scripts use [`codemod`](https://go.codemod.com/github) command below: ```console -$ npx codemod --target [...options] +$ npx codemod ``` -- `transform` - name of transform. see available transforms below. -- `path` - directory to transform. defaults to the current directory. - +The `package-name` is name of transform. see available transforms below. See the [codemod CLI doc](https://go.codemod.com/cli-docs) for a full list of available commands. All codemods are also available in the [Codemod Registry](https://go.codemod.com/registry). -## GitHub Action +## Development + +Project structures: + +```txt +codemods/ +├─ project/ +│ ├─ recipes/ +│ │ ├─ src/ +│ │ │ ├─ feature.ts +│ │ ├─ tests/ +│ │ │ ├─ input/ +│ │ │ │ ├─ case-1.js +│ │ │ │ ├─ case-2.js +│ │ │ │ ├─ case-x.js +│ │ │ ├─ expected/ +│ │ │ │ ├─ case-1.js +│ │ │ │ ├─ case-2.js +│ │ │ │ ├─ case-x.js +│ │ ├─ codemod.yaml +│ │ ├─ package.json +│ │ ├─ README.md +│ │ ├─ workflow.yaml +│ ├─ vx-to-vx/ +│ │ ├─ codemod.yaml +│ │ ├─ package.json +│ │ ├─ README.md +│ │ ├─ workflow.yaml +utilities/ +├─ src/ +│ ├─ node-utilisies.ts +├─ package.json +package.json +README.md +``` + +- `codemods` dir represents the collection of projects + - `project` is a placeholder for a project name (eg: `react`, `angular`, `vue`, etc) + - `recipes` is a collection of related codemods (eg: `v18-to-v19`, `react-class-to-function`) +- `utilities` is a internal package that provides shared utilities for codemods (eg: ast-grep queries) -Use the composite action in this repository to run the Codemod CLI in GitHub Actions: +### `codemod.yaml` example ```yaml -name: Codemod -on: - workflow_dispatch: -jobs: - run-codemod: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - name: Run codemod (dry run) - uses: codemod-com/commons@v0 - with: - args: "@codemod-com/your-codemod --dry-run" +schema_version: "1.0" +name: "/" +version: 1.0.0 +description: +author: +license: MIT +workflow: workflow.yaml +category: migration + +targets: + languages: + - javascript + - typescript + +keywords: + - transformation + - migration + +registry: + access: public + visibility: public ``` -Notes: -- `inputs.args` is passed to `npx codemod` and defaults to `--version`. -- The Action wraps `npx -y codemod`; no install needed. -- To publish on Marketplace, create a tagged release (e.g., `v0.0.1`) and select "Publish this Action to Marketplace" when drafting the release. +### `package.json` example + +```json +{ + "name": "@/", + "version": "0.0.1", + "private": true, + "devDependencies": { + "@codemod.com/jssg-types": "catalog:" + }, + "scripts": { + "test": "npx codemod jssg test -l typescript ./src/workflow.ts ./" + } +} +``` + +### `workflow.yaml` example + +```yaml +# yaml-language-server: $schema=https://raw.githubusercontent.com/codemod/codemod/refs/heads/main/schemas/workflow.json + +version: "1" + +nodes: + - id: apply-transforms + name: Apply AST Transformations + type: automatic + steps: + - name: Handle DEP0147 via transforming `fs.rmdir` to `fs.rm`. + js-ast-grep: + js_file: src/workflow.ts + base_path: . + include: + - "**/*.js" + - "**/*.jsx" + - "**/*.mjs" + - "**/*.cjs" + - "**/*.cts" + - "**/*.mts" + - "**/*.ts" + - "**/*.tsx" + exclude: + - "**/node_modules/**" + language: typescript +``` diff --git a/action.yml b/action.yml deleted file mode 100644 index 1f20ba55..00000000 --- a/action.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: "Codemod CLI" -description: "Run the Codemod CLI in GitHub Actions via npx." -author: "Codemod" -branding: - icon: "code" - color: "purple" - -inputs: - args: - description: "Arguments to pass to the Codemod CLI (e.g. '@codemod-com/some-codemod --dry-run'). Defaults to '--version'." - required: false - default: "--version" - -runs: - using: "composite" - steps: - - name: Run Codemod - shell: bash - run: | - set -euo pipefail - npx -y codemod ${{ inputs.args }} - - diff --git a/biome.json b/biome.json deleted file mode 100644 index a64d5403..00000000 --- a/biome.json +++ /dev/null @@ -1,136 +0,0 @@ -{ - "$schema": "node_modules/@biomejs/biome/configuration_schema.json", - "files": { - "ignore": ["**/__testfixtures__/**"] - }, - "linter": { - "ignore": [ - "*.d.ts", - "dist", - "cdmd_dist", - "build", - "pnpm-lock.yaml", - "node_modules", - ".eslint*", - ".vscode", - "build-ncc", - "generated" - ], - "rules": { - "suspicious": { - "noMisleadingCharacterClass": "warn", - "noDuplicateClassMembers": "off", - "noRedeclare": "off", - "noDoubleEquals": "warn", - "noAssignInExpressions": "warn", - "noControlCharactersInRegex": "warn", - "noDuplicateParameters": "warn", - "noDuplicateObjectKeys": "warn", - "noDuplicateCase": "warn", - "noCatchAssign": "warn", - "noFallthroughSwitchClause": "warn", - "noFunctionAssign": "warn", - "noLabelVar": "warn", - "noConfusingLabels": "warn", - "noUnsafeNegation": "warn", - "noSelfCompare": "warn", - "noShadowRestrictedNames": "warn", - "useValidTypeof": "warn", - "useGetterReturn": "warn", - "noCommentText": "warn", - "noDuplicateJsxProps": "warn", - "noExplicitAny": "warn", - "noUnsafeDeclarationMerging": "warn", - "noArrayIndexKey": "off" - }, - "correctness": { - "noUndeclaredVariables": "off", - "noUnusedVariables": "off", - "noUnusedImports": "error", - "noConstAssign": "warn", - "noEmptyCharacterClassInRegex": "warn", - "noEmptyPattern": "warn", - "noNewSymbol": "warn", - "noGlobalObjectCalls": "warn", - "noSelfAssign": "warn", - "noUnreachableSuper": "warn", - "noUnreachable": "warn", - "noUnusedLabels": "warn", - "useExhaustiveDependencies": "warn", - "useYield": "warn", - "useIsNan": "warn", - "useHookAtTopLevel": "error", - "useJsxKeyInIterable": "warn" - }, - "complexity": { - "noUselessConstructor": "off", - "noUselessLabel": "warn", - "noMultipleSpacesInRegularExpressionLiterals": "warn", - "noUselessRename": "warn", - "noWith": "warn", - "noForEach": "off" - }, - "style": { - "noArguments": "warn", - "noUnusedTemplateLiteral": "off", - "noCommaOperator": "warn", - "noRestrictedGlobals": "error", - "useLiteralEnumMembers": "off", - "noNonNullAssertion": "warn" - }, - "a11y": { - "noSvgWithoutTitle": "warn", - "noBlankTarget": "warn", - "useAltText": "warn", - "useAnchorContent": "warn", - "useValidAnchor": "warn", - "useAriaActivedescendantWithTabindex": "warn", - "useValidAriaProps": "warn", - "useValidAriaValues": "warn", - "useValidAriaRole": "warn", - "noAriaUnsupportedElements": "warn", - "useHeadingContent": "warn", - "useIframeTitle": "warn", - "noAccessKey": "warn", - "noDistractingElements": "warn", - "noRedundantAlt": "warn", - "useAriaPropsForRole": "warn", - "noHeaderScope": "warn", - "useButtonType": "warn", - "useKeyWithClickEvents": "off", - "noNoninteractiveTabindex": "warn" - }, - "performance": { "noDelete": "off", "noAccumulatingSpread": "warn" }, - "security": { "noDangerouslySetInnerHtml": "warn" } - } - }, - "formatter": { - "formatWithErrors": true, - "indentStyle": "space", - "ignore": [ - "*.d.ts", - "input.js", - "output.js", - "dist", - "cdmd_dist", - "build", - "pnpm-lock.yaml", - "node_modules", - "build-ncc", - ".vscode", - "generated", - "**/__testfixtures__/**" - ] - }, - "organizeImports": { - "ignore": [ - "node_modules", - "dist", - "cdmd_dist", - "build", - ".vscode", - "build-ncc", - "**/__testfixtures__/**" - ] - } -} diff --git a/biome.jsonc b/biome.jsonc new file mode 100644 index 00000000..b0e42355 --- /dev/null +++ b/biome.jsonc @@ -0,0 +1,77 @@ +{ + "$schema": "./node_modules/@biomejs/biome/configuration_schema.json", + "files": { + "includes": [ + "**", + "!codemods-legacy", + "!tooling-legacy", + "!**/*.snap.cjs", + "!**/fixtures", + "!**/expected", + "!**/input" + ] + }, + "assist": { "actions": { "source": { "organizeImports": "off" } } }, + // Rules for the linter + "linter": { + "rules": { + "style": { + "noNonNullAssertion": "off", + "noParameterAssign": "off", + "noYodaExpression": "error", + "useImportType": "error", + "useNodeAssertStrict": "error", + "useNodejsImportProtocol": "error", + "useAsConstAssertion": "error", + "useDefaultParameterLast": "error", + "useEnumInitializers": "error", + "useSelfClosingElements": "error", + "useSingleVarDeclarator": "error", + "noUnusedTemplateLiteral": "error", + "useNumberNamespace": "error", + "noInferrableTypes": "error", + "noUselessElse": "error", + "useArrayLiterals": "off", + "noEnum": "error" + }, + "suspicious": { + "noAssignInExpressions": "off", + "noExplicitAny": "error", + "noEmptyBlock": "error", + "noDuplicateAtImportRules": "error", + "noDuplicateObjectKeys": "error" + }, + "correctness": { + "noUnusedVariables": "error", + "noUnknownFunction": "error" + }, + "nursery": {}, + "performance": { + "recommended": true + } + } + }, + // Language specific settings + "javascript": { + "formatter": { + "arrowParentheses": "always", + "semicolons": "always", + "quoteStyle": "single", + "trailingCommas": "all" + }, + "linter": { + "enabled": true + } + }, + "json": { + "formatter": { + "enabled": true, + "indentStyle": "space" + } + }, + // VSC specific settings + "vcs": { + "enabled": true, + "clientKind": "git" + } +} diff --git a/codemods/Feature Flags/remove-unused-feature-flags/.codemodrc.json b/codemods-legacy/Feature Flags/remove-unused-feature-flags/.codemodrc.json similarity index 100% rename from codemods/Feature Flags/remove-unused-feature-flags/.codemodrc.json rename to codemods-legacy/Feature Flags/remove-unused-feature-flags/.codemodrc.json diff --git a/codemods/Feature Flags/remove-unused-feature-flags/README.md b/codemods-legacy/Feature Flags/remove-unused-feature-flags/README.md similarity index 100% rename from codemods/Feature Flags/remove-unused-feature-flags/README.md rename to codemods-legacy/Feature Flags/remove-unused-feature-flags/README.md diff --git a/codemods-legacy/Feature Flags/remove-unused-feature-flags/package.json b/codemods-legacy/Feature Flags/remove-unused-feature-flags/package.json new file mode 100644 index 00000000..4685b38c --- /dev/null +++ b/codemods-legacy/Feature Flags/remove-unused-feature-flags/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-feature-flags-remove-unused-feature-flags", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/Feature Flags/remove-unused-feature-flags/src/index.ts b/codemods-legacy/Feature Flags/remove-unused-feature-flags/src/index.ts similarity index 100% rename from codemods/Feature Flags/remove-unused-feature-flags/src/index.ts rename to codemods-legacy/Feature Flags/remove-unused-feature-flags/src/index.ts diff --git a/codemods-legacy/Feature Flags/remove-unused-feature-flags/test/test.ts b/codemods-legacy/Feature Flags/remove-unused-feature-flags/test/test.ts new file mode 100644 index 00000000..d91ac4d2 --- /dev/null +++ b/codemods-legacy/Feature Flags/remove-unused-feature-flags/test/test.ts @@ -0,0 +1,111 @@ +import assert from "node:assert"; +import { describe, it } from "node:test"; +import { buildApi } from "@codemod-com/utilities"; +import type { FileInfo } from "jscodeshift"; +import transform from "../src/index.ts"; + +describe("remove-unused-feature-flags", () => { + it("should not change code without feature flags", () => { + const INPUT = ` + const Component = () => { + return
A
; + } + `; + + const fileInfo: FileInfo = { + path: "index.ts", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx"), {}); + + assert.deepEqual(actualOutput, undefined); + }); + + it("should remove a feature flag check within Promise.all()", () => { + const INPUT = ` + const [a, b] = await Promise.all([ + Promise.resolve('a'), + isFlagEnabled('featureFlag'), + ]); + + const x = b && c; + + const y = + `; + + const OUTPUT = ` + const a = await Promise.resolve('a'); + + const x = c; + + const y = + `; + + const fileInfo: FileInfo = { + path: "index.ts", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx"), {}); + + assert.deepEqual( + actualOutput?.replace(/\s/gm, ""), + OUTPUT.replace(/\s/gm, ""), + ); + }); + + it("should remove a feature flag check within Promise.all() (with options)", () => { + const INPUT = ` + const [b, a] = await Promise.all([ + fnc('b'), + Promise.resolve('a'), + ]); + + const d = () => { + return c() && b; + } + `; + + const OUTPUT = ` + const a = await Promise.resolve('a'); + + const d = () => { + return c(); + } + `; + + const fileInfo: FileInfo = { + path: "index.ts", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("ts"), { + functionName: "fnc", + featureFlagName: "b", + }); + + assert.deepEqual( + actualOutput?.replace(/\s/gm, ""), + OUTPUT.replace(/\s/gm, ""), + ); + }); + + it("should replace await isFlagEnabled('featureFlag') with true", () => { + const INPUT = `const a = await isFlagEnabled('featureFlag');`; + + const OUTPUT = "const a = true;"; + + const fileInfo: FileInfo = { + path: "index.ts", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("ts"), {}); + + assert.deepEqual( + actualOutput?.replace(/\s/gm, ""), + OUTPUT.replace(/\s/gm, ""), + ); + }); +}); diff --git a/codemods/Feature Flags/remove-unused-feature-flags/tsconfig.json b/codemods-legacy/Feature Flags/remove-unused-feature-flags/tsconfig.json similarity index 100% rename from codemods/Feature Flags/remove-unused-feature-flags/tsconfig.json rename to codemods-legacy/Feature Flags/remove-unused-feature-flags/tsconfig.json diff --git a/codemods/devcycle/launchdarkly-to-devcycle/vitest.config.ts b/codemods-legacy/Feature Flags/remove-unused-feature-flags/vitest.config.ts similarity index 100% rename from codemods/devcycle/launchdarkly-to-devcycle/vitest.config.ts rename to codemods-legacy/Feature Flags/remove-unused-feature-flags/vitest.config.ts diff --git a/codemods/Go/remove-unnecessary-nested-block/.codemodrc.json b/codemods-legacy/Go/remove-unnecessary-nested-block/.codemodrc.json similarity index 100% rename from codemods/Go/remove-unnecessary-nested-block/.codemodrc.json rename to codemods-legacy/Go/remove-unnecessary-nested-block/.codemodrc.json diff --git a/codemods/Go/remove-unnecessary-nested-block/package.json b/codemods-legacy/Go/remove-unnecessary-nested-block/package.json similarity index 100% rename from codemods/Go/remove-unnecessary-nested-block/package.json rename to codemods-legacy/Go/remove-unnecessary-nested-block/package.json diff --git a/codemods/Go/remove-unnecessary-nested-block/rules.toml b/codemods-legacy/Go/remove-unnecessary-nested-block/rules.toml similarity index 100% rename from codemods/Go/remove-unnecessary-nested-block/rules.toml rename to codemods-legacy/Go/remove-unnecessary-nested-block/rules.toml diff --git a/codemods/Java/delete-unused-fields/.codemodrc.json b/codemods-legacy/Java/delete-unused-fields/.codemodrc.json similarity index 100% rename from codemods/Java/delete-unused-fields/.codemodrc.json rename to codemods-legacy/Java/delete-unused-fields/.codemodrc.json diff --git a/codemods/Java/delete-unused-fields/README.md b/codemods-legacy/Java/delete-unused-fields/README.md similarity index 100% rename from codemods/Java/delete-unused-fields/README.md rename to codemods-legacy/Java/delete-unused-fields/README.md diff --git a/codemods/Java/delete-unused-fields/package.json b/codemods-legacy/Java/delete-unused-fields/package.json similarity index 100% rename from codemods/Java/delete-unused-fields/package.json rename to codemods-legacy/Java/delete-unused-fields/package.json diff --git a/codemods/Java/delete-unused-fields/rules.toml b/codemods-legacy/Java/delete-unused-fields/rules.toml similarity index 100% rename from codemods/Java/delete-unused-fields/rules.toml rename to codemods-legacy/Java/delete-unused-fields/rules.toml diff --git a/codemods/antd/5/props-changed-migration/.codemodrc.json b/codemods-legacy/antd/5/props-changed-migration/.codemodrc.json similarity index 100% rename from codemods/antd/5/props-changed-migration/.codemodrc.json rename to codemods-legacy/antd/5/props-changed-migration/.codemodrc.json diff --git a/codemods/antd/5/props-changed-migration/README.md b/codemods-legacy/antd/5/props-changed-migration/README.md similarity index 100% rename from codemods/antd/5/props-changed-migration/README.md rename to codemods-legacy/antd/5/props-changed-migration/README.md diff --git a/codemods-legacy/antd/5/props-changed-migration/package.json b/codemods-legacy/antd/5/props-changed-migration/package.json new file mode 100644 index 00000000..10111ceb --- /dev/null +++ b/codemods-legacy/antd/5/props-changed-migration/package.json @@ -0,0 +1,18 @@ +{ + "name": "@codemod-com/codemod-antd-5-props-changed-migration", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/antd/5/props-changed-migration/src/ast.ts b/codemods-legacy/antd/5/props-changed-migration/src/ast.ts similarity index 100% rename from codemods/antd/5/props-changed-migration/src/ast.ts rename to codemods-legacy/antd/5/props-changed-migration/src/ast.ts diff --git a/codemods/antd/5/props-changed-migration/src/config.ts b/codemods-legacy/antd/5/props-changed-migration/src/config.ts similarity index 100% rename from codemods/antd/5/props-changed-migration/src/config.ts rename to codemods-legacy/antd/5/props-changed-migration/src/config.ts diff --git a/codemods/antd/5/props-changed-migration/src/index.ts b/codemods-legacy/antd/5/props-changed-migration/src/index.ts similarity index 100% rename from codemods/antd/5/props-changed-migration/src/index.ts rename to codemods-legacy/antd/5/props-changed-migration/src/index.ts diff --git a/codemods/antd/5/props-changed-migration/tsconfig.json b/codemods-legacy/antd/5/props-changed-migration/tsconfig.json similarity index 100% rename from codemods/antd/5/props-changed-migration/tsconfig.json rename to codemods-legacy/antd/5/props-changed-migration/tsconfig.json diff --git a/codemods/antd/5/remove-style-import/.codemodrc.json b/codemods-legacy/antd/5/remove-style-import/.codemodrc.json similarity index 100% rename from codemods/antd/5/remove-style-import/.codemodrc.json rename to codemods-legacy/antd/5/remove-style-import/.codemodrc.json diff --git a/codemods/antd/5/remove-style-import/README.md b/codemods-legacy/antd/5/remove-style-import/README.md similarity index 100% rename from codemods/antd/5/remove-style-import/README.md rename to codemods-legacy/antd/5/remove-style-import/README.md diff --git a/codemods-legacy/antd/5/remove-style-import/package.json b/codemods-legacy/antd/5/remove-style-import/package.json new file mode 100644 index 00000000..331e766b --- /dev/null +++ b/codemods-legacy/antd/5/remove-style-import/package.json @@ -0,0 +1,21 @@ +{ + "name": "@codemod-com/codemod-antd-5-v5-remove-style-import", + "dependencies": { + "@codemod-com/antd5-utils": "workspace:*" + }, + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/antd/5/remove-style-import/src/index.js b/codemods-legacy/antd/5/remove-style-import/src/index.js similarity index 100% rename from codemods/antd/5/remove-style-import/src/index.js rename to codemods-legacy/antd/5/remove-style-import/src/index.js diff --git a/codemods/antd/5/remove-style-import/tsconfig.json b/codemods-legacy/antd/5/remove-style-import/tsconfig.json similarity index 100% rename from codemods/antd/5/remove-style-import/tsconfig.json rename to codemods-legacy/antd/5/remove-style-import/tsconfig.json diff --git a/codemods/antd/5/removed-component-migration/.codemodrc.json b/codemods-legacy/antd/5/removed-component-migration/.codemodrc.json similarity index 100% rename from codemods/antd/5/removed-component-migration/.codemodrc.json rename to codemods-legacy/antd/5/removed-component-migration/.codemodrc.json diff --git a/codemods/antd/5/removed-component-migration/README.md b/codemods-legacy/antd/5/removed-component-migration/README.md similarity index 100% rename from codemods/antd/5/removed-component-migration/README.md rename to codemods-legacy/antd/5/removed-component-migration/README.md diff --git a/codemods-legacy/antd/5/removed-component-migration/package.json b/codemods-legacy/antd/5/removed-component-migration/package.json new file mode 100644 index 00000000..09d259d7 --- /dev/null +++ b/codemods-legacy/antd/5/removed-component-migration/package.json @@ -0,0 +1,21 @@ +{ + "name": "@codemod-com/codemod-antd-5-v5-removed-component-migration", + "dependencies": { + "@codemod-com/antd5-utils": "workspace:*" + }, + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/antd/5/removed-component-migration/src/index.js b/codemods-legacy/antd/5/removed-component-migration/src/index.js similarity index 100% rename from codemods/antd/5/removed-component-migration/src/index.js rename to codemods-legacy/antd/5/removed-component-migration/src/index.js diff --git a/codemods/antd/5/removed-component-migration/tsconfig.json b/codemods-legacy/antd/5/removed-component-migration/tsconfig.json similarity index 100% rename from codemods/antd/5/removed-component-migration/tsconfig.json rename to codemods-legacy/antd/5/removed-component-migration/tsconfig.json diff --git a/codemods/antd/5/removed-static-method-migration/.codemodrc.json b/codemods-legacy/antd/5/removed-static-method-migration/.codemodrc.json similarity index 100% rename from codemods/antd/5/removed-static-method-migration/.codemodrc.json rename to codemods-legacy/antd/5/removed-static-method-migration/.codemodrc.json diff --git a/codemods/antd/5/removed-static-method-migration/README.md b/codemods-legacy/antd/5/removed-static-method-migration/README.md similarity index 100% rename from codemods/antd/5/removed-static-method-migration/README.md rename to codemods-legacy/antd/5/removed-static-method-migration/README.md diff --git a/codemods-legacy/antd/5/removed-static-method-migration/package.json b/codemods-legacy/antd/5/removed-static-method-migration/package.json new file mode 100644 index 00000000..5d8b48ee --- /dev/null +++ b/codemods-legacy/antd/5/removed-static-method-migration/package.json @@ -0,0 +1,21 @@ +{ + "name": "@codemod-com/codemod-antd-5-removed-static-method-migration", + "dependencies": { + "@codemod-com/antd5-utils": "workspace:*" + }, + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/antd/5/removed-static-method-migration/src/index.js b/codemods-legacy/antd/5/removed-static-method-migration/src/index.js similarity index 100% rename from codemods/antd/5/removed-static-method-migration/src/index.js rename to codemods-legacy/antd/5/removed-static-method-migration/src/index.js diff --git a/codemods/antd/5/removed-static-method-migration/tsconfig.json b/codemods-legacy/antd/5/removed-static-method-migration/tsconfig.json similarity index 100% rename from codemods/antd/5/removed-static-method-migration/tsconfig.json rename to codemods-legacy/antd/5/removed-static-method-migration/tsconfig.json diff --git a/codemods/antd/5/utils/ast.ts b/codemods-legacy/antd/5/utils/ast.ts similarity index 100% rename from codemods/antd/5/utils/ast.ts rename to codemods-legacy/antd/5/utils/ast.ts diff --git a/codemods/antd/5/utils/config.js b/codemods-legacy/antd/5/utils/config.js similarity index 100% rename from codemods/antd/5/utils/config.js rename to codemods-legacy/antd/5/utils/config.js diff --git a/codemods/antd/5/utils/index.js b/codemods-legacy/antd/5/utils/index.js similarity index 100% rename from codemods/antd/5/utils/index.js rename to codemods-legacy/antd/5/utils/index.js diff --git a/codemods/antd/5/utils/marker.js b/codemods-legacy/antd/5/utils/marker.js similarity index 100% rename from codemods/antd/5/utils/marker.js rename to codemods-legacy/antd/5/utils/marker.js diff --git a/codemods/antd/5/utils/package.json b/codemods-legacy/antd/5/utils/package.json similarity index 100% rename from codemods/antd/5/utils/package.json rename to codemods-legacy/antd/5/utils/package.json diff --git a/codemods/antd/5/utils/utils.js b/codemods-legacy/antd/5/utils/utils.js similarity index 100% rename from codemods/antd/5/utils/utils.js rename to codemods-legacy/antd/5/utils/utils.js diff --git a/codemods/axios/fetch/.codemodrc.json b/codemods-legacy/axios/fetch/.codemodrc.json similarity index 100% rename from codemods/axios/fetch/.codemodrc.json rename to codemods-legacy/axios/fetch/.codemodrc.json diff --git a/codemods/axios/fetch/.gitignore b/codemods-legacy/axios/fetch/.gitignore similarity index 100% rename from codemods/axios/fetch/.gitignore rename to codemods-legacy/axios/fetch/.gitignore diff --git a/codemods/axios/fetch/LICENSE b/codemods-legacy/axios/fetch/LICENSE similarity index 100% rename from codemods/axios/fetch/LICENSE rename to codemods-legacy/axios/fetch/LICENSE diff --git a/codemods/axios/fetch/README.md b/codemods-legacy/axios/fetch/README.md similarity index 100% rename from codemods/axios/fetch/README.md rename to codemods-legacy/axios/fetch/README.md diff --git a/codemods/axios/fetch/__testfixtures__/fixture1.input.ts b/codemods-legacy/axios/fetch/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/axios/fetch/__testfixtures__/fixture1.input.ts rename to codemods-legacy/axios/fetch/__testfixtures__/fixture1.input.ts diff --git a/codemods/axios/fetch/__testfixtures__/fixture1.output.ts b/codemods-legacy/axios/fetch/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/axios/fetch/__testfixtures__/fixture1.output.ts rename to codemods-legacy/axios/fetch/__testfixtures__/fixture1.output.ts diff --git a/codemods/axios/fetch/__testfixtures__/fixture2.input.ts b/codemods-legacy/axios/fetch/__testfixtures__/fixture2.input.ts similarity index 100% rename from codemods/axios/fetch/__testfixtures__/fixture2.input.ts rename to codemods-legacy/axios/fetch/__testfixtures__/fixture2.input.ts diff --git a/codemods/axios/fetch/__testfixtures__/fixture2.output.ts b/codemods-legacy/axios/fetch/__testfixtures__/fixture2.output.ts similarity index 100% rename from codemods/axios/fetch/__testfixtures__/fixture2.output.ts rename to codemods-legacy/axios/fetch/__testfixtures__/fixture2.output.ts diff --git a/codemods-legacy/axios/fetch/package.json b/codemods-legacy/axios/fetch/package.json new file mode 100644 index 00000000..e9863871 --- /dev/null +++ b/codemods-legacy/axios/fetch/package.json @@ -0,0 +1,18 @@ +{ + "name": "fetch", + "license": "MIT", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "^5.2.2", + "vitest": "^1.0.1", + "@codemod.com/workflow": "0.0.31" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/axios/fetch/src/index.ts b/codemods-legacy/axios/fetch/src/index.ts similarity index 100% rename from codemods/axios/fetch/src/index.ts rename to codemods-legacy/axios/fetch/src/index.ts diff --git a/codemods-legacy/axios/fetch/tsconfig.json b/codemods-legacy/axios/fetch/tsconfig.json new file mode 100644 index 00000000..36bd1c7d --- /dev/null +++ b/codemods-legacy/axios/fetch/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@codemod-com/tsconfig/codemod.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "./dist" + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/bull/bullmq/.codemodrc.json b/codemods-legacy/bull/bullmq/.codemodrc.json similarity index 100% rename from codemods/bull/bullmq/.codemodrc.json rename to codemods-legacy/bull/bullmq/.codemodrc.json diff --git a/codemods/bull/bullmq/README.md b/codemods-legacy/bull/bullmq/README.md similarity index 100% rename from codemods/bull/bullmq/README.md rename to codemods-legacy/bull/bullmq/README.md diff --git a/codemods-legacy/bull/bullmq/package.json b/codemods-legacy/bull/bullmq/package.json new file mode 100644 index 00000000..3d12b45a --- /dev/null +++ b/codemods-legacy/bull/bullmq/package.json @@ -0,0 +1,18 @@ +{ + "name": "@codemod-com/codemod-bull-bullmq", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/bull/bullmq/src/correct-types.ts b/codemods-legacy/bull/bullmq/src/correct-types.ts similarity index 100% rename from codemods/bull/bullmq/src/correct-types.ts rename to codemods-legacy/bull/bullmq/src/correct-types.ts diff --git a/codemods/bull/bullmq/src/get-import-declaration.ts b/codemods-legacy/bull/bullmq/src/get-import-declaration.ts similarity index 100% rename from codemods/bull/bullmq/src/get-import-declaration.ts rename to codemods-legacy/bull/bullmq/src/get-import-declaration.ts diff --git a/codemods/bull/bullmq/src/imports.ts b/codemods-legacy/bull/bullmq/src/imports.ts similarity index 100% rename from codemods/bull/bullmq/src/imports.ts rename to codemods-legacy/bull/bullmq/src/imports.ts diff --git a/codemods/bull/bullmq/src/index.ts b/codemods-legacy/bull/bullmq/src/index.ts similarity index 100% rename from codemods/bull/bullmq/src/index.ts rename to codemods-legacy/bull/bullmq/src/index.ts diff --git a/codemods/bull/bullmq/src/listeners.ts b/codemods-legacy/bull/bullmq/src/listeners.ts similarity index 100% rename from codemods/bull/bullmq/src/listeners.ts rename to codemods-legacy/bull/bullmq/src/listeners.ts diff --git a/codemods/bull/bullmq/src/queue.ts b/codemods-legacy/bull/bullmq/src/queue.ts similarity index 100% rename from codemods/bull/bullmq/src/queue.ts rename to codemods-legacy/bull/bullmq/src/queue.ts diff --git a/codemods/bull/bullmq/src/types.ts b/codemods-legacy/bull/bullmq/src/types.ts similarity index 100% rename from codemods/bull/bullmq/src/types.ts rename to codemods-legacy/bull/bullmq/src/types.ts diff --git a/codemods/bull/bullmq/src/worker.ts b/codemods-legacy/bull/bullmq/src/worker.ts similarity index 100% rename from codemods/bull/bullmq/src/worker.ts rename to codemods-legacy/bull/bullmq/src/worker.ts diff --git a/codemods/bull/bullmq/tsconfig.json b/codemods-legacy/bull/bullmq/tsconfig.json similarity index 100% rename from codemods/bull/bullmq/tsconfig.json rename to codemods-legacy/bull/bullmq/tsconfig.json diff --git a/codemods/cal.com/app-directory-boilerplate-calcom/.codemodrc.json b/codemods-legacy/cal.com/app-directory-boilerplate-calcom/.codemodrc.json similarity index 100% rename from codemods/cal.com/app-directory-boilerplate-calcom/.codemodrc.json rename to codemods-legacy/cal.com/app-directory-boilerplate-calcom/.codemodrc.json diff --git a/codemods/cal.com/app-directory-boilerplate-calcom/README.md b/codemods-legacy/cal.com/app-directory-boilerplate-calcom/README.md similarity index 100% rename from codemods/cal.com/app-directory-boilerplate-calcom/README.md rename to codemods-legacy/cal.com/app-directory-boilerplate-calcom/README.md diff --git a/codemods-legacy/cal.com/app-directory-boilerplate-calcom/package.json b/codemods-legacy/cal.com/app-directory-boilerplate-calcom/package.json new file mode 100644 index 00000000..f457016e --- /dev/null +++ b/codemods-legacy/cal.com/app-directory-boilerplate-calcom/package.json @@ -0,0 +1,33 @@ +{ + "name": "@codemod-com/codemod-cal.com-app-directory-boilerplate-calcom", + "dependencies": { + "mdast-util-from-markdown": "catalog:", + "mdast-util-to-markdown": "catalog:", + "micromark-extension-mdxjs": "catalog:", + "mdast-util-mdx": "catalog:", + "unist-util-visit": "catalog:" + }, + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/filemod": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "memfs": "^4.6.0", + "ts-morph": "^19.0.0", + "jscodeshift": "^0.15.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods-legacy/cal.com/app-directory-boilerplate-calcom/src/index.ts b/codemods-legacy/cal.com/app-directory-boilerplate-calcom/src/index.ts new file mode 100644 index 00000000..2729bcb6 --- /dev/null +++ b/codemods-legacy/cal.com/app-directory-boilerplate-calcom/src/index.ts @@ -0,0 +1,665 @@ +import { format, parse, sep } from "node:path"; +import type { Filemod, HandleData, HandleFile } from "@codemod-com/filemod"; +import type { Identifier, SourceFile } from "ts-morph"; +import tsmorph, { Node, SyntaxKind } from "ts-morph"; + +type Dependencies = Readonly<{ + tsmorph: typeof tsmorph; +}>; + +const removeLeadingLineBreaks = (input: string): string => { + return input.replace(/^\n+/, ""); +}; + +const FilePurpose = { + ORIGINAL_PAGE: "ORIGINAL_PAGE", + ROUTE_PAGE: "ROUTE_PAGE", // route directories +} as const; + +type FilePurpose = typeof FilePurpose[keyof typeof FilePurpose]; + +const map = new Map([ + [FilePurpose.ORIGINAL_PAGE, ""], + [FilePurpose.ROUTE_PAGE, ""], +]); + +type State = Record; + +type DataAPI = Parameters>[0]; + +type FileCommand = Awaited>>[number]; +type DataCommand = Awaited>>; + +const addUseClientStatement = ( + oldPath: string, + oldData: string, +): DataCommand => { + const project = new tsmorph.Project({ + useInMemoryFileSystem: true, + skipFileDependencyResolution: true, + compilerOptions: { + allowJs: true, + }, + }); + + const sourceFile = project.createSourceFile(oldPath ?? "", oldData); + + const hasUseClient = sourceFile + .getDescendantsOfKind(SyntaxKind.StringLiteral) + .some((node) => { + const literal = node.getLiteralText(); + return literal === "use client"; + }); + + if (!hasUseClient) { + sourceFile.insertStatements(0, `'use client';`); + } + + return { + kind: "upsertData", + path: oldPath, + data: sourceFile.getFullText(), + }; +}; + +const ROUTE_SEGMENT_CONFIG_OPTIONS = [ + "dynamic", + "dynamicParams", + "revalidate", + "fetchCache", + "runtime", + "preferredRegion", + "maxDuration", +]; + +const getAncestorByDeclaration = (declarationNode: Node): Node | null => { + let ancestor: Node | null = null; + + const parameter = Node.isParameterDeclaration(declarationNode) + ? declarationNode + : declarationNode.getFirstAncestorByKind(SyntaxKind.Parameter); + const importDeclaration = declarationNode.getFirstAncestorByKind( + SyntaxKind.ImportDeclaration, + ); + + if (parameter !== undefined) { + ancestor = parameter; + } else if (importDeclaration !== undefined) { + ancestor = importDeclaration; + } else if (Node.isFunctionDeclaration(declarationNode)) { + ancestor = declarationNode; + } else if (Node.isVariableDeclaration(declarationNode)) { + // variable statement + ancestor = declarationNode.getParent()?.getParent() ?? null; + } else if (Node.isBindingElement(declarationNode)) { + ancestor = + declarationNode.getFirstAncestorByKind(SyntaxKind.VariableStatement) ?? + null; + } + + return ancestor; +}; +const DEPENDENCY_TREE_MAX_DEPTH = 3; + +const getDependenciesForIdentifiers = ( + identifiers: ReadonlyArray, + depth = 0, +) => { + if (depth > DEPENDENCY_TREE_MAX_DEPTH) { + return {}; + } + + const dependencies: Record = {}; + + identifiers.forEach((identifier) => { + const parent = identifier.getParent(); + + if (Node.isParameterDeclaration(parent)) { + return; + } + + if ( + (Node.isPropertyAccessExpression(parent) || + Node.isElementAccessExpression(parent)) && + identifier.getChildIndex() !== 0 + ) { + return; + } + + if ( + Node.isPropertyAssignment(parent) && + parent.getNameNode() === identifier + ) { + return; + } + + const [firstDeclaration] = identifier.getSymbol()?.getDeclarations() ?? []; + + const localSourceFile = identifier.getFirstAncestorByKind( + SyntaxKind.SourceFile, + ); + + // check if declaration exists in current sourceFile + if ( + firstDeclaration === undefined || + firstDeclaration.getFirstAncestorByKind(SyntaxKind.SourceFile) !== + localSourceFile + ) { + return; + } + + const ancestor = getAncestorByDeclaration(firstDeclaration); + + if (ancestor === null) { + return; + } + + dependencies[identifier.getText()] = ancestor.getText(); + + // recursivelly check for dependencies until reached parameter or import + if ( + Node.isImportDeclaration(ancestor) || + Node.isParameterDeclaration(ancestor) + ) { + return; + } + + const ancestorIdentifiers = ancestor + .getDescendantsOfKind(SyntaxKind.Identifier) + .filter((i) => { + if (i.getText() === identifier.getText()) { + return false; + } + + if (ancestor && Node.isFunctionDeclaration(ancestor)) { + const declaration = i.getSymbol()?.getDeclarations()[0]; + + // ensure we dont collect identifiers from function inner scope in nested functions + if ( + declaration?.getFirstAncestorByKind( + SyntaxKind.FunctionDeclaration, + ) === ancestor + ) { + return false; + } + } + + const parent = i.getParent(); + + return ( + !Node.isBindingElement(parent) && + !Node.isPropertyAssignment(parent) && + !(Node.isPropertyAccessExpression(parent) && i.getChildIndex() !== 0) + ); + }); + + const dependenciesOfAncestor = getDependenciesForIdentifiers( + ancestorIdentifiers, + depth + 1, + ); + Object.assign(dependencies, dependenciesOfAncestor); + }); + + return dependencies; +}; + +const getRouteSegmentConfig = (sourceFile: SourceFile): string => { + let nextjsConfig = ""; + + sourceFile.getVariableStatements().forEach((statement) => { + statement.getDeclarations().forEach((declaration) => { + const id = declaration.getName() ?? ""; + + if ( + declaration.hasExportKeyword() && + ROUTE_SEGMENT_CONFIG_OPTIONS.includes(id) + ) { + nextjsConfig += `${statement.getText()} \n`; + } + }); + }); + + return nextjsConfig; +}; + +const getServerSideDataHookWithDeps = (sourceFile: SourceFile) => { + let dataHooksWithDeps = ""; + + const getDataAF = sourceFile + .getDescendantsOfKind(SyntaxKind.ArrowFunction) + .find((AF) => { + const parent = AF.getParent(); + return ( + Node.isVariableDeclaration(parent) && parent.getName() === "getData" + ); + }); + + if (getDataAF === undefined) { + return dataHooksWithDeps; + } + + const identifiers = getDataAF + .getBody() + .getDescendantsOfKind(SyntaxKind.Identifier); + + const dependencies = getDependenciesForIdentifiers(identifiers); + + dataHooksWithDeps += Object.values(dependencies).reverse().join("\n"); + dataHooksWithDeps += `${ + getDataAF.getFirstAncestorByKind(SyntaxKind.VariableStatement)?.getText() ?? + "" + } \n`; + + return dataHooksWithDeps; +}; + +const getPositionAfterImports = (sourceFile: SourceFile): number => { + const lastImportDeclaration = + sourceFile.getLastChildByKind(SyntaxKind.ImportDeclaration) ?? null; + + return (lastImportDeclaration?.getChildIndex() ?? 0) + 1; +}; + +const buildPageFileData = ( + api: DataAPI, + path: string, + options: Readonly>, + filePurpose: FilePurpose.ROUTE_PAGE, +): DataCommand => { + const { tsmorph } = api.getDependencies(); + + const rewriteWithTsMorph = ( + input: string, + legacyPageData: string, + ): string => { + const project = new tsmorph.Project({ + useInMemoryFileSystem: true, + skipFileDependencyResolution: true, + compilerOptions: { + allowJs: true, + }, + }); + + const oldPath = + typeof options.oldPath === "string" ? options.oldPath : null; + + const sourceFile = project.createSourceFile(path ?? "", input); + + const legacyPageSourceFile = project.createSourceFile( + oldPath ?? "", + legacyPageData, + ); + + // inserting route segment config to the future page + const routeSegmentConfig = getRouteSegmentConfig(legacyPageSourceFile); + + sourceFile.addStatements(routeSegmentConfig); + + // inserting server side data hooks along with its dependencies to the future page + const serverSideDataHooks = + getServerSideDataHookWithDeps(legacyPageSourceFile); + + const positionAfterImports = getPositionAfterImports(sourceFile); + + sourceFile.insertStatements(positionAfterImports, serverSideDataHooks); + + sourceFile.getFunctions().forEach((fn) => { + if (fn.isDefaultExport()) { + fn.remove(); + return; + } + + const id = fn.getName() ?? ""; + + if ( + ["getStaticProps", "getServerSideProps", "getStaticPaths"].includes(id) + ) { + fn.setIsExported(false); + } + }); + + sourceFile.getVariableStatements().forEach((statement) => { + statement.getDeclarations().forEach((declaration) => { + const id = declaration.getName() ?? ""; + + if ( + ["getStaticProps", "getServerSideProps", "getStaticPaths"].includes( + id, + ) && + declaration.hasExportKeyword() + ) { + statement.setIsExported(false); + } + }); + }); + + sourceFile + .getDescendantsOfKind(SyntaxKind.JsxOpeningElement) + .filter( + (jsxOpeningElement) => + jsxOpeningElement.getTagNameNode().getText() === "Head", + ) + .map((declaration) => { + return declaration.getFirstAncestorByKind(SyntaxKind.JsxElement); + }) + .forEach((jsxElement) => { + const parenthesizedExpressionParent = + jsxElement?.getParentIfKind(SyntaxKind.ParenthesizedExpression) ?? + null; + + if (parenthesizedExpressionParent !== null) { + parenthesizedExpressionParent.replaceWithText("null"); + + return; + } + + jsxElement?.replaceWithText(""); + }); + + if (filePurpose === FilePurpose.ROUTE_PAGE) { + sourceFile.getImportDeclarations().forEach((declaration) => { + const moduleSpecifier = declaration.getModuleSpecifierValue(); + + if (moduleSpecifier.startsWith("./")) { + declaration.setModuleSpecifier(`.${moduleSpecifier}`); + } else if (moduleSpecifier.startsWith("../")) { + declaration.setModuleSpecifier(`../${moduleSpecifier}`); + } + }); + } + + return sourceFile.getFullText(); + }; + + return { + kind: "upsertData", + path, + data: rewriteWithTsMorph( + String(options.oldData ?? ""), + String(options.legacyPageData ?? ""), + ), + }; +}; + +const SERVER_SIDE_DATA_HOOKS_NAMES = ["getStaticProps", "getServerSideProps"]; + +const usesServerSideData = (sourceFile: SourceFile) => { + return ( + sourceFile + .getFunctions() + .some((fn) => + SERVER_SIDE_DATA_HOOKS_NAMES.includes(fn.getName() ?? ""), + ) || + sourceFile + .getVariableStatements() + .some((statement) => + statement + .getDeclarations() + .some((declaration) => + SERVER_SIDE_DATA_HOOKS_NAMES.includes(declaration.getName() ?? ""), + ), + ) + ); +}; + +const usesLayout = (sourceFile: SourceFile) => { + return sourceFile + .getImportDeclarations() + .some( + (importDeclaration) => + importDeclaration.getNamedImports()[0]?.getName() === "getLayout", + ); +}; + +const getPageContent = ( + newPagePath: string, + usesLayout: boolean, + nestedPathWithoutExtension: string, +) => { + if (newPagePath.endsWith("embed")) { + return ` +import type { Params } from "next/dist/shared/lib/router/utils/route-matcher"; +import { getData } from "../page"; + +type PageProps = Readonly<{ + params: Params; +}>; + +const Page = ({ params }: PageProps) => { + await getData(params, true); + + return null; +}; + +export default Page;`; + } + if (newPagePath.includes("(individual-page-wrapper")) { + return ` +import OldPage from "@pages/${nestedPathWithoutExtension}"; +import { _generateMetadata } from "app/_utils"; +import type { Params } from "next/dist/shared/lib/router/utils/route-matcher"; +import PageWrapper from "@components/PageWrapperAppDir"; +import { headers, cookies } from "next/headers"; +import { buildLegacyCtx } from "@lib/buildLegacyCtx"; + +${ + usesLayout + ? 'import { getLayout } from "@calcom/features/MainLayoutAppDir";' + : "" +} + +export const generateMetadata = async () => await _generateMetadata(() => "", () => ""); + +type PageProps = Readonly<{ + params: Params; +}>; + +const Page = async ({ params }: PageProps) => { + const h = headers(); + const nonce = h.get("x-nonce") ?? undefined; + + const legacyCtx = buildLegacyCtx(headers(), cookies(), params); + const props = await getData(legacyCtx); + + return ( + + + + ); +}; + +export default Page;`; + } + + return ` +import Page from "@pages/${nestedPathWithoutExtension}"; +import { _generateMetadata } from "app/_utils"; + +export const generateMetadata = async () => await _generateMetadata(() => "", () => ""); + +export default Page;`; +}; + +const getNewPagePath = ( + directoryNames: string[], + fileName: string, + usesServerSideData: boolean, + usesLayout: boolean, +) => { + const newDirArr = directoryNames.map((name) => { + if (name !== "pages") { + return name; + } + + if (usesServerSideData) { + return "app/future/(individual-page-wrapper)"; + } + + if (usesLayout) { + return "app/future/(shared-page-wrapper)/(layout)"; + } + + return "app/future/(shared-page-wrapper)/(no-layout)"; + }); + + if (fileName !== "index") { + newDirArr.push(fileName); + } + + return newDirArr.join(sep); +}; + +const handleFile: Filemod< + Dependencies, + Record +>["handleFile"] = async (api, path, options) => { + const parsedPath = parse(path); + const directoryNames = parsedPath.dir.split(sep); + const endsWithPages = + directoryNames.length > 0 && + directoryNames.lastIndexOf("pages") === directoryNames.length - 1; + + const nameIsIndex = parsedPath.name === "index"; + + if (endsWithPages && nameIsIndex) { + return []; + } + + const oldData = await api.readFile(path); + + if (!endsWithPages) { + const project = new tsmorph.Project({ + useInMemoryFileSystem: true, + skipFileDependencyResolution: true, + compilerOptions: { + allowJs: true, + }, + }); + + const sourceFile = project.createSourceFile(path ?? "", oldData); + + const pageUsesServerSideData = usesServerSideData(sourceFile); + const pageUsesLayout = usesLayout(sourceFile); + + const newPagePath = getNewPagePath( + directoryNames, + parsedPath.name, + pageUsesServerSideData, + pageUsesLayout, + ); + + const nestedPathWithoutExtension = `${ + parsedPath.dir.split("/pages/")[1] ?? "" + }/${parsedPath.name}`; + + const pageContent = getPageContent( + newPagePath, + pageUsesLayout, + nestedPathWithoutExtension, + ); + + const commands: FileCommand[] = [ + { + kind: "upsertFile", + path: format({ + root: parsedPath.root, + dir: newPagePath, + ext: parsedPath.ext, + name: "page", + }), + options: { + ...options, + filePurpose: FilePurpose.ROUTE_PAGE, + oldPath: path, + oldData: removeLeadingLineBreaks(pageContent), + legacyPageData: oldData, + }, + }, + { + kind: "upsertFile", + path: format({ + root: parsedPath.root, + dir: parsedPath.dir, + ext: parsedPath.ext, + name: parsedPath.name, + }), + options: { + ...options, + filePurpose: FilePurpose.ORIGINAL_PAGE, + oldPath: path, + oldData, + }, + }, + ]; + + return commands; + } + + if (parsedPath.name === "_app" || parsedPath.name === "_document") { + return [ + { + kind: "deleteFile", + path, + }, + ]; + } + + return []; +}; + +const handleData: HandleData = async ( + api, + path, + __, + options, +) => { + try { + const filePurpose = (options.filePurpose ?? null) as FilePurpose | null; + + if (filePurpose === null) { + return { + kind: "noop", + }; + } + + const content = map.get(filePurpose) ?? null; + + if (content === null) { + return { + kind: "noop", + }; + } + + if (filePurpose === FilePurpose.ROUTE_PAGE && options.oldPath) { + return buildPageFileData(api, path, options, filePurpose); + } + + if ( + filePurpose === FilePurpose.ORIGINAL_PAGE && + options.oldPath && + options.oldData + ) { + return addUseClientStatement( + String(options.oldPath), + String(options.oldData), + ); + } + + return { + kind: "upsertData", + path, + data: content, + }; + } catch (error) { + return { + kind: "noop", + }; + } +}; + +export const repomod: Filemod = { + includePatterns: ["**/pages/**/*.{js,jsx,ts,tsx}"], + excludePatterns: ["**/node_modules/**", "**/pages/api/**"], + handleFile, + handleData, +}; diff --git a/codemods-legacy/cal.com/app-directory-boilerplate-calcom/test/test.ts b/codemods-legacy/cal.com/app-directory-boilerplate-calcom/test/test.ts new file mode 100644 index 00000000..efa0364f --- /dev/null +++ b/codemods-legacy/cal.com/app-directory-boilerplate-calcom/test/test.ts @@ -0,0 +1,443 @@ +import { deepStrictEqual, ok } from "node:assert/strict"; +import { describe, it } from "node:test"; +import { buildApi, executeFilemod } from "@codemod-com/filemod"; +import { buildPathAPI, buildUnifiedFileSystem } from "@codemod-com/utilities"; +import type { DirectoryJSON } from "memfs"; +import { Volume, createFsFromVolume } from "memfs"; +import tsmorph from "ts-morph"; +import { repomod } from "../src/index.ts"; + +const transform = async (json: DirectoryJSON) => { + const volume = Volume.fromJSON(json); + const fs = createFsFromVolume(volume); + + const unifiedFileSystem = buildUnifiedFileSystem(fs); + const pathApi = buildPathAPI("/"); + + const api = buildApi<{ + tsmorph: typeof tsmorph; + }>( + unifiedFileSystem, + () => ({ + tsmorph, + }), + pathApi, + ); + + return executeFilemod(api, repomod, "/", {}, {}); +}; + +describe("cal.com app-directory-boilerplate-calcom", () => { + it("should build correct files", async () => { + const externalFileCommands = await transform({ + "/opt/project/pages/a/index.tsx": "TODO content", + "/opt/project/pages/a/embed.tsx": "TODO content", + "/opt/project/pages/a/b.tsx": ` + import { getLayout } from './getLayout'; + export default function B(props) { + return ; + } + B.getLayout = getLayout; + `, + "/opt/project/pages/a/[b]/c.tsx": ` + export const getServerSideProps = (ctx) => { + return null; + } + export default function C(props) { + return ; + } + `, + "/opt/project/pages/a/d.tsx": ` + export const getStaticProps = (ctx) => { + return null; + } + export default function C(props) { + return ; + } + `, + }); + + deepStrictEqual(externalFileCommands.length, 10); + + ok( + externalFileCommands.some( + (command) => + command.kind === "upsertFile" && + command.path === + "/opt/project/app/future/(shared-page-wrapper)/(no-layout)/a/page.tsx", + ), + ); + + ok( + externalFileCommands.some( + (command) => + command.kind === "upsertFile" && + command.path === "/opt/project/pages/a/index.tsx", + ), + ); + + ok( + externalFileCommands.some( + (command) => + command.kind === "upsertFile" && + command.path === "/opt/project/pages/a/embed.tsx", + ), + ); + + ok( + externalFileCommands.some( + (command) => + command.kind === "upsertFile" && + command.path === + "/opt/project/app/future/(shared-page-wrapper)/(layout)/a/b/page.tsx", + ), + ); + + ok( + externalFileCommands.some( + (command) => + command.kind === "upsertFile" && + command.path === "/opt/project/pages/a/b.tsx", + ), + ); + + ok( + externalFileCommands.some( + (command) => + command.kind === "upsertFile" && + command.path === + "/opt/project/app/future/(individual-page-wrapper)/a/[b]/c/page.tsx", + ), + ); + + ok( + externalFileCommands.some( + (command) => + command.kind === "upsertFile" && + command.path === "/opt/project/pages/a/[b]/c.tsx", + ), + ); + + ok( + externalFileCommands.some( + (command) => + command.kind === "upsertFile" && + command.path === + "/opt/project/app/future/(individual-page-wrapper)/a/d/page.tsx", + ), + ); + + ok( + externalFileCommands.some( + (command) => + command.kind === "upsertFile" && + command.path === "/opt/project/pages/a/d.tsx", + ), + ); + + ok( + externalFileCommands.some((command) => { + return ( + command.kind === "upsertFile" && + command.path === + "/opt/project/app/future/(shared-page-wrapper)/(no-layout)/a/embed/page.tsx" && + command.newData.replace(/\W/gm, "") === + ` + import type { Params } from "next/dist/shared/lib/router/utils/route-matcher"; + import { getData } from "../page"; + + type PageProps = Readonly<{ + params: Params; + }>; + + const Page = ({ params }: PageProps) => { + await getData(params, true); + + return null; + }; + + export default Page;`.replace(/\W/gm, "") + ); + }), + ); + + ok( + externalFileCommands.some((command) => { + return ( + command.kind === "upsertFile" && + command.path === + "/opt/project/app/future/(shared-page-wrapper)/(no-layout)/a/page.tsx" && + command.newData.replace(/\W/gm, "") === + ` + import Page from "@pages/a/index"; + import { _generateMetadata } from "app/_utils"; + + export const generateMetadata = async () => await _generateMetadata(() => "", () => ""); + export default Page; + `.replace(/\W/gm, "") + ); + }), + ); + + ok( + externalFileCommands.some((command) => { + return ( + command.kind === "upsertFile" && + command.path === "/opt/project/pages/a/index.tsx" && + command.newData.replace(/\W/gm, "") === + ` + 'use client'; + TODO content + `.replace(/\W/gm, "") + ); + }), + ); + + ok( + externalFileCommands.some((command) => { + return ( + command.kind === "upsertFile" && + command.path === + "/opt/project/app/future/(shared-page-wrapper)/(layout)/a/b/page.tsx" && + command.newData.replace(/\W/gm, "") === + ` + import Page from "@pages/a/b"; + import { _generateMetadata } from "app/_utils"; + + export const generateMetadata = async () => await _generateMetadata(() => "", () => ""); + export default Page; + `.replace(/\W/gm, "") + ); + }), + ); + + ok( + externalFileCommands.some((command) => { + return ( + command.kind === "upsertFile" && + command.path === "/opt/project/pages/a/b.tsx" && + command.newData.replace(/\W/gm, "") === + ` + 'use client'; + import { getLayout } from './getLayout'; + export default function B(props) { + return ; + } + B.getLayout = getLayout; + `.replace(/\W/gm, "") + ); + }), + ); + + ok( + externalFileCommands.some((command) => { + const expected = ` + import OldPage from "@pages/a/[b]/c"; + import { _generateMetadata } from "app/_utils"; + import type { Params } from "next/dist/shared/lib/router/utils/route-matcher"; + import PageWrapper from "@components/PageWrapperAppDir"; + import { headers, cookies } from "next/headers"; + import { buildLegacyCtx } from "@lib/buildLegacyCtx"; + + export const generateMetadata = async () => await _generateMetadata(() => "", () => ""); + + type PageProps = Readonly<{ + params: Params; + }>; + + const Page = async ({ params }: PageProps) => { + const h = headers(); + const nonce = h.get("x-nonce") ?? undefined; + + const legacyCtx = buildLegacyCtx(headers(), cookies(), params); + const props = await getData(legacyCtx); + + return ( + + + + ); + }; + + export default Page;`; + + return ( + command.kind === "upsertFile" && + command.path === + "/opt/project/app/future/(individual-page-wrapper)/a/[b]/c/page.tsx" && + command.newData.replace(/\W/gm, "") === expected.replace(/\W/gm, "") + ); + }), + ); + + ok( + externalFileCommands.some((command) => { + return ( + command.kind === "upsertFile" && + command.path === "/opt/project/pages/a/[b]/c.tsx" && + command.newData.replace(/\W/gm, "") === + ` + 'use client'; + export const getServerSideProps = (ctx) => { + return null; + } + export default function C(props) { + return ; + } + `.replace(/\W/gm, "") + ); + }), + ); + + ok( + externalFileCommands.some((command) => { + const expected = ` + import OldPage from "@pages/a/d"; + import { _generateMetadata } from "app/_utils"; + import type { Params } from "next/dist/shared/lib/router/utils/route-matcher"; + import PageWrapper from "@components/PageWrapperAppDir"; + import { headers, cookies } from "next/headers"; + import { buildLegacyCtx } from "@lib/buildLegacyCtx"; + + export const generateMetadata = async () => await _generateMetadata(() => "", () => ""); + + type PageProps = Readonly<{ + params: Params; + }>; + + const Page = async ({ params }: PageProps) => { + const h = headers(); + const nonce = h.get("x-nonce") ?? undefined; + + const legacyCtx = buildLegacyCtx(headers(), cookies(), params); + const props = await getData(legacyCtx); + + return ( + + + + ); + }; + + export default Page;`; + return ( + command.kind === "upsertFile" && + command.path === + "/opt/project/app/future/(individual-page-wrapper)/a/d/page.tsx" && + command.newData.replace(/\W/gm, "") === expected.replace(/\W/gm, "") + ); + }), + ); + + ok( + externalFileCommands.some((command) => { + return ( + command.kind === "upsertFile" && + command.path === "/opt/project/pages/a/d.tsx" && + command.newData.replace(/\W/gm, "") === + ` + 'use client'; + export const getStaticProps = (ctx) => { + return null; + } + export default function C(props) { + return ; + } + `.replace(/\W/gm, "") + ); + }), + ); + }); + + it("should insert router segment config and server-side data hooks to the future page", async () => { + const [upsertPageCommand] = await transform({ + "/opt/project/pages/a/index.tsx": ` + import C from 'C'; + import { a } from 'a'; + import b from 'b'; + + export const getServerSideProps = (ctx) => { + return a + b; + } + + const getData = () => { + getServerSideProps(); + } + + export default function P() { + return ; + } + + export const dynamic="force-dynamic"; + `, + }); + + deepStrictEqual(upsertPageCommand?.kind, "upsertFile"); + deepStrictEqual( + upsertPageCommand?.path, + "/opt/project/app/future/(individual-page-wrapper)/a/page.tsx", + ); + + deepStrictEqual( + upsertPageCommand?.newData.replace(/(?!\.)\s/gm, ""), + `import OldPage from "@pages/a/index"; + import {_generateMetadata} from "app/_utils"; + import type {Params} from "next/dist/shared/lib/router/utils/route-matcher"; + import PageWrapper from "@components/PageWrapperAppDir"; + import {headers, cookies} from "next/headers"; + import { buildLegacyCtx } from "@lib/buildLegacyCtx"; + + import b from 'b'; + import { a } from 'a'; + const getServerSideProps = (ctx) => { + return a + b; + } + const getData = () => { + getServerSideProps(); + } + + export const generateMetadata = async ()=> await _generateMetadata(()=>"",()=>""); + type PageProps=Readonly<{params:Params;}>; + const Page = async ({params}:PageProps)=>{ + const h=headers(); + const nonce=h.get("x-nonce") ?? undefined; + + const legacyCtx = buildLegacyCtx(headers(), cookies(), params); + const props = await getData(legacyCtx); + + return(); + }; + export default Page; + export const dynamic="force-dynamic"; + `.replace(/(?!\.)\s/gm, ""), + ); + }); + + it('should not insert "use client" directive twice', async () => { + const [, upsertLegacyPage] = await transform({ + "/opt/project/pages/a/index.tsx": ` + 'use client' + import C from 'C'; + + export default function P() { + return ; + } + + `, + }); + + deepStrictEqual(upsertLegacyPage?.kind, "upsertFile"); + deepStrictEqual(upsertLegacyPage?.path, "/opt/project/pages/a/index.tsx"); + + deepStrictEqual( + upsertLegacyPage?.newData.replace(/(?!\.)\s/gm, ""), + `'use client' + import C from 'C'; + + export default function P() { + return ; + } + `.replace(/(?!\.)\s/gm, ""), + ); + }); +}); diff --git a/codemods/cal.com/app-directory-boilerplate-calcom/tsconfig.json b/codemods-legacy/cal.com/app-directory-boilerplate-calcom/tsconfig.json similarity index 100% rename from codemods/cal.com/app-directory-boilerplate-calcom/tsconfig.json rename to codemods-legacy/cal.com/app-directory-boilerplate-calcom/tsconfig.json diff --git a/codemods/cal.com/generate-metadata-tests-calcom/.codemodrc.json b/codemods-legacy/cal.com/generate-metadata-tests-calcom/.codemodrc.json similarity index 100% rename from codemods/cal.com/generate-metadata-tests-calcom/.codemodrc.json rename to codemods-legacy/cal.com/generate-metadata-tests-calcom/.codemodrc.json diff --git a/codemods/cal.com/generate-metadata-tests-calcom/README.md b/codemods-legacy/cal.com/generate-metadata-tests-calcom/README.md similarity index 100% rename from codemods/cal.com/generate-metadata-tests-calcom/README.md rename to codemods-legacy/cal.com/generate-metadata-tests-calcom/README.md diff --git a/codemods-legacy/cal.com/generate-metadata-tests-calcom/package.json b/codemods-legacy/cal.com/generate-metadata-tests-calcom/package.json new file mode 100644 index 00000000..e28d1644 --- /dev/null +++ b/codemods-legacy/cal.com/generate-metadata-tests-calcom/package.json @@ -0,0 +1,26 @@ +{ + "name": "@codemod-com/codemod-cal.com-generate-metadata-tests-calcom", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/filemod": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "memfs": "^4.6.0", + "ts-morph": "^19.0.0", + "jscodeshift": "^0.15.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/cal.com/generate-metadata-tests-calcom/src/index.ts b/codemods-legacy/cal.com/generate-metadata-tests-calcom/src/index.ts similarity index 100% rename from codemods/cal.com/generate-metadata-tests-calcom/src/index.ts rename to codemods-legacy/cal.com/generate-metadata-tests-calcom/src/index.ts diff --git a/codemods-legacy/cal.com/generate-metadata-tests-calcom/test/test.ts b/codemods-legacy/cal.com/generate-metadata-tests-calcom/test/test.ts new file mode 100644 index 00000000..069cf955 --- /dev/null +++ b/codemods-legacy/cal.com/generate-metadata-tests-calcom/test/test.ts @@ -0,0 +1,86 @@ +import { deepStrictEqual } from "node:assert"; +import { describe, it } from "node:test"; +import { buildApi, executeFilemod } from "@codemod-com/filemod"; +import { buildPathAPI, buildUnifiedFileSystem } from "@codemod-com/utilities"; +import type { DirectoryJSON } from "memfs"; +import { Volume, createFsFromVolume } from "memfs"; +import { buildData, repomod } from "../src/index.ts"; + +const transform = async (json: DirectoryJSON) => { + const volume = Volume.fromJSON(json); + const fs = createFsFromVolume(volume); + + const unifiedFileSystem = buildUnifiedFileSystem(fs); + const pathApi = buildPathAPI("/"); + + const api = buildApi>( + unifiedFileSystem, + () => ({}), + pathApi, + ); + + return executeFilemod(api, repomod, "/", { testPath: "/opt/tests" }, {}); +}; + +type ExternalFileCommand = Awaited>[number]; + +const removeWhitespaces = ( + command: ExternalFileCommand, +): ExternalFileCommand => { + if (command.kind !== "upsertFile") { + return command; + } + + return { + ...command, + oldData: command.oldData.replace(/\s/, ""), + newData: command.newData.replace(/\s/, ""), + }; +}; + +describe("generate-metadata-tests", () => { + it("should build correct files", async () => { + const [command] = await transform({ + "/opt/project/pages/a/index.tsx": "", + }); + + const newData = buildData("a").replace(/\s/, ""); + + deepStrictEqual(removeWhitespaces(command!), { + kind: "upsertFile", + path: "/opt/tests/a.e2e.ts", + oldData: "", + newData, + }); + }); + + it("should build correct files", async () => { + const [command] = await transform({ + "/opt/project/pages/a/[b].tsx": "", + }); + + const newData = buildData("a/[b]").replace(/\s/, ""); + + deepStrictEqual(removeWhitespaces(command!), { + kind: "upsertFile", + path: "/opt/tests/a/[b].e2e.ts", + oldData: "", + newData, + }); + }); + + it("should build correct files", async () => { + const [command] = await transform({ + "/opt/project/pages/a/[b]/c.tsx": "", + }); + + const newData = buildData("a/[b]/c").replace(/\s/, ""); + + deepStrictEqual(removeWhitespaces(command!), { + kind: "upsertFile", + path: "/opt/tests/a/[b]/c.e2e.ts", + oldData: "", + newData, + }); + }); +}); diff --git a/codemods/cal.com/generate-metadata-tests-calcom/tsconfig.json b/codemods-legacy/cal.com/generate-metadata-tests-calcom/tsconfig.json similarity index 100% rename from codemods/cal.com/generate-metadata-tests-calcom/tsconfig.json rename to codemods-legacy/cal.com/generate-metadata-tests-calcom/tsconfig.json diff --git a/codemods/cal.com/generate-url-patterns/.codemodrc.json b/codemods-legacy/cal.com/generate-url-patterns/.codemodrc.json similarity index 100% rename from codemods/cal.com/generate-url-patterns/.codemodrc.json rename to codemods-legacy/cal.com/generate-url-patterns/.codemodrc.json diff --git a/codemods/cal.com/generate-url-patterns/README.md b/codemods-legacy/cal.com/generate-url-patterns/README.md similarity index 100% rename from codemods/cal.com/generate-url-patterns/README.md rename to codemods-legacy/cal.com/generate-url-patterns/README.md diff --git a/codemods-legacy/cal.com/generate-url-patterns/package.json b/codemods-legacy/cal.com/generate-url-patterns/package.json new file mode 100644 index 00000000..971e2d3c --- /dev/null +++ b/codemods-legacy/cal.com/generate-url-patterns/package.json @@ -0,0 +1,26 @@ +{ + "name": "@codemod-com/codemod-cal.com-generate-url-patterns", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@codemod-com/filemod": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "memfs": "^4.6.0", + "ts-morph": "^19.0.0", + "jscodeshift": "^0.15.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/cal.com/generate-url-patterns/src/index.ts b/codemods-legacy/cal.com/generate-url-patterns/src/index.ts similarity index 100% rename from codemods/cal.com/generate-url-patterns/src/index.ts rename to codemods-legacy/cal.com/generate-url-patterns/src/index.ts diff --git a/codemods-legacy/cal.com/generate-url-patterns/test/test.ts b/codemods-legacy/cal.com/generate-url-patterns/test/test.ts new file mode 100644 index 00000000..0c306914 --- /dev/null +++ b/codemods-legacy/cal.com/generate-url-patterns/test/test.ts @@ -0,0 +1,223 @@ +import { deepStrictEqual } from "node:assert/strict"; +import { describe, it } from "node:test"; +import { buildApi, executeFilemod } from "@codemod-com/filemod"; +import { buildPathAPI, buildUnifiedFileSystem } from "@codemod-com/utilities"; +import jscodeshift from "jscodeshift"; +import type { DirectoryJSON } from "memfs"; +import { Volume, createFsFromVolume } from "memfs"; +import { repomod } from "../src/index.ts"; + +const transform = async ( + json: DirectoryJSON, + options: { + turboPath: string; + abTestMiddlewarePath: string; + middlewarePath: string; + generateAsPageGroup?: boolean; + }, +) => { + const volume = Volume.fromJSON(json); + + const fs = createFsFromVolume(volume); + + const unifiedFileSystem = buildUnifiedFileSystem(fs); + const pathApi = buildPathAPI("/"); + + const api = buildApi<{ jscodeshift: typeof jscodeshift }>( + unifiedFileSystem, + () => ({ + jscodeshift, + }), + pathApi, + ); + + return executeFilemod(api, repomod, "/", options, {}); +}; + +type ExternalFileCommand = Awaited>[number]; + +const removeWhitespaces = ( + command: ExternalFileCommand, +): ExternalFileCommand => { + if (command.kind !== "upsertFile") { + return command; + } + + return { + ...command, + oldData: command.oldData.replace(/\s/gm, ""), + newData: command.newData.replace(/\s/gm, ""), + }; +}; + +const turboContent = JSON.stringify({ + globalEnv: ["OTHER_ENVVAR"], +}); + +const abTestMiddlewareContent = ` + import { type X } from 'y'; + const other = true; +`; +const middlewareContent = ` + export const config = { + matcher: [ + "otherPath", + ] + } +`; + +describe("generate-url-patterns", () => { + it("should build correct files", async () => { + const [turboJsonCommand, middlewareTsCommand, abTestMiddlewareTsCommand] = + await transform( + { + "/opt/project/turbo.json": turboContent, + "/opt/project/abTestMiddleware.ts": abTestMiddlewareContent, + "/opt/project/middleware.ts": middlewareContent, + "/opt/project/app/future/noSegment/page.tsx": "", + "/opt/project/app/future/dynamicSegment/[a]/page.tsx": "", + "/opt/project/app/future/dynamicSegment/[b]/[c]/page.tsx": "", + "/opt/project/app/future/catchAllDynamicSegments/[...d]/page.tsx": "", + "/opt/project/app/future/(someLayout)/optionalCatchAllDynamicSegments/[[...element]]/f/page.tsx": + "", + }, + { + turboPath: "/opt/project/turbo.json", + abTestMiddlewarePath: "/opt/project/abTestMiddleware.ts", + middlewarePath: "/opt/project/middleware.ts", + }, + ); + + const newData = JSON.stringify({ + globalEnv: [ + "APP_ROUTER_CATCHALLDYNAMICSEGMENTS_D_ENABLED", + "APP_ROUTER_DYNAMICSEGMENT_A_ENABLED", + "APP_ROUTER_DYNAMICSEGMENT_B_C_ENABLED", + "APP_ROUTER_NOSEGMENT_ENABLED", + "APP_ROUTER_OPTIONALCATCHALLDYNAMICSEGMENTS_ELEMENT_F_ENABLED", + "OTHER_ENVVAR", + ], + }); + + deepStrictEqual(removeWhitespaces(turboJsonCommand!), { + kind: "upsertFile", + path: "/opt/project/turbo.json", + oldData: turboContent, + newData, + }); + + deepStrictEqual( + removeWhitespaces(abTestMiddlewareTsCommand!), + removeWhitespaces({ + kind: "upsertFile", + path: "/opt/project/abTestMiddleware.ts", + oldData: abTestMiddlewareContent, + newData: `import { type X } from 'y'; + const other = true; + + const ROUTES: [URLPattern, boolean][] = [ + [ + "/catchAllDynamicSegments/:d+", + Boolean(process.env.APP_ROUTER_CATCHALLDYNAMICSEGMENTS_D_ENABLED) + ] as const, + [ + "/dynamicSegment/:a", + Boolean(process.env.APP_ROUTER_DYNAMICSEGMENT_A_ENABLED) + ] as const, + [ + "/dynamicSegment/:b/:c", + Boolean(process.env.APP_ROUTER_DYNAMICSEGMENT_B_C_ENABLED) + ] as const, + ["/noSegment", Boolean(process.env.APP_ROUTER_NOSEGMENT_ENABLED)] as const, + [ + "/optionalCatchAllDynamicSegments/:element*/f", + Boolean(process.env.APP_ROUTER_OPTIONALCATCHALLDYNAMICSEGMENTS_ELEMENT_F_ENABLED) + ] as const + ].map(([pathname, enabled]) => [new URLPattern({ + pathname + }), enabled]); +`, + }), + ); + + deepStrictEqual( + removeWhitespaces(middlewareTsCommand!), + removeWhitespaces({ + kind: "upsertFile", + path: "/opt/project/middleware.ts", + oldData: middlewareContent, + newData: ` + export const config = { + matcher: [ + "otherPath", + "/noSegment", + "/future/noSegment/", + + "/dynamicSegment/:a", + "/future/dynamicSegment/:a/", + + "/catchAllDynamicSegments/:d+", + "/future/catchAllDynamicSegments/:d+/", + + "/dynamicSegment/:b/:c", + "/future/dynamicSegment/:b/:c/", + + "/optionalCatchAllDynamicSegments/:element*/f", + "/future/optionalCatchAllDynamicSegments/:element*/f/" + ] + } + `, + }), + ); + }); + + it("should support generateAsPageGroup option", async () => { + const [turboJsonCommand, abTestMiddlewareTsCommand] = await transform( + { + "/opt/project/turbo.json": turboContent, + "/opt/project/abTestMiddleware.ts": abTestMiddlewareContent, + "/opt/project/app/future/top-level/page.tsx": "", + "/opt/project/app/future/top-level/a/page.tsx": "", + "/opt/project/app/future/top-level/b/page.tsx": "", + "/opt/project/app/future/top-level/a/b/page.tsx": "", + }, + { + turboPath: "/opt/project/turbo.json", + abTestMiddlewarePath: "/opt/project/abTestMiddleware.ts", + middlewarePath: "/opt/project/middleware.ts", + generateAsPageGroup: true, + }, + ); + + const newData = JSON.stringify({ + globalEnv: ["APP_ROUTER_TOP_LEVEL_ENABLED", "OTHER_ENVVAR"], + }); + + deepStrictEqual(removeWhitespaces(turboJsonCommand!), { + kind: "upsertFile", + path: "/opt/project/turbo.json", + oldData: turboContent, + newData, + }); + + deepStrictEqual( + removeWhitespaces(abTestMiddlewareTsCommand!), + removeWhitespaces({ + kind: "upsertFile", + path: "/opt/project/abTestMiddleware.ts", + oldData: abTestMiddlewareContent, + newData: `import { type X } from 'y'; + const other = true; + + const ROUTES: [URLPattern, boolean][] = [ + [ + "/top-level/:path*", + Boolean(process.env.APP_ROUTER_TOP_LEVEL_ENABLED) + ] as const + ].map(([pathname, enabled]) => [new URLPattern({ + pathname + }), enabled]);`, + }), + ); + }); +}); diff --git a/codemods/cal.com/generate-url-patterns/tsconfig.json b/codemods-legacy/cal.com/generate-url-patterns/tsconfig.json similarity index 100% rename from codemods/cal.com/generate-url-patterns/tsconfig.json rename to codemods-legacy/cal.com/generate-url-patterns/tsconfig.json diff --git a/codemods/codemod-com/migrate-codemod-registry/.codemodrc.json b/codemods-legacy/codemod-com/migrate-codemod-registry/.codemodrc.json similarity index 100% rename from codemods/codemod-com/migrate-codemod-registry/.codemodrc.json rename to codemods-legacy/codemod-com/migrate-codemod-registry/.codemodrc.json diff --git a/codemods/codemod-com/migrate-codemod-registry/README.md b/codemods-legacy/codemod-com/migrate-codemod-registry/README.md similarity index 100% rename from codemods/codemod-com/migrate-codemod-registry/README.md rename to codemods-legacy/codemod-com/migrate-codemod-registry/README.md diff --git a/codemods-legacy/codemod-com/migrate-codemod-registry/package.json b/codemods-legacy/codemod-com/migrate-codemod-registry/package.json new file mode 100644 index 00000000..72c1f285 --- /dev/null +++ b/codemods-legacy/codemod-com/migrate-codemod-registry/package.json @@ -0,0 +1,21 @@ +{ + "name": "@codemod-com/codemod-migrate-codemod-registry", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "@codemod-com/filemod": "workspace:*", + "memfs": "^4.6.0", + "ts-morph": "^19.0.0", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/codemod-com/migrate-codemod-registry/src/index.ts b/codemods-legacy/codemod-com/migrate-codemod-registry/src/index.ts similarity index 100% rename from codemods/codemod-com/migrate-codemod-registry/src/index.ts rename to codemods-legacy/codemod-com/migrate-codemod-registry/src/index.ts diff --git a/codemods/codemod-com/migrate-codemod-registry/tsconfig.json b/codemods-legacy/codemod-com/migrate-codemod-registry/tsconfig.json similarity index 100% rename from codemods/codemod-com/migrate-codemod-registry/tsconfig.json rename to codemods-legacy/codemod-com/migrate-codemod-registry/tsconfig.json diff --git a/codemods/devcycle/launchdarkly-to-devcycle/.codemodrc.json b/codemods-legacy/devcycle/launchdarkly-to-devcycle/.codemodrc.json similarity index 100% rename from codemods/devcycle/launchdarkly-to-devcycle/.codemodrc.json rename to codemods-legacy/devcycle/launchdarkly-to-devcycle/.codemodrc.json diff --git a/codemods/devcycle/launchdarkly-to-devcycle/.gitignore b/codemods-legacy/devcycle/launchdarkly-to-devcycle/.gitignore similarity index 100% rename from codemods/devcycle/launchdarkly-to-devcycle/.gitignore rename to codemods-legacy/devcycle/launchdarkly-to-devcycle/.gitignore diff --git a/codemods/devcycle/launchdarkly-to-devcycle/LICENSE b/codemods-legacy/devcycle/launchdarkly-to-devcycle/LICENSE similarity index 100% rename from codemods/devcycle/launchdarkly-to-devcycle/LICENSE rename to codemods-legacy/devcycle/launchdarkly-to-devcycle/LICENSE diff --git a/codemods/devcycle/launchdarkly-to-devcycle/README.md b/codemods-legacy/devcycle/launchdarkly-to-devcycle/README.md similarity index 100% rename from codemods/devcycle/launchdarkly-to-devcycle/README.md rename to codemods-legacy/devcycle/launchdarkly-to-devcycle/README.md diff --git a/codemods/devcycle/launchdarkly-to-devcycle/__testfixtures__/useFlags.input.ts b/codemods-legacy/devcycle/launchdarkly-to-devcycle/__testfixtures__/useFlags.input.ts similarity index 100% rename from codemods/devcycle/launchdarkly-to-devcycle/__testfixtures__/useFlags.input.ts rename to codemods-legacy/devcycle/launchdarkly-to-devcycle/__testfixtures__/useFlags.input.ts diff --git a/codemods/devcycle/launchdarkly-to-devcycle/__testfixtures__/useFlags.output.ts b/codemods-legacy/devcycle/launchdarkly-to-devcycle/__testfixtures__/useFlags.output.ts similarity index 100% rename from codemods/devcycle/launchdarkly-to-devcycle/__testfixtures__/useFlags.output.ts rename to codemods-legacy/devcycle/launchdarkly-to-devcycle/__testfixtures__/useFlags.output.ts diff --git a/codemods/devcycle/launchdarkly-to-devcycle/__testfixtures__/withLDProvider.input.ts b/codemods-legacy/devcycle/launchdarkly-to-devcycle/__testfixtures__/withLDProvider.input.ts similarity index 100% rename from codemods/devcycle/launchdarkly-to-devcycle/__testfixtures__/withLDProvider.input.ts rename to codemods-legacy/devcycle/launchdarkly-to-devcycle/__testfixtures__/withLDProvider.input.ts diff --git a/codemods/devcycle/launchdarkly-to-devcycle/__testfixtures__/withLDProvider.output.ts b/codemods-legacy/devcycle/launchdarkly-to-devcycle/__testfixtures__/withLDProvider.output.ts similarity index 100% rename from codemods/devcycle/launchdarkly-to-devcycle/__testfixtures__/withLDProvider.output.ts rename to codemods-legacy/devcycle/launchdarkly-to-devcycle/__testfixtures__/withLDProvider.output.ts diff --git a/codemods-legacy/devcycle/launchdarkly-to-devcycle/package.json b/codemods-legacy/devcycle/launchdarkly-to-devcycle/package.json new file mode 100644 index 00000000..4251303d --- /dev/null +++ b/codemods-legacy/devcycle/launchdarkly-to-devcycle/package.json @@ -0,0 +1,23 @@ +{ + "name": "launchdarkly-to-devcycle", + "author": "dmytrohryshyn", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "5.2.2", + "jscodeshift": "^0.15.1" + }, + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "license": "MIT", + "files": [ + "README.md", + ".codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/devcycle/launchdarkly-to-devcycle/src/index.ts b/codemods-legacy/devcycle/launchdarkly-to-devcycle/src/index.ts similarity index 100% rename from codemods/devcycle/launchdarkly-to-devcycle/src/index.ts rename to codemods-legacy/devcycle/launchdarkly-to-devcycle/src/index.ts diff --git a/codemods-legacy/devcycle/launchdarkly-to-devcycle/test/test.ts b/codemods-legacy/devcycle/launchdarkly-to-devcycle/test/test.ts new file mode 100644 index 00000000..270461c1 --- /dev/null +++ b/codemods-legacy/devcycle/launchdarkly-to-devcycle/test/test.ts @@ -0,0 +1,74 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; +import { readFile } from "node:fs/promises"; +import { join } from "node:path"; +import jscodeshift from "jscodeshift"; +import type { API } from "jscodeshift"; +import transform from "../src/index.ts"; + +const __dirname = new URL(".", import.meta.url).pathname; + +const buildApi = (parser: string | undefined): API => ({ + j: parser ? jscodeshift.withParser(parser) : jscodeshift, + jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, + stats: () => { + console.error( + "The stats function was called, which is not supported on purpose", + ); + }, + report: () => { + console.error( + "The report function was called, which is not supported on purpose", + ); + }, +}); + +describe("launchdarkly-to-devcycle", () => { + it("Should replace withLDProvider HOC", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/withLDProvider.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/withLDProvider.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); + + it("Should replace useFlags hook", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/useFlags.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/useFlags.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); +}); diff --git a/codemods-legacy/devcycle/launchdarkly-to-devcycle/tsconfig.json b/codemods-legacy/devcycle/launchdarkly-to-devcycle/tsconfig.json new file mode 100644 index 00000000..2562479f --- /dev/null +++ b/codemods-legacy/devcycle/launchdarkly-to-devcycle/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@codemod-com/tsconfig/codemod.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "./dist" + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"], +} diff --git a/codemods/devcycle/replace-feature-flag/.codemodrc.json b/codemods-legacy/devcycle/replace-feature-flag/.codemodrc.json similarity index 100% rename from codemods/devcycle/replace-feature-flag/.codemodrc.json rename to codemods-legacy/devcycle/replace-feature-flag/.codemodrc.json diff --git a/codemods/devcycle/replace-feature-flag/.gitignore b/codemods-legacy/devcycle/replace-feature-flag/.gitignore similarity index 100% rename from codemods/devcycle/replace-feature-flag/.gitignore rename to codemods-legacy/devcycle/replace-feature-flag/.gitignore diff --git a/codemods/devcycle/replace-feature-flag/LICENSE b/codemods-legacy/devcycle/replace-feature-flag/LICENSE similarity index 100% rename from codemods/devcycle/replace-feature-flag/LICENSE rename to codemods-legacy/devcycle/replace-feature-flag/LICENSE diff --git a/codemods/devcycle/replace-feature-flag/README.md b/codemods-legacy/devcycle/replace-feature-flag/README.md similarity index 100% rename from codemods/devcycle/replace-feature-flag/README.md rename to codemods-legacy/devcycle/replace-feature-flag/README.md diff --git a/codemods/devcycle/replace-feature-flag/__testfixtures__/devcycle.input.js b/codemods-legacy/devcycle/replace-feature-flag/__testfixtures__/devcycle.input.js similarity index 100% rename from codemods/devcycle/replace-feature-flag/__testfixtures__/devcycle.input.js rename to codemods-legacy/devcycle/replace-feature-flag/__testfixtures__/devcycle.input.js diff --git a/codemods/devcycle/replace-feature-flag/__testfixtures__/devcycle.output.js b/codemods-legacy/devcycle/replace-feature-flag/__testfixtures__/devcycle.output.js similarity index 100% rename from codemods/devcycle/replace-feature-flag/__testfixtures__/devcycle.output.js rename to codemods-legacy/devcycle/replace-feature-flag/__testfixtures__/devcycle.output.js diff --git a/codemods/devcycle/replace-feature-flag/__testfixtures__/object.input.js b/codemods-legacy/devcycle/replace-feature-flag/__testfixtures__/object.input.js similarity index 100% rename from codemods/devcycle/replace-feature-flag/__testfixtures__/object.input.js rename to codemods-legacy/devcycle/replace-feature-flag/__testfixtures__/object.input.js diff --git a/codemods/devcycle/replace-feature-flag/__testfixtures__/object.output.js b/codemods-legacy/devcycle/replace-feature-flag/__testfixtures__/object.output.js similarity index 100% rename from codemods/devcycle/replace-feature-flag/__testfixtures__/object.output.js rename to codemods-legacy/devcycle/replace-feature-flag/__testfixtures__/object.output.js diff --git a/codemods-legacy/devcycle/replace-feature-flag/package.json b/codemods-legacy/devcycle/replace-feature-flag/package.json new file mode 100644 index 00000000..4490a241 --- /dev/null +++ b/codemods-legacy/devcycle/replace-feature-flag/package.json @@ -0,0 +1,23 @@ +{ + "name": "devcycle/replace-feature-flag", + "author": "dmytrohryshyn", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "5.2.2", + "vitest": "^1.0.1", + "ts-morph": "^22.0.0" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "license": "MIT", + "files": [ + "README.md", + ".codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/devcycle/replace-feature-flag/src/index.ts b/codemods-legacy/devcycle/replace-feature-flag/src/index.ts similarity index 100% rename from codemods/devcycle/replace-feature-flag/src/index.ts rename to codemods-legacy/devcycle/replace-feature-flag/src/index.ts diff --git a/codemods/devcycle/replace-feature-flag/test/test.ts b/codemods-legacy/devcycle/replace-feature-flag/test/test.ts similarity index 100% rename from codemods/devcycle/replace-feature-flag/test/test.ts rename to codemods-legacy/devcycle/replace-feature-flag/test/test.ts diff --git a/codemods-legacy/devcycle/replace-feature-flag/tsconfig.json b/codemods-legacy/devcycle/replace-feature-flag/tsconfig.json new file mode 100644 index 00000000..36bd1c7d --- /dev/null +++ b/codemods-legacy/devcycle/replace-feature-flag/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@codemod-com/tsconfig/codemod.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "./dist" + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/devcycle/replace-feature-flag/vitest.config.ts b/codemods-legacy/devcycle/replace-feature-flag/vitest.config.ts similarity index 100% rename from codemods/devcycle/replace-feature-flag/vitest.config.ts rename to codemods-legacy/devcycle/replace-feature-flag/vitest.config.ts diff --git a/codemods/ember/5/app-controller-router-props/.codemodrc.json b/codemods-legacy/ember/5/app-controller-router-props/.codemodrc.json similarity index 100% rename from codemods/ember/5/app-controller-router-props/.codemodrc.json rename to codemods-legacy/ember/5/app-controller-router-props/.codemodrc.json diff --git a/codemods/ember/5/app-controller-router-props/README.md b/codemods-legacy/ember/5/app-controller-router-props/README.md similarity index 100% rename from codemods/ember/5/app-controller-router-props/README.md rename to codemods-legacy/ember/5/app-controller-router-props/README.md diff --git a/codemods-legacy/ember/5/app-controller-router-props/package.json b/codemods-legacy/ember/5/app-controller-router-props/package.json new file mode 100644 index 00000000..c729b141 --- /dev/null +++ b/codemods-legacy/ember/5/app-controller-router-props/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-ember-5-app-controller-router-props", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/ember/5/app-controller-router-props/src/index.js b/codemods-legacy/ember/5/app-controller-router-props/src/index.js similarity index 100% rename from codemods/ember/5/app-controller-router-props/src/index.js rename to codemods-legacy/ember/5/app-controller-router-props/src/index.js diff --git a/codemods/ember/5/app-controller-router-props/test/test.ts b/codemods-legacy/ember/5/app-controller-router-props/test/test.ts similarity index 100% rename from codemods/ember/5/app-controller-router-props/test/test.ts rename to codemods-legacy/ember/5/app-controller-router-props/test/test.ts diff --git a/codemods/ember/5/app-controller-router-props/tsconfig.json b/codemods-legacy/ember/5/app-controller-router-props/tsconfig.json similarity index 100% rename from codemods/ember/5/app-controller-router-props/tsconfig.json rename to codemods-legacy/ember/5/app-controller-router-props/tsconfig.json diff --git a/codemods/ethers/v6/big-numbers/vitest.config.ts b/codemods-legacy/ember/5/app-controller-router-props/vitest.config.ts similarity index 100% rename from codemods/ethers/v6/big-numbers/vitest.config.ts rename to codemods-legacy/ember/5/app-controller-router-props/vitest.config.ts diff --git a/codemods/ember/5/array-wrapper/.codemodrc.json b/codemods-legacy/ember/5/array-wrapper/.codemodrc.json similarity index 100% rename from codemods/ember/5/array-wrapper/.codemodrc.json rename to codemods-legacy/ember/5/array-wrapper/.codemodrc.json diff --git a/codemods/ember/5/array-wrapper/README.md b/codemods-legacy/ember/5/array-wrapper/README.md similarity index 100% rename from codemods/ember/5/array-wrapper/README.md rename to codemods-legacy/ember/5/array-wrapper/README.md diff --git a/codemods-legacy/ember/5/array-wrapper/package.json b/codemods-legacy/ember/5/array-wrapper/package.json new file mode 100644 index 00000000..965cd424 --- /dev/null +++ b/codemods-legacy/ember/5/array-wrapper/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-ember-5-array-wrapper", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/ember/5/array-wrapper/src/index.js b/codemods-legacy/ember/5/array-wrapper/src/index.js similarity index 100% rename from codemods/ember/5/array-wrapper/src/index.js rename to codemods-legacy/ember/5/array-wrapper/src/index.js diff --git a/codemods/ember/5/array-wrapper/test/test.ts b/codemods-legacy/ember/5/array-wrapper/test/test.ts similarity index 100% rename from codemods/ember/5/array-wrapper/test/test.ts rename to codemods-legacy/ember/5/array-wrapper/test/test.ts diff --git a/codemods/ember/5/array-wrapper/tsconfig.json b/codemods-legacy/ember/5/array-wrapper/tsconfig.json similarity index 100% rename from codemods/ember/5/array-wrapper/tsconfig.json rename to codemods-legacy/ember/5/array-wrapper/tsconfig.json diff --git a/codemods/ethers/v6/contracts-ambiguous-methods/vitest.config.ts b/codemods-legacy/ember/5/array-wrapper/vitest.config.ts similarity index 100% rename from codemods/ethers/v6/contracts-ambiguous-methods/vitest.config.ts rename to codemods-legacy/ember/5/array-wrapper/vitest.config.ts diff --git a/codemods/ember/5/convert-module-for-to-setup-test/.codemodrc.json b/codemods-legacy/ember/5/convert-module-for-to-setup-test/.codemodrc.json similarity index 100% rename from codemods/ember/5/convert-module-for-to-setup-test/.codemodrc.json rename to codemods-legacy/ember/5/convert-module-for-to-setup-test/.codemodrc.json diff --git a/codemods/ember/5/convert-module-for-to-setup-test/README.md b/codemods-legacy/ember/5/convert-module-for-to-setup-test/README.md similarity index 100% rename from codemods/ember/5/convert-module-for-to-setup-test/README.md rename to codemods-legacy/ember/5/convert-module-for-to-setup-test/README.md diff --git a/codemods-legacy/ember/5/convert-module-for-to-setup-test/package.json b/codemods-legacy/ember/5/convert-module-for-to-setup-test/package.json new file mode 100644 index 00000000..3e315376 --- /dev/null +++ b/codemods-legacy/ember/5/convert-module-for-to-setup-test/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-ember-5-convert-module-for-to-setup-test", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/ember/5/convert-module-for-to-setup-test/src/index.js b/codemods-legacy/ember/5/convert-module-for-to-setup-test/src/index.js similarity index 100% rename from codemods/ember/5/convert-module-for-to-setup-test/src/index.js rename to codemods-legacy/ember/5/convert-module-for-to-setup-test/src/index.js diff --git a/codemods/ember/5/convert-module-for-to-setup-test/test/test.ts b/codemods-legacy/ember/5/convert-module-for-to-setup-test/test/test.ts similarity index 100% rename from codemods/ember/5/convert-module-for-to-setup-test/test/test.ts rename to codemods-legacy/ember/5/convert-module-for-to-setup-test/test/test.ts diff --git a/codemods/ember/5/convert-module-for-to-setup-test/tsconfig.json b/codemods-legacy/ember/5/convert-module-for-to-setup-test/tsconfig.json similarity index 100% rename from codemods/ember/5/convert-module-for-to-setup-test/tsconfig.json rename to codemods-legacy/ember/5/convert-module-for-to-setup-test/tsconfig.json diff --git a/codemods/ethers/v6/contracts-other-methods/vitest.config.ts b/codemods-legacy/ember/5/convert-module-for-to-setup-test/vitest.config.ts similarity index 100% rename from codemods/ethers/v6/contracts-other-methods/vitest.config.ts rename to codemods-legacy/ember/5/convert-module-for-to-setup-test/vitest.config.ts diff --git a/codemods/ember/5/cp-property-map/.codemodrc.json b/codemods-legacy/ember/5/cp-property-map/.codemodrc.json similarity index 100% rename from codemods/ember/5/cp-property-map/.codemodrc.json rename to codemods-legacy/ember/5/cp-property-map/.codemodrc.json diff --git a/codemods/ember/5/cp-property-map/README.md b/codemods-legacy/ember/5/cp-property-map/README.md similarity index 100% rename from codemods/ember/5/cp-property-map/README.md rename to codemods-legacy/ember/5/cp-property-map/README.md diff --git a/codemods-legacy/ember/5/cp-property-map/package.json b/codemods-legacy/ember/5/cp-property-map/package.json new file mode 100644 index 00000000..a82dfc61 --- /dev/null +++ b/codemods-legacy/ember/5/cp-property-map/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-ember-5-cp-property-map", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/ember/5/cp-property-map/src/index.js b/codemods-legacy/ember/5/cp-property-map/src/index.js similarity index 100% rename from codemods/ember/5/cp-property-map/src/index.js rename to codemods-legacy/ember/5/cp-property-map/src/index.js diff --git a/codemods/ember/5/cp-property-map/test/test.ts b/codemods-legacy/ember/5/cp-property-map/test/test.ts similarity index 100% rename from codemods/ember/5/cp-property-map/test/test.ts rename to codemods-legacy/ember/5/cp-property-map/test/test.ts diff --git a/codemods/ember/5/cp-property-map/tsconfig.json b/codemods-legacy/ember/5/cp-property-map/tsconfig.json similarity index 100% rename from codemods/ember/5/cp-property-map/tsconfig.json rename to codemods-legacy/ember/5/cp-property-map/tsconfig.json diff --git a/codemods/ethers/v6/importing/vitest.config.ts b/codemods-legacy/ember/5/cp-property-map/vitest.config.ts similarity index 100% rename from codemods/ethers/v6/importing/vitest.config.ts rename to codemods-legacy/ember/5/cp-property-map/vitest.config.ts diff --git a/codemods/ember/5/cp-property/.codemodrc.json b/codemods-legacy/ember/5/cp-property/.codemodrc.json similarity index 100% rename from codemods/ember/5/cp-property/.codemodrc.json rename to codemods-legacy/ember/5/cp-property/.codemodrc.json diff --git a/codemods/ember/5/cp-property/README.md b/codemods-legacy/ember/5/cp-property/README.md similarity index 100% rename from codemods/ember/5/cp-property/README.md rename to codemods-legacy/ember/5/cp-property/README.md diff --git a/codemods-legacy/ember/5/cp-property/package.json b/codemods-legacy/ember/5/cp-property/package.json new file mode 100644 index 00000000..a05d9e5c --- /dev/null +++ b/codemods-legacy/ember/5/cp-property/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-ember-5-cp-property", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/ember/5/cp-property/src/index.js b/codemods-legacy/ember/5/cp-property/src/index.js similarity index 100% rename from codemods/ember/5/cp-property/src/index.js rename to codemods-legacy/ember/5/cp-property/src/index.js diff --git a/codemods/ember/5/cp-property/test/test.ts b/codemods-legacy/ember/5/cp-property/test/test.ts similarity index 100% rename from codemods/ember/5/cp-property/test/test.ts rename to codemods-legacy/ember/5/cp-property/test/test.ts diff --git a/codemods/ember/5/cp-property/tsconfig.json b/codemods-legacy/ember/5/cp-property/tsconfig.json similarity index 100% rename from codemods/ember/5/cp-property/tsconfig.json rename to codemods-legacy/ember/5/cp-property/tsconfig.json diff --git a/codemods/ethers/v6/providers/vitest.config.ts b/codemods-legacy/ember/5/cp-property/vitest.config.ts similarity index 100% rename from codemods/ethers/v6/providers/vitest.config.ts rename to codemods-legacy/ember/5/cp-property/vitest.config.ts diff --git a/codemods/ember/5/cp-volatile/.codemodrc.json b/codemods-legacy/ember/5/cp-volatile/.codemodrc.json similarity index 100% rename from codemods/ember/5/cp-volatile/.codemodrc.json rename to codemods-legacy/ember/5/cp-volatile/.codemodrc.json diff --git a/codemods/ember/5/cp-volatile/README.md b/codemods-legacy/ember/5/cp-volatile/README.md similarity index 100% rename from codemods/ember/5/cp-volatile/README.md rename to codemods-legacy/ember/5/cp-volatile/README.md diff --git a/codemods-legacy/ember/5/cp-volatile/package.json b/codemods-legacy/ember/5/cp-volatile/package.json new file mode 100644 index 00000000..841a2d84 --- /dev/null +++ b/codemods-legacy/ember/5/cp-volatile/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-ember-5-cp-volatile", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/ember/5/cp-volatile/src/index.js b/codemods-legacy/ember/5/cp-volatile/src/index.js similarity index 100% rename from codemods/ember/5/cp-volatile/src/index.js rename to codemods-legacy/ember/5/cp-volatile/src/index.js diff --git a/codemods/ember/5/cp-volatile/test/test.ts b/codemods-legacy/ember/5/cp-volatile/test/test.ts similarity index 100% rename from codemods/ember/5/cp-volatile/test/test.ts rename to codemods-legacy/ember/5/cp-volatile/test/test.ts diff --git a/codemods/ember/5/cp-volatile/tsconfig.json b/codemods-legacy/ember/5/cp-volatile/tsconfig.json similarity index 100% rename from codemods/ember/5/cp-volatile/tsconfig.json rename to codemods-legacy/ember/5/cp-volatile/tsconfig.json diff --git a/codemods/ethers/v6/singatures/vitest.config.ts b/codemods-legacy/ember/5/cp-volatile/vitest.config.ts similarity index 100% rename from codemods/ethers/v6/singatures/vitest.config.ts rename to codemods-legacy/ember/5/cp-volatile/vitest.config.ts diff --git a/codemods/ember/5/deprecate-merge/.codemodrc.json b/codemods-legacy/ember/5/deprecate-merge/.codemodrc.json similarity index 100% rename from codemods/ember/5/deprecate-merge/.codemodrc.json rename to codemods-legacy/ember/5/deprecate-merge/.codemodrc.json diff --git a/codemods/ember/5/deprecate-merge/README.md b/codemods-legacy/ember/5/deprecate-merge/README.md similarity index 100% rename from codemods/ember/5/deprecate-merge/README.md rename to codemods-legacy/ember/5/deprecate-merge/README.md diff --git a/codemods-legacy/ember/5/deprecate-merge/package.json b/codemods-legacy/ember/5/deprecate-merge/package.json new file mode 100644 index 00000000..c3c34607 --- /dev/null +++ b/codemods-legacy/ember/5/deprecate-merge/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-ember-5-deprecate-merge", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/ember/5/deprecate-merge/src/index.js b/codemods-legacy/ember/5/deprecate-merge/src/index.js similarity index 100% rename from codemods/ember/5/deprecate-merge/src/index.js rename to codemods-legacy/ember/5/deprecate-merge/src/index.js diff --git a/codemods/ember/5/deprecate-merge/test/test.ts b/codemods-legacy/ember/5/deprecate-merge/test/test.ts similarity index 100% rename from codemods/ember/5/deprecate-merge/test/test.ts rename to codemods-legacy/ember/5/deprecate-merge/test/test.ts diff --git a/codemods/ember/5/deprecate-merge/tsconfig.json b/codemods-legacy/ember/5/deprecate-merge/tsconfig.json similarity index 100% rename from codemods/ember/5/deprecate-merge/tsconfig.json rename to codemods-legacy/ember/5/deprecate-merge/tsconfig.json diff --git a/codemods/ethers/v6/transactions/vitest.config.ts b/codemods-legacy/ember/5/deprecate-merge/vitest.config.ts similarity index 100% rename from codemods/ethers/v6/transactions/vitest.config.ts rename to codemods-legacy/ember/5/deprecate-merge/vitest.config.ts diff --git a/codemods/ember/5/deprecate-router-events/.codemodrc.json b/codemods-legacy/ember/5/deprecate-router-events/.codemodrc.json similarity index 100% rename from codemods/ember/5/deprecate-router-events/.codemodrc.json rename to codemods-legacy/ember/5/deprecate-router-events/.codemodrc.json diff --git a/codemods/ember/5/deprecate-router-events/README.md b/codemods-legacy/ember/5/deprecate-router-events/README.md similarity index 100% rename from codemods/ember/5/deprecate-router-events/README.md rename to codemods-legacy/ember/5/deprecate-router-events/README.md diff --git a/codemods-legacy/ember/5/deprecate-router-events/package.json b/codemods-legacy/ember/5/deprecate-router-events/package.json new file mode 100644 index 00000000..4402e796 --- /dev/null +++ b/codemods-legacy/ember/5/deprecate-router-events/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-ember-5-deprecate-router-events", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/ember/5/deprecate-router-events/src/index.js b/codemods-legacy/ember/5/deprecate-router-events/src/index.js similarity index 100% rename from codemods/ember/5/deprecate-router-events/src/index.js rename to codemods-legacy/ember/5/deprecate-router-events/src/index.js diff --git a/codemods/ember/5/deprecate-router-events/test/test.ts b/codemods-legacy/ember/5/deprecate-router-events/test/test.ts similarity index 100% rename from codemods/ember/5/deprecate-router-events/test/test.ts rename to codemods-legacy/ember/5/deprecate-router-events/test/test.ts diff --git a/codemods/ember/5/deprecate-router-events/tsconfig.json b/codemods-legacy/ember/5/deprecate-router-events/tsconfig.json similarity index 100% rename from codemods/ember/5/deprecate-router-events/tsconfig.json rename to codemods-legacy/ember/5/deprecate-router-events/tsconfig.json diff --git a/codemods/ethers/v6/utilities/vitest.config.ts b/codemods-legacy/ember/5/deprecate-router-events/vitest.config.ts similarity index 100% rename from codemods/ethers/v6/utilities/vitest.config.ts rename to codemods-legacy/ember/5/deprecate-router-events/vitest.config.ts diff --git a/codemods/ember/5/ember-jquery-legacy/.codemodrc.json b/codemods-legacy/ember/5/ember-jquery-legacy/.codemodrc.json similarity index 100% rename from codemods/ember/5/ember-jquery-legacy/.codemodrc.json rename to codemods-legacy/ember/5/ember-jquery-legacy/.codemodrc.json diff --git a/codemods/ember/5/ember-jquery-legacy/README.md b/codemods-legacy/ember/5/ember-jquery-legacy/README.md similarity index 100% rename from codemods/ember/5/ember-jquery-legacy/README.md rename to codemods-legacy/ember/5/ember-jquery-legacy/README.md diff --git a/codemods-legacy/ember/5/ember-jquery-legacy/package.json b/codemods-legacy/ember/5/ember-jquery-legacy/package.json new file mode 100644 index 00000000..6fb126ce --- /dev/null +++ b/codemods-legacy/ember/5/ember-jquery-legacy/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-ember-5-ember-jquery-legacy", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/ember/5/ember-jquery-legacy/src/index.js b/codemods-legacy/ember/5/ember-jquery-legacy/src/index.js similarity index 100% rename from codemods/ember/5/ember-jquery-legacy/src/index.js rename to codemods-legacy/ember/5/ember-jquery-legacy/src/index.js diff --git a/codemods/ember/5/ember-jquery-legacy/test/test.ts b/codemods-legacy/ember/5/ember-jquery-legacy/test/test.ts similarity index 100% rename from codemods/ember/5/ember-jquery-legacy/test/test.ts rename to codemods-legacy/ember/5/ember-jquery-legacy/test/test.ts diff --git a/codemods/ember/5/ember-jquery-legacy/tsconfig.json b/codemods-legacy/ember/5/ember-jquery-legacy/tsconfig.json similarity index 100% rename from codemods/ember/5/ember-jquery-legacy/tsconfig.json rename to codemods-legacy/ember/5/ember-jquery-legacy/tsconfig.json diff --git a/codemods/jasmine/5.0/handling_env-execute/vitest.config.ts b/codemods-legacy/ember/5/ember-jquery-legacy/vitest.config.ts similarity index 100% rename from codemods/jasmine/5.0/handling_env-execute/vitest.config.ts rename to codemods-legacy/ember/5/ember-jquery-legacy/vitest.config.ts diff --git a/codemods/ember/5/es5-getter-ember-codemod/.codemodrc.json b/codemods-legacy/ember/5/es5-getter-ember-codemod/.codemodrc.json similarity index 100% rename from codemods/ember/5/es5-getter-ember-codemod/.codemodrc.json rename to codemods-legacy/ember/5/es5-getter-ember-codemod/.codemodrc.json diff --git a/codemods/ember/5/es5-getter-ember-codemod/README.md b/codemods-legacy/ember/5/es5-getter-ember-codemod/README.md similarity index 100% rename from codemods/ember/5/es5-getter-ember-codemod/README.md rename to codemods-legacy/ember/5/es5-getter-ember-codemod/README.md diff --git a/codemods-legacy/ember/5/es5-getter-ember-codemod/package.json b/codemods-legacy/ember/5/es5-getter-ember-codemod/package.json new file mode 100644 index 00000000..0a8aa8f3 --- /dev/null +++ b/codemods-legacy/ember/5/es5-getter-ember-codemod/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-ember-5-es5-getter-ember-codemod", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/ember/5/es5-getter-ember-codemod/src/index.js b/codemods-legacy/ember/5/es5-getter-ember-codemod/src/index.js similarity index 100% rename from codemods/ember/5/es5-getter-ember-codemod/src/index.js rename to codemods-legacy/ember/5/es5-getter-ember-codemod/src/index.js diff --git a/codemods/ember/5/es5-getter-ember-codemod/test/test.ts b/codemods-legacy/ember/5/es5-getter-ember-codemod/test/test.ts similarity index 100% rename from codemods/ember/5/es5-getter-ember-codemod/test/test.ts rename to codemods-legacy/ember/5/es5-getter-ember-codemod/test/test.ts diff --git a/codemods/ember/5/es5-getter-ember-codemod/tsconfig.json b/codemods-legacy/ember/5/es5-getter-ember-codemod/tsconfig.json similarity index 100% rename from codemods/ember/5/es5-getter-ember-codemod/tsconfig.json rename to codemods-legacy/ember/5/es5-getter-ember-codemod/tsconfig.json diff --git a/codemods/jasmine/5.0/node-boot-removal/vitest.config.ts b/codemods-legacy/ember/5/es5-getter-ember-codemod/vitest.config.ts similarity index 100% rename from codemods/jasmine/5.0/node-boot-removal/vitest.config.ts rename to codemods-legacy/ember/5/es5-getter-ember-codemod/vitest.config.ts diff --git a/codemods/ember/5/fpe-computed/.codemodrc.json b/codemods-legacy/ember/5/fpe-computed/.codemodrc.json similarity index 100% rename from codemods/ember/5/fpe-computed/.codemodrc.json rename to codemods-legacy/ember/5/fpe-computed/.codemodrc.json diff --git a/codemods/ember/5/fpe-computed/README.md b/codemods-legacy/ember/5/fpe-computed/README.md similarity index 100% rename from codemods/ember/5/fpe-computed/README.md rename to codemods-legacy/ember/5/fpe-computed/README.md diff --git a/codemods-legacy/ember/5/fpe-computed/package.json b/codemods-legacy/ember/5/fpe-computed/package.json new file mode 100644 index 00000000..5187f7c1 --- /dev/null +++ b/codemods-legacy/ember/5/fpe-computed/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-ember-5-fpe-computed", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/ember/5/fpe-computed/src/index.js b/codemods-legacy/ember/5/fpe-computed/src/index.js similarity index 100% rename from codemods/ember/5/fpe-computed/src/index.js rename to codemods-legacy/ember/5/fpe-computed/src/index.js diff --git a/codemods/ember/5/fpe-computed/test/test.ts b/codemods-legacy/ember/5/fpe-computed/test/test.ts similarity index 100% rename from codemods/ember/5/fpe-computed/test/test.ts rename to codemods-legacy/ember/5/fpe-computed/test/test.ts diff --git a/codemods/ember/5/fpe-computed/tsconfig.json b/codemods-legacy/ember/5/fpe-computed/tsconfig.json similarity index 100% rename from codemods/ember/5/fpe-computed/tsconfig.json rename to codemods-legacy/ember/5/fpe-computed/tsconfig.json diff --git a/codemods/meteor/v3/fibers-to-async-promises/vitest.config.ts b/codemods-legacy/ember/5/fpe-computed/vitest.config.ts similarity index 100% rename from codemods/meteor/v3/fibers-to-async-promises/vitest.config.ts rename to codemods-legacy/ember/5/fpe-computed/vitest.config.ts diff --git a/codemods/ember/5/fpe-observes/.codemodrc.json b/codemods-legacy/ember/5/fpe-observes/.codemodrc.json similarity index 100% rename from codemods/ember/5/fpe-observes/.codemodrc.json rename to codemods-legacy/ember/5/fpe-observes/.codemodrc.json diff --git a/codemods/ember/5/fpe-observes/README.md b/codemods-legacy/ember/5/fpe-observes/README.md similarity index 100% rename from codemods/ember/5/fpe-observes/README.md rename to codemods-legacy/ember/5/fpe-observes/README.md diff --git a/codemods-legacy/ember/5/fpe-observes/package.json b/codemods-legacy/ember/5/fpe-observes/package.json new file mode 100644 index 00000000..c525f6af --- /dev/null +++ b/codemods-legacy/ember/5/fpe-observes/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-ember-5-fpe-observes", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/ember/5/fpe-observes/src/index.js b/codemods-legacy/ember/5/fpe-observes/src/index.js similarity index 100% rename from codemods/ember/5/fpe-observes/src/index.js rename to codemods-legacy/ember/5/fpe-observes/src/index.js diff --git a/codemods/ember/5/fpe-observes/test/test.ts b/codemods-legacy/ember/5/fpe-observes/test/test.ts similarity index 100% rename from codemods/ember/5/fpe-observes/test/test.ts rename to codemods-legacy/ember/5/fpe-observes/test/test.ts diff --git a/codemods/ember/5/fpe-observes/tsconfig.json b/codemods-legacy/ember/5/fpe-observes/tsconfig.json similarity index 100% rename from codemods/ember/5/fpe-observes/tsconfig.json rename to codemods-legacy/ember/5/fpe-observes/tsconfig.json diff --git a/codemods/meteor/v3/meteor-renamed functions/vitest.config.ts b/codemods-legacy/ember/5/fpe-observes/vitest.config.ts similarity index 100% rename from codemods/meteor/v3/meteor-renamed functions/vitest.config.ts rename to codemods-legacy/ember/5/fpe-observes/vitest.config.ts diff --git a/codemods/ember/5/fpe-on/.codemodrc.json b/codemods-legacy/ember/5/fpe-on/.codemodrc.json similarity index 100% rename from codemods/ember/5/fpe-on/.codemodrc.json rename to codemods-legacy/ember/5/fpe-on/.codemodrc.json diff --git a/codemods/ember/5/fpe-on/README.md b/codemods-legacy/ember/5/fpe-on/README.md similarity index 100% rename from codemods/ember/5/fpe-on/README.md rename to codemods-legacy/ember/5/fpe-on/README.md diff --git a/codemods-legacy/ember/5/fpe-on/package.json b/codemods-legacy/ember/5/fpe-on/package.json new file mode 100644 index 00000000..9219dad4 --- /dev/null +++ b/codemods-legacy/ember/5/fpe-on/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-ember-5-fpe-on", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/ember/5/fpe-on/src/index.js b/codemods-legacy/ember/5/fpe-on/src/index.js similarity index 100% rename from codemods/ember/5/fpe-on/src/index.js rename to codemods-legacy/ember/5/fpe-on/src/index.js diff --git a/codemods/ember/5/fpe-on/test/test.ts b/codemods-legacy/ember/5/fpe-on/test/test.ts similarity index 100% rename from codemods/ember/5/fpe-on/test/test.ts rename to codemods-legacy/ember/5/fpe-on/test/test.ts diff --git a/codemods/ember/5/fpe-on/tsconfig.json b/codemods-legacy/ember/5/fpe-on/tsconfig.json similarity index 100% rename from codemods/ember/5/fpe-on/tsconfig.json rename to codemods-legacy/ember/5/fpe-on/tsconfig.json diff --git a/codemods/meteor/v3/mongoDb-async-methods/vitest.config.ts b/codemods-legacy/ember/5/fpe-on/vitest.config.ts similarity index 100% rename from codemods/meteor/v3/mongoDb-async-methods/vitest.config.ts rename to codemods-legacy/ember/5/fpe-on/vitest.config.ts diff --git a/codemods/ember/5/jquery-apis/.codemodrc.json b/codemods-legacy/ember/5/jquery-apis/.codemodrc.json similarity index 100% rename from codemods/ember/5/jquery-apis/.codemodrc.json rename to codemods-legacy/ember/5/jquery-apis/.codemodrc.json diff --git a/codemods/ember/5/jquery-apis/README.md b/codemods-legacy/ember/5/jquery-apis/README.md similarity index 100% rename from codemods/ember/5/jquery-apis/README.md rename to codemods-legacy/ember/5/jquery-apis/README.md diff --git a/codemods-legacy/ember/5/jquery-apis/package.json b/codemods-legacy/ember/5/jquery-apis/package.json new file mode 100644 index 00000000..747445e5 --- /dev/null +++ b/codemods-legacy/ember/5/jquery-apis/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-ember-5-jquery-apis", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/ember/5/jquery-apis/src/index.js b/codemods-legacy/ember/5/jquery-apis/src/index.js similarity index 100% rename from codemods/ember/5/jquery-apis/src/index.js rename to codemods-legacy/ember/5/jquery-apis/src/index.js diff --git a/codemods/ember/5/jquery-apis/test/test.ts b/codemods-legacy/ember/5/jquery-apis/test/test.ts similarity index 100% rename from codemods/ember/5/jquery-apis/test/test.ts rename to codemods-legacy/ember/5/jquery-apis/test/test.ts diff --git a/codemods/ember/5/jquery-apis/tsconfig.json b/codemods-legacy/ember/5/jquery-apis/tsconfig.json similarity index 100% rename from codemods/ember/5/jquery-apis/tsconfig.json rename to codemods-legacy/ember/5/jquery-apis/tsconfig.json diff --git a/codemods/meteor/v3/removedFunctions/vitest.config.ts b/codemods-legacy/ember/5/jquery-apis/vitest.config.ts similarity index 100% rename from codemods/meteor/v3/removedFunctions/vitest.config.ts rename to codemods-legacy/ember/5/jquery-apis/vitest.config.ts diff --git a/codemods/ember/5/jquery-event/.codemodrc.json b/codemods-legacy/ember/5/jquery-event/.codemodrc.json similarity index 100% rename from codemods/ember/5/jquery-event/.codemodrc.json rename to codemods-legacy/ember/5/jquery-event/.codemodrc.json diff --git a/codemods/ember/5/jquery-event/README.md b/codemods-legacy/ember/5/jquery-event/README.md similarity index 100% rename from codemods/ember/5/jquery-event/README.md rename to codemods-legacy/ember/5/jquery-event/README.md diff --git a/codemods-legacy/ember/5/jquery-event/package.json b/codemods-legacy/ember/5/jquery-event/package.json new file mode 100644 index 00000000..7f8f4479 --- /dev/null +++ b/codemods-legacy/ember/5/jquery-event/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-ember-5-jquery-event", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/ember/5/jquery-event/src/index.js b/codemods-legacy/ember/5/jquery-event/src/index.js similarity index 100% rename from codemods/ember/5/jquery-event/src/index.js rename to codemods-legacy/ember/5/jquery-event/src/index.js diff --git a/codemods/ember/5/jquery-event/test/test.ts b/codemods-legacy/ember/5/jquery-event/test/test.ts similarity index 100% rename from codemods/ember/5/jquery-event/test/test.ts rename to codemods-legacy/ember/5/jquery-event/test/test.ts diff --git a/codemods/ember/5/jquery-event/tsconfig.json b/codemods-legacy/ember/5/jquery-event/tsconfig.json similarity index 100% rename from codemods/ember/5/jquery-event/tsconfig.json rename to codemods-legacy/ember/5/jquery-event/tsconfig.json diff --git a/codemods/meteor/v3/webapp-handler-renaming/vitest.config.ts b/codemods-legacy/ember/5/jquery-event/vitest.config.ts similarity index 100% rename from codemods/meteor/v3/webapp-handler-renaming/vitest.config.ts rename to codemods-legacy/ember/5/jquery-event/vitest.config.ts diff --git a/codemods/ember/5/notify-property-change/.codemodrc.json b/codemods-legacy/ember/5/notify-property-change/.codemodrc.json similarity index 100% rename from codemods/ember/5/notify-property-change/.codemodrc.json rename to codemods-legacy/ember/5/notify-property-change/.codemodrc.json diff --git a/codemods/ember/5/notify-property-change/README.md b/codemods-legacy/ember/5/notify-property-change/README.md similarity index 100% rename from codemods/ember/5/notify-property-change/README.md rename to codemods-legacy/ember/5/notify-property-change/README.md diff --git a/codemods-legacy/ember/5/notify-property-change/package.json b/codemods-legacy/ember/5/notify-property-change/package.json new file mode 100644 index 00000000..63495ba9 --- /dev/null +++ b/codemods-legacy/ember/5/notify-property-change/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-ember-5-notify-property-change", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/ember/5/notify-property-change/src/index.js b/codemods-legacy/ember/5/notify-property-change/src/index.js similarity index 100% rename from codemods/ember/5/notify-property-change/src/index.js rename to codemods-legacy/ember/5/notify-property-change/src/index.js diff --git a/codemods/ember/5/notify-property-change/test/test.ts b/codemods-legacy/ember/5/notify-property-change/test/test.ts similarity index 100% rename from codemods/ember/5/notify-property-change/test/test.ts rename to codemods-legacy/ember/5/notify-property-change/test/test.ts diff --git a/codemods/ember/5/notify-property-change/tsconfig.json b/codemods-legacy/ember/5/notify-property-change/tsconfig.json similarity index 100% rename from codemods/ember/5/notify-property-change/tsconfig.json rename to codemods-legacy/ember/5/notify-property-change/tsconfig.json diff --git a/codemods/netlify/add-zod-validation/vitest.config.ts b/codemods-legacy/ember/5/notify-property-change/vitest.config.ts similarity index 100% rename from codemods/netlify/add-zod-validation/vitest.config.ts rename to codemods-legacy/ember/5/notify-property-change/vitest.config.ts diff --git a/codemods/ember/5/object-new-constructor/.codemodrc.json b/codemods-legacy/ember/5/object-new-constructor/.codemodrc.json similarity index 100% rename from codemods/ember/5/object-new-constructor/.codemodrc.json rename to codemods-legacy/ember/5/object-new-constructor/.codemodrc.json diff --git a/codemods/ember/5/object-new-constructor/README.md b/codemods-legacy/ember/5/object-new-constructor/README.md similarity index 100% rename from codemods/ember/5/object-new-constructor/README.md rename to codemods-legacy/ember/5/object-new-constructor/README.md diff --git a/codemods-legacy/ember/5/object-new-constructor/package.json b/codemods-legacy/ember/5/object-new-constructor/package.json new file mode 100644 index 00000000..cc546333 --- /dev/null +++ b/codemods-legacy/ember/5/object-new-constructor/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-ember-5-object-new-constructor", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/ember/5/object-new-constructor/src/index.js b/codemods-legacy/ember/5/object-new-constructor/src/index.js similarity index 100% rename from codemods/ember/5/object-new-constructor/src/index.js rename to codemods-legacy/ember/5/object-new-constructor/src/index.js diff --git a/codemods/ember/5/object-new-constructor/test/test.ts b/codemods-legacy/ember/5/object-new-constructor/test/test.ts similarity index 100% rename from codemods/ember/5/object-new-constructor/test/test.ts rename to codemods-legacy/ember/5/object-new-constructor/test/test.ts diff --git a/codemods/ember/5/object-new-constructor/tsconfig.json b/codemods-legacy/ember/5/object-new-constructor/tsconfig.json similarity index 100% rename from codemods/ember/5/object-new-constructor/tsconfig.json rename to codemods-legacy/ember/5/object-new-constructor/tsconfig.json diff --git a/codemods/netlify/replace-feature-flag/vitest.config.ts b/codemods-legacy/ember/5/object-new-constructor/vitest.config.ts similarity index 100% rename from codemods/netlify/replace-feature-flag/vitest.config.ts rename to codemods-legacy/ember/5/object-new-constructor/vitest.config.ts diff --git a/codemods/eslint/biome/migrate-rules/.codemodrc.json b/codemods-legacy/eslint/biome/migrate-rules/.codemodrc.json similarity index 100% rename from codemods/eslint/biome/migrate-rules/.codemodrc.json rename to codemods-legacy/eslint/biome/migrate-rules/.codemodrc.json diff --git a/codemods/eslint/biome/migrate-rules/README.md b/codemods-legacy/eslint/biome/migrate-rules/README.md similarity index 100% rename from codemods/eslint/biome/migrate-rules/README.md rename to codemods-legacy/eslint/biome/migrate-rules/README.md diff --git a/codemods/eslint/biome/migrate-rules/generate-latest-dts.ts b/codemods-legacy/eslint/biome/migrate-rules/generate-latest-dts.ts similarity index 100% rename from codemods/eslint/biome/migrate-rules/generate-latest-dts.ts rename to codemods-legacy/eslint/biome/migrate-rules/generate-latest-dts.ts diff --git a/codemods-legacy/eslint/biome/migrate-rules/package.json b/codemods-legacy/eslint/biome/migrate-rules/package.json new file mode 100644 index 00000000..75f0dfda --- /dev/null +++ b/codemods-legacy/eslint/biome/migrate-rules/package.json @@ -0,0 +1,25 @@ +{ + "name": "@codemod-com/codemod-eslint-to-biome-rules", + "devDependencies": { + "@codemod-com/filemod": "workspace:*", + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "memfs": "^4.6.0", + "typescript": "^5.2.2", + "valibot": "catalog:", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "generate": "tsx generate-latest-dts.ts", + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/eslint/biome/migrate-rules/src/functions.ts b/codemods-legacy/eslint/biome/migrate-rules/src/functions.ts similarity index 100% rename from codemods/eslint/biome/migrate-rules/src/functions.ts rename to codemods-legacy/eslint/biome/migrate-rules/src/functions.ts diff --git a/codemods/eslint/biome/migrate-rules/src/index.ts b/codemods-legacy/eslint/biome/migrate-rules/src/index.ts similarity index 100% rename from codemods/eslint/biome/migrate-rules/src/index.ts rename to codemods-legacy/eslint/biome/migrate-rules/src/index.ts diff --git a/codemods/eslint/biome/migrate-rules/src/schemas.ts b/codemods-legacy/eslint/biome/migrate-rules/src/schemas.ts similarity index 100% rename from codemods/eslint/biome/migrate-rules/src/schemas.ts rename to codemods-legacy/eslint/biome/migrate-rules/src/schemas.ts diff --git a/codemods/eslint/biome/migrate-rules/src/types.ts b/codemods-legacy/eslint/biome/migrate-rules/src/types.ts similarity index 100% rename from codemods/eslint/biome/migrate-rules/src/types.ts rename to codemods-legacy/eslint/biome/migrate-rules/src/types.ts diff --git a/codemods/eslint/biome/migrate-rules/test/test.ts b/codemods-legacy/eslint/biome/migrate-rules/test/test.ts similarity index 100% rename from codemods/eslint/biome/migrate-rules/test/test.ts rename to codemods-legacy/eslint/biome/migrate-rules/test/test.ts diff --git a/codemods/eslint/biome/migrate-rules/tsconfig.json b/codemods-legacy/eslint/biome/migrate-rules/tsconfig.json similarity index 100% rename from codemods/eslint/biome/migrate-rules/tsconfig.json rename to codemods-legacy/eslint/biome/migrate-rules/tsconfig.json diff --git a/codemods/eslint/biome/migrate-rules/types/biome.d.ts b/codemods-legacy/eslint/biome/migrate-rules/types/biome.d.ts similarity index 100% rename from codemods/eslint/biome/migrate-rules/types/biome.d.ts rename to codemods-legacy/eslint/biome/migrate-rules/types/biome.d.ts diff --git a/codemods/eslint/biome/migrate-rules/types/eslint.d.ts b/codemods-legacy/eslint/biome/migrate-rules/types/eslint.d.ts similarity index 100% rename from codemods/eslint/biome/migrate-rules/types/eslint.d.ts rename to codemods-legacy/eslint/biome/migrate-rules/types/eslint.d.ts diff --git a/codemods/eslint/biome/migrate-rules/types/prettier.d.ts b/codemods-legacy/eslint/biome/migrate-rules/types/prettier.d.ts similarity index 100% rename from codemods/eslint/biome/migrate-rules/types/prettier.d.ts rename to codemods-legacy/eslint/biome/migrate-rules/types/prettier.d.ts diff --git a/codemods/nextAuth/useSession-array-to-Object-destrucutring/vitest.config.ts b/codemods-legacy/eslint/biome/migrate-rules/vitest.config.ts similarity index 100% rename from codemods/nextAuth/useSession-array-to-Object-destrucutring/vitest.config.ts rename to codemods-legacy/eslint/biome/migrate-rules/vitest.config.ts diff --git a/codemods/ethers/v6/big-numbers/.codemodrc.json b/codemods-legacy/ethers/v6/big-numbers/.codemodrc.json similarity index 100% rename from codemods/ethers/v6/big-numbers/.codemodrc.json rename to codemods-legacy/ethers/v6/big-numbers/.codemodrc.json diff --git a/codemods/ethers/v6/big-numbers/.gitignore b/codemods-legacy/ethers/v6/big-numbers/.gitignore similarity index 100% rename from codemods/ethers/v6/big-numbers/.gitignore rename to codemods-legacy/ethers/v6/big-numbers/.gitignore diff --git a/codemods/ethers/v6/big-numbers/LICENSE b/codemods-legacy/ethers/v6/big-numbers/LICENSE similarity index 100% rename from codemods/ethers/v6/big-numbers/LICENSE rename to codemods-legacy/ethers/v6/big-numbers/LICENSE diff --git a/codemods/ethers/v6/big-numbers/README.md b/codemods-legacy/ethers/v6/big-numbers/README.md similarity index 100% rename from codemods/ethers/v6/big-numbers/README.md rename to codemods-legacy/ethers/v6/big-numbers/README.md diff --git a/codemods/ethers/v6/big-numbers/__testfixtures__/fixture1.input.ts b/codemods-legacy/ethers/v6/big-numbers/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/ethers/v6/big-numbers/__testfixtures__/fixture1.input.ts rename to codemods-legacy/ethers/v6/big-numbers/__testfixtures__/fixture1.input.ts diff --git a/codemods/ethers/v6/big-numbers/__testfixtures__/fixture1.output.ts b/codemods-legacy/ethers/v6/big-numbers/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/ethers/v6/big-numbers/__testfixtures__/fixture1.output.ts rename to codemods-legacy/ethers/v6/big-numbers/__testfixtures__/fixture1.output.ts diff --git a/codemods/ethers/v6/big-numbers/cdmd_dist/index.cjs b/codemods-legacy/ethers/v6/big-numbers/cdmd_dist/index.cjs similarity index 100% rename from codemods/ethers/v6/big-numbers/cdmd_dist/index.cjs rename to codemods-legacy/ethers/v6/big-numbers/cdmd_dist/index.cjs diff --git a/codemods-legacy/ethers/v6/big-numbers/package.json b/codemods-legacy/ethers/v6/big-numbers/package.json new file mode 100644 index 00000000..17865d87 --- /dev/null +++ b/codemods-legacy/ethers/v6/big-numbers/package.json @@ -0,0 +1,24 @@ +{ + "name": "ethers-big-numbers", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "*", + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "^5.2.2", + "vitest": "^1.0.1", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "yugal41735" +} diff --git a/codemods/ethers/v6/big-numbers/src/index.ts b/codemods-legacy/ethers/v6/big-numbers/src/index.ts similarity index 100% rename from codemods/ethers/v6/big-numbers/src/index.ts rename to codemods-legacy/ethers/v6/big-numbers/src/index.ts diff --git a/codemods/ethers/v6/big-numbers/test/test.ts b/codemods-legacy/ethers/v6/big-numbers/test/test.ts similarity index 100% rename from codemods/ethers/v6/big-numbers/test/test.ts rename to codemods-legacy/ethers/v6/big-numbers/test/test.ts diff --git a/codemods-legacy/ethers/v6/big-numbers/tsconfig.json b/codemods-legacy/ethers/v6/big-numbers/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/ethers/v6/big-numbers/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/nuxt/4/absolute-watch-path/vitest.config.ts b/codemods-legacy/ethers/v6/big-numbers/vitest.config.ts similarity index 100% rename from codemods/nuxt/4/absolute-watch-path/vitest.config.ts rename to codemods-legacy/ethers/v6/big-numbers/vitest.config.ts diff --git a/codemods/ethers/v6/contracts-ambiguous-methods/.codemodrc.json b/codemods-legacy/ethers/v6/contracts-ambiguous-methods/.codemodrc.json similarity index 100% rename from codemods/ethers/v6/contracts-ambiguous-methods/.codemodrc.json rename to codemods-legacy/ethers/v6/contracts-ambiguous-methods/.codemodrc.json diff --git a/codemods/ethers/v6/contracts-ambiguous-methods/.gitignore b/codemods-legacy/ethers/v6/contracts-ambiguous-methods/.gitignore similarity index 100% rename from codemods/ethers/v6/contracts-ambiguous-methods/.gitignore rename to codemods-legacy/ethers/v6/contracts-ambiguous-methods/.gitignore diff --git a/codemods/ethers/v6/contracts-ambiguous-methods/LICENSE b/codemods-legacy/ethers/v6/contracts-ambiguous-methods/LICENSE similarity index 100% rename from codemods/ethers/v6/contracts-ambiguous-methods/LICENSE rename to codemods-legacy/ethers/v6/contracts-ambiguous-methods/LICENSE diff --git a/codemods/ethers/v6/contracts-ambiguous-methods/README.md b/codemods-legacy/ethers/v6/contracts-ambiguous-methods/README.md similarity index 100% rename from codemods/ethers/v6/contracts-ambiguous-methods/README.md rename to codemods-legacy/ethers/v6/contracts-ambiguous-methods/README.md diff --git a/codemods/ethers/v6/contracts-ambiguous-methods/__testfixtures__/fixture1.input.ts b/codemods-legacy/ethers/v6/contracts-ambiguous-methods/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/ethers/v6/contracts-ambiguous-methods/__testfixtures__/fixture1.input.ts rename to codemods-legacy/ethers/v6/contracts-ambiguous-methods/__testfixtures__/fixture1.input.ts diff --git a/codemods/ethers/v6/contracts-ambiguous-methods/__testfixtures__/fixture1.output.ts b/codemods-legacy/ethers/v6/contracts-ambiguous-methods/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/ethers/v6/contracts-ambiguous-methods/__testfixtures__/fixture1.output.ts rename to codemods-legacy/ethers/v6/contracts-ambiguous-methods/__testfixtures__/fixture1.output.ts diff --git a/codemods/ethers/v6/contracts-ambiguous-methods/cdmd_dist/index.cjs b/codemods-legacy/ethers/v6/contracts-ambiguous-methods/cdmd_dist/index.cjs similarity index 100% rename from codemods/ethers/v6/contracts-ambiguous-methods/cdmd_dist/index.cjs rename to codemods-legacy/ethers/v6/contracts-ambiguous-methods/cdmd_dist/index.cjs diff --git a/codemods-legacy/ethers/v6/contracts-ambiguous-methods/package.json b/codemods-legacy/ethers/v6/contracts-ambiguous-methods/package.json new file mode 100644 index 00000000..f0cb1477 --- /dev/null +++ b/codemods-legacy/ethers/v6/contracts-ambiguous-methods/package.json @@ -0,0 +1,24 @@ +{ + "name": "contract-to-typed-address-wrapper", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "^5.2.2", + "vitest": "^1.0.1", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "yugal41735" +} diff --git a/codemods/ethers/v6/contracts-ambiguous-methods/src/index.ts b/codemods-legacy/ethers/v6/contracts-ambiguous-methods/src/index.ts similarity index 100% rename from codemods/ethers/v6/contracts-ambiguous-methods/src/index.ts rename to codemods-legacy/ethers/v6/contracts-ambiguous-methods/src/index.ts diff --git a/codemods/ethers/v6/contracts-ambiguous-methods/test/test.ts b/codemods-legacy/ethers/v6/contracts-ambiguous-methods/test/test.ts similarity index 100% rename from codemods/ethers/v6/contracts-ambiguous-methods/test/test.ts rename to codemods-legacy/ethers/v6/contracts-ambiguous-methods/test/test.ts diff --git a/codemods-legacy/ethers/v6/contracts-ambiguous-methods/tsconfig.json b/codemods-legacy/ethers/v6/contracts-ambiguous-methods/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/ethers/v6/contracts-ambiguous-methods/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/nuxt/4/default-data-error-value/vitest.config.ts b/codemods-legacy/ethers/v6/contracts-ambiguous-methods/vitest.config.ts similarity index 100% rename from codemods/nuxt/4/default-data-error-value/vitest.config.ts rename to codemods-legacy/ethers/v6/contracts-ambiguous-methods/vitest.config.ts diff --git a/codemods/ethers/v6/contracts-other-methods/.codemodrc.json b/codemods-legacy/ethers/v6/contracts-other-methods/.codemodrc.json similarity index 100% rename from codemods/ethers/v6/contracts-other-methods/.codemodrc.json rename to codemods-legacy/ethers/v6/contracts-other-methods/.codemodrc.json diff --git a/codemods/ethers/v6/contracts-other-methods/.gitignore b/codemods-legacy/ethers/v6/contracts-other-methods/.gitignore similarity index 100% rename from codemods/ethers/v6/contracts-other-methods/.gitignore rename to codemods-legacy/ethers/v6/contracts-other-methods/.gitignore diff --git a/codemods/ethers/v6/contracts-other-methods/LICENSE b/codemods-legacy/ethers/v6/contracts-other-methods/LICENSE similarity index 100% rename from codemods/ethers/v6/contracts-other-methods/LICENSE rename to codemods-legacy/ethers/v6/contracts-other-methods/LICENSE diff --git a/codemods/ethers/v6/contracts-other-methods/README.md b/codemods-legacy/ethers/v6/contracts-other-methods/README.md similarity index 100% rename from codemods/ethers/v6/contracts-other-methods/README.md rename to codemods-legacy/ethers/v6/contracts-other-methods/README.md diff --git a/codemods/ethers/v6/contracts-other-methods/__testfixtures__/fixture1.input.ts b/codemods-legacy/ethers/v6/contracts-other-methods/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/ethers/v6/contracts-other-methods/__testfixtures__/fixture1.input.ts rename to codemods-legacy/ethers/v6/contracts-other-methods/__testfixtures__/fixture1.input.ts diff --git a/codemods/ethers/v6/contracts-other-methods/__testfixtures__/fixture1.output.ts b/codemods-legacy/ethers/v6/contracts-other-methods/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/ethers/v6/contracts-other-methods/__testfixtures__/fixture1.output.ts rename to codemods-legacy/ethers/v6/contracts-other-methods/__testfixtures__/fixture1.output.ts diff --git a/codemods/ethers/v6/contracts-other-methods/__testfixtures__/fixture2.input.ts b/codemods-legacy/ethers/v6/contracts-other-methods/__testfixtures__/fixture2.input.ts similarity index 100% rename from codemods/ethers/v6/contracts-other-methods/__testfixtures__/fixture2.input.ts rename to codemods-legacy/ethers/v6/contracts-other-methods/__testfixtures__/fixture2.input.ts diff --git a/codemods/ethers/v6/contracts-other-methods/__testfixtures__/fixture2.output.ts b/codemods-legacy/ethers/v6/contracts-other-methods/__testfixtures__/fixture2.output.ts similarity index 100% rename from codemods/ethers/v6/contracts-other-methods/__testfixtures__/fixture2.output.ts rename to codemods-legacy/ethers/v6/contracts-other-methods/__testfixtures__/fixture2.output.ts diff --git a/codemods/ethers/v6/contracts-other-methods/__testfixtures__/fixture3.input.ts b/codemods-legacy/ethers/v6/contracts-other-methods/__testfixtures__/fixture3.input.ts similarity index 100% rename from codemods/ethers/v6/contracts-other-methods/__testfixtures__/fixture3.input.ts rename to codemods-legacy/ethers/v6/contracts-other-methods/__testfixtures__/fixture3.input.ts diff --git a/codemods/ethers/v6/contracts-other-methods/__testfixtures__/fixture3.output.ts b/codemods-legacy/ethers/v6/contracts-other-methods/__testfixtures__/fixture3.output.ts similarity index 100% rename from codemods/ethers/v6/contracts-other-methods/__testfixtures__/fixture3.output.ts rename to codemods-legacy/ethers/v6/contracts-other-methods/__testfixtures__/fixture3.output.ts diff --git a/codemods/ethers/v6/contracts-other-methods/__testfixtures__/fixture4.input.ts b/codemods-legacy/ethers/v6/contracts-other-methods/__testfixtures__/fixture4.input.ts similarity index 100% rename from codemods/ethers/v6/contracts-other-methods/__testfixtures__/fixture4.input.ts rename to codemods-legacy/ethers/v6/contracts-other-methods/__testfixtures__/fixture4.input.ts diff --git a/codemods/ethers/v6/contracts-other-methods/__testfixtures__/fixture4.output.ts b/codemods-legacy/ethers/v6/contracts-other-methods/__testfixtures__/fixture4.output.ts similarity index 100% rename from codemods/ethers/v6/contracts-other-methods/__testfixtures__/fixture4.output.ts rename to codemods-legacy/ethers/v6/contracts-other-methods/__testfixtures__/fixture4.output.ts diff --git a/codemods/ethers/v6/contracts-other-methods/cdmd_dist/index.cjs b/codemods-legacy/ethers/v6/contracts-other-methods/cdmd_dist/index.cjs similarity index 100% rename from codemods/ethers/v6/contracts-other-methods/cdmd_dist/index.cjs rename to codemods-legacy/ethers/v6/contracts-other-methods/cdmd_dist/index.cjs diff --git a/codemods-legacy/ethers/v6/contracts-other-methods/package.json b/codemods-legacy/ethers/v6/contracts-other-methods/package.json new file mode 100644 index 00000000..56ff4bab --- /dev/null +++ b/codemods-legacy/ethers/v6/contracts-other-methods/package.json @@ -0,0 +1,24 @@ +{ + "name": "ethers-5-contract-methods-refactor", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "^5.2.2", + "vitest": "^1.0.1", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "yugal41735" +} diff --git a/codemods/ethers/v6/contracts-other-methods/src/index.ts b/codemods-legacy/ethers/v6/contracts-other-methods/src/index.ts similarity index 100% rename from codemods/ethers/v6/contracts-other-methods/src/index.ts rename to codemods-legacy/ethers/v6/contracts-other-methods/src/index.ts diff --git a/codemods/ethers/v6/contracts-other-methods/test/test.ts b/codemods-legacy/ethers/v6/contracts-other-methods/test/test.ts similarity index 100% rename from codemods/ethers/v6/contracts-other-methods/test/test.ts rename to codemods-legacy/ethers/v6/contracts-other-methods/test/test.ts diff --git a/codemods-legacy/ethers/v6/contracts-other-methods/tsconfig.json b/codemods-legacy/ethers/v6/contracts-other-methods/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/ethers/v6/contracts-other-methods/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/nuxt/4/deprecated-dedupe-value/vitest.config.ts b/codemods-legacy/ethers/v6/contracts-other-methods/vitest.config.ts similarity index 100% rename from codemods/nuxt/4/deprecated-dedupe-value/vitest.config.ts rename to codemods-legacy/ethers/v6/contracts-other-methods/vitest.config.ts diff --git a/codemods/ethers/v6/importing/.codemodrc.json b/codemods-legacy/ethers/v6/importing/.codemodrc.json similarity index 100% rename from codemods/ethers/v6/importing/.codemodrc.json rename to codemods-legacy/ethers/v6/importing/.codemodrc.json diff --git a/codemods/ethers/v6/importing/.gitignore b/codemods-legacy/ethers/v6/importing/.gitignore similarity index 100% rename from codemods/ethers/v6/importing/.gitignore rename to codemods-legacy/ethers/v6/importing/.gitignore diff --git a/codemods/ethers/v6/importing/LICENSE b/codemods-legacy/ethers/v6/importing/LICENSE similarity index 100% rename from codemods/ethers/v6/importing/LICENSE rename to codemods-legacy/ethers/v6/importing/LICENSE diff --git a/codemods/ethers/v6/importing/README.md b/codemods-legacy/ethers/v6/importing/README.md similarity index 100% rename from codemods/ethers/v6/importing/README.md rename to codemods-legacy/ethers/v6/importing/README.md diff --git a/codemods/ethers/v6/importing/__testfixtures__/fixture1.input.ts b/codemods-legacy/ethers/v6/importing/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/ethers/v6/importing/__testfixtures__/fixture1.input.ts rename to codemods-legacy/ethers/v6/importing/__testfixtures__/fixture1.input.ts diff --git a/codemods/ethers/v6/importing/__testfixtures__/fixture1.output.ts b/codemods-legacy/ethers/v6/importing/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/ethers/v6/importing/__testfixtures__/fixture1.output.ts rename to codemods-legacy/ethers/v6/importing/__testfixtures__/fixture1.output.ts diff --git a/codemods/ethers/v6/importing/__testfixtures__/fixture2.input.ts b/codemods-legacy/ethers/v6/importing/__testfixtures__/fixture2.input.ts similarity index 100% rename from codemods/ethers/v6/importing/__testfixtures__/fixture2.input.ts rename to codemods-legacy/ethers/v6/importing/__testfixtures__/fixture2.input.ts diff --git a/codemods/ethers/v6/importing/__testfixtures__/fixture2.output.ts b/codemods-legacy/ethers/v6/importing/__testfixtures__/fixture2.output.ts similarity index 100% rename from codemods/ethers/v6/importing/__testfixtures__/fixture2.output.ts rename to codemods-legacy/ethers/v6/importing/__testfixtures__/fixture2.output.ts diff --git a/codemods/ethers/v6/importing/cdmd_dist/index.cjs b/codemods-legacy/ethers/v6/importing/cdmd_dist/index.cjs similarity index 100% rename from codemods/ethers/v6/importing/cdmd_dist/index.cjs rename to codemods-legacy/ethers/v6/importing/cdmd_dist/index.cjs diff --git a/codemods-legacy/ethers/v6/importing/package.json b/codemods-legacy/ethers/v6/importing/package.json new file mode 100644 index 00000000..09be2c4e --- /dev/null +++ b/codemods-legacy/ethers/v6/importing/package.json @@ -0,0 +1,24 @@ +{ + "name": "ethers-5-import-infura-provider-refactor", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "^5.2.2", + "vitest": "^1.0.1", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "yugal41735" +} diff --git a/codemods/ethers/v6/importing/src/index.ts b/codemods-legacy/ethers/v6/importing/src/index.ts similarity index 100% rename from codemods/ethers/v6/importing/src/index.ts rename to codemods-legacy/ethers/v6/importing/src/index.ts diff --git a/codemods/ethers/v6/importing/test/test.ts b/codemods-legacy/ethers/v6/importing/test/test.ts similarity index 100% rename from codemods/ethers/v6/importing/test/test.ts rename to codemods-legacy/ethers/v6/importing/test/test.ts diff --git a/codemods-legacy/ethers/v6/importing/tsconfig.json b/codemods-legacy/ethers/v6/importing/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/ethers/v6/importing/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/nuxt/4/file-structure/vitest.config.ts b/codemods-legacy/ethers/v6/importing/vitest.config.ts similarity index 100% rename from codemods/nuxt/4/file-structure/vitest.config.ts rename to codemods-legacy/ethers/v6/importing/vitest.config.ts diff --git a/codemods/ethers/v6/migration-recipe/.codemodrc.json b/codemods-legacy/ethers/v6/migration-recipe/.codemodrc.json similarity index 100% rename from codemods/ethers/v6/migration-recipe/.codemodrc.json rename to codemods-legacy/ethers/v6/migration-recipe/.codemodrc.json diff --git a/codemods/ethers/v6/migration-recipe/README.md b/codemods-legacy/ethers/v6/migration-recipe/README.md similarity index 100% rename from codemods/ethers/v6/migration-recipe/README.md rename to codemods-legacy/ethers/v6/migration-recipe/README.md diff --git a/codemods/ethers/v6/migration-recipe/package.json b/codemods-legacy/ethers/v6/migration-recipe/package.json similarity index 100% rename from codemods/ethers/v6/migration-recipe/package.json rename to codemods-legacy/ethers/v6/migration-recipe/package.json diff --git a/codemods/ethers/v6/providers/.codemodrc.json b/codemods-legacy/ethers/v6/providers/.codemodrc.json similarity index 100% rename from codemods/ethers/v6/providers/.codemodrc.json rename to codemods-legacy/ethers/v6/providers/.codemodrc.json diff --git a/codemods/ethers/v6/providers/.gitignore b/codemods-legacy/ethers/v6/providers/.gitignore similarity index 100% rename from codemods/ethers/v6/providers/.gitignore rename to codemods-legacy/ethers/v6/providers/.gitignore diff --git a/codemods/ethers/v6/providers/LICENSE b/codemods-legacy/ethers/v6/providers/LICENSE similarity index 100% rename from codemods/ethers/v6/providers/LICENSE rename to codemods-legacy/ethers/v6/providers/LICENSE diff --git a/codemods/ethers/v6/providers/README.md b/codemods-legacy/ethers/v6/providers/README.md similarity index 100% rename from codemods/ethers/v6/providers/README.md rename to codemods-legacy/ethers/v6/providers/README.md diff --git a/codemods/ethers/v6/providers/__testfixtures__/fixture1.input.ts b/codemods-legacy/ethers/v6/providers/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/ethers/v6/providers/__testfixtures__/fixture1.input.ts rename to codemods-legacy/ethers/v6/providers/__testfixtures__/fixture1.input.ts diff --git a/codemods/ethers/v6/providers/__testfixtures__/fixture1.output.ts b/codemods-legacy/ethers/v6/providers/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/ethers/v6/providers/__testfixtures__/fixture1.output.ts rename to codemods-legacy/ethers/v6/providers/__testfixtures__/fixture1.output.ts diff --git a/codemods/ethers/v6/providers/__testfixtures__/fixture2.input.ts b/codemods-legacy/ethers/v6/providers/__testfixtures__/fixture2.input.ts similarity index 100% rename from codemods/ethers/v6/providers/__testfixtures__/fixture2.input.ts rename to codemods-legacy/ethers/v6/providers/__testfixtures__/fixture2.input.ts diff --git a/codemods/ethers/v6/providers/__testfixtures__/fixture2.output.ts b/codemods-legacy/ethers/v6/providers/__testfixtures__/fixture2.output.ts similarity index 100% rename from codemods/ethers/v6/providers/__testfixtures__/fixture2.output.ts rename to codemods-legacy/ethers/v6/providers/__testfixtures__/fixture2.output.ts diff --git a/codemods/ethers/v6/providers/__testfixtures__/fixture3.input.ts b/codemods-legacy/ethers/v6/providers/__testfixtures__/fixture3.input.ts similarity index 100% rename from codemods/ethers/v6/providers/__testfixtures__/fixture3.input.ts rename to codemods-legacy/ethers/v6/providers/__testfixtures__/fixture3.input.ts diff --git a/codemods/ethers/v6/providers/__testfixtures__/fixture3.output.ts b/codemods-legacy/ethers/v6/providers/__testfixtures__/fixture3.output.ts similarity index 100% rename from codemods/ethers/v6/providers/__testfixtures__/fixture3.output.ts rename to codemods-legacy/ethers/v6/providers/__testfixtures__/fixture3.output.ts diff --git a/codemods/ethers/v6/providers/__testfixtures__/fixture4.input.ts b/codemods-legacy/ethers/v6/providers/__testfixtures__/fixture4.input.ts similarity index 100% rename from codemods/ethers/v6/providers/__testfixtures__/fixture4.input.ts rename to codemods-legacy/ethers/v6/providers/__testfixtures__/fixture4.input.ts diff --git a/codemods/ethers/v6/providers/__testfixtures__/fixture4.output.ts b/codemods-legacy/ethers/v6/providers/__testfixtures__/fixture4.output.ts similarity index 100% rename from codemods/ethers/v6/providers/__testfixtures__/fixture4.output.ts rename to codemods-legacy/ethers/v6/providers/__testfixtures__/fixture4.output.ts diff --git a/codemods/ethers/v6/providers/cdmd_dist/index.cjs b/codemods-legacy/ethers/v6/providers/cdmd_dist/index.cjs similarity index 100% rename from codemods/ethers/v6/providers/cdmd_dist/index.cjs rename to codemods-legacy/ethers/v6/providers/cdmd_dist/index.cjs diff --git a/codemods-legacy/ethers/v6/providers/package.json b/codemods-legacy/ethers/v6/providers/package.json new file mode 100644 index 00000000..fe786952 --- /dev/null +++ b/codemods-legacy/ethers/v6/providers/package.json @@ -0,0 +1,24 @@ +{ + "name": "ethers-5-provider-methods-update", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "^5.2.2", + "vitest": "^1.0.1", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "yugal41735" +} diff --git a/codemods/ethers/v6/providers/src/index.ts b/codemods-legacy/ethers/v6/providers/src/index.ts similarity index 100% rename from codemods/ethers/v6/providers/src/index.ts rename to codemods-legacy/ethers/v6/providers/src/index.ts diff --git a/codemods/ethers/v6/providers/test/test.ts b/codemods-legacy/ethers/v6/providers/test/test.ts similarity index 100% rename from codemods/ethers/v6/providers/test/test.ts rename to codemods-legacy/ethers/v6/providers/test/test.ts diff --git a/codemods-legacy/ethers/v6/providers/tsconfig.json b/codemods-legacy/ethers/v6/providers/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/ethers/v6/providers/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/nuxt/4/shallow-function-reactivity/vitest.config.ts b/codemods-legacy/ethers/v6/providers/vitest.config.ts similarity index 100% rename from codemods/nuxt/4/shallow-function-reactivity/vitest.config.ts rename to codemods-legacy/ethers/v6/providers/vitest.config.ts diff --git a/codemods/ethers/v6/singatures/.codemodrc.json b/codemods-legacy/ethers/v6/singatures/.codemodrc.json similarity index 100% rename from codemods/ethers/v6/singatures/.codemodrc.json rename to codemods-legacy/ethers/v6/singatures/.codemodrc.json diff --git a/codemods/ethers/v6/singatures/.gitignore b/codemods-legacy/ethers/v6/singatures/.gitignore similarity index 100% rename from codemods/ethers/v6/singatures/.gitignore rename to codemods-legacy/ethers/v6/singatures/.gitignore diff --git a/codemods/ethers/v6/singatures/LICENSE b/codemods-legacy/ethers/v6/singatures/LICENSE similarity index 100% rename from codemods/ethers/v6/singatures/LICENSE rename to codemods-legacy/ethers/v6/singatures/LICENSE diff --git a/codemods/ethers/v6/singatures/README.md b/codemods-legacy/ethers/v6/singatures/README.md similarity index 100% rename from codemods/ethers/v6/singatures/README.md rename to codemods-legacy/ethers/v6/singatures/README.md diff --git a/codemods/ethers/v6/singatures/__testfixtures__/fixture1.input.ts b/codemods-legacy/ethers/v6/singatures/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/ethers/v6/singatures/__testfixtures__/fixture1.input.ts rename to codemods-legacy/ethers/v6/singatures/__testfixtures__/fixture1.input.ts diff --git a/codemods/ethers/v6/singatures/__testfixtures__/fixture1.output.ts b/codemods-legacy/ethers/v6/singatures/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/ethers/v6/singatures/__testfixtures__/fixture1.output.ts rename to codemods-legacy/ethers/v6/singatures/__testfixtures__/fixture1.output.ts diff --git a/codemods/ethers/v6/singatures/__testfixtures__/fixture2.input.ts b/codemods-legacy/ethers/v6/singatures/__testfixtures__/fixture2.input.ts similarity index 100% rename from codemods/ethers/v6/singatures/__testfixtures__/fixture2.input.ts rename to codemods-legacy/ethers/v6/singatures/__testfixtures__/fixture2.input.ts diff --git a/codemods/ethers/v6/singatures/__testfixtures__/fixture2.output.ts b/codemods-legacy/ethers/v6/singatures/__testfixtures__/fixture2.output.ts similarity index 100% rename from codemods/ethers/v6/singatures/__testfixtures__/fixture2.output.ts rename to codemods-legacy/ethers/v6/singatures/__testfixtures__/fixture2.output.ts diff --git a/codemods/ethers/v6/singatures/cdmd_dist/index.cjs b/codemods-legacy/ethers/v6/singatures/cdmd_dist/index.cjs similarity index 100% rename from codemods/ethers/v6/singatures/cdmd_dist/index.cjs rename to codemods-legacy/ethers/v6/singatures/cdmd_dist/index.cjs diff --git a/codemods-legacy/ethers/v6/singatures/package.json b/codemods-legacy/ethers/v6/singatures/package.json new file mode 100644 index 00000000..306ce3b1 --- /dev/null +++ b/codemods-legacy/ethers/v6/singatures/package.json @@ -0,0 +1,24 @@ +{ + "name": "ethers-5-replace-split-join-signature", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "^5.2.2", + "vitest": "^1.0.1", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "yugal41735" +} diff --git a/codemods/ethers/v6/singatures/src/index.ts b/codemods-legacy/ethers/v6/singatures/src/index.ts similarity index 100% rename from codemods/ethers/v6/singatures/src/index.ts rename to codemods-legacy/ethers/v6/singatures/src/index.ts diff --git a/codemods/ethers/v6/singatures/test/test.ts b/codemods-legacy/ethers/v6/singatures/test/test.ts similarity index 100% rename from codemods/ethers/v6/singatures/test/test.ts rename to codemods-legacy/ethers/v6/singatures/test/test.ts diff --git a/codemods-legacy/ethers/v6/singatures/tsconfig.json b/codemods-legacy/ethers/v6/singatures/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/ethers/v6/singatures/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/nuxt/4/template-compilation-changes/vitest.config.ts b/codemods-legacy/ethers/v6/singatures/vitest.config.ts similarity index 100% rename from codemods/nuxt/4/template-compilation-changes/vitest.config.ts rename to codemods-legacy/ethers/v6/singatures/vitest.config.ts diff --git a/codemods/ethers/v6/transactions/.codemodrc.json b/codemods-legacy/ethers/v6/transactions/.codemodrc.json similarity index 100% rename from codemods/ethers/v6/transactions/.codemodrc.json rename to codemods-legacy/ethers/v6/transactions/.codemodrc.json diff --git a/codemods/ethers/v6/transactions/.gitignore b/codemods-legacy/ethers/v6/transactions/.gitignore similarity index 100% rename from codemods/ethers/v6/transactions/.gitignore rename to codemods-legacy/ethers/v6/transactions/.gitignore diff --git a/codemods/ethers/v6/transactions/LICENSE b/codemods-legacy/ethers/v6/transactions/LICENSE similarity index 100% rename from codemods/ethers/v6/transactions/LICENSE rename to codemods-legacy/ethers/v6/transactions/LICENSE diff --git a/codemods/ethers/v6/transactions/README.md b/codemods-legacy/ethers/v6/transactions/README.md similarity index 100% rename from codemods/ethers/v6/transactions/README.md rename to codemods-legacy/ethers/v6/transactions/README.md diff --git a/codemods/ethers/v6/transactions/__testfixtures__/fixture1.input.ts b/codemods-legacy/ethers/v6/transactions/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/ethers/v6/transactions/__testfixtures__/fixture1.input.ts rename to codemods-legacy/ethers/v6/transactions/__testfixtures__/fixture1.input.ts diff --git a/codemods/ethers/v6/transactions/__testfixtures__/fixture1.output.ts b/codemods-legacy/ethers/v6/transactions/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/ethers/v6/transactions/__testfixtures__/fixture1.output.ts rename to codemods-legacy/ethers/v6/transactions/__testfixtures__/fixture1.output.ts diff --git a/codemods/ethers/v6/transactions/__testfixtures__/fixture2.input.ts b/codemods-legacy/ethers/v6/transactions/__testfixtures__/fixture2.input.ts similarity index 100% rename from codemods/ethers/v6/transactions/__testfixtures__/fixture2.input.ts rename to codemods-legacy/ethers/v6/transactions/__testfixtures__/fixture2.input.ts diff --git a/codemods/ethers/v6/transactions/__testfixtures__/fixture2.output.ts b/codemods-legacy/ethers/v6/transactions/__testfixtures__/fixture2.output.ts similarity index 100% rename from codemods/ethers/v6/transactions/__testfixtures__/fixture2.output.ts rename to codemods-legacy/ethers/v6/transactions/__testfixtures__/fixture2.output.ts diff --git a/codemods/ethers/v6/transactions/__testfixtures__/fixture3.input.ts b/codemods-legacy/ethers/v6/transactions/__testfixtures__/fixture3.input.ts similarity index 100% rename from codemods/ethers/v6/transactions/__testfixtures__/fixture3.input.ts rename to codemods-legacy/ethers/v6/transactions/__testfixtures__/fixture3.input.ts diff --git a/codemods/ethers/v6/transactions/__testfixtures__/fixture3.output.ts b/codemods-legacy/ethers/v6/transactions/__testfixtures__/fixture3.output.ts similarity index 100% rename from codemods/ethers/v6/transactions/__testfixtures__/fixture3.output.ts rename to codemods-legacy/ethers/v6/transactions/__testfixtures__/fixture3.output.ts diff --git a/codemods/ethers/v6/transactions/cdmd_dist/index.cjs b/codemods-legacy/ethers/v6/transactions/cdmd_dist/index.cjs similarity index 100% rename from codemods/ethers/v6/transactions/cdmd_dist/index.cjs rename to codemods-legacy/ethers/v6/transactions/cdmd_dist/index.cjs diff --git a/codemods-legacy/ethers/v6/transactions/package.json b/codemods-legacy/ethers/v6/transactions/package.json new file mode 100644 index 00000000..8c77b53e --- /dev/null +++ b/codemods-legacy/ethers/v6/transactions/package.json @@ -0,0 +1,24 @@ +{ + "name": "transaction-methods-refactoring", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "^5.2.2", + "vitest": "^1.0.1", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "yugal41735" +} diff --git a/codemods/ethers/v6/transactions/src/index.ts b/codemods-legacy/ethers/v6/transactions/src/index.ts similarity index 100% rename from codemods/ethers/v6/transactions/src/index.ts rename to codemods-legacy/ethers/v6/transactions/src/index.ts diff --git a/codemods/ethers/v6/transactions/test/test.ts b/codemods-legacy/ethers/v6/transactions/test/test.ts similarity index 100% rename from codemods/ethers/v6/transactions/test/test.ts rename to codemods-legacy/ethers/v6/transactions/test/test.ts diff --git a/codemods-legacy/ethers/v6/transactions/tsconfig.json b/codemods-legacy/ethers/v6/transactions/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/ethers/v6/transactions/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/openFeature/replace-feature-flags/vitest.config.ts b/codemods-legacy/ethers/v6/transactions/vitest.config.ts similarity index 100% rename from codemods/openFeature/replace-feature-flags/vitest.config.ts rename to codemods-legacy/ethers/v6/transactions/vitest.config.ts diff --git a/codemods/ethers/v6/utilities/.codemodrc.json b/codemods-legacy/ethers/v6/utilities/.codemodrc.json similarity index 100% rename from codemods/ethers/v6/utilities/.codemodrc.json rename to codemods-legacy/ethers/v6/utilities/.codemodrc.json diff --git a/codemods/ethers/v6/utilities/.gitignore b/codemods-legacy/ethers/v6/utilities/.gitignore similarity index 100% rename from codemods/ethers/v6/utilities/.gitignore rename to codemods-legacy/ethers/v6/utilities/.gitignore diff --git a/codemods/ethers/v6/utilities/LICENSE b/codemods-legacy/ethers/v6/utilities/LICENSE similarity index 100% rename from codemods/ethers/v6/utilities/LICENSE rename to codemods-legacy/ethers/v6/utilities/LICENSE diff --git a/codemods/ethers/v6/utilities/README.md b/codemods-legacy/ethers/v6/utilities/README.md similarity index 100% rename from codemods/ethers/v6/utilities/README.md rename to codemods-legacy/ethers/v6/utilities/README.md diff --git a/codemods/ethers/v6/utilities/__testfixtures__/fixture1.input.ts b/codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/ethers/v6/utilities/__testfixtures__/fixture1.input.ts rename to codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture1.input.ts diff --git a/codemods/ethers/v6/utilities/__testfixtures__/fixture1.output.ts b/codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/ethers/v6/utilities/__testfixtures__/fixture1.output.ts rename to codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture1.output.ts diff --git a/codemods/ethers/v6/utilities/__testfixtures__/fixture2.input.ts b/codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture2.input.ts similarity index 100% rename from codemods/ethers/v6/utilities/__testfixtures__/fixture2.input.ts rename to codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture2.input.ts diff --git a/codemods/ethers/v6/utilities/__testfixtures__/fixture2.output.ts b/codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture2.output.ts similarity index 100% rename from codemods/ethers/v6/utilities/__testfixtures__/fixture2.output.ts rename to codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture2.output.ts diff --git a/codemods/ethers/v6/utilities/__testfixtures__/fixture3.input.ts b/codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture3.input.ts similarity index 100% rename from codemods/ethers/v6/utilities/__testfixtures__/fixture3.input.ts rename to codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture3.input.ts diff --git a/codemods/ethers/v6/utilities/__testfixtures__/fixture3.output.ts b/codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture3.output.ts similarity index 100% rename from codemods/ethers/v6/utilities/__testfixtures__/fixture3.output.ts rename to codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture3.output.ts diff --git a/codemods/ethers/v6/utilities/__testfixtures__/fixture4.input.ts b/codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture4.input.ts similarity index 100% rename from codemods/ethers/v6/utilities/__testfixtures__/fixture4.input.ts rename to codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture4.input.ts diff --git a/codemods/ethers/v6/utilities/__testfixtures__/fixture4.output.ts b/codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture4.output.ts similarity index 100% rename from codemods/ethers/v6/utilities/__testfixtures__/fixture4.output.ts rename to codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture4.output.ts diff --git a/codemods/ethers/v6/utilities/__testfixtures__/fixture5.input.ts b/codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture5.input.ts similarity index 100% rename from codemods/ethers/v6/utilities/__testfixtures__/fixture5.input.ts rename to codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture5.input.ts diff --git a/codemods/ethers/v6/utilities/__testfixtures__/fixture5.output.ts b/codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture5.output.ts similarity index 100% rename from codemods/ethers/v6/utilities/__testfixtures__/fixture5.output.ts rename to codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture5.output.ts diff --git a/codemods/ethers/v6/utilities/__testfixtures__/fixture6.input.ts b/codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture6.input.ts similarity index 100% rename from codemods/ethers/v6/utilities/__testfixtures__/fixture6.input.ts rename to codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture6.input.ts diff --git a/codemods/ethers/v6/utilities/__testfixtures__/fixture6.output.ts b/codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture6.output.ts similarity index 100% rename from codemods/ethers/v6/utilities/__testfixtures__/fixture6.output.ts rename to codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture6.output.ts diff --git a/codemods/ethers/v6/utilities/__testfixtures__/fixture7.input.ts b/codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture7.input.ts similarity index 100% rename from codemods/ethers/v6/utilities/__testfixtures__/fixture7.input.ts rename to codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture7.input.ts diff --git a/codemods/ethers/v6/utilities/__testfixtures__/fixture7.output.ts b/codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture7.output.ts similarity index 100% rename from codemods/ethers/v6/utilities/__testfixtures__/fixture7.output.ts rename to codemods-legacy/ethers/v6/utilities/__testfixtures__/fixture7.output.ts diff --git a/codemods/ethers/v6/utilities/cdmd_dist/index.cjs b/codemods-legacy/ethers/v6/utilities/cdmd_dist/index.cjs similarity index 100% rename from codemods/ethers/v6/utilities/cdmd_dist/index.cjs rename to codemods-legacy/ethers/v6/utilities/cdmd_dist/index.cjs diff --git a/codemods-legacy/ethers/v6/utilities/package.json b/codemods-legacy/ethers/v6/utilities/package.json new file mode 100644 index 00000000..5d94ea45 --- /dev/null +++ b/codemods-legacy/ethers/v6/utilities/package.json @@ -0,0 +1,24 @@ +{ + "name": "ethers-utils-to-core-methods-migration", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "^5.2.2", + "vitest": "^1.0.1", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "yugal41735" +} diff --git a/codemods/ethers/v6/utilities/src/index.ts b/codemods-legacy/ethers/v6/utilities/src/index.ts similarity index 100% rename from codemods/ethers/v6/utilities/src/index.ts rename to codemods-legacy/ethers/v6/utilities/src/index.ts diff --git a/codemods/ethers/v6/utilities/test/test.ts b/codemods-legacy/ethers/v6/utilities/test/test.ts similarity index 100% rename from codemods/ethers/v6/utilities/test/test.ts rename to codemods-legacy/ethers/v6/utilities/test/test.ts diff --git a/codemods-legacy/ethers/v6/utilities/tsconfig.json b/codemods-legacy/ethers/v6/utilities/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/ethers/v6/utilities/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/react-router/4/move-HOC-to-global-scope/vitest.config.ts b/codemods-legacy/ethers/v6/utilities/vitest.config.ts similarity index 100% rename from codemods/react-router/4/move-HOC-to-global-scope/vitest.config.ts rename to codemods-legacy/ethers/v6/utilities/vitest.config.ts diff --git a/codemods/history/4/replace-state-object/.codemodrc.json b/codemods-legacy/history/4/replace-state-object/.codemodrc.json similarity index 100% rename from codemods/history/4/replace-state-object/.codemodrc.json rename to codemods-legacy/history/4/replace-state-object/.codemodrc.json diff --git a/codemods/history/4/replace-state-object/README.md b/codemods-legacy/history/4/replace-state-object/README.md similarity index 100% rename from codemods/history/4/replace-state-object/README.md rename to codemods-legacy/history/4/replace-state-object/README.md diff --git a/codemods-legacy/history/4/replace-state-object/package.json b/codemods-legacy/history/4/replace-state-object/package.json new file mode 100644 index 00000000..9481b57d --- /dev/null +++ b/codemods-legacy/history/4/replace-state-object/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-history-4-replace-state-object", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/history/4/replace-state-object/src/index.ts b/codemods-legacy/history/4/replace-state-object/src/index.ts similarity index 100% rename from codemods/history/4/replace-state-object/src/index.ts rename to codemods-legacy/history/4/replace-state-object/src/index.ts diff --git a/codemods-legacy/history/4/replace-state-object/test/test.ts b/codemods-legacy/history/4/replace-state-object/test/test.ts new file mode 100644 index 00000000..0ef024d1 --- /dev/null +++ b/codemods-legacy/history/4/replace-state-object/test/test.ts @@ -0,0 +1,67 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; +import { buildApi } from "@codemod-com/utilities"; +import type { FileInfo } from "jscodeshift"; +import transform from "../src/index.ts"; + +describe("history v4 replace-state-object", () => { + it("should extract `state` object into the second argument", async () => { + const input = ` + import createHistory from 'history/createBrowserHistory'; + + const history = createHistory(); + + history.push({ pathname: '/new-path', search: 'search', hash: 'hash', state: { key: 'value' } }); + `; + + const output = ` + import createHistory from 'history/createBrowserHistory'; + + const history = createHistory(); + + history.push({ pathname: '/new-path', search: 'search', hash: 'hash' }, { key: 'value' }); + `; + + const fileInfo: FileInfo = { + path: "index.js", + source: input, + }; + + const actualOutput = transform(fileInfo, buildApi("js")); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + output.replace(/\W/gm, ""), + ); + }); + + it("should do nothing if the argument is simply a string.", async () => { + const input = ` + import createHistory from 'history/createBrowserHistory'; + + const history = createHistory(); + + history.push('/new-path'); + `; + + const output = ` + import createHistory from 'history/createBrowserHistory'; + + const history = createHistory(); + + history.push('/new-path'); + `; + + const fileInfo: FileInfo = { + path: "index.js", + source: input, + }; + + const actualOutput = transform(fileInfo, buildApi("js")); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + output.replace(/\W/gm, ""), + ); + }); +}); diff --git a/codemods/history/4/replace-state-object/tsconfig.json b/codemods-legacy/history/4/replace-state-object/tsconfig.json similarity index 100% rename from codemods/history/4/replace-state-object/tsconfig.json rename to codemods-legacy/history/4/replace-state-object/tsconfig.json diff --git a/codemods/history/4/use-back/.codemodrc.json b/codemods-legacy/history/4/use-back/.codemodrc.json similarity index 100% rename from codemods/history/4/use-back/.codemodrc.json rename to codemods-legacy/history/4/use-back/.codemodrc.json diff --git a/codemods/history/4/use-back/README.md b/codemods-legacy/history/4/use-back/README.md similarity index 100% rename from codemods/history/4/use-back/README.md rename to codemods-legacy/history/4/use-back/README.md diff --git a/codemods-legacy/history/4/use-back/package.json b/codemods-legacy/history/4/use-back/package.json new file mode 100644 index 00000000..0e7ca8b0 --- /dev/null +++ b/codemods-legacy/history/4/use-back/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-history-4-use-back", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/history/4/use-back/src/index.ts b/codemods-legacy/history/4/use-back/src/index.ts similarity index 100% rename from codemods/history/4/use-back/src/index.ts rename to codemods-legacy/history/4/use-back/src/index.ts diff --git a/codemods-legacy/history/4/use-back/test/test.ts b/codemods-legacy/history/4/use-back/test/test.ts new file mode 100644 index 00000000..d6fdd8c4 --- /dev/null +++ b/codemods-legacy/history/4/use-back/test/test.ts @@ -0,0 +1,65 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; +import { buildApi, trimLicense } from "@codemod-com/utilities"; +import type { FileInfo } from "jscodeshift"; +import transform from "../src/index.ts"; + +describe("history v4 use-back", () => { + it("should replace history.goBack() with history.back()", async () => { + const input = ` + history.goBack(); + + const Component = () => { + const handleChange = () => { + history.goBack(); + }; + + useEffect(() => { + history.goBack(); + }, []); + + return ( +
+ +
+ ); + }; + `; + + const fileInfo: FileInfo = { + path: "index.js", + source: trimLicense(input), + }; + + const actualOutput = transform(fileInfo, buildApi("js")); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + trimLicense(output).replace(/\W/gm, ""), + ); + }); +}); diff --git a/codemods/history/4/use-back/tsconfig.json b/codemods-legacy/history/4/use-back/tsconfig.json similarity index 100% rename from codemods/history/4/use-back/tsconfig.json rename to codemods-legacy/history/4/use-back/tsconfig.json diff --git a/codemods/history/4/use-block/.codemodrc.json b/codemods-legacy/history/4/use-block/.codemodrc.json similarity index 100% rename from codemods/history/4/use-block/.codemodrc.json rename to codemods-legacy/history/4/use-block/.codemodrc.json diff --git a/codemods/history/4/use-block/README.md b/codemods-legacy/history/4/use-block/README.md similarity index 100% rename from codemods/history/4/use-block/README.md rename to codemods-legacy/history/4/use-block/README.md diff --git a/codemods-legacy/history/4/use-block/package.json b/codemods-legacy/history/4/use-block/package.json new file mode 100644 index 00000000..72822823 --- /dev/null +++ b/codemods-legacy/history/4/use-block/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-history-4-use-block", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/history/4/use-block/src/index.ts b/codemods-legacy/history/4/use-block/src/index.ts similarity index 100% rename from codemods/history/4/use-block/src/index.ts rename to codemods-legacy/history/4/use-block/src/index.ts diff --git a/codemods-legacy/history/4/use-block/test/test.ts b/codemods-legacy/history/4/use-block/test/test.ts new file mode 100644 index 00000000..0a88a97b --- /dev/null +++ b/codemods-legacy/history/4/use-block/test/test.ts @@ -0,0 +1,77 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; +import { buildApi } from "@codemod-com/utilities"; +import type { FileInfo } from "jscodeshift"; +import transform from "../src/index.ts"; + +describe("history v4 use-block", () => { + it("should replace history.listenBefore() with history.block() when location is used", async () => { + const input = ` + import createHistory from 'history/createBrowserHistory'; + + const history = createHistory(); + + history.listenBefore(location => { + console.log(location); + }); + `; + + const output = ` + import createHistory from 'history/createBrowserHistory'; + + const history = createHistory(); + + history.block(({ location }) => { + console.log(location); + }); + `; + + const fileInfo: FileInfo = { + path: "index.js", + source: input, + }; + + const actualOutput = transform(fileInfo, buildApi("js")); + + assert.deepEqual( + actualOutput?.replace(/[\s_;()]/gm, ""), + output.replace(/[\s_;()]/gm, ""), + ); + }); + + it("should replace history.listenBefore() with history.block() when both location and action are used", async () => { + const input = ` + import createHistory from 'history/createBrowserHistory'; + + const history = createHistory(); + + history.listenBefore((location, callback) => { + console.log(location); + callback(); + }); + `; + + const output = ` + import createHistory from 'history/createBrowserHistory'; + + const history = createHistory(); + + history.block(({ location, action }) => { + console.log(location); + action(); + }); + `; + + const fileInfo: FileInfo = { + path: "index.js", + source: input, + }; + + const actualOutput = transform(fileInfo, buildApi("js")); + + assert.deepEqual( + actualOutput?.replace(/[\s_;()]/gm, ""), + output.replace(/[\s_;()]/gm, ""), + ); + }); +}); diff --git a/codemods/history/4/use-block/tsconfig.json b/codemods-legacy/history/4/use-block/tsconfig.json similarity index 100% rename from codemods/history/4/use-block/tsconfig.json rename to codemods-legacy/history/4/use-block/tsconfig.json diff --git a/codemods/history/4/use-location/.codemodrc.json b/codemods-legacy/history/4/use-location/.codemodrc.json similarity index 100% rename from codemods/history/4/use-location/.codemodrc.json rename to codemods-legacy/history/4/use-location/.codemodrc.json diff --git a/codemods/history/4/use-location/README.md b/codemods-legacy/history/4/use-location/README.md similarity index 100% rename from codemods/history/4/use-location/README.md rename to codemods-legacy/history/4/use-location/README.md diff --git a/codemods-legacy/history/4/use-location/package.json b/codemods-legacy/history/4/use-location/package.json new file mode 100644 index 00000000..b08eb9ac --- /dev/null +++ b/codemods-legacy/history/4/use-location/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-history-4-use-location", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/history/4/use-location/src/index.ts b/codemods-legacy/history/4/use-location/src/index.ts similarity index 100% rename from codemods/history/4/use-location/src/index.ts rename to codemods-legacy/history/4/use-location/src/index.ts diff --git a/codemods-legacy/history/4/use-location/test/test.ts b/codemods-legacy/history/4/use-location/test/test.ts new file mode 100644 index 00000000..bc7d7ae7 --- /dev/null +++ b/codemods-legacy/history/4/use-location/test/test.ts @@ -0,0 +1,37 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; +import { buildApi, trimLicense } from "@codemod-com/utilities"; +import type { FileInfo } from "jscodeshift"; +import transform from "../src/index.ts"; + +describe("history v4 use-location", () => { + it("should replace history.getCurrentLocation() with history.location", async () => { + const input = ` + import createHistory from 'history/createBrowserHistory'; + + const history = createHistory(); + + const currentLocation = history.getCurrentLocation(); + `; + + const output = ` + import createHistory from 'history/createBrowserHistory'; + + const history = createHistory(); + + const currentLocation = history.location; + `; + + const fileInfo: FileInfo = { + path: "index.js", + source: trimLicense(input), + }; + + const actualOutput = transform(fileInfo, buildApi("js")); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + trimLicense(output).replace(/\W/gm, ""), + ); + }); +}); diff --git a/codemods/history/4/use-location/tsconfig.json b/codemods-legacy/history/4/use-location/tsconfig.json similarity index 100% rename from codemods/history/4/use-location/tsconfig.json rename to codemods-legacy/history/4/use-location/tsconfig.json diff --git a/codemods/i18n/.codemodrc.json b/codemods-legacy/i18n/.codemodrc.json similarity index 100% rename from codemods/i18n/.codemodrc.json rename to codemods-legacy/i18n/.codemodrc.json diff --git a/codemods/i18n/README.md b/codemods-legacy/i18n/README.md similarity index 100% rename from codemods/i18n/README.md rename to codemods-legacy/i18n/README.md diff --git a/codemods-legacy/i18n/package.json b/codemods-legacy/i18n/package.json new file mode 100644 index 00000000..1141ba66 --- /dev/null +++ b/codemods-legacy/i18n/package.json @@ -0,0 +1,27 @@ +{ + "name": "@codemod-com/codemod-i18n", + + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/filemod": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "memfs": "^4.6.0", + "ts-morph": "^19.0.0", + "jscodeshift": "^0.15.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/i18n/src/index.ts b/codemods-legacy/i18n/src/index.ts similarity index 100% rename from codemods/i18n/src/index.ts rename to codemods-legacy/i18n/src/index.ts diff --git a/codemods-legacy/i18n/test/test.ts b/codemods-legacy/i18n/test/test.ts new file mode 100644 index 00000000..8fa78caa --- /dev/null +++ b/codemods-legacy/i18n/test/test.ts @@ -0,0 +1,408 @@ +import { deepStrictEqual } from "node:assert"; +import { describe, it } from "node:test"; +import type { UnifiedFileSystem } from "@codemod-com/filemod"; +import { buildApi, executeFilemod } from "@codemod-com/filemod"; +import { buildPathAPI, buildUnifiedFileSystem } from "@codemod-com/utilities"; +import type { DirectoryJSON } from "memfs"; +import { Volume, createFsFromVolume } from "memfs"; +import tsmorph from "ts-morph"; +import { repomod } from "../src/index.ts"; + +const transform = async (json: DirectoryJSON) => { + const volume = Volume.fromJSON(json); + const fs = createFsFromVolume(volume); + + const unifiedFileSystem = buildUnifiedFileSystem(fs); + const pathApi = buildPathAPI("/"); + + const api = buildApi<{ + tsmorph: typeof tsmorph; + unifiedFileSystem: UnifiedFileSystem; + }>( + unifiedFileSystem, + () => ({ + tsmorph, + unifiedFileSystem, + }), + pathApi, + ); + + return executeFilemod(api, repomod, "/", {}, {}); +}; + +describe("i18n remove unused translations", () => { + it("should support t('translationKey')", async () => { + const A_CONTENT = ` + import { useLocale } from "@calcom/lib/hooks/useLocale"; + + export default function A() { + const { t } = useLocale(); + + return <> +

{t('key_1')}

+

{t( a ? 'key_2' : 'key_3')}

+ + } + `; + + const LOCALE_CONTENT = ` + { + "key_1": "key1", + "key_2": "key2", + "key_3": "key3", + "key_4": "key4", + } + `; + + const [upsertDataCommand] = await transform({ + "/opt/project/components/A.tsx": A_CONTENT, + "/opt/project/public/static/locales/en/common.json": LOCALE_CONTENT, + }); + + const expectedResult = ` + { + "key_1": "key1", + "key_2": "key2", + "key_3": "key3", + } + `; + deepStrictEqual(upsertDataCommand?.kind, "upsertFile"); + + deepStrictEqual( + upsertDataCommand.path, + "/opt/project/public/static/locales/en/common.json", + ); + + deepStrictEqual( + upsertDataCommand.newData.replace(/\W/gm, ""), + expectedResult.replace(/\W/gm, ""), + ); + }); + + it("should support props.language('translationKey')", async () => { + const A_CONTENT = ` + import { useLocale } from "@calcom/lib/hooks/useLocale"; + + export default function A(props) { + return

{props.language('key_1')}

+ } + `; + + const LOCALE_CONTENT = ` + { + "key_1": "key1", + "key_2": "key2" + } + `; + + const [upsertDataCommand] = await transform({ + "/opt/project/components/A.tsx": A_CONTENT, + "/opt/project/public/static/locales/en/common.json": LOCALE_CONTENT, + }); + + const expectedResult = ` + { + "key_1": "key1" + } + `; + deepStrictEqual(upsertDataCommand?.kind, "upsertFile"); + + deepStrictEqual( + upsertDataCommand.path, + "/opt/project/public/static/locales/en/common.json", + ); + + deepStrictEqual( + upsertDataCommand.newData.replace(/\W/gm, ""), + expectedResult.replace(/\W/gm, ""), + ); + }); + + it("should support this.getTextBody('translationKey1', 'translationText2')", async () => { + const A_CONTENT = ` + import { useLocale } from "@calcom/lib/hooks/useLocale"; + + export default class A extends B { + protected c() { + return { + text: this.getTextBody("key_1", "key_2"), + }; + } + } + `; + + const LOCALE_CONTENT = ` + { + "key_1": "key1", + "key_2": "key2", + "key_3": "key3, + } + `; + + const [upsertDataCommand] = await transform({ + "/opt/project/components/A.tsx": A_CONTENT, + "/opt/project/public/static/locales/en/common.json": LOCALE_CONTENT, + }); + + const expectedResult = ` + { + "key_1": "key1", + "key_2": "key2", + } + `; + deepStrictEqual(upsertDataCommand?.kind, "upsertFile"); + + deepStrictEqual( + upsertDataCommand.path, + "/opt/project/public/static/locales/en/common.json", + ); + + deepStrictEqual( + upsertDataCommand.newData.replace(/\W/gm, ""), + expectedResult.replace(/\W/gm, ""), + ); + }); + + it("should support a.translate('translationKey')", async () => { + const A_CONTENT = ` + import { useLocale } from "@calcom/lib/hooks/useLocale"; + + export default function A(props) { + return

{props.a.b.c.translate('key_1')}

+ } + `; + + const LOCALE_CONTENT = ` + { + "key_1": "key1", + "key_2": "key2" + } + `; + + const [upsertDataCommand] = await transform({ + "/opt/project/components/A.tsx": A_CONTENT, + "/opt/project/public/static/locales/en/common.json": LOCALE_CONTENT, + }); + + const expectedResult = ` + { + "key_1": "key1" + } + `; + deepStrictEqual(upsertDataCommand?.kind, "upsertFile"); + + deepStrictEqual( + upsertDataCommand.path, + "/opt/project/public/static/locales/en/common.json", + ); + + deepStrictEqual( + upsertDataCommand.newData.replace(/\W/gm, ""), + expectedResult.replace(/\W/gm, ""), + ); + }); + + it("should support ", async () => { + const A_CONTENT = ` + import { Trans } from "next-i18next"; + + export default function A() { + return + } + `; + + const LOCALE_CONTENT = ` + { + "key_1": "key1", + "key_2": "key2" + } + `; + + const [upsertDataCommand] = await transform({ + "/opt/project/components/A.tsx": A_CONTENT, + "/opt/project/public/static/locales/en/common.json": LOCALE_CONTENT, + }); + + const expectedResult = ` + { + "key_1": "key1" + } + `; + deepStrictEqual(upsertDataCommand?.kind, "upsertFile"); + + deepStrictEqual( + upsertDataCommand.path, + "/opt/project/public/static/locales/en/common.json", + ); + + deepStrictEqual( + upsertDataCommand.newData.replace(/\W/gm, ""), + expectedResult.replace(/\W/gm, ""), + ); + }); + + it("should support ", async () => { + const A_CONTENT = ` + import { Trans } from "next-i18next"; + + const variable1 = "1"; + const variable2 = "2"; + + export default function A() { + return <> + +

{t(\`key_\${variable2}\`)}

+ + } + `; + + const LOCALE_CONTENT = ` + { + "aaakey": "aaakey", + "key_1": "key1", + "key_2": "key2" + } + `; + + const [upsertDataCommand] = await transform({ + "/opt/project/components/A.tsx": A_CONTENT, + "/opt/project/public/static/locales/en/common.json": LOCALE_CONTENT, + }); + + const expectedResult = ` + { + "key_1": "key1", + "key_2": "key2" + } + `; + deepStrictEqual(upsertDataCommand?.kind, "upsertFile"); + + deepStrictEqual( + upsertDataCommand.path, + "/opt/project/public/static/locales/en/common.json", + ); + + deepStrictEqual( + upsertDataCommand.newData.replace(/\W/gm, ""), + expectedResult.replace(/\W/gm, ""), + ); + }); + + it("should support ", async () => { + const A_CONTENT = ` + import { Trans } from "next-i18next"; + + const variable = "1"; + + export default function A() { + return <> + + + } + `; + + const LOCALE_CONTENT = ` + { + "unused_key": "", + "key_tail": "", + } + `; + + const [upsertDataCommand] = await transform({ + "/opt/project/components/A.tsx": A_CONTENT, + "/opt/project/public/static/locales/en/common.json": LOCALE_CONTENT, + }); + + const expectedResult = ` + { + "key_tail": "", + } + `; + deepStrictEqual(upsertDataCommand?.kind, "upsertFile"); + + deepStrictEqual( + upsertDataCommand.path, + "/opt/project/public/static/locales/en/common.json", + ); + + deepStrictEqual( + upsertDataCommand.newData.replace(/\W/gm, ""), + expectedResult.replace(/\W/gm, ""), + ); + }); + + it("should support t(`${variable}_tail`)", async () => { + const A_CONTENT = ` + t(\`\${variable2}_tail\`); + `; + + const LOCALE_CONTENT = ` + { + "unused_key": "", + "key_tail": "", + } + `; + + const [upsertDataCommand] = await transform({ + "/opt/project/components/A.tsx": A_CONTENT, + "/opt/project/public/static/locales/en/common.json": LOCALE_CONTENT, + }); + + const expectedResult = ` + { + "key_tail": "", + } + `; + deepStrictEqual(upsertDataCommand?.kind, "upsertFile"); + + deepStrictEqual( + upsertDataCommand.path, + "/opt/project/public/static/locales/en/common.json", + ); + + deepStrictEqual( + upsertDataCommand.newData.replace(/\W/gm, ""), + expectedResult.replace(/\W/gm, ""), + ); + }); + + it("should consider snake_case component props i18n keys>", async () => { + const A_CONTENT = ` + export default function Component() { + return + } + `; + + const LOCALE_CONTENT = ` + { + "unused_key": "", + "key_1": "", + "key_2": "", + } + `; + + const [upsertDataCommand] = await transform({ + "/opt/project/components/A.tsx": A_CONTENT, + "/opt/project/public/static/locales/en/common.json": LOCALE_CONTENT, + }); + + const expectedResult = ` + { + "key_1": "", + "key_2": "", + } + `; + + deepStrictEqual(upsertDataCommand?.kind, "upsertFile"); + + deepStrictEqual( + upsertDataCommand.path, + "/opt/project/public/static/locales/en/common.json", + ); + + deepStrictEqual( + upsertDataCommand.newData.replace(/\W/gm, ""), + expectedResult.replace(/\W/gm, ""), + ); + }); +}); diff --git a/codemods/i18n/tsconfig.json b/codemods-legacy/i18n/tsconfig.json similarity index 100% rename from codemods/i18n/tsconfig.json rename to codemods-legacy/i18n/tsconfig.json diff --git a/codemods/immutable/0/add-deprecation-comment/.codemodrc.json b/codemods-legacy/immutable/0/add-deprecation-comment/.codemodrc.json similarity index 100% rename from codemods/immutable/0/add-deprecation-comment/.codemodrc.json rename to codemods-legacy/immutable/0/add-deprecation-comment/.codemodrc.json diff --git a/codemods/immutable/0/add-deprecation-comment/README.md b/codemods-legacy/immutable/0/add-deprecation-comment/README.md similarity index 100% rename from codemods/immutable/0/add-deprecation-comment/README.md rename to codemods-legacy/immutable/0/add-deprecation-comment/README.md diff --git a/codemods-legacy/immutable/0/add-deprecation-comment/package.json b/codemods-legacy/immutable/0/add-deprecation-comment/package.json new file mode 100644 index 00000000..d65af0e2 --- /dev/null +++ b/codemods-legacy/immutable/0/add-deprecation-comment/package.json @@ -0,0 +1,18 @@ +{ + "name": "@codemod-com/codemod-immutable-0-add-deprecation-comment", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/immutable/0/add-deprecation-comment/src/index.ts b/codemods-legacy/immutable/0/add-deprecation-comment/src/index.ts similarity index 100% rename from codemods/immutable/0/add-deprecation-comment/src/index.ts rename to codemods-legacy/immutable/0/add-deprecation-comment/src/index.ts diff --git a/codemods/immutable/0/add-deprecation-comment/tsconfig.json b/codemods-legacy/immutable/0/add-deprecation-comment/tsconfig.json similarity index 100% rename from codemods/immutable/0/add-deprecation-comment/tsconfig.json rename to codemods-legacy/immutable/0/add-deprecation-comment/tsconfig.json diff --git a/codemods/immutable/0/nest-from-js/.codemodrc.json b/codemods-legacy/immutable/0/nest-from-js/.codemodrc.json similarity index 100% rename from codemods/immutable/0/nest-from-js/.codemodrc.json rename to codemods-legacy/immutable/0/nest-from-js/.codemodrc.json diff --git a/codemods/immutable/0/nest-from-js/README.md b/codemods-legacy/immutable/0/nest-from-js/README.md similarity index 100% rename from codemods/immutable/0/nest-from-js/README.md rename to codemods-legacy/immutable/0/nest-from-js/README.md diff --git a/codemods-legacy/immutable/0/nest-from-js/package.json b/codemods-legacy/immutable/0/nest-from-js/package.json new file mode 100644 index 00000000..b1cf51bd --- /dev/null +++ b/codemods-legacy/immutable/0/nest-from-js/package.json @@ -0,0 +1,18 @@ +{ + "name": "@codemod-com/codemod-immutable-0-nest-from-js", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/immutable/0/nest-from-js/src/index.ts b/codemods-legacy/immutable/0/nest-from-js/src/index.ts similarity index 100% rename from codemods/immutable/0/nest-from-js/src/index.ts rename to codemods-legacy/immutable/0/nest-from-js/src/index.ts diff --git a/codemods/immutable/0/nest-from-js/tsconfig.json b/codemods-legacy/immutable/0/nest-from-js/tsconfig.json similarity index 100% rename from codemods/immutable/0/nest-from-js/tsconfig.json rename to codemods-legacy/immutable/0/nest-from-js/tsconfig.json diff --git a/codemods/immutable/0/remove-from-js/.codemodrc.json b/codemods-legacy/immutable/0/remove-from-js/.codemodrc.json similarity index 100% rename from codemods/immutable/0/remove-from-js/.codemodrc.json rename to codemods-legacy/immutable/0/remove-from-js/.codemodrc.json diff --git a/codemods/immutable/0/remove-from-js/README.md b/codemods-legacy/immutable/0/remove-from-js/README.md similarity index 100% rename from codemods/immutable/0/remove-from-js/README.md rename to codemods-legacy/immutable/0/remove-from-js/README.md diff --git a/codemods-legacy/immutable/0/remove-from-js/package.json b/codemods-legacy/immutable/0/remove-from-js/package.json new file mode 100644 index 00000000..309e788e --- /dev/null +++ b/codemods-legacy/immutable/0/remove-from-js/package.json @@ -0,0 +1,18 @@ +{ + "name": "@codemod-com/codemod-immutable-0-remove-from-js", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/immutable/0/remove-from-js/src/index.ts b/codemods-legacy/immutable/0/remove-from-js/src/index.ts similarity index 100% rename from codemods/immutable/0/remove-from-js/src/index.ts rename to codemods-legacy/immutable/0/remove-from-js/src/index.ts diff --git a/codemods/immutable/0/remove-from-js/tsconfig.json b/codemods-legacy/immutable/0/remove-from-js/tsconfig.json similarity index 100% rename from codemods/immutable/0/remove-from-js/tsconfig.json rename to codemods-legacy/immutable/0/remove-from-js/tsconfig.json diff --git a/codemods/immutable/0/remove-import/.codemodrc.json b/codemods-legacy/immutable/0/remove-import/.codemodrc.json similarity index 100% rename from codemods/immutable/0/remove-import/.codemodrc.json rename to codemods-legacy/immutable/0/remove-import/.codemodrc.json diff --git a/codemods/immutable/0/remove-import/README.md b/codemods-legacy/immutable/0/remove-import/README.md similarity index 100% rename from codemods/immutable/0/remove-import/README.md rename to codemods-legacy/immutable/0/remove-import/README.md diff --git a/codemods-legacy/immutable/0/remove-import/package.json b/codemods-legacy/immutable/0/remove-import/package.json new file mode 100644 index 00000000..2a75e2b4 --- /dev/null +++ b/codemods-legacy/immutable/0/remove-import/package.json @@ -0,0 +1,18 @@ +{ + "name": "@codemod-com/codemod-immutable-0-remove-import", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/immutable/0/remove-import/src/index.ts b/codemods-legacy/immutable/0/remove-import/src/index.ts similarity index 100% rename from codemods/immutable/0/remove-import/src/index.ts rename to codemods-legacy/immutable/0/remove-import/src/index.ts diff --git a/codemods/immutable/0/remove-import/tsconfig.json b/codemods-legacy/immutable/0/remove-import/tsconfig.json similarity index 100% rename from codemods/immutable/0/remove-import/tsconfig.json rename to codemods-legacy/immutable/0/remove-import/tsconfig.json diff --git a/codemods/immutable/0/remove-to-js/.codemodrc.json b/codemods-legacy/immutable/0/remove-to-js/.codemodrc.json similarity index 100% rename from codemods/immutable/0/remove-to-js/.codemodrc.json rename to codemods-legacy/immutable/0/remove-to-js/.codemodrc.json diff --git a/codemods/immutable/0/remove-to-js/README.md b/codemods-legacy/immutable/0/remove-to-js/README.md similarity index 100% rename from codemods/immutable/0/remove-to-js/README.md rename to codemods-legacy/immutable/0/remove-to-js/README.md diff --git a/codemods-legacy/immutable/0/remove-to-js/package.json b/codemods-legacy/immutable/0/remove-to-js/package.json new file mode 100644 index 00000000..721d7e2c --- /dev/null +++ b/codemods-legacy/immutable/0/remove-to-js/package.json @@ -0,0 +1,18 @@ +{ + "name": "@codemod-com/codemod-immutable-0-remove-to-js", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/immutable/0/remove-to-js/src/index.ts b/codemods-legacy/immutable/0/remove-to-js/src/index.ts similarity index 100% rename from codemods/immutable/0/remove-to-js/src/index.ts rename to codemods-legacy/immutable/0/remove-to-js/src/index.ts diff --git a/codemods/immutable/0/remove-to-js/tsconfig.json b/codemods-legacy/immutable/0/remove-to-js/tsconfig.json similarity index 100% rename from codemods/immutable/0/remove-to-js/tsconfig.json rename to codemods-legacy/immutable/0/remove-to-js/tsconfig.json diff --git a/codemods/immutable/0/replace-get-in/.codemodrc.json b/codemods-legacy/immutable/0/replace-get-in/.codemodrc.json similarity index 100% rename from codemods/immutable/0/replace-get-in/.codemodrc.json rename to codemods-legacy/immutable/0/replace-get-in/.codemodrc.json diff --git a/codemods/immutable/0/replace-get-in/README.md b/codemods-legacy/immutable/0/replace-get-in/README.md similarity index 100% rename from codemods/immutable/0/replace-get-in/README.md rename to codemods-legacy/immutable/0/replace-get-in/README.md diff --git a/codemods-legacy/immutable/0/replace-get-in/package.json b/codemods-legacy/immutable/0/replace-get-in/package.json new file mode 100644 index 00000000..ccc6db5c --- /dev/null +++ b/codemods-legacy/immutable/0/replace-get-in/package.json @@ -0,0 +1,18 @@ +{ + "name": "@codemod-com/codemod-immutable-0-replace-get-in", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/immutable/0/replace-get-in/src/index.ts b/codemods-legacy/immutable/0/replace-get-in/src/index.ts similarity index 100% rename from codemods/immutable/0/replace-get-in/src/index.ts rename to codemods-legacy/immutable/0/replace-get-in/src/index.ts diff --git a/codemods/immutable/0/replace-get-in/tsconfig.json b/codemods-legacy/immutable/0/replace-get-in/tsconfig.json similarity index 100% rename from codemods/immutable/0/replace-get-in/tsconfig.json rename to codemods-legacy/immutable/0/replace-get-in/tsconfig.json diff --git a/codemods/immutable/0/replace-get/.codemodrc.json b/codemods-legacy/immutable/0/replace-get/.codemodrc.json similarity index 100% rename from codemods/immutable/0/replace-get/.codemodrc.json rename to codemods-legacy/immutable/0/replace-get/.codemodrc.json diff --git a/codemods/immutable/0/replace-get/README.md b/codemods-legacy/immutable/0/replace-get/README.md similarity index 100% rename from codemods/immutable/0/replace-get/README.md rename to codemods-legacy/immutable/0/replace-get/README.md diff --git a/codemods-legacy/immutable/0/replace-get/package.json b/codemods-legacy/immutable/0/replace-get/package.json new file mode 100644 index 00000000..dab8051b --- /dev/null +++ b/codemods-legacy/immutable/0/replace-get/package.json @@ -0,0 +1,18 @@ +{ + "name": "@codemod-com/codemod-immutable-0-replace-get", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/immutable/0/replace-get/src/index.ts b/codemods-legacy/immutable/0/replace-get/src/index.ts similarity index 100% rename from codemods/immutable/0/replace-get/src/index.ts rename to codemods-legacy/immutable/0/replace-get/src/index.ts diff --git a/codemods/immutable/0/replace-get/tsconfig.json b/codemods-legacy/immutable/0/replace-get/tsconfig.json similarity index 100% rename from codemods/immutable/0/replace-get/tsconfig.json rename to codemods-legacy/immutable/0/replace-get/tsconfig.json diff --git a/codemods/immutable/0/replace-merge/.codemodrc.json b/codemods-legacy/immutable/0/replace-merge/.codemodrc.json similarity index 100% rename from codemods/immutable/0/replace-merge/.codemodrc.json rename to codemods-legacy/immutable/0/replace-merge/.codemodrc.json diff --git a/codemods/immutable/0/replace-merge/README.md b/codemods-legacy/immutable/0/replace-merge/README.md similarity index 100% rename from codemods/immutable/0/replace-merge/README.md rename to codemods-legacy/immutable/0/replace-merge/README.md diff --git a/codemods-legacy/immutable/0/replace-merge/package.json b/codemods-legacy/immutable/0/replace-merge/package.json new file mode 100644 index 00000000..fd3f2a95 --- /dev/null +++ b/codemods-legacy/immutable/0/replace-merge/package.json @@ -0,0 +1,18 @@ +{ + "name": "@codemod-com/codemod-immutable-0-replace-merge", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/immutable/0/replace-merge/src/index.ts b/codemods-legacy/immutable/0/replace-merge/src/index.ts similarity index 100% rename from codemods/immutable/0/replace-merge/src/index.ts rename to codemods-legacy/immutable/0/replace-merge/src/index.ts diff --git a/codemods/immutable/0/replace-merge/tsconfig.json b/codemods-legacy/immutable/0/replace-merge/tsconfig.json similarity index 100% rename from codemods/immutable/0/replace-merge/tsconfig.json rename to codemods-legacy/immutable/0/replace-merge/tsconfig.json diff --git a/codemods/immutable/0/replace-set-in/.codemodrc.json b/codemods-legacy/immutable/0/replace-set-in/.codemodrc.json similarity index 100% rename from codemods/immutable/0/replace-set-in/.codemodrc.json rename to codemods-legacy/immutable/0/replace-set-in/.codemodrc.json diff --git a/codemods/immutable/0/replace-set-in/README.md b/codemods-legacy/immutable/0/replace-set-in/README.md similarity index 100% rename from codemods/immutable/0/replace-set-in/README.md rename to codemods-legacy/immutable/0/replace-set-in/README.md diff --git a/codemods-legacy/immutable/0/replace-set-in/package.json b/codemods-legacy/immutable/0/replace-set-in/package.json new file mode 100644 index 00000000..29bf5971 --- /dev/null +++ b/codemods-legacy/immutable/0/replace-set-in/package.json @@ -0,0 +1,18 @@ +{ + "name": "@codemod-com/codemod-immutable-0-replace-set-in", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/immutable/0/replace-set-in/src/index.ts b/codemods-legacy/immutable/0/replace-set-in/src/index.ts similarity index 100% rename from codemods/immutable/0/replace-set-in/src/index.ts rename to codemods-legacy/immutable/0/replace-set-in/src/index.ts diff --git a/codemods/immutable/0/replace-set-in/tsconfig.json b/codemods-legacy/immutable/0/replace-set-in/tsconfig.json similarity index 100% rename from codemods/immutable/0/replace-set-in/tsconfig.json rename to codemods-legacy/immutable/0/replace-set-in/tsconfig.json diff --git a/codemods/immutable/0/replace-set/.codemodrc.json b/codemods-legacy/immutable/0/replace-set/.codemodrc.json similarity index 100% rename from codemods/immutable/0/replace-set/.codemodrc.json rename to codemods-legacy/immutable/0/replace-set/.codemodrc.json diff --git a/codemods/immutable/0/replace-set/README.md b/codemods-legacy/immutable/0/replace-set/README.md similarity index 100% rename from codemods/immutable/0/replace-set/README.md rename to codemods-legacy/immutable/0/replace-set/README.md diff --git a/codemods-legacy/immutable/0/replace-set/package.json b/codemods-legacy/immutable/0/replace-set/package.json new file mode 100644 index 00000000..c30cb0dd --- /dev/null +++ b/codemods-legacy/immutable/0/replace-set/package.json @@ -0,0 +1,18 @@ +{ + "name": "@codemod-com/codemod-immutable-0-replace-set", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/immutable/0/replace-set/src/index.ts b/codemods-legacy/immutable/0/replace-set/src/index.ts similarity index 100% rename from codemods/immutable/0/replace-set/src/index.ts rename to codemods-legacy/immutable/0/replace-set/src/index.ts diff --git a/codemods/immutable/0/replace-set/tsconfig.json b/codemods-legacy/immutable/0/replace-set/tsconfig.json similarity index 100% rename from codemods/immutable/0/replace-set/tsconfig.json rename to codemods-legacy/immutable/0/replace-set/tsconfig.json diff --git a/codemods/immutable/4/isterable-to-iscollection/.codemodrc.json b/codemods-legacy/immutable/4/isterable-to-iscollection/.codemodrc.json similarity index 100% rename from codemods/immutable/4/isterable-to-iscollection/.codemodrc.json rename to codemods-legacy/immutable/4/isterable-to-iscollection/.codemodrc.json diff --git a/codemods/immutable/4/isterable-to-iscollection/README.md b/codemods-legacy/immutable/4/isterable-to-iscollection/README.md similarity index 100% rename from codemods/immutable/4/isterable-to-iscollection/README.md rename to codemods-legacy/immutable/4/isterable-to-iscollection/README.md diff --git a/codemods-legacy/immutable/4/isterable-to-iscollection/package.json b/codemods-legacy/immutable/4/isterable-to-iscollection/package.json new file mode 100644 index 00000000..a4f17fc2 --- /dev/null +++ b/codemods-legacy/immutable/4/isterable-to-iscollection/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-immutable-4-isterable-to-iscollection", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/immutable/4/isterable-to-iscollection/src/index.ts b/codemods-legacy/immutable/4/isterable-to-iscollection/src/index.ts similarity index 100% rename from codemods/immutable/4/isterable-to-iscollection/src/index.ts rename to codemods-legacy/immutable/4/isterable-to-iscollection/src/index.ts diff --git a/codemods/immutable/4/isterable-to-iscollection/test/test.ts b/codemods-legacy/immutable/4/isterable-to-iscollection/test/test.ts similarity index 100% rename from codemods/immutable/4/isterable-to-iscollection/test/test.ts rename to codemods-legacy/immutable/4/isterable-to-iscollection/test/test.ts diff --git a/codemods/immutable/4/isterable-to-iscollection/tsconfig.json b/codemods-legacy/immutable/4/isterable-to-iscollection/tsconfig.json similarity index 100% rename from codemods/immutable/4/isterable-to-iscollection/tsconfig.json rename to codemods-legacy/immutable/4/isterable-to-iscollection/tsconfig.json diff --git a/codemods/react/19/remove-legacy-context/vitest.config.ts b/codemods-legacy/immutable/4/isterable-to-iscollection/vitest.config.ts similarity index 100% rename from codemods/react/19/remove-legacy-context/vitest.config.ts rename to codemods-legacy/immutable/4/isterable-to-iscollection/vitest.config.ts diff --git a/codemods/immutable/4/map-to-array/.codemodrc.json b/codemods-legacy/immutable/4/map-to-array/.codemodrc.json similarity index 100% rename from codemods/immutable/4/map-to-array/.codemodrc.json rename to codemods-legacy/immutable/4/map-to-array/.codemodrc.json diff --git a/codemods/immutable/4/map-to-array/README.md b/codemods-legacy/immutable/4/map-to-array/README.md similarity index 100% rename from codemods/immutable/4/map-to-array/README.md rename to codemods-legacy/immutable/4/map-to-array/README.md diff --git a/codemods-legacy/immutable/4/map-to-array/package.json b/codemods-legacy/immutable/4/map-to-array/package.json new file mode 100644 index 00000000..0758bc3c --- /dev/null +++ b/codemods-legacy/immutable/4/map-to-array/package.json @@ -0,0 +1,18 @@ +{ + "name": "@codemod-com/codemod-immutable-4-map-to-array", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/immutable/4/map-to-array/src/index.js b/codemods-legacy/immutable/4/map-to-array/src/index.js similarity index 100% rename from codemods/immutable/4/map-to-array/src/index.js rename to codemods-legacy/immutable/4/map-to-array/src/index.js diff --git a/codemods/immutable/4/map-to-array/tsconfig.json b/codemods-legacy/immutable/4/map-to-array/tsconfig.json similarity index 100% rename from codemods/immutable/4/map-to-array/tsconfig.json rename to codemods-legacy/immutable/4/map-to-array/tsconfig.json diff --git a/codemods/immutable/4/rename-to-seq/.codemodrc.json b/codemods-legacy/immutable/4/rename-to-seq/.codemodrc.json similarity index 100% rename from codemods/immutable/4/rename-to-seq/.codemodrc.json rename to codemods-legacy/immutable/4/rename-to-seq/.codemodrc.json diff --git a/codemods/immutable/4/rename-to-seq/README.md b/codemods-legacy/immutable/4/rename-to-seq/README.md similarity index 100% rename from codemods/immutable/4/rename-to-seq/README.md rename to codemods-legacy/immutable/4/rename-to-seq/README.md diff --git a/codemods-legacy/immutable/4/rename-to-seq/package.json b/codemods-legacy/immutable/4/rename-to-seq/package.json new file mode 100644 index 00000000..9825db57 --- /dev/null +++ b/codemods-legacy/immutable/4/rename-to-seq/package.json @@ -0,0 +1,18 @@ +{ + "name": "@codemod-com/codemod-immutable-4-rename-to-seq", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/immutable/4/rename-to-seq/src/index.js b/codemods-legacy/immutable/4/rename-to-seq/src/index.js similarity index 100% rename from codemods/immutable/4/rename-to-seq/src/index.js rename to codemods-legacy/immutable/4/rename-to-seq/src/index.js diff --git a/codemods/immutable/4/rename-to-seq/tsconfig.json b/codemods-legacy/immutable/4/rename-to-seq/tsconfig.json similarity index 100% rename from codemods/immutable/4/rename-to-seq/tsconfig.json rename to codemods-legacy/immutable/4/rename-to-seq/tsconfig.json diff --git a/codemods/jasmine/5.0/handling_env-execute/.codemodrc.json b/codemods-legacy/jasmine/5.0/handling_env-execute/.codemodrc.json similarity index 100% rename from codemods/jasmine/5.0/handling_env-execute/.codemodrc.json rename to codemods-legacy/jasmine/5.0/handling_env-execute/.codemodrc.json diff --git a/codemods/jasmine/5.0/handling_env-execute/.gitignore b/codemods-legacy/jasmine/5.0/handling_env-execute/.gitignore similarity index 100% rename from codemods/jasmine/5.0/handling_env-execute/.gitignore rename to codemods-legacy/jasmine/5.0/handling_env-execute/.gitignore diff --git a/codemods/jasmine/5.0/handling_env-execute/LICENSE b/codemods-legacy/jasmine/5.0/handling_env-execute/LICENSE similarity index 100% rename from codemods/jasmine/5.0/handling_env-execute/LICENSE rename to codemods-legacy/jasmine/5.0/handling_env-execute/LICENSE diff --git a/codemods/jasmine/5.0/handling_env-execute/README.md b/codemods-legacy/jasmine/5.0/handling_env-execute/README.md similarity index 100% rename from codemods/jasmine/5.0/handling_env-execute/README.md rename to codemods-legacy/jasmine/5.0/handling_env-execute/README.md diff --git a/codemods/jasmine/5.0/handling_env-execute/__testfixtures__/fixture1.input.ts b/codemods-legacy/jasmine/5.0/handling_env-execute/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/jasmine/5.0/handling_env-execute/__testfixtures__/fixture1.input.ts rename to codemods-legacy/jasmine/5.0/handling_env-execute/__testfixtures__/fixture1.input.ts diff --git a/codemods/jasmine/5.0/handling_env-execute/__testfixtures__/fixture1.output.ts b/codemods-legacy/jasmine/5.0/handling_env-execute/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/jasmine/5.0/handling_env-execute/__testfixtures__/fixture1.output.ts rename to codemods-legacy/jasmine/5.0/handling_env-execute/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/jasmine/5.0/handling_env-execute/package.json b/codemods-legacy/jasmine/5.0/handling_env-execute/package.json new file mode 100644 index 00000000..55b57c45 --- /dev/null +++ b/codemods-legacy/jasmine/5.0/handling_env-execute/package.json @@ -0,0 +1,23 @@ +{ + "name": "handling-env-execute", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1" + }, + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "yugal41735" +} diff --git a/codemods-legacy/jasmine/5.0/handling_env-execute/src/index.ts b/codemods-legacy/jasmine/5.0/handling_env-execute/src/index.ts new file mode 100644 index 00000000..ce1b4030 --- /dev/null +++ b/codemods-legacy/jasmine/5.0/handling_env-execute/src/index.ts @@ -0,0 +1,32 @@ +import type { API, FileInfo } from "jscodeshift"; + +export default function transformer(fileInfo: FileInfo, api: API) { + const j = api.jscodeshift; + const root = j(fileInfo.source); + + // Find all CallExpressions where env.execute is called with a callback + root + .find(j.CallExpression, { + callee: { + type: "MemberExpression", + object: { name: "env" }, + property: { name: "execute" }, + }, + arguments: (args: any[]) => + args.length === 2 && j.FunctionExpression.check(args[1]), + }) + .forEach((path) => { + const callExpression = path.node; + + // Replace the function expression argument with async/await syntax + callExpression.arguments = []; + + // Wrap in an await expression + const awaitExpression = j.awaitExpression(callExpression); + + // Replace the old statement with await env.execute() + j(path).replaceWith(awaitExpression); + }); + + return root.toSource(); +} diff --git a/codemods-legacy/jasmine/5.0/handling_env-execute/test/test.ts b/codemods-legacy/jasmine/5.0/handling_env-execute/test/test.ts new file mode 100644 index 00000000..0aaded2b --- /dev/null +++ b/codemods-legacy/jasmine/5.0/handling_env-execute/test/test.ts @@ -0,0 +1,51 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; +import { readFile } from "node:fs/promises"; +import { join } from "node:path"; +import jscodeshift from "jscodeshift"; +import type { API } from "jscodeshift"; +import transform from "../src/index.ts"; + +const __dirname = new URL(".", import.meta.url).pathname; + +const buildApi = (parser: string | undefined): API => ({ + j: parser ? jscodeshift.withParser(parser) : jscodeshift, + jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, + stats: () => { + console.error( + "The stats function was called, which is not supported on purpose", + ); + }, + report: () => { + console.error( + "The report function was called, which is not supported on purpose", + ); + }, +}); + +describe("three_transform_logluvloader", () => { + it("test #1", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); +}); diff --git a/codemods-legacy/jasmine/5.0/handling_env-execute/tsconfig.json b/codemods-legacy/jasmine/5.0/handling_env-execute/tsconfig.json new file mode 100644 index 00000000..7757ca16 --- /dev/null +++ b/codemods-legacy/jasmine/5.0/handling_env-execute/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"], +} diff --git a/codemods/jasmine/5.0/jasmine_migration_recipe/.codemodrc.json b/codemods-legacy/jasmine/5.0/jasmine_migration_recipe/.codemodrc.json similarity index 100% rename from codemods/jasmine/5.0/jasmine_migration_recipe/.codemodrc.json rename to codemods-legacy/jasmine/5.0/jasmine_migration_recipe/.codemodrc.json diff --git a/codemods/jasmine/5.0/jasmine_migration_recipe/README.md b/codemods-legacy/jasmine/5.0/jasmine_migration_recipe/README.md similarity index 100% rename from codemods/jasmine/5.0/jasmine_migration_recipe/README.md rename to codemods-legacy/jasmine/5.0/jasmine_migration_recipe/README.md diff --git a/codemods/jasmine/5.0/jasmine_migration_recipe/package.json b/codemods-legacy/jasmine/5.0/jasmine_migration_recipe/package.json similarity index 100% rename from codemods/jasmine/5.0/jasmine_migration_recipe/package.json rename to codemods-legacy/jasmine/5.0/jasmine_migration_recipe/package.json diff --git a/codemods/jasmine/5.0/node-boot-removal/.codemodrc.json b/codemods-legacy/jasmine/5.0/node-boot-removal/.codemodrc.json similarity index 100% rename from codemods/jasmine/5.0/node-boot-removal/.codemodrc.json rename to codemods-legacy/jasmine/5.0/node-boot-removal/.codemodrc.json diff --git a/codemods/jasmine/5.0/node-boot-removal/.gitignore b/codemods-legacy/jasmine/5.0/node-boot-removal/.gitignore similarity index 100% rename from codemods/jasmine/5.0/node-boot-removal/.gitignore rename to codemods-legacy/jasmine/5.0/node-boot-removal/.gitignore diff --git a/codemods/jasmine/5.0/node-boot-removal/LICENSE b/codemods-legacy/jasmine/5.0/node-boot-removal/LICENSE similarity index 100% rename from codemods/jasmine/5.0/node-boot-removal/LICENSE rename to codemods-legacy/jasmine/5.0/node-boot-removal/LICENSE diff --git a/codemods/jasmine/5.0/node-boot-removal/README.md b/codemods-legacy/jasmine/5.0/node-boot-removal/README.md similarity index 100% rename from codemods/jasmine/5.0/node-boot-removal/README.md rename to codemods-legacy/jasmine/5.0/node-boot-removal/README.md diff --git a/codemods/jasmine/5.0/node-boot-removal/__testfixtures__/fixture1.input.ts b/codemods-legacy/jasmine/5.0/node-boot-removal/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/jasmine/5.0/node-boot-removal/__testfixtures__/fixture1.input.ts rename to codemods-legacy/jasmine/5.0/node-boot-removal/__testfixtures__/fixture1.input.ts diff --git a/codemods/jasmine/5.0/node-boot-removal/__testfixtures__/fixture1.output.ts b/codemods-legacy/jasmine/5.0/node-boot-removal/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/jasmine/5.0/node-boot-removal/__testfixtures__/fixture1.output.ts rename to codemods-legacy/jasmine/5.0/node-boot-removal/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/jasmine/5.0/node-boot-removal/package.json b/codemods-legacy/jasmine/5.0/node-boot-removal/package.json new file mode 100644 index 00000000..75e251ad --- /dev/null +++ b/codemods-legacy/jasmine/5.0/node-boot-removal/package.json @@ -0,0 +1,23 @@ +{ + "name": "jasmine-1-require-node-boot-to-boot", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1" + }, + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "yugal41735" +} diff --git a/codemods/jasmine/5.0/node-boot-removal/src/index.ts b/codemods-legacy/jasmine/5.0/node-boot-removal/src/index.ts similarity index 100% rename from codemods/jasmine/5.0/node-boot-removal/src/index.ts rename to codemods-legacy/jasmine/5.0/node-boot-removal/src/index.ts diff --git a/codemods-legacy/jasmine/5.0/node-boot-removal/test/test.ts b/codemods-legacy/jasmine/5.0/node-boot-removal/test/test.ts new file mode 100644 index 00000000..a5613e48 --- /dev/null +++ b/codemods-legacy/jasmine/5.0/node-boot-removal/test/test.ts @@ -0,0 +1,51 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; +import { readFile } from "node:fs/promises"; +import { join } from "node:path"; +import jscodeshift from "jscodeshift"; +import type { API } from "jscodeshift"; +import transform from "../src/index.ts"; + +const __dirname = new URL(".", import.meta.url).pathname; + +const buildApi = (parser: string | undefined): API => ({ + j: parser ? jscodeshift.withParser(parser) : jscodeshift, + jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, + stats: () => { + console.error( + "The stats function was called, which is not supported on purpose", + ); + }, + report: () => { + console.error( + "The report function was called, which is not supported on purpose", + ); + }, +}); + +describe("jasmine/1/require-node-boot-to-boot", () => { + it("test #1", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); +}); diff --git a/codemods-legacy/jasmine/5.0/node-boot-removal/tsconfig.json b/codemods-legacy/jasmine/5.0/node-boot-removal/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/jasmine/5.0/node-boot-removal/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/jest/vitest/.codemodrc.json b/codemods-legacy/jest/vitest/.codemodrc.json similarity index 100% rename from codemods/jest/vitest/.codemodrc.json rename to codemods-legacy/jest/vitest/.codemodrc.json diff --git a/codemods/jest/vitest/README.md b/codemods-legacy/jest/vitest/README.md similarity index 100% rename from codemods/jest/vitest/README.md rename to codemods-legacy/jest/vitest/README.md diff --git a/codemods-legacy/jest/vitest/package.json b/codemods-legacy/jest/vitest/package.json new file mode 100644 index 00000000..641009f1 --- /dev/null +++ b/codemods-legacy/jest/vitest/package.json @@ -0,0 +1,19 @@ +{ + "name": "@codemod-com/codemod-jest-vitest", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/jest/vitest/src/default-exports.ts b/codemods-legacy/jest/vitest/src/default-exports.ts similarity index 100% rename from codemods/jest/vitest/src/default-exports.ts rename to codemods-legacy/jest/vitest/src/default-exports.ts diff --git a/codemods/jest/vitest/src/factory-func.ts b/codemods-legacy/jest/vitest/src/factory-func.ts similarity index 100% rename from codemods/jest/vitest/src/factory-func.ts rename to codemods-legacy/jest/vitest/src/factory-func.ts diff --git a/codemods/jest/vitest/src/get-api-calls.ts b/codemods-legacy/jest/vitest/src/get-api-calls.ts similarity index 100% rename from codemods/jest/vitest/src/get-api-calls.ts rename to codemods-legacy/jest/vitest/src/get-api-calls.ts diff --git a/codemods/jest/vitest/src/import.ts b/codemods-legacy/jest/vitest/src/import.ts similarity index 100% rename from codemods/jest/vitest/src/import.ts rename to codemods-legacy/jest/vitest/src/import.ts diff --git a/codemods/jest/vitest/src/index.ts b/codemods-legacy/jest/vitest/src/index.ts similarity index 100% rename from codemods/jest/vitest/src/index.ts rename to codemods-legacy/jest/vitest/src/index.ts diff --git a/codemods/jest/vitest/src/jest-vi.ts b/codemods-legacy/jest/vitest/src/jest-vi.ts similarity index 100% rename from codemods/jest/vitest/src/jest-vi.ts rename to codemods-legacy/jest/vitest/src/jest-vi.ts diff --git a/codemods/jest/vitest/src/replace-api.ts b/codemods-legacy/jest/vitest/src/replace-api.ts similarity index 100% rename from codemods/jest/vitest/src/replace-api.ts rename to codemods-legacy/jest/vitest/src/replace-api.ts diff --git a/codemods/jest/vitest/tsconfig.json b/codemods-legacy/jest/vitest/tsconfig.json similarity index 100% rename from codemods/jest/vitest/tsconfig.json rename to codemods-legacy/jest/vitest/tsconfig.json diff --git a/codemods/meteor/v3/fibers-to-async-promises/.codemodrc.json b/codemods-legacy/meteor/v3/fibers-to-async-promises/.codemodrc.json similarity index 100% rename from codemods/meteor/v3/fibers-to-async-promises/.codemodrc.json rename to codemods-legacy/meteor/v3/fibers-to-async-promises/.codemodrc.json diff --git a/codemods/meteor/v3/fibers-to-async-promises/.gitignore b/codemods-legacy/meteor/v3/fibers-to-async-promises/.gitignore similarity index 100% rename from codemods/meteor/v3/fibers-to-async-promises/.gitignore rename to codemods-legacy/meteor/v3/fibers-to-async-promises/.gitignore diff --git a/codemods/meteor/v3/fibers-to-async-promises/LICENSE b/codemods-legacy/meteor/v3/fibers-to-async-promises/LICENSE similarity index 100% rename from codemods/meteor/v3/fibers-to-async-promises/LICENSE rename to codemods-legacy/meteor/v3/fibers-to-async-promises/LICENSE diff --git a/codemods/meteor/v3/fibers-to-async-promises/README.md b/codemods-legacy/meteor/v3/fibers-to-async-promises/README.md similarity index 100% rename from codemods/meteor/v3/fibers-to-async-promises/README.md rename to codemods-legacy/meteor/v3/fibers-to-async-promises/README.md diff --git a/codemods/meteor/v3/fibers-to-async-promises/__testfixtures__/fixture1.input.ts b/codemods-legacy/meteor/v3/fibers-to-async-promises/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/meteor/v3/fibers-to-async-promises/__testfixtures__/fixture1.input.ts rename to codemods-legacy/meteor/v3/fibers-to-async-promises/__testfixtures__/fixture1.input.ts diff --git a/codemods/meteor/v3/fibers-to-async-promises/__testfixtures__/fixture1.output.ts b/codemods-legacy/meteor/v3/fibers-to-async-promises/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/meteor/v3/fibers-to-async-promises/__testfixtures__/fixture1.output.ts rename to codemods-legacy/meteor/v3/fibers-to-async-promises/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/meteor/v3/fibers-to-async-promises/package.json b/codemods-legacy/meteor/v3/fibers-to-async-promises/package.json new file mode 100644 index 00000000..e175ff7b --- /dev/null +++ b/codemods-legacy/meteor/v3/fibers-to-async-promises/package.json @@ -0,0 +1,24 @@ +{ + "name": "meteor-1-replace-fibers-with-promises", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "^5.2.2", + "vitest": "^1.0.1", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "manishjha-04" +} diff --git a/codemods/meteor/v3/fibers-to-async-promises/src/index.ts b/codemods-legacy/meteor/v3/fibers-to-async-promises/src/index.ts similarity index 100% rename from codemods/meteor/v3/fibers-to-async-promises/src/index.ts rename to codemods-legacy/meteor/v3/fibers-to-async-promises/src/index.ts diff --git a/codemods/meteor/v3/fibers-to-async-promises/test/test.ts b/codemods-legacy/meteor/v3/fibers-to-async-promises/test/test.ts similarity index 100% rename from codemods/meteor/v3/fibers-to-async-promises/test/test.ts rename to codemods-legacy/meteor/v3/fibers-to-async-promises/test/test.ts diff --git a/codemods-legacy/meteor/v3/fibers-to-async-promises/tsconfig.json b/codemods-legacy/meteor/v3/fibers-to-async-promises/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/meteor/v3/fibers-to-async-promises/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/react/19/replace-create-factory/vitest.config.ts b/codemods-legacy/meteor/v3/fibers-to-async-promises/vitest.config.ts similarity index 100% rename from codemods/react/19/replace-create-factory/vitest.config.ts rename to codemods-legacy/meteor/v3/fibers-to-async-promises/vitest.config.ts diff --git a/codemods/meteor/v3/meteor-renamed functions/.codemodrc.json b/codemods-legacy/meteor/v3/meteor-renamed functions/.codemodrc.json similarity index 100% rename from codemods/meteor/v3/meteor-renamed functions/.codemodrc.json rename to codemods-legacy/meteor/v3/meteor-renamed functions/.codemodrc.json diff --git a/codemods/meteor/v3/meteor-renamed functions/.gitignore b/codemods-legacy/meteor/v3/meteor-renamed functions/.gitignore similarity index 100% rename from codemods/meteor/v3/meteor-renamed functions/.gitignore rename to codemods-legacy/meteor/v3/meteor-renamed functions/.gitignore diff --git a/codemods/meteor/v3/meteor-renamed functions/LICENSE b/codemods-legacy/meteor/v3/meteor-renamed functions/LICENSE similarity index 100% rename from codemods/meteor/v3/meteor-renamed functions/LICENSE rename to codemods-legacy/meteor/v3/meteor-renamed functions/LICENSE diff --git a/codemods/meteor/v3/meteor-renamed functions/README.md b/codemods-legacy/meteor/v3/meteor-renamed functions/README.md similarity index 100% rename from codemods/meteor/v3/meteor-renamed functions/README.md rename to codemods-legacy/meteor/v3/meteor-renamed functions/README.md diff --git a/codemods/meteor/v3/meteor-renamed functions/__testfixtures__/fixture1.input.ts b/codemods-legacy/meteor/v3/meteor-renamed functions/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/meteor/v3/meteor-renamed functions/__testfixtures__/fixture1.input.ts rename to codemods-legacy/meteor/v3/meteor-renamed functions/__testfixtures__/fixture1.input.ts diff --git a/codemods/meteor/v3/meteor-renamed functions/__testfixtures__/fixture1.output.ts b/codemods-legacy/meteor/v3/meteor-renamed functions/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/meteor/v3/meteor-renamed functions/__testfixtures__/fixture1.output.ts rename to codemods-legacy/meteor/v3/meteor-renamed functions/__testfixtures__/fixture1.output.ts diff --git a/codemods/meteor/v3/meteor-renamed functions/__testfixtures__/fixture2.input.ts b/codemods-legacy/meteor/v3/meteor-renamed functions/__testfixtures__/fixture2.input.ts similarity index 100% rename from codemods/meteor/v3/meteor-renamed functions/__testfixtures__/fixture2.input.ts rename to codemods-legacy/meteor/v3/meteor-renamed functions/__testfixtures__/fixture2.input.ts diff --git a/codemods/meteor/v3/meteor-renamed functions/__testfixtures__/fixture2.output.ts b/codemods-legacy/meteor/v3/meteor-renamed functions/__testfixtures__/fixture2.output.ts similarity index 100% rename from codemods/meteor/v3/meteor-renamed functions/__testfixtures__/fixture2.output.ts rename to codemods-legacy/meteor/v3/meteor-renamed functions/__testfixtures__/fixture2.output.ts diff --git a/codemods/meteor/v3/meteor-renamed functions/__testfixtures__/fixture3.input.ts b/codemods-legacy/meteor/v3/meteor-renamed functions/__testfixtures__/fixture3.input.ts similarity index 100% rename from codemods/meteor/v3/meteor-renamed functions/__testfixtures__/fixture3.input.ts rename to codemods-legacy/meteor/v3/meteor-renamed functions/__testfixtures__/fixture3.input.ts diff --git a/codemods/meteor/v3/meteor-renamed functions/__testfixtures__/fixture3.output.ts b/codemods-legacy/meteor/v3/meteor-renamed functions/__testfixtures__/fixture3.output.ts similarity index 100% rename from codemods/meteor/v3/meteor-renamed functions/__testfixtures__/fixture3.output.ts rename to codemods-legacy/meteor/v3/meteor-renamed functions/__testfixtures__/fixture3.output.ts diff --git a/codemods/meteor/v3/meteor-renamed functions/__testfixtures__/fixture4.input.ts b/codemods-legacy/meteor/v3/meteor-renamed functions/__testfixtures__/fixture4.input.ts similarity index 100% rename from codemods/meteor/v3/meteor-renamed functions/__testfixtures__/fixture4.input.ts rename to codemods-legacy/meteor/v3/meteor-renamed functions/__testfixtures__/fixture4.input.ts diff --git a/codemods/meteor/v3/meteor-renamed functions/__testfixtures__/fixture4.output.ts b/codemods-legacy/meteor/v3/meteor-renamed functions/__testfixtures__/fixture4.output.ts similarity index 100% rename from codemods/meteor/v3/meteor-renamed functions/__testfixtures__/fixture4.output.ts rename to codemods-legacy/meteor/v3/meteor-renamed functions/__testfixtures__/fixture4.output.ts diff --git a/codemods-legacy/meteor/v3/meteor-renamed functions/package.json b/codemods-legacy/meteor/v3/meteor-renamed functions/package.json new file mode 100644 index 00000000..c1380b07 --- /dev/null +++ b/codemods-legacy/meteor/v3/meteor-renamed functions/package.json @@ -0,0 +1,24 @@ +{ + "name": "synchronous-to-asynchronous-method-transform", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "^5.2.2", + "vitest": "^1.0.1", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "manishjha-04" +} diff --git a/codemods/meteor/v3/meteor-renamed functions/src/index.ts b/codemods-legacy/meteor/v3/meteor-renamed functions/src/index.ts similarity index 100% rename from codemods/meteor/v3/meteor-renamed functions/src/index.ts rename to codemods-legacy/meteor/v3/meteor-renamed functions/src/index.ts diff --git a/codemods/meteor/v3/meteor-renamed functions/test/test.ts b/codemods-legacy/meteor/v3/meteor-renamed functions/test/test.ts similarity index 100% rename from codemods/meteor/v3/meteor-renamed functions/test/test.ts rename to codemods-legacy/meteor/v3/meteor-renamed functions/test/test.ts diff --git a/codemods-legacy/meteor/v3/meteor-renamed functions/tsconfig.json b/codemods-legacy/meteor/v3/meteor-renamed functions/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/meteor/v3/meteor-renamed functions/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/react/19/replace-default-props/vitest.config.ts b/codemods-legacy/meteor/v3/meteor-renamed functions/vitest.config.ts similarity index 100% rename from codemods/react/19/replace-default-props/vitest.config.ts rename to codemods-legacy/meteor/v3/meteor-renamed functions/vitest.config.ts diff --git a/codemods/meteor/v3/mongoDb-async-methods/.codemodrc.json b/codemods-legacy/meteor/v3/mongoDb-async-methods/.codemodrc.json similarity index 100% rename from codemods/meteor/v3/mongoDb-async-methods/.codemodrc.json rename to codemods-legacy/meteor/v3/mongoDb-async-methods/.codemodrc.json diff --git a/codemods/meteor/v3/mongoDb-async-methods/.gitignore b/codemods-legacy/meteor/v3/mongoDb-async-methods/.gitignore similarity index 100% rename from codemods/meteor/v3/mongoDb-async-methods/.gitignore rename to codemods-legacy/meteor/v3/mongoDb-async-methods/.gitignore diff --git a/codemods/meteor/v3/mongoDb-async-methods/LICENSE b/codemods-legacy/meteor/v3/mongoDb-async-methods/LICENSE similarity index 100% rename from codemods/meteor/v3/mongoDb-async-methods/LICENSE rename to codemods-legacy/meteor/v3/mongoDb-async-methods/LICENSE diff --git a/codemods/meteor/v3/mongoDb-async-methods/README.md b/codemods-legacy/meteor/v3/mongoDb-async-methods/README.md similarity index 100% rename from codemods/meteor/v3/mongoDb-async-methods/README.md rename to codemods-legacy/meteor/v3/mongoDb-async-methods/README.md diff --git a/codemods/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture1.input.ts b/codemods-legacy/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture1.input.ts rename to codemods-legacy/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture1.input.ts diff --git a/codemods/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture1.output.ts b/codemods-legacy/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture1.output.ts rename to codemods-legacy/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture1.output.ts diff --git a/codemods/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture2.input.ts b/codemods-legacy/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture2.input.ts similarity index 100% rename from codemods/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture2.input.ts rename to codemods-legacy/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture2.input.ts diff --git a/codemods/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture2.output.ts b/codemods-legacy/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture2.output.ts similarity index 100% rename from codemods/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture2.output.ts rename to codemods-legacy/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture2.output.ts diff --git a/codemods/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture3.input.ts b/codemods-legacy/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture3.input.ts similarity index 100% rename from codemods/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture3.input.ts rename to codemods-legacy/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture3.input.ts diff --git a/codemods/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture3.output.ts b/codemods-legacy/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture3.output.ts similarity index 100% rename from codemods/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture3.output.ts rename to codemods-legacy/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture3.output.ts diff --git a/codemods/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture4.input.ts b/codemods-legacy/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture4.input.ts similarity index 100% rename from codemods/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture4.input.ts rename to codemods-legacy/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture4.input.ts diff --git a/codemods/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture4.output.ts b/codemods-legacy/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture4.output.ts similarity index 100% rename from codemods/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture4.output.ts rename to codemods-legacy/meteor/v3/mongoDb-async-methods/__testfixtures__/fixture4.output.ts diff --git a/codemods-legacy/meteor/v3/mongoDb-async-methods/package.json b/codemods-legacy/meteor/v3/mongoDb-async-methods/package.json new file mode 100644 index 00000000..5f723541 --- /dev/null +++ b/codemods-legacy/meteor/v3/mongoDb-async-methods/package.json @@ -0,0 +1,24 @@ +{ + "name": "async-fetch-and-findone-transformation", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "^5.2.2", + "vitest": "^1.0.1", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "manishjha-04" +} diff --git a/codemods/meteor/v3/mongoDb-async-methods/src/index.ts b/codemods-legacy/meteor/v3/mongoDb-async-methods/src/index.ts similarity index 100% rename from codemods/meteor/v3/mongoDb-async-methods/src/index.ts rename to codemods-legacy/meteor/v3/mongoDb-async-methods/src/index.ts diff --git a/codemods/meteor/v3/mongoDb-async-methods/test/test.ts b/codemods-legacy/meteor/v3/mongoDb-async-methods/test/test.ts similarity index 100% rename from codemods/meteor/v3/mongoDb-async-methods/test/test.ts rename to codemods-legacy/meteor/v3/mongoDb-async-methods/test/test.ts diff --git a/codemods-legacy/meteor/v3/mongoDb-async-methods/tsconfig.json b/codemods-legacy/meteor/v3/mongoDb-async-methods/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/meteor/v3/mongoDb-async-methods/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/react/19/replace-react-test-renderer-import/vitest.config.ts b/codemods-legacy/meteor/v3/mongoDb-async-methods/vitest.config.ts similarity index 100% rename from codemods/react/19/replace-react-test-renderer-import/vitest.config.ts rename to codemods-legacy/meteor/v3/mongoDb-async-methods/vitest.config.ts diff --git a/codemods/meteor/v3/removedFunctions/.codemodrc.json b/codemods-legacy/meteor/v3/removedFunctions/.codemodrc.json similarity index 100% rename from codemods/meteor/v3/removedFunctions/.codemodrc.json rename to codemods-legacy/meteor/v3/removedFunctions/.codemodrc.json diff --git a/codemods/meteor/v3/removedFunctions/.gitignore b/codemods-legacy/meteor/v3/removedFunctions/.gitignore similarity index 100% rename from codemods/meteor/v3/removedFunctions/.gitignore rename to codemods-legacy/meteor/v3/removedFunctions/.gitignore diff --git a/codemods/meteor/v3/removedFunctions/LICENSE b/codemods-legacy/meteor/v3/removedFunctions/LICENSE similarity index 100% rename from codemods/meteor/v3/removedFunctions/LICENSE rename to codemods-legacy/meteor/v3/removedFunctions/LICENSE diff --git a/codemods/meteor/v3/removedFunctions/README.md b/codemods-legacy/meteor/v3/removedFunctions/README.md similarity index 100% rename from codemods/meteor/v3/removedFunctions/README.md rename to codemods-legacy/meteor/v3/removedFunctions/README.md diff --git a/codemods/meteor/v3/removedFunctions/__testfixtures__/fixture1.input.ts b/codemods-legacy/meteor/v3/removedFunctions/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/meteor/v3/removedFunctions/__testfixtures__/fixture1.input.ts rename to codemods-legacy/meteor/v3/removedFunctions/__testfixtures__/fixture1.input.ts diff --git a/codemods/meteor/v3/removedFunctions/__testfixtures__/fixture1.output.ts b/codemods-legacy/meteor/v3/removedFunctions/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/meteor/v3/removedFunctions/__testfixtures__/fixture1.output.ts rename to codemods-legacy/meteor/v3/removedFunctions/__testfixtures__/fixture1.output.ts diff --git a/codemods/meteor/v3/removedFunctions/__testfixtures__/fixture2.input.ts b/codemods-legacy/meteor/v3/removedFunctions/__testfixtures__/fixture2.input.ts similarity index 100% rename from codemods/meteor/v3/removedFunctions/__testfixtures__/fixture2.input.ts rename to codemods-legacy/meteor/v3/removedFunctions/__testfixtures__/fixture2.input.ts diff --git a/codemods/meteor/v3/removedFunctions/__testfixtures__/fixture2.output.ts b/codemods-legacy/meteor/v3/removedFunctions/__testfixtures__/fixture2.output.ts similarity index 100% rename from codemods/meteor/v3/removedFunctions/__testfixtures__/fixture2.output.ts rename to codemods-legacy/meteor/v3/removedFunctions/__testfixtures__/fixture2.output.ts diff --git a/codemods-legacy/meteor/v3/removedFunctions/package.json b/codemods-legacy/meteor/v3/removedFunctions/package.json new file mode 100644 index 00000000..a8d9d71b --- /dev/null +++ b/codemods-legacy/meteor/v3/removedFunctions/package.json @@ -0,0 +1,24 @@ +{ + "name": "meteor-1-async-await-transformation", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "^5.2.2", + "vitest": "^1.0.1", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "manishjha-04" +} diff --git a/codemods/meteor/v3/removedFunctions/src/index.ts b/codemods-legacy/meteor/v3/removedFunctions/src/index.ts similarity index 100% rename from codemods/meteor/v3/removedFunctions/src/index.ts rename to codemods-legacy/meteor/v3/removedFunctions/src/index.ts diff --git a/codemods/meteor/v3/removedFunctions/test/test.ts b/codemods-legacy/meteor/v3/removedFunctions/test/test.ts similarity index 100% rename from codemods/meteor/v3/removedFunctions/test/test.ts rename to codemods-legacy/meteor/v3/removedFunctions/test/test.ts diff --git a/codemods-legacy/meteor/v3/removedFunctions/tsconfig.json b/codemods-legacy/meteor/v3/removedFunctions/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/meteor/v3/removedFunctions/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/react/19/replace-reactdom-render/vitest.config.ts b/codemods-legacy/meteor/v3/removedFunctions/vitest.config.ts similarity index 100% rename from codemods/react/19/replace-reactdom-render/vitest.config.ts rename to codemods-legacy/meteor/v3/removedFunctions/vitest.config.ts diff --git a/codemods/meteor/v3/webapp-handler-renaming/.codemodrc.json b/codemods-legacy/meteor/v3/webapp-handler-renaming/.codemodrc.json similarity index 100% rename from codemods/meteor/v3/webapp-handler-renaming/.codemodrc.json rename to codemods-legacy/meteor/v3/webapp-handler-renaming/.codemodrc.json diff --git a/codemods/meteor/v3/webapp-handler-renaming/.gitignore b/codemods-legacy/meteor/v3/webapp-handler-renaming/.gitignore similarity index 100% rename from codemods/meteor/v3/webapp-handler-renaming/.gitignore rename to codemods-legacy/meteor/v3/webapp-handler-renaming/.gitignore diff --git a/codemods/meteor/v3/webapp-handler-renaming/LICENSE b/codemods-legacy/meteor/v3/webapp-handler-renaming/LICENSE similarity index 100% rename from codemods/meteor/v3/webapp-handler-renaming/LICENSE rename to codemods-legacy/meteor/v3/webapp-handler-renaming/LICENSE diff --git a/codemods/meteor/v3/webapp-handler-renaming/README.md b/codemods-legacy/meteor/v3/webapp-handler-renaming/README.md similarity index 100% rename from codemods/meteor/v3/webapp-handler-renaming/README.md rename to codemods-legacy/meteor/v3/webapp-handler-renaming/README.md diff --git a/codemods/meteor/v3/webapp-handler-renaming/__testfixtures__/fixture1.input.ts b/codemods-legacy/meteor/v3/webapp-handler-renaming/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/meteor/v3/webapp-handler-renaming/__testfixtures__/fixture1.input.ts rename to codemods-legacy/meteor/v3/webapp-handler-renaming/__testfixtures__/fixture1.input.ts diff --git a/codemods/meteor/v3/webapp-handler-renaming/__testfixtures__/fixture1.output.ts b/codemods-legacy/meteor/v3/webapp-handler-renaming/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/meteor/v3/webapp-handler-renaming/__testfixtures__/fixture1.output.ts rename to codemods-legacy/meteor/v3/webapp-handler-renaming/__testfixtures__/fixture1.output.ts diff --git a/codemods/meteor/v3/webapp-handler-renaming/__testfixtures__/fixture2.input.ts b/codemods-legacy/meteor/v3/webapp-handler-renaming/__testfixtures__/fixture2.input.ts similarity index 100% rename from codemods/meteor/v3/webapp-handler-renaming/__testfixtures__/fixture2.input.ts rename to codemods-legacy/meteor/v3/webapp-handler-renaming/__testfixtures__/fixture2.input.ts diff --git a/codemods/meteor/v3/webapp-handler-renaming/__testfixtures__/fixture2.output.ts b/codemods-legacy/meteor/v3/webapp-handler-renaming/__testfixtures__/fixture2.output.ts similarity index 100% rename from codemods/meteor/v3/webapp-handler-renaming/__testfixtures__/fixture2.output.ts rename to codemods-legacy/meteor/v3/webapp-handler-renaming/__testfixtures__/fixture2.output.ts diff --git a/codemods-legacy/meteor/v3/webapp-handler-renaming/package.json b/codemods-legacy/meteor/v3/webapp-handler-renaming/package.json new file mode 100644 index 00000000..23ef92c7 --- /dev/null +++ b/codemods-legacy/meteor/v3/webapp-handler-renaming/package.json @@ -0,0 +1,24 @@ +{ + "name": "meteor-3-api-rename-express-migration", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "^5.2.2", + "vitest": "^1.0.1", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "manishjha-04" +} diff --git a/codemods/meteor/v3/webapp-handler-renaming/src/index.ts b/codemods-legacy/meteor/v3/webapp-handler-renaming/src/index.ts similarity index 100% rename from codemods/meteor/v3/webapp-handler-renaming/src/index.ts rename to codemods-legacy/meteor/v3/webapp-handler-renaming/src/index.ts diff --git a/codemods/meteor/v3/webapp-handler-renaming/test/test.ts b/codemods-legacy/meteor/v3/webapp-handler-renaming/test/test.ts similarity index 100% rename from codemods/meteor/v3/webapp-handler-renaming/test/test.ts rename to codemods-legacy/meteor/v3/webapp-handler-renaming/test/test.ts diff --git a/codemods-legacy/meteor/v3/webapp-handler-renaming/tsconfig.json b/codemods-legacy/meteor/v3/webapp-handler-renaming/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/meteor/v3/webapp-handler-renaming/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/react/19/replace-string-ref/vitest.config.ts b/codemods-legacy/meteor/v3/webapp-handler-renaming/vitest.config.ts similarity index 100% rename from codemods/react/19/replace-string-ref/vitest.config.ts rename to codemods-legacy/meteor/v3/webapp-handler-renaming/vitest.config.ts diff --git a/codemods/mocha/vitest/migrate-configuration/.codemodrc.json b/codemods-legacy/mocha/vitest/migrate-configuration/.codemodrc.json similarity index 100% rename from codemods/mocha/vitest/migrate-configuration/.codemodrc.json rename to codemods-legacy/mocha/vitest/migrate-configuration/.codemodrc.json diff --git a/codemods/mocha/vitest/migrate-configuration/README.md b/codemods-legacy/mocha/vitest/migrate-configuration/README.md similarity index 100% rename from codemods/mocha/vitest/migrate-configuration/README.md rename to codemods-legacy/mocha/vitest/migrate-configuration/README.md diff --git a/codemods-legacy/mocha/vitest/migrate-configuration/package.json b/codemods-legacy/mocha/vitest/migrate-configuration/package.json new file mode 100644 index 00000000..030b1ff2 --- /dev/null +++ b/codemods-legacy/mocha/vitest/migrate-configuration/package.json @@ -0,0 +1,28 @@ +{ + "name": "@codemod-com/codemod-mocha-vitest-migrate-configuration", + "dependencies": { + "valibot": "catalog:" + }, + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/filemod": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "jscodeshift": "^0.15.1", + "memfs": "^4.6.0", + "typescript": "^5.2.2", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/mocha/vitest/migrate-configuration/src/index.ts b/codemods-legacy/mocha/vitest/migrate-configuration/src/index.ts similarity index 100% rename from codemods/mocha/vitest/migrate-configuration/src/index.ts rename to codemods-legacy/mocha/vitest/migrate-configuration/src/index.ts diff --git a/codemods/mocha/vitest/migrate-configuration/test/test.ts b/codemods-legacy/mocha/vitest/migrate-configuration/test/test.ts similarity index 100% rename from codemods/mocha/vitest/migrate-configuration/test/test.ts rename to codemods-legacy/mocha/vitest/migrate-configuration/test/test.ts diff --git a/codemods/mocha/vitest/migrate-configuration/tsconfig.json b/codemods-legacy/mocha/vitest/migrate-configuration/tsconfig.json similarity index 100% rename from codemods/mocha/vitest/migrate-configuration/tsconfig.json rename to codemods-legacy/mocha/vitest/migrate-configuration/tsconfig.json diff --git a/codemods/react/create-element-to-jsx/vitest.config.ts b/codemods-legacy/mocha/vitest/migrate-configuration/vitest.config.ts similarity index 100% rename from codemods/react/create-element-to-jsx/vitest.config.ts rename to codemods-legacy/mocha/vitest/migrate-configuration/vitest.config.ts diff --git a/codemods/mocha/vitest/migrate-tests/.codemodrc.json b/codemods-legacy/mocha/vitest/migrate-tests/.codemodrc.json similarity index 100% rename from codemods/mocha/vitest/migrate-tests/.codemodrc.json rename to codemods-legacy/mocha/vitest/migrate-tests/.codemodrc.json diff --git a/codemods/mocha/vitest/migrate-tests/README.md b/codemods-legacy/mocha/vitest/migrate-tests/README.md similarity index 100% rename from codemods/mocha/vitest/migrate-tests/README.md rename to codemods-legacy/mocha/vitest/migrate-tests/README.md diff --git a/codemods-legacy/mocha/vitest/migrate-tests/package.json b/codemods-legacy/mocha/vitest/migrate-tests/package.json new file mode 100644 index 00000000..e5652b60 --- /dev/null +++ b/codemods-legacy/mocha/vitest/migrate-tests/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-mocha-vitest-migrate-tests", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/mocha/vitest/migrate-tests/src/index.ts b/codemods-legacy/mocha/vitest/migrate-tests/src/index.ts similarity index 100% rename from codemods/mocha/vitest/migrate-tests/src/index.ts rename to codemods-legacy/mocha/vitest/migrate-tests/src/index.ts diff --git a/codemods/mocha/vitest/migrate-tests/test/test.ts b/codemods-legacy/mocha/vitest/migrate-tests/test/test.ts similarity index 100% rename from codemods/mocha/vitest/migrate-tests/test/test.ts rename to codemods-legacy/mocha/vitest/migrate-tests/test/test.ts diff --git a/codemods/mocha/vitest/migrate-tests/tsconfig.json b/codemods-legacy/mocha/vitest/migrate-tests/tsconfig.json similarity index 100% rename from codemods/mocha/vitest/migrate-tests/tsconfig.json rename to codemods-legacy/mocha/vitest/migrate-tests/tsconfig.json diff --git a/codemods/react/update-react-imports/vitest.config.ts b/codemods-legacy/mocha/vitest/migrate-tests/vitest.config.ts similarity index 100% rename from codemods/react/update-react-imports/vitest.config.ts rename to codemods-legacy/mocha/vitest/migrate-tests/vitest.config.ts diff --git a/codemods/mocha/vitest/recipe/.codemodrc.json b/codemods-legacy/mocha/vitest/recipe/.codemodrc.json similarity index 100% rename from codemods/mocha/vitest/recipe/.codemodrc.json rename to codemods-legacy/mocha/vitest/recipe/.codemodrc.json diff --git a/codemods/mocha/vitest/recipe/README.md b/codemods-legacy/mocha/vitest/recipe/README.md similarity index 100% rename from codemods/mocha/vitest/recipe/README.md rename to codemods-legacy/mocha/vitest/recipe/README.md diff --git a/codemods/mocha/vitest/recipe/package.json b/codemods-legacy/mocha/vitest/recipe/package.json similarity index 100% rename from codemods/mocha/vitest/recipe/package.json rename to codemods-legacy/mocha/vitest/recipe/package.json diff --git a/codemods/msw/2/callback-signature/.codemodrc.json b/codemods-legacy/msw/2/callback-signature/.codemodrc.json similarity index 100% rename from codemods/msw/2/callback-signature/.codemodrc.json rename to codemods-legacy/msw/2/callback-signature/.codemodrc.json diff --git a/codemods/msw/2/callback-signature/README.md b/codemods-legacy/msw/2/callback-signature/README.md similarity index 100% rename from codemods/msw/2/callback-signature/README.md rename to codemods-legacy/msw/2/callback-signature/README.md diff --git a/codemods-legacy/msw/2/callback-signature/package.json b/codemods-legacy/msw/2/callback-signature/package.json new file mode 100644 index 00000000..4e57c70c --- /dev/null +++ b/codemods-legacy/msw/2/callback-signature/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-msw-2-callback-signature", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "ts-morph": "^19.0.0" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/msw/2/callback-signature/src/index.ts b/codemods-legacy/msw/2/callback-signature/src/index.ts similarity index 100% rename from codemods/msw/2/callback-signature/src/index.ts rename to codemods-legacy/msw/2/callback-signature/src/index.ts diff --git a/codemods/msw/2/callback-signature/tsconfig.json b/codemods-legacy/msw/2/callback-signature/tsconfig.json similarity index 100% rename from codemods/msw/2/callback-signature/tsconfig.json rename to codemods-legacy/msw/2/callback-signature/tsconfig.json diff --git a/codemods/msw/2/ctx-fetch/.codemodrc.json b/codemods-legacy/msw/2/ctx-fetch/.codemodrc.json similarity index 100% rename from codemods/msw/2/ctx-fetch/.codemodrc.json rename to codemods-legacy/msw/2/ctx-fetch/.codemodrc.json diff --git a/codemods/msw/2/ctx-fetch/README.md b/codemods-legacy/msw/2/ctx-fetch/README.md similarity index 100% rename from codemods/msw/2/ctx-fetch/README.md rename to codemods-legacy/msw/2/ctx-fetch/README.md diff --git a/codemods-legacy/msw/2/ctx-fetch/package.json b/codemods-legacy/msw/2/ctx-fetch/package.json new file mode 100644 index 00000000..e303c691 --- /dev/null +++ b/codemods-legacy/msw/2/ctx-fetch/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-msw-2-ctx-fetch", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "ts-morph": "^19.0.0" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/msw/2/ctx-fetch/src/index.ts b/codemods-legacy/msw/2/ctx-fetch/src/index.ts similarity index 100% rename from codemods/msw/2/ctx-fetch/src/index.ts rename to codemods-legacy/msw/2/ctx-fetch/src/index.ts diff --git a/codemods/msw/2/ctx-fetch/tsconfig.json b/codemods-legacy/msw/2/ctx-fetch/tsconfig.json similarity index 100% rename from codemods/msw/2/ctx-fetch/tsconfig.json rename to codemods-legacy/msw/2/ctx-fetch/tsconfig.json diff --git a/codemods/msw/2/imports/.codemodrc.json b/codemods-legacy/msw/2/imports/.codemodrc.json similarity index 100% rename from codemods/msw/2/imports/.codemodrc.json rename to codemods-legacy/msw/2/imports/.codemodrc.json diff --git a/codemods/msw/2/imports/README.md b/codemods-legacy/msw/2/imports/README.md similarity index 100% rename from codemods/msw/2/imports/README.md rename to codemods-legacy/msw/2/imports/README.md diff --git a/codemods-legacy/msw/2/imports/package.json b/codemods-legacy/msw/2/imports/package.json new file mode 100644 index 00000000..b8b7a1ea --- /dev/null +++ b/codemods-legacy/msw/2/imports/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-msw-2-imports", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.7.2", + "ts-morph": "^24.0.0" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/msw/2/imports/src/index.ts b/codemods-legacy/msw/2/imports/src/index.ts similarity index 100% rename from codemods/msw/2/imports/src/index.ts rename to codemods-legacy/msw/2/imports/src/index.ts diff --git a/codemods-legacy/msw/2/imports/tsconfig.json b/codemods-legacy/msw/2/imports/tsconfig.json new file mode 100644 index 00000000..36bd1c7d --- /dev/null +++ b/codemods-legacy/msw/2/imports/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@codemod-com/tsconfig/codemod.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "./dist" + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/msw/2/lifecycle-events-signature/.codemodrc.json b/codemods-legacy/msw/2/lifecycle-events-signature/.codemodrc.json similarity index 100% rename from codemods/msw/2/lifecycle-events-signature/.codemodrc.json rename to codemods-legacy/msw/2/lifecycle-events-signature/.codemodrc.json diff --git a/codemods/msw/2/lifecycle-events-signature/README.md b/codemods-legacy/msw/2/lifecycle-events-signature/README.md similarity index 100% rename from codemods/msw/2/lifecycle-events-signature/README.md rename to codemods-legacy/msw/2/lifecycle-events-signature/README.md diff --git a/codemods-legacy/msw/2/lifecycle-events-signature/package.json b/codemods-legacy/msw/2/lifecycle-events-signature/package.json new file mode 100644 index 00000000..67fac214 --- /dev/null +++ b/codemods-legacy/msw/2/lifecycle-events-signature/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-msw-2-lifecycle-events-signature", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "ts-morph": "^19.0.0" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/msw/2/lifecycle-events-signature/src/index.ts b/codemods-legacy/msw/2/lifecycle-events-signature/src/index.ts similarity index 100% rename from codemods/msw/2/lifecycle-events-signature/src/index.ts rename to codemods-legacy/msw/2/lifecycle-events-signature/src/index.ts diff --git a/codemods/msw/2/lifecycle-events-signature/tsconfig.json b/codemods-legacy/msw/2/lifecycle-events-signature/tsconfig.json similarity index 100% rename from codemods/msw/2/lifecycle-events-signature/tsconfig.json rename to codemods-legacy/msw/2/lifecycle-events-signature/tsconfig.json diff --git a/codemods/msw/2/print-handler/.codemodrc.json b/codemods-legacy/msw/2/print-handler/.codemodrc.json similarity index 100% rename from codemods/msw/2/print-handler/.codemodrc.json rename to codemods-legacy/msw/2/print-handler/.codemodrc.json diff --git a/codemods/msw/2/print-handler/README.md b/codemods-legacy/msw/2/print-handler/README.md similarity index 100% rename from codemods/msw/2/print-handler/README.md rename to codemods-legacy/msw/2/print-handler/README.md diff --git a/codemods-legacy/msw/2/print-handler/package.json b/codemods-legacy/msw/2/print-handler/package.json new file mode 100644 index 00000000..c251f5df --- /dev/null +++ b/codemods-legacy/msw/2/print-handler/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-msw-2-print-handler", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "ts-morph": "^19.0.0" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/msw/2/print-handler/src/index.ts b/codemods-legacy/msw/2/print-handler/src/index.ts similarity index 100% rename from codemods/msw/2/print-handler/src/index.ts rename to codemods-legacy/msw/2/print-handler/src/index.ts diff --git a/codemods/msw/2/print-handler/tsconfig.json b/codemods-legacy/msw/2/print-handler/tsconfig.json similarity index 100% rename from codemods/msw/2/print-handler/tsconfig.json rename to codemods-legacy/msw/2/print-handler/tsconfig.json diff --git a/codemods/msw/2/req-passthrough/.codemodrc.json b/codemods-legacy/msw/2/req-passthrough/.codemodrc.json similarity index 100% rename from codemods/msw/2/req-passthrough/.codemodrc.json rename to codemods-legacy/msw/2/req-passthrough/.codemodrc.json diff --git a/codemods/msw/2/req-passthrough/README.md b/codemods-legacy/msw/2/req-passthrough/README.md similarity index 100% rename from codemods/msw/2/req-passthrough/README.md rename to codemods-legacy/msw/2/req-passthrough/README.md diff --git a/codemods-legacy/msw/2/req-passthrough/package.json b/codemods-legacy/msw/2/req-passthrough/package.json new file mode 100644 index 00000000..0bf91969 --- /dev/null +++ b/codemods-legacy/msw/2/req-passthrough/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-msw-2-req-passthrough", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "ts-morph": "^19.0.0" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/msw/2/req-passthrough/src/index.ts b/codemods-legacy/msw/2/req-passthrough/src/index.ts similarity index 100% rename from codemods/msw/2/req-passthrough/src/index.ts rename to codemods-legacy/msw/2/req-passthrough/src/index.ts diff --git a/codemods/msw/2/req-passthrough/tsconfig.json b/codemods-legacy/msw/2/req-passthrough/tsconfig.json similarity index 100% rename from codemods/msw/2/req-passthrough/tsconfig.json rename to codemods-legacy/msw/2/req-passthrough/tsconfig.json diff --git a/codemods/msw/2/request-changes/.codemodrc.json b/codemods-legacy/msw/2/request-changes/.codemodrc.json similarity index 100% rename from codemods/msw/2/request-changes/.codemodrc.json rename to codemods-legacy/msw/2/request-changes/.codemodrc.json diff --git a/codemods/msw/2/request-changes/README.md b/codemods-legacy/msw/2/request-changes/README.md similarity index 100% rename from codemods/msw/2/request-changes/README.md rename to codemods-legacy/msw/2/request-changes/README.md diff --git a/codemods-legacy/msw/2/request-changes/package.json b/codemods-legacy/msw/2/request-changes/package.json new file mode 100644 index 00000000..48934af8 --- /dev/null +++ b/codemods-legacy/msw/2/request-changes/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-msw-2-request-changes", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "ts-morph": "^19.0.0" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/msw/2/request-changes/src/index.ts b/codemods-legacy/msw/2/request-changes/src/index.ts similarity index 100% rename from codemods/msw/2/request-changes/src/index.ts rename to codemods-legacy/msw/2/request-changes/src/index.ts diff --git a/codemods/msw/2/request-changes/tsconfig.json b/codemods-legacy/msw/2/request-changes/tsconfig.json similarity index 100% rename from codemods/msw/2/request-changes/tsconfig.json rename to codemods-legacy/msw/2/request-changes/tsconfig.json diff --git a/codemods/msw/2/response-usages/.codemodrc.json b/codemods-legacy/msw/2/response-usages/.codemodrc.json similarity index 100% rename from codemods/msw/2/response-usages/.codemodrc.json rename to codemods-legacy/msw/2/response-usages/.codemodrc.json diff --git a/codemods/msw/2/response-usages/README.md b/codemods-legacy/msw/2/response-usages/README.md similarity index 100% rename from codemods/msw/2/response-usages/README.md rename to codemods-legacy/msw/2/response-usages/README.md diff --git a/codemods/msw/2/response-usages/__testfixtures__/fixture1.input.ts b/codemods-legacy/msw/2/response-usages/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/msw/2/response-usages/__testfixtures__/fixture1.input.ts rename to codemods-legacy/msw/2/response-usages/__testfixtures__/fixture1.input.ts diff --git a/codemods/msw/2/response-usages/__testfixtures__/fixture1.output.ts b/codemods-legacy/msw/2/response-usages/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/msw/2/response-usages/__testfixtures__/fixture1.output.ts rename to codemods-legacy/msw/2/response-usages/__testfixtures__/fixture1.output.ts diff --git a/codemods/msw/2/response-usages/__testfixtures__/fixture2.input.ts b/codemods-legacy/msw/2/response-usages/__testfixtures__/fixture2.input.ts similarity index 100% rename from codemods/msw/2/response-usages/__testfixtures__/fixture2.input.ts rename to codemods-legacy/msw/2/response-usages/__testfixtures__/fixture2.input.ts diff --git a/codemods/msw/2/response-usages/__testfixtures__/fixture2.output.ts b/codemods-legacy/msw/2/response-usages/__testfixtures__/fixture2.output.ts similarity index 100% rename from codemods/msw/2/response-usages/__testfixtures__/fixture2.output.ts rename to codemods-legacy/msw/2/response-usages/__testfixtures__/fixture2.output.ts diff --git a/codemods/msw/2/response-usages/__testfixtures__/fixture3.input.ts b/codemods-legacy/msw/2/response-usages/__testfixtures__/fixture3.input.ts similarity index 100% rename from codemods/msw/2/response-usages/__testfixtures__/fixture3.input.ts rename to codemods-legacy/msw/2/response-usages/__testfixtures__/fixture3.input.ts diff --git a/codemods/msw/2/response-usages/__testfixtures__/fixture3.output.ts b/codemods-legacy/msw/2/response-usages/__testfixtures__/fixture3.output.ts similarity index 100% rename from codemods/msw/2/response-usages/__testfixtures__/fixture3.output.ts rename to codemods-legacy/msw/2/response-usages/__testfixtures__/fixture3.output.ts diff --git a/codemods-legacy/msw/2/response-usages/package.json b/codemods-legacy/msw/2/response-usages/package.json new file mode 100644 index 00000000..c65ff07f --- /dev/null +++ b/codemods-legacy/msw/2/response-usages/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-msw-2-response-usages", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "ts-morph": "^19.0.0", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/msw/2/response-usages/src/index.ts b/codemods-legacy/msw/2/response-usages/src/index.ts similarity index 100% rename from codemods/msw/2/response-usages/src/index.ts rename to codemods-legacy/msw/2/response-usages/src/index.ts diff --git a/codemods/msw/2/response-usages/test/test.ts b/codemods-legacy/msw/2/response-usages/test/test.ts similarity index 100% rename from codemods/msw/2/response-usages/test/test.ts rename to codemods-legacy/msw/2/response-usages/test/test.ts diff --git a/codemods/msw/2/response-usages/tsconfig.json b/codemods-legacy/msw/2/response-usages/tsconfig.json similarity index 100% rename from codemods/msw/2/response-usages/tsconfig.json rename to codemods-legacy/msw/2/response-usages/tsconfig.json diff --git a/codemods/replace-feature-flag-core/vitest.config.ts b/codemods-legacy/msw/2/response-usages/vitest.config.ts similarity index 100% rename from codemods/replace-feature-flag-core/vitest.config.ts rename to codemods-legacy/msw/2/response-usages/vitest.config.ts diff --git a/codemods/msw/2/type-args/.codemodrc.json b/codemods-legacy/msw/2/type-args/.codemodrc.json similarity index 100% rename from codemods/msw/2/type-args/.codemodrc.json rename to codemods-legacy/msw/2/type-args/.codemodrc.json diff --git a/codemods/msw/2/type-args/README.md b/codemods-legacy/msw/2/type-args/README.md similarity index 100% rename from codemods/msw/2/type-args/README.md rename to codemods-legacy/msw/2/type-args/README.md diff --git a/codemods-legacy/msw/2/type-args/package.json b/codemods-legacy/msw/2/type-args/package.json new file mode 100644 index 00000000..8f0583f5 --- /dev/null +++ b/codemods-legacy/msw/2/type-args/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-msw-2-type-args", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "ts-morph": "^19.0.0" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/msw/2/type-args/src/index.ts b/codemods-legacy/msw/2/type-args/src/index.ts similarity index 100% rename from codemods/msw/2/type-args/src/index.ts rename to codemods-legacy/msw/2/type-args/src/index.ts diff --git a/codemods/msw/2/type-args/tsconfig.json b/codemods-legacy/msw/2/type-args/tsconfig.json similarity index 100% rename from codemods/msw/2/type-args/tsconfig.json rename to codemods-legacy/msw/2/type-args/tsconfig.json diff --git a/codemods/msw/2/upgrade-recipe/.codemodrc.json b/codemods-legacy/msw/2/upgrade-recipe/.codemodrc.json similarity index 100% rename from codemods/msw/2/upgrade-recipe/.codemodrc.json rename to codemods-legacy/msw/2/upgrade-recipe/.codemodrc.json diff --git a/codemods/msw/2/upgrade-recipe/README.md b/codemods-legacy/msw/2/upgrade-recipe/README.md similarity index 100% rename from codemods/msw/2/upgrade-recipe/README.md rename to codemods-legacy/msw/2/upgrade-recipe/README.md diff --git a/codemods/msw/2/upgrade-recipe/package.json b/codemods-legacy/msw/2/upgrade-recipe/package.json similarity index 100% rename from codemods/msw/2/upgrade-recipe/package.json rename to codemods-legacy/msw/2/upgrade-recipe/package.json diff --git a/codemods/mui/5/core-styles-import/.codemodrc.json b/codemods-legacy/mui/5/core-styles-import/.codemodrc.json similarity index 100% rename from codemods/mui/5/core-styles-import/.codemodrc.json rename to codemods-legacy/mui/5/core-styles-import/.codemodrc.json diff --git a/codemods/mui/5/core-styles-import/README.md b/codemods-legacy/mui/5/core-styles-import/README.md similarity index 100% rename from codemods/mui/5/core-styles-import/README.md rename to codemods-legacy/mui/5/core-styles-import/README.md diff --git a/codemods-legacy/mui/5/core-styles-import/package.json b/codemods-legacy/mui/5/core-styles-import/package.json new file mode 100644 index 00000000..d808215b --- /dev/null +++ b/codemods-legacy/mui/5/core-styles-import/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-mui-5-adapter-v4", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/mui/5/core-styles-import/src/index.ts b/codemods-legacy/mui/5/core-styles-import/src/index.ts similarity index 100% rename from codemods/mui/5/core-styles-import/src/index.ts rename to codemods-legacy/mui/5/core-styles-import/src/index.ts diff --git a/codemods-legacy/mui/5/core-styles-import/test/test.ts b/codemods-legacy/mui/5/core-styles-import/test/test.ts new file mode 100644 index 00000000..8bff1a40 --- /dev/null +++ b/codemods-legacy/mui/5/core-styles-import/test/test.ts @@ -0,0 +1,33 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; +import { buildApi } from "@codemod-com/utilities"; +import type { FileInfo } from "jscodeshift"; + +import transform from "../src/index.ts"; + +describe("mui/5/core-styles-import", () => { + it("basic test", () => { + const INPUT = ` + import { darken, lighten } from '@material-ui/core/styles/colorManipulator'; + import { Overrides } from '@material-ui/core/styles/overrides'; + import makeStyles from '@material-ui/core/styles/makeStyles'; + import { createTheme } from '@material-ui/core/styles'; + `; + + const OUTPUT = ` + import { createTheme, darken, lighten, Overrides, makeStyles } from '@material-ui/core/styles'; + `; + + const fileInfo: FileInfo = { + path: "index.ts", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx"), {}); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); +}); diff --git a/codemods/mui/5/core-styles-import/tsconfig.json b/codemods-legacy/mui/5/core-styles-import/tsconfig.json similarity index 100% rename from codemods/mui/5/core-styles-import/tsconfig.json rename to codemods-legacy/mui/5/core-styles-import/tsconfig.json diff --git a/codemods/netlify-sdk/0.8.1/addBuildEventContext/.codemodrc.json b/codemods-legacy/netlify-sdk/0.8.1/addBuildEventContext/.codemodrc.json similarity index 100% rename from codemods/netlify-sdk/0.8.1/addBuildEventContext/.codemodrc.json rename to codemods-legacy/netlify-sdk/0.8.1/addBuildEventContext/.codemodrc.json diff --git a/codemods/netlify-sdk/0.8.1/addBuildEventContext/README.md b/codemods-legacy/netlify-sdk/0.8.1/addBuildEventContext/README.md similarity index 100% rename from codemods/netlify-sdk/0.8.1/addBuildEventContext/README.md rename to codemods-legacy/netlify-sdk/0.8.1/addBuildEventContext/README.md diff --git a/codemods-legacy/netlify-sdk/0.8.1/addBuildEventContext/package.json b/codemods-legacy/netlify-sdk/0.8.1/addBuildEventContext/package.json new file mode 100644 index 00000000..03e8a000 --- /dev/null +++ b/codemods-legacy/netlify-sdk/0.8.1/addBuildEventContext/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-netlify-sdk-0.8.1-addbuildeventcontext", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/netlify-sdk/0.8.1/addBuildEventContext/src/index.ts b/codemods-legacy/netlify-sdk/0.8.1/addBuildEventContext/src/index.ts similarity index 100% rename from codemods/netlify-sdk/0.8.1/addBuildEventContext/src/index.ts rename to codemods-legacy/netlify-sdk/0.8.1/addBuildEventContext/src/index.ts diff --git a/codemods/netlify-sdk/0.8.1/addBuildEventContext/test/test.ts b/codemods-legacy/netlify-sdk/0.8.1/addBuildEventContext/test/test.ts similarity index 100% rename from codemods/netlify-sdk/0.8.1/addBuildEventContext/test/test.ts rename to codemods-legacy/netlify-sdk/0.8.1/addBuildEventContext/test/test.ts diff --git a/codemods/netlify-sdk/0.8.1/addBuildEventContext/tsconfig.json b/codemods-legacy/netlify-sdk/0.8.1/addBuildEventContext/tsconfig.json similarity index 100% rename from codemods/netlify-sdk/0.8.1/addBuildEventContext/tsconfig.json rename to codemods-legacy/netlify-sdk/0.8.1/addBuildEventContext/tsconfig.json diff --git a/codemods/statsig/replace-gate/vitest.config.ts b/codemods-legacy/netlify-sdk/0.8.1/addBuildEventContext/vitest.config.ts similarity index 100% rename from codemods/statsig/replace-gate/vitest.config.ts rename to codemods-legacy/netlify-sdk/0.8.1/addBuildEventContext/vitest.config.ts diff --git a/codemods/netlify-sdk/0.8.1/addBuildEventHandler/.codemodrc.json b/codemods-legacy/netlify-sdk/0.8.1/addBuildEventHandler/.codemodrc.json similarity index 100% rename from codemods/netlify-sdk/0.8.1/addBuildEventHandler/.codemodrc.json rename to codemods-legacy/netlify-sdk/0.8.1/addBuildEventHandler/.codemodrc.json diff --git a/codemods/netlify-sdk/0.8.1/addBuildEventHandler/README.md b/codemods-legacy/netlify-sdk/0.8.1/addBuildEventHandler/README.md similarity index 100% rename from codemods/netlify-sdk/0.8.1/addBuildEventHandler/README.md rename to codemods-legacy/netlify-sdk/0.8.1/addBuildEventHandler/README.md diff --git a/codemods-legacy/netlify-sdk/0.8.1/addBuildEventHandler/package.json b/codemods-legacy/netlify-sdk/0.8.1/addBuildEventHandler/package.json new file mode 100644 index 00000000..0876799f --- /dev/null +++ b/codemods-legacy/netlify-sdk/0.8.1/addBuildEventHandler/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-netlify-sdk-0.8.1-addbuildeventhandler", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/netlify-sdk/0.8.1/addBuildEventHandler/src/index.ts b/codemods-legacy/netlify-sdk/0.8.1/addBuildEventHandler/src/index.ts similarity index 100% rename from codemods/netlify-sdk/0.8.1/addBuildEventHandler/src/index.ts rename to codemods-legacy/netlify-sdk/0.8.1/addBuildEventHandler/src/index.ts diff --git a/codemods/netlify-sdk/0.8.1/addBuildEventHandler/test/test.ts b/codemods-legacy/netlify-sdk/0.8.1/addBuildEventHandler/test/test.ts similarity index 100% rename from codemods/netlify-sdk/0.8.1/addBuildEventHandler/test/test.ts rename to codemods-legacy/netlify-sdk/0.8.1/addBuildEventHandler/test/test.ts diff --git a/codemods/netlify-sdk/0.8.1/addBuildEventHandler/tsconfig.json b/codemods-legacy/netlify-sdk/0.8.1/addBuildEventHandler/tsconfig.json similarity index 100% rename from codemods/netlify-sdk/0.8.1/addBuildEventHandler/tsconfig.json rename to codemods-legacy/netlify-sdk/0.8.1/addBuildEventHandler/tsconfig.json diff --git a/codemods/styledictionary/4/asynchronous-api-file-headers/vitest.config.ts b/codemods-legacy/netlify-sdk/0.8.1/addBuildEventHandler/vitest.config.ts similarity index 100% rename from codemods/styledictionary/4/asynchronous-api-file-headers/vitest.config.ts rename to codemods-legacy/netlify-sdk/0.8.1/addBuildEventHandler/vitest.config.ts diff --git a/codemods/netlify-sdk/0.8.1/disableBuildEventHandlers/.codemodrc.json b/codemods-legacy/netlify-sdk/0.8.1/disableBuildEventHandlers/.codemodrc.json similarity index 100% rename from codemods/netlify-sdk/0.8.1/disableBuildEventHandlers/.codemodrc.json rename to codemods-legacy/netlify-sdk/0.8.1/disableBuildEventHandlers/.codemodrc.json diff --git a/codemods/netlify-sdk/0.8.1/disableBuildEventHandlers/README.md b/codemods-legacy/netlify-sdk/0.8.1/disableBuildEventHandlers/README.md similarity index 100% rename from codemods/netlify-sdk/0.8.1/disableBuildEventHandlers/README.md rename to codemods-legacy/netlify-sdk/0.8.1/disableBuildEventHandlers/README.md diff --git a/codemods-legacy/netlify-sdk/0.8.1/disableBuildEventHandlers/package.json b/codemods-legacy/netlify-sdk/0.8.1/disableBuildEventHandlers/package.json new file mode 100644 index 00000000..62b887a0 --- /dev/null +++ b/codemods-legacy/netlify-sdk/0.8.1/disableBuildEventHandlers/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-netlify-sdk-0.8.1-disablebuildeventhandlers", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/netlify-sdk/0.8.1/disableBuildEventHandlers/src/index.ts b/codemods-legacy/netlify-sdk/0.8.1/disableBuildEventHandlers/src/index.ts similarity index 100% rename from codemods/netlify-sdk/0.8.1/disableBuildEventHandlers/src/index.ts rename to codemods-legacy/netlify-sdk/0.8.1/disableBuildEventHandlers/src/index.ts diff --git a/codemods/netlify-sdk/0.8.1/disableBuildEventHandlers/test/test.ts b/codemods-legacy/netlify-sdk/0.8.1/disableBuildEventHandlers/test/test.ts similarity index 100% rename from codemods/netlify-sdk/0.8.1/disableBuildEventHandlers/test/test.ts rename to codemods-legacy/netlify-sdk/0.8.1/disableBuildEventHandlers/test/test.ts diff --git a/codemods/netlify-sdk/0.8.1/disableBuildEventHandlers/tsconfig.json b/codemods-legacy/netlify-sdk/0.8.1/disableBuildEventHandlers/tsconfig.json similarity index 100% rename from codemods/netlify-sdk/0.8.1/disableBuildEventHandlers/tsconfig.json rename to codemods-legacy/netlify-sdk/0.8.1/disableBuildEventHandlers/tsconfig.json diff --git a/codemods/styledictionary/4/asynchronous-api/vitest.config.ts b/codemods-legacy/netlify-sdk/0.8.1/disableBuildEventHandlers/vitest.config.ts similarity index 100% rename from codemods/styledictionary/4/asynchronous-api/vitest.config.ts rename to codemods-legacy/netlify-sdk/0.8.1/disableBuildEventHandlers/vitest.config.ts diff --git a/codemods/netlify-sdk/0.8.1/enableBuildEventHandlers/.codemodrc.json b/codemods-legacy/netlify-sdk/0.8.1/enableBuildEventHandlers/.codemodrc.json similarity index 100% rename from codemods/netlify-sdk/0.8.1/enableBuildEventHandlers/.codemodrc.json rename to codemods-legacy/netlify-sdk/0.8.1/enableBuildEventHandlers/.codemodrc.json diff --git a/codemods/netlify-sdk/0.8.1/enableBuildEventHandlers/README.md b/codemods-legacy/netlify-sdk/0.8.1/enableBuildEventHandlers/README.md similarity index 100% rename from codemods/netlify-sdk/0.8.1/enableBuildEventHandlers/README.md rename to codemods-legacy/netlify-sdk/0.8.1/enableBuildEventHandlers/README.md diff --git a/codemods-legacy/netlify-sdk/0.8.1/enableBuildEventHandlers/package.json b/codemods-legacy/netlify-sdk/0.8.1/enableBuildEventHandlers/package.json new file mode 100644 index 00000000..f5e7ed4c --- /dev/null +++ b/codemods-legacy/netlify-sdk/0.8.1/enableBuildEventHandlers/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-netlify-sdk-0.8.1-enablebuildeventhandlers", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/netlify-sdk/0.8.1/enableBuildEventHandlers/src/index.ts b/codemods-legacy/netlify-sdk/0.8.1/enableBuildEventHandlers/src/index.ts similarity index 100% rename from codemods/netlify-sdk/0.8.1/enableBuildEventHandlers/src/index.ts rename to codemods-legacy/netlify-sdk/0.8.1/enableBuildEventHandlers/src/index.ts diff --git a/codemods/netlify-sdk/0.8.1/enableBuildEventHandlers/test/test.ts b/codemods-legacy/netlify-sdk/0.8.1/enableBuildEventHandlers/test/test.ts similarity index 100% rename from codemods/netlify-sdk/0.8.1/enableBuildEventHandlers/test/test.ts rename to codemods-legacy/netlify-sdk/0.8.1/enableBuildEventHandlers/test/test.ts diff --git a/codemods/netlify-sdk/0.8.1/enableBuildEventHandlers/tsconfig.json b/codemods-legacy/netlify-sdk/0.8.1/enableBuildEventHandlers/tsconfig.json similarity index 100% rename from codemods/netlify-sdk/0.8.1/enableBuildEventHandlers/tsconfig.json rename to codemods-legacy/netlify-sdk/0.8.1/enableBuildEventHandlers/tsconfig.json diff --git a/codemods/styledictionary/4/format-helpers/vitest.config.ts b/codemods-legacy/netlify-sdk/0.8.1/enableBuildEventHandlers/vitest.config.ts similarity index 100% rename from codemods/styledictionary/4/format-helpers/vitest.config.ts rename to codemods-legacy/netlify-sdk/0.8.1/enableBuildEventHandlers/vitest.config.ts diff --git a/codemods/netlify-sdk/0.8.1/exportZod/.codemodrc.json b/codemods-legacy/netlify-sdk/0.8.1/exportZod/.codemodrc.json similarity index 100% rename from codemods/netlify-sdk/0.8.1/exportZod/.codemodrc.json rename to codemods-legacy/netlify-sdk/0.8.1/exportZod/.codemodrc.json diff --git a/codemods/netlify-sdk/0.8.1/exportZod/README.md b/codemods-legacy/netlify-sdk/0.8.1/exportZod/README.md similarity index 100% rename from codemods/netlify-sdk/0.8.1/exportZod/README.md rename to codemods-legacy/netlify-sdk/0.8.1/exportZod/README.md diff --git a/codemods-legacy/netlify-sdk/0.8.1/exportZod/package.json b/codemods-legacy/netlify-sdk/0.8.1/exportZod/package.json new file mode 100644 index 00000000..54545afb --- /dev/null +++ b/codemods-legacy/netlify-sdk/0.8.1/exportZod/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-netlify-sdk-0.8.1-exportzod", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/netlify-sdk/0.8.1/exportZod/src/index.ts b/codemods-legacy/netlify-sdk/0.8.1/exportZod/src/index.ts similarity index 100% rename from codemods/netlify-sdk/0.8.1/exportZod/src/index.ts rename to codemods-legacy/netlify-sdk/0.8.1/exportZod/src/index.ts diff --git a/codemods/netlify-sdk/0.8.1/exportZod/test/test.ts b/codemods-legacy/netlify-sdk/0.8.1/exportZod/test/test.ts similarity index 100% rename from codemods/netlify-sdk/0.8.1/exportZod/test/test.ts rename to codemods-legacy/netlify-sdk/0.8.1/exportZod/test/test.ts diff --git a/codemods/netlify-sdk/0.8.1/exportZod/tsconfig.json b/codemods-legacy/netlify-sdk/0.8.1/exportZod/tsconfig.json similarity index 100% rename from codemods/netlify-sdk/0.8.1/exportZod/tsconfig.json rename to codemods-legacy/netlify-sdk/0.8.1/exportZod/tsconfig.json diff --git a/codemods/styledictionary/4/formatting-options/vitest.config.ts b/codemods-legacy/netlify-sdk/0.8.1/exportZod/vitest.config.ts similarity index 100% rename from codemods/styledictionary/4/formatting-options/vitest.config.ts rename to codemods-legacy/netlify-sdk/0.8.1/exportZod/vitest.config.ts diff --git a/codemods/netlify-sdk/0.8.4/addApiHandler/.codemodrc.json b/codemods-legacy/netlify-sdk/0.8.4/addApiHandler/.codemodrc.json similarity index 100% rename from codemods/netlify-sdk/0.8.4/addApiHandler/.codemodrc.json rename to codemods-legacy/netlify-sdk/0.8.4/addApiHandler/.codemodrc.json diff --git a/codemods/netlify-sdk/0.8.4/addApiHandler/README.md b/codemods-legacy/netlify-sdk/0.8.4/addApiHandler/README.md similarity index 100% rename from codemods/netlify-sdk/0.8.4/addApiHandler/README.md rename to codemods-legacy/netlify-sdk/0.8.4/addApiHandler/README.md diff --git a/codemods-legacy/netlify-sdk/0.8.4/addApiHandler/package.json b/codemods-legacy/netlify-sdk/0.8.4/addApiHandler/package.json new file mode 100644 index 00000000..3c408d3e --- /dev/null +++ b/codemods-legacy/netlify-sdk/0.8.4/addApiHandler/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-netlify-sdk-0.8.4-addapihandler", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/netlify-sdk/0.8.4/addApiHandler/src/index.ts b/codemods-legacy/netlify-sdk/0.8.4/addApiHandler/src/index.ts similarity index 100% rename from codemods/netlify-sdk/0.8.4/addApiHandler/src/index.ts rename to codemods-legacy/netlify-sdk/0.8.4/addApiHandler/src/index.ts diff --git a/codemods/netlify-sdk/0.8.4/addApiHandler/test/test.ts b/codemods-legacy/netlify-sdk/0.8.4/addApiHandler/test/test.ts similarity index 100% rename from codemods/netlify-sdk/0.8.4/addApiHandler/test/test.ts rename to codemods-legacy/netlify-sdk/0.8.4/addApiHandler/test/test.ts diff --git a/codemods/netlify-sdk/0.8.4/addApiHandler/tsconfig.json b/codemods-legacy/netlify-sdk/0.8.4/addApiHandler/tsconfig.json similarity index 100% rename from codemods/netlify-sdk/0.8.4/addApiHandler/tsconfig.json rename to codemods-legacy/netlify-sdk/0.8.4/addApiHandler/tsconfig.json diff --git a/codemods/styledictionary/4/hook-api-actions/vitest.config.ts b/codemods-legacy/netlify-sdk/0.8.4/addApiHandler/vitest.config.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-actions/vitest.config.ts rename to codemods-legacy/netlify-sdk/0.8.4/addApiHandler/vitest.config.ts diff --git a/codemods/netlify-sdk/0.8.5/createEnvironmentVariable/.codemodrc.json b/codemods-legacy/netlify-sdk/0.8.5/createEnvironmentVariable/.codemodrc.json similarity index 100% rename from codemods/netlify-sdk/0.8.5/createEnvironmentVariable/.codemodrc.json rename to codemods-legacy/netlify-sdk/0.8.5/createEnvironmentVariable/.codemodrc.json diff --git a/codemods/netlify-sdk/0.8.5/createEnvironmentVariable/README.md b/codemods-legacy/netlify-sdk/0.8.5/createEnvironmentVariable/README.md similarity index 100% rename from codemods/netlify-sdk/0.8.5/createEnvironmentVariable/README.md rename to codemods-legacy/netlify-sdk/0.8.5/createEnvironmentVariable/README.md diff --git a/codemods-legacy/netlify-sdk/0.8.5/createEnvironmentVariable/package.json b/codemods-legacy/netlify-sdk/0.8.5/createEnvironmentVariable/package.json new file mode 100644 index 00000000..bf15972c --- /dev/null +++ b/codemods-legacy/netlify-sdk/0.8.5/createEnvironmentVariable/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-netlify-sdk-0.8.5-createenvironmentvariable", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/netlify-sdk/0.8.5/createEnvironmentVariable/src/index.ts b/codemods-legacy/netlify-sdk/0.8.5/createEnvironmentVariable/src/index.ts similarity index 100% rename from codemods/netlify-sdk/0.8.5/createEnvironmentVariable/src/index.ts rename to codemods-legacy/netlify-sdk/0.8.5/createEnvironmentVariable/src/index.ts diff --git a/codemods/netlify-sdk/0.8.5/createEnvironmentVariable/test/test.ts b/codemods-legacy/netlify-sdk/0.8.5/createEnvironmentVariable/test/test.ts similarity index 100% rename from codemods/netlify-sdk/0.8.5/createEnvironmentVariable/test/test.ts rename to codemods-legacy/netlify-sdk/0.8.5/createEnvironmentVariable/test/test.ts diff --git a/codemods/netlify-sdk/0.8.5/createEnvironmentVariable/tsconfig.json b/codemods-legacy/netlify-sdk/0.8.5/createEnvironmentVariable/tsconfig.json similarity index 100% rename from codemods/netlify-sdk/0.8.5/createEnvironmentVariable/tsconfig.json rename to codemods-legacy/netlify-sdk/0.8.5/createEnvironmentVariable/tsconfig.json diff --git a/codemods/styledictionary/4/hook-api-file-header/vitest.config.ts b/codemods-legacy/netlify-sdk/0.8.5/createEnvironmentVariable/vitest.config.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-file-header/vitest.config.ts rename to codemods-legacy/netlify-sdk/0.8.5/createEnvironmentVariable/vitest.config.ts diff --git a/codemods/netlify-sdk/0.8.5/createOrUpdateVariable/.codemodrc.json b/codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariable/.codemodrc.json similarity index 100% rename from codemods/netlify-sdk/0.8.5/createOrUpdateVariable/.codemodrc.json rename to codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariable/.codemodrc.json diff --git a/codemods/netlify-sdk/0.8.5/createOrUpdateVariable/README.md b/codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariable/README.md similarity index 100% rename from codemods/netlify-sdk/0.8.5/createOrUpdateVariable/README.md rename to codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariable/README.md diff --git a/codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariable/package.json b/codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariable/package.json new file mode 100644 index 00000000..b20c4e97 --- /dev/null +++ b/codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariable/package.json @@ -0,0 +1,18 @@ +{ + "name": "@codemod-com/codemod-netlify-sdk-0.8.5-createorupdatevariable", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/netlify-sdk/0.8.5/createOrUpdateVariable/src/index.ts b/codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariable/src/index.ts similarity index 100% rename from codemods/netlify-sdk/0.8.5/createOrUpdateVariable/src/index.ts rename to codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariable/src/index.ts diff --git a/codemods/netlify-sdk/0.8.5/createOrUpdateVariable/tsconfig.json b/codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariable/tsconfig.json similarity index 100% rename from codemods/netlify-sdk/0.8.5/createOrUpdateVariable/tsconfig.json rename to codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariable/tsconfig.json diff --git a/codemods/netlify-sdk/0.8.5/createOrUpdateVariables/.codemodrc.json b/codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariables/.codemodrc.json similarity index 100% rename from codemods/netlify-sdk/0.8.5/createOrUpdateVariables/.codemodrc.json rename to codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariables/.codemodrc.json diff --git a/codemods/netlify-sdk/0.8.5/createOrUpdateVariables/README.md b/codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariables/README.md similarity index 100% rename from codemods/netlify-sdk/0.8.5/createOrUpdateVariables/README.md rename to codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariables/README.md diff --git a/codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariables/package.json b/codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariables/package.json new file mode 100644 index 00000000..783f8efd --- /dev/null +++ b/codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariables/package.json @@ -0,0 +1,18 @@ +{ + "name": "@codemod-com/codemod-netlify-sdk-0.8.5-createorupdatevariables", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/netlify-sdk/0.8.5/createOrUpdateVariables/src/index.ts b/codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariables/src/index.ts similarity index 100% rename from codemods/netlify-sdk/0.8.5/createOrUpdateVariables/src/index.ts rename to codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariables/src/index.ts diff --git a/codemods/netlify-sdk/0.8.5/createOrUpdateVariables/tsconfig.json b/codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariables/tsconfig.json similarity index 100% rename from codemods/netlify-sdk/0.8.5/createOrUpdateVariables/tsconfig.json rename to codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariables/tsconfig.json diff --git a/codemods/netlify-sdk/0.8.5/deleteEnvironmentVariable/.codemodrc.json b/codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariable/.codemodrc.json similarity index 100% rename from codemods/netlify-sdk/0.8.5/deleteEnvironmentVariable/.codemodrc.json rename to codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariable/.codemodrc.json diff --git a/codemods/netlify-sdk/0.8.5/deleteEnvironmentVariable/README.md b/codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariable/README.md similarity index 100% rename from codemods/netlify-sdk/0.8.5/deleteEnvironmentVariable/README.md rename to codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariable/README.md diff --git a/codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariable/package.json b/codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariable/package.json new file mode 100644 index 00000000..7fa4dfc4 --- /dev/null +++ b/codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariable/package.json @@ -0,0 +1,19 @@ +{ + "name": "@codemod-com/codemod-netlify-sdk-0.8.5-deleteenvironmentvariable", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/netlify-sdk/0.8.5/deleteEnvironmentVariable/src/index.ts b/codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariable/src/index.ts similarity index 100% rename from codemods/netlify-sdk/0.8.5/deleteEnvironmentVariable/src/index.ts rename to codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariable/src/index.ts diff --git a/codemods/netlify-sdk/0.8.5/deleteEnvironmentVariable/tsconfig.json b/codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariable/tsconfig.json similarity index 100% rename from codemods/netlify-sdk/0.8.5/deleteEnvironmentVariable/tsconfig.json rename to codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariable/tsconfig.json diff --git a/codemods/netlify-sdk/0.8.5/deleteEnvironmentVariables/.codemodrc.json b/codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariables/.codemodrc.json similarity index 100% rename from codemods/netlify-sdk/0.8.5/deleteEnvironmentVariables/.codemodrc.json rename to codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariables/.codemodrc.json diff --git a/codemods/netlify-sdk/0.8.5/deleteEnvironmentVariables/README.md b/codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariables/README.md similarity index 100% rename from codemods/netlify-sdk/0.8.5/deleteEnvironmentVariables/README.md rename to codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariables/README.md diff --git a/codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariables/package.json b/codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariables/package.json new file mode 100644 index 00000000..0f5b039c --- /dev/null +++ b/codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariables/package.json @@ -0,0 +1,18 @@ +{ + "name": "@codemod-com/codemod-netlify-sdk-0.8.5-deleteenvironmentvariables", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/netlify-sdk/0.8.5/deleteEnvironmentVariables/src/index.ts b/codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariables/src/index.ts similarity index 100% rename from codemods/netlify-sdk/0.8.5/deleteEnvironmentVariables/src/index.ts rename to codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariables/src/index.ts diff --git a/codemods/netlify-sdk/0.8.5/deleteEnvironmentVariables/tsconfig.json b/codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariables/tsconfig.json similarity index 100% rename from codemods/netlify-sdk/0.8.5/deleteEnvironmentVariables/tsconfig.json rename to codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariables/tsconfig.json diff --git a/codemods/netlify-sdk/0.8.5/getEnvironmentVariables/.codemodrc.json b/codemods-legacy/netlify-sdk/0.8.5/getEnvironmentVariables/.codemodrc.json similarity index 100% rename from codemods/netlify-sdk/0.8.5/getEnvironmentVariables/.codemodrc.json rename to codemods-legacy/netlify-sdk/0.8.5/getEnvironmentVariables/.codemodrc.json diff --git a/codemods/netlify-sdk/0.8.5/getEnvironmentVariables/README.md b/codemods-legacy/netlify-sdk/0.8.5/getEnvironmentVariables/README.md similarity index 100% rename from codemods/netlify-sdk/0.8.5/getEnvironmentVariables/README.md rename to codemods-legacy/netlify-sdk/0.8.5/getEnvironmentVariables/README.md diff --git a/codemods-legacy/netlify-sdk/0.8.5/getEnvironmentVariables/package.json b/codemods-legacy/netlify-sdk/0.8.5/getEnvironmentVariables/package.json new file mode 100644 index 00000000..6a105308 --- /dev/null +++ b/codemods-legacy/netlify-sdk/0.8.5/getEnvironmentVariables/package.json @@ -0,0 +1,18 @@ +{ + "name": "@codemod-com/codemod-netlify-sdk-0.8.5-getenvironmentvariables", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/netlify-sdk/0.8.5/getEnvironmentVariables/src/index.ts b/codemods-legacy/netlify-sdk/0.8.5/getEnvironmentVariables/src/index.ts similarity index 100% rename from codemods/netlify-sdk/0.8.5/getEnvironmentVariables/src/index.ts rename to codemods-legacy/netlify-sdk/0.8.5/getEnvironmentVariables/src/index.ts diff --git a/codemods/netlify-sdk/0.8.5/getEnvironmentVariables/tsconfig.json b/codemods-legacy/netlify-sdk/0.8.5/getEnvironmentVariables/tsconfig.json similarity index 100% rename from codemods/netlify-sdk/0.8.5/getEnvironmentVariables/tsconfig.json rename to codemods-legacy/netlify-sdk/0.8.5/getEnvironmentVariables/tsconfig.json diff --git a/codemods/netlify-sdk/0.8.5/netlify-sdk-0.8.5-recipe/.codemodrc.json b/codemods-legacy/netlify-sdk/0.8.5/netlify-sdk-0.8.5-recipe/.codemodrc.json similarity index 100% rename from codemods/netlify-sdk/0.8.5/netlify-sdk-0.8.5-recipe/.codemodrc.json rename to codemods-legacy/netlify-sdk/0.8.5/netlify-sdk-0.8.5-recipe/.codemodrc.json diff --git a/codemods/netlify-sdk/0.8.5/netlify-sdk-0.8.5-recipe/README.md b/codemods-legacy/netlify-sdk/0.8.5/netlify-sdk-0.8.5-recipe/README.md similarity index 100% rename from codemods/netlify-sdk/0.8.5/netlify-sdk-0.8.5-recipe/README.md rename to codemods-legacy/netlify-sdk/0.8.5/netlify-sdk-0.8.5-recipe/README.md diff --git a/codemods/netlify-sdk/0.8.5/netlify-sdk-0.8.5-recipe/package.json b/codemods-legacy/netlify-sdk/0.8.5/netlify-sdk-0.8.5-recipe/package.json similarity index 100% rename from codemods/netlify-sdk/0.8.5/netlify-sdk-0.8.5-recipe/package.json rename to codemods-legacy/netlify-sdk/0.8.5/netlify-sdk-0.8.5-recipe/package.json diff --git a/codemods/netlify-sdk/0.8.5/patchEnvironmentVariable/.codemodrc.json b/codemods-legacy/netlify-sdk/0.8.5/patchEnvironmentVariable/.codemodrc.json similarity index 100% rename from codemods/netlify-sdk/0.8.5/patchEnvironmentVariable/.codemodrc.json rename to codemods-legacy/netlify-sdk/0.8.5/patchEnvironmentVariable/.codemodrc.json diff --git a/codemods/netlify-sdk/0.8.5/patchEnvironmentVariable/README.md b/codemods-legacy/netlify-sdk/0.8.5/patchEnvironmentVariable/README.md similarity index 100% rename from codemods/netlify-sdk/0.8.5/patchEnvironmentVariable/README.md rename to codemods-legacy/netlify-sdk/0.8.5/patchEnvironmentVariable/README.md diff --git a/codemods-legacy/netlify-sdk/0.8.5/patchEnvironmentVariable/package.json b/codemods-legacy/netlify-sdk/0.8.5/patchEnvironmentVariable/package.json new file mode 100644 index 00000000..6ecaa312 --- /dev/null +++ b/codemods-legacy/netlify-sdk/0.8.5/patchEnvironmentVariable/package.json @@ -0,0 +1,18 @@ +{ + "name": "@codemod-com/codemod-netlify-sdk-0.8.5-patchenvironmentvariable", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/netlify-sdk/0.8.5/patchEnvironmentVariable/src/index.ts b/codemods-legacy/netlify-sdk/0.8.5/patchEnvironmentVariable/src/index.ts similarity index 100% rename from codemods/netlify-sdk/0.8.5/patchEnvironmentVariable/src/index.ts rename to codemods-legacy/netlify-sdk/0.8.5/patchEnvironmentVariable/src/index.ts diff --git a/codemods/netlify-sdk/0.8.5/patchEnvironmentVariable/tsconfig.json b/codemods-legacy/netlify-sdk/0.8.5/patchEnvironmentVariable/tsconfig.json similarity index 100% rename from codemods/netlify-sdk/0.8.5/patchEnvironmentVariable/tsconfig.json rename to codemods-legacy/netlify-sdk/0.8.5/patchEnvironmentVariable/tsconfig.json diff --git a/codemods/netlify-sdk/0.8.5/updateEnvironmentVariable/.codemodrc.json b/codemods-legacy/netlify-sdk/0.8.5/updateEnvironmentVariable/.codemodrc.json similarity index 100% rename from codemods/netlify-sdk/0.8.5/updateEnvironmentVariable/.codemodrc.json rename to codemods-legacy/netlify-sdk/0.8.5/updateEnvironmentVariable/.codemodrc.json diff --git a/codemods/netlify-sdk/0.8.5/updateEnvironmentVariable/README.md b/codemods-legacy/netlify-sdk/0.8.5/updateEnvironmentVariable/README.md similarity index 100% rename from codemods/netlify-sdk/0.8.5/updateEnvironmentVariable/README.md rename to codemods-legacy/netlify-sdk/0.8.5/updateEnvironmentVariable/README.md diff --git a/codemods-legacy/netlify-sdk/0.8.5/updateEnvironmentVariable/package.json b/codemods-legacy/netlify-sdk/0.8.5/updateEnvironmentVariable/package.json new file mode 100644 index 00000000..4424a14f --- /dev/null +++ b/codemods-legacy/netlify-sdk/0.8.5/updateEnvironmentVariable/package.json @@ -0,0 +1,18 @@ +{ + "name": "@codemod-com/codemod-netlify-sdk-0.8.5-updateenvironmentvariable", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/netlify-sdk/0.8.5/updateEnvironmentVariable/src/index.ts b/codemods-legacy/netlify-sdk/0.8.5/updateEnvironmentVariable/src/index.ts similarity index 100% rename from codemods/netlify-sdk/0.8.5/updateEnvironmentVariable/src/index.ts rename to codemods-legacy/netlify-sdk/0.8.5/updateEnvironmentVariable/src/index.ts diff --git a/codemods/netlify-sdk/0.8.5/updateEnvironmentVariable/tsconfig.json b/codemods-legacy/netlify-sdk/0.8.5/updateEnvironmentVariable/tsconfig.json similarity index 100% rename from codemods/netlify-sdk/0.8.5/updateEnvironmentVariable/tsconfig.json rename to codemods-legacy/netlify-sdk/0.8.5/updateEnvironmentVariable/tsconfig.json diff --git a/codemods/netlify/add-zod-validation/.codemodrc.json b/codemods-legacy/netlify/add-zod-validation/.codemodrc.json similarity index 100% rename from codemods/netlify/add-zod-validation/.codemodrc.json rename to codemods-legacy/netlify/add-zod-validation/.codemodrc.json diff --git a/codemods/netlify/add-zod-validation/.gitignore b/codemods-legacy/netlify/add-zod-validation/.gitignore similarity index 100% rename from codemods/netlify/add-zod-validation/.gitignore rename to codemods-legacy/netlify/add-zod-validation/.gitignore diff --git a/codemods/netlify/add-zod-validation/LICENSE b/codemods-legacy/netlify/add-zod-validation/LICENSE similarity index 100% rename from codemods/netlify/add-zod-validation/LICENSE rename to codemods-legacy/netlify/add-zod-validation/LICENSE diff --git a/codemods/netlify/add-zod-validation/README.md b/codemods-legacy/netlify/add-zod-validation/README.md similarity index 100% rename from codemods/netlify/add-zod-validation/README.md rename to codemods-legacy/netlify/add-zod-validation/README.md diff --git a/codemods/netlify/add-zod-validation/__testfixtures__/fixture1.input.ts b/codemods-legacy/netlify/add-zod-validation/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/netlify/add-zod-validation/__testfixtures__/fixture1.input.ts rename to codemods-legacy/netlify/add-zod-validation/__testfixtures__/fixture1.input.ts diff --git a/codemods/netlify/add-zod-validation/__testfixtures__/fixture1.output.ts b/codemods-legacy/netlify/add-zod-validation/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/netlify/add-zod-validation/__testfixtures__/fixture1.output.ts rename to codemods-legacy/netlify/add-zod-validation/__testfixtures__/fixture1.output.ts diff --git a/codemods/netlify/add-zod-validation/__testfixtures__/fixture2.input.ts b/codemods-legacy/netlify/add-zod-validation/__testfixtures__/fixture2.input.ts similarity index 100% rename from codemods/netlify/add-zod-validation/__testfixtures__/fixture2.input.ts rename to codemods-legacy/netlify/add-zod-validation/__testfixtures__/fixture2.input.ts diff --git a/codemods/netlify/add-zod-validation/__testfixtures__/fixture2.output.ts b/codemods-legacy/netlify/add-zod-validation/__testfixtures__/fixture2.output.ts similarity index 100% rename from codemods/netlify/add-zod-validation/__testfixtures__/fixture2.output.ts rename to codemods-legacy/netlify/add-zod-validation/__testfixtures__/fixture2.output.ts diff --git a/codemods/netlify/add-zod-validation/__testfixtures__/fixture3.input.ts b/codemods-legacy/netlify/add-zod-validation/__testfixtures__/fixture3.input.ts similarity index 100% rename from codemods/netlify/add-zod-validation/__testfixtures__/fixture3.input.ts rename to codemods-legacy/netlify/add-zod-validation/__testfixtures__/fixture3.input.ts diff --git a/codemods/netlify/add-zod-validation/__testfixtures__/fixture3.output.ts b/codemods-legacy/netlify/add-zod-validation/__testfixtures__/fixture3.output.ts similarity index 100% rename from codemods/netlify/add-zod-validation/__testfixtures__/fixture3.output.ts rename to codemods-legacy/netlify/add-zod-validation/__testfixtures__/fixture3.output.ts diff --git a/codemods-legacy/netlify/add-zod-validation/package.json b/codemods-legacy/netlify/add-zod-validation/package.json new file mode 100644 index 00000000..d9f115fa --- /dev/null +++ b/codemods-legacy/netlify/add-zod-validation/package.json @@ -0,0 +1,19 @@ +{ + "name": "add-zod-validation", + "license": "MIT", + "private": true, + "devDependencies": { + "@codemod.com/workflow": "0.0.31", + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "^5.2.2", + "vitest": "^1.0.1" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "arybitskiy" +} diff --git a/codemods/netlify/add-zod-validation/src/index.ts b/codemods-legacy/netlify/add-zod-validation/src/index.ts similarity index 100% rename from codemods/netlify/add-zod-validation/src/index.ts rename to codemods-legacy/netlify/add-zod-validation/src/index.ts diff --git a/codemods-legacy/netlify/add-zod-validation/tsconfig.json b/codemods-legacy/netlify/add-zod-validation/tsconfig.json new file mode 100644 index 00000000..36bd1c7d --- /dev/null +++ b/codemods-legacy/netlify/add-zod-validation/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@codemod-com/tsconfig/codemod.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "./dist" + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/styledictionary/4/hook-api-filters/vitest.config.ts b/codemods-legacy/netlify/add-zod-validation/vitest.config.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-filters/vitest.config.ts rename to codemods-legacy/netlify/add-zod-validation/vitest.config.ts diff --git a/codemods/netlify/replace-feature-flag/.codemodrc.json b/codemods-legacy/netlify/replace-feature-flag/.codemodrc.json similarity index 100% rename from codemods/netlify/replace-feature-flag/.codemodrc.json rename to codemods-legacy/netlify/replace-feature-flag/.codemodrc.json diff --git a/codemods/netlify/replace-feature-flag/.gitignore b/codemods-legacy/netlify/replace-feature-flag/.gitignore similarity index 100% rename from codemods/netlify/replace-feature-flag/.gitignore rename to codemods-legacy/netlify/replace-feature-flag/.gitignore diff --git a/codemods/netlify/replace-feature-flag/LICENSE b/codemods-legacy/netlify/replace-feature-flag/LICENSE similarity index 100% rename from codemods/netlify/replace-feature-flag/LICENSE rename to codemods-legacy/netlify/replace-feature-flag/LICENSE diff --git a/codemods/netlify/replace-feature-flag/README.md b/codemods-legacy/netlify/replace-feature-flag/README.md similarity index 100% rename from codemods/netlify/replace-feature-flag/README.md rename to codemods-legacy/netlify/replace-feature-flag/README.md diff --git a/codemods/netlify/replace-feature-flag/__testfixtures__/mockFlags.input.tsx b/codemods-legacy/netlify/replace-feature-flag/__testfixtures__/mockFlags.input.tsx similarity index 100% rename from codemods/netlify/replace-feature-flag/__testfixtures__/mockFlags.input.tsx rename to codemods-legacy/netlify/replace-feature-flag/__testfixtures__/mockFlags.input.tsx diff --git a/codemods/netlify/replace-feature-flag/__testfixtures__/mockFlags.output.tsx b/codemods-legacy/netlify/replace-feature-flag/__testfixtures__/mockFlags.output.tsx similarity index 100% rename from codemods/netlify/replace-feature-flag/__testfixtures__/mockFlags.output.tsx rename to codemods-legacy/netlify/replace-feature-flag/__testfixtures__/mockFlags.output.tsx diff --git a/codemods/netlify/replace-feature-flag/__testfixtures__/typeLiteralProperty.input.ts b/codemods-legacy/netlify/replace-feature-flag/__testfixtures__/typeLiteralProperty.input.ts similarity index 100% rename from codemods/netlify/replace-feature-flag/__testfixtures__/typeLiteralProperty.input.ts rename to codemods-legacy/netlify/replace-feature-flag/__testfixtures__/typeLiteralProperty.input.ts diff --git a/codemods/netlify/replace-feature-flag/__testfixtures__/typeLiteralProperty.output.ts b/codemods-legacy/netlify/replace-feature-flag/__testfixtures__/typeLiteralProperty.output.ts similarity index 100% rename from codemods/netlify/replace-feature-flag/__testfixtures__/typeLiteralProperty.output.ts rename to codemods-legacy/netlify/replace-feature-flag/__testfixtures__/typeLiteralProperty.output.ts diff --git a/codemods-legacy/netlify/replace-feature-flag/package.json b/codemods-legacy/netlify/replace-feature-flag/package.json new file mode 100644 index 00000000..382db71f --- /dev/null +++ b/codemods-legacy/netlify/replace-feature-flag/package.json @@ -0,0 +1,23 @@ +{ + "name": "netlify/replace-feature-flag", + "author": "dmytrohryshyn", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "5.2.2", + "vitest": "^1.0.1", + "ts-morph": "^22.0.0" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "license": "MIT", + "files": [ + "README.md", + ".codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/netlify/replace-feature-flag/src/index.ts b/codemods-legacy/netlify/replace-feature-flag/src/index.ts similarity index 100% rename from codemods/netlify/replace-feature-flag/src/index.ts rename to codemods-legacy/netlify/replace-feature-flag/src/index.ts diff --git a/codemods/netlify/replace-feature-flag/test/test.ts b/codemods-legacy/netlify/replace-feature-flag/test/test.ts similarity index 100% rename from codemods/netlify/replace-feature-flag/test/test.ts rename to codemods-legacy/netlify/replace-feature-flag/test/test.ts diff --git a/codemods-legacy/netlify/replace-feature-flag/tsconfig.json b/codemods-legacy/netlify/replace-feature-flag/tsconfig.json new file mode 100644 index 00000000..36bd1c7d --- /dev/null +++ b/codemods-legacy/netlify/replace-feature-flag/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@codemod-com/tsconfig/codemod.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "./dist" + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/styledictionary/4/hook-api-formats/vitest.config.ts b/codemods-legacy/netlify/replace-feature-flag/vitest.config.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-formats/vitest.config.ts rename to codemods-legacy/netlify/replace-feature-flag/vitest.config.ts diff --git a/codemods/next-i18next/copy-keys/.codemodrc.json b/codemods-legacy/next-i18next/copy-keys/.codemodrc.json similarity index 100% rename from codemods/next-i18next/copy-keys/.codemodrc.json rename to codemods-legacy/next-i18next/copy-keys/.codemodrc.json diff --git a/codemods/next-i18next/copy-keys/README.md b/codemods-legacy/next-i18next/copy-keys/README.md similarity index 100% rename from codemods/next-i18next/copy-keys/README.md rename to codemods-legacy/next-i18next/copy-keys/README.md diff --git a/codemods-legacy/next-i18next/copy-keys/package.json b/codemods-legacy/next-i18next/copy-keys/package.json new file mode 100644 index 00000000..d5a1d7b4 --- /dev/null +++ b/codemods-legacy/next-i18next/copy-keys/package.json @@ -0,0 +1,25 @@ +{ + "name": "@codemod-com/codemod-next-i18next-copy-keys", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "@codemod-com/filemod": "workspace:*", + "memfs": "^4.6.0", + "ts-morph": "^19.0.0", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/next-i18next/copy-keys/src/index.ts b/codemods-legacy/next-i18next/copy-keys/src/index.ts similarity index 100% rename from codemods/next-i18next/copy-keys/src/index.ts rename to codemods-legacy/next-i18next/copy-keys/src/index.ts diff --git a/codemods/next-i18next/copy-keys/test/test.ts b/codemods-legacy/next-i18next/copy-keys/test/test.ts similarity index 100% rename from codemods/next-i18next/copy-keys/test/test.ts rename to codemods-legacy/next-i18next/copy-keys/test/test.ts diff --git a/codemods/next-i18next/copy-keys/tsconfig.json b/codemods-legacy/next-i18next/copy-keys/tsconfig.json similarity index 100% rename from codemods/next-i18next/copy-keys/tsconfig.json rename to codemods-legacy/next-i18next/copy-keys/tsconfig.json diff --git a/codemods/styledictionary/4/hook-api-parsers/vitest.config.ts b/codemods-legacy/next-i18next/copy-keys/vitest.config.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-parsers/vitest.config.ts rename to codemods-legacy/next-i18next/copy-keys/vitest.config.ts diff --git a/codemods/next/13/ab-test/.codemodrc.json b/codemods-legacy/next/13/ab-test/.codemodrc.json similarity index 100% rename from codemods/next/13/ab-test/.codemodrc.json rename to codemods-legacy/next/13/ab-test/.codemodrc.json diff --git a/codemods/next/13/ab-test/README.md b/codemods-legacy/next/13/ab-test/README.md similarity index 100% rename from codemods/next/13/ab-test/README.md rename to codemods-legacy/next/13/ab-test/README.md diff --git a/codemods-legacy/next/13/ab-test/package.json b/codemods-legacy/next/13/ab-test/package.json new file mode 100644 index 00000000..dbda8166 --- /dev/null +++ b/codemods-legacy/next/13/ab-test/package.json @@ -0,0 +1,25 @@ +{ + "name": "@codemod-com/codemod-next-13-ab-test", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "@codemod-com/filemod": "workspace:*", + "memfs": "^4.6.0", + "ts-morph": "^19.0.0", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/next/13/ab-test/src/index.ts b/codemods-legacy/next/13/ab-test/src/index.ts similarity index 100% rename from codemods/next/13/ab-test/src/index.ts rename to codemods-legacy/next/13/ab-test/src/index.ts diff --git a/codemods/next/13/ab-test/test/test.ts b/codemods-legacy/next/13/ab-test/test/test.ts similarity index 100% rename from codemods/next/13/ab-test/test/test.ts rename to codemods-legacy/next/13/ab-test/test/test.ts diff --git a/codemods/next/13/ab-test/tsconfig.json b/codemods-legacy/next/13/ab-test/tsconfig.json similarity index 100% rename from codemods/next/13/ab-test/tsconfig.json rename to codemods-legacy/next/13/ab-test/tsconfig.json diff --git a/codemods/styledictionary/4/hook-api-preprocessors/vitest.config.ts b/codemods-legacy/next/13/ab-test/vitest.config.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-preprocessors/vitest.config.ts rename to codemods-legacy/next/13/ab-test/vitest.config.ts diff --git a/codemods/next/13/app-directory-boilerplate/.codemodrc.json b/codemods-legacy/next/13/app-directory-boilerplate/.codemodrc.json similarity index 100% rename from codemods/next/13/app-directory-boilerplate/.codemodrc.json rename to codemods-legacy/next/13/app-directory-boilerplate/.codemodrc.json diff --git a/codemods/next/13/app-directory-boilerplate/README.md b/codemods-legacy/next/13/app-directory-boilerplate/README.md similarity index 100% rename from codemods/next/13/app-directory-boilerplate/README.md rename to codemods-legacy/next/13/app-directory-boilerplate/README.md diff --git a/codemods-legacy/next/13/app-directory-boilerplate/package.json b/codemods-legacy/next/13/app-directory-boilerplate/package.json new file mode 100644 index 00000000..542d6329 --- /dev/null +++ b/codemods-legacy/next/13/app-directory-boilerplate/package.json @@ -0,0 +1,33 @@ +{ + "name": "@codemod-com/codemod-next-13-app-directory-boilerplate", + "dependencies": { + "mdast-util-from-markdown": "catalog:", + "mdast-util-to-markdown": "catalog:", + "micromark-extension-mdxjs": "catalog:", + "mdast-util-mdx": "catalog:", + "unist-util-visit": "catalog:" + }, + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "@codemod-com/filemod": "workspace:*", + "memfs": "^4.6.0", + "ts-morph": "^19.0.0", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run test.ts", + "test:win": "vitest run test.win.ts", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/next/13/app-directory-boilerplate/src/index.ts b/codemods-legacy/next/13/app-directory-boilerplate/src/index.ts similarity index 100% rename from codemods/next/13/app-directory-boilerplate/src/index.ts rename to codemods-legacy/next/13/app-directory-boilerplate/src/index.ts diff --git a/codemods/next/13/app-directory-boilerplate/test/test.ts b/codemods-legacy/next/13/app-directory-boilerplate/test/test.ts similarity index 100% rename from codemods/next/13/app-directory-boilerplate/test/test.ts rename to codemods-legacy/next/13/app-directory-boilerplate/test/test.ts diff --git a/codemods/next/13/app-directory-boilerplate/test/test.win.ts b/codemods-legacy/next/13/app-directory-boilerplate/test/test.win.ts similarity index 100% rename from codemods/next/13/app-directory-boilerplate/test/test.win.ts rename to codemods-legacy/next/13/app-directory-boilerplate/test/test.win.ts diff --git a/codemods/next/13/app-directory-boilerplate/tsconfig.json b/codemods-legacy/next/13/app-directory-boilerplate/tsconfig.json similarity index 100% rename from codemods/next/13/app-directory-boilerplate/tsconfig.json rename to codemods-legacy/next/13/app-directory-boilerplate/tsconfig.json diff --git a/codemods/styledictionary/4/hook-api-transform-groups/vitest.config.ts b/codemods-legacy/next/13/app-directory-boilerplate/vitest.config.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-transform-groups/vitest.config.ts rename to codemods-legacy/next/13/app-directory-boilerplate/vitest.config.ts diff --git a/codemods/next/13/app-router-recipe/.codemodrc.json b/codemods-legacy/next/13/app-router-recipe/.codemodrc.json similarity index 100% rename from codemods/next/13/app-router-recipe/.codemodrc.json rename to codemods-legacy/next/13/app-router-recipe/.codemodrc.json diff --git a/codemods/next/13/app-router-recipe/README.md b/codemods-legacy/next/13/app-router-recipe/README.md similarity index 100% rename from codemods/next/13/app-router-recipe/README.md rename to codemods-legacy/next/13/app-router-recipe/README.md diff --git a/codemods/next/13/app-router-recipe/package.json b/codemods-legacy/next/13/app-router-recipe/package.json similarity index 100% rename from codemods/next/13/app-router-recipe/package.json rename to codemods-legacy/next/13/app-router-recipe/package.json diff --git a/codemods/next/13/built-in-next-font/.codemodrc.json b/codemods-legacy/next/13/built-in-next-font/.codemodrc.json similarity index 100% rename from codemods/next/13/built-in-next-font/.codemodrc.json rename to codemods-legacy/next/13/built-in-next-font/.codemodrc.json diff --git a/codemods/next/13/built-in-next-font/README.md b/codemods-legacy/next/13/built-in-next-font/README.md similarity index 100% rename from codemods/next/13/built-in-next-font/README.md rename to codemods-legacy/next/13/built-in-next-font/README.md diff --git a/codemods-legacy/next/13/built-in-next-font/package.json b/codemods-legacy/next/13/built-in-next-font/package.json new file mode 100644 index 00000000..67e9979a --- /dev/null +++ b/codemods-legacy/next/13/built-in-next-font/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-next-13-built-in-next-font", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/next/13/built-in-next-font/src/index.ts b/codemods-legacy/next/13/built-in-next-font/src/index.ts similarity index 100% rename from codemods/next/13/built-in-next-font/src/index.ts rename to codemods-legacy/next/13/built-in-next-font/src/index.ts diff --git a/codemods/next/13/built-in-next-font/tsconfig.json b/codemods-legacy/next/13/built-in-next-font/tsconfig.json similarity index 100% rename from codemods/next/13/built-in-next-font/tsconfig.json rename to codemods-legacy/next/13/built-in-next-font/tsconfig.json diff --git a/codemods/next/13/comment-deletable-files/.codemodrc.json b/codemods-legacy/next/13/comment-deletable-files/.codemodrc.json similarity index 100% rename from codemods/next/13/comment-deletable-files/.codemodrc.json rename to codemods-legacy/next/13/comment-deletable-files/.codemodrc.json diff --git a/codemods/next/13/comment-deletable-files/README.md b/codemods-legacy/next/13/comment-deletable-files/README.md similarity index 100% rename from codemods/next/13/comment-deletable-files/README.md rename to codemods-legacy/next/13/comment-deletable-files/README.md diff --git a/codemods-legacy/next/13/comment-deletable-files/package.json b/codemods-legacy/next/13/comment-deletable-files/package.json new file mode 100644 index 00000000..cdd98952 --- /dev/null +++ b/codemods-legacy/next/13/comment-deletable-files/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-next-13-comment-deletable-files", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/next/13/comment-deletable-files/src/index.ts b/codemods-legacy/next/13/comment-deletable-files/src/index.ts similarity index 100% rename from codemods/next/13/comment-deletable-files/src/index.ts rename to codemods-legacy/next/13/comment-deletable-files/src/index.ts diff --git a/codemods/next/13/comment-deletable-files/test/test.ts b/codemods-legacy/next/13/comment-deletable-files/test/test.ts similarity index 100% rename from codemods/next/13/comment-deletable-files/test/test.ts rename to codemods-legacy/next/13/comment-deletable-files/test/test.ts diff --git a/codemods/next/13/comment-deletable-files/tsconfig.json b/codemods-legacy/next/13/comment-deletable-files/tsconfig.json similarity index 100% rename from codemods/next/13/comment-deletable-files/tsconfig.json rename to codemods-legacy/next/13/comment-deletable-files/tsconfig.json diff --git a/codemods/styledictionary/4/hook-api-transform/vitest.config.ts b/codemods-legacy/next/13/comment-deletable-files/vitest.config.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-transform/vitest.config.ts rename to codemods-legacy/next/13/comment-deletable-files/vitest.config.ts diff --git a/codemods/next/13/move-css-in-js-styles/.codemodrc.json b/codemods-legacy/next/13/move-css-in-js-styles/.codemodrc.json similarity index 100% rename from codemods/next/13/move-css-in-js-styles/.codemodrc.json rename to codemods-legacy/next/13/move-css-in-js-styles/.codemodrc.json diff --git a/codemods/next/13/move-css-in-js-styles/README.md b/codemods-legacy/next/13/move-css-in-js-styles/README.md similarity index 100% rename from codemods/next/13/move-css-in-js-styles/README.md rename to codemods-legacy/next/13/move-css-in-js-styles/README.md diff --git a/codemods-legacy/next/13/move-css-in-js-styles/package.json b/codemods-legacy/next/13/move-css-in-js-styles/package.json new file mode 100644 index 00000000..e55a65ea --- /dev/null +++ b/codemods-legacy/next/13/move-css-in-js-styles/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-next-13-move-css-in-js-styles", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1", + "sinon": "^15.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/next/13/move-css-in-js-styles/src/index.ts b/codemods-legacy/next/13/move-css-in-js-styles/src/index.ts similarity index 100% rename from codemods/next/13/move-css-in-js-styles/src/index.ts rename to codemods-legacy/next/13/move-css-in-js-styles/src/index.ts diff --git a/codemods/next/13/move-css-in-js-styles/test/test.ts b/codemods-legacy/next/13/move-css-in-js-styles/test/test.ts similarity index 100% rename from codemods/next/13/move-css-in-js-styles/test/test.ts rename to codemods-legacy/next/13/move-css-in-js-styles/test/test.ts diff --git a/codemods/next/13/move-css-in-js-styles/tsconfig.json b/codemods-legacy/next/13/move-css-in-js-styles/tsconfig.json similarity index 100% rename from codemods/next/13/move-css-in-js-styles/tsconfig.json rename to codemods-legacy/next/13/move-css-in-js-styles/tsconfig.json diff --git a/codemods/styledictionary/4/instantiating-style-dictionary/vitest.config.ts b/codemods-legacy/next/13/move-css-in-js-styles/vitest.config.ts similarity index 100% rename from codemods/styledictionary/4/instantiating-style-dictionary/vitest.config.ts rename to codemods-legacy/next/13/move-css-in-js-styles/vitest.config.ts diff --git a/codemods/next/13/new-image-experimental/.codemodrc.json b/codemods-legacy/next/13/new-image-experimental/.codemodrc.json similarity index 100% rename from codemods/next/13/new-image-experimental/.codemodrc.json rename to codemods-legacy/next/13/new-image-experimental/.codemodrc.json diff --git a/codemods/next/13/new-image-experimental/README.md b/codemods-legacy/next/13/new-image-experimental/README.md similarity index 100% rename from codemods/next/13/new-image-experimental/README.md rename to codemods-legacy/next/13/new-image-experimental/README.md diff --git a/codemods-legacy/next/13/new-image-experimental/package.json b/codemods-legacy/next/13/new-image-experimental/package.json new file mode 100644 index 00000000..0390e6cf --- /dev/null +++ b/codemods-legacy/next/13/new-image-experimental/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-next-13-new-image-experimental", + + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/next/13/new-image-experimental/src/index.ts b/codemods-legacy/next/13/new-image-experimental/src/index.ts similarity index 100% rename from codemods/next/13/new-image-experimental/src/index.ts rename to codemods-legacy/next/13/new-image-experimental/src/index.ts diff --git a/codemods/next/13/new-image-experimental/test/test.ts b/codemods-legacy/next/13/new-image-experimental/test/test.ts similarity index 100% rename from codemods/next/13/new-image-experimental/test/test.ts rename to codemods-legacy/next/13/new-image-experimental/test/test.ts diff --git a/codemods/next/13/new-image-experimental/tsconfig.json b/codemods-legacy/next/13/new-image-experimental/tsconfig.json similarity index 100% rename from codemods/next/13/new-image-experimental/tsconfig.json rename to codemods-legacy/next/13/new-image-experimental/tsconfig.json diff --git a/codemods/styledictionary/4/logging/vitest.config.ts b/codemods-legacy/next/13/new-image-experimental/vitest.config.ts similarity index 100% rename from codemods/styledictionary/4/logging/vitest.config.ts rename to codemods-legacy/next/13/new-image-experimental/vitest.config.ts diff --git a/codemods/next/13/new-link/.codemodrc.json b/codemods-legacy/next/13/new-link/.codemodrc.json similarity index 100% rename from codemods/next/13/new-link/.codemodrc.json rename to codemods-legacy/next/13/new-link/.codemodrc.json diff --git a/codemods/next/13/new-link/README.md b/codemods-legacy/next/13/new-link/README.md similarity index 100% rename from codemods/next/13/new-link/README.md rename to codemods-legacy/next/13/new-link/README.md diff --git a/codemods-legacy/next/13/new-link/package.json b/codemods-legacy/next/13/new-link/package.json new file mode 100644 index 00000000..1cbd295e --- /dev/null +++ b/codemods-legacy/next/13/new-link/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-next-13-new-link", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/next/13/new-link/src/index.ts b/codemods-legacy/next/13/new-link/src/index.ts similarity index 100% rename from codemods/next/13/new-link/src/index.ts rename to codemods-legacy/next/13/new-link/src/index.ts diff --git a/codemods/next/13/new-link/test/test.ts b/codemods-legacy/next/13/new-link/test/test.ts similarity index 100% rename from codemods/next/13/new-link/test/test.ts rename to codemods-legacy/next/13/new-link/test/test.ts diff --git a/codemods/next/13/new-link/tsconfig.json b/codemods-legacy/next/13/new-link/tsconfig.json similarity index 100% rename from codemods/next/13/new-link/tsconfig.json rename to codemods-legacy/next/13/new-link/tsconfig.json diff --git a/codemods/styledictionary/4/module-common-js/vitest.config.ts b/codemods-legacy/next/13/new-link/vitest.config.ts similarity index 100% rename from codemods/styledictionary/4/module-common-js/vitest.config.ts rename to codemods-legacy/next/13/new-link/vitest.config.ts diff --git a/codemods/next/13/next-image-to-legacy-image/.codemodrc.json b/codemods-legacy/next/13/next-image-to-legacy-image/.codemodrc.json similarity index 100% rename from codemods/next/13/next-image-to-legacy-image/.codemodrc.json rename to codemods-legacy/next/13/next-image-to-legacy-image/.codemodrc.json diff --git a/codemods/next/13/next-image-to-legacy-image/README.md b/codemods-legacy/next/13/next-image-to-legacy-image/README.md similarity index 100% rename from codemods/next/13/next-image-to-legacy-image/README.md rename to codemods-legacy/next/13/next-image-to-legacy-image/README.md diff --git a/codemods-legacy/next/13/next-image-to-legacy-image/package.json b/codemods-legacy/next/13/next-image-to-legacy-image/package.json new file mode 100644 index 00000000..9a1f90f6 --- /dev/null +++ b/codemods-legacy/next/13/next-image-to-legacy-image/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-next-13-next-image-to-legacy-image", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/next/13/next-image-to-legacy-image/src/index.ts b/codemods-legacy/next/13/next-image-to-legacy-image/src/index.ts similarity index 100% rename from codemods/next/13/next-image-to-legacy-image/src/index.ts rename to codemods-legacy/next/13/next-image-to-legacy-image/src/index.ts diff --git a/codemods/next/13/next-image-to-legacy-image/tsconfig.json b/codemods-legacy/next/13/next-image-to-legacy-image/tsconfig.json similarity index 100% rename from codemods/next/13/next-image-to-legacy-image/tsconfig.json rename to codemods-legacy/next/13/next-image-to-legacy-image/tsconfig.json diff --git a/codemods/next/13/remove-get-static-props/.codemodrc.json b/codemods-legacy/next/13/remove-get-static-props/.codemodrc.json similarity index 100% rename from codemods/next/13/remove-get-static-props/.codemodrc.json rename to codemods-legacy/next/13/remove-get-static-props/.codemodrc.json diff --git a/codemods/next/13/remove-get-static-props/README.md b/codemods-legacy/next/13/remove-get-static-props/README.md similarity index 100% rename from codemods/next/13/remove-get-static-props/README.md rename to codemods-legacy/next/13/remove-get-static-props/README.md diff --git a/codemods-legacy/next/13/remove-get-static-props/package.json b/codemods-legacy/next/13/remove-get-static-props/package.json new file mode 100644 index 00000000..7b6c0c19 --- /dev/null +++ b/codemods-legacy/next/13/remove-get-static-props/package.json @@ -0,0 +1,25 @@ +{ + "name": "@codemod-com/codemod-next-13-remove-get-static-props", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "@codemod-com/filemod": "workspace:*", + "memfs": "^4.6.0", + "ts-morph": "^19.0.0", + "jscodeshift": "0.14.0", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/next/13/remove-get-static-props/src/index.ts b/codemods-legacy/next/13/remove-get-static-props/src/index.ts similarity index 100% rename from codemods/next/13/remove-get-static-props/src/index.ts rename to codemods-legacy/next/13/remove-get-static-props/src/index.ts diff --git a/codemods/next/13/remove-get-static-props/test/test.ts b/codemods-legacy/next/13/remove-get-static-props/test/test.ts similarity index 100% rename from codemods/next/13/remove-get-static-props/test/test.ts rename to codemods-legacy/next/13/remove-get-static-props/test/test.ts diff --git a/codemods/next/13/remove-get-static-props/tsconfig.json b/codemods-legacy/next/13/remove-get-static-props/tsconfig.json similarity index 100% rename from codemods/next/13/remove-get-static-props/tsconfig.json rename to codemods-legacy/next/13/remove-get-static-props/tsconfig.json diff --git a/codemods/styledictionary/4/reference-utils/vitest.config.ts b/codemods-legacy/next/13/remove-get-static-props/vitest.config.ts similarity index 100% rename from codemods/styledictionary/4/reference-utils/vitest.config.ts rename to codemods-legacy/next/13/remove-get-static-props/vitest.config.ts diff --git a/codemods/next/13/remove-next-export/.codemodrc.json b/codemods-legacy/next/13/remove-next-export/.codemodrc.json similarity index 100% rename from codemods/next/13/remove-next-export/.codemodrc.json rename to codemods-legacy/next/13/remove-next-export/.codemodrc.json diff --git a/codemods/next/13/remove-next-export/README.md b/codemods-legacy/next/13/remove-next-export/README.md similarity index 100% rename from codemods/next/13/remove-next-export/README.md rename to codemods-legacy/next/13/remove-next-export/README.md diff --git a/codemods-legacy/next/13/remove-next-export/package.json b/codemods-legacy/next/13/remove-next-export/package.json new file mode 100644 index 00000000..ede3445e --- /dev/null +++ b/codemods-legacy/next/13/remove-next-export/package.json @@ -0,0 +1,25 @@ +{ + "name": "@codemod-com/codemod-next-13-remove-next-export", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "@codemod-com/filemod": "workspace:*", + "memfs": "^4.6.0", + "ts-morph": "^19.0.0", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/next/13/remove-next-export/src/index.ts b/codemods-legacy/next/13/remove-next-export/src/index.ts similarity index 100% rename from codemods/next/13/remove-next-export/src/index.ts rename to codemods-legacy/next/13/remove-next-export/src/index.ts diff --git a/codemods/next/13/remove-next-export/test/test.ts b/codemods-legacy/next/13/remove-next-export/test/test.ts similarity index 100% rename from codemods/next/13/remove-next-export/test/test.ts rename to codemods-legacy/next/13/remove-next-export/test/test.ts diff --git a/codemods/next/13/remove-next-export/tsconfig.json b/codemods-legacy/next/13/remove-next-export/tsconfig.json similarity index 100% rename from codemods/next/13/remove-next-export/tsconfig.json rename to codemods-legacy/next/13/remove-next-export/tsconfig.json diff --git a/codemods/styledictionary/4/type/vitest.config.ts b/codemods-legacy/next/13/remove-next-export/vitest.config.ts similarity index 100% rename from codemods/styledictionary/4/type/vitest.config.ts rename to codemods-legacy/next/13/remove-next-export/vitest.config.ts diff --git a/codemods/next/13/replace-api-routes/.codemodrc.json b/codemods-legacy/next/13/replace-api-routes/.codemodrc.json similarity index 100% rename from codemods/next/13/replace-api-routes/.codemodrc.json rename to codemods-legacy/next/13/replace-api-routes/.codemodrc.json diff --git a/codemods/next/13/replace-api-routes/README.md b/codemods-legacy/next/13/replace-api-routes/README.md similarity index 100% rename from codemods/next/13/replace-api-routes/README.md rename to codemods-legacy/next/13/replace-api-routes/README.md diff --git a/codemods-legacy/next/13/replace-api-routes/package.json b/codemods-legacy/next/13/replace-api-routes/package.json new file mode 100644 index 00000000..25b3c3d7 --- /dev/null +++ b/codemods-legacy/next/13/replace-api-routes/package.json @@ -0,0 +1,25 @@ +{ + "name": "@codemod-com/codemod-next-13-replace-api-routes", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "@codemod-com/filemod": "workspace:*", + "memfs": "^4.6.0", + "ts-morph": "^19.0.0", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/next/13/replace-api-routes/src/index.ts b/codemods-legacy/next/13/replace-api-routes/src/index.ts similarity index 100% rename from codemods/next/13/replace-api-routes/src/index.ts rename to codemods-legacy/next/13/replace-api-routes/src/index.ts diff --git a/codemods/next/13/replace-api-routes/test/test.ts b/codemods-legacy/next/13/replace-api-routes/test/test.ts similarity index 100% rename from codemods/next/13/replace-api-routes/test/test.ts rename to codemods-legacy/next/13/replace-api-routes/test/test.ts diff --git a/codemods/next/13/replace-api-routes/tsconfig.json b/codemods-legacy/next/13/replace-api-routes/tsconfig.json similarity index 100% rename from codemods/next/13/replace-api-routes/tsconfig.json rename to codemods-legacy/next/13/replace-api-routes/tsconfig.json diff --git a/codemods/styledictionary/4/updated-and-removed-transforms/vitest.config.ts b/codemods-legacy/next/13/replace-api-routes/vitest.config.ts similarity index 100% rename from codemods/styledictionary/4/updated-and-removed-transforms/vitest.config.ts rename to codemods-legacy/next/13/replace-api-routes/vitest.config.ts diff --git a/codemods/next/13/replace-next-head/.codemodrc.json b/codemods-legacy/next/13/replace-next-head/.codemodrc.json similarity index 100% rename from codemods/next/13/replace-next-head/.codemodrc.json rename to codemods-legacy/next/13/replace-next-head/.codemodrc.json diff --git a/codemods/next/13/replace-next-head/README.md b/codemods-legacy/next/13/replace-next-head/README.md similarity index 100% rename from codemods/next/13/replace-next-head/README.md rename to codemods-legacy/next/13/replace-next-head/README.md diff --git a/codemods-legacy/next/13/replace-next-head/package.json b/codemods-legacy/next/13/replace-next-head/package.json new file mode 100644 index 00000000..97f39314 --- /dev/null +++ b/codemods-legacy/next/13/replace-next-head/package.json @@ -0,0 +1,33 @@ +{ + "name": "@codemod-com/codemod-next-13-replace-next-head", + "dependencies": { + "mdast-util-from-markdown": "catalog:", + "mdast-util-to-markdown": "catalog:", + "micromark-extension-mdxjs": "catalog:", + "mdast-util-mdx": "catalog:", + "unist-util-visit": "catalog:", + "unist-util-filter": "^5.0.1" + }, + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "@codemod-com/filemod": "workspace:*", + "memfs": "^4.6.0", + "ts-morph": "^19.0.0", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/next/13/replace-next-head/src/index.ts b/codemods-legacy/next/13/replace-next-head/src/index.ts similarity index 100% rename from codemods/next/13/replace-next-head/src/index.ts rename to codemods-legacy/next/13/replace-next-head/src/index.ts diff --git a/codemods/next/13/replace-next-head/test/test.ts b/codemods-legacy/next/13/replace-next-head/test/test.ts similarity index 100% rename from codemods/next/13/replace-next-head/test/test.ts rename to codemods-legacy/next/13/replace-next-head/test/test.ts diff --git a/codemods/next/13/replace-next-head/tsconfig.json b/codemods-legacy/next/13/replace-next-head/tsconfig.json similarity index 100% rename from codemods/next/13/replace-next-head/tsconfig.json rename to codemods-legacy/next/13/replace-next-head/tsconfig.json diff --git a/codemods/svelte/5/components-as-functions-destroyfunction/vitest.config.ts b/codemods-legacy/next/13/replace-next-head/vitest.config.ts similarity index 100% rename from codemods/svelte/5/components-as-functions-destroyfunction/vitest.config.ts rename to codemods-legacy/next/13/replace-next-head/vitest.config.ts diff --git a/codemods/next/13/replace-next-router/.codemodrc.json b/codemods-legacy/next/13/replace-next-router/.codemodrc.json similarity index 100% rename from codemods/next/13/replace-next-router/.codemodrc.json rename to codemods-legacy/next/13/replace-next-router/.codemodrc.json diff --git a/codemods/next/13/replace-next-router/README.md b/codemods-legacy/next/13/replace-next-router/README.md similarity index 100% rename from codemods/next/13/replace-next-router/README.md rename to codemods-legacy/next/13/replace-next-router/README.md diff --git a/codemods-legacy/next/13/replace-next-router/package.json b/codemods-legacy/next/13/replace-next-router/package.json new file mode 100644 index 00000000..8674fe61 --- /dev/null +++ b/codemods-legacy/next/13/replace-next-router/package.json @@ -0,0 +1,21 @@ +{ + "name": "@codemod-com/codemod-next-13-replace-next-router", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "ts-morph": "^19.0.0", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/next/13/replace-next-router/src/index.ts b/codemods-legacy/next/13/replace-next-router/src/index.ts similarity index 100% rename from codemods/next/13/replace-next-router/src/index.ts rename to codemods-legacy/next/13/replace-next-router/src/index.ts diff --git a/codemods/next/13/replace-next-router/test/test.ts b/codemods-legacy/next/13/replace-next-router/test/test.ts similarity index 100% rename from codemods/next/13/replace-next-router/test/test.ts rename to codemods-legacy/next/13/replace-next-router/test/test.ts diff --git a/codemods/next/13/replace-next-router/tsconfig.json b/codemods-legacy/next/13/replace-next-router/tsconfig.json similarity index 100% rename from codemods/next/13/replace-next-router/tsconfig.json rename to codemods-legacy/next/13/replace-next-router/tsconfig.json diff --git a/codemods/svelte/5/components-as-functions-onfunction/vitest.config.ts b/codemods-legacy/next/13/replace-next-router/vitest.config.ts similarity index 100% rename from codemods/svelte/5/components-as-functions-onfunction/vitest.config.ts rename to codemods-legacy/next/13/replace-next-router/vitest.config.ts diff --git a/codemods/next/13/replace-use-search-params/.codemodrc.json b/codemods-legacy/next/13/replace-use-search-params/.codemodrc.json similarity index 100% rename from codemods/next/13/replace-use-search-params/.codemodrc.json rename to codemods-legacy/next/13/replace-use-search-params/.codemodrc.json diff --git a/codemods/next/13/replace-use-search-params/README.md b/codemods-legacy/next/13/replace-use-search-params/README.md similarity index 100% rename from codemods/next/13/replace-use-search-params/README.md rename to codemods-legacy/next/13/replace-use-search-params/README.md diff --git a/codemods-legacy/next/13/replace-use-search-params/package.json b/codemods-legacy/next/13/replace-use-search-params/package.json new file mode 100644 index 00000000..bd0fe213 --- /dev/null +++ b/codemods-legacy/next/13/replace-use-search-params/package.json @@ -0,0 +1,25 @@ +{ + "name": "@codemod-com/codemod-next-13-replace-use-search-params", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "@codemod-com/filemod": "workspace:*", + "memfs": "^4.6.0", + "ts-morph": "^19.0.0", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/next/13/replace-use-search-params/src/index.ts b/codemods-legacy/next/13/replace-use-search-params/src/index.ts similarity index 100% rename from codemods/next/13/replace-use-search-params/src/index.ts rename to codemods-legacy/next/13/replace-use-search-params/src/index.ts diff --git a/codemods/next/13/replace-use-search-params/test/test.ts b/codemods-legacy/next/13/replace-use-search-params/test/test.ts similarity index 100% rename from codemods/next/13/replace-use-search-params/test/test.ts rename to codemods-legacy/next/13/replace-use-search-params/test/test.ts diff --git a/codemods/next/13/replace-use-search-params/tsconfig.json b/codemods-legacy/next/13/replace-use-search-params/tsconfig.json similarity index 100% rename from codemods/next/13/replace-use-search-params/tsconfig.json rename to codemods-legacy/next/13/replace-use-search-params/tsconfig.json diff --git a/codemods/svelte/5/components-as-functions/vitest.config.ts b/codemods-legacy/next/13/replace-use-search-params/vitest.config.ts similarity index 100% rename from codemods/svelte/5/components-as-functions/vitest.config.ts rename to codemods-legacy/next/13/replace-use-search-params/vitest.config.ts diff --git a/codemods/next/13/upsert-use-client-directive/.codemodrc.json b/codemods-legacy/next/13/upsert-use-client-directive/.codemodrc.json similarity index 100% rename from codemods/next/13/upsert-use-client-directive/.codemodrc.json rename to codemods-legacy/next/13/upsert-use-client-directive/.codemodrc.json diff --git a/codemods/next/13/upsert-use-client-directive/README.md b/codemods-legacy/next/13/upsert-use-client-directive/README.md similarity index 100% rename from codemods/next/13/upsert-use-client-directive/README.md rename to codemods-legacy/next/13/upsert-use-client-directive/README.md diff --git a/codemods-legacy/next/13/upsert-use-client-directive/package.json b/codemods-legacy/next/13/upsert-use-client-directive/package.json new file mode 100644 index 00000000..a0965fe6 --- /dev/null +++ b/codemods-legacy/next/13/upsert-use-client-directive/package.json @@ -0,0 +1,21 @@ +{ + "name": "@codemod-com/codemod-next-13-upsert-use-client-directive", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "ts-morph": "^19.0.0", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/next/13/upsert-use-client-directive/src/index.ts b/codemods-legacy/next/13/upsert-use-client-directive/src/index.ts similarity index 100% rename from codemods/next/13/upsert-use-client-directive/src/index.ts rename to codemods-legacy/next/13/upsert-use-client-directive/src/index.ts diff --git a/codemods/next/13/upsert-use-client-directive/test/test.ts b/codemods-legacy/next/13/upsert-use-client-directive/test/test.ts similarity index 100% rename from codemods/next/13/upsert-use-client-directive/test/test.ts rename to codemods-legacy/next/13/upsert-use-client-directive/test/test.ts diff --git a/codemods/next/13/upsert-use-client-directive/tsconfig.json b/codemods-legacy/next/13/upsert-use-client-directive/tsconfig.json similarity index 100% rename from codemods/next/13/upsert-use-client-directive/tsconfig.json rename to codemods-legacy/next/13/upsert-use-client-directive/tsconfig.json diff --git a/codemods/svelte/5/is-where-scoping/vitest.config.ts b/codemods-legacy/next/13/upsert-use-client-directive/vitest.config.ts similarity index 100% rename from codemods/svelte/5/is-where-scoping/vitest.config.ts rename to codemods-legacy/next/13/upsert-use-client-directive/vitest.config.ts diff --git a/codemods/next/14/metadata-to-viewport-export/.codemodrc.json b/codemods-legacy/next/14/metadata-to-viewport-export/.codemodrc.json similarity index 100% rename from codemods/next/14/metadata-to-viewport-export/.codemodrc.json rename to codemods-legacy/next/14/metadata-to-viewport-export/.codemodrc.json diff --git a/codemods/next/14/metadata-to-viewport-export/README.md b/codemods-legacy/next/14/metadata-to-viewport-export/README.md similarity index 100% rename from codemods/next/14/metadata-to-viewport-export/README.md rename to codemods-legacy/next/14/metadata-to-viewport-export/README.md diff --git a/codemods-legacy/next/14/metadata-to-viewport-export/package.json b/codemods-legacy/next/14/metadata-to-viewport-export/package.json new file mode 100644 index 00000000..dd45a1b9 --- /dev/null +++ b/codemods-legacy/next/14/metadata-to-viewport-export/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-next-14-metadata-to-viewport-export", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/next/14/metadata-to-viewport-export/src/index.ts b/codemods-legacy/next/14/metadata-to-viewport-export/src/index.ts similarity index 100% rename from codemods/next/14/metadata-to-viewport-export/src/index.ts rename to codemods-legacy/next/14/metadata-to-viewport-export/src/index.ts diff --git a/codemods/next/14/metadata-to-viewport-export/test/test.ts b/codemods-legacy/next/14/metadata-to-viewport-export/test/test.ts similarity index 100% rename from codemods/next/14/metadata-to-viewport-export/test/test.ts rename to codemods-legacy/next/14/metadata-to-viewport-export/test/test.ts diff --git a/codemods/next/14/metadata-to-viewport-export/tsconfig.json b/codemods-legacy/next/14/metadata-to-viewport-export/tsconfig.json similarity index 100% rename from codemods/next/14/metadata-to-viewport-export/tsconfig.json rename to codemods-legacy/next/14/metadata-to-viewport-export/tsconfig.json diff --git a/codemods/svelte/5/server-api-changes/vitest.config.ts b/codemods-legacy/next/14/metadata-to-viewport-export/vitest.config.ts similarity index 100% rename from codemods/svelte/5/server-api-changes/vitest.config.ts rename to codemods-legacy/next/14/metadata-to-viewport-export/vitest.config.ts diff --git a/codemods/next/14/next-og-import/.codemodrc.json b/codemods-legacy/next/14/next-og-import/.codemodrc.json similarity index 100% rename from codemods/next/14/next-og-import/.codemodrc.json rename to codemods-legacy/next/14/next-og-import/.codemodrc.json diff --git a/codemods/next/14/next-og-import/README.md b/codemods-legacy/next/14/next-og-import/README.md similarity index 100% rename from codemods/next/14/next-og-import/README.md rename to codemods-legacy/next/14/next-og-import/README.md diff --git a/codemods-legacy/next/14/next-og-import/package.json b/codemods-legacy/next/14/next-og-import/package.json new file mode 100644 index 00000000..908e6ec3 --- /dev/null +++ b/codemods-legacy/next/14/next-og-import/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-next-14-next-og-import", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/next/14/next-og-import/src/index.ts b/codemods-legacy/next/14/next-og-import/src/index.ts similarity index 100% rename from codemods/next/14/next-og-import/src/index.ts rename to codemods-legacy/next/14/next-og-import/src/index.ts diff --git a/codemods/next/14/next-og-import/test/test.ts b/codemods-legacy/next/14/next-og-import/test/test.ts similarity index 100% rename from codemods/next/14/next-og-import/test/test.ts rename to codemods-legacy/next/14/next-og-import/test/test.ts diff --git a/codemods/next/14/next-og-import/tsconfig.json b/codemods-legacy/next/14/next-og-import/tsconfig.json similarity index 100% rename from codemods/next/14/next-og-import/tsconfig.json rename to codemods-legacy/next/14/next-og-import/tsconfig.json diff --git a/codemods/svelte/5/svelte-element-expression/vitest.config.ts b/codemods-legacy/next/14/next-og-import/vitest.config.ts similarity index 100% rename from codemods/svelte/5/svelte-element-expression/vitest.config.ts rename to codemods-legacy/next/14/next-og-import/vitest.config.ts diff --git a/codemods/nextAuth/useSession-array-to-Object-destrucutring/.codemodrc.json b/codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring/.codemodrc.json similarity index 100% rename from codemods/nextAuth/useSession-array-to-Object-destrucutring/.codemodrc.json rename to codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring/.codemodrc.json diff --git a/codemods/nextAuth/useSession-array-to-Object-destrucutring/.gitignore b/codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring/.gitignore similarity index 100% rename from codemods/nextAuth/useSession-array-to-Object-destrucutring/.gitignore rename to codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring/.gitignore diff --git a/codemods/nextAuth/useSession-array-to-Object-destrucutring/LICENSE b/codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring/LICENSE similarity index 100% rename from codemods/nextAuth/useSession-array-to-Object-destrucutring/LICENSE rename to codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring/LICENSE diff --git a/codemods/nextAuth/useSession-array-to-Object-destrucutring/README.md b/codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring/README.md similarity index 100% rename from codemods/nextAuth/useSession-array-to-Object-destrucutring/README.md rename to codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring/README.md diff --git a/codemods/nextAuth/useSession-array-to-Object-destrucutring/__testfixtures__/fixture1.input.ts b/codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/nextAuth/useSession-array-to-Object-destrucutring/__testfixtures__/fixture1.input.ts rename to codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring/__testfixtures__/fixture1.input.ts diff --git a/codemods/nextAuth/useSession-array-to-Object-destrucutring/__testfixtures__/fixture1.output.ts b/codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/nextAuth/useSession-array-to-Object-destrucutring/__testfixtures__/fixture1.output.ts rename to codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring/package.json b/codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring/package.json new file mode 100644 index 00000000..761f28ac --- /dev/null +++ b/codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring/package.json @@ -0,0 +1,22 @@ +{ + "name": "nextjs-use-session-array-to-object-destructuring", + "license": "MIT", + "private": true, + "devDependencies": { + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1" + }, + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "manishjha-04" +} diff --git a/codemods/nextAuth/useSession-array-to-Object-destrucutring/src/index.ts b/codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring/src/index.ts similarity index 100% rename from codemods/nextAuth/useSession-array-to-Object-destrucutring/src/index.ts rename to codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring/src/index.ts diff --git a/codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring/test/test.ts b/codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring/test/test.ts new file mode 100644 index 00000000..f1a0f9b6 --- /dev/null +++ b/codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring/test/test.ts @@ -0,0 +1,51 @@ +import assert from "node:assert"; +import { describe, it } from "node:test"; +import { readFile } from "node:fs/promises"; +import { join } from "node:path"; +import jscodeshift from "jscodeshift"; +import type { API } from "jscodeshift"; +import transform from "../src/index.ts"; + +const __dirname = new URL(".", import.meta.url).pathname; + +const buildApi = (parser: string | undefined): API => ({ + j: parser ? jscodeshift.withParser(parser) : jscodeshift, + jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, + stats: () => { + console.error( + "The stats function was called, which is not supported on purpose", + ); + }, + report: () => { + console.error( + "The report function was called, which is not supported on purpose", + ); + }, +}); + +describe("nextjs/use-session-array-to-object-destructuring", () => { + it("test #1", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/\s/gm, ""), + OUTPUT.replace(/\s/gm, ""), + ); + }); +}); diff --git a/codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring/tsconfig.json b/codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring/tsconfig.json new file mode 100644 index 00000000..c6203c5d --- /dev/null +++ b/codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/npm/esm-first-in-exports/.codemodrc.json b/codemods-legacy/npm/esm-first-in-exports/.codemodrc.json similarity index 100% rename from codemods/npm/esm-first-in-exports/.codemodrc.json rename to codemods-legacy/npm/esm-first-in-exports/.codemodrc.json diff --git a/codemods/npm/esm-first-in-exports/.gitignore b/codemods-legacy/npm/esm-first-in-exports/.gitignore similarity index 100% rename from codemods/npm/esm-first-in-exports/.gitignore rename to codemods-legacy/npm/esm-first-in-exports/.gitignore diff --git a/codemods/npm/esm-first-in-exports/LICENSE b/codemods-legacy/npm/esm-first-in-exports/LICENSE similarity index 100% rename from codemods/npm/esm-first-in-exports/LICENSE rename to codemods-legacy/npm/esm-first-in-exports/LICENSE diff --git a/codemods/npm/esm-first-in-exports/README.md b/codemods-legacy/npm/esm-first-in-exports/README.md similarity index 100% rename from codemods/npm/esm-first-in-exports/README.md rename to codemods-legacy/npm/esm-first-in-exports/README.md diff --git a/codemods-legacy/npm/esm-first-in-exports/package.json b/codemods-legacy/npm/esm-first-in-exports/package.json new file mode 100644 index 00000000..174cf49f --- /dev/null +++ b/codemods-legacy/npm/esm-first-in-exports/package.json @@ -0,0 +1,18 @@ +{ + "name": "@codemod/npm-esm-first-in-exports", + "license": "MIT", + "private": true, + "devDependencies": { + "@types/node": "20.9.0", + "typescript": "^5.2.2", + "vitest": "^1.0.1", + "@codemod.com/workflow": "0.0.31" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "arybitskiy" +} diff --git a/codemods/npm/esm-first-in-exports/src/index.ts b/codemods-legacy/npm/esm-first-in-exports/src/index.ts similarity index 100% rename from codemods/npm/esm-first-in-exports/src/index.ts rename to codemods-legacy/npm/esm-first-in-exports/src/index.ts diff --git a/codemods-legacy/npm/esm-first-in-exports/tsconfig.json b/codemods-legacy/npm/esm-first-in-exports/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/npm/esm-first-in-exports/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/nuxt/4/absolute-watch-path/.codemodrc.json b/codemods-legacy/nuxt/4/absolute-watch-path/.codemodrc.json similarity index 100% rename from codemods/nuxt/4/absolute-watch-path/.codemodrc.json rename to codemods-legacy/nuxt/4/absolute-watch-path/.codemodrc.json diff --git a/codemods/nuxt/4/absolute-watch-path/.gitignore b/codemods-legacy/nuxt/4/absolute-watch-path/.gitignore similarity index 100% rename from codemods/nuxt/4/absolute-watch-path/.gitignore rename to codemods-legacy/nuxt/4/absolute-watch-path/.gitignore diff --git a/codemods/nuxt/4/absolute-watch-path/LICENSE b/codemods-legacy/nuxt/4/absolute-watch-path/LICENSE similarity index 100% rename from codemods/nuxt/4/absolute-watch-path/LICENSE rename to codemods-legacy/nuxt/4/absolute-watch-path/LICENSE diff --git a/codemods/nuxt/4/absolute-watch-path/README.md b/codemods-legacy/nuxt/4/absolute-watch-path/README.md similarity index 100% rename from codemods/nuxt/4/absolute-watch-path/README.md rename to codemods-legacy/nuxt/4/absolute-watch-path/README.md diff --git a/codemods/nuxt/4/absolute-watch-path/__testfixtures__/fixture1.input.ts b/codemods-legacy/nuxt/4/absolute-watch-path/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/nuxt/4/absolute-watch-path/__testfixtures__/fixture1.input.ts rename to codemods-legacy/nuxt/4/absolute-watch-path/__testfixtures__/fixture1.input.ts diff --git a/codemods/nuxt/4/absolute-watch-path/__testfixtures__/fixture1.output.ts b/codemods-legacy/nuxt/4/absolute-watch-path/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/nuxt/4/absolute-watch-path/__testfixtures__/fixture1.output.ts rename to codemods-legacy/nuxt/4/absolute-watch-path/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/nuxt/4/absolute-watch-path/package.json b/codemods-legacy/nuxt/4/absolute-watch-path/package.json new file mode 100644 index 00000000..fdb9eb9a --- /dev/null +++ b/codemods-legacy/nuxt/4/absolute-watch-path/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/nuxt-4-absolute-watch-path", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/nuxt/4/absolute-watch-path/src/index.ts b/codemods-legacy/nuxt/4/absolute-watch-path/src/index.ts similarity index 100% rename from codemods/nuxt/4/absolute-watch-path/src/index.ts rename to codemods-legacy/nuxt/4/absolute-watch-path/src/index.ts diff --git a/codemods-legacy/nuxt/4/absolute-watch-path/tsconfig.json b/codemods-legacy/nuxt/4/absolute-watch-path/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/nuxt/4/absolute-watch-path/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/nuxt/4/default-data-error-value/.codemodrc.json b/codemods-legacy/nuxt/4/default-data-error-value/.codemodrc.json similarity index 100% rename from codemods/nuxt/4/default-data-error-value/.codemodrc.json rename to codemods-legacy/nuxt/4/default-data-error-value/.codemodrc.json diff --git a/codemods/nuxt/4/default-data-error-value/.gitignore b/codemods-legacy/nuxt/4/default-data-error-value/.gitignore similarity index 100% rename from codemods/nuxt/4/default-data-error-value/.gitignore rename to codemods-legacy/nuxt/4/default-data-error-value/.gitignore diff --git a/codemods/nuxt/4/default-data-error-value/LICENSE b/codemods-legacy/nuxt/4/default-data-error-value/LICENSE similarity index 100% rename from codemods/nuxt/4/default-data-error-value/LICENSE rename to codemods-legacy/nuxt/4/default-data-error-value/LICENSE diff --git a/codemods/nuxt/4/default-data-error-value/README.md b/codemods-legacy/nuxt/4/default-data-error-value/README.md similarity index 100% rename from codemods/nuxt/4/default-data-error-value/README.md rename to codemods-legacy/nuxt/4/default-data-error-value/README.md diff --git a/codemods/nuxt/4/default-data-error-value/__testfixtures__/fixture1.input.ts b/codemods-legacy/nuxt/4/default-data-error-value/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/nuxt/4/default-data-error-value/__testfixtures__/fixture1.input.ts rename to codemods-legacy/nuxt/4/default-data-error-value/__testfixtures__/fixture1.input.ts diff --git a/codemods/nuxt/4/default-data-error-value/__testfixtures__/fixture1.output.ts b/codemods-legacy/nuxt/4/default-data-error-value/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/nuxt/4/default-data-error-value/__testfixtures__/fixture1.output.ts rename to codemods-legacy/nuxt/4/default-data-error-value/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/nuxt/4/default-data-error-value/package.json b/codemods-legacy/nuxt/4/default-data-error-value/package.json new file mode 100644 index 00000000..25b132a9 --- /dev/null +++ b/codemods-legacy/nuxt/4/default-data-error-value/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/nuxt-4-default-data-error-value", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/nuxt/4/default-data-error-value/src/index.ts b/codemods-legacy/nuxt/4/default-data-error-value/src/index.ts similarity index 100% rename from codemods/nuxt/4/default-data-error-value/src/index.ts rename to codemods-legacy/nuxt/4/default-data-error-value/src/index.ts diff --git a/codemods-legacy/nuxt/4/default-data-error-value/tsconfig.json b/codemods-legacy/nuxt/4/default-data-error-value/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/nuxt/4/default-data-error-value/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/nuxt/4/deprecated-dedupe-value/.codemodrc.json b/codemods-legacy/nuxt/4/deprecated-dedupe-value/.codemodrc.json similarity index 100% rename from codemods/nuxt/4/deprecated-dedupe-value/.codemodrc.json rename to codemods-legacy/nuxt/4/deprecated-dedupe-value/.codemodrc.json diff --git a/codemods/nuxt/4/deprecated-dedupe-value/.gitignore b/codemods-legacy/nuxt/4/deprecated-dedupe-value/.gitignore similarity index 100% rename from codemods/nuxt/4/deprecated-dedupe-value/.gitignore rename to codemods-legacy/nuxt/4/deprecated-dedupe-value/.gitignore diff --git a/codemods/nuxt/4/deprecated-dedupe-value/LICENSE b/codemods-legacy/nuxt/4/deprecated-dedupe-value/LICENSE similarity index 100% rename from codemods/nuxt/4/deprecated-dedupe-value/LICENSE rename to codemods-legacy/nuxt/4/deprecated-dedupe-value/LICENSE diff --git a/codemods/nuxt/4/deprecated-dedupe-value/README.md b/codemods-legacy/nuxt/4/deprecated-dedupe-value/README.md similarity index 100% rename from codemods/nuxt/4/deprecated-dedupe-value/README.md rename to codemods-legacy/nuxt/4/deprecated-dedupe-value/README.md diff --git a/codemods/nuxt/4/deprecated-dedupe-value/__testfixtures__/fixture1.input.ts b/codemods-legacy/nuxt/4/deprecated-dedupe-value/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/nuxt/4/deprecated-dedupe-value/__testfixtures__/fixture1.input.ts rename to codemods-legacy/nuxt/4/deprecated-dedupe-value/__testfixtures__/fixture1.input.ts diff --git a/codemods/nuxt/4/deprecated-dedupe-value/__testfixtures__/fixture1.output.ts b/codemods-legacy/nuxt/4/deprecated-dedupe-value/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/nuxt/4/deprecated-dedupe-value/__testfixtures__/fixture1.output.ts rename to codemods-legacy/nuxt/4/deprecated-dedupe-value/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/nuxt/4/deprecated-dedupe-value/package.json b/codemods-legacy/nuxt/4/deprecated-dedupe-value/package.json new file mode 100644 index 00000000..93d3971b --- /dev/null +++ b/codemods-legacy/nuxt/4/deprecated-dedupe-value/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/nuxt-4-deprecated-dedupe-value", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/nuxt/4/deprecated-dedupe-value/src/index.ts b/codemods-legacy/nuxt/4/deprecated-dedupe-value/src/index.ts similarity index 100% rename from codemods/nuxt/4/deprecated-dedupe-value/src/index.ts rename to codemods-legacy/nuxt/4/deprecated-dedupe-value/src/index.ts diff --git a/codemods-legacy/nuxt/4/deprecated-dedupe-value/tsconfig.json b/codemods-legacy/nuxt/4/deprecated-dedupe-value/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/nuxt/4/deprecated-dedupe-value/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/nuxt/4/file-structure/.codemodrc.json b/codemods-legacy/nuxt/4/file-structure/.codemodrc.json similarity index 100% rename from codemods/nuxt/4/file-structure/.codemodrc.json rename to codemods-legacy/nuxt/4/file-structure/.codemodrc.json diff --git a/codemods/nuxt/4/file-structure/.gitignore b/codemods-legacy/nuxt/4/file-structure/.gitignore similarity index 100% rename from codemods/nuxt/4/file-structure/.gitignore rename to codemods-legacy/nuxt/4/file-structure/.gitignore diff --git a/codemods/nuxt/4/file-structure/LICENSE b/codemods-legacy/nuxt/4/file-structure/LICENSE similarity index 100% rename from codemods/nuxt/4/file-structure/LICENSE rename to codemods-legacy/nuxt/4/file-structure/LICENSE diff --git a/codemods/nuxt/4/file-structure/README.md b/codemods-legacy/nuxt/4/file-structure/README.md similarity index 100% rename from codemods/nuxt/4/file-structure/README.md rename to codemods-legacy/nuxt/4/file-structure/README.md diff --git a/codemods-legacy/nuxt/4/file-structure/package.json b/codemods-legacy/nuxt/4/file-structure/package.json new file mode 100644 index 00000000..8f7f60cf --- /dev/null +++ b/codemods-legacy/nuxt/4/file-structure/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod/nuxt-4-file-structure", + "private": true, + "license": "MIT", + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "^5.2.2", + "@codemod.com/workflow": "0.0.31" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/nuxt/4/file-structure/src/index.ts b/codemods-legacy/nuxt/4/file-structure/src/index.ts similarity index 100% rename from codemods/nuxt/4/file-structure/src/index.ts rename to codemods-legacy/nuxt/4/file-structure/src/index.ts diff --git a/codemods-legacy/nuxt/4/file-structure/tsconfig.json b/codemods-legacy/nuxt/4/file-structure/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/nuxt/4/file-structure/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/nuxt/4/migration-recipe/.codemodrc.json b/codemods-legacy/nuxt/4/migration-recipe/.codemodrc.json similarity index 100% rename from codemods/nuxt/4/migration-recipe/.codemodrc.json rename to codemods-legacy/nuxt/4/migration-recipe/.codemodrc.json diff --git a/codemods/nuxt/4/migration-recipe/README.md b/codemods-legacy/nuxt/4/migration-recipe/README.md similarity index 100% rename from codemods/nuxt/4/migration-recipe/README.md rename to codemods-legacy/nuxt/4/migration-recipe/README.md diff --git a/codemods/nuxt/4/migration-recipe/package.json b/codemods-legacy/nuxt/4/migration-recipe/package.json similarity index 100% rename from codemods/nuxt/4/migration-recipe/package.json rename to codemods-legacy/nuxt/4/migration-recipe/package.json diff --git a/codemods/nuxt/4/shallow-function-reactivity/.codemodrc.json b/codemods-legacy/nuxt/4/shallow-function-reactivity/.codemodrc.json similarity index 100% rename from codemods/nuxt/4/shallow-function-reactivity/.codemodrc.json rename to codemods-legacy/nuxt/4/shallow-function-reactivity/.codemodrc.json diff --git a/codemods/nuxt/4/shallow-function-reactivity/.gitignore b/codemods-legacy/nuxt/4/shallow-function-reactivity/.gitignore similarity index 100% rename from codemods/nuxt/4/shallow-function-reactivity/.gitignore rename to codemods-legacy/nuxt/4/shallow-function-reactivity/.gitignore diff --git a/codemods/nuxt/4/shallow-function-reactivity/LICENSE b/codemods-legacy/nuxt/4/shallow-function-reactivity/LICENSE similarity index 100% rename from codemods/nuxt/4/shallow-function-reactivity/LICENSE rename to codemods-legacy/nuxt/4/shallow-function-reactivity/LICENSE diff --git a/codemods/nuxt/4/shallow-function-reactivity/README.md b/codemods-legacy/nuxt/4/shallow-function-reactivity/README.md similarity index 100% rename from codemods/nuxt/4/shallow-function-reactivity/README.md rename to codemods-legacy/nuxt/4/shallow-function-reactivity/README.md diff --git a/codemods/nuxt/4/shallow-function-reactivity/__testfixtures__/fixture1.input.ts b/codemods-legacy/nuxt/4/shallow-function-reactivity/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/nuxt/4/shallow-function-reactivity/__testfixtures__/fixture1.input.ts rename to codemods-legacy/nuxt/4/shallow-function-reactivity/__testfixtures__/fixture1.input.ts diff --git a/codemods/nuxt/4/shallow-function-reactivity/__testfixtures__/fixture1.output.ts b/codemods-legacy/nuxt/4/shallow-function-reactivity/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/nuxt/4/shallow-function-reactivity/__testfixtures__/fixture1.output.ts rename to codemods-legacy/nuxt/4/shallow-function-reactivity/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/nuxt/4/shallow-function-reactivity/package.json b/codemods-legacy/nuxt/4/shallow-function-reactivity/package.json new file mode 100644 index 00000000..bf126b0a --- /dev/null +++ b/codemods-legacy/nuxt/4/shallow-function-reactivity/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/nuxt-4-shallow-data-reactivity", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/nuxt/4/shallow-function-reactivity/src/index.ts b/codemods-legacy/nuxt/4/shallow-function-reactivity/src/index.ts similarity index 100% rename from codemods/nuxt/4/shallow-function-reactivity/src/index.ts rename to codemods-legacy/nuxt/4/shallow-function-reactivity/src/index.ts diff --git a/codemods-legacy/nuxt/4/shallow-function-reactivity/tsconfig.json b/codemods-legacy/nuxt/4/shallow-function-reactivity/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/nuxt/4/shallow-function-reactivity/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/nuxt/4/template-compilation-changes/.codemodrc.json b/codemods-legacy/nuxt/4/template-compilation-changes/.codemodrc.json similarity index 100% rename from codemods/nuxt/4/template-compilation-changes/.codemodrc.json rename to codemods-legacy/nuxt/4/template-compilation-changes/.codemodrc.json diff --git a/codemods/nuxt/4/template-compilation-changes/.gitignore b/codemods-legacy/nuxt/4/template-compilation-changes/.gitignore similarity index 100% rename from codemods/nuxt/4/template-compilation-changes/.gitignore rename to codemods-legacy/nuxt/4/template-compilation-changes/.gitignore diff --git a/codemods/nuxt/4/template-compilation-changes/LICENSE b/codemods-legacy/nuxt/4/template-compilation-changes/LICENSE similarity index 100% rename from codemods/nuxt/4/template-compilation-changes/LICENSE rename to codemods-legacy/nuxt/4/template-compilation-changes/LICENSE diff --git a/codemods/nuxt/4/template-compilation-changes/README.md b/codemods-legacy/nuxt/4/template-compilation-changes/README.md similarity index 100% rename from codemods/nuxt/4/template-compilation-changes/README.md rename to codemods-legacy/nuxt/4/template-compilation-changes/README.md diff --git a/codemods/nuxt/4/template-compilation-changes/__testfixtures__/fixture1.input.ts b/codemods-legacy/nuxt/4/template-compilation-changes/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/nuxt/4/template-compilation-changes/__testfixtures__/fixture1.input.ts rename to codemods-legacy/nuxt/4/template-compilation-changes/__testfixtures__/fixture1.input.ts diff --git a/codemods/nuxt/4/template-compilation-changes/__testfixtures__/fixture1.output.ts b/codemods-legacy/nuxt/4/template-compilation-changes/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/nuxt/4/template-compilation-changes/__testfixtures__/fixture1.output.ts rename to codemods-legacy/nuxt/4/template-compilation-changes/__testfixtures__/fixture1.output.ts diff --git a/codemods/nuxt/4/template-compilation-changes/__testfixtures__/fixture2.input.ts b/codemods-legacy/nuxt/4/template-compilation-changes/__testfixtures__/fixture2.input.ts similarity index 100% rename from codemods/nuxt/4/template-compilation-changes/__testfixtures__/fixture2.input.ts rename to codemods-legacy/nuxt/4/template-compilation-changes/__testfixtures__/fixture2.input.ts diff --git a/codemods/nuxt/4/template-compilation-changes/__testfixtures__/fixture2.output.ts b/codemods-legacy/nuxt/4/template-compilation-changes/__testfixtures__/fixture2.output.ts similarity index 100% rename from codemods/nuxt/4/template-compilation-changes/__testfixtures__/fixture2.output.ts rename to codemods-legacy/nuxt/4/template-compilation-changes/__testfixtures__/fixture2.output.ts diff --git a/codemods-legacy/nuxt/4/template-compilation-changes/package.json b/codemods-legacy/nuxt/4/template-compilation-changes/package.json new file mode 100644 index 00000000..064b38a5 --- /dev/null +++ b/codemods-legacy/nuxt/4/template-compilation-changes/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/nuxt-4-template-compilation-changes", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/nuxt/4/template-compilation-changes/src/index.ts b/codemods-legacy/nuxt/4/template-compilation-changes/src/index.ts similarity index 100% rename from codemods/nuxt/4/template-compilation-changes/src/index.ts rename to codemods-legacy/nuxt/4/template-compilation-changes/src/index.ts diff --git a/codemods-legacy/nuxt/4/template-compilation-changes/tsconfig.json b/codemods-legacy/nuxt/4/template-compilation-changes/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/nuxt/4/template-compilation-changes/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/openFeature/replace-feature-flags/.codemodrc.json b/codemods-legacy/openFeature/replace-feature-flags/.codemodrc.json similarity index 100% rename from codemods/openFeature/replace-feature-flags/.codemodrc.json rename to codemods-legacy/openFeature/replace-feature-flags/.codemodrc.json diff --git a/codemods/openFeature/replace-feature-flags/.gitignore b/codemods-legacy/openFeature/replace-feature-flags/.gitignore similarity index 100% rename from codemods/openFeature/replace-feature-flags/.gitignore rename to codemods-legacy/openFeature/replace-feature-flags/.gitignore diff --git a/codemods/openFeature/replace-feature-flags/LICENSE b/codemods-legacy/openFeature/replace-feature-flags/LICENSE similarity index 100% rename from codemods/openFeature/replace-feature-flags/LICENSE rename to codemods-legacy/openFeature/replace-feature-flags/LICENSE diff --git a/codemods/openFeature/replace-feature-flags/README.md b/codemods-legacy/openFeature/replace-feature-flags/README.md similarity index 100% rename from codemods/openFeature/replace-feature-flags/README.md rename to codemods-legacy/openFeature/replace-feature-flags/README.md diff --git a/codemods/openFeature/replace-feature-flags/__testfixtures__/openFeature.input.js b/codemods-legacy/openFeature/replace-feature-flags/__testfixtures__/openFeature.input.js similarity index 100% rename from codemods/openFeature/replace-feature-flags/__testfixtures__/openFeature.input.js rename to codemods-legacy/openFeature/replace-feature-flags/__testfixtures__/openFeature.input.js diff --git a/codemods/openFeature/replace-feature-flags/__testfixtures__/openFeature.output.js b/codemods-legacy/openFeature/replace-feature-flags/__testfixtures__/openFeature.output.js similarity index 100% rename from codemods/openFeature/replace-feature-flags/__testfixtures__/openFeature.output.js rename to codemods-legacy/openFeature/replace-feature-flags/__testfixtures__/openFeature.output.js diff --git a/codemods-legacy/openFeature/replace-feature-flags/package.json b/codemods-legacy/openFeature/replace-feature-flags/package.json new file mode 100644 index 00000000..642e001d --- /dev/null +++ b/codemods-legacy/openFeature/replace-feature-flags/package.json @@ -0,0 +1,23 @@ +{ + "name": "openFeature/replace-feature-flag", + "author": "dmytrohryshyn", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "5.2.2", + "vitest": "^1.0.1", + "ts-morph": "^22.0.0" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "license": "MIT", + "files": [ + "README.md", + ".codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/openFeature/replace-feature-flags/src/index.ts b/codemods-legacy/openFeature/replace-feature-flags/src/index.ts similarity index 100% rename from codemods/openFeature/replace-feature-flags/src/index.ts rename to codemods-legacy/openFeature/replace-feature-flags/src/index.ts diff --git a/codemods/openFeature/replace-feature-flags/test/test.ts b/codemods-legacy/openFeature/replace-feature-flags/test/test.ts similarity index 100% rename from codemods/openFeature/replace-feature-flags/test/test.ts rename to codemods-legacy/openFeature/replace-feature-flags/test/test.ts diff --git a/codemods-legacy/openFeature/replace-feature-flags/tsconfig.json b/codemods-legacy/openFeature/replace-feature-flags/tsconfig.json new file mode 100644 index 00000000..36bd1c7d --- /dev/null +++ b/codemods-legacy/openFeature/replace-feature-flags/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@codemod-com/tsconfig/codemod.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "./dist" + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/tanStack/codeSplitting/vitest.config.ts b/codemods-legacy/openFeature/replace-feature-flags/vitest.config.ts similarity index 100% rename from codemods/tanStack/codeSplitting/vitest.config.ts rename to codemods-legacy/openFeature/replace-feature-flags/vitest.config.ts diff --git a/codemods/pnpm/catalog/.codemodrc.json b/codemods-legacy/pnpm/catalog/.codemodrc.json similarity index 100% rename from codemods/pnpm/catalog/.codemodrc.json rename to codemods-legacy/pnpm/catalog/.codemodrc.json diff --git a/codemods/pnpm/catalog/.gitignore b/codemods-legacy/pnpm/catalog/.gitignore similarity index 100% rename from codemods/pnpm/catalog/.gitignore rename to codemods-legacy/pnpm/catalog/.gitignore diff --git a/codemods/pnpm/catalog/LICENSE b/codemods-legacy/pnpm/catalog/LICENSE similarity index 100% rename from codemods/pnpm/catalog/LICENSE rename to codemods-legacy/pnpm/catalog/LICENSE diff --git a/codemods/pnpm/catalog/README.md b/codemods-legacy/pnpm/catalog/README.md similarity index 100% rename from codemods/pnpm/catalog/README.md rename to codemods-legacy/pnpm/catalog/README.md diff --git a/codemods-legacy/pnpm/catalog/package.json b/codemods-legacy/pnpm/catalog/package.json new file mode 100644 index 00000000..2379d12b --- /dev/null +++ b/codemods-legacy/pnpm/catalog/package.json @@ -0,0 +1,18 @@ +{ + "name": "@codemod.com/pnpm-catalog", + "license": "MIT", + "private": true, + "devDependencies": { + "@types/node": "20.9.0", + "typescript": "^5.2.2", + "@codemod.com/workflow": "0.0.31", + "semver": "^7.6.2", + "@types/semver": "^7.5.8" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/pnpm/catalog/src/index.ts b/codemods-legacy/pnpm/catalog/src/index.ts similarity index 100% rename from codemods/pnpm/catalog/src/index.ts rename to codemods-legacy/pnpm/catalog/src/index.ts diff --git a/codemods-legacy/pnpm/catalog/tsconfig.json b/codemods-legacy/pnpm/catalog/tsconfig.json new file mode 100644 index 00000000..36bd1c7d --- /dev/null +++ b/codemods-legacy/pnpm/catalog/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@codemod-com/tsconfig/codemod.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "./dist" + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/prisma/5/json-protocol/.codemodrc.json b/codemods-legacy/prisma/5/json-protocol/.codemodrc.json similarity index 100% rename from codemods/prisma/5/json-protocol/.codemodrc.json rename to codemods-legacy/prisma/5/json-protocol/.codemodrc.json diff --git a/codemods/prisma/5/json-protocol/README.md b/codemods-legacy/prisma/5/json-protocol/README.md similarity index 100% rename from codemods/prisma/5/json-protocol/README.md rename to codemods-legacy/prisma/5/json-protocol/README.md diff --git a/codemods/prisma/5/json-protocol/__testfixtures__/fixture1.input.ts b/codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/prisma/5/json-protocol/__testfixtures__/fixture1.input.ts rename to codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture1.input.ts diff --git a/codemods/prisma/5/json-protocol/__testfixtures__/fixture1.output.ts b/codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/prisma/5/json-protocol/__testfixtures__/fixture1.output.ts rename to codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture1.output.ts diff --git a/codemods/prisma/5/json-protocol/__testfixtures__/fixture2.input.ts b/codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture2.input.ts similarity index 100% rename from codemods/prisma/5/json-protocol/__testfixtures__/fixture2.input.ts rename to codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture2.input.ts diff --git a/codemods/prisma/5/json-protocol/__testfixtures__/fixture2.output.ts b/codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture2.output.ts similarity index 100% rename from codemods/prisma/5/json-protocol/__testfixtures__/fixture2.output.ts rename to codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture2.output.ts diff --git a/codemods/prisma/5/json-protocol/__testfixtures__/fixture3.input.ts b/codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture3.input.ts similarity index 100% rename from codemods/prisma/5/json-protocol/__testfixtures__/fixture3.input.ts rename to codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture3.input.ts diff --git a/codemods/prisma/5/json-protocol/__testfixtures__/fixture3.output.ts b/codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture3.output.ts similarity index 100% rename from codemods/prisma/5/json-protocol/__testfixtures__/fixture3.output.ts rename to codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture3.output.ts diff --git a/codemods/prisma/5/json-protocol/__testfixtures__/fixture4.input.ts b/codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture4.input.ts similarity index 100% rename from codemods/prisma/5/json-protocol/__testfixtures__/fixture4.input.ts rename to codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture4.input.ts diff --git a/codemods/prisma/5/json-protocol/__testfixtures__/fixture4.output.ts b/codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture4.output.ts similarity index 100% rename from codemods/prisma/5/json-protocol/__testfixtures__/fixture4.output.ts rename to codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture4.output.ts diff --git a/codemods/prisma/5/json-protocol/__testfixtures__/fixture5.input.ts b/codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture5.input.ts similarity index 100% rename from codemods/prisma/5/json-protocol/__testfixtures__/fixture5.input.ts rename to codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture5.input.ts diff --git a/codemods/prisma/5/json-protocol/__testfixtures__/fixture5.output.ts b/codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture5.output.ts similarity index 100% rename from codemods/prisma/5/json-protocol/__testfixtures__/fixture5.output.ts rename to codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture5.output.ts diff --git a/codemods/prisma/5/json-protocol/__testfixtures__/fixture6.input.ts b/codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture6.input.ts similarity index 100% rename from codemods/prisma/5/json-protocol/__testfixtures__/fixture6.input.ts rename to codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture6.input.ts diff --git a/codemods/prisma/5/json-protocol/__testfixtures__/fixture6.output.ts b/codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture6.output.ts similarity index 100% rename from codemods/prisma/5/json-protocol/__testfixtures__/fixture6.output.ts rename to codemods-legacy/prisma/5/json-protocol/__testfixtures__/fixture6.output.ts diff --git a/codemods-legacy/prisma/5/json-protocol/package.json b/codemods-legacy/prisma/5/json-protocol/package.json new file mode 100644 index 00000000..8532b216 --- /dev/null +++ b/codemods-legacy/prisma/5/json-protocol/package.json @@ -0,0 +1,29 @@ +{ + "name": "@codemod-com/codemod-prisma-json-protocol", + "devDependencies": { + "@codemod-com/filemod": "workspace:*", + "@codemod-com/utilities": "workspace:*", + "@loancrate/prisma-schema-parser": "^2.0.0", + "@types/jscodeshift": "^0.11.10", + "jscodeshift": "^0.15.1", + "memfs": "^4.6.0", + "typescript": "^5.2.2", + "valibot": "catalog:", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module", + "dependencies": { + "@mrleebo/prisma-ast": "^0.12.0" + } +} diff --git a/codemods/prisma/5/json-protocol/src/constants.ts b/codemods-legacy/prisma/5/json-protocol/src/constants.ts similarity index 100% rename from codemods/prisma/5/json-protocol/src/constants.ts rename to codemods-legacy/prisma/5/json-protocol/src/constants.ts diff --git a/codemods/prisma/5/json-protocol/src/index.ts b/codemods-legacy/prisma/5/json-protocol/src/index.ts similarity index 100% rename from codemods/prisma/5/json-protocol/src/index.ts rename to codemods-legacy/prisma/5/json-protocol/src/index.ts diff --git a/codemods/prisma/5/json-protocol/src/types.ts b/codemods-legacy/prisma/5/json-protocol/src/types.ts similarity index 100% rename from codemods/prisma/5/json-protocol/src/types.ts rename to codemods-legacy/prisma/5/json-protocol/src/types.ts diff --git a/codemods/prisma/5/json-protocol/test/test.ts b/codemods-legacy/prisma/5/json-protocol/test/test.ts similarity index 100% rename from codemods/prisma/5/json-protocol/test/test.ts rename to codemods-legacy/prisma/5/json-protocol/test/test.ts diff --git a/codemods/prisma/5/json-protocol/tsconfig.json b/codemods-legacy/prisma/5/json-protocol/tsconfig.json similarity index 100% rename from codemods/prisma/5/json-protocol/tsconfig.json rename to codemods-legacy/prisma/5/json-protocol/tsconfig.json diff --git a/codemods/three/r168/deactivate-to-disconnect/vitest.config.ts b/codemods-legacy/prisma/5/json-protocol/vitest.config.ts similarity index 100% rename from codemods/three/r168/deactivate-to-disconnect/vitest.config.ts rename to codemods-legacy/prisma/5/json-protocol/vitest.config.ts diff --git a/codemods/python/eliminate-async-io/.codemodrc.json b/codemods-legacy/python/eliminate-async-io/.codemodrc.json similarity index 100% rename from codemods/python/eliminate-async-io/.codemodrc.json rename to codemods-legacy/python/eliminate-async-io/.codemodrc.json diff --git a/codemods/python/eliminate-async-io/LICENSE b/codemods-legacy/python/eliminate-async-io/LICENSE similarity index 100% rename from codemods/python/eliminate-async-io/LICENSE rename to codemods-legacy/python/eliminate-async-io/LICENSE diff --git a/codemods/python/eliminate-async-io/README.md b/codemods-legacy/python/eliminate-async-io/README.md similarity index 100% rename from codemods/python/eliminate-async-io/README.md rename to codemods-legacy/python/eliminate-async-io/README.md diff --git a/codemods/python/eliminate-async-io/__testfixtures__/fixture1.input.py b/codemods-legacy/python/eliminate-async-io/__testfixtures__/fixture1.input.py similarity index 100% rename from codemods/python/eliminate-async-io/__testfixtures__/fixture1.input.py rename to codemods-legacy/python/eliminate-async-io/__testfixtures__/fixture1.input.py diff --git a/codemods/python/eliminate-async-io/__testfixtures__/fixture1.output.py b/codemods-legacy/python/eliminate-async-io/__testfixtures__/fixture1.output.py similarity index 100% rename from codemods/python/eliminate-async-io/__testfixtures__/fixture1.output.py rename to codemods-legacy/python/eliminate-async-io/__testfixtures__/fixture1.output.py diff --git a/codemods/python/eliminate-async-io/__testfixtures__/fixture2.input.py b/codemods-legacy/python/eliminate-async-io/__testfixtures__/fixture2.input.py similarity index 100% rename from codemods/python/eliminate-async-io/__testfixtures__/fixture2.input.py rename to codemods-legacy/python/eliminate-async-io/__testfixtures__/fixture2.input.py diff --git a/codemods/python/eliminate-async-io/__testfixtures__/fixture2.output.py b/codemods-legacy/python/eliminate-async-io/__testfixtures__/fixture2.output.py similarity index 100% rename from codemods/python/eliminate-async-io/__testfixtures__/fixture2.output.py rename to codemods-legacy/python/eliminate-async-io/__testfixtures__/fixture2.output.py diff --git a/codemods/python/eliminate-async-io/cdmd_dist/index.js b/codemods-legacy/python/eliminate-async-io/cdmd_dist/index.js similarity index 100% rename from codemods/python/eliminate-async-io/cdmd_dist/index.js rename to codemods-legacy/python/eliminate-async-io/cdmd_dist/index.js diff --git a/codemods/python/eliminate-async-io/src/rule.yaml b/codemods-legacy/python/eliminate-async-io/src/rule.yaml similarity index 100% rename from codemods/python/eliminate-async-io/src/rule.yaml rename to codemods-legacy/python/eliminate-async-io/src/rule.yaml diff --git a/codemods/python/orjson/json.dumps/.codemodrc.json b/codemods-legacy/python/orjson/json.dumps/.codemodrc.json similarity index 100% rename from codemods/python/orjson/json.dumps/.codemodrc.json rename to codemods-legacy/python/orjson/json.dumps/.codemodrc.json diff --git a/codemods/python/orjson/json.dumps/LICENSE b/codemods-legacy/python/orjson/json.dumps/LICENSE similarity index 100% rename from codemods/python/orjson/json.dumps/LICENSE rename to codemods-legacy/python/orjson/json.dumps/LICENSE diff --git a/codemods/python/orjson/json.dumps/README.md b/codemods-legacy/python/orjson/json.dumps/README.md similarity index 100% rename from codemods/python/orjson/json.dumps/README.md rename to codemods-legacy/python/orjson/json.dumps/README.md diff --git a/codemods/python/orjson/json.dumps/__testfixtures__/fixture1.input.py b/codemods-legacy/python/orjson/json.dumps/__testfixtures__/fixture1.input.py similarity index 100% rename from codemods/python/orjson/json.dumps/__testfixtures__/fixture1.input.py rename to codemods-legacy/python/orjson/json.dumps/__testfixtures__/fixture1.input.py diff --git a/codemods/python/orjson/json.dumps/__testfixtures__/fixture1.output.py b/codemods-legacy/python/orjson/json.dumps/__testfixtures__/fixture1.output.py similarity index 100% rename from codemods/python/orjson/json.dumps/__testfixtures__/fixture1.output.py rename to codemods-legacy/python/orjson/json.dumps/__testfixtures__/fixture1.output.py diff --git a/codemods/python/orjson/json.dumps/src/rule.yaml b/codemods-legacy/python/orjson/json.dumps/src/rule.yaml similarity index 100% rename from codemods/python/orjson/json.dumps/src/rule.yaml rename to codemods-legacy/python/orjson/json.dumps/src/rule.yaml diff --git a/codemods/python/orjson/json.load/.codemodrc.json b/codemods-legacy/python/orjson/json.load/.codemodrc.json similarity index 100% rename from codemods/python/orjson/json.load/.codemodrc.json rename to codemods-legacy/python/orjson/json.load/.codemodrc.json diff --git a/codemods/python/orjson/json.load/LICENSE b/codemods-legacy/python/orjson/json.load/LICENSE similarity index 100% rename from codemods/python/orjson/json.load/LICENSE rename to codemods-legacy/python/orjson/json.load/LICENSE diff --git a/codemods/python/orjson/json.load/README.md b/codemods-legacy/python/orjson/json.load/README.md similarity index 100% rename from codemods/python/orjson/json.load/README.md rename to codemods-legacy/python/orjson/json.load/README.md diff --git a/codemods/python/orjson/json.load/__testfixtures__/fixture1.input.py b/codemods-legacy/python/orjson/json.load/__testfixtures__/fixture1.input.py similarity index 100% rename from codemods/python/orjson/json.load/__testfixtures__/fixture1.input.py rename to codemods-legacy/python/orjson/json.load/__testfixtures__/fixture1.input.py diff --git a/codemods/python/orjson/json.load/__testfixtures__/fixture1.output.py b/codemods-legacy/python/orjson/json.load/__testfixtures__/fixture1.output.py similarity index 100% rename from codemods/python/orjson/json.load/__testfixtures__/fixture1.output.py rename to codemods-legacy/python/orjson/json.load/__testfixtures__/fixture1.output.py diff --git a/codemods/python/orjson/json.load/src/rule.yaml b/codemods-legacy/python/orjson/json.load/src/rule.yaml similarity index 100% rename from codemods/python/orjson/json.load/src/rule.yaml rename to codemods-legacy/python/orjson/json.load/src/rule.yaml diff --git a/codemods/python/orjson/json.loads/.codemodrc.json b/codemods-legacy/python/orjson/json.loads/.codemodrc.json similarity index 100% rename from codemods/python/orjson/json.loads/.codemodrc.json rename to codemods-legacy/python/orjson/json.loads/.codemodrc.json diff --git a/codemods/python/orjson/json.loads/LICENSE b/codemods-legacy/python/orjson/json.loads/LICENSE similarity index 100% rename from codemods/python/orjson/json.loads/LICENSE rename to codemods-legacy/python/orjson/json.loads/LICENSE diff --git a/codemods/python/orjson/json.loads/README.md b/codemods-legacy/python/orjson/json.loads/README.md similarity index 100% rename from codemods/python/orjson/json.loads/README.md rename to codemods-legacy/python/orjson/json.loads/README.md diff --git a/codemods/python/orjson/json.loads/__testfixtures__/fixture1.input.py b/codemods-legacy/python/orjson/json.loads/__testfixtures__/fixture1.input.py similarity index 100% rename from codemods/python/orjson/json.loads/__testfixtures__/fixture1.input.py rename to codemods-legacy/python/orjson/json.loads/__testfixtures__/fixture1.input.py diff --git a/codemods/python/orjson/json.loads/__testfixtures__/fixture1.output.py b/codemods-legacy/python/orjson/json.loads/__testfixtures__/fixture1.output.py similarity index 100% rename from codemods/python/orjson/json.loads/__testfixtures__/fixture1.output.py rename to codemods-legacy/python/orjson/json.loads/__testfixtures__/fixture1.output.py diff --git a/codemods/python/orjson/json.loads/src/rule.yaml b/codemods-legacy/python/orjson/json.loads/src/rule.yaml similarity index 100% rename from codemods/python/orjson/json.loads/src/rule.yaml rename to codemods-legacy/python/orjson/json.loads/src/rule.yaml diff --git a/codemods/python/orjson/orjson.dumps-add-UTC_Z/.codemodrc.json b/codemods-legacy/python/orjson/orjson.dumps-add-UTC_Z/.codemodrc.json similarity index 100% rename from codemods/python/orjson/orjson.dumps-add-UTC_Z/.codemodrc.json rename to codemods-legacy/python/orjson/orjson.dumps-add-UTC_Z/.codemodrc.json diff --git a/codemods/python/orjson/orjson.dumps-add-UTC_Z/LICENSE b/codemods-legacy/python/orjson/orjson.dumps-add-UTC_Z/LICENSE similarity index 100% rename from codemods/python/orjson/orjson.dumps-add-UTC_Z/LICENSE rename to codemods-legacy/python/orjson/orjson.dumps-add-UTC_Z/LICENSE diff --git a/codemods/python/orjson/orjson.dumps-add-UTC_Z/README.md b/codemods-legacy/python/orjson/orjson.dumps-add-UTC_Z/README.md similarity index 100% rename from codemods/python/orjson/orjson.dumps-add-UTC_Z/README.md rename to codemods-legacy/python/orjson/orjson.dumps-add-UTC_Z/README.md diff --git a/codemods/python/orjson/orjson.dumps-add-UTC_Z/__testfixtures__/fixture1.input.py b/codemods-legacy/python/orjson/orjson.dumps-add-UTC_Z/__testfixtures__/fixture1.input.py similarity index 100% rename from codemods/python/orjson/orjson.dumps-add-UTC_Z/__testfixtures__/fixture1.input.py rename to codemods-legacy/python/orjson/orjson.dumps-add-UTC_Z/__testfixtures__/fixture1.input.py diff --git a/codemods/python/orjson/orjson.dumps-add-UTC_Z/__testfixtures__/fixture1.output.py b/codemods-legacy/python/orjson/orjson.dumps-add-UTC_Z/__testfixtures__/fixture1.output.py similarity index 100% rename from codemods/python/orjson/orjson.dumps-add-UTC_Z/__testfixtures__/fixture1.output.py rename to codemods-legacy/python/orjson/orjson.dumps-add-UTC_Z/__testfixtures__/fixture1.output.py diff --git a/codemods/python/orjson/orjson.dumps-add-UTC_Z/src/rule.yaml b/codemods-legacy/python/orjson/orjson.dumps-add-UTC_Z/src/rule.yaml similarity index 100% rename from codemods/python/orjson/orjson.dumps-add-UTC_Z/src/rule.yaml rename to codemods-legacy/python/orjson/orjson.dumps-add-UTC_Z/src/rule.yaml diff --git a/codemods/python/orjson/recipe/.codemodrc.json b/codemods-legacy/python/orjson/recipe/.codemodrc.json similarity index 100% rename from codemods/python/orjson/recipe/.codemodrc.json rename to codemods-legacy/python/orjson/recipe/.codemodrc.json diff --git a/codemods/python/orjson/recipe/README.md b/codemods-legacy/python/orjson/recipe/README.md similarity index 100% rename from codemods/python/orjson/recipe/README.md rename to codemods-legacy/python/orjson/recipe/README.md diff --git a/codemods/python/orjson/recipe/package.json b/codemods-legacy/python/orjson/recipe/package.json similarity index 100% rename from codemods/python/orjson/recipe/package.json rename to codemods-legacy/python/orjson/recipe/package.json diff --git a/codemods/python/orjson/sentry-import-replacement/.codemodrc.json b/codemods-legacy/python/orjson/sentry-import-replacement/.codemodrc.json similarity index 100% rename from codemods/python/orjson/sentry-import-replacement/.codemodrc.json rename to codemods-legacy/python/orjson/sentry-import-replacement/.codemodrc.json diff --git a/codemods/python/orjson/sentry-import-replacement/LICENSE b/codemods-legacy/python/orjson/sentry-import-replacement/LICENSE similarity index 100% rename from codemods/python/orjson/sentry-import-replacement/LICENSE rename to codemods-legacy/python/orjson/sentry-import-replacement/LICENSE diff --git a/codemods/python/orjson/sentry-import-replacement/README.md b/codemods-legacy/python/orjson/sentry-import-replacement/README.md similarity index 100% rename from codemods/python/orjson/sentry-import-replacement/README.md rename to codemods-legacy/python/orjson/sentry-import-replacement/README.md diff --git a/codemods/python/orjson/sentry-import-replacement/__testfixtures__/fixture1.input.py b/codemods-legacy/python/orjson/sentry-import-replacement/__testfixtures__/fixture1.input.py similarity index 100% rename from codemods/python/orjson/sentry-import-replacement/__testfixtures__/fixture1.input.py rename to codemods-legacy/python/orjson/sentry-import-replacement/__testfixtures__/fixture1.input.py diff --git a/codemods/python/orjson/sentry-import-replacement/__testfixtures__/fixture1.output.py b/codemods-legacy/python/orjson/sentry-import-replacement/__testfixtures__/fixture1.output.py similarity index 100% rename from codemods/python/orjson/sentry-import-replacement/__testfixtures__/fixture1.output.py rename to codemods-legacy/python/orjson/sentry-import-replacement/__testfixtures__/fixture1.output.py diff --git a/codemods/python/orjson/sentry-import-replacement/src/rule.yaml b/codemods-legacy/python/orjson/sentry-import-replacement/src/rule.yaml similarity index 100% rename from codemods/python/orjson/sentry-import-replacement/src/rule.yaml rename to codemods-legacy/python/orjson/sentry-import-replacement/src/rule.yaml diff --git a/codemods/react-native/74/migrate-to-fire-interval-seconds/.codemodrc.json b/codemods-legacy/react-native/74/migrate-to-fire-interval-seconds/.codemodrc.json similarity index 100% rename from codemods/react-native/74/migrate-to-fire-interval-seconds/.codemodrc.json rename to codemods-legacy/react-native/74/migrate-to-fire-interval-seconds/.codemodrc.json diff --git a/codemods/react-native/74/migrate-to-fire-interval-seconds/LICENSE b/codemods-legacy/react-native/74/migrate-to-fire-interval-seconds/LICENSE similarity index 100% rename from codemods/react-native/74/migrate-to-fire-interval-seconds/LICENSE rename to codemods-legacy/react-native/74/migrate-to-fire-interval-seconds/LICENSE diff --git a/codemods/react-native/74/migrate-to-fire-interval-seconds/README.md b/codemods-legacy/react-native/74/migrate-to-fire-interval-seconds/README.md similarity index 100% rename from codemods/react-native/74/migrate-to-fire-interval-seconds/README.md rename to codemods-legacy/react-native/74/migrate-to-fire-interval-seconds/README.md diff --git a/codemods-legacy/react-native/74/migrate-to-fire-interval-seconds/package.json b/codemods-legacy/react-native/74/migrate-to-fire-interval-seconds/package.json new file mode 100644 index 00000000..607b37e0 --- /dev/null +++ b/codemods-legacy/react-native/74/migrate-to-fire-interval-seconds/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-react-native-74-migrate-to-fire-interval-seconds", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-native/74/migrate-to-fire-interval-seconds/src/index.ts b/codemods-legacy/react-native/74/migrate-to-fire-interval-seconds/src/index.ts similarity index 100% rename from codemods/react-native/74/migrate-to-fire-interval-seconds/src/index.ts rename to codemods-legacy/react-native/74/migrate-to-fire-interval-seconds/src/index.ts diff --git a/codemods/react-native/74/migrate-to-fire-interval-seconds/test/test.ts b/codemods-legacy/react-native/74/migrate-to-fire-interval-seconds/test/test.ts similarity index 100% rename from codemods/react-native/74/migrate-to-fire-interval-seconds/test/test.ts rename to codemods-legacy/react-native/74/migrate-to-fire-interval-seconds/test/test.ts diff --git a/codemods/react-native/74/migrate-to-fire-interval-seconds/tsconfig.json b/codemods-legacy/react-native/74/migrate-to-fire-interval-seconds/tsconfig.json similarity index 100% rename from codemods/react-native/74/migrate-to-fire-interval-seconds/tsconfig.json rename to codemods-legacy/react-native/74/migrate-to-fire-interval-seconds/tsconfig.json diff --git a/codemods/three/r168/drag-controls-to-connect/vitest.config.ts b/codemods-legacy/react-native/74/migrate-to-fire-interval-seconds/vitest.config.ts similarity index 100% rename from codemods/three/r168/drag-controls-to-connect/vitest.config.ts rename to codemods-legacy/react-native/74/migrate-to-fire-interval-seconds/vitest.config.ts diff --git a/codemods/react-native/74/remove-alert-action/.codemodrc.json b/codemods-legacy/react-native/74/remove-alert-action/.codemodrc.json similarity index 100% rename from codemods/react-native/74/remove-alert-action/.codemodrc.json rename to codemods-legacy/react-native/74/remove-alert-action/.codemodrc.json diff --git a/codemods/react-native/74/remove-alert-action/LICENSE b/codemods-legacy/react-native/74/remove-alert-action/LICENSE similarity index 100% rename from codemods/react-native/74/remove-alert-action/LICENSE rename to codemods-legacy/react-native/74/remove-alert-action/LICENSE diff --git a/codemods/react-native/74/remove-alert-action/README.md b/codemods-legacy/react-native/74/remove-alert-action/README.md similarity index 100% rename from codemods/react-native/74/remove-alert-action/README.md rename to codemods-legacy/react-native/74/remove-alert-action/README.md diff --git a/codemods-legacy/react-native/74/remove-alert-action/package.json b/codemods-legacy/react-native/74/remove-alert-action/package.json new file mode 100644 index 00000000..94d68b63 --- /dev/null +++ b/codemods-legacy/react-native/74/remove-alert-action/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-react-native-74-remove-alert-action", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-native/74/remove-alert-action/src/index.ts b/codemods-legacy/react-native/74/remove-alert-action/src/index.ts similarity index 100% rename from codemods/react-native/74/remove-alert-action/src/index.ts rename to codemods-legacy/react-native/74/remove-alert-action/src/index.ts diff --git a/codemods/react-native/74/remove-alert-action/test/test.ts b/codemods-legacy/react-native/74/remove-alert-action/test/test.ts similarity index 100% rename from codemods/react-native/74/remove-alert-action/test/test.ts rename to codemods-legacy/react-native/74/remove-alert-action/test/test.ts diff --git a/codemods/react-native/74/remove-alert-action/tsconfig.json b/codemods-legacy/react-native/74/remove-alert-action/tsconfig.json similarity index 100% rename from codemods/react-native/74/remove-alert-action/tsconfig.json rename to codemods-legacy/react-native/74/remove-alert-action/tsconfig.json diff --git a/codemods/three/r168/pointer-lock-controls-to-controls-object/vitest.config.ts b/codemods-legacy/react-native/74/remove-alert-action/vitest.config.ts similarity index 100% rename from codemods/three/r168/pointer-lock-controls-to-controls-object/vitest.config.ts rename to codemods-legacy/react-native/74/remove-alert-action/vitest.config.ts diff --git a/codemods/react-native/74/remove-event-listener-callback/.codemodrc.json b/codemods-legacy/react-native/74/remove-event-listener-callback/.codemodrc.json similarity index 100% rename from codemods/react-native/74/remove-event-listener-callback/.codemodrc.json rename to codemods-legacy/react-native/74/remove-event-listener-callback/.codemodrc.json diff --git a/codemods/react-native/74/remove-event-listener-callback/LICENSE b/codemods-legacy/react-native/74/remove-event-listener-callback/LICENSE similarity index 100% rename from codemods/react-native/74/remove-event-listener-callback/LICENSE rename to codemods-legacy/react-native/74/remove-event-listener-callback/LICENSE diff --git a/codemods/react-native/74/remove-event-listener-callback/README.md b/codemods-legacy/react-native/74/remove-event-listener-callback/README.md similarity index 100% rename from codemods/react-native/74/remove-event-listener-callback/README.md rename to codemods-legacy/react-native/74/remove-event-listener-callback/README.md diff --git a/codemods-legacy/react-native/74/remove-event-listener-callback/package.json b/codemods-legacy/react-native/74/remove-event-listener-callback/package.json new file mode 100644 index 00000000..557e067e --- /dev/null +++ b/codemods-legacy/react-native/74/remove-event-listener-callback/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-react-native-74-remove-event-listener-callback", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-native/74/remove-event-listener-callback/src/index.ts b/codemods-legacy/react-native/74/remove-event-listener-callback/src/index.ts similarity index 100% rename from codemods/react-native/74/remove-event-listener-callback/src/index.ts rename to codemods-legacy/react-native/74/remove-event-listener-callback/src/index.ts diff --git a/codemods/react-native/74/remove-event-listener-callback/test/test.ts b/codemods-legacy/react-native/74/remove-event-listener-callback/test/test.ts similarity index 100% rename from codemods/react-native/74/remove-event-listener-callback/test/test.ts rename to codemods-legacy/react-native/74/remove-event-listener-callback/test/test.ts diff --git a/codemods/react-native/74/remove-event-listener-callback/tsconfig.json b/codemods-legacy/react-native/74/remove-event-listener-callback/tsconfig.json similarity index 100% rename from codemods/react-native/74/remove-event-listener-callback/tsconfig.json rename to codemods-legacy/react-native/74/remove-event-listener-callback/tsconfig.json diff --git a/codemods/three/r168/replace-dragcontrols-getraycaster/vitest.config.ts b/codemods-legacy/react-native/74/remove-event-listener-callback/vitest.config.ts similarity index 100% rename from codemods/three/r168/replace-dragcontrols-getraycaster/vitest.config.ts rename to codemods-legacy/react-native/74/remove-event-listener-callback/vitest.config.ts diff --git a/codemods/react-redux/0/add-state-type/.codemodrc.json b/codemods-legacy/react-redux/0/add-state-type/.codemodrc.json similarity index 100% rename from codemods/react-redux/0/add-state-type/.codemodrc.json rename to codemods-legacy/react-redux/0/add-state-type/.codemodrc.json diff --git a/codemods/react-redux/0/add-state-type/README.md b/codemods-legacy/react-redux/0/add-state-type/README.md similarity index 100% rename from codemods/react-redux/0/add-state-type/README.md rename to codemods-legacy/react-redux/0/add-state-type/README.md diff --git a/codemods-legacy/react-redux/0/add-state-type/package.json b/codemods-legacy/react-redux/0/add-state-type/package.json new file mode 100644 index 00000000..2f77725c --- /dev/null +++ b/codemods-legacy/react-redux/0/add-state-type/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-react-redux-0-add-state-type", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-redux/0/add-state-type/src/index.ts b/codemods-legacy/react-redux/0/add-state-type/src/index.ts similarity index 100% rename from codemods/react-redux/0/add-state-type/src/index.ts rename to codemods-legacy/react-redux/0/add-state-type/src/index.ts diff --git a/codemods-legacy/react-redux/0/add-state-type/test/test.ts b/codemods-legacy/react-redux/0/add-state-type/test/test.ts new file mode 100644 index 00000000..273981f5 --- /dev/null +++ b/codemods-legacy/react-redux/0/add-state-type/test/test.ts @@ -0,0 +1,344 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; +import { buildApi } from "@codemod-com/utilities"; +import type { FileInfo } from "jscodeshift"; +import transform from "../src/index.ts"; + + +describe("react-redux-8 add-state-type", () => { + it("should add the State type for state parameter of the mapStateToProps arrow function", () => { + const INPUT = ` + const mapStateToProps = (state) => ({ + a: selectA(state), + }); + `; + + const OUTPUT = ` + import { State } from "state"; + + const mapStateToProps = (state: State) => ({ + a: selectA(state), + }); + `; + + const fileInfo: FileInfo = { + path: "index.js", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx"), {}); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); + + it("should add the State type for state destructured parameter of the mapStateToProps arrow function", () => { + const INPUT = ` + const mapStateToProps = ({ a }) => ({ + a, + }); + `; + + const OUTPUT = ` + import { State } from "state"; + + const mapStateToProps = ({ a }: State) => ({ + a, + }); + `; + + const fileInfo: FileInfo = { + path: "index.js", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx"), {}); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); + + it("should add the State type for state parameter of the mapStateToProps function", () => { + const INPUT = ` + function mapStateToProps (a) { + return { + a + } + } + `; + + const OUTPUT = ` + import { State } from "state"; + + function mapStateToProps (a: State) { + return { + a + } + } + `; + + const fileInfo: FileInfo = { + path: "index.js", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx"), {}); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); + + it("should add the State type for state destructured parameter of the mapStateToProps function", () => { + const INPUT = ` + function mapStateToProps ({ a }) { + return { + a + } + } + `; + + const OUTPUT = ` + import { State } from "state"; + + function mapStateToProps ({ a }: State) { + return { + a + } + } + `; + + const fileInfo: FileInfo = { + path: "index.js", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx"), {}); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); + + it("should add the State type for state parameter of the mapDispatchToProps arrow function", () => { + const INPUT = ` + const mapDispatchToProps = (dispatch) => ({ + onA: (a) => dispatch(a), + }); + `; + + const OUTPUT = ` + import { ThunkDispatch } from "redux-thunk"; + import { State } from "state"; + + const mapDispatchToProps = (dispatch: ThunkDispatch) => ({ + onA: (a) => dispatch(a), + }); + `; + + const fileInfo: FileInfo = { + path: "index.js", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx"), {}); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); + + it("should add the State type for state parameter of the mapDispatchToProps arrow function", () => { + const INPUT = ` + function mapDispatchToProps (dispatch) { + return { + onA: (a) => dispatch(a), + } + }; + `; + + const OUTPUT = ` + import { ThunkDispatch } from "redux-thunk"; + import { State } from "state"; + + function mapDispatchToProps (dispatch: ThunkDispatch) { + return { + onA: (a) => dispatch(a), + } + }; + `; + + const fileInfo: FileInfo = { + path: "index.js", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx"), {}); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); + + it("should add the State type for state parameter of the mapStateToProps and the mapDispatchToProps arrow function", () => { + const INPUT = ` + function mapStateToProps (state) { + return { + ...state + } + } + + function mapDispatchToProps (dispatch) { + return { + onA: (a) => dispatch(a), + } + }; + `; + + const OUTPUT = ` + import { ThunkDispatch } from "redux-thunk"; + import { State } from "state"; + + function mapStateToProps (state: State) { + return { + ...state + } + } + + function mapDispatchToProps (dispatch: ThunkDispatch) { + return { + onA: (a) => dispatch(a), + } + }; + `; + + const fileInfo: FileInfo = { + path: "index.js", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx"), {}); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); + + it("should add the State type for state parameter of the mapStateToProps and the mapDispatchToProps function", () => { + const INPUT = ` + const mapStateToProps = (state) => { + return { + ...state + } + } + + const mapDispatchToProps = (dispatch) => { + return { + onA: (a) => dispatch(a), + } + }; + `; + + const OUTPUT = ` + import { ThunkDispatch } from "redux-thunk"; + import { State } from "state"; + + const mapStateToProps = (state: State) => { + return { + ...state + } + } + + const mapDispatchToProps = (dispatch: ThunkDispatch) => { + return { + onA: (a) => dispatch(a), + } + }; + `; + + const fileInfo: FileInfo = { + path: "index.js", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx"), {}); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); + + it("should add the State type for state parameter of the select function", () => { + const INPUT = ` + function selectX (state) { + return { + ...state + } + } + `; + + const OUTPUT = ` + import { State } from "state"; + + function selectX (state: State) { + return { + ...state + } + } + `; + + const fileInfo: FileInfo = { + path: "index.js", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx"), {}); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); + + it("should add the State type for state parameter of the select function", () => { + const INPUT = ` + const selectX = (state) => { + return { + ...state + } + } + `; + + const OUTPUT = ` + import { State } from "state"; + + const selectX = (state: State) => { + return { + ...state + } + } + `; + + const fileInfo: FileInfo = { + path: "index.js", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx"), {}); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); +}); diff --git a/codemods/react-redux/0/add-state-type/tsconfig.json b/codemods-legacy/react-redux/0/add-state-type/tsconfig.json similarity index 100% rename from codemods/react-redux/0/add-state-type/tsconfig.json rename to codemods-legacy/react-redux/0/add-state-type/tsconfig.json diff --git a/codemods/react-router/4/add-exact-prop/.codemodrc.json b/codemods-legacy/react-router/4/add-exact-prop/.codemodrc.json similarity index 100% rename from codemods/react-router/4/add-exact-prop/.codemodrc.json rename to codemods-legacy/react-router/4/add-exact-prop/.codemodrc.json diff --git a/codemods/react-router/4/add-exact-prop/LICENSE b/codemods-legacy/react-router/4/add-exact-prop/LICENSE similarity index 100% rename from codemods/react-router/4/add-exact-prop/LICENSE rename to codemods-legacy/react-router/4/add-exact-prop/LICENSE diff --git a/codemods/react-router/4/add-exact-prop/README.md b/codemods-legacy/react-router/4/add-exact-prop/README.md similarity index 100% rename from codemods/react-router/4/add-exact-prop/README.md rename to codemods-legacy/react-router/4/add-exact-prop/README.md diff --git a/codemods-legacy/react-router/4/add-exact-prop/package.json b/codemods-legacy/react-router/4/add-exact-prop/package.json new file mode 100644 index 00000000..9ca2d60f --- /dev/null +++ b/codemods-legacy/react-router/4/add-exact-prop/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-react-router-4-add-exact-prop", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/4/add-exact-prop/src/index.ts b/codemods-legacy/react-router/4/add-exact-prop/src/index.ts similarity index 100% rename from codemods/react-router/4/add-exact-prop/src/index.ts rename to codemods-legacy/react-router/4/add-exact-prop/src/index.ts diff --git a/codemods/react-router/4/add-exact-prop/test/test.ts b/codemods-legacy/react-router/4/add-exact-prop/test/test.ts similarity index 100% rename from codemods/react-router/4/add-exact-prop/test/test.ts rename to codemods-legacy/react-router/4/add-exact-prop/test/test.ts diff --git a/codemods/react-router/4/add-exact-prop/tsconfig.json b/codemods-legacy/react-router/4/add-exact-prop/tsconfig.json similarity index 100% rename from codemods/react-router/4/add-exact-prop/tsconfig.json rename to codemods-legacy/react-router/4/add-exact-prop/tsconfig.json diff --git a/codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/vitest.config.ts b/codemods-legacy/react-router/4/add-exact-prop/vitest.config.ts similarity index 100% rename from codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/vitest.config.ts rename to codemods-legacy/react-router/4/add-exact-prop/vitest.config.ts diff --git a/codemods/react-router/4/browser-router/.codemodrc.json b/codemods-legacy/react-router/4/browser-router/.codemodrc.json similarity index 100% rename from codemods/react-router/4/browser-router/.codemodrc.json rename to codemods-legacy/react-router/4/browser-router/.codemodrc.json diff --git a/codemods/react-router/4/browser-router/README.md b/codemods-legacy/react-router/4/browser-router/README.md similarity index 100% rename from codemods/react-router/4/browser-router/README.md rename to codemods-legacy/react-router/4/browser-router/README.md diff --git a/codemods-legacy/react-router/4/browser-router/package.json b/codemods-legacy/react-router/4/browser-router/package.json new file mode 100644 index 00000000..138f3a4f --- /dev/null +++ b/codemods-legacy/react-router/4/browser-router/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-react-router-4-browser-router", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/4/browser-router/src/index.ts b/codemods-legacy/react-router/4/browser-router/src/index.ts similarity index 100% rename from codemods/react-router/4/browser-router/src/index.ts rename to codemods-legacy/react-router/4/browser-router/src/index.ts diff --git a/codemods/react-router/4/browser-router/test/test.ts b/codemods-legacy/react-router/4/browser-router/test/test.ts similarity index 100% rename from codemods/react-router/4/browser-router/test/test.ts rename to codemods-legacy/react-router/4/browser-router/test/test.ts diff --git a/codemods/react-router/4/browser-router/tsconfig.json b/codemods-legacy/react-router/4/browser-router/tsconfig.json similarity index 100% rename from codemods/react-router/4/browser-router/tsconfig.json rename to codemods-legacy/react-router/4/browser-router/tsconfig.json diff --git a/codemods/three/r168/replace-viewport-top-left-with-viewport-uv/vitest.config.ts b/codemods-legacy/react-router/4/browser-router/vitest.config.ts similarity index 100% rename from codemods/three/r168/replace-viewport-top-left-with-viewport-uv/vitest.config.ts rename to codemods-legacy/react-router/4/browser-router/vitest.config.ts diff --git a/codemods/react-router/4/create-hash-history/.codemodrc.json b/codemods-legacy/react-router/4/create-hash-history/.codemodrc.json similarity index 100% rename from codemods/react-router/4/create-hash-history/.codemodrc.json rename to codemods-legacy/react-router/4/create-hash-history/.codemodrc.json diff --git a/codemods/react-router/4/create-hash-history/LICENSE b/codemods-legacy/react-router/4/create-hash-history/LICENSE similarity index 100% rename from codemods/react-router/4/create-hash-history/LICENSE rename to codemods-legacy/react-router/4/create-hash-history/LICENSE diff --git a/codemods/react-router/4/create-hash-history/README.md b/codemods-legacy/react-router/4/create-hash-history/README.md similarity index 100% rename from codemods/react-router/4/create-hash-history/README.md rename to codemods-legacy/react-router/4/create-hash-history/README.md diff --git a/codemods-legacy/react-router/4/create-hash-history/package.json b/codemods-legacy/react-router/4/create-hash-history/package.json new file mode 100644 index 00000000..31d7cbb3 --- /dev/null +++ b/codemods-legacy/react-router/4/create-hash-history/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-react-router-4-create-hash-history", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/4/create-hash-history/src/index.ts b/codemods-legacy/react-router/4/create-hash-history/src/index.ts similarity index 100% rename from codemods/react-router/4/create-hash-history/src/index.ts rename to codemods-legacy/react-router/4/create-hash-history/src/index.ts diff --git a/codemods/react-router/4/create-hash-history/test/test.ts b/codemods-legacy/react-router/4/create-hash-history/test/test.ts similarity index 100% rename from codemods/react-router/4/create-hash-history/test/test.ts rename to codemods-legacy/react-router/4/create-hash-history/test/test.ts diff --git a/codemods/react-router/4/create-hash-history/tsconfig.json b/codemods-legacy/react-router/4/create-hash-history/tsconfig.json similarity index 100% rename from codemods/react-router/4/create-hash-history/tsconfig.json rename to codemods-legacy/react-router/4/create-hash-history/tsconfig.json diff --git a/codemods/three/r168/transform_logluvloader/vitest.config.ts b/codemods-legacy/react-router/4/create-hash-history/vitest.config.ts similarity index 100% rename from codemods/three/r168/transform_logluvloader/vitest.config.ts rename to codemods-legacy/react-router/4/create-hash-history/vitest.config.ts diff --git a/codemods/react-router/4/hash-router/.codemodrc.json b/codemods-legacy/react-router/4/hash-router/.codemodrc.json similarity index 100% rename from codemods/react-router/4/hash-router/.codemodrc.json rename to codemods-legacy/react-router/4/hash-router/.codemodrc.json diff --git a/codemods/react-router/4/hash-router/LICENSE b/codemods-legacy/react-router/4/hash-router/LICENSE similarity index 100% rename from codemods/react-router/4/hash-router/LICENSE rename to codemods-legacy/react-router/4/hash-router/LICENSE diff --git a/codemods/react-router/4/hash-router/README.md b/codemods-legacy/react-router/4/hash-router/README.md similarity index 100% rename from codemods/react-router/4/hash-router/README.md rename to codemods-legacy/react-router/4/hash-router/README.md diff --git a/codemods-legacy/react-router/4/hash-router/package.json b/codemods-legacy/react-router/4/hash-router/package.json new file mode 100644 index 00000000..73ae2f6f --- /dev/null +++ b/codemods-legacy/react-router/4/hash-router/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-react-router-4-hash-router", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/4/hash-router/src/index.ts b/codemods-legacy/react-router/4/hash-router/src/index.ts similarity index 100% rename from codemods/react-router/4/hash-router/src/index.ts rename to codemods-legacy/react-router/4/hash-router/src/index.ts diff --git a/codemods/react-router/4/hash-router/test/test.ts b/codemods-legacy/react-router/4/hash-router/test/test.ts similarity index 100% rename from codemods/react-router/4/hash-router/test/test.ts rename to codemods-legacy/react-router/4/hash-router/test/test.ts diff --git a/codemods/react-router/4/hash-router/tsconfig.json b/codemods-legacy/react-router/4/hash-router/tsconfig.json similarity index 100% rename from codemods/react-router/4/hash-router/tsconfig.json rename to codemods-legacy/react-router/4/hash-router/tsconfig.json diff --git a/codemods/three/r168/uniforms-to-uniformarray/vitest.config.ts b/codemods-legacy/react-router/4/hash-router/vitest.config.ts similarity index 100% rename from codemods/three/r168/uniforms-to-uniformarray/vitest.config.ts rename to codemods-legacy/react-router/4/hash-router/vitest.config.ts diff --git a/codemods/react-router/4/index-route/.codemodrc.json b/codemods-legacy/react-router/4/index-route/.codemodrc.json similarity index 100% rename from codemods/react-router/4/index-route/.codemodrc.json rename to codemods-legacy/react-router/4/index-route/.codemodrc.json diff --git a/codemods/react-router/4/index-route/LICENSE b/codemods-legacy/react-router/4/index-route/LICENSE similarity index 100% rename from codemods/react-router/4/index-route/LICENSE rename to codemods-legacy/react-router/4/index-route/LICENSE diff --git a/codemods/react-router/4/index-route/README.md b/codemods-legacy/react-router/4/index-route/README.md similarity index 100% rename from codemods/react-router/4/index-route/README.md rename to codemods-legacy/react-router/4/index-route/README.md diff --git a/codemods-legacy/react-router/4/index-route/package.json b/codemods-legacy/react-router/4/index-route/package.json new file mode 100644 index 00000000..e9573035 --- /dev/null +++ b/codemods-legacy/react-router/4/index-route/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-react-router-4-index-route", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/4/index-route/src/index.ts b/codemods-legacy/react-router/4/index-route/src/index.ts similarity index 100% rename from codemods/react-router/4/index-route/src/index.ts rename to codemods-legacy/react-router/4/index-route/src/index.ts diff --git a/codemods/react-router/4/index-route/test/test.ts b/codemods-legacy/react-router/4/index-route/test/test.ts similarity index 100% rename from codemods/react-router/4/index-route/test/test.ts rename to codemods-legacy/react-router/4/index-route/test/test.ts diff --git a/codemods/react-router/4/index-route/tsconfig.json b/codemods-legacy/react-router/4/index-route/tsconfig.json similarity index 100% rename from codemods/react-router/4/index-route/tsconfig.json rename to codemods-legacy/react-router/4/index-route/tsconfig.json diff --git a/codemods/vue/3/render-function-api/vitest.config.ts b/codemods-legacy/react-router/4/index-route/vitest.config.ts similarity index 100% rename from codemods/vue/3/render-function-api/vitest.config.ts rename to codemods-legacy/react-router/4/index-route/vitest.config.ts diff --git a/codemods/react-router/4/move-HOC-to-global-scope/.codemodrc.json b/codemods-legacy/react-router/4/move-HOC-to-global-scope/.codemodrc.json similarity index 100% rename from codemods/react-router/4/move-HOC-to-global-scope/.codemodrc.json rename to codemods-legacy/react-router/4/move-HOC-to-global-scope/.codemodrc.json diff --git a/codemods/react-router/4/move-HOC-to-global-scope/.gitignore b/codemods-legacy/react-router/4/move-HOC-to-global-scope/.gitignore similarity index 100% rename from codemods/react-router/4/move-HOC-to-global-scope/.gitignore rename to codemods-legacy/react-router/4/move-HOC-to-global-scope/.gitignore diff --git a/codemods/react-router/4/move-HOC-to-global-scope/LICENSE b/codemods-legacy/react-router/4/move-HOC-to-global-scope/LICENSE similarity index 100% rename from codemods/react-router/4/move-HOC-to-global-scope/LICENSE rename to codemods-legacy/react-router/4/move-HOC-to-global-scope/LICENSE diff --git a/codemods/react-router/4/move-HOC-to-global-scope/README.md b/codemods-legacy/react-router/4/move-HOC-to-global-scope/README.md similarity index 100% rename from codemods/react-router/4/move-HOC-to-global-scope/README.md rename to codemods-legacy/react-router/4/move-HOC-to-global-scope/README.md diff --git a/codemods/react-router/4/move-HOC-to-global-scope/__testfixtures__/fixture1.input.tsx b/codemods-legacy/react-router/4/move-HOC-to-global-scope/__testfixtures__/fixture1.input.tsx similarity index 100% rename from codemods/react-router/4/move-HOC-to-global-scope/__testfixtures__/fixture1.input.tsx rename to codemods-legacy/react-router/4/move-HOC-to-global-scope/__testfixtures__/fixture1.input.tsx diff --git a/codemods/react-router/4/move-HOC-to-global-scope/__testfixtures__/fixture1.output.tsx b/codemods-legacy/react-router/4/move-HOC-to-global-scope/__testfixtures__/fixture1.output.tsx similarity index 100% rename from codemods/react-router/4/move-HOC-to-global-scope/__testfixtures__/fixture1.output.tsx rename to codemods-legacy/react-router/4/move-HOC-to-global-scope/__testfixtures__/fixture1.output.tsx diff --git a/codemods/react-router/4/move-HOC-to-global-scope/package.json b/codemods-legacy/react-router/4/move-HOC-to-global-scope/package.json similarity index 100% rename from codemods/react-router/4/move-HOC-to-global-scope/package.json rename to codemods-legacy/react-router/4/move-HOC-to-global-scope/package.json diff --git a/codemods/react-router/4/move-HOC-to-global-scope/src/index.ts b/codemods-legacy/react-router/4/move-HOC-to-global-scope/src/index.ts similarity index 100% rename from codemods/react-router/4/move-HOC-to-global-scope/src/index.ts rename to codemods-legacy/react-router/4/move-HOC-to-global-scope/src/index.ts diff --git a/codemods/react-router/4/move-HOC-to-global-scope/test/test.ts b/codemods-legacy/react-router/4/move-HOC-to-global-scope/test/test.ts similarity index 100% rename from codemods/react-router/4/move-HOC-to-global-scope/test/test.ts rename to codemods-legacy/react-router/4/move-HOC-to-global-scope/test/test.ts diff --git a/codemods-legacy/react-router/4/move-HOC-to-global-scope/tsconfig.json b/codemods-legacy/react-router/4/move-HOC-to-global-scope/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/react-router/4/move-HOC-to-global-scope/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/webpack/v5/json-imports-to-default-imports/vitest.config.ts b/codemods-legacy/react-router/4/move-HOC-to-global-scope/vitest.config.ts similarity index 100% rename from codemods/webpack/v5/json-imports-to-default-imports/vitest.config.ts rename to codemods-legacy/react-router/4/move-HOC-to-global-scope/vitest.config.ts diff --git a/codemods/react-router/4/remove-with-props/.codemodrc.json b/codemods-legacy/react-router/4/remove-with-props/.codemodrc.json similarity index 100% rename from codemods/react-router/4/remove-with-props/.codemodrc.json rename to codemods-legacy/react-router/4/remove-with-props/.codemodrc.json diff --git a/codemods/react-router/4/remove-with-props/LICENSE b/codemods-legacy/react-router/4/remove-with-props/LICENSE similarity index 100% rename from codemods/react-router/4/remove-with-props/LICENSE rename to codemods-legacy/react-router/4/remove-with-props/LICENSE diff --git a/codemods/react-router/4/remove-with-props/README.md b/codemods-legacy/react-router/4/remove-with-props/README.md similarity index 100% rename from codemods/react-router/4/remove-with-props/README.md rename to codemods-legacy/react-router/4/remove-with-props/README.md diff --git a/codemods-legacy/react-router/4/remove-with-props/package.json b/codemods-legacy/react-router/4/remove-with-props/package.json new file mode 100644 index 00000000..fd660a97 --- /dev/null +++ b/codemods-legacy/react-router/4/remove-with-props/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-react-router-4-remove-with-props", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/4/remove-with-props/src/index.ts b/codemods-legacy/react-router/4/remove-with-props/src/index.ts similarity index 100% rename from codemods/react-router/4/remove-with-props/src/index.ts rename to codemods-legacy/react-router/4/remove-with-props/src/index.ts diff --git a/codemods/react-router/4/remove-with-props/test/test.ts b/codemods-legacy/react-router/4/remove-with-props/test/test.ts similarity index 100% rename from codemods/react-router/4/remove-with-props/test/test.ts rename to codemods-legacy/react-router/4/remove-with-props/test/test.ts diff --git a/codemods/react-router/4/remove-with-props/tsconfig.json b/codemods-legacy/react-router/4/remove-with-props/tsconfig.json similarity index 100% rename from codemods/react-router/4/remove-with-props/tsconfig.json rename to codemods-legacy/react-router/4/remove-with-props/tsconfig.json diff --git a/codemods/webpack/v5/migrate-library-target-to-library-object/vitest.config.ts b/codemods-legacy/react-router/4/remove-with-props/vitest.config.ts similarity index 100% rename from codemods/webpack/v5/migrate-library-target-to-library-object/vitest.config.ts rename to codemods-legacy/react-router/4/remove-with-props/vitest.config.ts diff --git a/codemods/react-router/4/rename-imports/.codemodrc.json b/codemods-legacy/react-router/4/rename-imports/.codemodrc.json similarity index 100% rename from codemods/react-router/4/rename-imports/.codemodrc.json rename to codemods-legacy/react-router/4/rename-imports/.codemodrc.json diff --git a/codemods/react-router/4/rename-imports/LICENSE b/codemods-legacy/react-router/4/rename-imports/LICENSE similarity index 100% rename from codemods/react-router/4/rename-imports/LICENSE rename to codemods-legacy/react-router/4/rename-imports/LICENSE diff --git a/codemods/react-router/4/rename-imports/README.md b/codemods-legacy/react-router/4/rename-imports/README.md similarity index 100% rename from codemods/react-router/4/rename-imports/README.md rename to codemods-legacy/react-router/4/rename-imports/README.md diff --git a/codemods-legacy/react-router/4/rename-imports/package.json b/codemods-legacy/react-router/4/rename-imports/package.json new file mode 100644 index 00000000..7f3eac0c --- /dev/null +++ b/codemods-legacy/react-router/4/rename-imports/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-react-router-4-rename-imports", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/4/rename-imports/src/index.ts b/codemods-legacy/react-router/4/rename-imports/src/index.ts similarity index 100% rename from codemods/react-router/4/rename-imports/src/index.ts rename to codemods-legacy/react-router/4/rename-imports/src/index.ts diff --git a/codemods/react-router/4/rename-imports/test/test.ts b/codemods-legacy/react-router/4/rename-imports/test/test.ts similarity index 100% rename from codemods/react-router/4/rename-imports/test/test.ts rename to codemods-legacy/react-router/4/rename-imports/test/test.ts diff --git a/codemods/react-router/4/rename-imports/tsconfig.json b/codemods-legacy/react-router/4/rename-imports/tsconfig.json similarity index 100% rename from codemods/react-router/4/rename-imports/tsconfig.json rename to codemods-legacy/react-router/4/rename-imports/tsconfig.json diff --git a/codemods/webpack/v5/set-target-to-false-and-update-plugins/vitest.config.ts b/codemods-legacy/react-router/4/rename-imports/vitest.config.ts similarity index 100% rename from codemods/webpack/v5/set-target-to-false-and-update-plugins/vitest.config.ts rename to codemods-legacy/react-router/4/rename-imports/vitest.config.ts diff --git a/codemods/react-router/4/replace-location-query/.codemodrc.json b/codemods-legacy/react-router/4/replace-location-query/.codemodrc.json similarity index 100% rename from codemods/react-router/4/replace-location-query/.codemodrc.json rename to codemods-legacy/react-router/4/replace-location-query/.codemodrc.json diff --git a/codemods/react-router/4/replace-location-query/README.md b/codemods-legacy/react-router/4/replace-location-query/README.md similarity index 100% rename from codemods/react-router/4/replace-location-query/README.md rename to codemods-legacy/react-router/4/replace-location-query/README.md diff --git a/codemods-legacy/react-router/4/replace-location-query/package.json b/codemods-legacy/react-router/4/replace-location-query/package.json new file mode 100644 index 00000000..a175943d --- /dev/null +++ b/codemods-legacy/react-router/4/replace-location-query/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-react-router-4-replace-location-query", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/4/replace-location-query/src/index.ts b/codemods-legacy/react-router/4/replace-location-query/src/index.ts similarity index 100% rename from codemods/react-router/4/replace-location-query/src/index.ts rename to codemods-legacy/react-router/4/replace-location-query/src/index.ts diff --git a/codemods/react-router/4/replace-location-query/test/test.ts b/codemods-legacy/react-router/4/replace-location-query/test/test.ts similarity index 100% rename from codemods/react-router/4/replace-location-query/test/test.ts rename to codemods-legacy/react-router/4/replace-location-query/test/test.ts diff --git a/codemods/react-router/4/replace-location-query/tsconfig.json b/codemods-legacy/react-router/4/replace-location-query/tsconfig.json similarity index 100% rename from codemods/react-router/4/replace-location-query/tsconfig.json rename to codemods-legacy/react-router/4/replace-location-query/tsconfig.json diff --git a/codemods-legacy/react-router/4/replace-location-query/vitest.config.ts b/codemods-legacy/react-router/4/replace-location-query/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react-router/4/replace-location-query/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/react-router/4/replace-nested-routes/.codemodrc.json b/codemods-legacy/react-router/4/replace-nested-routes/.codemodrc.json similarity index 100% rename from codemods/react-router/4/replace-nested-routes/.codemodrc.json rename to codemods-legacy/react-router/4/replace-nested-routes/.codemodrc.json diff --git a/codemods/react-router/4/replace-nested-routes/README.md b/codemods-legacy/react-router/4/replace-nested-routes/README.md similarity index 100% rename from codemods/react-router/4/replace-nested-routes/README.md rename to codemods-legacy/react-router/4/replace-nested-routes/README.md diff --git a/codemods-legacy/react-router/4/replace-nested-routes/package.json b/codemods-legacy/react-router/4/replace-nested-routes/package.json new file mode 100644 index 00000000..f8159d7a --- /dev/null +++ b/codemods-legacy/react-router/4/replace-nested-routes/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-react-router-4-replace-nested-routes", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/4/replace-nested-routes/src/index.ts b/codemods-legacy/react-router/4/replace-nested-routes/src/index.ts similarity index 100% rename from codemods/react-router/4/replace-nested-routes/src/index.ts rename to codemods-legacy/react-router/4/replace-nested-routes/src/index.ts diff --git a/codemods/react-router/4/replace-nested-routes/test/test.ts b/codemods-legacy/react-router/4/replace-nested-routes/test/test.ts similarity index 100% rename from codemods/react-router/4/replace-nested-routes/test/test.ts rename to codemods-legacy/react-router/4/replace-nested-routes/test/test.ts diff --git a/codemods/react-router/4/replace-nested-routes/tsconfig.json b/codemods-legacy/react-router/4/replace-nested-routes/tsconfig.json similarity index 100% rename from codemods/react-router/4/replace-nested-routes/tsconfig.json rename to codemods-legacy/react-router/4/replace-nested-routes/tsconfig.json diff --git a/codemods-legacy/react-router/4/replace-nested-routes/vitest.config.ts b/codemods-legacy/react-router/4/replace-nested-routes/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react-router/4/replace-nested-routes/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/react-router/4/replace-param-prop/.codemodrc.json b/codemods-legacy/react-router/4/replace-param-prop/.codemodrc.json similarity index 100% rename from codemods/react-router/4/replace-param-prop/.codemodrc.json rename to codemods-legacy/react-router/4/replace-param-prop/.codemodrc.json diff --git a/codemods/react-router/4/replace-param-prop/README.md b/codemods-legacy/react-router/4/replace-param-prop/README.md similarity index 100% rename from codemods/react-router/4/replace-param-prop/README.md rename to codemods-legacy/react-router/4/replace-param-prop/README.md diff --git a/codemods-legacy/react-router/4/replace-param-prop/package.json b/codemods-legacy/react-router/4/replace-param-prop/package.json new file mode 100644 index 00000000..1557f3a3 --- /dev/null +++ b/codemods-legacy/react-router/4/replace-param-prop/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-react-router-4-replace-param-prop", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/4/replace-param-prop/src/index.ts b/codemods-legacy/react-router/4/replace-param-prop/src/index.ts similarity index 100% rename from codemods/react-router/4/replace-param-prop/src/index.ts rename to codemods-legacy/react-router/4/replace-param-prop/src/index.ts diff --git a/codemods/react-router/4/replace-param-prop/test/test.ts b/codemods-legacy/react-router/4/replace-param-prop/test/test.ts similarity index 100% rename from codemods/react-router/4/replace-param-prop/test/test.ts rename to codemods-legacy/react-router/4/replace-param-prop/test/test.ts diff --git a/codemods/react-router/4/replace-param-prop/tsconfig.json b/codemods-legacy/react-router/4/replace-param-prop/tsconfig.json similarity index 100% rename from codemods/react-router/4/replace-param-prop/tsconfig.json rename to codemods-legacy/react-router/4/replace-param-prop/tsconfig.json diff --git a/codemods-legacy/react-router/4/replace-param-prop/vitest.config.ts b/codemods-legacy/react-router/4/replace-param-prop/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react-router/4/replace-param-prop/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/react-router/4/use-history-hook/.codemodrc.json b/codemods-legacy/react-router/4/use-history-hook/.codemodrc.json similarity index 100% rename from codemods/react-router/4/use-history-hook/.codemodrc.json rename to codemods-legacy/react-router/4/use-history-hook/.codemodrc.json diff --git a/codemods/react-router/4/use-history-hook/README.md b/codemods-legacy/react-router/4/use-history-hook/README.md similarity index 100% rename from codemods/react-router/4/use-history-hook/README.md rename to codemods-legacy/react-router/4/use-history-hook/README.md diff --git a/codemods-legacy/react-router/4/use-history-hook/package.json b/codemods-legacy/react-router/4/use-history-hook/package.json new file mode 100644 index 00000000..d3f60975 --- /dev/null +++ b/codemods-legacy/react-router/4/use-history-hook/package.json @@ -0,0 +1,24 @@ +{ + "name": "@codemod-com/codemod-react-router-4-use-history-hook", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "esbuild": "0.19.5", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "build:cjs": "cjs-builder ./src/index.ts", + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/4/use-history-hook/src/index.ts b/codemods-legacy/react-router/4/use-history-hook/src/index.ts similarity index 100% rename from codemods/react-router/4/use-history-hook/src/index.ts rename to codemods-legacy/react-router/4/use-history-hook/src/index.ts diff --git a/codemods/react-router/4/use-history-hook/test/test.ts b/codemods-legacy/react-router/4/use-history-hook/test/test.ts similarity index 100% rename from codemods/react-router/4/use-history-hook/test/test.ts rename to codemods-legacy/react-router/4/use-history-hook/test/test.ts diff --git a/codemods/react-router/4/use-history-hook/tsconfig.json b/codemods-legacy/react-router/4/use-history-hook/tsconfig.json similarity index 100% rename from codemods/react-router/4/use-history-hook/tsconfig.json rename to codemods-legacy/react-router/4/use-history-hook/tsconfig.json diff --git a/codemods-legacy/react-router/4/use-history-hook/vitest.config.ts b/codemods-legacy/react-router/4/use-history-hook/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react-router/4/use-history-hook/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/react-router/4/wrap-with-switch/.codemodrc.json b/codemods-legacy/react-router/4/wrap-with-switch/.codemodrc.json similarity index 100% rename from codemods/react-router/4/wrap-with-switch/.codemodrc.json rename to codemods-legacy/react-router/4/wrap-with-switch/.codemodrc.json diff --git a/codemods/react-router/4/wrap-with-switch/LICENSE b/codemods-legacy/react-router/4/wrap-with-switch/LICENSE similarity index 100% rename from codemods/react-router/4/wrap-with-switch/LICENSE rename to codemods-legacy/react-router/4/wrap-with-switch/LICENSE diff --git a/codemods/react-router/4/wrap-with-switch/README.md b/codemods-legacy/react-router/4/wrap-with-switch/README.md similarity index 100% rename from codemods/react-router/4/wrap-with-switch/README.md rename to codemods-legacy/react-router/4/wrap-with-switch/README.md diff --git a/codemods-legacy/react-router/4/wrap-with-switch/package.json b/codemods-legacy/react-router/4/wrap-with-switch/package.json new file mode 100644 index 00000000..15cc80f0 --- /dev/null +++ b/codemods-legacy/react-router/4/wrap-with-switch/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-react-router-4-wrap-with-switch", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/4/wrap-with-switch/src/index.ts b/codemods-legacy/react-router/4/wrap-with-switch/src/index.ts similarity index 100% rename from codemods/react-router/4/wrap-with-switch/src/index.ts rename to codemods-legacy/react-router/4/wrap-with-switch/src/index.ts diff --git a/codemods/react-router/4/wrap-with-switch/test/test.ts b/codemods-legacy/react-router/4/wrap-with-switch/test/test.ts similarity index 100% rename from codemods/react-router/4/wrap-with-switch/test/test.ts rename to codemods-legacy/react-router/4/wrap-with-switch/test/test.ts diff --git a/codemods/react-router/4/wrap-with-switch/tsconfig.json b/codemods-legacy/react-router/4/wrap-with-switch/tsconfig.json similarity index 100% rename from codemods/react-router/4/wrap-with-switch/tsconfig.json rename to codemods-legacy/react-router/4/wrap-with-switch/tsconfig.json diff --git a/codemods-legacy/react-router/4/wrap-with-switch/vitest.config.ts b/codemods-legacy/react-router/4/wrap-with-switch/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react-router/4/wrap-with-switch/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/react-router/6/compat-route/.codemodrc.json b/codemods-legacy/react-router/6/compat-route/.codemodrc.json similarity index 100% rename from codemods/react-router/6/compat-route/.codemodrc.json rename to codemods-legacy/react-router/6/compat-route/.codemodrc.json diff --git a/codemods/react-router/6/compat-route/README.md b/codemods-legacy/react-router/6/compat-route/README.md similarity index 100% rename from codemods/react-router/6/compat-route/README.md rename to codemods-legacy/react-router/6/compat-route/README.md diff --git a/codemods-legacy/react-router/6/compat-route/package.json b/codemods-legacy/react-router/6/compat-route/package.json new file mode 100644 index 00000000..d8cbdc6a --- /dev/null +++ b/codemods-legacy/react-router/6/compat-route/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-react-router-6-compat-route", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/6/compat-route/src/index.ts b/codemods-legacy/react-router/6/compat-route/src/index.ts similarity index 100% rename from codemods/react-router/6/compat-route/src/index.ts rename to codemods-legacy/react-router/6/compat-route/src/index.ts diff --git a/codemods/react-router/6/compat-route/tsconfig.json b/codemods-legacy/react-router/6/compat-route/tsconfig.json similarity index 100% rename from codemods/react-router/6/compat-route/tsconfig.json rename to codemods-legacy/react-router/6/compat-route/tsconfig.json diff --git a/codemods/react-router/6/compat-router/.codemodrc.json b/codemods-legacy/react-router/6/compat-router/.codemodrc.json similarity index 100% rename from codemods/react-router/6/compat-router/.codemodrc.json rename to codemods-legacy/react-router/6/compat-router/.codemodrc.json diff --git a/codemods/react-router/6/compat-router/README.md b/codemods-legacy/react-router/6/compat-router/README.md similarity index 100% rename from codemods/react-router/6/compat-router/README.md rename to codemods-legacy/react-router/6/compat-router/README.md diff --git a/codemods-legacy/react-router/6/compat-router/package.json b/codemods-legacy/react-router/6/compat-router/package.json new file mode 100644 index 00000000..89090911 --- /dev/null +++ b/codemods-legacy/react-router/6/compat-router/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-react-router-6-compat-router", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/6/compat-router/src/index.ts b/codemods-legacy/react-router/6/compat-router/src/index.ts similarity index 100% rename from codemods/react-router/6/compat-router/src/index.ts rename to codemods-legacy/react-router/6/compat-router/src/index.ts diff --git a/codemods/react-router/6/compat-router/tsconfig.json b/codemods-legacy/react-router/6/compat-router/tsconfig.json similarity index 100% rename from codemods/react-router/6/compat-router/tsconfig.json rename to codemods-legacy/react-router/6/compat-router/tsconfig.json diff --git a/codemods/react-router/6/link-to-props/.codemodrc.json b/codemods-legacy/react-router/6/link-to-props/.codemodrc.json similarity index 100% rename from codemods/react-router/6/link-to-props/.codemodrc.json rename to codemods-legacy/react-router/6/link-to-props/.codemodrc.json diff --git a/codemods/react-router/6/link-to-props/README.md b/codemods-legacy/react-router/6/link-to-props/README.md similarity index 100% rename from codemods/react-router/6/link-to-props/README.md rename to codemods-legacy/react-router/6/link-to-props/README.md diff --git a/codemods-legacy/react-router/6/link-to-props/package.json b/codemods-legacy/react-router/6/link-to-props/package.json new file mode 100644 index 00000000..b791c8e6 --- /dev/null +++ b/codemods-legacy/react-router/6/link-to-props/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-react-router-6-link-to-props", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/6/link-to-props/src/index.ts b/codemods-legacy/react-router/6/link-to-props/src/index.ts similarity index 100% rename from codemods/react-router/6/link-to-props/src/index.ts rename to codemods-legacy/react-router/6/link-to-props/src/index.ts diff --git a/codemods/react-router/6/link-to-props/tsconfig.json b/codemods-legacy/react-router/6/link-to-props/tsconfig.json similarity index 100% rename from codemods/react-router/6/link-to-props/tsconfig.json rename to codemods-legacy/react-router/6/link-to-props/tsconfig.json diff --git a/codemods/react-router/6/match-path-arguments/.codemodrc.json b/codemods-legacy/react-router/6/match-path-arguments/.codemodrc.json similarity index 100% rename from codemods/react-router/6/match-path-arguments/.codemodrc.json rename to codemods-legacy/react-router/6/match-path-arguments/.codemodrc.json diff --git a/codemods/react-router/6/match-path-arguments/README.md b/codemods-legacy/react-router/6/match-path-arguments/README.md similarity index 100% rename from codemods/react-router/6/match-path-arguments/README.md rename to codemods-legacy/react-router/6/match-path-arguments/README.md diff --git a/codemods-legacy/react-router/6/match-path-arguments/package.json b/codemods-legacy/react-router/6/match-path-arguments/package.json new file mode 100644 index 00000000..ebfa9fdd --- /dev/null +++ b/codemods-legacy/react-router/6/match-path-arguments/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-react-router-6-match-path-arguments", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/6/match-path-arguments/src/index.ts b/codemods-legacy/react-router/6/match-path-arguments/src/index.ts similarity index 100% rename from codemods/react-router/6/match-path-arguments/src/index.ts rename to codemods-legacy/react-router/6/match-path-arguments/src/index.ts diff --git a/codemods/react-router/6/match-path-arguments/tsconfig.json b/codemods-legacy/react-router/6/match-path-arguments/tsconfig.json similarity index 100% rename from codemods/react-router/6/match-path-arguments/tsconfig.json rename to codemods-legacy/react-router/6/match-path-arguments/tsconfig.json diff --git a/codemods/react-router/6/navlink-exact-end/.codemodrc.json b/codemods-legacy/react-router/6/navlink-exact-end/.codemodrc.json similarity index 100% rename from codemods/react-router/6/navlink-exact-end/.codemodrc.json rename to codemods-legacy/react-router/6/navlink-exact-end/.codemodrc.json diff --git a/codemods/react-router/6/navlink-exact-end/README.md b/codemods-legacy/react-router/6/navlink-exact-end/README.md similarity index 100% rename from codemods/react-router/6/navlink-exact-end/README.md rename to codemods-legacy/react-router/6/navlink-exact-end/README.md diff --git a/codemods-legacy/react-router/6/navlink-exact-end/package.json b/codemods-legacy/react-router/6/navlink-exact-end/package.json new file mode 100644 index 00000000..e92bf256 --- /dev/null +++ b/codemods-legacy/react-router/6/navlink-exact-end/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-react-router-6-navlink-exact-end", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/6/navlink-exact-end/src/index.ts b/codemods-legacy/react-router/6/navlink-exact-end/src/index.ts similarity index 100% rename from codemods/react-router/6/navlink-exact-end/src/index.ts rename to codemods-legacy/react-router/6/navlink-exact-end/src/index.ts diff --git a/codemods/react-router/6/navlink-exact-end/tsconfig.json b/codemods-legacy/react-router/6/navlink-exact-end/tsconfig.json similarity index 100% rename from codemods/react-router/6/navlink-exact-end/tsconfig.json rename to codemods-legacy/react-router/6/navlink-exact-end/tsconfig.json diff --git a/codemods/react-router/6/redirect-to-navigate/.codemodrc.json b/codemods-legacy/react-router/6/redirect-to-navigate/.codemodrc.json similarity index 100% rename from codemods/react-router/6/redirect-to-navigate/.codemodrc.json rename to codemods-legacy/react-router/6/redirect-to-navigate/.codemodrc.json diff --git a/codemods/react-router/6/redirect-to-navigate/README.md b/codemods-legacy/react-router/6/redirect-to-navigate/README.md similarity index 100% rename from codemods/react-router/6/redirect-to-navigate/README.md rename to codemods-legacy/react-router/6/redirect-to-navigate/README.md diff --git a/codemods-legacy/react-router/6/redirect-to-navigate/package.json b/codemods-legacy/react-router/6/redirect-to-navigate/package.json new file mode 100644 index 00000000..82ea6a8c --- /dev/null +++ b/codemods-legacy/react-router/6/redirect-to-navigate/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-react-router-6-redirect-to-navigate", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/6/redirect-to-navigate/src/index.ts b/codemods-legacy/react-router/6/redirect-to-navigate/src/index.ts similarity index 100% rename from codemods/react-router/6/redirect-to-navigate/src/index.ts rename to codemods-legacy/react-router/6/redirect-to-navigate/src/index.ts diff --git a/codemods/react-router/6/redirect-to-navigate/tsconfig.json b/codemods-legacy/react-router/6/redirect-to-navigate/tsconfig.json similarity index 100% rename from codemods/react-router/6/redirect-to-navigate/tsconfig.json rename to codemods-legacy/react-router/6/redirect-to-navigate/tsconfig.json diff --git a/codemods/react-router/6/remove-active-classname/.codemodrc.json b/codemods-legacy/react-router/6/remove-active-classname/.codemodrc.json similarity index 100% rename from codemods/react-router/6/remove-active-classname/.codemodrc.json rename to codemods-legacy/react-router/6/remove-active-classname/.codemodrc.json diff --git a/codemods/react-router/6/remove-active-classname/README.md b/codemods-legacy/react-router/6/remove-active-classname/README.md similarity index 100% rename from codemods/react-router/6/remove-active-classname/README.md rename to codemods-legacy/react-router/6/remove-active-classname/README.md diff --git a/codemods/react-router/6/remove-active-classname/__testfixtures__/input.js b/codemods-legacy/react-router/6/remove-active-classname/__testfixtures__/input.js similarity index 100% rename from codemods/react-router/6/remove-active-classname/__testfixtures__/input.js rename to codemods-legacy/react-router/6/remove-active-classname/__testfixtures__/input.js diff --git a/codemods/react-router/6/remove-active-classname/__testfixtures__/output.js b/codemods-legacy/react-router/6/remove-active-classname/__testfixtures__/output.js similarity index 100% rename from codemods/react-router/6/remove-active-classname/__testfixtures__/output.js rename to codemods-legacy/react-router/6/remove-active-classname/__testfixtures__/output.js diff --git a/codemods-legacy/react-router/6/remove-active-classname/package.json b/codemods-legacy/react-router/6/remove-active-classname/package.json new file mode 100644 index 00000000..eb82f6ab --- /dev/null +++ b/codemods-legacy/react-router/6/remove-active-classname/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-react-router-6-remove-active-classname", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/6/remove-active-classname/src/index.ts b/codemods-legacy/react-router/6/remove-active-classname/src/index.ts similarity index 100% rename from codemods/react-router/6/remove-active-classname/src/index.ts rename to codemods-legacy/react-router/6/remove-active-classname/src/index.ts diff --git a/codemods/react-router/6/remove-active-classname/test/test.ts b/codemods-legacy/react-router/6/remove-active-classname/test/test.ts similarity index 100% rename from codemods/react-router/6/remove-active-classname/test/test.ts rename to codemods-legacy/react-router/6/remove-active-classname/test/test.ts diff --git a/codemods/react-router/6/remove-active-classname/tsconfig.json b/codemods-legacy/react-router/6/remove-active-classname/tsconfig.json similarity index 100% rename from codemods/react-router/6/remove-active-classname/tsconfig.json rename to codemods-legacy/react-router/6/remove-active-classname/tsconfig.json diff --git a/codemods-legacy/react-router/6/remove-active-classname/vitest.config.ts b/codemods-legacy/react-router/6/remove-active-classname/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react-router/6/remove-active-classname/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/react-router/6/remove-active-style/.codemodrc.json b/codemods-legacy/react-router/6/remove-active-style/.codemodrc.json similarity index 100% rename from codemods/react-router/6/remove-active-style/.codemodrc.json rename to codemods-legacy/react-router/6/remove-active-style/.codemodrc.json diff --git a/codemods/react-router/6/remove-active-style/README.md b/codemods-legacy/react-router/6/remove-active-style/README.md similarity index 100% rename from codemods/react-router/6/remove-active-style/README.md rename to codemods-legacy/react-router/6/remove-active-style/README.md diff --git a/codemods/react-router/6/remove-active-style/__testfixtures__/input.js b/codemods-legacy/react-router/6/remove-active-style/__testfixtures__/input.js similarity index 100% rename from codemods/react-router/6/remove-active-style/__testfixtures__/input.js rename to codemods-legacy/react-router/6/remove-active-style/__testfixtures__/input.js diff --git a/codemods/react-router/6/remove-active-style/__testfixtures__/output.js b/codemods-legacy/react-router/6/remove-active-style/__testfixtures__/output.js similarity index 100% rename from codemods/react-router/6/remove-active-style/__testfixtures__/output.js rename to codemods-legacy/react-router/6/remove-active-style/__testfixtures__/output.js diff --git a/codemods-legacy/react-router/6/remove-active-style/package.json b/codemods-legacy/react-router/6/remove-active-style/package.json new file mode 100644 index 00000000..bd10ec6d --- /dev/null +++ b/codemods-legacy/react-router/6/remove-active-style/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-react-router-6-remove-active-style", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/6/remove-active-style/src/index.ts b/codemods-legacy/react-router/6/remove-active-style/src/index.ts similarity index 100% rename from codemods/react-router/6/remove-active-style/src/index.ts rename to codemods-legacy/react-router/6/remove-active-style/src/index.ts diff --git a/codemods/react-router/6/remove-active-style/test/test.ts b/codemods-legacy/react-router/6/remove-active-style/test/test.ts similarity index 100% rename from codemods/react-router/6/remove-active-style/test/test.ts rename to codemods-legacy/react-router/6/remove-active-style/test/test.ts diff --git a/codemods/react-router/6/remove-active-style/tsconfig.json b/codemods-legacy/react-router/6/remove-active-style/tsconfig.json similarity index 100% rename from codemods/react-router/6/remove-active-style/tsconfig.json rename to codemods-legacy/react-router/6/remove-active-style/tsconfig.json diff --git a/codemods-legacy/react-router/6/remove-active-style/vitest.config.ts b/codemods-legacy/react-router/6/remove-active-style/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react-router/6/remove-active-style/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/react-router/6/remove-compat-router/.codemodrc.json b/codemods-legacy/react-router/6/remove-compat-router/.codemodrc.json similarity index 100% rename from codemods/react-router/6/remove-compat-router/.codemodrc.json rename to codemods-legacy/react-router/6/remove-compat-router/.codemodrc.json diff --git a/codemods/react-router/6/remove-compat-router/README.md b/codemods-legacy/react-router/6/remove-compat-router/README.md similarity index 100% rename from codemods/react-router/6/remove-compat-router/README.md rename to codemods-legacy/react-router/6/remove-compat-router/README.md diff --git a/codemods-legacy/react-router/6/remove-compat-router/package.json b/codemods-legacy/react-router/6/remove-compat-router/package.json new file mode 100644 index 00000000..372e392c --- /dev/null +++ b/codemods-legacy/react-router/6/remove-compat-router/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-react-router-6-remove-compat-router", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/6/remove-compat-router/src/index.ts b/codemods-legacy/react-router/6/remove-compat-router/src/index.ts similarity index 100% rename from codemods/react-router/6/remove-compat-router/src/index.ts rename to codemods-legacy/react-router/6/remove-compat-router/src/index.ts diff --git a/codemods/react-router/6/remove-compat-router/tsconfig.json b/codemods-legacy/react-router/6/remove-compat-router/tsconfig.json similarity index 100% rename from codemods/react-router/6/remove-compat-router/tsconfig.json rename to codemods-legacy/react-router/6/remove-compat-router/tsconfig.json diff --git a/codemods/react-router/6/remove-go-hooks/.codemodrc.json b/codemods-legacy/react-router/6/remove-go-hooks/.codemodrc.json similarity index 100% rename from codemods/react-router/6/remove-go-hooks/.codemodrc.json rename to codemods-legacy/react-router/6/remove-go-hooks/.codemodrc.json diff --git a/codemods/react-router/6/remove-go-hooks/README.md b/codemods-legacy/react-router/6/remove-go-hooks/README.md similarity index 100% rename from codemods/react-router/6/remove-go-hooks/README.md rename to codemods-legacy/react-router/6/remove-go-hooks/README.md diff --git a/codemods-legacy/react-router/6/remove-go-hooks/package.json b/codemods-legacy/react-router/6/remove-go-hooks/package.json new file mode 100644 index 00000000..6a4ba304 --- /dev/null +++ b/codemods-legacy/react-router/6/remove-go-hooks/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-react-router-6-remove-go-hooks", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/6/remove-go-hooks/src/index.ts b/codemods-legacy/react-router/6/remove-go-hooks/src/index.ts similarity index 100% rename from codemods/react-router/6/remove-go-hooks/src/index.ts rename to codemods-legacy/react-router/6/remove-go-hooks/src/index.ts diff --git a/codemods/react-router/6/remove-go-hooks/tsconfig.json b/codemods-legacy/react-router/6/remove-go-hooks/tsconfig.json similarity index 100% rename from codemods/react-router/6/remove-go-hooks/tsconfig.json rename to codemods-legacy/react-router/6/remove-go-hooks/tsconfig.json diff --git a/codemods/react-router/6/remove-redirect-inside-switch/.codemodrc.json b/codemods-legacy/react-router/6/remove-redirect-inside-switch/.codemodrc.json similarity index 100% rename from codemods/react-router/6/remove-redirect-inside-switch/.codemodrc.json rename to codemods-legacy/react-router/6/remove-redirect-inside-switch/.codemodrc.json diff --git a/codemods/react-router/6/remove-redirect-inside-switch/README.md b/codemods-legacy/react-router/6/remove-redirect-inside-switch/README.md similarity index 100% rename from codemods/react-router/6/remove-redirect-inside-switch/README.md rename to codemods-legacy/react-router/6/remove-redirect-inside-switch/README.md diff --git a/codemods/react-router/6/remove-redirect-inside-switch/__testfixtures__/input.js b/codemods-legacy/react-router/6/remove-redirect-inside-switch/__testfixtures__/input.js similarity index 100% rename from codemods/react-router/6/remove-redirect-inside-switch/__testfixtures__/input.js rename to codemods-legacy/react-router/6/remove-redirect-inside-switch/__testfixtures__/input.js diff --git a/codemods/react-router/6/remove-redirect-inside-switch/__testfixtures__/output.js b/codemods-legacy/react-router/6/remove-redirect-inside-switch/__testfixtures__/output.js similarity index 100% rename from codemods/react-router/6/remove-redirect-inside-switch/__testfixtures__/output.js rename to codemods-legacy/react-router/6/remove-redirect-inside-switch/__testfixtures__/output.js diff --git a/codemods-legacy/react-router/6/remove-redirect-inside-switch/package.json b/codemods-legacy/react-router/6/remove-redirect-inside-switch/package.json new file mode 100644 index 00000000..effd1332 --- /dev/null +++ b/codemods-legacy/react-router/6/remove-redirect-inside-switch/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-react-router-6-remove-redirect-inside-switch", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/6/remove-redirect-inside-switch/src/index.js b/codemods-legacy/react-router/6/remove-redirect-inside-switch/src/index.js similarity index 100% rename from codemods/react-router/6/remove-redirect-inside-switch/src/index.js rename to codemods-legacy/react-router/6/remove-redirect-inside-switch/src/index.js diff --git a/codemods/react-router/6/remove-redirect-inside-switch/test/test.ts b/codemods-legacy/react-router/6/remove-redirect-inside-switch/test/test.ts similarity index 100% rename from codemods/react-router/6/remove-redirect-inside-switch/test/test.ts rename to codemods-legacy/react-router/6/remove-redirect-inside-switch/test/test.ts diff --git a/codemods/react-router/6/remove-redirect-inside-switch/tsconfig.json b/codemods-legacy/react-router/6/remove-redirect-inside-switch/tsconfig.json similarity index 100% rename from codemods/react-router/6/remove-redirect-inside-switch/tsconfig.json rename to codemods-legacy/react-router/6/remove-redirect-inside-switch/tsconfig.json diff --git a/codemods-legacy/react-router/6/remove-redirect-inside-switch/vitest.config.ts b/codemods-legacy/react-router/6/remove-redirect-inside-switch/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react-router/6/remove-redirect-inside-switch/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/react-router/6/rename-compat-imports/.codemodrc.json b/codemods-legacy/react-router/6/rename-compat-imports/.codemodrc.json similarity index 100% rename from codemods/react-router/6/rename-compat-imports/.codemodrc.json rename to codemods-legacy/react-router/6/rename-compat-imports/.codemodrc.json diff --git a/codemods/react-router/6/rename-compat-imports/README.md b/codemods-legacy/react-router/6/rename-compat-imports/README.md similarity index 100% rename from codemods/react-router/6/rename-compat-imports/README.md rename to codemods-legacy/react-router/6/rename-compat-imports/README.md diff --git a/codemods-legacy/react-router/6/rename-compat-imports/package.json b/codemods-legacy/react-router/6/rename-compat-imports/package.json new file mode 100644 index 00000000..6044a29b --- /dev/null +++ b/codemods-legacy/react-router/6/rename-compat-imports/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-react-router-6-rename-compat-imports", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/6/rename-compat-imports/src/index.ts b/codemods-legacy/react-router/6/rename-compat-imports/src/index.ts similarity index 100% rename from codemods/react-router/6/rename-compat-imports/src/index.ts rename to codemods-legacy/react-router/6/rename-compat-imports/src/index.ts diff --git a/codemods/react-router/6/rename-compat-imports/tsconfig.json b/codemods-legacy/react-router/6/rename-compat-imports/tsconfig.json similarity index 100% rename from codemods/react-router/6/rename-compat-imports/tsconfig.json rename to codemods-legacy/react-router/6/rename-compat-imports/tsconfig.json diff --git a/codemods/react-router/6/static-router-imports/.codemodrc.json b/codemods-legacy/react-router/6/static-router-imports/.codemodrc.json similarity index 100% rename from codemods/react-router/6/static-router-imports/.codemodrc.json rename to codemods-legacy/react-router/6/static-router-imports/.codemodrc.json diff --git a/codemods/react-router/6/static-router-imports/README.md b/codemods-legacy/react-router/6/static-router-imports/README.md similarity index 100% rename from codemods/react-router/6/static-router-imports/README.md rename to codemods-legacy/react-router/6/static-router-imports/README.md diff --git a/codemods-legacy/react-router/6/static-router-imports/package.json b/codemods-legacy/react-router/6/static-router-imports/package.json new file mode 100644 index 00000000..80050257 --- /dev/null +++ b/codemods-legacy/react-router/6/static-router-imports/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-react-router-6-static-router-imports", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/6/static-router-imports/src/index.ts b/codemods-legacy/react-router/6/static-router-imports/src/index.ts similarity index 100% rename from codemods/react-router/6/static-router-imports/src/index.ts rename to codemods-legacy/react-router/6/static-router-imports/src/index.ts diff --git a/codemods/react-router/6/static-router-imports/tsconfig.json b/codemods-legacy/react-router/6/static-router-imports/tsconfig.json similarity index 100% rename from codemods/react-router/6/static-router-imports/tsconfig.json rename to codemods-legacy/react-router/6/static-router-imports/tsconfig.json diff --git a/codemods/react-router/6/use-location/.codemodrc.json b/codemods-legacy/react-router/6/use-location/.codemodrc.json similarity index 100% rename from codemods/react-router/6/use-location/.codemodrc.json rename to codemods-legacy/react-router/6/use-location/.codemodrc.json diff --git a/codemods/react-router/6/use-location/README.md b/codemods-legacy/react-router/6/use-location/README.md similarity index 100% rename from codemods/react-router/6/use-location/README.md rename to codemods-legacy/react-router/6/use-location/README.md diff --git a/codemods-legacy/react-router/6/use-location/package.json b/codemods-legacy/react-router/6/use-location/package.json new file mode 100644 index 00000000..ba19b4f8 --- /dev/null +++ b/codemods-legacy/react-router/6/use-location/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-react-router-6-use-location", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/6/use-location/src/index.js b/codemods-legacy/react-router/6/use-location/src/index.js similarity index 100% rename from codemods/react-router/6/use-location/src/index.js rename to codemods-legacy/react-router/6/use-location/src/index.js diff --git a/codemods/react-router/6/use-location/tsconfig.json b/codemods-legacy/react-router/6/use-location/tsconfig.json similarity index 100% rename from codemods/react-router/6/use-location/tsconfig.json rename to codemods-legacy/react-router/6/use-location/tsconfig.json diff --git a/codemods/react-router/6/use-navigate/.codemodrc.json b/codemods-legacy/react-router/6/use-navigate/.codemodrc.json similarity index 100% rename from codemods/react-router/6/use-navigate/.codemodrc.json rename to codemods-legacy/react-router/6/use-navigate/.codemodrc.json diff --git a/codemods/react-router/6/use-navigate/README.md b/codemods-legacy/react-router/6/use-navigate/README.md similarity index 100% rename from codemods/react-router/6/use-navigate/README.md rename to codemods-legacy/react-router/6/use-navigate/README.md diff --git a/codemods-legacy/react-router/6/use-navigate/package.json b/codemods-legacy/react-router/6/use-navigate/package.json new file mode 100644 index 00000000..42359dd1 --- /dev/null +++ b/codemods-legacy/react-router/6/use-navigate/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-react-router-6-use-navigate", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/6/use-navigate/src/index.js b/codemods-legacy/react-router/6/use-navigate/src/index.js similarity index 100% rename from codemods/react-router/6/use-navigate/src/index.js rename to codemods-legacy/react-router/6/use-navigate/src/index.js diff --git a/codemods/react-router/6/use-navigate/tsconfig.json b/codemods-legacy/react-router/6/use-navigate/tsconfig.json similarity index 100% rename from codemods/react-router/6/use-navigate/tsconfig.json rename to codemods-legacy/react-router/6/use-navigate/tsconfig.json diff --git a/codemods/react-router/6/use-params/.codemodrc.json b/codemods-legacy/react-router/6/use-params/.codemodrc.json similarity index 100% rename from codemods/react-router/6/use-params/.codemodrc.json rename to codemods-legacy/react-router/6/use-params/.codemodrc.json diff --git a/codemods/react-router/6/use-params/README.md b/codemods-legacy/react-router/6/use-params/README.md similarity index 100% rename from codemods/react-router/6/use-params/README.md rename to codemods-legacy/react-router/6/use-params/README.md diff --git a/codemods-legacy/react-router/6/use-params/package.json b/codemods-legacy/react-router/6/use-params/package.json new file mode 100644 index 00000000..cffb22b6 --- /dev/null +++ b/codemods-legacy/react-router/6/use-params/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-react-router-6-use-params", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/6/use-params/src/index.js b/codemods-legacy/react-router/6/use-params/src/index.js similarity index 100% rename from codemods/react-router/6/use-params/src/index.js rename to codemods-legacy/react-router/6/use-params/src/index.js diff --git a/codemods/react-router/6/use-params/tsconfig.json b/codemods-legacy/react-router/6/use-params/tsconfig.json similarity index 100% rename from codemods/react-router/6/use-params/tsconfig.json rename to codemods-legacy/react-router/6/use-params/tsconfig.json diff --git a/codemods/react-router/6/use-route-match/.codemodrc.json b/codemods-legacy/react-router/6/use-route-match/.codemodrc.json similarity index 100% rename from codemods/react-router/6/use-route-match/.codemodrc.json rename to codemods-legacy/react-router/6/use-route-match/.codemodrc.json diff --git a/codemods/react-router/6/use-route-match/README.md b/codemods-legacy/react-router/6/use-route-match/README.md similarity index 100% rename from codemods/react-router/6/use-route-match/README.md rename to codemods-legacy/react-router/6/use-route-match/README.md diff --git a/codemods-legacy/react-router/6/use-route-match/package.json b/codemods-legacy/react-router/6/use-route-match/package.json new file mode 100644 index 00000000..8ea5a686 --- /dev/null +++ b/codemods-legacy/react-router/6/use-route-match/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-react-router-6-use-route-match", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react-router/6/use-route-match/src/index.js b/codemods-legacy/react-router/6/use-route-match/src/index.js similarity index 100% rename from codemods/react-router/6/use-route-match/src/index.js rename to codemods-legacy/react-router/6/use-route-match/src/index.js diff --git a/codemods/react-router/6/use-route-match/tsconfig.json b/codemods-legacy/react-router/6/use-route-match/tsconfig.json similarity index 100% rename from codemods/react-router/6/use-route-match/tsconfig.json rename to codemods-legacy/react-router/6/use-route-match/tsconfig.json diff --git a/codemods/react/.DS_Store b/codemods-legacy/react/.DS_Store similarity index 100% rename from codemods/react/.DS_Store rename to codemods-legacy/react/.DS_Store diff --git a/codemods/react/19/migration-recipe/.codemodrc.json b/codemods-legacy/react/19/migration-recipe/.codemodrc.json similarity index 100% rename from codemods/react/19/migration-recipe/.codemodrc.json rename to codemods-legacy/react/19/migration-recipe/.codemodrc.json diff --git a/codemods/react/19/migration-recipe/README.md b/codemods-legacy/react/19/migration-recipe/README.md similarity index 100% rename from codemods/react/19/migration-recipe/README.md rename to codemods-legacy/react/19/migration-recipe/README.md diff --git a/codemods/react/19/migration-recipe/package.json b/codemods-legacy/react/19/migration-recipe/package.json similarity index 100% rename from codemods/react/19/migration-recipe/package.json rename to codemods-legacy/react/19/migration-recipe/package.json diff --git a/codemods/react/19/remove-context-provider/.codemodrc.json b/codemods-legacy/react/19/remove-context-provider/.codemodrc.json similarity index 100% rename from codemods/react/19/remove-context-provider/.codemodrc.json rename to codemods-legacy/react/19/remove-context-provider/.codemodrc.json diff --git a/codemods/react/19/remove-context-provider/README.md b/codemods-legacy/react/19/remove-context-provider/README.md similarity index 100% rename from codemods/react/19/remove-context-provider/README.md rename to codemods-legacy/react/19/remove-context-provider/README.md diff --git a/codemods-legacy/react/19/remove-context-provider/package.json b/codemods-legacy/react/19/remove-context-provider/package.json new file mode 100644 index 00000000..58c4531e --- /dev/null +++ b/codemods-legacy/react/19/remove-context-provider/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-react-19-remove-context-provider", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react/19/remove-context-provider/src/index.ts b/codemods-legacy/react/19/remove-context-provider/src/index.ts similarity index 100% rename from codemods/react/19/remove-context-provider/src/index.ts rename to codemods-legacy/react/19/remove-context-provider/src/index.ts diff --git a/codemods/react/19/remove-context-provider/test/test.ts b/codemods-legacy/react/19/remove-context-provider/test/test.ts similarity index 100% rename from codemods/react/19/remove-context-provider/test/test.ts rename to codemods-legacy/react/19/remove-context-provider/test/test.ts diff --git a/codemods/react/19/remove-context-provider/tsconfig.json b/codemods-legacy/react/19/remove-context-provider/tsconfig.json similarity index 100% rename from codemods/react/19/remove-context-provider/tsconfig.json rename to codemods-legacy/react/19/remove-context-provider/tsconfig.json diff --git a/codemods-legacy/react/19/remove-context-provider/vitest.config.ts b/codemods-legacy/react/19/remove-context-provider/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react/19/remove-context-provider/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/react/19/remove-forward-ref/.codemodrc.json b/codemods-legacy/react/19/remove-forward-ref/.codemodrc.json similarity index 100% rename from codemods/react/19/remove-forward-ref/.codemodrc.json rename to codemods-legacy/react/19/remove-forward-ref/.codemodrc.json diff --git a/codemods/react/19/remove-forward-ref/README.md b/codemods-legacy/react/19/remove-forward-ref/README.md similarity index 100% rename from codemods/react/19/remove-forward-ref/README.md rename to codemods-legacy/react/19/remove-forward-ref/README.md diff --git a/codemods-legacy/react/19/remove-forward-ref/package.json b/codemods-legacy/react/19/remove-forward-ref/package.json new file mode 100644 index 00000000..fc24391b --- /dev/null +++ b/codemods-legacy/react/19/remove-forward-ref/package.json @@ -0,0 +1,24 @@ +{ + "name": "@codemod-com/codemod-react-remove-forward-ref", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^3.2.4" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react/19/remove-forward-ref/src/index.ts b/codemods-legacy/react/19/remove-forward-ref/src/index.ts similarity index 100% rename from codemods/react/19/remove-forward-ref/src/index.ts rename to codemods-legacy/react/19/remove-forward-ref/src/index.ts diff --git a/codemods/react/19/remove-forward-ref/test/test.ts b/codemods-legacy/react/19/remove-forward-ref/test/test.ts similarity index 100% rename from codemods/react/19/remove-forward-ref/test/test.ts rename to codemods-legacy/react/19/remove-forward-ref/test/test.ts diff --git a/codemods/react/19/remove-forward-ref/tsconfig.json b/codemods-legacy/react/19/remove-forward-ref/tsconfig.json similarity index 100% rename from codemods/react/19/remove-forward-ref/tsconfig.json rename to codemods-legacy/react/19/remove-forward-ref/tsconfig.json diff --git a/codemods-legacy/react/19/remove-forward-ref/vitest.config.ts b/codemods-legacy/react/19/remove-forward-ref/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react/19/remove-forward-ref/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/react/19/remove-legacy-context/.codemodrc.json b/codemods-legacy/react/19/remove-legacy-context/.codemodrc.json similarity index 100% rename from codemods/react/19/remove-legacy-context/.codemodrc.json rename to codemods-legacy/react/19/remove-legacy-context/.codemodrc.json diff --git a/codemods/react/19/remove-legacy-context/.gitignore b/codemods-legacy/react/19/remove-legacy-context/.gitignore similarity index 100% rename from codemods/react/19/remove-legacy-context/.gitignore rename to codemods-legacy/react/19/remove-legacy-context/.gitignore diff --git a/codemods/react/19/remove-legacy-context/LICENSE b/codemods-legacy/react/19/remove-legacy-context/LICENSE similarity index 100% rename from codemods/react/19/remove-legacy-context/LICENSE rename to codemods-legacy/react/19/remove-legacy-context/LICENSE diff --git a/codemods/react/19/remove-legacy-context/README.md b/codemods-legacy/react/19/remove-legacy-context/README.md similarity index 100% rename from codemods/react/19/remove-legacy-context/README.md rename to codemods-legacy/react/19/remove-legacy-context/README.md diff --git a/codemods/react/19/remove-legacy-context/__testfixtures__/class-component.input.tsx b/codemods-legacy/react/19/remove-legacy-context/__testfixtures__/class-component.input.tsx similarity index 100% rename from codemods/react/19/remove-legacy-context/__testfixtures__/class-component.input.tsx rename to codemods-legacy/react/19/remove-legacy-context/__testfixtures__/class-component.input.tsx diff --git a/codemods/react/19/remove-legacy-context/__testfixtures__/class-component.output.tsx b/codemods-legacy/react/19/remove-legacy-context/__testfixtures__/class-component.output.tsx similarity index 100% rename from codemods/react/19/remove-legacy-context/__testfixtures__/class-component.output.tsx rename to codemods-legacy/react/19/remove-legacy-context/__testfixtures__/class-component.output.tsx diff --git a/codemods-legacy/react/19/remove-legacy-context/package.json b/codemods-legacy/react/19/remove-legacy-context/package.json new file mode 100644 index 00000000..b83b54be --- /dev/null +++ b/codemods-legacy/react/19/remove-legacy-context/package.json @@ -0,0 +1,25 @@ +{ + "name": "remove-legacy-context", + "license": "MIT", + "private": true, + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "20.9.0", + "jscodeshift": "^0.15.1", + "typescript": "^5.2.2", + "vitest": "^3.2.4 " + }, + "scripts": { + "test-fails": "vitest run && echo this test fails", + "test:watch": "vitest watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "dmytrohryshyn" +} diff --git a/codemods/react/19/remove-legacy-context/src/analyze.ts b/codemods-legacy/react/19/remove-legacy-context/src/analyze.ts similarity index 100% rename from codemods/react/19/remove-legacy-context/src/analyze.ts rename to codemods-legacy/react/19/remove-legacy-context/src/analyze.ts diff --git a/codemods-legacy/react/19/remove-legacy-context/src/index.ts b/codemods-legacy/react/19/remove-legacy-context/src/index.ts new file mode 100644 index 00000000..a61546b3 --- /dev/null +++ b/codemods-legacy/react/19/remove-legacy-context/src/index.ts @@ -0,0 +1,80 @@ +// BUILT WITH https://codemod.studio + +import type { API, FileInfo, JSCodeshift } from "jscodeshift"; +import { findPatterns } from "./analyze.js"; + +import { getClassMethod } from "@codemod.com/codemod-utils"; + +// const FooContext = React.createContext(); +const buildContextVariableDeclaration = (j: JSCodeshift) => + j.variableDeclaration("const", [ + j.variableDeclarator( + j.identifier("Context"), + j.callExpression( + j.memberExpression( + j.identifier("React"), + j.identifier("createContext"), + ), + [], + ), + ), + ]); + +const buildContextProvider = (j: JSCodeshift, value: any, renderedJsx: any) => + j.jsxElement( + j.jsxOpeningElement(j.jsxIdentifier("Context"), [ + j.jsxAttribute(j.jsxIdentifier("value"), j.jsxExpressionContainer(value)), + ]), + j.jsxClosingElement(j.jsxIdentifier("Context")), + [renderedJsx], + ); + +export default function transform( + file: FileInfo, + api: API, +): string | undefined { + const j = api.jscodeshift; + const root = j(file.source); + + let isDirty = false; + + findPatterns(j, root)?.forEach((pattern) => { + if (!pattern) { + return; + } + isDirty = true; + + const { classComponent, getChildContext, childContextTypes } = pattern; + + const childContextValue = + j(getChildContext).find(j.ReturnStatement).paths().at(0)?.value + .argument ?? null; + + j(childContextTypes).remove(); + j(getChildContext).remove(); + + // add Context variable declaration + const variableDeclaration = buildContextVariableDeclaration(j); + classComponent.insertBefore(variableDeclaration); + + const render = getClassMethod(j, classComponent, "render"); + + const renderReturnStatement = render + ? j(render).find(j.ReturnStatement).paths().at(0) + : null; + + const renderedJsx = renderReturnStatement?.value.argument; + + if (!renderedJsx) { + return; + } + + renderReturnStatement.value.argument = buildContextProvider( + j, + childContextValue, + renderedJsx, + ); + }); + + return isDirty ? root.toSource() : undefined; +} diff --git a/codemods/react/19/remove-legacy-context/test/test.ts b/codemods-legacy/react/19/remove-legacy-context/test/test.ts similarity index 100% rename from codemods/react/19/remove-legacy-context/test/test.ts rename to codemods-legacy/react/19/remove-legacy-context/test/test.ts diff --git a/codemods-legacy/react/19/remove-legacy-context/tsconfig.json b/codemods-legacy/react/19/remove-legacy-context/tsconfig.json new file mode 100644 index 00000000..36bd1c7d --- /dev/null +++ b/codemods-legacy/react/19/remove-legacy-context/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@codemod-com/tsconfig/codemod.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "./dist" + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods-legacy/react/19/remove-legacy-context/vitest.config.ts b/codemods-legacy/react/19/remove-legacy-context/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react/19/remove-legacy-context/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/react/19/remove-memoization/.codemodrc.json b/codemods-legacy/react/19/remove-memoization/.codemodrc.json similarity index 100% rename from codemods/react/19/remove-memoization/.codemodrc.json rename to codemods-legacy/react/19/remove-memoization/.codemodrc.json diff --git a/codemods/react/19/remove-memoization/README.md b/codemods-legacy/react/19/remove-memoization/README.md similarity index 100% rename from codemods/react/19/remove-memoization/README.md rename to codemods-legacy/react/19/remove-memoization/README.md diff --git a/codemods-legacy/react/19/remove-memoization/package.json b/codemods-legacy/react/19/remove-memoization/package.json new file mode 100644 index 00000000..ad6f3ca8 --- /dev/null +++ b/codemods-legacy/react/19/remove-memoization/package.json @@ -0,0 +1,24 @@ +{ + "name": "@codemod-com/codemod-react-19-remove-memoization-hooks", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react/19/remove-memoization/src/index.ts b/codemods-legacy/react/19/remove-memoization/src/index.ts similarity index 100% rename from codemods/react/19/remove-memoization/src/index.ts rename to codemods-legacy/react/19/remove-memoization/src/index.ts diff --git a/codemods/react/19/remove-memoization/test/test.ts b/codemods-legacy/react/19/remove-memoization/test/test.ts similarity index 100% rename from codemods/react/19/remove-memoization/test/test.ts rename to codemods-legacy/react/19/remove-memoization/test/test.ts diff --git a/codemods/react/19/remove-memoization/tsconfig.json b/codemods-legacy/react/19/remove-memoization/tsconfig.json similarity index 100% rename from codemods/react/19/remove-memoization/tsconfig.json rename to codemods-legacy/react/19/remove-memoization/tsconfig.json diff --git a/codemods-legacy/react/19/remove-memoization/vitest.config.ts b/codemods-legacy/react/19/remove-memoization/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react/19/remove-memoization/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/react/19/replace-act-import/.codemodrc.json b/codemods-legacy/react/19/replace-act-import/.codemodrc.json similarity index 100% rename from codemods/react/19/replace-act-import/.codemodrc.json rename to codemods-legacy/react/19/replace-act-import/.codemodrc.json diff --git a/codemods/react/19/replace-act-import/README.md b/codemods-legacy/react/19/replace-act-import/README.md similarity index 100% rename from codemods/react/19/replace-act-import/README.md rename to codemods-legacy/react/19/replace-act-import/README.md diff --git a/codemods/react/19/replace-act-import/__testfixtures__/existing-type-import.input.js b/codemods-legacy/react/19/replace-act-import/__testfixtures__/existing-type-import.input.js similarity index 100% rename from codemods/react/19/replace-act-import/__testfixtures__/existing-type-import.input.js rename to codemods-legacy/react/19/replace-act-import/__testfixtures__/existing-type-import.input.js diff --git a/codemods/react/19/replace-act-import/__testfixtures__/existing-type-import.output.js b/codemods-legacy/react/19/replace-act-import/__testfixtures__/existing-type-import.output.js similarity index 100% rename from codemods/react/19/replace-act-import/__testfixtures__/existing-type-import.output.js rename to codemods-legacy/react/19/replace-act-import/__testfixtures__/existing-type-import.output.js diff --git a/codemods/react/19/replace-act-import/__testfixtures__/fixture1.input.js b/codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture1.input.js similarity index 100% rename from codemods/react/19/replace-act-import/__testfixtures__/fixture1.input.js rename to codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture1.input.js diff --git a/codemods/react/19/replace-act-import/__testfixtures__/fixture1.output.js b/codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture1.output.js similarity index 100% rename from codemods/react/19/replace-act-import/__testfixtures__/fixture1.output.js rename to codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture1.output.js diff --git a/codemods/react/19/replace-act-import/__testfixtures__/fixture2.input.js b/codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture2.input.js similarity index 100% rename from codemods/react/19/replace-act-import/__testfixtures__/fixture2.input.js rename to codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture2.input.js diff --git a/codemods/react/19/replace-act-import/__testfixtures__/fixture2.output.js b/codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture2.output.js similarity index 100% rename from codemods/react/19/replace-act-import/__testfixtures__/fixture2.output.js rename to codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture2.output.js diff --git a/codemods/react/19/replace-act-import/__testfixtures__/fixture3.input.js b/codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture3.input.js similarity index 100% rename from codemods/react/19/replace-act-import/__testfixtures__/fixture3.input.js rename to codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture3.input.js diff --git a/codemods/react/19/replace-act-import/__testfixtures__/fixture3.output.js b/codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture3.output.js similarity index 100% rename from codemods/react/19/replace-act-import/__testfixtures__/fixture3.output.js rename to codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture3.output.js diff --git a/codemods/react/19/replace-act-import/__testfixtures__/fixture4.input.js b/codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture4.input.js similarity index 100% rename from codemods/react/19/replace-act-import/__testfixtures__/fixture4.input.js rename to codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture4.input.js diff --git a/codemods/react/19/replace-act-import/__testfixtures__/fixture4.output.js b/codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture4.output.js similarity index 100% rename from codemods/react/19/replace-act-import/__testfixtures__/fixture4.output.js rename to codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture4.output.js diff --git a/codemods/react/19/replace-act-import/__testfixtures__/fixture5.input.js b/codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture5.input.js similarity index 100% rename from codemods/react/19/replace-act-import/__testfixtures__/fixture5.input.js rename to codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture5.input.js diff --git a/codemods/react/19/replace-act-import/__testfixtures__/fixture5.output.js b/codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture5.output.js similarity index 100% rename from codemods/react/19/replace-act-import/__testfixtures__/fixture5.output.js rename to codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture5.output.js diff --git a/codemods/react/19/replace-act-import/__testfixtures__/fixture6.input.js b/codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture6.input.js similarity index 100% rename from codemods/react/19/replace-act-import/__testfixtures__/fixture6.input.js rename to codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture6.input.js diff --git a/codemods/react/19/replace-act-import/__testfixtures__/fixture6.output.js b/codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture6.output.js similarity index 100% rename from codemods/react/19/replace-act-import/__testfixtures__/fixture6.output.js rename to codemods-legacy/react/19/replace-act-import/__testfixtures__/fixture6.output.js diff --git a/codemods/react/19/replace-act-import/__testfixtures__/re-export.input.js b/codemods-legacy/react/19/replace-act-import/__testfixtures__/re-export.input.js similarity index 100% rename from codemods/react/19/replace-act-import/__testfixtures__/re-export.input.js rename to codemods-legacy/react/19/replace-act-import/__testfixtures__/re-export.input.js diff --git a/codemods/react/19/replace-act-import/__testfixtures__/re-export.output.js b/codemods-legacy/react/19/replace-act-import/__testfixtures__/re-export.output.js similarity index 100% rename from codemods/react/19/replace-act-import/__testfixtures__/re-export.output.js rename to codemods-legacy/react/19/replace-act-import/__testfixtures__/re-export.output.js diff --git a/codemods-legacy/react/19/replace-act-import/package.json b/codemods-legacy/react/19/replace-act-import/package.json new file mode 100644 index 00000000..5a86dbc3 --- /dev/null +++ b/codemods-legacy/react/19/replace-act-import/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-react-replace-act-import", + "version": "1.0.0", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "^20.12.3", + "@types/jscodeshift": "^0.11.10", + "jscodeshift": "^0.15.1", + "typescript": "^5.2.2", + "vitest": "^1.0.1" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react/19/replace-act-import/src/index.ts b/codemods-legacy/react/19/replace-act-import/src/index.ts similarity index 100% rename from codemods/react/19/replace-act-import/src/index.ts rename to codemods-legacy/react/19/replace-act-import/src/index.ts diff --git a/codemods/react/19/replace-act-import/test/test.ts b/codemods-legacy/react/19/replace-act-import/test/test.ts similarity index 100% rename from codemods/react/19/replace-act-import/test/test.ts rename to codemods-legacy/react/19/replace-act-import/test/test.ts diff --git a/codemods-legacy/react/19/replace-act-import/tsconfig.json b/codemods-legacy/react/19/replace-act-import/tsconfig.json new file mode 100644 index 00000000..36bd1c7d --- /dev/null +++ b/codemods-legacy/react/19/replace-act-import/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@codemod-com/tsconfig/codemod.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "./dist" + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods-legacy/react/19/replace-act-import/vitest.config.ts b/codemods-legacy/react/19/replace-act-import/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react/19/replace-act-import/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/react/19/replace-create-factory/.codemodrc.json b/codemods-legacy/react/19/replace-create-factory/.codemodrc.json similarity index 100% rename from codemods/react/19/replace-create-factory/.codemodrc.json rename to codemods-legacy/react/19/replace-create-factory/.codemodrc.json diff --git a/codemods/react/19/replace-create-factory/.gitignore b/codemods-legacy/react/19/replace-create-factory/.gitignore similarity index 100% rename from codemods/react/19/replace-create-factory/.gitignore rename to codemods-legacy/react/19/replace-create-factory/.gitignore diff --git a/codemods/react/19/replace-create-factory/LICENSE b/codemods-legacy/react/19/replace-create-factory/LICENSE similarity index 100% rename from codemods/react/19/replace-create-factory/LICENSE rename to codemods-legacy/react/19/replace-create-factory/LICENSE diff --git a/codemods/react/19/replace-create-factory/README.md b/codemods-legacy/react/19/replace-create-factory/README.md similarity index 100% rename from codemods/react/19/replace-create-factory/README.md rename to codemods-legacy/react/19/replace-create-factory/README.md diff --git a/codemods/react/19/replace-create-factory/__testfixtures__/identifier.input.ts b/codemods-legacy/react/19/replace-create-factory/__testfixtures__/identifier.input.ts similarity index 100% rename from codemods/react/19/replace-create-factory/__testfixtures__/identifier.input.ts rename to codemods-legacy/react/19/replace-create-factory/__testfixtures__/identifier.input.ts diff --git a/codemods/react/19/replace-create-factory/__testfixtures__/identifier.output.ts b/codemods-legacy/react/19/replace-create-factory/__testfixtures__/identifier.output.ts similarity index 100% rename from codemods/react/19/replace-create-factory/__testfixtures__/identifier.output.ts rename to codemods-legacy/react/19/replace-create-factory/__testfixtures__/identifier.output.ts diff --git a/codemods/react/19/replace-create-factory/__testfixtures__/string-tag-name.input.ts b/codemods-legacy/react/19/replace-create-factory/__testfixtures__/string-tag-name.input.ts similarity index 100% rename from codemods/react/19/replace-create-factory/__testfixtures__/string-tag-name.input.ts rename to codemods-legacy/react/19/replace-create-factory/__testfixtures__/string-tag-name.input.ts diff --git a/codemods/react/19/replace-create-factory/__testfixtures__/string-tag-name.output.ts b/codemods-legacy/react/19/replace-create-factory/__testfixtures__/string-tag-name.output.ts similarity index 100% rename from codemods/react/19/replace-create-factory/__testfixtures__/string-tag-name.output.ts rename to codemods-legacy/react/19/replace-create-factory/__testfixtures__/string-tag-name.output.ts diff --git a/codemods-legacy/react/19/replace-create-factory/package.json b/codemods-legacy/react/19/replace-create-factory/package.json new file mode 100644 index 00000000..ee7c2941 --- /dev/null +++ b/codemods-legacy/react/19/replace-create-factory/package.json @@ -0,0 +1,24 @@ +{ + "name": "react-19-replace-create-factory", + "license": "MIT", + "private": true, + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "^5.2.2", + "vitest": "^3.2.4", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react/19/replace-create-factory/src/analyze.ts b/codemods-legacy/react/19/replace-create-factory/src/analyze.ts similarity index 100% rename from codemods/react/19/replace-create-factory/src/analyze.ts rename to codemods-legacy/react/19/replace-create-factory/src/analyze.ts diff --git a/codemods/react/19/replace-create-factory/src/index.ts b/codemods-legacy/react/19/replace-create-factory/src/index.ts similarity index 100% rename from codemods/react/19/replace-create-factory/src/index.ts rename to codemods-legacy/react/19/replace-create-factory/src/index.ts diff --git a/codemods/react/19/replace-create-factory/test/test.ts b/codemods-legacy/react/19/replace-create-factory/test/test.ts similarity index 100% rename from codemods/react/19/replace-create-factory/test/test.ts rename to codemods-legacy/react/19/replace-create-factory/test/test.ts diff --git a/codemods-legacy/react/19/replace-create-factory/tsconfig.json b/codemods-legacy/react/19/replace-create-factory/tsconfig.json new file mode 100644 index 00000000..36bd1c7d --- /dev/null +++ b/codemods-legacy/react/19/replace-create-factory/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@codemod-com/tsconfig/codemod.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "./dist" + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods-legacy/react/19/replace-create-factory/vitest.config.ts b/codemods-legacy/react/19/replace-create-factory/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react/19/replace-create-factory/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/react/19/replace-default-props/.codemodrc.json b/codemods-legacy/react/19/replace-default-props/.codemodrc.json similarity index 100% rename from codemods/react/19/replace-default-props/.codemodrc.json rename to codemods-legacy/react/19/replace-default-props/.codemodrc.json diff --git a/codemods/react/19/replace-default-props/.gitignore b/codemods-legacy/react/19/replace-default-props/.gitignore similarity index 100% rename from codemods/react/19/replace-default-props/.gitignore rename to codemods-legacy/react/19/replace-default-props/.gitignore diff --git a/codemods/react/19/replace-default-props/LICENSE b/codemods-legacy/react/19/replace-default-props/LICENSE similarity index 100% rename from codemods/react/19/replace-default-props/LICENSE rename to codemods-legacy/react/19/replace-default-props/LICENSE diff --git a/codemods/react/19/replace-default-props/README.md b/codemods-legacy/react/19/replace-default-props/README.md similarity index 100% rename from codemods/react/19/replace-default-props/README.md rename to codemods-legacy/react/19/replace-default-props/README.md diff --git a/codemods/react/19/replace-default-props/__testfixtures__/button-jsx-example-input.jsx b/codemods-legacy/react/19/replace-default-props/__testfixtures__/button-jsx-example-input.jsx similarity index 100% rename from codemods/react/19/replace-default-props/__testfixtures__/button-jsx-example-input.jsx rename to codemods-legacy/react/19/replace-default-props/__testfixtures__/button-jsx-example-input.jsx diff --git a/codemods/react/19/replace-default-props/__testfixtures__/button-jsx-example-output.jsx b/codemods-legacy/react/19/replace-default-props/__testfixtures__/button-jsx-example-output.jsx similarity index 100% rename from codemods/react/19/replace-default-props/__testfixtures__/button-jsx-example-output.jsx rename to codemods-legacy/react/19/replace-default-props/__testfixtures__/button-jsx-example-output.jsx diff --git a/codemods/react/19/replace-default-props/__testfixtures__/implicit-return.input.jsx b/codemods-legacy/react/19/replace-default-props/__testfixtures__/implicit-return.input.jsx similarity index 100% rename from codemods/react/19/replace-default-props/__testfixtures__/implicit-return.input.jsx rename to codemods-legacy/react/19/replace-default-props/__testfixtures__/implicit-return.input.jsx diff --git a/codemods/react/19/replace-default-props/__testfixtures__/implicit-return.output.jsx b/codemods-legacy/react/19/replace-default-props/__testfixtures__/implicit-return.output.jsx similarity index 100% rename from codemods/react/19/replace-default-props/__testfixtures__/implicit-return.output.jsx rename to codemods-legacy/react/19/replace-default-props/__testfixtures__/implicit-return.output.jsx diff --git a/codemods/react/19/replace-default-props/__testfixtures__/multiple-default-props.input.tsx b/codemods-legacy/react/19/replace-default-props/__testfixtures__/multiple-default-props.input.tsx similarity index 100% rename from codemods/react/19/replace-default-props/__testfixtures__/multiple-default-props.input.tsx rename to codemods-legacy/react/19/replace-default-props/__testfixtures__/multiple-default-props.input.tsx diff --git a/codemods/react/19/replace-default-props/__testfixtures__/multiple-default-props.output.tsx b/codemods-legacy/react/19/replace-default-props/__testfixtures__/multiple-default-props.output.tsx similarity index 100% rename from codemods/react/19/replace-default-props/__testfixtures__/multiple-default-props.output.tsx rename to codemods-legacy/react/19/replace-default-props/__testfixtures__/multiple-default-props.output.tsx diff --git a/codemods/react/19/replace-default-props/__testfixtures__/nested-destructuring.input.tsx b/codemods-legacy/react/19/replace-default-props/__testfixtures__/nested-destructuring.input.tsx similarity index 100% rename from codemods/react/19/replace-default-props/__testfixtures__/nested-destructuring.input.tsx rename to codemods-legacy/react/19/replace-default-props/__testfixtures__/nested-destructuring.input.tsx diff --git a/codemods/react/19/replace-default-props/__testfixtures__/nested-destructuring.output.tsx b/codemods-legacy/react/19/replace-default-props/__testfixtures__/nested-destructuring.output.tsx similarity index 100% rename from codemods/react/19/replace-default-props/__testfixtures__/nested-destructuring.output.tsx rename to codemods-legacy/react/19/replace-default-props/__testfixtures__/nested-destructuring.output.tsx diff --git a/codemods/react/19/replace-default-props/__testfixtures__/partial-default-props.input.tsx b/codemods-legacy/react/19/replace-default-props/__testfixtures__/partial-default-props.input.tsx similarity index 100% rename from codemods/react/19/replace-default-props/__testfixtures__/partial-default-props.input.tsx rename to codemods-legacy/react/19/replace-default-props/__testfixtures__/partial-default-props.input.tsx diff --git a/codemods/react/19/replace-default-props/__testfixtures__/partial-default-props.output.tsx b/codemods-legacy/react/19/replace-default-props/__testfixtures__/partial-default-props.output.tsx similarity index 100% rename from codemods/react/19/replace-default-props/__testfixtures__/partial-default-props.output.tsx rename to codemods-legacy/react/19/replace-default-props/__testfixtures__/partial-default-props.output.tsx diff --git a/codemods/react/19/replace-default-props/__testfixtures__/props-not-destructured.input.tsx b/codemods-legacy/react/19/replace-default-props/__testfixtures__/props-not-destructured.input.tsx similarity index 100% rename from codemods/react/19/replace-default-props/__testfixtures__/props-not-destructured.input.tsx rename to codemods-legacy/react/19/replace-default-props/__testfixtures__/props-not-destructured.input.tsx diff --git a/codemods/react/19/replace-default-props/__testfixtures__/props-not-destructured.output.tsx b/codemods-legacy/react/19/replace-default-props/__testfixtures__/props-not-destructured.output.tsx similarity index 100% rename from codemods/react/19/replace-default-props/__testfixtures__/props-not-destructured.output.tsx rename to codemods-legacy/react/19/replace-default-props/__testfixtures__/props-not-destructured.output.tsx diff --git a/codemods/react/19/replace-default-props/__testfixtures__/rest-element-example.input.jsx b/codemods-legacy/react/19/replace-default-props/__testfixtures__/rest-element-example.input.jsx similarity index 100% rename from codemods/react/19/replace-default-props/__testfixtures__/rest-element-example.input.jsx rename to codemods-legacy/react/19/replace-default-props/__testfixtures__/rest-element-example.input.jsx diff --git a/codemods/react/19/replace-default-props/__testfixtures__/rest-element-example.output.jsx b/codemods-legacy/react/19/replace-default-props/__testfixtures__/rest-element-example.output.jsx similarity index 100% rename from codemods/react/19/replace-default-props/__testfixtures__/rest-element-example.output.jsx rename to codemods-legacy/react/19/replace-default-props/__testfixtures__/rest-element-example.output.jsx diff --git a/codemods/react/19/replace-default-props/__testfixtures__/single-default-prop.input.tsx b/codemods-legacy/react/19/replace-default-props/__testfixtures__/single-default-prop.input.tsx similarity index 100% rename from codemods/react/19/replace-default-props/__testfixtures__/single-default-prop.input.tsx rename to codemods-legacy/react/19/replace-default-props/__testfixtures__/single-default-prop.input.tsx diff --git a/codemods/react/19/replace-default-props/__testfixtures__/single-default-prop.output.tsx b/codemods-legacy/react/19/replace-default-props/__testfixtures__/single-default-prop.output.tsx similarity index 100% rename from codemods/react/19/replace-default-props/__testfixtures__/single-default-prop.output.tsx rename to codemods-legacy/react/19/replace-default-props/__testfixtures__/single-default-prop.output.tsx diff --git a/codemods/react/19/replace-default-props/__testfixtures__/with-functions.input.tsx b/codemods-legacy/react/19/replace-default-props/__testfixtures__/with-functions.input.tsx similarity index 100% rename from codemods/react/19/replace-default-props/__testfixtures__/with-functions.input.tsx rename to codemods-legacy/react/19/replace-default-props/__testfixtures__/with-functions.input.tsx diff --git a/codemods/react/19/replace-default-props/__testfixtures__/with-functions.output.tsx b/codemods-legacy/react/19/replace-default-props/__testfixtures__/with-functions.output.tsx similarity index 100% rename from codemods/react/19/replace-default-props/__testfixtures__/with-functions.output.tsx rename to codemods-legacy/react/19/replace-default-props/__testfixtures__/with-functions.output.tsx diff --git a/codemods/react/19/replace-default-props/__testfixtures__/with-rest-props.input.tsx b/codemods-legacy/react/19/replace-default-props/__testfixtures__/with-rest-props.input.tsx similarity index 100% rename from codemods/react/19/replace-default-props/__testfixtures__/with-rest-props.input.tsx rename to codemods-legacy/react/19/replace-default-props/__testfixtures__/with-rest-props.input.tsx diff --git a/codemods/react/19/replace-default-props/__testfixtures__/with-rest-props.output.tsx b/codemods-legacy/react/19/replace-default-props/__testfixtures__/with-rest-props.output.tsx similarity index 100% rename from codemods/react/19/replace-default-props/__testfixtures__/with-rest-props.output.tsx rename to codemods-legacy/react/19/replace-default-props/__testfixtures__/with-rest-props.output.tsx diff --git a/codemods-legacy/react/19/replace-default-props/package.json b/codemods-legacy/react/19/replace-default-props/package.json new file mode 100644 index 00000000..7c2f134d --- /dev/null +++ b/codemods-legacy/react/19/replace-default-props/package.json @@ -0,0 +1,25 @@ +{ + "name": "react-19-replace-default-props", + "license": "MIT", + "private": true, + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:", + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "^5.2.2", + "vitest": "^1.0.1", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react/19/replace-default-props/src/index.ts b/codemods-legacy/react/19/replace-default-props/src/index.ts similarity index 100% rename from codemods/react/19/replace-default-props/src/index.ts rename to codemods-legacy/react/19/replace-default-props/src/index.ts diff --git a/codemods/react/19/replace-default-props/test/test.ts b/codemods-legacy/react/19/replace-default-props/test/test.ts similarity index 100% rename from codemods/react/19/replace-default-props/test/test.ts rename to codemods-legacy/react/19/replace-default-props/test/test.ts diff --git a/codemods-legacy/react/19/replace-default-props/tsconfig.json b/codemods-legacy/react/19/replace-default-props/tsconfig.json new file mode 100644 index 00000000..36bd1c7d --- /dev/null +++ b/codemods-legacy/react/19/replace-default-props/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@codemod-com/tsconfig/codemod.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "./dist" + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods-legacy/react/19/replace-default-props/vitest.config.ts b/codemods-legacy/react/19/replace-default-props/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react/19/replace-default-props/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/react/19/replace-react-test-renderer-import/.codemodrc.json b/codemods-legacy/react/19/replace-react-test-renderer-import/.codemodrc.json similarity index 100% rename from codemods/react/19/replace-react-test-renderer-import/.codemodrc.json rename to codemods-legacy/react/19/replace-react-test-renderer-import/.codemodrc.json diff --git a/codemods/react/19/replace-react-test-renderer-import/LICENSE b/codemods-legacy/react/19/replace-react-test-renderer-import/LICENSE similarity index 100% rename from codemods/react/19/replace-react-test-renderer-import/LICENSE rename to codemods-legacy/react/19/replace-react-test-renderer-import/LICENSE diff --git a/codemods/react/19/replace-react-test-renderer-import/README.md b/codemods-legacy/react/19/replace-react-test-renderer-import/README.md similarity index 100% rename from codemods/react/19/replace-react-test-renderer-import/README.md rename to codemods-legacy/react/19/replace-react-test-renderer-import/README.md diff --git a/codemods/react/19/replace-react-test-renderer-import/__testfixtures__/import-cjs.input.ts b/codemods-legacy/react/19/replace-react-test-renderer-import/__testfixtures__/import-cjs.input.ts similarity index 100% rename from codemods/react/19/replace-react-test-renderer-import/__testfixtures__/import-cjs.input.ts rename to codemods-legacy/react/19/replace-react-test-renderer-import/__testfixtures__/import-cjs.input.ts diff --git a/codemods/react/19/replace-react-test-renderer-import/__testfixtures__/import-cjs.output.ts b/codemods-legacy/react/19/replace-react-test-renderer-import/__testfixtures__/import-cjs.output.ts similarity index 100% rename from codemods/react/19/replace-react-test-renderer-import/__testfixtures__/import-cjs.output.ts rename to codemods-legacy/react/19/replace-react-test-renderer-import/__testfixtures__/import-cjs.output.ts diff --git a/codemods/react/19/replace-react-test-renderer-import/__testfixtures__/import-esm.input.ts b/codemods-legacy/react/19/replace-react-test-renderer-import/__testfixtures__/import-esm.input.ts similarity index 100% rename from codemods/react/19/replace-react-test-renderer-import/__testfixtures__/import-esm.input.ts rename to codemods-legacy/react/19/replace-react-test-renderer-import/__testfixtures__/import-esm.input.ts diff --git a/codemods/react/19/replace-react-test-renderer-import/__testfixtures__/import-esm.output.ts b/codemods-legacy/react/19/replace-react-test-renderer-import/__testfixtures__/import-esm.output.ts similarity index 100% rename from codemods/react/19/replace-react-test-renderer-import/__testfixtures__/import-esm.output.ts rename to codemods-legacy/react/19/replace-react-test-renderer-import/__testfixtures__/import-esm.output.ts diff --git a/codemods/react/19/replace-react-test-renderer-import/__testfixtures__/no-import.input.ts b/codemods-legacy/react/19/replace-react-test-renderer-import/__testfixtures__/no-import.input.ts similarity index 100% rename from codemods/react/19/replace-react-test-renderer-import/__testfixtures__/no-import.input.ts rename to codemods-legacy/react/19/replace-react-test-renderer-import/__testfixtures__/no-import.input.ts diff --git a/codemods-legacy/react/19/replace-react-test-renderer-import/package.json b/codemods-legacy/react/19/replace-react-test-renderer-import/package.json new file mode 100644 index 00000000..caadc926 --- /dev/null +++ b/codemods-legacy/react/19/replace-react-test-renderer-import/package.json @@ -0,0 +1,24 @@ +{ + "name": "react/19/replace-react-test-renderer-import", + "license": "MIT", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "^5.2.2", + "vitest": "^1.0.1", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "dmytrohryshyn" +} diff --git a/codemods/react/19/replace-react-test-renderer-import/src/index.ts b/codemods-legacy/react/19/replace-react-test-renderer-import/src/index.ts similarity index 100% rename from codemods/react/19/replace-react-test-renderer-import/src/index.ts rename to codemods-legacy/react/19/replace-react-test-renderer-import/src/index.ts diff --git a/codemods/react/19/replace-react-test-renderer-import/test/test.ts b/codemods-legacy/react/19/replace-react-test-renderer-import/test/test.ts similarity index 100% rename from codemods/react/19/replace-react-test-renderer-import/test/test.ts rename to codemods-legacy/react/19/replace-react-test-renderer-import/test/test.ts diff --git a/codemods-legacy/react/19/replace-react-test-renderer-import/tsconfig.json b/codemods-legacy/react/19/replace-react-test-renderer-import/tsconfig.json new file mode 100644 index 00000000..36bd1c7d --- /dev/null +++ b/codemods-legacy/react/19/replace-react-test-renderer-import/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@codemod-com/tsconfig/codemod.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "./dist" + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods-legacy/react/19/replace-react-test-renderer-import/vitest.config.ts b/codemods-legacy/react/19/replace-react-test-renderer-import/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react/19/replace-react-test-renderer-import/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/react/19/replace-reactdom-render/.codemodrc.json b/codemods-legacy/react/19/replace-reactdom-render/.codemodrc.json similarity index 100% rename from codemods/react/19/replace-reactdom-render/.codemodrc.json rename to codemods-legacy/react/19/replace-reactdom-render/.codemodrc.json diff --git a/codemods/react/19/replace-reactdom-render/.gitignore b/codemods-legacy/react/19/replace-reactdom-render/.gitignore similarity index 100% rename from codemods/react/19/replace-reactdom-render/.gitignore rename to codemods-legacy/react/19/replace-reactdom-render/.gitignore diff --git a/codemods/react/19/replace-reactdom-render/LICENSE b/codemods-legacy/react/19/replace-reactdom-render/LICENSE similarity index 100% rename from codemods/react/19/replace-reactdom-render/LICENSE rename to codemods-legacy/react/19/replace-reactdom-render/LICENSE diff --git a/codemods/react/19/replace-reactdom-render/README.md b/codemods-legacy/react/19/replace-reactdom-render/README.md similarity index 100% rename from codemods/react/19/replace-reactdom-render/README.md rename to codemods-legacy/react/19/replace-reactdom-render/README.md diff --git a/codemods/react/19/replace-reactdom-render/__testfixtures__/fixture1.input.js b/codemods-legacy/react/19/replace-reactdom-render/__testfixtures__/fixture1.input.js similarity index 100% rename from codemods/react/19/replace-reactdom-render/__testfixtures__/fixture1.input.js rename to codemods-legacy/react/19/replace-reactdom-render/__testfixtures__/fixture1.input.js diff --git a/codemods/react/19/replace-reactdom-render/__testfixtures__/fixture1.output.js b/codemods-legacy/react/19/replace-reactdom-render/__testfixtures__/fixture1.output.js similarity index 100% rename from codemods/react/19/replace-reactdom-render/__testfixtures__/fixture1.output.js rename to codemods-legacy/react/19/replace-reactdom-render/__testfixtures__/fixture1.output.js diff --git a/codemods/react/19/replace-reactdom-render/__testfixtures__/hydrate.input.js b/codemods-legacy/react/19/replace-reactdom-render/__testfixtures__/hydrate.input.js similarity index 100% rename from codemods/react/19/replace-reactdom-render/__testfixtures__/hydrate.input.js rename to codemods-legacy/react/19/replace-reactdom-render/__testfixtures__/hydrate.input.js diff --git a/codemods/react/19/replace-reactdom-render/__testfixtures__/hydrate.output.js b/codemods-legacy/react/19/replace-reactdom-render/__testfixtures__/hydrate.output.js similarity index 100% rename from codemods/react/19/replace-reactdom-render/__testfixtures__/hydrate.output.js rename to codemods-legacy/react/19/replace-reactdom-render/__testfixtures__/hydrate.output.js diff --git a/codemods/react/19/replace-reactdom-render/__testfixtures__/import.input.js b/codemods-legacy/react/19/replace-reactdom-render/__testfixtures__/import.input.js similarity index 100% rename from codemods/react/19/replace-reactdom-render/__testfixtures__/import.input.js rename to codemods-legacy/react/19/replace-reactdom-render/__testfixtures__/import.input.js diff --git a/codemods/react/19/replace-reactdom-render/__testfixtures__/import.output.js b/codemods-legacy/react/19/replace-reactdom-render/__testfixtures__/import.output.js similarity index 100% rename from codemods/react/19/replace-reactdom-render/__testfixtures__/import.output.js rename to codemods-legacy/react/19/replace-reactdom-render/__testfixtures__/import.output.js diff --git a/codemods/react/19/replace-reactdom-render/__testfixtures__/nested.input.js b/codemods-legacy/react/19/replace-reactdom-render/__testfixtures__/nested.input.js similarity index 100% rename from codemods/react/19/replace-reactdom-render/__testfixtures__/nested.input.js rename to codemods-legacy/react/19/replace-reactdom-render/__testfixtures__/nested.input.js diff --git a/codemods/react/19/replace-reactdom-render/__testfixtures__/nested.output.js b/codemods-legacy/react/19/replace-reactdom-render/__testfixtures__/nested.output.js similarity index 100% rename from codemods/react/19/replace-reactdom-render/__testfixtures__/nested.output.js rename to codemods-legacy/react/19/replace-reactdom-render/__testfixtures__/nested.output.js diff --git a/codemods/react/19/replace-reactdom-render/__testfixtures__/unmount.input.js b/codemods-legacy/react/19/replace-reactdom-render/__testfixtures__/unmount.input.js similarity index 100% rename from codemods/react/19/replace-reactdom-render/__testfixtures__/unmount.input.js rename to codemods-legacy/react/19/replace-reactdom-render/__testfixtures__/unmount.input.js diff --git a/codemods/react/19/replace-reactdom-render/__testfixtures__/unmount.output.js b/codemods-legacy/react/19/replace-reactdom-render/__testfixtures__/unmount.output.js similarity index 100% rename from codemods/react/19/replace-reactdom-render/__testfixtures__/unmount.output.js rename to codemods-legacy/react/19/replace-reactdom-render/__testfixtures__/unmount.output.js diff --git a/codemods-legacy/react/19/replace-reactdom-render/package.json b/codemods-legacy/react/19/replace-reactdom-render/package.json new file mode 100644 index 00000000..fe18e757 --- /dev/null +++ b/codemods-legacy/react/19/replace-reactdom-render/package.json @@ -0,0 +1,25 @@ +{ + "name": "react/19/replace-reactdom-render", + "author": "dmytrohryshyn", + "private": true, + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "5.2.2", + "vitest": "^1.0.1", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "license": "MIT", + "files": [ + "README.md", + ".codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react/19/replace-reactdom-render/src/index.ts b/codemods-legacy/react/19/replace-reactdom-render/src/index.ts similarity index 100% rename from codemods/react/19/replace-reactdom-render/src/index.ts rename to codemods-legacy/react/19/replace-reactdom-render/src/index.ts diff --git a/codemods/react/19/replace-reactdom-render/test/test.ts b/codemods-legacy/react/19/replace-reactdom-render/test/test.ts similarity index 100% rename from codemods/react/19/replace-reactdom-render/test/test.ts rename to codemods-legacy/react/19/replace-reactdom-render/test/test.ts diff --git a/codemods-legacy/react/19/replace-reactdom-render/tsconfig.json b/codemods-legacy/react/19/replace-reactdom-render/tsconfig.json new file mode 100644 index 00000000..36bd1c7d --- /dev/null +++ b/codemods-legacy/react/19/replace-reactdom-render/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@codemod-com/tsconfig/codemod.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "./dist" + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods-legacy/react/19/replace-reactdom-render/vitest.config.ts b/codemods-legacy/react/19/replace-reactdom-render/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react/19/replace-reactdom-render/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/react/19/replace-string-ref/.codemodrc.json b/codemods-legacy/react/19/replace-string-ref/.codemodrc.json similarity index 100% rename from codemods/react/19/replace-string-ref/.codemodrc.json rename to codemods-legacy/react/19/replace-string-ref/.codemodrc.json diff --git a/codemods/react/19/replace-string-ref/.gitignore b/codemods-legacy/react/19/replace-string-ref/.gitignore similarity index 100% rename from codemods/react/19/replace-string-ref/.gitignore rename to codemods-legacy/react/19/replace-string-ref/.gitignore diff --git a/codemods/react/19/replace-string-ref/LICENSE b/codemods-legacy/react/19/replace-string-ref/LICENSE similarity index 100% rename from codemods/react/19/replace-string-ref/LICENSE rename to codemods-legacy/react/19/replace-string-ref/LICENSE diff --git a/codemods/react/19/replace-string-ref/README.md b/codemods-legacy/react/19/replace-string-ref/README.md similarity index 100% rename from codemods/react/19/replace-string-ref/README.md rename to codemods-legacy/react/19/replace-string-ref/README.md diff --git a/codemods/react/19/replace-string-ref/__testfixtures__/class-component-custom-import-names.input.tsx b/codemods-legacy/react/19/replace-string-ref/__testfixtures__/class-component-custom-import-names.input.tsx similarity index 100% rename from codemods/react/19/replace-string-ref/__testfixtures__/class-component-custom-import-names.input.tsx rename to codemods-legacy/react/19/replace-string-ref/__testfixtures__/class-component-custom-import-names.input.tsx diff --git a/codemods/react/19/replace-string-ref/__testfixtures__/class-component-custom-import-names.output.tsx b/codemods-legacy/react/19/replace-string-ref/__testfixtures__/class-component-custom-import-names.output.tsx similarity index 100% rename from codemods/react/19/replace-string-ref/__testfixtures__/class-component-custom-import-names.output.tsx rename to codemods-legacy/react/19/replace-string-ref/__testfixtures__/class-component-custom-import-names.output.tsx diff --git a/codemods/react/19/replace-string-ref/__testfixtures__/class-component-default-import.input.tsx b/codemods-legacy/react/19/replace-string-ref/__testfixtures__/class-component-default-import.input.tsx similarity index 100% rename from codemods/react/19/replace-string-ref/__testfixtures__/class-component-default-import.input.tsx rename to codemods-legacy/react/19/replace-string-ref/__testfixtures__/class-component-default-import.input.tsx diff --git a/codemods/react/19/replace-string-ref/__testfixtures__/class-component-default-import.output.tsx b/codemods-legacy/react/19/replace-string-ref/__testfixtures__/class-component-default-import.output.tsx similarity index 100% rename from codemods/react/19/replace-string-ref/__testfixtures__/class-component-default-import.output.tsx rename to codemods-legacy/react/19/replace-string-ref/__testfixtures__/class-component-default-import.output.tsx diff --git a/codemods/react/19/replace-string-ref/__testfixtures__/class-component-named-import.input.tsx b/codemods-legacy/react/19/replace-string-ref/__testfixtures__/class-component-named-import.input.tsx similarity index 100% rename from codemods/react/19/replace-string-ref/__testfixtures__/class-component-named-import.input.tsx rename to codemods-legacy/react/19/replace-string-ref/__testfixtures__/class-component-named-import.input.tsx diff --git a/codemods/react/19/replace-string-ref/__testfixtures__/class-component-named-import.output.tsx b/codemods-legacy/react/19/replace-string-ref/__testfixtures__/class-component-named-import.output.tsx similarity index 100% rename from codemods/react/19/replace-string-ref/__testfixtures__/class-component-named-import.output.tsx rename to codemods-legacy/react/19/replace-string-ref/__testfixtures__/class-component-named-import.output.tsx diff --git a/codemods/react/19/replace-string-ref/__testfixtures__/function-component.input.tsx b/codemods-legacy/react/19/replace-string-ref/__testfixtures__/function-component.input.tsx similarity index 100% rename from codemods/react/19/replace-string-ref/__testfixtures__/function-component.input.tsx rename to codemods-legacy/react/19/replace-string-ref/__testfixtures__/function-component.input.tsx diff --git a/codemods/react/19/replace-string-ref/__testfixtures__/function-component.output.tsx b/codemods-legacy/react/19/replace-string-ref/__testfixtures__/function-component.output.tsx similarity index 100% rename from codemods/react/19/replace-string-ref/__testfixtures__/function-component.output.tsx rename to codemods-legacy/react/19/replace-string-ref/__testfixtures__/function-component.output.tsx diff --git a/codemods-legacy/react/19/replace-string-ref/package.json b/codemods-legacy/react/19/replace-string-ref/package.json new file mode 100644 index 00000000..c0f8ce49 --- /dev/null +++ b/codemods-legacy/react/19/replace-string-ref/package.json @@ -0,0 +1,25 @@ +{ + "name": "@codemod-com/codemod-react-19-replace-string-ref", + "author": "codemod", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react/19/replace-string-ref/src/index.ts b/codemods-legacy/react/19/replace-string-ref/src/index.ts similarity index 100% rename from codemods/react/19/replace-string-ref/src/index.ts rename to codemods-legacy/react/19/replace-string-ref/src/index.ts diff --git a/codemods/react/19/replace-string-ref/test/test.ts b/codemods-legacy/react/19/replace-string-ref/test/test.ts similarity index 100% rename from codemods/react/19/replace-string-ref/test/test.ts rename to codemods-legacy/react/19/replace-string-ref/test/test.ts diff --git a/codemods-legacy/react/19/replace-string-ref/tsconfig.json b/codemods-legacy/react/19/replace-string-ref/tsconfig.json new file mode 100644 index 00000000..36bd1c7d --- /dev/null +++ b/codemods-legacy/react/19/replace-string-ref/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@codemod-com/tsconfig/codemod.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "./dist" + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods-legacy/react/19/replace-string-ref/vitest.config.ts b/codemods-legacy/react/19/replace-string-ref/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react/19/replace-string-ref/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/react/19/replace-use-form-state/.codemodrc.json b/codemods-legacy/react/19/replace-use-form-state/.codemodrc.json similarity index 100% rename from codemods/react/19/replace-use-form-state/.codemodrc.json rename to codemods-legacy/react/19/replace-use-form-state/.codemodrc.json diff --git a/codemods/react/19/replace-use-form-state/README.md b/codemods-legacy/react/19/replace-use-form-state/README.md similarity index 100% rename from codemods/react/19/replace-use-form-state/README.md rename to codemods-legacy/react/19/replace-use-form-state/README.md diff --git a/codemods/react/19/replace-use-form-state/__testfixtures__/fixture1.input.js b/codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture1.input.js similarity index 100% rename from codemods/react/19/replace-use-form-state/__testfixtures__/fixture1.input.js rename to codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture1.input.js diff --git a/codemods/react/19/replace-use-form-state/__testfixtures__/fixture1.output.js b/codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture1.output.js similarity index 100% rename from codemods/react/19/replace-use-form-state/__testfixtures__/fixture1.output.js rename to codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture1.output.js diff --git a/codemods/react/19/replace-use-form-state/__testfixtures__/fixture2.input.js b/codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture2.input.js similarity index 100% rename from codemods/react/19/replace-use-form-state/__testfixtures__/fixture2.input.js rename to codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture2.input.js diff --git a/codemods/react/19/replace-use-form-state/__testfixtures__/fixture2.output.js b/codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture2.output.js similarity index 100% rename from codemods/react/19/replace-use-form-state/__testfixtures__/fixture2.output.js rename to codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture2.output.js diff --git a/codemods/react/19/replace-use-form-state/__testfixtures__/fixture3.input.js b/codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture3.input.js similarity index 100% rename from codemods/react/19/replace-use-form-state/__testfixtures__/fixture3.input.js rename to codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture3.input.js diff --git a/codemods/react/19/replace-use-form-state/__testfixtures__/fixture3.output.js b/codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture3.output.js similarity index 100% rename from codemods/react/19/replace-use-form-state/__testfixtures__/fixture3.output.js rename to codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture3.output.js diff --git a/codemods/react/19/replace-use-form-state/__testfixtures__/fixture4.input.js b/codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture4.input.js similarity index 100% rename from codemods/react/19/replace-use-form-state/__testfixtures__/fixture4.input.js rename to codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture4.input.js diff --git a/codemods/react/19/replace-use-form-state/__testfixtures__/fixture4.output.js b/codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture4.output.js similarity index 100% rename from codemods/react/19/replace-use-form-state/__testfixtures__/fixture4.output.js rename to codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture4.output.js diff --git a/codemods/react/19/replace-use-form-state/__testfixtures__/fixture5.input.js b/codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture5.input.js similarity index 100% rename from codemods/react/19/replace-use-form-state/__testfixtures__/fixture5.input.js rename to codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture5.input.js diff --git a/codemods/react/19/replace-use-form-state/__testfixtures__/fixture5.output.js b/codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture5.output.js similarity index 100% rename from codemods/react/19/replace-use-form-state/__testfixtures__/fixture5.output.js rename to codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture5.output.js diff --git a/codemods/react/19/replace-use-form-state/__testfixtures__/fixture6.input.js b/codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture6.input.js similarity index 100% rename from codemods/react/19/replace-use-form-state/__testfixtures__/fixture6.input.js rename to codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture6.input.js diff --git a/codemods/react/19/replace-use-form-state/__testfixtures__/fixture6.output.js b/codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture6.output.js similarity index 100% rename from codemods/react/19/replace-use-form-state/__testfixtures__/fixture6.output.js rename to codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture6.output.js diff --git a/codemods/react/19/replace-use-form-state/__testfixtures__/fixture7.input.js b/codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture7.input.js similarity index 100% rename from codemods/react/19/replace-use-form-state/__testfixtures__/fixture7.input.js rename to codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture7.input.js diff --git a/codemods/react/19/replace-use-form-state/__testfixtures__/fixture7.output.js b/codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture7.output.js similarity index 100% rename from codemods/react/19/replace-use-form-state/__testfixtures__/fixture7.output.js rename to codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture7.output.js diff --git a/codemods/react/19/replace-use-form-state/__testfixtures__/fixture8.input.js b/codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture8.input.js similarity index 100% rename from codemods/react/19/replace-use-form-state/__testfixtures__/fixture8.input.js rename to codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture8.input.js diff --git a/codemods/react/19/replace-use-form-state/__testfixtures__/fixture8.output.js b/codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture8.output.js similarity index 100% rename from codemods/react/19/replace-use-form-state/__testfixtures__/fixture8.output.js rename to codemods-legacy/react/19/replace-use-form-state/__testfixtures__/fixture8.output.js diff --git a/codemods-legacy/react/19/replace-use-form-state/package.json b/codemods-legacy/react/19/replace-use-form-state/package.json new file mode 100644 index 00000000..0f6ad6ba --- /dev/null +++ b/codemods-legacy/react/19/replace-use-form-state/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-react-replace-use-form-state", + "version": "1.0.7", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "^20.12.3", + "@types/jscodeshift": "^0.11.10", + "jscodeshift": "^0.15.1", + "typescript": "^5.2.2", + "vitest": "^1.0.1" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react/19/replace-use-form-state/src/index.ts b/codemods-legacy/react/19/replace-use-form-state/src/index.ts similarity index 100% rename from codemods/react/19/replace-use-form-state/src/index.ts rename to codemods-legacy/react/19/replace-use-form-state/src/index.ts diff --git a/codemods/react/19/replace-use-form-state/test/test.ts b/codemods-legacy/react/19/replace-use-form-state/test/test.ts similarity index 100% rename from codemods/react/19/replace-use-form-state/test/test.ts rename to codemods-legacy/react/19/replace-use-form-state/test/test.ts diff --git a/codemods-legacy/react/19/replace-use-form-state/tsconfig.json b/codemods-legacy/react/19/replace-use-form-state/tsconfig.json new file mode 100644 index 00000000..36bd1c7d --- /dev/null +++ b/codemods-legacy/react/19/replace-use-form-state/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@codemod-com/tsconfig/codemod.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "./dist" + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods-legacy/react/19/replace-use-form-state/vitest.config.ts b/codemods-legacy/react/19/replace-use-form-state/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react/19/replace-use-form-state/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/react/19/use-context-hook/.codemodrc.json b/codemods-legacy/react/19/use-context-hook/.codemodrc.json similarity index 100% rename from codemods/react/19/use-context-hook/.codemodrc.json rename to codemods-legacy/react/19/use-context-hook/.codemodrc.json diff --git a/codemods/react/19/use-context-hook/README.md b/codemods-legacy/react/19/use-context-hook/README.md similarity index 100% rename from codemods/react/19/use-context-hook/README.md rename to codemods-legacy/react/19/use-context-hook/README.md diff --git a/codemods-legacy/react/19/use-context-hook/package.json b/codemods-legacy/react/19/use-context-hook/package.json new file mode 100644 index 00000000..fa75b043 --- /dev/null +++ b/codemods-legacy/react/19/use-context-hook/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-react-19-use-context", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react/19/use-context-hook/src/index.ts b/codemods-legacy/react/19/use-context-hook/src/index.ts similarity index 100% rename from codemods/react/19/use-context-hook/src/index.ts rename to codemods-legacy/react/19/use-context-hook/src/index.ts diff --git a/codemods/react/19/use-context-hook/test/test.ts b/codemods-legacy/react/19/use-context-hook/test/test.ts similarity index 100% rename from codemods/react/19/use-context-hook/test/test.ts rename to codemods-legacy/react/19/use-context-hook/test/test.ts diff --git a/codemods/react/19/use-context-hook/tsconfig.json b/codemods-legacy/react/19/use-context-hook/tsconfig.json similarity index 100% rename from codemods/react/19/use-context-hook/tsconfig.json rename to codemods-legacy/react/19/use-context-hook/tsconfig.json diff --git a/codemods-legacy/react/19/use-context-hook/vitest.config.ts b/codemods-legacy/react/19/use-context-hook/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react/19/use-context-hook/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/react/create-element-to-jsx/.codemodrc.json b/codemods-legacy/react/create-element-to-jsx/.codemodrc.json similarity index 100% rename from codemods/react/create-element-to-jsx/.codemodrc.json rename to codemods-legacy/react/create-element-to-jsx/.codemodrc.json diff --git a/codemods/react/create-element-to-jsx/.gitignore b/codemods-legacy/react/create-element-to-jsx/.gitignore similarity index 100% rename from codemods/react/create-element-to-jsx/.gitignore rename to codemods-legacy/react/create-element-to-jsx/.gitignore diff --git a/codemods/react/create-element-to-jsx/LICENSE b/codemods-legacy/react/create-element-to-jsx/LICENSE similarity index 100% rename from codemods/react/create-element-to-jsx/LICENSE rename to codemods-legacy/react/create-element-to-jsx/LICENSE diff --git a/codemods/react/create-element-to-jsx/README.md b/codemods-legacy/react/create-element-to-jsx/README.md similarity index 100% rename from codemods/react/create-element-to-jsx/README.md rename to codemods-legacy/react/create-element-to-jsx/README.md diff --git a/codemods/react/create-element-to-jsx/__testfixtures__/fixture1.input.jsx b/codemods-legacy/react/create-element-to-jsx/__testfixtures__/fixture1.input.jsx similarity index 100% rename from codemods/react/create-element-to-jsx/__testfixtures__/fixture1.input.jsx rename to codemods-legacy/react/create-element-to-jsx/__testfixtures__/fixture1.input.jsx diff --git a/codemods/react/create-element-to-jsx/__testfixtures__/fixture1.output.jsx b/codemods-legacy/react/create-element-to-jsx/__testfixtures__/fixture1.output.jsx similarity index 100% rename from codemods/react/create-element-to-jsx/__testfixtures__/fixture1.output.jsx rename to codemods-legacy/react/create-element-to-jsx/__testfixtures__/fixture1.output.jsx diff --git a/codemods/react/create-element-to-jsx/__testfixtures__/fixture2.input.jsx b/codemods-legacy/react/create-element-to-jsx/__testfixtures__/fixture2.input.jsx similarity index 100% rename from codemods/react/create-element-to-jsx/__testfixtures__/fixture2.input.jsx rename to codemods-legacy/react/create-element-to-jsx/__testfixtures__/fixture2.input.jsx diff --git a/codemods/react/create-element-to-jsx/__testfixtures__/fixture2.output.jsx b/codemods-legacy/react/create-element-to-jsx/__testfixtures__/fixture2.output.jsx similarity index 100% rename from codemods/react/create-element-to-jsx/__testfixtures__/fixture2.output.jsx rename to codemods-legacy/react/create-element-to-jsx/__testfixtures__/fixture2.output.jsx diff --git a/codemods/react/create-element-to-jsx/__testfixtures__/fixture3.input.jsx b/codemods-legacy/react/create-element-to-jsx/__testfixtures__/fixture3.input.jsx similarity index 100% rename from codemods/react/create-element-to-jsx/__testfixtures__/fixture3.input.jsx rename to codemods-legacy/react/create-element-to-jsx/__testfixtures__/fixture3.input.jsx diff --git a/codemods/react/create-element-to-jsx/__testfixtures__/fixture3.output.jsx b/codemods-legacy/react/create-element-to-jsx/__testfixtures__/fixture3.output.jsx similarity index 100% rename from codemods/react/create-element-to-jsx/__testfixtures__/fixture3.output.jsx rename to codemods-legacy/react/create-element-to-jsx/__testfixtures__/fixture3.output.jsx diff --git a/codemods-legacy/react/create-element-to-jsx/package.json b/codemods-legacy/react/create-element-to-jsx/package.json new file mode 100644 index 00000000..d5095442 --- /dev/null +++ b/codemods-legacy/react/create-element-to-jsx/package.json @@ -0,0 +1,25 @@ +{ + "name": "create-element-to-jsx", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "jscodeshift": "^0.15.1", + "typescript": "^5.2.2", + "vitest": "^1.0.1" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "amirabbas-gh", + "dependencies": { + "ast-types": "^0.14.2" + } +} diff --git a/codemods-legacy/react/create-element-to-jsx/src/index.js b/codemods-legacy/react/create-element-to-jsx/src/index.js new file mode 100644 index 00000000..f34d8d58 --- /dev/null +++ b/codemods-legacy/react/create-element-to-jsx/src/index.js @@ -0,0 +1,272 @@ +const hasModule = (j, path, module) => + path + .findVariableDeclarators() + .filter(j.filters.VariableDeclarator.requiresModule(module)) + .size() === 1 || + path + .find(j.ImportDeclaration, { + type: 'ImportDeclaration', + source: { + type: 'Literal', + }, + }) + .filter(declarator => declarator.value.source.value === module) + .size() === 1; + +const hasReact = (j, path) => ( + hasModule(j, path, 'React') || + hasModule(j, path, 'react') || + hasModule(j, path, 'react/addons') || + hasModule(j, path, 'react-native') +); + +export default function transform(file, api, options) { + const j = api.jscodeshift; + const printOptions = options.printOptions || {}; + const root = j(file.source); + const encodeJSXTextValue = (value) => + value.replace(//g, ">"); + + const canLiteralBePropString = (node) => + node.raw.indexOf("\\") === -1 && node.value.indexOf('"') === -1; + + const convertExpressionToJSXAttributes = (expression) => { + if (!expression) { + return { + attributes: [], + extraComments: [], + }; + } + + const isReactSpread = + expression.type === "CallExpression" && + expression.callee.type === "MemberExpression" && + expression.callee.object.name === "React" && + expression.callee.property.name === "__spread"; + + const isObjectAssign = + expression.type === "CallExpression" && + expression.callee.type === "MemberExpression" && + expression.callee.object.name === "Object" && + expression.callee.property.name === "assign"; + + const validSpreadTypes = [ + "Identifier", + "MemberExpression", + "CallExpression", + ]; + + if (isReactSpread || isObjectAssign) { + const resultAttributes = []; + const resultExtraComments = expression.comments || []; + const { callee } = expression; + for (const node of [callee, callee.object, callee.property]) { + resultExtraComments.push(...(node.comments || [])); + } + expression.arguments.forEach((expression) => { + const { attributes, extraComments } = + convertExpressionToJSXAttributes(expression); + resultAttributes.push(...attributes); + resultExtraComments.push(...extraComments); + }); + + return { + attributes: resultAttributes, + extraComments: resultExtraComments, + }; + } else if (validSpreadTypes.indexOf(expression.type) != -1) { + return { + attributes: [j.jsxSpreadAttribute(expression)], + extraComments: [], + }; + } else if (expression.type === "ObjectExpression") { + const attributes = expression.properties.map((property) => { + if (property.type === "SpreadProperty") { + const spreadAttribute = j.jsxSpreadAttribute(property.argument); + spreadAttribute.comments = property.comments; + return spreadAttribute; + } else if (property.type === "Property") { + const propertyValueType = property.value.type; + + let value; + if ( + propertyValueType === "Literal" && + typeof property.value.value === "string" && + canLiteralBePropString(property.value) + ) { + value = j.literal(property.value.value); + value.comments = property.value.comments; + } else { + value = j.jsxExpressionContainer(property.value); + } + + let jsxIdentifier; + if (property.key.type === "Literal") { + jsxIdentifier = j.jsxIdentifier(property.key.value); + } else { + jsxIdentifier = j.jsxIdentifier(property.key.name); + } + jsxIdentifier.comments = property.key.comments; + + const jsxAttribute = j.jsxAttribute(jsxIdentifier, value); + jsxAttribute.comments = property.comments; + return jsxAttribute; + } + return null; + }); + + return { + attributes, + extraComments: expression.comments || [], + }; + } else if (expression.type === "Literal" && expression.value === null) { + return { + attributes: [], + extraComments: expression.comments || [], + }; + } else { + throw new Error(`Unexpected attribute of type "${expression.type}"`); + } + }; + + const canConvertToJSXIdentifier = (node) => + (node.type === "Literal" && typeof node.value === "string") || + node.type === "Identifier" || + (node.type === "MemberExpression" && + !node.computed && + canConvertToJSXIdentifier(node.object) && + canConvertToJSXIdentifier(node.property)); + + const jsxIdentifierFor = (node) => { + let identifier; + let comments = node.comments || []; + if (node.type === "Literal") { + identifier = j.jsxIdentifier(node.value); + } else if (node.type === "MemberExpression") { + let { identifier: objectIdentifier, comments: objectComments } = + jsxIdentifierFor(node.object); + let { identifier: propertyIdentifier, comments: propertyComments } = + jsxIdentifierFor(node.property); + identifier = j.jsxMemberExpression(objectIdentifier, propertyIdentifier); + comments.push(...objectComments, ...propertyComments); + } else { + identifier = j.jsxIdentifier(node.name); + } + return { identifier, comments }; + }; + + const isCapitalizationInvalid = (node) => + (node.type === "Literal" && !/^[a-z]/.test(node.value)) || + (node.type === "Identifier" && /^[a-z]/.test(node.name)); + + const convertNodeToJSX = (node) => { + const comments = node.value.comments || []; + const { callee } = node.value; + for (const calleeNode of [callee, callee.object, callee.property]) { + for (const comment of calleeNode.comments || []) { + comment.leading = true; + comment.trailing = false; + comments.push(comment); + } + } + + const args = node.value.arguments; + + if ( + isCapitalizationInvalid(args[0]) || + !canConvertToJSXIdentifier(args[0]) + ) { + return node.value; + } + + const { identifier: jsxIdentifier, comments: identifierComments } = + jsxIdentifierFor(args[0]); + const props = args[1]; + + const { attributes, extraComments } = + convertExpressionToJSXAttributes(props); + + for (const comment of [...identifierComments, ...extraComments]) { + comment.leading = false; + comment.trailing = true; + comments.push(comment); + } + + const children = args.slice(2).map((child, index) => { + if ( + child.type === "Literal" && + typeof child.value === "string" && + !child.comments && + child.value !== "" && + child.value.trim() === child.value + ) { + return j.jsxText(encodeJSXTextValue(child.value)); + } else if ( + child.type === "CallExpression" && + child.callee.object && + child.callee.object.name === "React" && + child.callee.property.name === "createElement" + ) { + const jsxChild = convertNodeToJSX(node.get("arguments", index + 2)); + if ( + jsxChild.type !== "JSXElement" || + (jsxChild.comments || []).length > 0 + ) { + return j.jsxExpressionContainer(jsxChild); + } else { + return jsxChild; + } + } else if (child.type === "SpreadElement") { + return j.jsxExpressionContainer(child.argument); + } else { + return j.jsxExpressionContainer(child); + } + }); + + const openingElement = j.jsxOpeningElement(jsxIdentifier, attributes); + + if (children.length) { + const endIdentifier = Object.assign({}, jsxIdentifier, { comments: [] }); + // Add text newline nodes between elements so recast formats one child per + // line instead of all children on one line. + const paddedChildren = [j.jsxText("\n")]; + for (const child of children) { + paddedChildren.push(child, j.jsxText("\n")); + } + const element = j.jsxElement( + openingElement, + j.jsxClosingElement(endIdentifier), + paddedChildren, + ); + element.comments = comments; + return element; + } else { + openingElement.selfClosing = true; + const element = j.jsxElement(openingElement); + element.comments = comments; + return element; + } + }; + + if (options["explicit-require"] === false || hasReact(j, root)) { + const mutations = root + .find(j.CallExpression, { + callee: { + object: { + name: "React", + }, + property: { + name: "createElement", + }, + }, + }) + .replaceWith(convertNodeToJSX) + .size(); + + if (mutations) { + return root.toSource(printOptions); + } + } + + return null; +}; diff --git a/codemods/react/create-element-to-jsx/test/test.ts b/codemods-legacy/react/create-element-to-jsx/test/test.ts similarity index 100% rename from codemods/react/create-element-to-jsx/test/test.ts rename to codemods-legacy/react/create-element-to-jsx/test/test.ts diff --git a/codemods-legacy/react/create-element-to-jsx/tsconfig.json b/codemods-legacy/react/create-element-to-jsx/tsconfig.json new file mode 100644 index 00000000..1f37b071 --- /dev/null +++ b/codemods-legacy/react/create-element-to-jsx/tsconfig.json @@ -0,0 +1,33 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js", + "src/index.cjs" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods-legacy/react/create-element-to-jsx/vitest.config.ts b/codemods-legacy/react/create-element-to-jsx/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react/create-element-to-jsx/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/react/prop-types-typescript/.codemodrc.json b/codemods-legacy/react/prop-types-typescript/.codemodrc.json similarity index 100% rename from codemods/react/prop-types-typescript/.codemodrc.json rename to codemods-legacy/react/prop-types-typescript/.codemodrc.json diff --git a/codemods/react/prop-types-typescript/README.md b/codemods-legacy/react/prop-types-typescript/README.md similarity index 100% rename from codemods/react/prop-types-typescript/README.md rename to codemods-legacy/react/prop-types-typescript/README.md diff --git a/codemods-legacy/react/prop-types-typescript/package.json b/codemods-legacy/react/prop-types-typescript/package.json new file mode 100644 index 00000000..201a0979 --- /dev/null +++ b/codemods-legacy/react/prop-types-typescript/package.json @@ -0,0 +1,24 @@ +{ + "name": "@codemod-com/codemod-react-prop-types-typescript", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1", + "ast-types": "^0.15.0" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react/prop-types-typescript/src/index.ts b/codemods-legacy/react/prop-types-typescript/src/index.ts similarity index 100% rename from codemods/react/prop-types-typescript/src/index.ts rename to codemods-legacy/react/prop-types-typescript/src/index.ts diff --git a/codemods/react/prop-types-typescript/test/test.ts b/codemods-legacy/react/prop-types-typescript/test/test.ts similarity index 100% rename from codemods/react/prop-types-typescript/test/test.ts rename to codemods-legacy/react/prop-types-typescript/test/test.ts diff --git a/codemods/react/prop-types-typescript/tsconfig.json b/codemods-legacy/react/prop-types-typescript/tsconfig.json similarity index 100% rename from codemods/react/prop-types-typescript/tsconfig.json rename to codemods-legacy/react/prop-types-typescript/tsconfig.json diff --git a/codemods-legacy/react/prop-types-typescript/vitest.config.ts b/codemods-legacy/react/prop-types-typescript/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react/prop-types-typescript/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/react/replace-react-fc-typescript/.codemodrc.json b/codemods-legacy/react/replace-react-fc-typescript/.codemodrc.json similarity index 100% rename from codemods/react/replace-react-fc-typescript/.codemodrc.json rename to codemods-legacy/react/replace-react-fc-typescript/.codemodrc.json diff --git a/codemods/react/replace-react-fc-typescript/README.md b/codemods-legacy/react/replace-react-fc-typescript/README.md similarity index 100% rename from codemods/react/replace-react-fc-typescript/README.md rename to codemods-legacy/react/replace-react-fc-typescript/README.md diff --git a/codemods-legacy/react/replace-react-fc-typescript/package.json b/codemods-legacy/react/replace-react-fc-typescript/package.json new file mode 100644 index 00000000..228ab570 --- /dev/null +++ b/codemods-legacy/react/replace-react-fc-typescript/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/codemod-react-replace-react-fc-typescript", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/react/replace-react-fc-typescript/src/index.ts b/codemods-legacy/react/replace-react-fc-typescript/src/index.ts similarity index 100% rename from codemods/react/replace-react-fc-typescript/src/index.ts rename to codemods-legacy/react/replace-react-fc-typescript/src/index.ts diff --git a/codemods/react/replace-react-fc-typescript/test/test.ts b/codemods-legacy/react/replace-react-fc-typescript/test/test.ts similarity index 100% rename from codemods/react/replace-react-fc-typescript/test/test.ts rename to codemods-legacy/react/replace-react-fc-typescript/test/test.ts diff --git a/codemods/react/replace-react-fc-typescript/tsconfig.json b/codemods-legacy/react/replace-react-fc-typescript/tsconfig.json similarity index 100% rename from codemods/react/replace-react-fc-typescript/tsconfig.json rename to codemods-legacy/react/replace-react-fc-typescript/tsconfig.json diff --git a/codemods-legacy/react/replace-react-fc-typescript/vitest.config.ts b/codemods-legacy/react/replace-react-fc-typescript/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react/replace-react-fc-typescript/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/react/update-react-imports/.codemodrc.json b/codemods-legacy/react/update-react-imports/.codemodrc.json similarity index 100% rename from codemods/react/update-react-imports/.codemodrc.json rename to codemods-legacy/react/update-react-imports/.codemodrc.json diff --git a/codemods/react/update-react-imports/.gitignore b/codemods-legacy/react/update-react-imports/.gitignore similarity index 100% rename from codemods/react/update-react-imports/.gitignore rename to codemods-legacy/react/update-react-imports/.gitignore diff --git a/codemods/react/update-react-imports/README.md b/codemods-legacy/react/update-react-imports/README.md similarity index 100% rename from codemods/react/update-react-imports/README.md rename to codemods-legacy/react/update-react-imports/README.md diff --git a/codemods/react/update-react-imports/__testfixtures__/any-import.input.tsx b/codemods-legacy/react/update-react-imports/__testfixtures__/any-import.input.tsx similarity index 100% rename from codemods/react/update-react-imports/__testfixtures__/any-import.input.tsx rename to codemods-legacy/react/update-react-imports/__testfixtures__/any-import.input.tsx diff --git a/codemods/react/update-react-imports/__testfixtures__/any-import.output.tsx b/codemods-legacy/react/update-react-imports/__testfixtures__/any-import.output.tsx similarity index 100% rename from codemods/react/update-react-imports/__testfixtures__/any-import.output.tsx rename to codemods-legacy/react/update-react-imports/__testfixtures__/any-import.output.tsx diff --git a/codemods/react/update-react-imports/__testfixtures__/default-import.input.tsx b/codemods-legacy/react/update-react-imports/__testfixtures__/default-import.input.tsx similarity index 100% rename from codemods/react/update-react-imports/__testfixtures__/default-import.input.tsx rename to codemods-legacy/react/update-react-imports/__testfixtures__/default-import.input.tsx diff --git a/codemods/react/update-react-imports/__testfixtures__/default-import.output.tsx b/codemods-legacy/react/update-react-imports/__testfixtures__/default-import.output.tsx similarity index 100% rename from codemods/react/update-react-imports/__testfixtures__/default-import.output.tsx rename to codemods-legacy/react/update-react-imports/__testfixtures__/default-import.output.tsx diff --git a/codemods/react/update-react-imports/__testfixtures__/namespace-import.input.tsx b/codemods-legacy/react/update-react-imports/__testfixtures__/namespace-import.input.tsx similarity index 100% rename from codemods/react/update-react-imports/__testfixtures__/namespace-import.input.tsx rename to codemods-legacy/react/update-react-imports/__testfixtures__/namespace-import.input.tsx diff --git a/codemods/react/update-react-imports/__testfixtures__/namespace-import.output.tsx b/codemods-legacy/react/update-react-imports/__testfixtures__/namespace-import.output.tsx similarity index 100% rename from codemods/react/update-react-imports/__testfixtures__/namespace-import.output.tsx rename to codemods-legacy/react/update-react-imports/__testfixtures__/namespace-import.output.tsx diff --git a/codemods/react/update-react-imports/__testfixtures__/preserve-comments.input.tsx b/codemods-legacy/react/update-react-imports/__testfixtures__/preserve-comments.input.tsx similarity index 100% rename from codemods/react/update-react-imports/__testfixtures__/preserve-comments.input.tsx rename to codemods-legacy/react/update-react-imports/__testfixtures__/preserve-comments.input.tsx diff --git a/codemods/react/update-react-imports/__testfixtures__/preserve-comments.output.tsx b/codemods-legacy/react/update-react-imports/__testfixtures__/preserve-comments.output.tsx similarity index 100% rename from codemods/react/update-react-imports/__testfixtures__/preserve-comments.output.tsx rename to codemods-legacy/react/update-react-imports/__testfixtures__/preserve-comments.output.tsx diff --git a/codemods/react/update-react-imports/__testfixtures__/satisfies-import.input.tsx b/codemods-legacy/react/update-react-imports/__testfixtures__/satisfies-import.input.tsx similarity index 100% rename from codemods/react/update-react-imports/__testfixtures__/satisfies-import.input.tsx rename to codemods-legacy/react/update-react-imports/__testfixtures__/satisfies-import.input.tsx diff --git a/codemods/react/update-react-imports/__testfixtures__/satisfies-import.output.tsx b/codemods-legacy/react/update-react-imports/__testfixtures__/satisfies-import.output.tsx similarity index 100% rename from codemods/react/update-react-imports/__testfixtures__/satisfies-import.output.tsx rename to codemods-legacy/react/update-react-imports/__testfixtures__/satisfies-import.output.tsx diff --git a/codemods/react/update-react-imports/__testfixtures__/satisfies2-import.input.tsx b/codemods-legacy/react/update-react-imports/__testfixtures__/satisfies2-import.input.tsx similarity index 100% rename from codemods/react/update-react-imports/__testfixtures__/satisfies2-import.input.tsx rename to codemods-legacy/react/update-react-imports/__testfixtures__/satisfies2-import.input.tsx diff --git a/codemods/react/update-react-imports/__testfixtures__/satisfies2-import.output.tsx b/codemods-legacy/react/update-react-imports/__testfixtures__/satisfies2-import.output.tsx similarity index 100% rename from codemods/react/update-react-imports/__testfixtures__/satisfies2-import.output.tsx rename to codemods-legacy/react/update-react-imports/__testfixtures__/satisfies2-import.output.tsx diff --git a/codemods/react/update-react-imports/__testfixtures__/type-import.input.tsx b/codemods-legacy/react/update-react-imports/__testfixtures__/type-import.input.tsx similarity index 100% rename from codemods/react/update-react-imports/__testfixtures__/type-import.input.tsx rename to codemods-legacy/react/update-react-imports/__testfixtures__/type-import.input.tsx diff --git a/codemods/react/update-react-imports/__testfixtures__/type-import.output.tsx b/codemods-legacy/react/update-react-imports/__testfixtures__/type-import.output.tsx similarity index 100% rename from codemods/react/update-react-imports/__testfixtures__/type-import.output.tsx rename to codemods-legacy/react/update-react-imports/__testfixtures__/type-import.output.tsx diff --git a/codemods/react/update-react-imports/cdmd_dist/index.js b/codemods-legacy/react/update-react-imports/cdmd_dist/index.js similarity index 100% rename from codemods/react/update-react-imports/cdmd_dist/index.js rename to codemods-legacy/react/update-react-imports/cdmd_dist/index.js diff --git a/codemods-legacy/react/update-react-imports/package.json b/codemods-legacy/react/update-react-imports/package.json new file mode 100644 index 00000000..67b7e01d --- /dev/null +++ b/codemods-legacy/react/update-react-imports/package.json @@ -0,0 +1,28 @@ +{ + "name": "react-update-react-imports", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "20.9.0", + "jscodeshift": "^0.15.1", + "typescript": "^5.2.2", + "vitest": "^1.0.1" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "amirabbas-gh", + "dependencies": { + "@types/react": "^19.0.1", + "react": "^19.0.0" + } +} diff --git a/codemods/react/update-react-imports/src/index.ts b/codemods-legacy/react/update-react-imports/src/index.ts similarity index 100% rename from codemods/react/update-react-imports/src/index.ts rename to codemods-legacy/react/update-react-imports/src/index.ts diff --git a/codemods/react/update-react-imports/test/test.ts b/codemods-legacy/react/update-react-imports/test/test.ts similarity index 100% rename from codemods/react/update-react-imports/test/test.ts rename to codemods-legacy/react/update-react-imports/test/test.ts diff --git a/codemods-legacy/react/update-react-imports/tsconfig.json b/codemods-legacy/react/update-react-imports/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/react/update-react-imports/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods-legacy/react/update-react-imports/vitest.config.ts b/codemods-legacy/react/update-react-imports/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/react/update-react-imports/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/redwoodjs/core/4/auth-decoder/.codemodrc.json b/codemods-legacy/redwoodjs/core/4/auth-decoder/.codemodrc.json similarity index 100% rename from codemods/redwoodjs/core/4/auth-decoder/.codemodrc.json rename to codemods-legacy/redwoodjs/core/4/auth-decoder/.codemodrc.json diff --git a/codemods/redwoodjs/core/4/auth-decoder/README.md b/codemods-legacy/redwoodjs/core/4/auth-decoder/README.md similarity index 100% rename from codemods/redwoodjs/core/4/auth-decoder/README.md rename to codemods-legacy/redwoodjs/core/4/auth-decoder/README.md diff --git a/codemods/redwoodjs/core/4/auth-decoder/__testfixtures__/input.js b/codemods-legacy/redwoodjs/core/4/auth-decoder/__testfixtures__/input.js similarity index 100% rename from codemods/redwoodjs/core/4/auth-decoder/__testfixtures__/input.js rename to codemods-legacy/redwoodjs/core/4/auth-decoder/__testfixtures__/input.js diff --git a/codemods/redwoodjs/core/4/auth-decoder/__testfixtures__/output.js b/codemods-legacy/redwoodjs/core/4/auth-decoder/__testfixtures__/output.js similarity index 100% rename from codemods/redwoodjs/core/4/auth-decoder/__testfixtures__/output.js rename to codemods-legacy/redwoodjs/core/4/auth-decoder/__testfixtures__/output.js diff --git a/codemods-legacy/redwoodjs/core/4/auth-decoder/package.json b/codemods-legacy/redwoodjs/core/4/auth-decoder/package.json new file mode 100644 index 00000000..0e72d8dd --- /dev/null +++ b/codemods-legacy/redwoodjs/core/4/auth-decoder/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-redwoodjs-core-4-auth-decoder", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/redwoodjs/core/4/auth-decoder/src/index.ts b/codemods-legacy/redwoodjs/core/4/auth-decoder/src/index.ts similarity index 100% rename from codemods/redwoodjs/core/4/auth-decoder/src/index.ts rename to codemods-legacy/redwoodjs/core/4/auth-decoder/src/index.ts diff --git a/codemods-legacy/redwoodjs/core/4/auth-decoder/test/test.ts b/codemods-legacy/redwoodjs/core/4/auth-decoder/test/test.ts new file mode 100644 index 00000000..7a8fc984 --- /dev/null +++ b/codemods-legacy/redwoodjs/core/4/auth-decoder/test/test.ts @@ -0,0 +1,51 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; +import { readFile } from "node:fs/promises"; +import { join } from "node:path"; +import { fileURLToPath } from "node:url"; +import jscodeshift from "jscodeshift"; +import type { API, FileInfo } from "jscodeshift"; +import transform from "../src/index.ts"; + +const __dirname = fileURLToPath(new URL(".", import.meta.url)); + +describe("@redwoodjs/core v4 auth-decoder", () => { + it("should add authDecoder", async () => { + const input = await readFile(join(__dirname, "../__testfixtures__/input.js"), { + encoding: "utf8", + }); + + const output = await readFile(join(__dirname, "../__testfixtures__/output.js"), { + encoding: "utf8", + }); + + const fileInfo: FileInfo = { + path: "index.js", + source: input, + }; + + const buildApi = (parser: string): API => ({ + j: jscodeshift.withParser(parser), + jscodeshift: jscodeshift.withParser(parser), + stats: () => { + console.error( + "The stats function was called, which is not supported on purpose", + ); + }, + report: () => { + console.error( + "The report function was called, which is not supported on purpose", + ); + }, + }); + + const actualOutput = transform(fileInfo, buildApi("js"), { + quote: "single", + }); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + output.replace(/\W/gm, ""), + ); + }); +}); diff --git a/codemods/redwoodjs/core/4/auth-decoder/tsconfig.json b/codemods-legacy/redwoodjs/core/4/auth-decoder/tsconfig.json similarity index 100% rename from codemods/redwoodjs/core/4/auth-decoder/tsconfig.json rename to codemods-legacy/redwoodjs/core/4/auth-decoder/tsconfig.json diff --git a/codemods/redwoodjs/core/4/redwood-apollo-provider/.codemodrc.json b/codemods-legacy/redwoodjs/core/4/redwood-apollo-provider/.codemodrc.json similarity index 100% rename from codemods/redwoodjs/core/4/redwood-apollo-provider/.codemodrc.json rename to codemods-legacy/redwoodjs/core/4/redwood-apollo-provider/.codemodrc.json diff --git a/codemods/redwoodjs/core/4/redwood-apollo-provider/README.md b/codemods-legacy/redwoodjs/core/4/redwood-apollo-provider/README.md similarity index 100% rename from codemods/redwoodjs/core/4/redwood-apollo-provider/README.md rename to codemods-legacy/redwoodjs/core/4/redwood-apollo-provider/README.md diff --git a/codemods/redwoodjs/core/4/redwood-apollo-provider/__testfixtures__/input.js b/codemods-legacy/redwoodjs/core/4/redwood-apollo-provider/__testfixtures__/input.js similarity index 100% rename from codemods/redwoodjs/core/4/redwood-apollo-provider/__testfixtures__/input.js rename to codemods-legacy/redwoodjs/core/4/redwood-apollo-provider/__testfixtures__/input.js diff --git a/codemods/redwoodjs/core/4/redwood-apollo-provider/__testfixtures__/output.js b/codemods-legacy/redwoodjs/core/4/redwood-apollo-provider/__testfixtures__/output.js similarity index 100% rename from codemods/redwoodjs/core/4/redwood-apollo-provider/__testfixtures__/output.js rename to codemods-legacy/redwoodjs/core/4/redwood-apollo-provider/__testfixtures__/output.js diff --git a/codemods-legacy/redwoodjs/core/4/redwood-apollo-provider/package.json b/codemods-legacy/redwoodjs/core/4/redwood-apollo-provider/package.json new file mode 100644 index 00000000..a2e1f75c --- /dev/null +++ b/codemods-legacy/redwoodjs/core/4/redwood-apollo-provider/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-redwoodjs-core-4-redwood-apollo-provider", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/redwoodjs/core/4/redwood-apollo-provider/src/index.ts b/codemods-legacy/redwoodjs/core/4/redwood-apollo-provider/src/index.ts similarity index 100% rename from codemods/redwoodjs/core/4/redwood-apollo-provider/src/index.ts rename to codemods-legacy/redwoodjs/core/4/redwood-apollo-provider/src/index.ts diff --git a/codemods-legacy/redwoodjs/core/4/redwood-apollo-provider/test/test.ts b/codemods-legacy/redwoodjs/core/4/redwood-apollo-provider/test/test.ts new file mode 100644 index 00000000..c3bc1fb2 --- /dev/null +++ b/codemods-legacy/redwoodjs/core/4/redwood-apollo-provider/test/test.ts @@ -0,0 +1,51 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; +import { readFile } from "node:fs/promises"; +import { join } from "node:path"; +import { fileURLToPath } from "node:url"; +import jscodeshift from "jscodeshift"; +import type { API, FileInfo } from "jscodeshift"; +import transform from "../src/index.ts"; + +const __dirname = fileURLToPath(new URL(".", import.meta.url)); + +describe("@redwoodjs/core v4 redwood-apollo-provider", () => { + it("should add AuthProvider and useAuth", async () => { + const input = await readFile(join(__dirname, "../__testfixtures__/input.js"), { + encoding: "utf8", + }); + + const output = await readFile(join(__dirname, "../__testfixtures__/output.js"), { + encoding: "utf8", + }); + + const fileInfo: FileInfo = { + path: "index.js", + source: input, + }; + + const buildApi = (parser: string): API => ({ + j: jscodeshift.withParser(parser), + jscodeshift: jscodeshift.withParser(parser), + stats: () => { + console.error( + "The stats function was called, which is not supported on purpose", + ); + }, + report: () => { + console.error( + "The report function was called, which is not supported on purpose", + ); + }, + }); + + const actualOutput = transform(fileInfo, buildApi("js"), { + quote: "single", + }); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + output.replace(/\W/gm, ""), + ); + }); +}); diff --git a/codemods/redwoodjs/core/4/redwood-apollo-provider/tsconfig.json b/codemods-legacy/redwoodjs/core/4/redwood-apollo-provider/tsconfig.json similarity index 100% rename from codemods/redwoodjs/core/4/redwood-apollo-provider/tsconfig.json rename to codemods-legacy/redwoodjs/core/4/redwood-apollo-provider/tsconfig.json diff --git a/codemods/redwoodjs/core/4/router-use-auth/.codemodrc.json b/codemods-legacy/redwoodjs/core/4/router-use-auth/.codemodrc.json similarity index 100% rename from codemods/redwoodjs/core/4/router-use-auth/.codemodrc.json rename to codemods-legacy/redwoodjs/core/4/router-use-auth/.codemodrc.json diff --git a/codemods/redwoodjs/core/4/router-use-auth/README.md b/codemods-legacy/redwoodjs/core/4/router-use-auth/README.md similarity index 100% rename from codemods/redwoodjs/core/4/router-use-auth/README.md rename to codemods-legacy/redwoodjs/core/4/router-use-auth/README.md diff --git a/codemods/redwoodjs/core/4/router-use-auth/__testfixtures__/input.js b/codemods-legacy/redwoodjs/core/4/router-use-auth/__testfixtures__/input.js similarity index 100% rename from codemods/redwoodjs/core/4/router-use-auth/__testfixtures__/input.js rename to codemods-legacy/redwoodjs/core/4/router-use-auth/__testfixtures__/input.js diff --git a/codemods/redwoodjs/core/4/router-use-auth/__testfixtures__/output.js b/codemods-legacy/redwoodjs/core/4/router-use-auth/__testfixtures__/output.js similarity index 100% rename from codemods/redwoodjs/core/4/router-use-auth/__testfixtures__/output.js rename to codemods-legacy/redwoodjs/core/4/router-use-auth/__testfixtures__/output.js diff --git a/codemods-legacy/redwoodjs/core/4/router-use-auth/package.json b/codemods-legacy/redwoodjs/core/4/router-use-auth/package.json new file mode 100644 index 00000000..f2a4f0f8 --- /dev/null +++ b/codemods-legacy/redwoodjs/core/4/router-use-auth/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/codemod-redwoodjs-core-4-router-use-auth", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/redwoodjs/core/4/router-use-auth/src/index.ts b/codemods-legacy/redwoodjs/core/4/router-use-auth/src/index.ts similarity index 100% rename from codemods/redwoodjs/core/4/router-use-auth/src/index.ts rename to codemods-legacy/redwoodjs/core/4/router-use-auth/src/index.ts diff --git a/codemods-legacy/redwoodjs/core/4/router-use-auth/test/test.ts b/codemods-legacy/redwoodjs/core/4/router-use-auth/test/test.ts new file mode 100644 index 00000000..b995c3a4 --- /dev/null +++ b/codemods-legacy/redwoodjs/core/4/router-use-auth/test/test.ts @@ -0,0 +1,51 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; +import { readFile } from "node:fs/promises"; +import { join } from "node:path"; +import { fileURLToPath } from "node:url"; +import type { API, FileInfo } from "jscodeshift"; +import jscodeshift from "jscodeshift"; +import transform from "../src/index.ts"; + +const __dirname = fileURLToPath(new URL(".", import.meta.url)); + +describe("@redwoodjs/core v4 router-use-auth", () => { + it("should add useAuth", async () => { + const input = await readFile(join(__dirname, "../__testfixtures__/input.js"), { + encoding: "utf8", + }); + + const output = await readFile(join(__dirname, "../__testfixtures__/output.js"), { + encoding: "utf8", + }); + + const fileInfo: FileInfo = { + path: "index.js", + source: input, + }; + + const buildApi = (parser: string): API => ({ + j: jscodeshift.withParser(parser), + jscodeshift: jscodeshift.withParser(parser), + stats: () => { + console.error( + "The stats function was called, which is not supported on purpose", + ); + }, + report: () => { + console.error( + "The report function was called, which is not supported on purpose", + ); + }, + }); + + const actualOutput = transform(fileInfo, buildApi("js"), { + quote: "single", + }); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + output.replace(/\W/gm, ""), + ); + }); +}); diff --git a/codemods/redwoodjs/core/4/router-use-auth/tsconfig.json b/codemods-legacy/redwoodjs/core/4/router-use-auth/tsconfig.json similarity index 100% rename from codemods/redwoodjs/core/4/router-use-auth/tsconfig.json rename to codemods-legacy/redwoodjs/core/4/router-use-auth/tsconfig.json diff --git a/codemods/redwoodjs/core/4/use-armor/.codemodrc.json b/codemods-legacy/redwoodjs/core/4/use-armor/.codemodrc.json similarity index 100% rename from codemods/redwoodjs/core/4/use-armor/.codemodrc.json rename to codemods-legacy/redwoodjs/core/4/use-armor/.codemodrc.json diff --git a/codemods/redwoodjs/core/4/use-armor/README.md b/codemods-legacy/redwoodjs/core/4/use-armor/README.md similarity index 100% rename from codemods/redwoodjs/core/4/use-armor/README.md rename to codemods-legacy/redwoodjs/core/4/use-armor/README.md diff --git a/codemods-legacy/redwoodjs/core/4/use-armor/package.json b/codemods-legacy/redwoodjs/core/4/use-armor/package.json new file mode 100644 index 00000000..4a82c52f --- /dev/null +++ b/codemods-legacy/redwoodjs/core/4/use-armor/package.json @@ -0,0 +1,17 @@ +{ + "name": "@codemod-com/codemod-redwoodjs-core-4-use-armor", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "private": true, + "main": "./dist/index.cjs", + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/redwoodjs/core/4/use-armor/src/index.js b/codemods-legacy/redwoodjs/core/4/use-armor/src/index.js similarity index 100% rename from codemods/redwoodjs/core/4/use-armor/src/index.js rename to codemods-legacy/redwoodjs/core/4/use-armor/src/index.js diff --git a/codemods/redwoodjs/core/4/use-armor/tsconfig.json b/codemods-legacy/redwoodjs/core/4/use-armor/tsconfig.json similarity index 100% rename from codemods/redwoodjs/core/4/use-armor/tsconfig.json rename to codemods-legacy/redwoodjs/core/4/use-armor/tsconfig.json diff --git a/codemods/remove-unused-feature-flags-2/.codemodrc.json b/codemods-legacy/remove-unused-feature-flags-2/.codemodrc.json similarity index 100% rename from codemods/remove-unused-feature-flags-2/.codemodrc.json rename to codemods-legacy/remove-unused-feature-flags-2/.codemodrc.json diff --git a/codemods/remove-unused-feature-flags-2/README.md b/codemods-legacy/remove-unused-feature-flags-2/README.md similarity index 100% rename from codemods/remove-unused-feature-flags-2/README.md rename to codemods-legacy/remove-unused-feature-flags-2/README.md diff --git a/codemods-legacy/remove-unused-feature-flags-2/package.json b/codemods-legacy/remove-unused-feature-flags-2/package.json new file mode 100644 index 00000000..920fe852 --- /dev/null +++ b/codemods-legacy/remove-unused-feature-flags-2/package.json @@ -0,0 +1,26 @@ +{ + "name": "@codemod-com/codemod-remove-unused-feature-flags-2", + "devDependencies": { + "@codemod-com/utilities": "workspace:*", + "@codemod-com/filemod": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "memfs": "^4.6.0", + "ts-morph": "^19.0.0", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10", + "vitest": "^1.0.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/remove-unused-feature-flags-2/src/index.ts b/codemods-legacy/remove-unused-feature-flags-2/src/index.ts similarity index 100% rename from codemods/remove-unused-feature-flags-2/src/index.ts rename to codemods-legacy/remove-unused-feature-flags-2/src/index.ts diff --git a/codemods/remove-unused-feature-flags-2/test/test.ts b/codemods-legacy/remove-unused-feature-flags-2/test/test.ts similarity index 100% rename from codemods/remove-unused-feature-flags-2/test/test.ts rename to codemods-legacy/remove-unused-feature-flags-2/test/test.ts diff --git a/codemods/remove-unused-feature-flags-2/tsconfig.json b/codemods-legacy/remove-unused-feature-flags-2/tsconfig.json similarity index 100% rename from codemods/remove-unused-feature-flags-2/tsconfig.json rename to codemods-legacy/remove-unused-feature-flags-2/tsconfig.json diff --git a/codemods-legacy/remove-unused-feature-flags-2/vitest.config.ts b/codemods-legacy/remove-unused-feature-flags-2/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/remove-unused-feature-flags-2/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/replace-feature-flag-core/.gitignore b/codemods-legacy/replace-feature-flag-core/.gitignore similarity index 100% rename from codemods/replace-feature-flag-core/.gitignore rename to codemods-legacy/replace-feature-flag-core/.gitignore diff --git a/codemods/replace-feature-flag-core/LICENSE b/codemods-legacy/replace-feature-flag-core/LICENSE similarity index 100% rename from codemods/replace-feature-flag-core/LICENSE rename to codemods-legacy/replace-feature-flag-core/LICENSE diff --git a/codemods/replace-feature-flag-core/README.md b/codemods-legacy/replace-feature-flag-core/README.md similarity index 100% rename from codemods/replace-feature-flag-core/README.md rename to codemods-legacy/replace-feature-flag-core/README.md diff --git a/codemods/replace-feature-flag-core/__testfixtures__/binary-expressions.input.ts b/codemods-legacy/replace-feature-flag-core/__testfixtures__/binary-expressions.input.ts similarity index 100% rename from codemods/replace-feature-flag-core/__testfixtures__/binary-expressions.input.ts rename to codemods-legacy/replace-feature-flag-core/__testfixtures__/binary-expressions.input.ts diff --git a/codemods/replace-feature-flag-core/__testfixtures__/binary-expressions.output.ts b/codemods-legacy/replace-feature-flag-core/__testfixtures__/binary-expressions.output.ts similarity index 100% rename from codemods/replace-feature-flag-core/__testfixtures__/binary-expressions.output.ts rename to codemods-legacy/replace-feature-flag-core/__testfixtures__/binary-expressions.output.ts diff --git a/codemods/replace-feature-flag-core/__testfixtures__/conditional-expressions.input.ts b/codemods-legacy/replace-feature-flag-core/__testfixtures__/conditional-expressions.input.ts similarity index 100% rename from codemods/replace-feature-flag-core/__testfixtures__/conditional-expressions.input.ts rename to codemods-legacy/replace-feature-flag-core/__testfixtures__/conditional-expressions.input.ts diff --git a/codemods/replace-feature-flag-core/__testfixtures__/conditional-expressions.output.ts b/codemods-legacy/replace-feature-flag-core/__testfixtures__/conditional-expressions.output.ts similarity index 100% rename from codemods/replace-feature-flag-core/__testfixtures__/conditional-expressions.output.ts rename to codemods-legacy/replace-feature-flag-core/__testfixtures__/conditional-expressions.output.ts diff --git a/codemods/replace-feature-flag-core/__testfixtures__/if-statements.input.ts b/codemods-legacy/replace-feature-flag-core/__testfixtures__/if-statements.input.ts similarity index 100% rename from codemods/replace-feature-flag-core/__testfixtures__/if-statements.input.ts rename to codemods-legacy/replace-feature-flag-core/__testfixtures__/if-statements.input.ts diff --git a/codemods/replace-feature-flag-core/__testfixtures__/if-statements.output.ts b/codemods-legacy/replace-feature-flag-core/__testfixtures__/if-statements.output.ts similarity index 100% rename from codemods/replace-feature-flag-core/__testfixtures__/if-statements.output.ts rename to codemods-legacy/replace-feature-flag-core/__testfixtures__/if-statements.output.ts diff --git a/codemods/replace-feature-flag-core/__testfixtures__/logical-expressions.input.ts b/codemods-legacy/replace-feature-flag-core/__testfixtures__/logical-expressions.input.ts similarity index 100% rename from codemods/replace-feature-flag-core/__testfixtures__/logical-expressions.input.ts rename to codemods-legacy/replace-feature-flag-core/__testfixtures__/logical-expressions.input.ts diff --git a/codemods/replace-feature-flag-core/__testfixtures__/logical-expressions.output.ts b/codemods-legacy/replace-feature-flag-core/__testfixtures__/logical-expressions.output.ts similarity index 100% rename from codemods/replace-feature-flag-core/__testfixtures__/logical-expressions.output.ts rename to codemods-legacy/replace-feature-flag-core/__testfixtures__/logical-expressions.output.ts diff --git a/codemods/replace-feature-flag-core/__testfixtures__/object-literal-refactor.input.ts b/codemods-legacy/replace-feature-flag-core/__testfixtures__/object-literal-refactor.input.ts similarity index 100% rename from codemods/replace-feature-flag-core/__testfixtures__/object-literal-refactor.input.ts rename to codemods-legacy/replace-feature-flag-core/__testfixtures__/object-literal-refactor.input.ts diff --git a/codemods/replace-feature-flag-core/__testfixtures__/object-literal-refactor.output.ts b/codemods-legacy/replace-feature-flag-core/__testfixtures__/object-literal-refactor.output.ts similarity index 100% rename from codemods/replace-feature-flag-core/__testfixtures__/object-literal-refactor.output.ts rename to codemods-legacy/replace-feature-flag-core/__testfixtures__/object-literal-refactor.output.ts diff --git a/codemods/replace-feature-flag-core/__testfixtures__/references-refactor.input.ts b/codemods-legacy/replace-feature-flag-core/__testfixtures__/references-refactor.input.ts similarity index 100% rename from codemods/replace-feature-flag-core/__testfixtures__/references-refactor.input.ts rename to codemods-legacy/replace-feature-flag-core/__testfixtures__/references-refactor.input.ts diff --git a/codemods/replace-feature-flag-core/__testfixtures__/references-refactor.output.ts b/codemods-legacy/replace-feature-flag-core/__testfixtures__/references-refactor.output.ts similarity index 100% rename from codemods/replace-feature-flag-core/__testfixtures__/references-refactor.output.ts rename to codemods-legacy/replace-feature-flag-core/__testfixtures__/references-refactor.output.ts diff --git a/codemods/replace-feature-flag-core/__testfixtures__/shared.ts b/codemods-legacy/replace-feature-flag-core/__testfixtures__/shared.ts similarity index 100% rename from codemods/replace-feature-flag-core/__testfixtures__/shared.ts rename to codemods-legacy/replace-feature-flag-core/__testfixtures__/shared.ts diff --git a/codemods/replace-feature-flag-core/__testfixtures__/simple-string.input.ts b/codemods-legacy/replace-feature-flag-core/__testfixtures__/simple-string.input.ts similarity index 100% rename from codemods/replace-feature-flag-core/__testfixtures__/simple-string.input.ts rename to codemods-legacy/replace-feature-flag-core/__testfixtures__/simple-string.input.ts diff --git a/codemods/replace-feature-flag-core/__testfixtures__/simple-string.output.ts b/codemods-legacy/replace-feature-flag-core/__testfixtures__/simple-string.output.ts similarity index 100% rename from codemods/replace-feature-flag-core/__testfixtures__/simple-string.output.ts rename to codemods-legacy/replace-feature-flag-core/__testfixtures__/simple-string.output.ts diff --git a/codemods/replace-feature-flag-core/__testfixtures__/unary.input.ts b/codemods-legacy/replace-feature-flag-core/__testfixtures__/unary.input.ts similarity index 100% rename from codemods/replace-feature-flag-core/__testfixtures__/unary.input.ts rename to codemods-legacy/replace-feature-flag-core/__testfixtures__/unary.input.ts diff --git a/codemods/replace-feature-flag-core/__testfixtures__/unary.output.ts b/codemods-legacy/replace-feature-flag-core/__testfixtures__/unary.output.ts similarity index 100% rename from codemods/replace-feature-flag-core/__testfixtures__/unary.output.ts rename to codemods-legacy/replace-feature-flag-core/__testfixtures__/unary.output.ts diff --git a/codemods-legacy/replace-feature-flag-core/package.json b/codemods-legacy/replace-feature-flag-core/package.json new file mode 100644 index 00000000..90e8e46f --- /dev/null +++ b/codemods-legacy/replace-feature-flag-core/package.json @@ -0,0 +1,22 @@ +{ + "name": "replace-feature-flag-core", + "author": "dmytrohryshyn", + "private": true, + "devDependencies": { + "@types/node": "20.9.0", + "typescript": "5.2.2", + "vitest": "^1.0.1", + "ts-morph": "^22.0.0" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "license": "MIT", + "files": [ + "README.md", + ".codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/replace-feature-flag-core/src/index.ts b/codemods-legacy/replace-feature-flag-core/src/index.ts similarity index 100% rename from codemods/replace-feature-flag-core/src/index.ts rename to codemods-legacy/replace-feature-flag-core/src/index.ts diff --git a/codemods/replace-feature-flag-core/src/types.ts b/codemods-legacy/replace-feature-flag-core/src/types.ts similarity index 100% rename from codemods/replace-feature-flag-core/src/types.ts rename to codemods-legacy/replace-feature-flag-core/src/types.ts diff --git a/codemods/replace-feature-flag-core/src/utils.ts b/codemods-legacy/replace-feature-flag-core/src/utils.ts similarity index 100% rename from codemods/replace-feature-flag-core/src/utils.ts rename to codemods-legacy/replace-feature-flag-core/src/utils.ts diff --git a/codemods/replace-feature-flag-core/test/test.ts b/codemods-legacy/replace-feature-flag-core/test/test.ts similarity index 100% rename from codemods/replace-feature-flag-core/test/test.ts rename to codemods-legacy/replace-feature-flag-core/test/test.ts diff --git a/codemods-legacy/replace-feature-flag-core/tsconfig.json b/codemods-legacy/replace-feature-flag-core/tsconfig.json new file mode 100644 index 00000000..2562479f --- /dev/null +++ b/codemods-legacy/replace-feature-flag-core/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@codemod-com/tsconfig/codemod.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "./dist" + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"], +} diff --git a/codemods-legacy/replace-feature-flag-core/vitest.config.ts b/codemods-legacy/replace-feature-flag-core/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/replace-feature-flag-core/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/sql/add-index-before-select/.codemodrc.json b/codemods-legacy/sql/add-index-before-select/.codemodrc.json similarity index 100% rename from codemods/sql/add-index-before-select/.codemodrc.json rename to codemods-legacy/sql/add-index-before-select/.codemodrc.json diff --git a/codemods/sql/add-index-before-select/.gitignore b/codemods-legacy/sql/add-index-before-select/.gitignore similarity index 100% rename from codemods/sql/add-index-before-select/.gitignore rename to codemods-legacy/sql/add-index-before-select/.gitignore diff --git a/codemods/sql/add-index-before-select/LICENSE b/codemods-legacy/sql/add-index-before-select/LICENSE similarity index 100% rename from codemods/sql/add-index-before-select/LICENSE rename to codemods-legacy/sql/add-index-before-select/LICENSE diff --git a/codemods/sql/add-index-before-select/README.md b/codemods-legacy/sql/add-index-before-select/README.md similarity index 100% rename from codemods/sql/add-index-before-select/README.md rename to codemods-legacy/sql/add-index-before-select/README.md diff --git a/codemods/sql/add-index-before-select/__testfixtures__/fixture1.input.sql b/codemods-legacy/sql/add-index-before-select/__testfixtures__/fixture1.input.sql similarity index 100% rename from codemods/sql/add-index-before-select/__testfixtures__/fixture1.input.sql rename to codemods-legacy/sql/add-index-before-select/__testfixtures__/fixture1.input.sql diff --git a/codemods/sql/add-index-before-select/__testfixtures__/fixture1.output.sql b/codemods-legacy/sql/add-index-before-select/__testfixtures__/fixture1.output.sql similarity index 100% rename from codemods/sql/add-index-before-select/__testfixtures__/fixture1.output.sql rename to codemods-legacy/sql/add-index-before-select/__testfixtures__/fixture1.output.sql diff --git a/codemods-legacy/sql/add-index-before-select/package.json b/codemods-legacy/sql/add-index-before-select/package.json new file mode 100644 index 00000000..349d269f --- /dev/null +++ b/codemods-legacy/sql/add-index-before-select/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod-com/sql-add-index-before-select", + "license": "MIT", + "private": true, + "devDependencies": { + "@types/node": "20.9.0", + "typescript": "^5.2.2", + "@codemod.com/workflow": "0.0.31" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/sql/add-index-before-select/src/index.ts b/codemods-legacy/sql/add-index-before-select/src/index.ts similarity index 100% rename from codemods/sql/add-index-before-select/src/index.ts rename to codemods-legacy/sql/add-index-before-select/src/index.ts diff --git a/codemods-legacy/sql/add-index-before-select/tsconfig.json b/codemods-legacy/sql/add-index-before-select/tsconfig.json new file mode 100644 index 00000000..c6203c5d --- /dev/null +++ b/codemods-legacy/sql/add-index-before-select/tsconfig.json @@ -0,0 +1,31 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/statsig/replace-gate/.codemodrc.json b/codemods-legacy/statsig/replace-gate/.codemodrc.json similarity index 100% rename from codemods/statsig/replace-gate/.codemodrc.json rename to codemods-legacy/statsig/replace-gate/.codemodrc.json diff --git a/codemods/statsig/replace-gate/.gitignore b/codemods-legacy/statsig/replace-gate/.gitignore similarity index 100% rename from codemods/statsig/replace-gate/.gitignore rename to codemods-legacy/statsig/replace-gate/.gitignore diff --git a/codemods/statsig/replace-gate/LICENSE b/codemods-legacy/statsig/replace-gate/LICENSE similarity index 100% rename from codemods/statsig/replace-gate/LICENSE rename to codemods-legacy/statsig/replace-gate/LICENSE diff --git a/codemods/statsig/replace-gate/README.md b/codemods-legacy/statsig/replace-gate/README.md similarity index 100% rename from codemods/statsig/replace-gate/README.md rename to codemods-legacy/statsig/replace-gate/README.md diff --git a/codemods/statsig/replace-gate/__testfixtures__/statsig.input.js b/codemods-legacy/statsig/replace-gate/__testfixtures__/statsig.input.js similarity index 100% rename from codemods/statsig/replace-gate/__testfixtures__/statsig.input.js rename to codemods-legacy/statsig/replace-gate/__testfixtures__/statsig.input.js diff --git a/codemods/statsig/replace-gate/__testfixtures__/statsig.output.js b/codemods-legacy/statsig/replace-gate/__testfixtures__/statsig.output.js similarity index 100% rename from codemods/statsig/replace-gate/__testfixtures__/statsig.output.js rename to codemods-legacy/statsig/replace-gate/__testfixtures__/statsig.output.js diff --git a/codemods-legacy/statsig/replace-gate/package.json b/codemods-legacy/statsig/replace-gate/package.json new file mode 100644 index 00000000..27623030 --- /dev/null +++ b/codemods-legacy/statsig/replace-gate/package.json @@ -0,0 +1,23 @@ +{ + "name": "statsig/replace-gate", + "author": "dmytrohryshyn", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "5.2.2", + "vitest": "^1.0.1", + "ts-morph": "^22.0.0" + }, + "scripts": { + "test": "vitest run", + "test:watch": "vitest watch" + }, + "license": "MIT", + "files": [ + "README.md", + ".codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/statsig/replace-gate/src/index.ts b/codemods-legacy/statsig/replace-gate/src/index.ts similarity index 100% rename from codemods/statsig/replace-gate/src/index.ts rename to codemods-legacy/statsig/replace-gate/src/index.ts diff --git a/codemods/statsig/replace-gate/test/test.ts b/codemods-legacy/statsig/replace-gate/test/test.ts similarity index 100% rename from codemods/statsig/replace-gate/test/test.ts rename to codemods-legacy/statsig/replace-gate/test/test.ts diff --git a/codemods-legacy/statsig/replace-gate/tsconfig.json b/codemods-legacy/statsig/replace-gate/tsconfig.json new file mode 100644 index 00000000..36bd1c7d --- /dev/null +++ b/codemods-legacy/statsig/replace-gate/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@codemod-com/tsconfig/codemod.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "./dist" + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods-legacy/statsig/replace-gate/vitest.config.ts b/codemods-legacy/statsig/replace-gate/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/codemods-legacy/statsig/replace-gate/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/codemods/styledictionary/4/asynchronous-api-file-headers/.codemodrc.json b/codemods-legacy/styledictionary/4/asynchronous-api-file-headers/.codemodrc.json similarity index 100% rename from codemods/styledictionary/4/asynchronous-api-file-headers/.codemodrc.json rename to codemods-legacy/styledictionary/4/asynchronous-api-file-headers/.codemodrc.json diff --git a/codemods/styledictionary/4/asynchronous-api-file-headers/.gitignore b/codemods-legacy/styledictionary/4/asynchronous-api-file-headers/.gitignore similarity index 100% rename from codemods/styledictionary/4/asynchronous-api-file-headers/.gitignore rename to codemods-legacy/styledictionary/4/asynchronous-api-file-headers/.gitignore diff --git a/codemods/styledictionary/4/asynchronous-api-file-headers/LICENSE b/codemods-legacy/styledictionary/4/asynchronous-api-file-headers/LICENSE similarity index 100% rename from codemods/styledictionary/4/asynchronous-api-file-headers/LICENSE rename to codemods-legacy/styledictionary/4/asynchronous-api-file-headers/LICENSE diff --git a/codemods/styledictionary/4/asynchronous-api-file-headers/README.md b/codemods-legacy/styledictionary/4/asynchronous-api-file-headers/README.md similarity index 100% rename from codemods/styledictionary/4/asynchronous-api-file-headers/README.md rename to codemods-legacy/styledictionary/4/asynchronous-api-file-headers/README.md diff --git a/codemods/styledictionary/4/asynchronous-api-file-headers/__testfixtures__/fixture1.input.ts b/codemods-legacy/styledictionary/4/asynchronous-api-file-headers/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/styledictionary/4/asynchronous-api-file-headers/__testfixtures__/fixture1.input.ts rename to codemods-legacy/styledictionary/4/asynchronous-api-file-headers/__testfixtures__/fixture1.input.ts diff --git a/codemods/styledictionary/4/asynchronous-api-file-headers/__testfixtures__/fixture1.output.ts b/codemods-legacy/styledictionary/4/asynchronous-api-file-headers/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/styledictionary/4/asynchronous-api-file-headers/__testfixtures__/fixture1.output.ts rename to codemods-legacy/styledictionary/4/asynchronous-api-file-headers/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/styledictionary/4/asynchronous-api-file-headers/package.json b/codemods-legacy/styledictionary/4/asynchronous-api-file-headers/package.json new file mode 100644 index 00000000..91783182 --- /dev/null +++ b/codemods-legacy/styledictionary/4/asynchronous-api-file-headers/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/styledictionary-4-asynchronous-api-file-headers", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/styledictionary/4/asynchronous-api-file-headers/src/index.ts b/codemods-legacy/styledictionary/4/asynchronous-api-file-headers/src/index.ts similarity index 100% rename from codemods/styledictionary/4/asynchronous-api-file-headers/src/index.ts rename to codemods-legacy/styledictionary/4/asynchronous-api-file-headers/src/index.ts diff --git a/codemods-legacy/styledictionary/4/asynchronous-api-file-headers/tsconfig.json b/codemods-legacy/styledictionary/4/asynchronous-api-file-headers/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/styledictionary/4/asynchronous-api-file-headers/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/styledictionary/4/asynchronous-api/.codemodrc.json b/codemods-legacy/styledictionary/4/asynchronous-api/.codemodrc.json similarity index 100% rename from codemods/styledictionary/4/asynchronous-api/.codemodrc.json rename to codemods-legacy/styledictionary/4/asynchronous-api/.codemodrc.json diff --git a/codemods/styledictionary/4/asynchronous-api/.gitignore b/codemods-legacy/styledictionary/4/asynchronous-api/.gitignore similarity index 100% rename from codemods/styledictionary/4/asynchronous-api/.gitignore rename to codemods-legacy/styledictionary/4/asynchronous-api/.gitignore diff --git a/codemods/styledictionary/4/asynchronous-api/LICENSE b/codemods-legacy/styledictionary/4/asynchronous-api/LICENSE similarity index 100% rename from codemods/styledictionary/4/asynchronous-api/LICENSE rename to codemods-legacy/styledictionary/4/asynchronous-api/LICENSE diff --git a/codemods/styledictionary/4/asynchronous-api/README.md b/codemods-legacy/styledictionary/4/asynchronous-api/README.md similarity index 100% rename from codemods/styledictionary/4/asynchronous-api/README.md rename to codemods-legacy/styledictionary/4/asynchronous-api/README.md diff --git a/codemods/styledictionary/4/asynchronous-api/__testfixtures__/fixture1.input.ts b/codemods-legacy/styledictionary/4/asynchronous-api/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/styledictionary/4/asynchronous-api/__testfixtures__/fixture1.input.ts rename to codemods-legacy/styledictionary/4/asynchronous-api/__testfixtures__/fixture1.input.ts diff --git a/codemods/styledictionary/4/asynchronous-api/__testfixtures__/fixture1.output.ts b/codemods-legacy/styledictionary/4/asynchronous-api/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/styledictionary/4/asynchronous-api/__testfixtures__/fixture1.output.ts rename to codemods-legacy/styledictionary/4/asynchronous-api/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/styledictionary/4/asynchronous-api/package.json b/codemods-legacy/styledictionary/4/asynchronous-api/package.json new file mode 100644 index 00000000..f5c8666e --- /dev/null +++ b/codemods-legacy/styledictionary/4/asynchronous-api/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/styledictionary-4-asynchronous-api", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/styledictionary/4/asynchronous-api/src/index.ts b/codemods-legacy/styledictionary/4/asynchronous-api/src/index.ts similarity index 100% rename from codemods/styledictionary/4/asynchronous-api/src/index.ts rename to codemods-legacy/styledictionary/4/asynchronous-api/src/index.ts diff --git a/codemods-legacy/styledictionary/4/asynchronous-api/tsconfig.json b/codemods-legacy/styledictionary/4/asynchronous-api/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/styledictionary/4/asynchronous-api/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/styledictionary/4/format-helpers/.codemodrc.json b/codemods-legacy/styledictionary/4/format-helpers/.codemodrc.json similarity index 100% rename from codemods/styledictionary/4/format-helpers/.codemodrc.json rename to codemods-legacy/styledictionary/4/format-helpers/.codemodrc.json diff --git a/codemods/styledictionary/4/format-helpers/.gitignore b/codemods-legacy/styledictionary/4/format-helpers/.gitignore similarity index 100% rename from codemods/styledictionary/4/format-helpers/.gitignore rename to codemods-legacy/styledictionary/4/format-helpers/.gitignore diff --git a/codemods/styledictionary/4/format-helpers/LICENSE b/codemods-legacy/styledictionary/4/format-helpers/LICENSE similarity index 100% rename from codemods/styledictionary/4/format-helpers/LICENSE rename to codemods-legacy/styledictionary/4/format-helpers/LICENSE diff --git a/codemods/styledictionary/4/format-helpers/README.md b/codemods-legacy/styledictionary/4/format-helpers/README.md similarity index 100% rename from codemods/styledictionary/4/format-helpers/README.md rename to codemods-legacy/styledictionary/4/format-helpers/README.md diff --git a/codemods/styledictionary/4/format-helpers/__testfixtures__/fixture1.input.ts b/codemods-legacy/styledictionary/4/format-helpers/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/styledictionary/4/format-helpers/__testfixtures__/fixture1.input.ts rename to codemods-legacy/styledictionary/4/format-helpers/__testfixtures__/fixture1.input.ts diff --git a/codemods/styledictionary/4/format-helpers/__testfixtures__/fixture1.output.ts b/codemods-legacy/styledictionary/4/format-helpers/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/styledictionary/4/format-helpers/__testfixtures__/fixture1.output.ts rename to codemods-legacy/styledictionary/4/format-helpers/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/styledictionary/4/format-helpers/package.json b/codemods-legacy/styledictionary/4/format-helpers/package.json new file mode 100644 index 00000000..0585fae4 --- /dev/null +++ b/codemods-legacy/styledictionary/4/format-helpers/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/styledictionary-4-format-helpers", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/styledictionary/4/format-helpers/src/index.ts b/codemods-legacy/styledictionary/4/format-helpers/src/index.ts similarity index 100% rename from codemods/styledictionary/4/format-helpers/src/index.ts rename to codemods-legacy/styledictionary/4/format-helpers/src/index.ts diff --git a/codemods-legacy/styledictionary/4/format-helpers/tsconfig.json b/codemods-legacy/styledictionary/4/format-helpers/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/styledictionary/4/format-helpers/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/styledictionary/4/formatting-options/.codemodrc.json b/codemods-legacy/styledictionary/4/formatting-options/.codemodrc.json similarity index 100% rename from codemods/styledictionary/4/formatting-options/.codemodrc.json rename to codemods-legacy/styledictionary/4/formatting-options/.codemodrc.json diff --git a/codemods/styledictionary/4/formatting-options/.gitignore b/codemods-legacy/styledictionary/4/formatting-options/.gitignore similarity index 100% rename from codemods/styledictionary/4/formatting-options/.gitignore rename to codemods-legacy/styledictionary/4/formatting-options/.gitignore diff --git a/codemods/styledictionary/4/formatting-options/LICENSE b/codemods-legacy/styledictionary/4/formatting-options/LICENSE similarity index 100% rename from codemods/styledictionary/4/formatting-options/LICENSE rename to codemods-legacy/styledictionary/4/formatting-options/LICENSE diff --git a/codemods/styledictionary/4/formatting-options/README.md b/codemods-legacy/styledictionary/4/formatting-options/README.md similarity index 100% rename from codemods/styledictionary/4/formatting-options/README.md rename to codemods-legacy/styledictionary/4/formatting-options/README.md diff --git a/codemods/styledictionary/4/formatting-options/__testfixtures__/fixture1.input.ts b/codemods-legacy/styledictionary/4/formatting-options/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/styledictionary/4/formatting-options/__testfixtures__/fixture1.input.ts rename to codemods-legacy/styledictionary/4/formatting-options/__testfixtures__/fixture1.input.ts diff --git a/codemods/styledictionary/4/formatting-options/__testfixtures__/fixture1.output.ts b/codemods-legacy/styledictionary/4/formatting-options/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/styledictionary/4/formatting-options/__testfixtures__/fixture1.output.ts rename to codemods-legacy/styledictionary/4/formatting-options/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/styledictionary/4/formatting-options/package.json b/codemods-legacy/styledictionary/4/formatting-options/package.json new file mode 100644 index 00000000..d648dee0 --- /dev/null +++ b/codemods-legacy/styledictionary/4/formatting-options/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/styledictionary-4-formatting-options", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/styledictionary/4/formatting-options/src/index.ts b/codemods-legacy/styledictionary/4/formatting-options/src/index.ts similarity index 100% rename from codemods/styledictionary/4/formatting-options/src/index.ts rename to codemods-legacy/styledictionary/4/formatting-options/src/index.ts diff --git a/codemods-legacy/styledictionary/4/formatting-options/tsconfig.json b/codemods-legacy/styledictionary/4/formatting-options/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/styledictionary/4/formatting-options/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/styledictionary/4/hook-api-actions/.codemodrc.json b/codemods-legacy/styledictionary/4/hook-api-actions/.codemodrc.json similarity index 100% rename from codemods/styledictionary/4/hook-api-actions/.codemodrc.json rename to codemods-legacy/styledictionary/4/hook-api-actions/.codemodrc.json diff --git a/codemods/styledictionary/4/hook-api-actions/.gitignore b/codemods-legacy/styledictionary/4/hook-api-actions/.gitignore similarity index 100% rename from codemods/styledictionary/4/hook-api-actions/.gitignore rename to codemods-legacy/styledictionary/4/hook-api-actions/.gitignore diff --git a/codemods/styledictionary/4/hook-api-actions/LICENSE b/codemods-legacy/styledictionary/4/hook-api-actions/LICENSE similarity index 100% rename from codemods/styledictionary/4/hook-api-actions/LICENSE rename to codemods-legacy/styledictionary/4/hook-api-actions/LICENSE diff --git a/codemods/styledictionary/4/hook-api-actions/README.md b/codemods-legacy/styledictionary/4/hook-api-actions/README.md similarity index 100% rename from codemods/styledictionary/4/hook-api-actions/README.md rename to codemods-legacy/styledictionary/4/hook-api-actions/README.md diff --git a/codemods/styledictionary/4/hook-api-actions/__testfixtures__/fixture1.input.ts b/codemods-legacy/styledictionary/4/hook-api-actions/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-actions/__testfixtures__/fixture1.input.ts rename to codemods-legacy/styledictionary/4/hook-api-actions/__testfixtures__/fixture1.input.ts diff --git a/codemods/styledictionary/4/hook-api-actions/__testfixtures__/fixture1.output.ts b/codemods-legacy/styledictionary/4/hook-api-actions/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-actions/__testfixtures__/fixture1.output.ts rename to codemods-legacy/styledictionary/4/hook-api-actions/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/styledictionary/4/hook-api-actions/package.json b/codemods-legacy/styledictionary/4/hook-api-actions/package.json new file mode 100644 index 00000000..f5ea7fb3 --- /dev/null +++ b/codemods-legacy/styledictionary/4/hook-api-actions/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/styledictionary-4-hook-api-actions", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/styledictionary/4/hook-api-actions/src/index.ts b/codemods-legacy/styledictionary/4/hook-api-actions/src/index.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-actions/src/index.ts rename to codemods-legacy/styledictionary/4/hook-api-actions/src/index.ts diff --git a/codemods-legacy/styledictionary/4/hook-api-actions/tsconfig.json b/codemods-legacy/styledictionary/4/hook-api-actions/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/styledictionary/4/hook-api-actions/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/styledictionary/4/hook-api-file-header/.codemodrc.json b/codemods-legacy/styledictionary/4/hook-api-file-header/.codemodrc.json similarity index 100% rename from codemods/styledictionary/4/hook-api-file-header/.codemodrc.json rename to codemods-legacy/styledictionary/4/hook-api-file-header/.codemodrc.json diff --git a/codemods/styledictionary/4/hook-api-file-header/.gitignore b/codemods-legacy/styledictionary/4/hook-api-file-header/.gitignore similarity index 100% rename from codemods/styledictionary/4/hook-api-file-header/.gitignore rename to codemods-legacy/styledictionary/4/hook-api-file-header/.gitignore diff --git a/codemods/styledictionary/4/hook-api-file-header/LICENSE b/codemods-legacy/styledictionary/4/hook-api-file-header/LICENSE similarity index 100% rename from codemods/styledictionary/4/hook-api-file-header/LICENSE rename to codemods-legacy/styledictionary/4/hook-api-file-header/LICENSE diff --git a/codemods/styledictionary/4/hook-api-file-header/README.md b/codemods-legacy/styledictionary/4/hook-api-file-header/README.md similarity index 100% rename from codemods/styledictionary/4/hook-api-file-header/README.md rename to codemods-legacy/styledictionary/4/hook-api-file-header/README.md diff --git a/codemods/styledictionary/4/hook-api-file-header/__testfixtures__/fixture1.input.ts b/codemods-legacy/styledictionary/4/hook-api-file-header/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-file-header/__testfixtures__/fixture1.input.ts rename to codemods-legacy/styledictionary/4/hook-api-file-header/__testfixtures__/fixture1.input.ts diff --git a/codemods/styledictionary/4/hook-api-file-header/__testfixtures__/fixture1.output.ts b/codemods-legacy/styledictionary/4/hook-api-file-header/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-file-header/__testfixtures__/fixture1.output.ts rename to codemods-legacy/styledictionary/4/hook-api-file-header/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/styledictionary/4/hook-api-file-header/package.json b/codemods-legacy/styledictionary/4/hook-api-file-header/package.json new file mode 100644 index 00000000..4fe99373 --- /dev/null +++ b/codemods-legacy/styledictionary/4/hook-api-file-header/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/styledictionary-4-hook-api-file-header", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/styledictionary/4/hook-api-file-header/src/index.ts b/codemods-legacy/styledictionary/4/hook-api-file-header/src/index.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-file-header/src/index.ts rename to codemods-legacy/styledictionary/4/hook-api-file-header/src/index.ts diff --git a/codemods-legacy/styledictionary/4/hook-api-file-header/tsconfig.json b/codemods-legacy/styledictionary/4/hook-api-file-header/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/styledictionary/4/hook-api-file-header/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/styledictionary/4/hook-api-filters/.codemodrc.json b/codemods-legacy/styledictionary/4/hook-api-filters/.codemodrc.json similarity index 100% rename from codemods/styledictionary/4/hook-api-filters/.codemodrc.json rename to codemods-legacy/styledictionary/4/hook-api-filters/.codemodrc.json diff --git a/codemods/styledictionary/4/hook-api-filters/.gitignore b/codemods-legacy/styledictionary/4/hook-api-filters/.gitignore similarity index 100% rename from codemods/styledictionary/4/hook-api-filters/.gitignore rename to codemods-legacy/styledictionary/4/hook-api-filters/.gitignore diff --git a/codemods/styledictionary/4/hook-api-filters/LICENSE b/codemods-legacy/styledictionary/4/hook-api-filters/LICENSE similarity index 100% rename from codemods/styledictionary/4/hook-api-filters/LICENSE rename to codemods-legacy/styledictionary/4/hook-api-filters/LICENSE diff --git a/codemods/styledictionary/4/hook-api-filters/README.md b/codemods-legacy/styledictionary/4/hook-api-filters/README.md similarity index 100% rename from codemods/styledictionary/4/hook-api-filters/README.md rename to codemods-legacy/styledictionary/4/hook-api-filters/README.md diff --git a/codemods/styledictionary/4/hook-api-filters/__testfixtures__/fixture1.input.ts b/codemods-legacy/styledictionary/4/hook-api-filters/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-filters/__testfixtures__/fixture1.input.ts rename to codemods-legacy/styledictionary/4/hook-api-filters/__testfixtures__/fixture1.input.ts diff --git a/codemods/styledictionary/4/hook-api-filters/__testfixtures__/fixture1.output.ts b/codemods-legacy/styledictionary/4/hook-api-filters/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-filters/__testfixtures__/fixture1.output.ts rename to codemods-legacy/styledictionary/4/hook-api-filters/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/styledictionary/4/hook-api-filters/package.json b/codemods-legacy/styledictionary/4/hook-api-filters/package.json new file mode 100644 index 00000000..f932b341 --- /dev/null +++ b/codemods-legacy/styledictionary/4/hook-api-filters/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/styledictionary-4-hook-api-filters", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/styledictionary/4/hook-api-filters/src/index.ts b/codemods-legacy/styledictionary/4/hook-api-filters/src/index.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-filters/src/index.ts rename to codemods-legacy/styledictionary/4/hook-api-filters/src/index.ts diff --git a/codemods-legacy/styledictionary/4/hook-api-filters/tsconfig.json b/codemods-legacy/styledictionary/4/hook-api-filters/tsconfig.json new file mode 100644 index 00000000..5c605c16 --- /dev/null +++ b/codemods-legacy/styledictionary/4/hook-api-filters/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"], +} diff --git a/codemods/styledictionary/4/hook-api-formats/.codemodrc.json b/codemods-legacy/styledictionary/4/hook-api-formats/.codemodrc.json similarity index 100% rename from codemods/styledictionary/4/hook-api-formats/.codemodrc.json rename to codemods-legacy/styledictionary/4/hook-api-formats/.codemodrc.json diff --git a/codemods/styledictionary/4/hook-api-formats/.gitignore b/codemods-legacy/styledictionary/4/hook-api-formats/.gitignore similarity index 100% rename from codemods/styledictionary/4/hook-api-formats/.gitignore rename to codemods-legacy/styledictionary/4/hook-api-formats/.gitignore diff --git a/codemods/styledictionary/4/hook-api-formats/LICENSE b/codemods-legacy/styledictionary/4/hook-api-formats/LICENSE similarity index 100% rename from codemods/styledictionary/4/hook-api-formats/LICENSE rename to codemods-legacy/styledictionary/4/hook-api-formats/LICENSE diff --git a/codemods/styledictionary/4/hook-api-formats/README.md b/codemods-legacy/styledictionary/4/hook-api-formats/README.md similarity index 100% rename from codemods/styledictionary/4/hook-api-formats/README.md rename to codemods-legacy/styledictionary/4/hook-api-formats/README.md diff --git a/codemods/styledictionary/4/hook-api-formats/__testfixtures__/fixture1.input.ts b/codemods-legacy/styledictionary/4/hook-api-formats/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-formats/__testfixtures__/fixture1.input.ts rename to codemods-legacy/styledictionary/4/hook-api-formats/__testfixtures__/fixture1.input.ts diff --git a/codemods/styledictionary/4/hook-api-formats/__testfixtures__/fixture1.output.ts b/codemods-legacy/styledictionary/4/hook-api-formats/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-formats/__testfixtures__/fixture1.output.ts rename to codemods-legacy/styledictionary/4/hook-api-formats/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/styledictionary/4/hook-api-formats/package.json b/codemods-legacy/styledictionary/4/hook-api-formats/package.json new file mode 100644 index 00000000..8dd7656a --- /dev/null +++ b/codemods-legacy/styledictionary/4/hook-api-formats/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/styledictionary-4-hook-api-formats", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/styledictionary/4/hook-api-formats/src/index.ts b/codemods-legacy/styledictionary/4/hook-api-formats/src/index.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-formats/src/index.ts rename to codemods-legacy/styledictionary/4/hook-api-formats/src/index.ts diff --git a/codemods-legacy/styledictionary/4/hook-api-formats/tsconfig.json b/codemods-legacy/styledictionary/4/hook-api-formats/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/styledictionary/4/hook-api-formats/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/styledictionary/4/hook-api-parsers/.codemodrc.json b/codemods-legacy/styledictionary/4/hook-api-parsers/.codemodrc.json similarity index 100% rename from codemods/styledictionary/4/hook-api-parsers/.codemodrc.json rename to codemods-legacy/styledictionary/4/hook-api-parsers/.codemodrc.json diff --git a/codemods/styledictionary/4/hook-api-parsers/.gitignore b/codemods-legacy/styledictionary/4/hook-api-parsers/.gitignore similarity index 100% rename from codemods/styledictionary/4/hook-api-parsers/.gitignore rename to codemods-legacy/styledictionary/4/hook-api-parsers/.gitignore diff --git a/codemods/styledictionary/4/hook-api-parsers/LICENSE b/codemods-legacy/styledictionary/4/hook-api-parsers/LICENSE similarity index 100% rename from codemods/styledictionary/4/hook-api-parsers/LICENSE rename to codemods-legacy/styledictionary/4/hook-api-parsers/LICENSE diff --git a/codemods/styledictionary/4/hook-api-parsers/README.md b/codemods-legacy/styledictionary/4/hook-api-parsers/README.md similarity index 100% rename from codemods/styledictionary/4/hook-api-parsers/README.md rename to codemods-legacy/styledictionary/4/hook-api-parsers/README.md diff --git a/codemods/styledictionary/4/hook-api-parsers/__testfixtures__/fixture1.input.ts b/codemods-legacy/styledictionary/4/hook-api-parsers/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-parsers/__testfixtures__/fixture1.input.ts rename to codemods-legacy/styledictionary/4/hook-api-parsers/__testfixtures__/fixture1.input.ts diff --git a/codemods/styledictionary/4/hook-api-parsers/__testfixtures__/fixture1.output.ts b/codemods-legacy/styledictionary/4/hook-api-parsers/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-parsers/__testfixtures__/fixture1.output.ts rename to codemods-legacy/styledictionary/4/hook-api-parsers/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/styledictionary/4/hook-api-parsers/package.json b/codemods-legacy/styledictionary/4/hook-api-parsers/package.json new file mode 100644 index 00000000..448a7543 --- /dev/null +++ b/codemods-legacy/styledictionary/4/hook-api-parsers/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/styledictionary-4-hook-api-parsers", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/styledictionary/4/hook-api-parsers/src/index.ts b/codemods-legacy/styledictionary/4/hook-api-parsers/src/index.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-parsers/src/index.ts rename to codemods-legacy/styledictionary/4/hook-api-parsers/src/index.ts diff --git a/codemods-legacy/styledictionary/4/hook-api-parsers/tsconfig.json b/codemods-legacy/styledictionary/4/hook-api-parsers/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/styledictionary/4/hook-api-parsers/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/styledictionary/4/hook-api-preprocessors/.codemodrc.json b/codemods-legacy/styledictionary/4/hook-api-preprocessors/.codemodrc.json similarity index 100% rename from codemods/styledictionary/4/hook-api-preprocessors/.codemodrc.json rename to codemods-legacy/styledictionary/4/hook-api-preprocessors/.codemodrc.json diff --git a/codemods/styledictionary/4/hook-api-preprocessors/.gitignore b/codemods-legacy/styledictionary/4/hook-api-preprocessors/.gitignore similarity index 100% rename from codemods/styledictionary/4/hook-api-preprocessors/.gitignore rename to codemods-legacy/styledictionary/4/hook-api-preprocessors/.gitignore diff --git a/codemods/styledictionary/4/hook-api-preprocessors/LICENSE b/codemods-legacy/styledictionary/4/hook-api-preprocessors/LICENSE similarity index 100% rename from codemods/styledictionary/4/hook-api-preprocessors/LICENSE rename to codemods-legacy/styledictionary/4/hook-api-preprocessors/LICENSE diff --git a/codemods/styledictionary/4/hook-api-preprocessors/README.md b/codemods-legacy/styledictionary/4/hook-api-preprocessors/README.md similarity index 100% rename from codemods/styledictionary/4/hook-api-preprocessors/README.md rename to codemods-legacy/styledictionary/4/hook-api-preprocessors/README.md diff --git a/codemods/styledictionary/4/hook-api-preprocessors/__testfixtures__/fixture1.input.ts b/codemods-legacy/styledictionary/4/hook-api-preprocessors/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-preprocessors/__testfixtures__/fixture1.input.ts rename to codemods-legacy/styledictionary/4/hook-api-preprocessors/__testfixtures__/fixture1.input.ts diff --git a/codemods/styledictionary/4/hook-api-preprocessors/__testfixtures__/fixture1.output.ts b/codemods-legacy/styledictionary/4/hook-api-preprocessors/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-preprocessors/__testfixtures__/fixture1.output.ts rename to codemods-legacy/styledictionary/4/hook-api-preprocessors/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/styledictionary/4/hook-api-preprocessors/package.json b/codemods-legacy/styledictionary/4/hook-api-preprocessors/package.json new file mode 100644 index 00000000..e7fe54ff --- /dev/null +++ b/codemods-legacy/styledictionary/4/hook-api-preprocessors/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/styledictionary-4-hook-api-preprocessors", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/styledictionary/4/hook-api-preprocessors/src/index.ts b/codemods-legacy/styledictionary/4/hook-api-preprocessors/src/index.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-preprocessors/src/index.ts rename to codemods-legacy/styledictionary/4/hook-api-preprocessors/src/index.ts diff --git a/codemods-legacy/styledictionary/4/hook-api-preprocessors/tsconfig.json b/codemods-legacy/styledictionary/4/hook-api-preprocessors/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/styledictionary/4/hook-api-preprocessors/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/styledictionary/4/hook-api-transform-groups/.codemodrc.json b/codemods-legacy/styledictionary/4/hook-api-transform-groups/.codemodrc.json similarity index 100% rename from codemods/styledictionary/4/hook-api-transform-groups/.codemodrc.json rename to codemods-legacy/styledictionary/4/hook-api-transform-groups/.codemodrc.json diff --git a/codemods/styledictionary/4/hook-api-transform-groups/.gitignore b/codemods-legacy/styledictionary/4/hook-api-transform-groups/.gitignore similarity index 100% rename from codemods/styledictionary/4/hook-api-transform-groups/.gitignore rename to codemods-legacy/styledictionary/4/hook-api-transform-groups/.gitignore diff --git a/codemods/styledictionary/4/hook-api-transform-groups/LICENSE b/codemods-legacy/styledictionary/4/hook-api-transform-groups/LICENSE similarity index 100% rename from codemods/styledictionary/4/hook-api-transform-groups/LICENSE rename to codemods-legacy/styledictionary/4/hook-api-transform-groups/LICENSE diff --git a/codemods/styledictionary/4/hook-api-transform-groups/README.md b/codemods-legacy/styledictionary/4/hook-api-transform-groups/README.md similarity index 100% rename from codemods/styledictionary/4/hook-api-transform-groups/README.md rename to codemods-legacy/styledictionary/4/hook-api-transform-groups/README.md diff --git a/codemods/styledictionary/4/hook-api-transform-groups/__testfixtures__/fixture1.input.ts b/codemods-legacy/styledictionary/4/hook-api-transform-groups/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-transform-groups/__testfixtures__/fixture1.input.ts rename to codemods-legacy/styledictionary/4/hook-api-transform-groups/__testfixtures__/fixture1.input.ts diff --git a/codemods/styledictionary/4/hook-api-transform-groups/__testfixtures__/fixture1.output.ts b/codemods-legacy/styledictionary/4/hook-api-transform-groups/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-transform-groups/__testfixtures__/fixture1.output.ts rename to codemods-legacy/styledictionary/4/hook-api-transform-groups/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/styledictionary/4/hook-api-transform-groups/package.json b/codemods-legacy/styledictionary/4/hook-api-transform-groups/package.json new file mode 100644 index 00000000..7e0a982d --- /dev/null +++ b/codemods-legacy/styledictionary/4/hook-api-transform-groups/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/styledictionary-4-hook-api-transform-groups", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/styledictionary/4/hook-api-transform-groups/src/index.ts b/codemods-legacy/styledictionary/4/hook-api-transform-groups/src/index.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-transform-groups/src/index.ts rename to codemods-legacy/styledictionary/4/hook-api-transform-groups/src/index.ts diff --git a/codemods-legacy/styledictionary/4/hook-api-transform-groups/tsconfig.json b/codemods-legacy/styledictionary/4/hook-api-transform-groups/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/styledictionary/4/hook-api-transform-groups/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/styledictionary/4/hook-api-transform/.codemodrc.json b/codemods-legacy/styledictionary/4/hook-api-transform/.codemodrc.json similarity index 100% rename from codemods/styledictionary/4/hook-api-transform/.codemodrc.json rename to codemods-legacy/styledictionary/4/hook-api-transform/.codemodrc.json diff --git a/codemods/styledictionary/4/hook-api-transform/.gitignore b/codemods-legacy/styledictionary/4/hook-api-transform/.gitignore similarity index 100% rename from codemods/styledictionary/4/hook-api-transform/.gitignore rename to codemods-legacy/styledictionary/4/hook-api-transform/.gitignore diff --git a/codemods/styledictionary/4/hook-api-transform/LICENSE b/codemods-legacy/styledictionary/4/hook-api-transform/LICENSE similarity index 100% rename from codemods/styledictionary/4/hook-api-transform/LICENSE rename to codemods-legacy/styledictionary/4/hook-api-transform/LICENSE diff --git a/codemods/styledictionary/4/hook-api-transform/README.md b/codemods-legacy/styledictionary/4/hook-api-transform/README.md similarity index 100% rename from codemods/styledictionary/4/hook-api-transform/README.md rename to codemods-legacy/styledictionary/4/hook-api-transform/README.md diff --git a/codemods/styledictionary/4/hook-api-transform/__testfixtures__/fixture1.input.ts b/codemods-legacy/styledictionary/4/hook-api-transform/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-transform/__testfixtures__/fixture1.input.ts rename to codemods-legacy/styledictionary/4/hook-api-transform/__testfixtures__/fixture1.input.ts diff --git a/codemods/styledictionary/4/hook-api-transform/__testfixtures__/fixture1.output.ts b/codemods-legacy/styledictionary/4/hook-api-transform/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-transform/__testfixtures__/fixture1.output.ts rename to codemods-legacy/styledictionary/4/hook-api-transform/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/styledictionary/4/hook-api-transform/package.json b/codemods-legacy/styledictionary/4/hook-api-transform/package.json new file mode 100644 index 00000000..a3c30c73 --- /dev/null +++ b/codemods-legacy/styledictionary/4/hook-api-transform/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/styledictionary-4-hook-api-transform", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/styledictionary/4/hook-api-transform/src/index.ts b/codemods-legacy/styledictionary/4/hook-api-transform/src/index.ts similarity index 100% rename from codemods/styledictionary/4/hook-api-transform/src/index.ts rename to codemods-legacy/styledictionary/4/hook-api-transform/src/index.ts diff --git a/codemods-legacy/styledictionary/4/hook-api-transform/tsconfig.json b/codemods-legacy/styledictionary/4/hook-api-transform/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/styledictionary/4/hook-api-transform/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/styledictionary/4/instantiating-style-dictionary/.codemodrc.json b/codemods-legacy/styledictionary/4/instantiating-style-dictionary/.codemodrc.json similarity index 100% rename from codemods/styledictionary/4/instantiating-style-dictionary/.codemodrc.json rename to codemods-legacy/styledictionary/4/instantiating-style-dictionary/.codemodrc.json diff --git a/codemods/styledictionary/4/instantiating-style-dictionary/.gitignore b/codemods-legacy/styledictionary/4/instantiating-style-dictionary/.gitignore similarity index 100% rename from codemods/styledictionary/4/instantiating-style-dictionary/.gitignore rename to codemods-legacy/styledictionary/4/instantiating-style-dictionary/.gitignore diff --git a/codemods/styledictionary/4/instantiating-style-dictionary/LICENSE b/codemods-legacy/styledictionary/4/instantiating-style-dictionary/LICENSE similarity index 100% rename from codemods/styledictionary/4/instantiating-style-dictionary/LICENSE rename to codemods-legacy/styledictionary/4/instantiating-style-dictionary/LICENSE diff --git a/codemods/styledictionary/4/instantiating-style-dictionary/README.md b/codemods-legacy/styledictionary/4/instantiating-style-dictionary/README.md similarity index 100% rename from codemods/styledictionary/4/instantiating-style-dictionary/README.md rename to codemods-legacy/styledictionary/4/instantiating-style-dictionary/README.md diff --git a/codemods/styledictionary/4/instantiating-style-dictionary/__testfixtures__/fixture1.input.ts b/codemods-legacy/styledictionary/4/instantiating-style-dictionary/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/styledictionary/4/instantiating-style-dictionary/__testfixtures__/fixture1.input.ts rename to codemods-legacy/styledictionary/4/instantiating-style-dictionary/__testfixtures__/fixture1.input.ts diff --git a/codemods/styledictionary/4/instantiating-style-dictionary/__testfixtures__/fixture1.output.ts b/codemods-legacy/styledictionary/4/instantiating-style-dictionary/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/styledictionary/4/instantiating-style-dictionary/__testfixtures__/fixture1.output.ts rename to codemods-legacy/styledictionary/4/instantiating-style-dictionary/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/styledictionary/4/instantiating-style-dictionary/package.json b/codemods-legacy/styledictionary/4/instantiating-style-dictionary/package.json new file mode 100644 index 00000000..331f3ab9 --- /dev/null +++ b/codemods-legacy/styledictionary/4/instantiating-style-dictionary/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/styledictionary-4-instantiating-style-dictionary", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/styledictionary/4/instantiating-style-dictionary/src/index.ts b/codemods-legacy/styledictionary/4/instantiating-style-dictionary/src/index.ts similarity index 100% rename from codemods/styledictionary/4/instantiating-style-dictionary/src/index.ts rename to codemods-legacy/styledictionary/4/instantiating-style-dictionary/src/index.ts diff --git a/codemods-legacy/styledictionary/4/instantiating-style-dictionary/tsconfig.json b/codemods-legacy/styledictionary/4/instantiating-style-dictionary/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/styledictionary/4/instantiating-style-dictionary/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/styledictionary/4/logging/.codemodrc.json b/codemods-legacy/styledictionary/4/logging/.codemodrc.json similarity index 100% rename from codemods/styledictionary/4/logging/.codemodrc.json rename to codemods-legacy/styledictionary/4/logging/.codemodrc.json diff --git a/codemods/styledictionary/4/logging/.gitignore b/codemods-legacy/styledictionary/4/logging/.gitignore similarity index 100% rename from codemods/styledictionary/4/logging/.gitignore rename to codemods-legacy/styledictionary/4/logging/.gitignore diff --git a/codemods/styledictionary/4/logging/LICENSE b/codemods-legacy/styledictionary/4/logging/LICENSE similarity index 100% rename from codemods/styledictionary/4/logging/LICENSE rename to codemods-legacy/styledictionary/4/logging/LICENSE diff --git a/codemods/styledictionary/4/logging/README.md b/codemods-legacy/styledictionary/4/logging/README.md similarity index 100% rename from codemods/styledictionary/4/logging/README.md rename to codemods-legacy/styledictionary/4/logging/README.md diff --git a/codemods/styledictionary/4/logging/__testfixtures__/fixture1.input.ts b/codemods-legacy/styledictionary/4/logging/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/styledictionary/4/logging/__testfixtures__/fixture1.input.ts rename to codemods-legacy/styledictionary/4/logging/__testfixtures__/fixture1.input.ts diff --git a/codemods/styledictionary/4/logging/__testfixtures__/fixture1.output.ts b/codemods-legacy/styledictionary/4/logging/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/styledictionary/4/logging/__testfixtures__/fixture1.output.ts rename to codemods-legacy/styledictionary/4/logging/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/styledictionary/4/logging/package.json b/codemods-legacy/styledictionary/4/logging/package.json new file mode 100644 index 00000000..ded6c933 --- /dev/null +++ b/codemods-legacy/styledictionary/4/logging/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/styledictionary-4-logging", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/styledictionary/4/logging/src/index.ts b/codemods-legacy/styledictionary/4/logging/src/index.ts similarity index 100% rename from codemods/styledictionary/4/logging/src/index.ts rename to codemods-legacy/styledictionary/4/logging/src/index.ts diff --git a/codemods-legacy/styledictionary/4/logging/tsconfig.json b/codemods-legacy/styledictionary/4/logging/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/styledictionary/4/logging/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/styledictionary/4/migration-recipe/.codemodrc.json b/codemods-legacy/styledictionary/4/migration-recipe/.codemodrc.json similarity index 100% rename from codemods/styledictionary/4/migration-recipe/.codemodrc.json rename to codemods-legacy/styledictionary/4/migration-recipe/.codemodrc.json diff --git a/codemods/styledictionary/4/migration-recipe/README.md b/codemods-legacy/styledictionary/4/migration-recipe/README.md similarity index 100% rename from codemods/styledictionary/4/migration-recipe/README.md rename to codemods-legacy/styledictionary/4/migration-recipe/README.md diff --git a/codemods/styledictionary/4/migration-recipe/package.json b/codemods-legacy/styledictionary/4/migration-recipe/package.json similarity index 100% rename from codemods/styledictionary/4/migration-recipe/package.json rename to codemods-legacy/styledictionary/4/migration-recipe/package.json diff --git a/codemods/styledictionary/4/module-common-js/.codemodrc.json b/codemods-legacy/styledictionary/4/module-common-js/.codemodrc.json similarity index 100% rename from codemods/styledictionary/4/module-common-js/.codemodrc.json rename to codemods-legacy/styledictionary/4/module-common-js/.codemodrc.json diff --git a/codemods/styledictionary/4/module-common-js/.gitignore b/codemods-legacy/styledictionary/4/module-common-js/.gitignore similarity index 100% rename from codemods/styledictionary/4/module-common-js/.gitignore rename to codemods-legacy/styledictionary/4/module-common-js/.gitignore diff --git a/codemods/styledictionary/4/module-common-js/LICENSE b/codemods-legacy/styledictionary/4/module-common-js/LICENSE similarity index 100% rename from codemods/styledictionary/4/module-common-js/LICENSE rename to codemods-legacy/styledictionary/4/module-common-js/LICENSE diff --git a/codemods/styledictionary/4/module-common-js/README.md b/codemods-legacy/styledictionary/4/module-common-js/README.md similarity index 100% rename from codemods/styledictionary/4/module-common-js/README.md rename to codemods-legacy/styledictionary/4/module-common-js/README.md diff --git a/codemods/styledictionary/4/module-common-js/__testfixtures__/fixture1.input.ts b/codemods-legacy/styledictionary/4/module-common-js/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/styledictionary/4/module-common-js/__testfixtures__/fixture1.input.ts rename to codemods-legacy/styledictionary/4/module-common-js/__testfixtures__/fixture1.input.ts diff --git a/codemods/styledictionary/4/module-common-js/__testfixtures__/fixture1.output.ts b/codemods-legacy/styledictionary/4/module-common-js/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/styledictionary/4/module-common-js/__testfixtures__/fixture1.output.ts rename to codemods-legacy/styledictionary/4/module-common-js/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/styledictionary/4/module-common-js/package.json b/codemods-legacy/styledictionary/4/module-common-js/package.json new file mode 100644 index 00000000..be134b51 --- /dev/null +++ b/codemods-legacy/styledictionary/4/module-common-js/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/styledictionary-4-module-common-js", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/styledictionary/4/module-common-js/src/index.ts b/codemods-legacy/styledictionary/4/module-common-js/src/index.ts similarity index 100% rename from codemods/styledictionary/4/module-common-js/src/index.ts rename to codemods-legacy/styledictionary/4/module-common-js/src/index.ts diff --git a/codemods-legacy/styledictionary/4/module-common-js/tsconfig.json b/codemods-legacy/styledictionary/4/module-common-js/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/styledictionary/4/module-common-js/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/styledictionary/4/reference-utils/.codemodrc.json b/codemods-legacy/styledictionary/4/reference-utils/.codemodrc.json similarity index 100% rename from codemods/styledictionary/4/reference-utils/.codemodrc.json rename to codemods-legacy/styledictionary/4/reference-utils/.codemodrc.json diff --git a/codemods/styledictionary/4/reference-utils/.gitignore b/codemods-legacy/styledictionary/4/reference-utils/.gitignore similarity index 100% rename from codemods/styledictionary/4/reference-utils/.gitignore rename to codemods-legacy/styledictionary/4/reference-utils/.gitignore diff --git a/codemods/styledictionary/4/reference-utils/LICENSE b/codemods-legacy/styledictionary/4/reference-utils/LICENSE similarity index 100% rename from codemods/styledictionary/4/reference-utils/LICENSE rename to codemods-legacy/styledictionary/4/reference-utils/LICENSE diff --git a/codemods/styledictionary/4/reference-utils/README.md b/codemods-legacy/styledictionary/4/reference-utils/README.md similarity index 100% rename from codemods/styledictionary/4/reference-utils/README.md rename to codemods-legacy/styledictionary/4/reference-utils/README.md diff --git a/codemods/styledictionary/4/reference-utils/__testfixtures__/fixture1.input.ts b/codemods-legacy/styledictionary/4/reference-utils/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/styledictionary/4/reference-utils/__testfixtures__/fixture1.input.ts rename to codemods-legacy/styledictionary/4/reference-utils/__testfixtures__/fixture1.input.ts diff --git a/codemods/styledictionary/4/reference-utils/__testfixtures__/fixture1.output.ts b/codemods-legacy/styledictionary/4/reference-utils/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/styledictionary/4/reference-utils/__testfixtures__/fixture1.output.ts rename to codemods-legacy/styledictionary/4/reference-utils/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/styledictionary/4/reference-utils/package.json b/codemods-legacy/styledictionary/4/reference-utils/package.json new file mode 100644 index 00000000..c423047c --- /dev/null +++ b/codemods-legacy/styledictionary/4/reference-utils/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/styledictionary-4-reference-utils", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/styledictionary/4/reference-utils/src/index.ts b/codemods-legacy/styledictionary/4/reference-utils/src/index.ts similarity index 100% rename from codemods/styledictionary/4/reference-utils/src/index.ts rename to codemods-legacy/styledictionary/4/reference-utils/src/index.ts diff --git a/codemods-legacy/styledictionary/4/reference-utils/tsconfig.json b/codemods-legacy/styledictionary/4/reference-utils/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/styledictionary/4/reference-utils/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/styledictionary/4/type/.codemodrc.json b/codemods-legacy/styledictionary/4/type/.codemodrc.json similarity index 100% rename from codemods/styledictionary/4/type/.codemodrc.json rename to codemods-legacy/styledictionary/4/type/.codemodrc.json diff --git a/codemods/styledictionary/4/type/.gitignore b/codemods-legacy/styledictionary/4/type/.gitignore similarity index 100% rename from codemods/styledictionary/4/type/.gitignore rename to codemods-legacy/styledictionary/4/type/.gitignore diff --git a/codemods/styledictionary/4/type/LICENSE b/codemods-legacy/styledictionary/4/type/LICENSE similarity index 100% rename from codemods/styledictionary/4/type/LICENSE rename to codemods-legacy/styledictionary/4/type/LICENSE diff --git a/codemods/styledictionary/4/type/README.md b/codemods-legacy/styledictionary/4/type/README.md similarity index 100% rename from codemods/styledictionary/4/type/README.md rename to codemods-legacy/styledictionary/4/type/README.md diff --git a/codemods/styledictionary/4/type/__testfixtures__/fixture1.input.ts b/codemods-legacy/styledictionary/4/type/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/styledictionary/4/type/__testfixtures__/fixture1.input.ts rename to codemods-legacy/styledictionary/4/type/__testfixtures__/fixture1.input.ts diff --git a/codemods/styledictionary/4/type/__testfixtures__/fixture1.output.ts b/codemods-legacy/styledictionary/4/type/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/styledictionary/4/type/__testfixtures__/fixture1.output.ts rename to codemods-legacy/styledictionary/4/type/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/styledictionary/4/type/package.json b/codemods-legacy/styledictionary/4/type/package.json new file mode 100644 index 00000000..c159d146 --- /dev/null +++ b/codemods-legacy/styledictionary/4/type/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/styledictionary-4-type", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/styledictionary/4/type/src/index.ts b/codemods-legacy/styledictionary/4/type/src/index.ts similarity index 100% rename from codemods/styledictionary/4/type/src/index.ts rename to codemods-legacy/styledictionary/4/type/src/index.ts diff --git a/codemods-legacy/styledictionary/4/type/tsconfig.json b/codemods-legacy/styledictionary/4/type/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/styledictionary/4/type/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/styledictionary/4/updated-and-removed-transforms/.codemodrc.json b/codemods-legacy/styledictionary/4/updated-and-removed-transforms/.codemodrc.json similarity index 100% rename from codemods/styledictionary/4/updated-and-removed-transforms/.codemodrc.json rename to codemods-legacy/styledictionary/4/updated-and-removed-transforms/.codemodrc.json diff --git a/codemods/styledictionary/4/updated-and-removed-transforms/.gitignore b/codemods-legacy/styledictionary/4/updated-and-removed-transforms/.gitignore similarity index 100% rename from codemods/styledictionary/4/updated-and-removed-transforms/.gitignore rename to codemods-legacy/styledictionary/4/updated-and-removed-transforms/.gitignore diff --git a/codemods/styledictionary/4/updated-and-removed-transforms/LICENSE b/codemods-legacy/styledictionary/4/updated-and-removed-transforms/LICENSE similarity index 100% rename from codemods/styledictionary/4/updated-and-removed-transforms/LICENSE rename to codemods-legacy/styledictionary/4/updated-and-removed-transforms/LICENSE diff --git a/codemods/styledictionary/4/updated-and-removed-transforms/README.md b/codemods-legacy/styledictionary/4/updated-and-removed-transforms/README.md similarity index 100% rename from codemods/styledictionary/4/updated-and-removed-transforms/README.md rename to codemods-legacy/styledictionary/4/updated-and-removed-transforms/README.md diff --git a/codemods/styledictionary/4/updated-and-removed-transforms/__testfixtures__/fixture1.input.ts b/codemods-legacy/styledictionary/4/updated-and-removed-transforms/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/styledictionary/4/updated-and-removed-transforms/__testfixtures__/fixture1.input.ts rename to codemods-legacy/styledictionary/4/updated-and-removed-transforms/__testfixtures__/fixture1.input.ts diff --git a/codemods/styledictionary/4/updated-and-removed-transforms/__testfixtures__/fixture1.output.ts b/codemods-legacy/styledictionary/4/updated-and-removed-transforms/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/styledictionary/4/updated-and-removed-transforms/__testfixtures__/fixture1.output.ts rename to codemods-legacy/styledictionary/4/updated-and-removed-transforms/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/styledictionary/4/updated-and-removed-transforms/package.json b/codemods-legacy/styledictionary/4/updated-and-removed-transforms/package.json new file mode 100644 index 00000000..96d7f53d --- /dev/null +++ b/codemods-legacy/styledictionary/4/updated-and-removed-transforms/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/styledictionary-4-updated-and-removed-transforms", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/styledictionary/4/updated-and-removed-transforms/src/index.ts b/codemods-legacy/styledictionary/4/updated-and-removed-transforms/src/index.ts similarity index 100% rename from codemods/styledictionary/4/updated-and-removed-transforms/src/index.ts rename to codemods-legacy/styledictionary/4/updated-and-removed-transforms/src/index.ts diff --git a/codemods-legacy/styledictionary/4/updated-and-removed-transforms/tsconfig.json b/codemods-legacy/styledictionary/4/updated-and-removed-transforms/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/styledictionary/4/updated-and-removed-transforms/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/svelte/5/components-as-functions-destroyfunction/.codemodrc.json b/codemods-legacy/svelte/5/components-as-functions-destroyfunction/.codemodrc.json similarity index 100% rename from codemods/svelte/5/components-as-functions-destroyfunction/.codemodrc.json rename to codemods-legacy/svelte/5/components-as-functions-destroyfunction/.codemodrc.json diff --git a/codemods/svelte/5/components-as-functions-destroyfunction/.gitignore b/codemods-legacy/svelte/5/components-as-functions-destroyfunction/.gitignore similarity index 100% rename from codemods/svelte/5/components-as-functions-destroyfunction/.gitignore rename to codemods-legacy/svelte/5/components-as-functions-destroyfunction/.gitignore diff --git a/codemods/svelte/5/components-as-functions-destroyfunction/LICENSE b/codemods-legacy/svelte/5/components-as-functions-destroyfunction/LICENSE similarity index 100% rename from codemods/svelte/5/components-as-functions-destroyfunction/LICENSE rename to codemods-legacy/svelte/5/components-as-functions-destroyfunction/LICENSE diff --git a/codemods/svelte/5/components-as-functions-destroyfunction/README.md b/codemods-legacy/svelte/5/components-as-functions-destroyfunction/README.md similarity index 100% rename from codemods/svelte/5/components-as-functions-destroyfunction/README.md rename to codemods-legacy/svelte/5/components-as-functions-destroyfunction/README.md diff --git a/codemods/svelte/5/components-as-functions-destroyfunction/__testfixtures__/fixture1.input.ts b/codemods-legacy/svelte/5/components-as-functions-destroyfunction/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/svelte/5/components-as-functions-destroyfunction/__testfixtures__/fixture1.input.ts rename to codemods-legacy/svelte/5/components-as-functions-destroyfunction/__testfixtures__/fixture1.input.ts diff --git a/codemods/svelte/5/components-as-functions-destroyfunction/__testfixtures__/fixture1.output.ts b/codemods-legacy/svelte/5/components-as-functions-destroyfunction/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/svelte/5/components-as-functions-destroyfunction/__testfixtures__/fixture1.output.ts rename to codemods-legacy/svelte/5/components-as-functions-destroyfunction/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/svelte/5/components-as-functions-destroyfunction/package.json b/codemods-legacy/svelte/5/components-as-functions-destroyfunction/package.json new file mode 100644 index 00000000..dea7aec0 --- /dev/null +++ b/codemods-legacy/svelte/5/components-as-functions-destroyfunction/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/svelte-5-components-as-functions-destroyfunction", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/svelte/5/components-as-functions-destroyfunction/src/index.ts b/codemods-legacy/svelte/5/components-as-functions-destroyfunction/src/index.ts similarity index 100% rename from codemods/svelte/5/components-as-functions-destroyfunction/src/index.ts rename to codemods-legacy/svelte/5/components-as-functions-destroyfunction/src/index.ts diff --git a/codemods-legacy/svelte/5/components-as-functions-destroyfunction/tsconfig.json b/codemods-legacy/svelte/5/components-as-functions-destroyfunction/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/svelte/5/components-as-functions-destroyfunction/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/svelte/5/components-as-functions-onfunction/.codemodrc.json b/codemods-legacy/svelte/5/components-as-functions-onfunction/.codemodrc.json similarity index 100% rename from codemods/svelte/5/components-as-functions-onfunction/.codemodrc.json rename to codemods-legacy/svelte/5/components-as-functions-onfunction/.codemodrc.json diff --git a/codemods/svelte/5/components-as-functions-onfunction/.gitignore b/codemods-legacy/svelte/5/components-as-functions-onfunction/.gitignore similarity index 100% rename from codemods/svelte/5/components-as-functions-onfunction/.gitignore rename to codemods-legacy/svelte/5/components-as-functions-onfunction/.gitignore diff --git a/codemods/svelte/5/components-as-functions-onfunction/LICENSE b/codemods-legacy/svelte/5/components-as-functions-onfunction/LICENSE similarity index 100% rename from codemods/svelte/5/components-as-functions-onfunction/LICENSE rename to codemods-legacy/svelte/5/components-as-functions-onfunction/LICENSE diff --git a/codemods/svelte/5/components-as-functions-onfunction/README.md b/codemods-legacy/svelte/5/components-as-functions-onfunction/README.md similarity index 100% rename from codemods/svelte/5/components-as-functions-onfunction/README.md rename to codemods-legacy/svelte/5/components-as-functions-onfunction/README.md diff --git a/codemods/svelte/5/components-as-functions-onfunction/__testfixtures__/fixture1.input.ts b/codemods-legacy/svelte/5/components-as-functions-onfunction/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/svelte/5/components-as-functions-onfunction/__testfixtures__/fixture1.input.ts rename to codemods-legacy/svelte/5/components-as-functions-onfunction/__testfixtures__/fixture1.input.ts diff --git a/codemods/svelte/5/components-as-functions-onfunction/__testfixtures__/fixture1.output.ts b/codemods-legacy/svelte/5/components-as-functions-onfunction/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/svelte/5/components-as-functions-onfunction/__testfixtures__/fixture1.output.ts rename to codemods-legacy/svelte/5/components-as-functions-onfunction/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/svelte/5/components-as-functions-onfunction/package.json b/codemods-legacy/svelte/5/components-as-functions-onfunction/package.json new file mode 100644 index 00000000..fc1ba41e --- /dev/null +++ b/codemods-legacy/svelte/5/components-as-functions-onfunction/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/svelte-5-components-as-functions-onfunction", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/svelte/5/components-as-functions-onfunction/src/index.ts b/codemods-legacy/svelte/5/components-as-functions-onfunction/src/index.ts similarity index 100% rename from codemods/svelte/5/components-as-functions-onfunction/src/index.ts rename to codemods-legacy/svelte/5/components-as-functions-onfunction/src/index.ts diff --git a/codemods-legacy/svelte/5/components-as-functions-onfunction/tsconfig.json b/codemods-legacy/svelte/5/components-as-functions-onfunction/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/svelte/5/components-as-functions-onfunction/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/svelte/5/components-as-functions/.codemodrc.json b/codemods-legacy/svelte/5/components-as-functions/.codemodrc.json similarity index 100% rename from codemods/svelte/5/components-as-functions/.codemodrc.json rename to codemods-legacy/svelte/5/components-as-functions/.codemodrc.json diff --git a/codemods/svelte/5/components-as-functions/.gitignore b/codemods-legacy/svelte/5/components-as-functions/.gitignore similarity index 100% rename from codemods/svelte/5/components-as-functions/.gitignore rename to codemods-legacy/svelte/5/components-as-functions/.gitignore diff --git a/codemods/svelte/5/components-as-functions/LICENSE b/codemods-legacy/svelte/5/components-as-functions/LICENSE similarity index 100% rename from codemods/svelte/5/components-as-functions/LICENSE rename to codemods-legacy/svelte/5/components-as-functions/LICENSE diff --git a/codemods/svelte/5/components-as-functions/README.md b/codemods-legacy/svelte/5/components-as-functions/README.md similarity index 100% rename from codemods/svelte/5/components-as-functions/README.md rename to codemods-legacy/svelte/5/components-as-functions/README.md diff --git a/codemods/svelte/5/components-as-functions/__testfixtures__/fixture1.input.ts b/codemods-legacy/svelte/5/components-as-functions/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/svelte/5/components-as-functions/__testfixtures__/fixture1.input.ts rename to codemods-legacy/svelte/5/components-as-functions/__testfixtures__/fixture1.input.ts diff --git a/codemods/svelte/5/components-as-functions/__testfixtures__/fixture1.output.ts b/codemods-legacy/svelte/5/components-as-functions/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/svelte/5/components-as-functions/__testfixtures__/fixture1.output.ts rename to codemods-legacy/svelte/5/components-as-functions/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/svelte/5/components-as-functions/package.json b/codemods-legacy/svelte/5/components-as-functions/package.json new file mode 100644 index 00000000..7436d6ec --- /dev/null +++ b/codemods-legacy/svelte/5/components-as-functions/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/svelte-5-components-as-functions", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/svelte/5/components-as-functions/src/index.ts b/codemods-legacy/svelte/5/components-as-functions/src/index.ts similarity index 100% rename from codemods/svelte/5/components-as-functions/src/index.ts rename to codemods-legacy/svelte/5/components-as-functions/src/index.ts diff --git a/codemods-legacy/svelte/5/components-as-functions/tsconfig.json b/codemods-legacy/svelte/5/components-as-functions/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/svelte/5/components-as-functions/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/svelte/5/is-where-scoping/.codemodrc.json b/codemods-legacy/svelte/5/is-where-scoping/.codemodrc.json similarity index 100% rename from codemods/svelte/5/is-where-scoping/.codemodrc.json rename to codemods-legacy/svelte/5/is-where-scoping/.codemodrc.json diff --git a/codemods/svelte/5/is-where-scoping/.gitignore b/codemods-legacy/svelte/5/is-where-scoping/.gitignore similarity index 100% rename from codemods/svelte/5/is-where-scoping/.gitignore rename to codemods-legacy/svelte/5/is-where-scoping/.gitignore diff --git a/codemods/svelte/5/is-where-scoping/LICENSE b/codemods-legacy/svelte/5/is-where-scoping/LICENSE similarity index 100% rename from codemods/svelte/5/is-where-scoping/LICENSE rename to codemods-legacy/svelte/5/is-where-scoping/LICENSE diff --git a/codemods/svelte/5/is-where-scoping/README.md b/codemods-legacy/svelte/5/is-where-scoping/README.md similarity index 100% rename from codemods/svelte/5/is-where-scoping/README.md rename to codemods-legacy/svelte/5/is-where-scoping/README.md diff --git a/codemods/svelte/5/is-where-scoping/__testfixtures__/fixture1.input.ts b/codemods-legacy/svelte/5/is-where-scoping/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/svelte/5/is-where-scoping/__testfixtures__/fixture1.input.ts rename to codemods-legacy/svelte/5/is-where-scoping/__testfixtures__/fixture1.input.ts diff --git a/codemods/svelte/5/is-where-scoping/__testfixtures__/fixture1.output.ts b/codemods-legacy/svelte/5/is-where-scoping/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/svelte/5/is-where-scoping/__testfixtures__/fixture1.output.ts rename to codemods-legacy/svelte/5/is-where-scoping/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/svelte/5/is-where-scoping/package.json b/codemods-legacy/svelte/5/is-where-scoping/package.json new file mode 100644 index 00000000..9f133bc0 --- /dev/null +++ b/codemods-legacy/svelte/5/is-where-scoping/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/svelte-5-is-where-scoping", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/svelte/5/is-where-scoping/src/index.ts b/codemods-legacy/svelte/5/is-where-scoping/src/index.ts similarity index 100% rename from codemods/svelte/5/is-where-scoping/src/index.ts rename to codemods-legacy/svelte/5/is-where-scoping/src/index.ts diff --git a/codemods-legacy/svelte/5/is-where-scoping/tsconfig.json b/codemods-legacy/svelte/5/is-where-scoping/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/svelte/5/is-where-scoping/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/svelte/5/migration-recipe/.codemodrc.json b/codemods-legacy/svelte/5/migration-recipe/.codemodrc.json similarity index 100% rename from codemods/svelte/5/migration-recipe/.codemodrc.json rename to codemods-legacy/svelte/5/migration-recipe/.codemodrc.json diff --git a/codemods/svelte/5/migration-recipe/README.md b/codemods-legacy/svelte/5/migration-recipe/README.md similarity index 100% rename from codemods/svelte/5/migration-recipe/README.md rename to codemods-legacy/svelte/5/migration-recipe/README.md diff --git a/codemods/svelte/5/migration-recipe/package.json b/codemods-legacy/svelte/5/migration-recipe/package.json similarity index 100% rename from codemods/svelte/5/migration-recipe/package.json rename to codemods-legacy/svelte/5/migration-recipe/package.json diff --git a/codemods/svelte/5/server-api-changes/.codemodrc.json b/codemods-legacy/svelte/5/server-api-changes/.codemodrc.json similarity index 100% rename from codemods/svelte/5/server-api-changes/.codemodrc.json rename to codemods-legacy/svelte/5/server-api-changes/.codemodrc.json diff --git a/codemods/svelte/5/server-api-changes/.gitignore b/codemods-legacy/svelte/5/server-api-changes/.gitignore similarity index 100% rename from codemods/svelte/5/server-api-changes/.gitignore rename to codemods-legacy/svelte/5/server-api-changes/.gitignore diff --git a/codemods/svelte/5/server-api-changes/LICENSE b/codemods-legacy/svelte/5/server-api-changes/LICENSE similarity index 100% rename from codemods/svelte/5/server-api-changes/LICENSE rename to codemods-legacy/svelte/5/server-api-changes/LICENSE diff --git a/codemods/svelte/5/server-api-changes/README.md b/codemods-legacy/svelte/5/server-api-changes/README.md similarity index 100% rename from codemods/svelte/5/server-api-changes/README.md rename to codemods-legacy/svelte/5/server-api-changes/README.md diff --git a/codemods/svelte/5/server-api-changes/__testfixtures__/fixture1.input.ts b/codemods-legacy/svelte/5/server-api-changes/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/svelte/5/server-api-changes/__testfixtures__/fixture1.input.ts rename to codemods-legacy/svelte/5/server-api-changes/__testfixtures__/fixture1.input.ts diff --git a/codemods/svelte/5/server-api-changes/__testfixtures__/fixture1.output.ts b/codemods-legacy/svelte/5/server-api-changes/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/svelte/5/server-api-changes/__testfixtures__/fixture1.output.ts rename to codemods-legacy/svelte/5/server-api-changes/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/svelte/5/server-api-changes/package.json b/codemods-legacy/svelte/5/server-api-changes/package.json new file mode 100644 index 00000000..fa38dcfd --- /dev/null +++ b/codemods-legacy/svelte/5/server-api-changes/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/svelte-5-server-api-changes", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/svelte/5/server-api-changes/src/index.ts b/codemods-legacy/svelte/5/server-api-changes/src/index.ts similarity index 100% rename from codemods/svelte/5/server-api-changes/src/index.ts rename to codemods-legacy/svelte/5/server-api-changes/src/index.ts diff --git a/codemods-legacy/svelte/5/server-api-changes/tsconfig.json b/codemods-legacy/svelte/5/server-api-changes/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/svelte/5/server-api-changes/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/svelte/5/svelte-element-expression/.codemodrc.json b/codemods-legacy/svelte/5/svelte-element-expression/.codemodrc.json similarity index 100% rename from codemods/svelte/5/svelte-element-expression/.codemodrc.json rename to codemods-legacy/svelte/5/svelte-element-expression/.codemodrc.json diff --git a/codemods/svelte/5/svelte-element-expression/.gitignore b/codemods-legacy/svelte/5/svelte-element-expression/.gitignore similarity index 100% rename from codemods/svelte/5/svelte-element-expression/.gitignore rename to codemods-legacy/svelte/5/svelte-element-expression/.gitignore diff --git a/codemods/svelte/5/svelte-element-expression/LICENSE b/codemods-legacy/svelte/5/svelte-element-expression/LICENSE similarity index 100% rename from codemods/svelte/5/svelte-element-expression/LICENSE rename to codemods-legacy/svelte/5/svelte-element-expression/LICENSE diff --git a/codemods/svelte/5/svelte-element-expression/README.md b/codemods-legacy/svelte/5/svelte-element-expression/README.md similarity index 100% rename from codemods/svelte/5/svelte-element-expression/README.md rename to codemods-legacy/svelte/5/svelte-element-expression/README.md diff --git a/codemods/svelte/5/svelte-element-expression/__testfixtures__/fixture1.input.ts b/codemods-legacy/svelte/5/svelte-element-expression/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/svelte/5/svelte-element-expression/__testfixtures__/fixture1.input.ts rename to codemods-legacy/svelte/5/svelte-element-expression/__testfixtures__/fixture1.input.ts diff --git a/codemods/svelte/5/svelte-element-expression/__testfixtures__/fixture1.output.ts b/codemods-legacy/svelte/5/svelte-element-expression/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/svelte/5/svelte-element-expression/__testfixtures__/fixture1.output.ts rename to codemods-legacy/svelte/5/svelte-element-expression/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/svelte/5/svelte-element-expression/package.json b/codemods-legacy/svelte/5/svelte-element-expression/package.json new file mode 100644 index 00000000..1519daf2 --- /dev/null +++ b/codemods-legacy/svelte/5/svelte-element-expression/package.json @@ -0,0 +1,16 @@ +{ + "name": "@codemod/svelte-5-svelte-element-expression", + "private": true, + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1", + "@types/jscodeshift": "^0.11.10" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/svelte/5/svelte-element-expression/src/index.ts b/codemods-legacy/svelte/5/svelte-element-expression/src/index.ts similarity index 100% rename from codemods/svelte/5/svelte-element-expression/src/index.ts rename to codemods-legacy/svelte/5/svelte-element-expression/src/index.ts diff --git a/codemods-legacy/svelte/5/svelte-element-expression/tsconfig.json b/codemods-legacy/svelte/5/svelte-element-expression/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/svelte/5/svelte-element-expression/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/tanStack/codeSplitting/.codemodrc.json b/codemods-legacy/tanStack/codeSplitting/.codemodrc.json similarity index 100% rename from codemods/tanStack/codeSplitting/.codemodrc.json rename to codemods-legacy/tanStack/codeSplitting/.codemodrc.json diff --git a/codemods/tanStack/codeSplitting/.gitignore b/codemods-legacy/tanStack/codeSplitting/.gitignore similarity index 100% rename from codemods/tanStack/codeSplitting/.gitignore rename to codemods-legacy/tanStack/codeSplitting/.gitignore diff --git a/codemods/tanStack/codeSplitting/LICENSE b/codemods-legacy/tanStack/codeSplitting/LICENSE similarity index 100% rename from codemods/tanStack/codeSplitting/LICENSE rename to codemods-legacy/tanStack/codeSplitting/LICENSE diff --git a/codemods/tanStack/codeSplitting/README.md b/codemods-legacy/tanStack/codeSplitting/README.md similarity index 100% rename from codemods/tanStack/codeSplitting/README.md rename to codemods-legacy/tanStack/codeSplitting/README.md diff --git a/codemods-legacy/tanStack/codeSplitting/package.json b/codemods-legacy/tanStack/codeSplitting/package.json new file mode 100644 index 00000000..ebeb5450 --- /dev/null +++ b/codemods-legacy/tanStack/codeSplitting/package.json @@ -0,0 +1,20 @@ +{ + "name": "tanStackRouter-CodeSplitting", + "private": true, + "license": "MIT", + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.9.0", + "typescript": "^5.5.4" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "dependencies": { + "@codemod.com/workflow": "^0.0.31", + "fast-glob": "^3.3.2" + } +} diff --git a/codemods/tanStack/codeSplitting/src/index.ts b/codemods-legacy/tanStack/codeSplitting/src/index.ts similarity index 100% rename from codemods/tanStack/codeSplitting/src/index.ts rename to codemods-legacy/tanStack/codeSplitting/src/index.ts diff --git a/codemods-legacy/tanStack/codeSplitting/tsconfig.json b/codemods-legacy/tanStack/codeSplitting/tsconfig.json new file mode 100644 index 00000000..93cee26a --- /dev/null +++ b/codemods-legacy/tanStack/codeSplitting/tsconfig.json @@ -0,0 +1,21 @@ +{ + "compilerOptions": { + "outDir": "./dist", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "isolatedModules": true, + "module": "NodeNext", + "skipLibCheck": true, + "strict": true, + "target": "ES6", + "allowJs": true, + "noUncheckedIndexedAccess": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/three/r168/deactivate-to-disconnect/.codemodrc.json b/codemods-legacy/three/r168/deactivate-to-disconnect/.codemodrc.json similarity index 100% rename from codemods/three/r168/deactivate-to-disconnect/.codemodrc.json rename to codemods-legacy/three/r168/deactivate-to-disconnect/.codemodrc.json diff --git a/codemods/three/r168/deactivate-to-disconnect/.gitignore b/codemods-legacy/three/r168/deactivate-to-disconnect/.gitignore similarity index 100% rename from codemods/three/r168/deactivate-to-disconnect/.gitignore rename to codemods-legacy/three/r168/deactivate-to-disconnect/.gitignore diff --git a/codemods/three/r168/deactivate-to-disconnect/LICENSE b/codemods-legacy/three/r168/deactivate-to-disconnect/LICENSE similarity index 100% rename from codemods/three/r168/deactivate-to-disconnect/LICENSE rename to codemods-legacy/three/r168/deactivate-to-disconnect/LICENSE diff --git a/codemods/three/r168/deactivate-to-disconnect/README.md b/codemods-legacy/three/r168/deactivate-to-disconnect/README.md similarity index 100% rename from codemods/three/r168/deactivate-to-disconnect/README.md rename to codemods-legacy/three/r168/deactivate-to-disconnect/README.md diff --git a/codemods/three/r168/deactivate-to-disconnect/__testfixtures__/fixture1.input.ts b/codemods-legacy/three/r168/deactivate-to-disconnect/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/three/r168/deactivate-to-disconnect/__testfixtures__/fixture1.input.ts rename to codemods-legacy/three/r168/deactivate-to-disconnect/__testfixtures__/fixture1.input.ts diff --git a/codemods/three/r168/deactivate-to-disconnect/__testfixtures__/fixture1.output.ts b/codemods-legacy/three/r168/deactivate-to-disconnect/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/three/r168/deactivate-to-disconnect/__testfixtures__/fixture1.output.ts rename to codemods-legacy/three/r168/deactivate-to-disconnect/__testfixtures__/fixture1.output.ts diff --git a/codemods/three/r168/deactivate-to-disconnect/__testfixtures__/fixture2.input.ts b/codemods-legacy/three/r168/deactivate-to-disconnect/__testfixtures__/fixture2.input.ts similarity index 100% rename from codemods/three/r168/deactivate-to-disconnect/__testfixtures__/fixture2.input.ts rename to codemods-legacy/three/r168/deactivate-to-disconnect/__testfixtures__/fixture2.input.ts diff --git a/codemods/three/r168/deactivate-to-disconnect/__testfixtures__/fixture2.output.ts b/codemods-legacy/three/r168/deactivate-to-disconnect/__testfixtures__/fixture2.output.ts similarity index 100% rename from codemods/three/r168/deactivate-to-disconnect/__testfixtures__/fixture2.output.ts rename to codemods-legacy/three/r168/deactivate-to-disconnect/__testfixtures__/fixture2.output.ts diff --git a/codemods-legacy/three/r168/deactivate-to-disconnect/package.json b/codemods-legacy/three/r168/deactivate-to-disconnect/package.json new file mode 100644 index 00000000..7d45c681 --- /dev/null +++ b/codemods-legacy/three/r168/deactivate-to-disconnect/package.json @@ -0,0 +1,24 @@ +{ + "name": "deactivate-to-disconnect", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "vitest": "^1.0.1", + "jscodeshift": "^0.15.1" + }, + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "yugal41735" +} diff --git a/codemods/three/r168/deactivate-to-disconnect/src/index.ts b/codemods-legacy/three/r168/deactivate-to-disconnect/src/index.ts similarity index 100% rename from codemods/three/r168/deactivate-to-disconnect/src/index.ts rename to codemods-legacy/three/r168/deactivate-to-disconnect/src/index.ts diff --git a/codemods-legacy/three/r168/deactivate-to-disconnect/test/test.ts b/codemods-legacy/three/r168/deactivate-to-disconnect/test/test.ts new file mode 100644 index 00000000..8ea257f6 --- /dev/null +++ b/codemods-legacy/three/r168/deactivate-to-disconnect/test/test.ts @@ -0,0 +1,76 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; +import { readFile } from "node:fs/promises"; +import { join } from "node:path"; +import jscodeshift from "jscodeshift"; +import type { API } from "jscodeshift"; +import transform from "../src/index.ts"; + +const __dirname = new URL(".", import.meta.url).pathname; + +const buildApi = (parser: string | undefined): API => ({ + j: parser ? jscodeshift.withParser(parser) : jscodeshift, + jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, + stats: () => { + console.error( + "The stats function was called, which is not supported on purpose", + ); + }, + report: () => { + console.error( + "The report function was called, which is not supported on purpose", + ); + }, +}); + +describe("deactivate-to-disconnect", () => { + it("test #1", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); + + it("test #2", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture2.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture2.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); +}); diff --git a/codemods-legacy/three/r168/deactivate-to-disconnect/tsconfig.json b/codemods-legacy/three/r168/deactivate-to-disconnect/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/three/r168/deactivate-to-disconnect/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/three/r168/drag-controls-to-connect/.codemodrc.json b/codemods-legacy/three/r168/drag-controls-to-connect/.codemodrc.json similarity index 100% rename from codemods/three/r168/drag-controls-to-connect/.codemodrc.json rename to codemods-legacy/three/r168/drag-controls-to-connect/.codemodrc.json diff --git a/codemods/three/r168/drag-controls-to-connect/.gitignore b/codemods-legacy/three/r168/drag-controls-to-connect/.gitignore similarity index 100% rename from codemods/three/r168/drag-controls-to-connect/.gitignore rename to codemods-legacy/three/r168/drag-controls-to-connect/.gitignore diff --git a/codemods/three/r168/drag-controls-to-connect/LICENSE b/codemods-legacy/three/r168/drag-controls-to-connect/LICENSE similarity index 100% rename from codemods/three/r168/drag-controls-to-connect/LICENSE rename to codemods-legacy/three/r168/drag-controls-to-connect/LICENSE diff --git a/codemods/three/r168/drag-controls-to-connect/README.md b/codemods-legacy/three/r168/drag-controls-to-connect/README.md similarity index 100% rename from codemods/three/r168/drag-controls-to-connect/README.md rename to codemods-legacy/three/r168/drag-controls-to-connect/README.md diff --git a/codemods/three/r168/drag-controls-to-connect/__testfixtures__/fixture1.input.ts b/codemods-legacy/three/r168/drag-controls-to-connect/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/three/r168/drag-controls-to-connect/__testfixtures__/fixture1.input.ts rename to codemods-legacy/three/r168/drag-controls-to-connect/__testfixtures__/fixture1.input.ts diff --git a/codemods/three/r168/drag-controls-to-connect/__testfixtures__/fixture1.output.ts b/codemods-legacy/three/r168/drag-controls-to-connect/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/three/r168/drag-controls-to-connect/__testfixtures__/fixture1.output.ts rename to codemods-legacy/three/r168/drag-controls-to-connect/__testfixtures__/fixture1.output.ts diff --git a/codemods/three/r168/drag-controls-to-connect/__testfixtures__/fixture2.input.ts b/codemods-legacy/three/r168/drag-controls-to-connect/__testfixtures__/fixture2.input.ts similarity index 100% rename from codemods/three/r168/drag-controls-to-connect/__testfixtures__/fixture2.input.ts rename to codemods-legacy/three/r168/drag-controls-to-connect/__testfixtures__/fixture2.input.ts diff --git a/codemods/three/r168/drag-controls-to-connect/__testfixtures__/fixture2.output.ts b/codemods-legacy/three/r168/drag-controls-to-connect/__testfixtures__/fixture2.output.ts similarity index 100% rename from codemods/three/r168/drag-controls-to-connect/__testfixtures__/fixture2.output.ts rename to codemods-legacy/three/r168/drag-controls-to-connect/__testfixtures__/fixture2.output.ts diff --git a/codemods-legacy/three/r168/drag-controls-to-connect/package.json b/codemods-legacy/three/r168/drag-controls-to-connect/package.json new file mode 100644 index 00000000..27f8d225 --- /dev/null +++ b/codemods-legacy/three/r168/drag-controls-to-connect/package.json @@ -0,0 +1,23 @@ +{ + "name": "drag-controls-to-connect", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1" + }, + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "yugal41735" +} diff --git a/codemods/three/r168/drag-controls-to-connect/src/index.ts b/codemods-legacy/three/r168/drag-controls-to-connect/src/index.ts similarity index 100% rename from codemods/three/r168/drag-controls-to-connect/src/index.ts rename to codemods-legacy/three/r168/drag-controls-to-connect/src/index.ts diff --git a/codemods-legacy/three/r168/drag-controls-to-connect/test/test.ts b/codemods-legacy/three/r168/drag-controls-to-connect/test/test.ts new file mode 100644 index 00000000..f6d07613 --- /dev/null +++ b/codemods-legacy/three/r168/drag-controls-to-connect/test/test.ts @@ -0,0 +1,76 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; +import { readFile } from "node:fs/promises"; +import { join } from "node:path"; +import jscodeshift from "jscodeshift"; +import type { API } from "jscodeshift"; +import transform from "../src/index.ts"; + +const __dirname = new URL(".", import.meta.url).pathname; + +const buildApi = (parser: string | undefined): API => ({ + j: parser ? jscodeshift.withParser(parser) : jscodeshift, + jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, + stats: () => { + console.error( + "The stats function was called, which is not supported on purpose", + ); + }, + report: () => { + console.error( + "The report function was called, which is not supported on purpose", + ); + }, +}); + +describe("drag-controls-to-connect", () => { + it("test #1", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); + + it("test #2", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture2.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture2.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); +}); diff --git a/codemods-legacy/three/r168/drag-controls-to-connect/tsconfig.json b/codemods-legacy/three/r168/drag-controls-to-connect/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/three/r168/drag-controls-to-connect/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/three/r168/replace-dragcontrols-getraycaster/.codemodrc.json b/codemods-legacy/three/r168/replace-dragcontrols-getraycaster/.codemodrc.json similarity index 100% rename from codemods/three/r168/replace-dragcontrols-getraycaster/.codemodrc.json rename to codemods-legacy/three/r168/replace-dragcontrols-getraycaster/.codemodrc.json diff --git a/codemods/three/r168/pointer-lock-controls-to-controls-object/.gitignore b/codemods-legacy/three/r168/replace-dragcontrols-getraycaster/.gitignore similarity index 100% rename from codemods/three/r168/pointer-lock-controls-to-controls-object/.gitignore rename to codemods-legacy/three/r168/replace-dragcontrols-getraycaster/.gitignore diff --git a/codemods/three/r168/pointer-lock-controls-to-controls-object/LICENSE b/codemods-legacy/three/r168/replace-dragcontrols-getraycaster/LICENSE similarity index 100% rename from codemods/three/r168/pointer-lock-controls-to-controls-object/LICENSE rename to codemods-legacy/three/r168/replace-dragcontrols-getraycaster/LICENSE diff --git a/codemods/three/r168/replace-dragcontrols-getraycaster/README.md b/codemods-legacy/three/r168/replace-dragcontrols-getraycaster/README.md similarity index 100% rename from codemods/three/r168/replace-dragcontrols-getraycaster/README.md rename to codemods-legacy/three/r168/replace-dragcontrols-getraycaster/README.md diff --git a/codemods/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture1.input.ts b/codemods-legacy/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture1.input.ts rename to codemods-legacy/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture1.input.ts diff --git a/codemods/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture1.output.ts b/codemods-legacy/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture1.output.ts rename to codemods-legacy/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture1.output.ts diff --git a/codemods/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture2.input.ts b/codemods-legacy/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture2.input.ts similarity index 100% rename from codemods/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture2.input.ts rename to codemods-legacy/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture2.input.ts diff --git a/codemods/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture2.output.ts b/codemods-legacy/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture2.output.ts similarity index 100% rename from codemods/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture2.output.ts rename to codemods-legacy/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture2.output.ts diff --git a/codemods/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture3.input.ts b/codemods-legacy/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture3.input.ts similarity index 100% rename from codemods/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture3.input.ts rename to codemods-legacy/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture3.input.ts diff --git a/codemods/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture3.output.ts b/codemods-legacy/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture3.output.ts similarity index 100% rename from codemods/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture3.output.ts rename to codemods-legacy/three/r168/replace-dragcontrols-getraycaster/__testfixtures__/fixture3.output.ts diff --git a/codemods-legacy/three/r168/replace-dragcontrols-getraycaster/package.json b/codemods-legacy/three/r168/replace-dragcontrols-getraycaster/package.json new file mode 100644 index 00000000..691e7ae7 --- /dev/null +++ b/codemods-legacy/three/r168/replace-dragcontrols-getraycaster/package.json @@ -0,0 +1,23 @@ +{ + "name": "threejs-replace-dragcontrols-getraycaster", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1" + }, + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "yugal41735" +} diff --git a/codemods/three/r168/replace-dragcontrols-getraycaster/src/index.ts b/codemods-legacy/three/r168/replace-dragcontrols-getraycaster/src/index.ts similarity index 100% rename from codemods/three/r168/replace-dragcontrols-getraycaster/src/index.ts rename to codemods-legacy/three/r168/replace-dragcontrols-getraycaster/src/index.ts diff --git a/codemods-legacy/three/r168/replace-dragcontrols-getraycaster/test/test.ts b/codemods-legacy/three/r168/replace-dragcontrols-getraycaster/test/test.ts new file mode 100644 index 00000000..7bb3bc42 --- /dev/null +++ b/codemods-legacy/three/r168/replace-dragcontrols-getraycaster/test/test.ts @@ -0,0 +1,101 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; +import { readFile } from "node:fs/promises"; +import { join } from "node:path"; +import jscodeshift from "jscodeshift"; +import type { API } from "jscodeshift"; +import transform from "../src/index.ts"; + +const __dirname = new URL(".", import.meta.url).pathname; + +const buildApi = (parser: string | undefined): API => ({ + j: parser ? jscodeshift.withParser(parser) : jscodeshift, + jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, + stats: () => { + console.error( + "The stats function was called, which is not supported on purpose", + ); + }, + report: () => { + console.error( + "The report function was called, which is not supported on purpose", + ); + }, +}); + +describe("threejs/replace-dragcontrols-getraycaster", () => { + it("test #1", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); + + it("test #2", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture2.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture2.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); + + it("test #3", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture3.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture3.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); +}); diff --git a/codemods-legacy/three/r168/replace-dragcontrols-getraycaster/tsconfig.json b/codemods-legacy/three/r168/replace-dragcontrols-getraycaster/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/three/r168/replace-dragcontrols-getraycaster/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/.codemodrc.json b/codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/.codemodrc.json similarity index 100% rename from codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/.codemodrc.json rename to codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/.codemodrc.json diff --git a/codemods/three/r168/replace-dragcontrols-getraycaster/.gitignore b/codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/.gitignore similarity index 100% rename from codemods/three/r168/replace-dragcontrols-getraycaster/.gitignore rename to codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/.gitignore diff --git a/codemods/three/r168/replace-dragcontrols-getraycaster/LICENSE b/codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/LICENSE similarity index 100% rename from codemods/three/r168/replace-dragcontrols-getraycaster/LICENSE rename to codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/LICENSE diff --git a/codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/README.md b/codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/README.md similarity index 100% rename from codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/README.md rename to codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/README.md diff --git a/codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/__testfixtures__/fixture1.input.ts b/codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/__testfixtures__/fixture1.input.ts rename to codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/__testfixtures__/fixture1.input.ts diff --git a/codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/__testfixtures__/fixture1.output.ts b/codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/__testfixtures__/fixture1.output.ts rename to codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/__testfixtures__/fixture1.output.ts diff --git a/codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/__testfixtures__/fixture2.input.ts b/codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/__testfixtures__/fixture2.input.ts similarity index 100% rename from codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/__testfixtures__/fixture2.input.ts rename to codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/__testfixtures__/fixture2.input.ts diff --git a/codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/__testfixtures__/fixture2.output.ts b/codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/__testfixtures__/fixture2.output.ts similarity index 100% rename from codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/__testfixtures__/fixture2.output.ts rename to codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/__testfixtures__/fixture2.output.ts diff --git a/codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/package.json b/codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/package.json new file mode 100644 index 00000000..755de1d5 --- /dev/null +++ b/codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/package.json @@ -0,0 +1,23 @@ +{ + "name": "replace-viewport-bottom-left-with-viewportuv-flipy", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1" + }, + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "yugal41735" +} diff --git a/codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/src/index.ts b/codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/src/index.ts similarity index 100% rename from codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/src/index.ts rename to codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/src/index.ts diff --git a/codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/test/test.ts b/codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/test/test.ts new file mode 100644 index 00000000..136988b2 --- /dev/null +++ b/codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/test/test.ts @@ -0,0 +1,76 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; +import { readFile } from "node:fs/promises"; +import { join } from "node:path"; +import jscodeshift from "jscodeshift"; +import type { API } from "jscodeshift"; +import transform from "../src/index.ts"; + +const __dirname = new URL(".", import.meta.url).pathname; + +const buildApi = (parser: string | undefined): API => ({ + j: parser ? jscodeshift.withParser(parser) : jscodeshift, + jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, + stats: () => { + console.error( + "The stats function was called, which is not supported on purpose", + ); + }, + report: () => { + console.error( + "The report function was called, which is not supported on purpose", + ); + }, +}); + +describe("replace-viewport-bottom-left-with-viewportuv-flipy", () => { + it("test #1", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); + + it("test #2", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture2.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture2.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); +}); diff --git a/codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/tsconfig.json b/codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/three/r168/replace-viewport-top-left-with-viewport-uv/.codemodrc.json b/codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/.codemodrc.json similarity index 100% rename from codemods/three/r168/replace-viewport-top-left-with-viewport-uv/.codemodrc.json rename to codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/.codemodrc.json diff --git a/codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/.gitignore b/codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/.gitignore similarity index 100% rename from codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/.gitignore rename to codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/.gitignore diff --git a/codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/LICENSE b/codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/LICENSE similarity index 100% rename from codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/LICENSE rename to codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/LICENSE diff --git a/codemods/three/r168/replace-viewport-top-left-with-viewport-uv/README.md b/codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/README.md similarity index 100% rename from codemods/three/r168/replace-viewport-top-left-with-viewport-uv/README.md rename to codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/README.md diff --git a/codemods/three/r168/replace-viewport-top-left-with-viewport-uv/__testfixtures__/fixture1.input.ts b/codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/three/r168/replace-viewport-top-left-with-viewport-uv/__testfixtures__/fixture1.input.ts rename to codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/__testfixtures__/fixture1.input.ts diff --git a/codemods/three/r168/replace-viewport-top-left-with-viewport-uv/__testfixtures__/fixture1.output.ts b/codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/three/r168/replace-viewport-top-left-with-viewport-uv/__testfixtures__/fixture1.output.ts rename to codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/__testfixtures__/fixture1.output.ts diff --git a/codemods/three/r168/replace-viewport-top-left-with-viewport-uv/__testfixtures__/fixture2.input.ts b/codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/__testfixtures__/fixture2.input.ts similarity index 100% rename from codemods/three/r168/replace-viewport-top-left-with-viewport-uv/__testfixtures__/fixture2.input.ts rename to codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/__testfixtures__/fixture2.input.ts diff --git a/codemods/three/r168/replace-viewport-top-left-with-viewport-uv/__testfixtures__/fixture2.output.ts b/codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/__testfixtures__/fixture2.output.ts similarity index 100% rename from codemods/three/r168/replace-viewport-top-left-with-viewport-uv/__testfixtures__/fixture2.output.ts rename to codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/__testfixtures__/fixture2.output.ts diff --git a/codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/package.json b/codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/package.json new file mode 100644 index 00000000..7d7b6c04 --- /dev/null +++ b/codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/package.json @@ -0,0 +1,24 @@ +{ + "name": "replace-viewport-top-left-with-viewport-uv", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "vitest": "^1.0.1", + "jscodeshift": "^0.15.1" + }, + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "yugal41735" +} diff --git a/codemods/three/r168/replace-viewport-top-left-with-viewport-uv/src/index.ts b/codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/src/index.ts similarity index 100% rename from codemods/three/r168/replace-viewport-top-left-with-viewport-uv/src/index.ts rename to codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/src/index.ts diff --git a/codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/test/test.ts b/codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/test/test.ts new file mode 100644 index 00000000..e95f117d --- /dev/null +++ b/codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/test/test.ts @@ -0,0 +1,76 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; +import { readFile } from "node:fs/promises"; +import { join } from "node:path"; +import jscodeshift from "jscodeshift"; +import type { API } from "jscodeshift"; +import transform from "../src/index.ts"; + +const __dirname = new URL(".", import.meta.url).pathname; + +const buildApi = (parser: string | undefined): API => ({ + j: parser ? jscodeshift.withParser(parser) : jscodeshift, + jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, + stats: () => { + console.error( + "The stats function was called, which is not supported on purpose", + ); + }, + report: () => { + console.error( + "The report function was called, which is not supported on purpose", + ); + }, +}); + +describe("replace-viewport-top-left-with-viewport-uv", () => { + it("test #1", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); + + it("test #2", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture2.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture2.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); +}); diff --git a/codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/tsconfig.json b/codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/three/r168/three_migration_recipe/.codemodrc.json b/codemods-legacy/three/r168/three_migration_recipe/.codemodrc.json similarity index 100% rename from codemods/three/r168/three_migration_recipe/.codemodrc.json rename to codemods-legacy/three/r168/three_migration_recipe/.codemodrc.json diff --git a/codemods/three/r168/three_migration_recipe/README.md b/codemods-legacy/three/r168/three_migration_recipe/README.md similarity index 100% rename from codemods/three/r168/three_migration_recipe/README.md rename to codemods-legacy/three/r168/three_migration_recipe/README.md diff --git a/codemods/three/r168/three_migration_recipe/package.json b/codemods-legacy/three/r168/three_migration_recipe/package.json similarity index 100% rename from codemods/three/r168/three_migration_recipe/package.json rename to codemods-legacy/three/r168/three_migration_recipe/package.json diff --git a/codemods/three/r168/transform_logluvloader/.codemodrc.json b/codemods-legacy/three/r168/transform_logluvloader/.codemodrc.json similarity index 100% rename from codemods/three/r168/transform_logluvloader/.codemodrc.json rename to codemods-legacy/three/r168/transform_logluvloader/.codemodrc.json diff --git a/codemods/three/r168/replace-viewport-top-left-with-viewport-uv/.gitignore b/codemods-legacy/three/r168/transform_logluvloader/.gitignore similarity index 100% rename from codemods/three/r168/replace-viewport-top-left-with-viewport-uv/.gitignore rename to codemods-legacy/three/r168/transform_logluvloader/.gitignore diff --git a/codemods/three/r168/replace-viewport-top-left-with-viewport-uv/LICENSE b/codemods-legacy/three/r168/transform_logluvloader/LICENSE similarity index 100% rename from codemods/three/r168/replace-viewport-top-left-with-viewport-uv/LICENSE rename to codemods-legacy/three/r168/transform_logluvloader/LICENSE diff --git a/codemods/three/r168/transform_logluvloader/README.md b/codemods-legacy/three/r168/transform_logluvloader/README.md similarity index 100% rename from codemods/three/r168/transform_logluvloader/README.md rename to codemods-legacy/three/r168/transform_logluvloader/README.md diff --git a/codemods/three/r168/transform_logluvloader/__testfixtures__/fixture1.input.ts b/codemods-legacy/three/r168/transform_logluvloader/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/three/r168/transform_logluvloader/__testfixtures__/fixture1.input.ts rename to codemods-legacy/three/r168/transform_logluvloader/__testfixtures__/fixture1.input.ts diff --git a/codemods/three/r168/transform_logluvloader/__testfixtures__/fixture1.output.ts b/codemods-legacy/three/r168/transform_logluvloader/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/three/r168/transform_logluvloader/__testfixtures__/fixture1.output.ts rename to codemods-legacy/three/r168/transform_logluvloader/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/three/r168/transform_logluvloader/package.json b/codemods-legacy/three/r168/transform_logluvloader/package.json new file mode 100644 index 00000000..6ec8e9f8 --- /dev/null +++ b/codemods-legacy/three/r168/transform_logluvloader/package.json @@ -0,0 +1,23 @@ +{ + "name": "three-transform-logluvloader", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1" + }, + "scripts": { + "test": "node --test", + "test:watch": "node --test" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "yugal41735" +} diff --git a/codemods-legacy/three/r168/transform_logluvloader/src/index.ts b/codemods-legacy/three/r168/transform_logluvloader/src/index.ts new file mode 100644 index 00000000..2cf15cb2 --- /dev/null +++ b/codemods-legacy/three/r168/transform_logluvloader/src/index.ts @@ -0,0 +1,79 @@ +import type { API, FileInfo } from "jscodeshift"; + +export default function transformer(fileInfo: FileInfo, api: API) { + const j = api.jscodeshift; + const root = j(fileInfo.source); + + // Replace import declarations + root.find(j.ImportDeclaration).forEach((path) => { + path.node.specifiers.forEach((specifier) => { + if (specifier.imported && specifier.imported.name === "LogLuvLoader") { + specifier.imported.name = "UltraHDRLoader"; + specifier.local.name = "UltraHDRLoader"; + } + }); + + // Also replace the source path if it contains LogLuvLoader + if (path.node.source.value.includes("LogLuvLoader")) { + path.node.source.value = path.node.source.value.replace( + "LogLuvLoader", + "UltraHDRLoader", + ); + } + }); + + // Replace export statements + root.find(j.ExportAllDeclaration).forEach((path) => { + if (path.node.source && path.node.source.value.includes("LogLuvLoader")) { + path.node.source.value = path.node.source.value.replace( + "LogLuvLoader", + "UltraHDRLoader", + ); + } + }); + + // Replace New Expressions (instantiation) + root + .find(j.NewExpression, { callee: { name: "LogLuvLoader" } }) + .forEach((path) => { + path.node.callee.name = "UltraHDRLoader"; + }); + + // Replace identifiers and any other usage + root.find(j.Identifier, { name: "LogLuvLoader" }).forEach((path) => { + path.node.name = "UltraHDRLoader"; + }); + + // Replace strings that contain 'LogLuvLoader' + root + .find(j.Literal) + .filter( + (path) => + typeof path.node.value === "string" && + path.node.value.includes("LogLuvLoader"), + ) + .forEach((path) => { + path.node.value = path.node.value.replace( + /LogLuvLoader/g, + "UltraHDRLoader", + ); + }); + + // Replace Template Literals that contain 'LogLuvLoader' + root.find(j.TemplateLiteral).forEach((path) => { + path.node.quasis.forEach((quasi) => { + if (quasi.value.raw.includes("LogLuvLoader")) { + quasi.value.raw = quasi.value.raw.replace( + /LogLuvLoader/g, + "UltraHDRLoader", + ); + quasi.value.cooked = quasi.value.cooked.replace( + /LogLuvLoader/g, + "UltraHDRLoader", + ); + } + }); + }); + + return root.toSource(); +} diff --git a/codemods-legacy/three/r168/transform_logluvloader/test/test.ts b/codemods-legacy/three/r168/transform_logluvloader/test/test.ts new file mode 100644 index 00000000..0aaded2b --- /dev/null +++ b/codemods-legacy/three/r168/transform_logluvloader/test/test.ts @@ -0,0 +1,51 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; +import { readFile } from "node:fs/promises"; +import { join } from "node:path"; +import jscodeshift from "jscodeshift"; +import type { API } from "jscodeshift"; +import transform from "../src/index.ts"; + +const __dirname = new URL(".", import.meta.url).pathname; + +const buildApi = (parser: string | undefined): API => ({ + j: parser ? jscodeshift.withParser(parser) : jscodeshift, + jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, + stats: () => { + console.error( + "The stats function was called, which is not supported on purpose", + ); + }, + report: () => { + console.error( + "The report function was called, which is not supported on purpose", + ); + }, +}); + +describe("three_transform_logluvloader", () => { + it("test #1", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); +}); diff --git a/codemods-legacy/three/r168/transform_logluvloader/tsconfig.json b/codemods-legacy/three/r168/transform_logluvloader/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/three/r168/transform_logluvloader/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/three/r168/uniforms-to-uniformarray/.codemodrc.json b/codemods-legacy/three/r168/uniforms-to-uniformarray/.codemodrc.json similarity index 100% rename from codemods/three/r168/uniforms-to-uniformarray/.codemodrc.json rename to codemods-legacy/three/r168/uniforms-to-uniformarray/.codemodrc.json diff --git a/codemods/three/r168/transform_logluvloader/.gitignore b/codemods-legacy/three/r168/uniforms-to-uniformarray/.gitignore similarity index 100% rename from codemods/three/r168/transform_logluvloader/.gitignore rename to codemods-legacy/three/r168/uniforms-to-uniformarray/.gitignore diff --git a/codemods/three/r168/transform_logluvloader/LICENSE b/codemods-legacy/three/r168/uniforms-to-uniformarray/LICENSE similarity index 100% rename from codemods/three/r168/transform_logluvloader/LICENSE rename to codemods-legacy/three/r168/uniforms-to-uniformarray/LICENSE diff --git a/codemods/three/r168/uniforms-to-uniformarray/README.md b/codemods-legacy/three/r168/uniforms-to-uniformarray/README.md similarity index 100% rename from codemods/three/r168/uniforms-to-uniformarray/README.md rename to codemods-legacy/three/r168/uniforms-to-uniformarray/README.md diff --git a/codemods/three/r168/uniforms-to-uniformarray/__testfixtures__/fixture1.input.ts b/codemods-legacy/three/r168/uniforms-to-uniformarray/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/three/r168/uniforms-to-uniformarray/__testfixtures__/fixture1.input.ts rename to codemods-legacy/three/r168/uniforms-to-uniformarray/__testfixtures__/fixture1.input.ts diff --git a/codemods/three/r168/uniforms-to-uniformarray/__testfixtures__/fixture1.output.ts b/codemods-legacy/three/r168/uniforms-to-uniformarray/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/three/r168/uniforms-to-uniformarray/__testfixtures__/fixture1.output.ts rename to codemods-legacy/three/r168/uniforms-to-uniformarray/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/three/r168/uniforms-to-uniformarray/package.json b/codemods-legacy/three/r168/uniforms-to-uniformarray/package.json new file mode 100644 index 00000000..b3b7519c --- /dev/null +++ b/codemods-legacy/three/r168/uniforms-to-uniformarray/package.json @@ -0,0 +1,24 @@ +{ + "name": "three-r168-uniforms-to-uniformarray", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "vitest": "^1.0.1", + "jscodeshift": "^0.15.1" + }, + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "yugal41735" +} diff --git a/codemods-legacy/three/r168/uniforms-to-uniformarray/src/index.ts b/codemods-legacy/three/r168/uniforms-to-uniformarray/src/index.ts new file mode 100644 index 00000000..c81943ad --- /dev/null +++ b/codemods-legacy/three/r168/uniforms-to-uniformarray/src/index.ts @@ -0,0 +1,23 @@ +import type { API, FileInfo } from "jscodeshift"; + +export default function transformer(fileInfo: FileInfo, api: API) { + const j = api.jscodeshift; + const root = j(fileInfo.source); + + // Find all CallExpressions where .uniforms() is called + root + .find(j.CallExpression, { + callee: { + type: "MemberExpression", + property: { + name: "uniforms", + }, + }, + }) + .forEach((path) => { + // Replace 'uniforms' with 'uniformArray' + path.node.callee.property.name = "uniformArray"; + }); + + return root.toSource(); +} diff --git a/codemods-legacy/three/r168/uniforms-to-uniformarray/test/test.ts b/codemods-legacy/three/r168/uniforms-to-uniformarray/test/test.ts new file mode 100644 index 00000000..37b62a19 --- /dev/null +++ b/codemods-legacy/three/r168/uniforms-to-uniformarray/test/test.ts @@ -0,0 +1,51 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; +import { readFile } from "node:fs/promises"; +import { join } from "node:path"; +import jscodeshift from "jscodeshift"; +import type { API } from "jscodeshift"; +import transform from "../src/index.ts"; + +const __dirname = new URL(".", import.meta.url).pathname; + +const buildApi = (parser: string | undefined): API => ({ + j: parser ? jscodeshift.withParser(parser) : jscodeshift, + jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, + stats: () => { + console.error( + "The stats function was called, which is not supported on purpose", + ); + }, + report: () => { + console.error( + "The report function was called, which is not supported on purpose", + ); + }, +}); + +describe("three/r168/uniforms-to-uniformarray", () => { + it("test #1", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); +}); diff --git a/codemods-legacy/three/r168/uniforms-to-uniformarray/tsconfig.json b/codemods-legacy/three/r168/uniforms-to-uniformarray/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/three/r168/uniforms-to-uniformarray/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/typescript/remove-public-modifier/.codemodrc.json b/codemods-legacy/typescript/remove-public-modifier/.codemodrc.json similarity index 100% rename from codemods/typescript/remove-public-modifier/.codemodrc.json rename to codemods-legacy/typescript/remove-public-modifier/.codemodrc.json diff --git a/codemods/typescript/remove-public-modifier/README.md b/codemods-legacy/typescript/remove-public-modifier/README.md similarity index 100% rename from codemods/typescript/remove-public-modifier/README.md rename to codemods-legacy/typescript/remove-public-modifier/README.md diff --git a/codemods-legacy/typescript/remove-public-modifier/package.json b/codemods-legacy/typescript/remove-public-modifier/package.json new file mode 100644 index 00000000..c981bcdd --- /dev/null +++ b/codemods-legacy/typescript/remove-public-modifier/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/typescript-remove-public-modifier", + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "@codemod-com/utilities": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/typescript/remove-public-modifier/src/index.ts b/codemods-legacy/typescript/remove-public-modifier/src/index.ts similarity index 100% rename from codemods/typescript/remove-public-modifier/src/index.ts rename to codemods-legacy/typescript/remove-public-modifier/src/index.ts diff --git a/codemods-legacy/typescript/remove-public-modifier/test/test.ts b/codemods-legacy/typescript/remove-public-modifier/test/test.ts new file mode 100644 index 00000000..50249c85 --- /dev/null +++ b/codemods-legacy/typescript/remove-public-modifier/test/test.ts @@ -0,0 +1,137 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; +import { buildApi } from "@codemod-com/utilities"; +import type { FileInfo } from "jscodeshift"; +import transform from "../src/index.ts"; + +describe("remove-public-modifier", () => { + it("basic", () => { + const INPUT = ` + class MyClass { + public myProperty: string; + + public constructor() { + } + + public myMethod(): void { + } + } + `; + + const OUTPUT = ` + class MyClass { + myProperty: string; + + constructor() { + } + + myMethod(): void { + } + } + `; + const fileInfo: FileInfo = { + path: "index.ts", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx")); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); + + it("no public modifier", () => { + const INPUT = ` + class MyClass { + myMethod(): void { + } + + myProperty: string = 'value'; + } + `; + + const OUTPUT = ` + class MyClass { + myMethod(): void { + } + + myProperty: string = 'value'; + } + `; + const fileInfo: FileInfo = { + path: "index.ts", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx")); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); + + it("class with other modifiers (private, protected, static, readonly)", () => { + const INPUT = ` + class MyClass { + public static readonly myProperty: string = 'value'; + private secondProperty: string = 'value'; + protected thirdProperty: string = 'value'; + } + `; + + const OUTPUT = ` + class MyClass { + static readonly myProperty: string = 'value'; + private secondProperty: string = 'value'; + protected thirdProperty: string = 'value'; + } + `; + const fileInfo: FileInfo = { + path: "index.ts", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx")); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); + + it("multiple classes in the same file", () => { + const INPUT = ` + class Class1 { + public method1(): void {} + } + + class Class2 { + public method2(): void {} + } + `; + + const OUTPUT = ` + class Class1 { + method1(): void {} + } + + class Class2 { + method2(): void {} + } + `; + const fileInfo: FileInfo = { + path: "index.ts", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx")); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); +}); diff --git a/codemods/typescript/remove-public-modifier/tsconfig.json b/codemods-legacy/typescript/remove-public-modifier/tsconfig.json similarity index 100% rename from codemods/typescript/remove-public-modifier/tsconfig.json rename to codemods-legacy/typescript/remove-public-modifier/tsconfig.json diff --git a/codemods/typescript/use-template-literals/.codemodrc.json b/codemods-legacy/typescript/use-template-literals/.codemodrc.json similarity index 100% rename from codemods/typescript/use-template-literals/.codemodrc.json rename to codemods-legacy/typescript/use-template-literals/.codemodrc.json diff --git a/codemods/typescript/use-template-literals/README.md b/codemods-legacy/typescript/use-template-literals/README.md similarity index 100% rename from codemods/typescript/use-template-literals/README.md rename to codemods-legacy/typescript/use-template-literals/README.md diff --git a/codemods-legacy/typescript/use-template-literals/package.json b/codemods-legacy/typescript/use-template-literals/package.json new file mode 100644 index 00000000..db41aea8 --- /dev/null +++ b/codemods-legacy/typescript/use-template-literals/package.json @@ -0,0 +1,23 @@ +{ + "name": "@codemod-com/typescript-use-template-literals", + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "@codemod-com/utilities": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1" + }, + "private": true, + "main": "./dist/index.cjs", + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/typescript/use-template-literals/src/index.ts b/codemods-legacy/typescript/use-template-literals/src/index.ts similarity index 100% rename from codemods/typescript/use-template-literals/src/index.ts rename to codemods-legacy/typescript/use-template-literals/src/index.ts diff --git a/codemods-legacy/typescript/use-template-literals/test/test.ts b/codemods-legacy/typescript/use-template-literals/test/test.ts new file mode 100644 index 00000000..d795e545 --- /dev/null +++ b/codemods-legacy/typescript/use-template-literals/test/test.ts @@ -0,0 +1,238 @@ +import assert from "node:assert/strict"; +import { describe, it } from "node:test"; +import { buildApi } from "@codemod-com/utilities"; +import type { FileInfo } from "jscodeshift"; +import transform from "../src/index.ts"; + +describe("use-template-literals", () => { + describe("variables declared with let", () => { + it("one variable", () => { + const INPUT = ` + let name = 'John'; + let greeting = 'Hello, ' + name + '!'; + `; + + const OUTPUT = ` + let name = 'John'; + let greeting = \`Hello, \${name}!\`; + `; + const fileInfo: FileInfo = { + path: "index.ts", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx")); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); + + it("two variables", () => { + const INPUT = ` + let name = 'John'; + let age = 12; + let greeting = name + 'is ' + age + ' years old!'; + `; + + const OUTPUT = ` + let name = 'John'; + let age = 12; + let greeting = \`\${name} is \${age} years old!\`; + `; + const fileInfo: FileInfo = { + path: "index.ts", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx")); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); + + it("three variables", () => { + const INPUT = ` + let name = 'John'; + let age = 12; + let gender = 'male'; + let greeting = name + age + gender; + `; + + const OUTPUT = ` + let name = 'John'; + let age = 12; + let gender = 'male'; + let greeting = \`\${name}\${age}\${gender}\`; + `; + const fileInfo: FileInfo = { + path: "index.ts", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx")); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); + }); + + describe("variables declared with var", () => { + it("one variable", () => { + const INPUT = ` + var name = 'John'; + var greeting = 'Hello, ' + name + '!'; + `; + + const OUTPUT = ` + var name = 'John'; + var greeting = \`Hello, \${name}!\`; + `; + const fileInfo: FileInfo = { + path: "index.ts", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx")); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); + + it("two variables", () => { + const INPUT = ` + var name = 'John'; + var age = 12; + var greeting = name + 'is ' + age + ' years old!'; + `; + + const OUTPUT = ` + var name = 'John'; + var age = 12; + var greeting = \`\${name} is \${age} years old!\`; + `; + const fileInfo: FileInfo = { + path: "index.ts", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx")); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); + + it("three variables", () => { + const INPUT = ` + var name = 'John'; + var age = 12; + var gender = 'male'; + var greeting = name + age + gender; + `; + + const OUTPUT = ` + var name = 'John'; + var age = 12; + var gender = 'male'; + var greeting = \`\${name}\${age}\${gender}\`; + `; + const fileInfo: FileInfo = { + path: "index.ts", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx")); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); + }); + + describe("variables declared with const", () => { + it("one variable", () => { + const INPUT = ` + const name = 'John'; + const greeting = 'Hello, ' + name + '!'; + `; + + const OUTPUT = ` + const name = 'John'; + const greeting = \`Hello, \${name}!\`; + `; + const fileInfo: FileInfo = { + path: "index.ts", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx")); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); + + it("two variables", () => { + const INPUT = ` + const name = 'John'; + const age = 12; + const greeting = name + 'is ' + age + ' years old!'; + `; + + const OUTPUT = ` + const name = 'John'; + const age = 12; + const greeting = \`\${name} is \${age} years old!\`; + `; + const fileInfo: FileInfo = { + path: "index.ts", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx")); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); + + it("three variables", () => { + const INPUT = ` + const name = 'John'; + const age = 12; + const gender = 'male'; + const greeting = name + age + gender; + `; + + const OUTPUT = ` + const name = 'John'; + const age = 12; + const gender = 'male'; + const greeting = \`\${name}\${age}\${gender}\`; + `; + const fileInfo: FileInfo = { + path: "index.ts", + source: INPUT, + }; + + const actualOutput = transform(fileInfo, buildApi("tsx")); + + assert.deepEqual( + actualOutput?.replace(/\W/gm, ""), + OUTPUT.replace(/\W/gm, ""), + ); + }); + }); +}); diff --git a/codemods/typescript/use-template-literals/tsconfig.json b/codemods-legacy/typescript/use-template-literals/tsconfig.json similarity index 100% rename from codemods/typescript/use-template-literals/tsconfig.json rename to codemods-legacy/typescript/use-template-literals/tsconfig.json diff --git a/codemods/vue/3/render-function-api/.codemodrc.json b/codemods-legacy/vue/3/render-function-api/.codemodrc.json similarity index 100% rename from codemods/vue/3/render-function-api/.codemodrc.json rename to codemods-legacy/vue/3/render-function-api/.codemodrc.json diff --git a/codemods/three/r168/uniforms-to-uniformarray/.gitignore b/codemods-legacy/vue/3/render-function-api/.gitignore similarity index 100% rename from codemods/three/r168/uniforms-to-uniformarray/.gitignore rename to codemods-legacy/vue/3/render-function-api/.gitignore diff --git a/codemods/vue/3/render-function-api/LICENSE b/codemods-legacy/vue/3/render-function-api/LICENSE similarity index 100% rename from codemods/vue/3/render-function-api/LICENSE rename to codemods-legacy/vue/3/render-function-api/LICENSE diff --git a/codemods/vue/3/render-function-api/README.md b/codemods-legacy/vue/3/render-function-api/README.md similarity index 100% rename from codemods/vue/3/render-function-api/README.md rename to codemods-legacy/vue/3/render-function-api/README.md diff --git a/codemods/vue/3/render-function-api/__testfixtures__/fixture1.input.ts b/codemods-legacy/vue/3/render-function-api/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/vue/3/render-function-api/__testfixtures__/fixture1.input.ts rename to codemods-legacy/vue/3/render-function-api/__testfixtures__/fixture1.input.ts diff --git a/codemods/vue/3/render-function-api/__testfixtures__/fixture1.output.ts b/codemods-legacy/vue/3/render-function-api/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/vue/3/render-function-api/__testfixtures__/fixture1.output.ts rename to codemods-legacy/vue/3/render-function-api/__testfixtures__/fixture1.output.ts diff --git a/codemods-legacy/vue/3/render-function-api/package.json b/codemods-legacy/vue/3/render-function-api/package.json new file mode 100644 index 00000000..fd8806f1 --- /dev/null +++ b/codemods-legacy/vue/3/render-function-api/package.json @@ -0,0 +1,22 @@ +{ + "name": "@codemod-com/vue-render-function-api", + "version": "1.0.0", + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "^24.3.0", + "@types/jscodeshift": "^0.11.10", + "jscodeshift": "^0.15.1", + "typescript": "^5.2.2" + }, + "private": true, + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "./README.md", + "./.codemodrc.json", + "./dist/index.cjs" + ], + "type": "module" +} diff --git a/codemods/vue/3/render-function-api/src/index.ts b/codemods-legacy/vue/3/render-function-api/src/index.ts similarity index 100% rename from codemods/vue/3/render-function-api/src/index.ts rename to codemods-legacy/vue/3/render-function-api/src/index.ts diff --git a/codemods-legacy/vue/3/render-function-api/test/test.ts b/codemods-legacy/vue/3/render-function-api/test/test.ts new file mode 100644 index 00000000..dd7af247 --- /dev/null +++ b/codemods-legacy/vue/3/render-function-api/test/test.ts @@ -0,0 +1,50 @@ +import assert from "node:assert"; +import { readFile } from "node:fs/promises"; +import { join } from "node:path"; +import { describe, it } from "node:test"; +import jscodeshift from "jscodeshift"; +import type { API } from "jscodeshift"; +import transform from "../src/index.ts"; + +const __dirname = new URL(".", import.meta.url).pathname; + +const buildApi = (parser: string | undefined): API => ({ + j: parser ? jscodeshift.withParser(parser) : jscodeshift, + jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, + stats: () => { + console.error( + "The stats function was called, which is not supported on purpose", + ); + }, + report: () => { + console.error( + "The report function was called, which is not supported on purpose", + ); + }, +}); + +describe("codemod", () => { + it("test #1", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); +}); diff --git a/codemods-legacy/vue/3/render-function-api/tsconfig.json b/codemods-legacy/vue/3/render-function-api/tsconfig.json new file mode 100644 index 00000000..36bd1c7d --- /dev/null +++ b/codemods-legacy/vue/3/render-function-api/tsconfig.json @@ -0,0 +1,14 @@ +{ + "extends": "@codemod-com/tsconfig/codemod.json", + "compilerOptions": { + "baseUrl": ".", + "outDir": "./dist" + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/webpack/v5/json-imports-to-default-imports/.codemodrc.json b/codemods-legacy/webpack/v5/json-imports-to-default-imports/.codemodrc.json similarity index 100% rename from codemods/webpack/v5/json-imports-to-default-imports/.codemodrc.json rename to codemods-legacy/webpack/v5/json-imports-to-default-imports/.codemodrc.json diff --git a/codemods/vue/3/render-function-api/.gitignore b/codemods-legacy/webpack/v5/json-imports-to-default-imports/.gitignore similarity index 100% rename from codemods/vue/3/render-function-api/.gitignore rename to codemods-legacy/webpack/v5/json-imports-to-default-imports/.gitignore diff --git a/codemods/webpack/v5/json-imports-to-default-imports/LICENSE b/codemods-legacy/webpack/v5/json-imports-to-default-imports/LICENSE similarity index 100% rename from codemods/webpack/v5/json-imports-to-default-imports/LICENSE rename to codemods-legacy/webpack/v5/json-imports-to-default-imports/LICENSE diff --git a/codemods/webpack/v5/json-imports-to-default-imports/README.md b/codemods-legacy/webpack/v5/json-imports-to-default-imports/README.md similarity index 100% rename from codemods/webpack/v5/json-imports-to-default-imports/README.md rename to codemods-legacy/webpack/v5/json-imports-to-default-imports/README.md diff --git a/codemods/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture1.input.ts b/codemods-legacy/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture1.input.ts rename to codemods-legacy/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture1.input.ts diff --git a/codemods/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture1.output.ts b/codemods-legacy/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture1.output.ts rename to codemods-legacy/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture1.output.ts diff --git a/codemods/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture2.input.ts b/codemods-legacy/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture2.input.ts similarity index 100% rename from codemods/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture2.input.ts rename to codemods-legacy/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture2.input.ts diff --git a/codemods/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture2.output.ts b/codemods-legacy/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture2.output.ts similarity index 100% rename from codemods/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture2.output.ts rename to codemods-legacy/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture2.output.ts diff --git a/codemods/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture3.input.ts b/codemods-legacy/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture3.input.ts similarity index 100% rename from codemods/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture3.input.ts rename to codemods-legacy/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture3.input.ts diff --git a/codemods/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture3.output.ts b/codemods-legacy/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture3.output.ts similarity index 100% rename from codemods/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture3.output.ts rename to codemods-legacy/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture3.output.ts diff --git a/codemods/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture4.input.ts b/codemods-legacy/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture4.input.ts similarity index 100% rename from codemods/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture4.input.ts rename to codemods-legacy/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture4.input.ts diff --git a/codemods/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture4.output.ts b/codemods-legacy/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture4.output.ts similarity index 100% rename from codemods/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture4.output.ts rename to codemods-legacy/webpack/v5/json-imports-to-default-imports/__testfixtures__/fixture4.output.ts diff --git a/codemods-legacy/webpack/v5/json-imports-to-default-imports/package.json b/codemods-legacy/webpack/v5/json-imports-to-default-imports/package.json new file mode 100644 index 00000000..c85bb270 --- /dev/null +++ b/codemods-legacy/webpack/v5/json-imports-to-default-imports/package.json @@ -0,0 +1,23 @@ +{ + "name": "json-imports-to-default-imports", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1" + }, + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "akash-kumar-dev" +} diff --git a/codemods/webpack/v5/json-imports-to-default-imports/src/index.ts b/codemods-legacy/webpack/v5/json-imports-to-default-imports/src/index.ts similarity index 100% rename from codemods/webpack/v5/json-imports-to-default-imports/src/index.ts rename to codemods-legacy/webpack/v5/json-imports-to-default-imports/src/index.ts diff --git a/codemods-legacy/webpack/v5/json-imports-to-default-imports/test/test.ts b/codemods-legacy/webpack/v5/json-imports-to-default-imports/test/test.ts new file mode 100644 index 00000000..eb1bb849 --- /dev/null +++ b/codemods-legacy/webpack/v5/json-imports-to-default-imports/test/test.ts @@ -0,0 +1,135 @@ +import assert from "node:assert"; +import { describe, it } from "node:test"; +import { readFile } from "node:fs/promises"; +import { join } from "node:path"; +import jscodeshift from "jscodeshift"; +import type { API } from "jscodeshift"; +import transform from "../src/index.ts"; + +const __dirname = new URL(".", import.meta.url).pathname; + +const buildApi = (parser: string | undefined): API => ({ + j: parser ? jscodeshift.withParser(parser) : jscodeshift, + jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, + stats: () => { + console.error( + "The stats function was called, which is not supported on purpose", + ); + }, + report: () => { + console.error( + "The report function was called, which is not supported on purpose", + ); + }, +}); + +describe("json-imports-to-default-imports", () => { + /** + * Test Case 1: Basic Named Import Transformation + * This test validates that named imports from JSON files + */ + it("test #1 - Basic Named Import Transformation", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); + + it("test #2 - Basic Named Import Transformation", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture2.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture2.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); + + /** + * Test Case 3: Nested References Transformation + * This test validates that named imports with nested references + */ + it("test #3 - Nested References Transformation", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture3.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture3.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); + + // Test Case 4: Multiple Named Imports + it("test #4 - Multiple Named Imports", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture4.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture4.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); +}); diff --git a/codemods-legacy/webpack/v5/json-imports-to-default-imports/tsconfig.json b/codemods-legacy/webpack/v5/json-imports-to-default-imports/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/webpack/v5/json-imports-to-default-imports/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/webpack/v5/migrate-library-target-to-library-object/.codemodrc.json b/codemods-legacy/webpack/v5/migrate-library-target-to-library-object/.codemodrc.json similarity index 100% rename from codemods/webpack/v5/migrate-library-target-to-library-object/.codemodrc.json rename to codemods-legacy/webpack/v5/migrate-library-target-to-library-object/.codemodrc.json diff --git a/codemods/webpack/v5/json-imports-to-default-imports/.gitignore b/codemods-legacy/webpack/v5/migrate-library-target-to-library-object/.gitignore similarity index 100% rename from codemods/webpack/v5/json-imports-to-default-imports/.gitignore rename to codemods-legacy/webpack/v5/migrate-library-target-to-library-object/.gitignore diff --git a/codemods/webpack/v5/migrate-library-target-to-library-object/LICENSE b/codemods-legacy/webpack/v5/migrate-library-target-to-library-object/LICENSE similarity index 100% rename from codemods/webpack/v5/migrate-library-target-to-library-object/LICENSE rename to codemods-legacy/webpack/v5/migrate-library-target-to-library-object/LICENSE diff --git a/codemods/webpack/v5/migrate-library-target-to-library-object/README.md b/codemods-legacy/webpack/v5/migrate-library-target-to-library-object/README.md similarity index 100% rename from codemods/webpack/v5/migrate-library-target-to-library-object/README.md rename to codemods-legacy/webpack/v5/migrate-library-target-to-library-object/README.md diff --git a/codemods/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture1.input.ts b/codemods-legacy/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture1.input.ts rename to codemods-legacy/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture1.input.ts diff --git a/codemods/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture1.output.ts b/codemods-legacy/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture1.output.ts rename to codemods-legacy/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture1.output.ts diff --git a/codemods/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture2.input.ts b/codemods-legacy/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture2.input.ts similarity index 100% rename from codemods/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture2.input.ts rename to codemods-legacy/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture2.input.ts diff --git a/codemods/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture2.output.ts b/codemods-legacy/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture2.output.ts similarity index 100% rename from codemods/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture2.output.ts rename to codemods-legacy/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture2.output.ts diff --git a/codemods/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture3.input.ts b/codemods-legacy/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture3.input.ts similarity index 100% rename from codemods/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture3.input.ts rename to codemods-legacy/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture3.input.ts diff --git a/codemods/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture3.output.ts b/codemods-legacy/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture3.output.ts similarity index 100% rename from codemods/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture3.output.ts rename to codemods-legacy/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture3.output.ts diff --git a/codemods/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture4.input.ts b/codemods-legacy/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture4.input.ts similarity index 100% rename from codemods/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture4.input.ts rename to codemods-legacy/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture4.input.ts diff --git a/codemods/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture4.output.ts b/codemods-legacy/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture4.output.ts similarity index 100% rename from codemods/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture4.output.ts rename to codemods-legacy/webpack/v5/migrate-library-target-to-library-object/__testfixtures__/fixture4.output.ts diff --git a/codemods-legacy/webpack/v5/migrate-library-target-to-library-object/package.json b/codemods-legacy/webpack/v5/migrate-library-target-to-library-object/package.json new file mode 100644 index 00000000..3f045cef --- /dev/null +++ b/codemods-legacy/webpack/v5/migrate-library-target-to-library-object/package.json @@ -0,0 +1,23 @@ +{ + "name": "migrate-library-target-to-library-object", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1" + }, + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "akash-kumar-dev" +} diff --git a/codemods/webpack/v5/migrate-library-target-to-library-object/src/index.ts b/codemods-legacy/webpack/v5/migrate-library-target-to-library-object/src/index.ts similarity index 100% rename from codemods/webpack/v5/migrate-library-target-to-library-object/src/index.ts rename to codemods-legacy/webpack/v5/migrate-library-target-to-library-object/src/index.ts diff --git a/codemods-legacy/webpack/v5/migrate-library-target-to-library-object/test/test.ts b/codemods-legacy/webpack/v5/migrate-library-target-to-library-object/test/test.ts new file mode 100644 index 00000000..fb42a50c --- /dev/null +++ b/codemods-legacy/webpack/v5/migrate-library-target-to-library-object/test/test.ts @@ -0,0 +1,126 @@ +import assert from "node:assert"; +import { readFile } from "node:fs/promises"; +import { join } from "node:path"; +import { describe, it } from "node:test"; +import jscodeshift from "jscodeshift"; +import type { API } from "jscodeshift"; +import transform from "../src/index.ts"; + +const __dirname = new URL(".", import.meta.url).pathname; + +const buildApi = (parser: string | undefined): API => ({ + j: parser ? jscodeshift.withParser(parser) : jscodeshift, + jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, + stats: () => { + console.error( + "The stats function was called, which is not supported on purpose", + ); + }, + report: () => { + console.error( + "The report function was called, which is not supported on purpose", + ); + }, +}); + +describe("webpack/1/migrate-library-target-to-library-object", () => { + it("test #1", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/\s/gm, ""), + OUTPUT.replace(/\s/gm, ""), + ); + }); + + it("test #2", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture2.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture2.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); + + it("test #3", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture3.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture3.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); + + it("test #4", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture4.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture4.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); +}); diff --git a/codemods-legacy/webpack/v5/migrate-library-target-to-library-object/tsconfig.json b/codemods-legacy/webpack/v5/migrate-library-target-to-library-object/tsconfig.json new file mode 100644 index 00000000..4c23a941 --- /dev/null +++ b/codemods-legacy/webpack/v5/migrate-library-target-to-library-object/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"] +} diff --git a/codemods/webpack/v5/migration-recipe/.codemodrc.json b/codemods-legacy/webpack/v5/migration-recipe/.codemodrc.json similarity index 100% rename from codemods/webpack/v5/migration-recipe/.codemodrc.json rename to codemods-legacy/webpack/v5/migration-recipe/.codemodrc.json diff --git a/codemods/webpack/v5/migration-recipe/README.md b/codemods-legacy/webpack/v5/migration-recipe/README.md similarity index 100% rename from codemods/webpack/v5/migration-recipe/README.md rename to codemods-legacy/webpack/v5/migration-recipe/README.md diff --git a/codemods/webpack/v5/migration-recipe/package.json b/codemods-legacy/webpack/v5/migration-recipe/package.json similarity index 100% rename from codemods/webpack/v5/migration-recipe/package.json rename to codemods-legacy/webpack/v5/migration-recipe/package.json diff --git a/codemods/webpack/v5/set-target-to-false-and-update-plugins/.codemodrc.json b/codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/.codemodrc.json similarity index 100% rename from codemods/webpack/v5/set-target-to-false-and-update-plugins/.codemodrc.json rename to codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/.codemodrc.json diff --git a/codemods/webpack/v5/migrate-library-target-to-library-object/.gitignore b/codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/.gitignore similarity index 100% rename from codemods/webpack/v5/migrate-library-target-to-library-object/.gitignore rename to codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/.gitignore diff --git a/codemods/webpack/v5/set-target-to-false-and-update-plugins/LICENSE b/codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/LICENSE similarity index 100% rename from codemods/webpack/v5/set-target-to-false-and-update-plugins/LICENSE rename to codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/LICENSE diff --git a/codemods/webpack/v5/set-target-to-false-and-update-plugins/README.md b/codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/README.md similarity index 100% rename from codemods/webpack/v5/set-target-to-false-and-update-plugins/README.md rename to codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/README.md diff --git a/codemods/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture1.input.ts b/codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture1.input.ts similarity index 100% rename from codemods/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture1.input.ts rename to codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture1.input.ts diff --git a/codemods/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture1.output.ts b/codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture1.output.ts similarity index 100% rename from codemods/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture1.output.ts rename to codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture1.output.ts diff --git a/codemods/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture2.input.ts b/codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture2.input.ts similarity index 100% rename from codemods/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture2.input.ts rename to codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture2.input.ts diff --git a/codemods/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture2.output.ts b/codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture2.output.ts similarity index 100% rename from codemods/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture2.output.ts rename to codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture2.output.ts diff --git a/codemods/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture3.input.ts b/codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture3.input.ts similarity index 100% rename from codemods/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture3.input.ts rename to codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture3.input.ts diff --git a/codemods/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture3.output.ts b/codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture3.output.ts similarity index 100% rename from codemods/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture3.output.ts rename to codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture3.output.ts diff --git a/codemods/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture4.input.ts b/codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture4.input.ts similarity index 100% rename from codemods/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture4.input.ts rename to codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture4.input.ts diff --git a/codemods/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture4.output.ts b/codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture4.output.ts similarity index 100% rename from codemods/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture4.output.ts rename to codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/__testfixtures__/fixture4.output.ts diff --git a/codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/package.json b/codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/package.json new file mode 100644 index 00000000..14564d9e --- /dev/null +++ b/codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/package.json @@ -0,0 +1,23 @@ +{ + "name": "set-target-to-false-and-update-plugins", + "license": "MIT", + "devDependencies": { + "@codemod.com/codemod-utils": "workspace:*", + "@codemod-com/tsconfig": "workspace:*", + "@types/jscodeshift": "^0.11.10", + "@types/node": "^24.3.0", + "typescript": "^5.2.2", + "jscodeshift": "^0.15.1" + }, + "scripts": { + "test": "node --test", + "test:watch": "node --test --watch" + }, + "files": [ + "README.md", + ".codemodrc.json", + "/dist/index.cjs" + ], + "type": "module", + "author": "akash-kumar-dev" +} diff --git a/codemods/webpack/v5/set-target-to-false-and-update-plugins/src/index.ts b/codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/src/index.ts similarity index 100% rename from codemods/webpack/v5/set-target-to-false-and-update-plugins/src/index.ts rename to codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/src/index.ts diff --git a/codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/test/test.ts b/codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/test/test.ts new file mode 100644 index 00000000..120a310e --- /dev/null +++ b/codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/test/test.ts @@ -0,0 +1,126 @@ +import assert from "node:assert"; +import { describe, it } from "node:test"; +import { readFile } from "node:fs/promises"; +import { join } from "node:path"; +import jscodeshift from "jscodeshift"; +import type { API } from "jscodeshift"; +import transform from "../src/index.ts"; + +const __dirname = new URL(".", import.meta.url).pathname; + +const buildApi = (parser: string | undefined): API => ({ + j: parser ? jscodeshift.withParser(parser) : jscodeshift, + jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, + stats: () => { + console.error( + "The stats function was called, which is not supported on purpose", + ); + }, + report: () => { + console.error( + "The report function was called, which is not supported on purpose", + ); + }, +}); + +describe("common-js/export-target-to-plugin-conversion", () => { + it("test #1", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); + + it("test #2", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture2.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture2.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); + + it("test #3", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture3.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture3.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); + + it("test #4", async () => { + const INPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture4.input.ts"), + "utf-8", + ); + const OUTPUT = await readFile( + join(__dirname, "..", "__testfixtures__/fixture4.output.ts"), + "utf-8", + ); + + const actualOutput = transform( + { + path: "index.js", + source: INPUT, + }, + buildApi("tsx"), + {}, + ); + + assert.deepEqual( + actualOutput?.replace(/W/gm, ""), + OUTPUT.replace(/W/gm, ""), + ); + }); +}); diff --git a/codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/tsconfig.json b/codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/tsconfig.json new file mode 100644 index 00000000..7757ca16 --- /dev/null +++ b/codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "module": "NodeNext", + "target": "ESNext", + "moduleResolution": "NodeNext", + "lib": ["ESNext", "DOM"], + "skipLibCheck": true, + "esModuleInterop": true, + "resolveJsonModule": true, + "allowSyntheticDefaultImports": true, + "isolatedModules": true, + "jsx": "react-jsx", + "useDefineForClassFields": true, + "noFallthroughCasesInSwitch": true, + "noUnusedLocals": false, + "noUnusedParameters": false, + "preserveWatchOutput": true, + "strict": true, + "strictNullChecks": true, + "incremental": true, + "noUncheckedIndexedAccess": true, + "noPropertyAccessFromIndexSignature": false, + "allowJs": true + }, + "include": [ + "./src/**/*.ts", + "./src/**/*.js", + "./test/**/*.ts", + "./test/**/*.js" + ], + "exclude": ["node_modules", "./dist/**/*"], +} diff --git a/codemods/Feature Flags/remove-unused-feature-flags/package.json b/codemods/Feature Flags/remove-unused-feature-flags/package.json deleted file mode 100644 index 9fee87ff..00000000 --- a/codemods/Feature Flags/remove-unused-feature-flags/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-feature-flags-remove-unused-feature-flags", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/Feature Flags/remove-unused-feature-flags/test/test.ts b/codemods/Feature Flags/remove-unused-feature-flags/test/test.ts deleted file mode 100644 index 7a3bb2a8..00000000 --- a/codemods/Feature Flags/remove-unused-feature-flags/test/test.ts +++ /dev/null @@ -1,111 +0,0 @@ -import assert from "node:assert"; -import { buildApi } from "@codemod-com/utilities"; -import type { FileInfo } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -describe("remove-unused-feature-flags", () => { - it("should not change code without feature flags", () => { - const INPUT = ` - const Component = () => { - return
A
; - } - `; - - const fileInfo: FileInfo = { - path: "index.ts", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx"), {}); - - assert.deepEqual(actualOutput, undefined); - }); - - it("should remove a feature flag check within Promise.all()", () => { - const INPUT = ` - const [a, b] = await Promise.all([ - Promise.resolve('a'), - isFlagEnabled('featureFlag'), - ]); - - const x = b && c; - - const y =
- `; - - const OUTPUT = ` - const a = await Promise.resolve('a'); - - const x = c; - - const y = - `; - - const fileInfo: FileInfo = { - path: "index.ts", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx"), {}); - - assert.deepEqual( - actualOutput?.replace(/\s/gm, ""), - OUTPUT.replace(/\s/gm, ""), - ); - }); - - it("should remove a feature flag check within Promise.all() (with options)", () => { - const INPUT = ` - const [b, a] = await Promise.all([ - fnc('b'), - Promise.resolve('a'), - ]); - - const d = () => { - return c() && b; - } - `; - - const OUTPUT = ` - const a = await Promise.resolve('a'); - - const d = () => { - return c(); - } - `; - - const fileInfo: FileInfo = { - path: "index.ts", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("ts"), { - functionName: "fnc", - featureFlagName: "b", - }); - - assert.deepEqual( - actualOutput?.replace(/\s/gm, ""), - OUTPUT.replace(/\s/gm, ""), - ); - }); - - it("should replace await isFlagEnabled('featureFlag') with true", () => { - const INPUT = `const a = await isFlagEnabled('featureFlag');`; - - const OUTPUT = "const a = true;"; - - const fileInfo: FileInfo = { - path: "index.ts", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("ts"), {}); - - assert.deepEqual( - actualOutput?.replace(/\s/gm, ""), - OUTPUT.replace(/\s/gm, ""), - ); - }); -}); diff --git a/codemods/antd/5/props-changed-migration/package.json b/codemods/antd/5/props-changed-migration/package.json deleted file mode 100644 index c5eddddb..00000000 --- a/codemods/antd/5/props-changed-migration/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod-com/codemod-antd-5-props-changed-migration", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/antd/5/remove-style-import/package.json b/codemods/antd/5/remove-style-import/package.json deleted file mode 100644 index ab3839c8..00000000 --- a/codemods/antd/5/remove-style-import/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-antd-5-v5-remove-style-import", - "dependencies": { - "@codemod-com/antd5-utils": "workspace:*" - }, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/antd/5/removed-component-migration/package.json b/codemods/antd/5/removed-component-migration/package.json deleted file mode 100644 index 4185d1ba..00000000 --- a/codemods/antd/5/removed-component-migration/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@codemod-com/codemod-antd-5-v5-removed-component-migration", - "dependencies": { - "@codemod-com/antd5-utils": "workspace:*" - }, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/antd/5/removed-static-method-migration/package.json b/codemods/antd/5/removed-static-method-migration/package.json deleted file mode 100644 index 9630a3ce..00000000 --- a/codemods/antd/5/removed-static-method-migration/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@codemod-com/codemod-antd-5-removed-static-method-migration", - "dependencies": { - "@codemod-com/antd5-utils": "workspace:*" - }, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/axios/fetch/package.json b/codemods/axios/fetch/package.json deleted file mode 100644 index 29a58217..00000000 --- a/codemods/axios/fetch/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "fetch", - "license": "MIT", - "private": true, - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/workflow": "workspace:*" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/axios/fetch/tsconfig.json b/codemods/axios/fetch/tsconfig.json deleted file mode 100644 index 329a7d63..00000000 --- a/codemods/axios/fetch/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "@codemod-com/tsconfig/codemod.json", - "compilerOptions": { - "baseUrl": ".", - "outDir": "./dist" - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/bull/bullmq/package.json b/codemods/bull/bullmq/package.json deleted file mode 100644 index dee92696..00000000 --- a/codemods/bull/bullmq/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-bull-bullmq", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/cal.com/app-directory-boilerplate-calcom/package.json b/codemods/cal.com/app-directory-boilerplate-calcom/package.json deleted file mode 100644 index 501c2576..00000000 --- a/codemods/cal.com/app-directory-boilerplate-calcom/package.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "name": "@codemod-com/codemod-cal.com-app-directory-boilerplate-calcom", - "dependencies": { - "mdast-util-from-markdown": "catalog:", - "mdast-util-to-markdown": "catalog:", - "micromark-extension-mdxjs": "catalog:", - "mdast-util-mdx": "catalog:", - "unist-util-visit": "catalog:" - }, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "@codemod-com/filemod": "workspace:*", - "memfs": "^4.6.0", - "ts-morph": "^19.0.0", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/cal.com/app-directory-boilerplate-calcom/src/index.ts b/codemods/cal.com/app-directory-boilerplate-calcom/src/index.ts deleted file mode 100644 index 02991519..00000000 --- a/codemods/cal.com/app-directory-boilerplate-calcom/src/index.ts +++ /dev/null @@ -1,664 +0,0 @@ -import { format, parse, sep } from "node:path"; -import type { Filemod, HandleData, HandleFile } from "@codemod-com/filemod"; -import type { Identifier, SourceFile } from "ts-morph"; -import tsmorph, { Node, SyntaxKind } from "ts-morph"; - -type Dependencies = Readonly<{ - tsmorph: typeof tsmorph; -}>; - -const removeLeadingLineBreaks = (input: string): string => { - return input.replace(/^\n+/, ""); -}; - -enum FilePurpose { - ORIGINAL_PAGE = "ORIGINAL_PAGE", - // route directories - ROUTE_PAGE = "ROUTE_PAGE", -} - -const map = new Map([ - [FilePurpose.ORIGINAL_PAGE, ""], - [FilePurpose.ROUTE_PAGE, ""], -]); - -type State = Record; - -type DataAPI = Parameters>[0]; - -type FileCommand = Awaited>>[number]; -type DataCommand = Awaited>>; - -const addUseClientStatement = ( - oldPath: string, - oldData: string, -): DataCommand => { - const project = new tsmorph.Project({ - useInMemoryFileSystem: true, - skipFileDependencyResolution: true, - compilerOptions: { - allowJs: true, - }, - }); - - const sourceFile = project.createSourceFile(oldPath ?? "", oldData); - - const hasUseClient = sourceFile - .getDescendantsOfKind(SyntaxKind.StringLiteral) - .some((node) => { - const literal = node.getLiteralText(); - return literal === "use client"; - }); - - if (!hasUseClient) { - sourceFile.insertStatements(0, `'use client';`); - } - - return { - kind: "upsertData", - path: oldPath, - data: sourceFile.getFullText(), - }; -}; - -const ROUTE_SEGMENT_CONFIG_OPTIONS = [ - "dynamic", - "dynamicParams", - "revalidate", - "fetchCache", - "runtime", - "preferredRegion", - "maxDuration", -]; - -const getAncestorByDeclaration = (declarationNode: Node): Node | null => { - let ancestor: Node | null = null; - - const parameter = Node.isParameterDeclaration(declarationNode) - ? declarationNode - : declarationNode.getFirstAncestorByKind(SyntaxKind.Parameter); - const importDeclaration = declarationNode.getFirstAncestorByKind( - SyntaxKind.ImportDeclaration, - ); - - if (parameter !== undefined) { - ancestor = parameter; - } else if (importDeclaration !== undefined) { - ancestor = importDeclaration; - } else if (Node.isFunctionDeclaration(declarationNode)) { - ancestor = declarationNode; - } else if (Node.isVariableDeclaration(declarationNode)) { - // variable statement - ancestor = declarationNode.getParent()?.getParent() ?? null; - } else if (Node.isBindingElement(declarationNode)) { - ancestor = - declarationNode.getFirstAncestorByKind(SyntaxKind.VariableStatement) ?? - null; - } - - return ancestor; -}; -const DEPENDENCY_TREE_MAX_DEPTH = 3; - -const getDependenciesForIdentifiers = ( - identifiers: ReadonlyArray, - depth = 0, -) => { - if (depth > DEPENDENCY_TREE_MAX_DEPTH) { - return {}; - } - - const dependencies: Record = {}; - - identifiers.forEach((identifier) => { - const parent = identifier.getParent(); - - if (Node.isParameterDeclaration(parent)) { - return; - } - - if ( - (Node.isPropertyAccessExpression(parent) || - Node.isElementAccessExpression(parent)) && - identifier.getChildIndex() !== 0 - ) { - return; - } - - if ( - Node.isPropertyAssignment(parent) && - parent.getNameNode() === identifier - ) { - return; - } - - const [firstDeclaration] = identifier.getSymbol()?.getDeclarations() ?? []; - - const localSourceFile = identifier.getFirstAncestorByKind( - SyntaxKind.SourceFile, - ); - - // check if declaration exists in current sourceFile - if ( - firstDeclaration === undefined || - firstDeclaration.getFirstAncestorByKind(SyntaxKind.SourceFile) !== - localSourceFile - ) { - return; - } - - const ancestor = getAncestorByDeclaration(firstDeclaration); - - if (ancestor === null) { - return; - } - - dependencies[identifier.getText()] = ancestor.getText(); - - // recursivelly check for dependencies until reached parameter or import - if ( - Node.isImportDeclaration(ancestor) || - Node.isParameterDeclaration(ancestor) - ) { - return; - } - - const ancestorIdentifiers = ancestor - .getDescendantsOfKind(SyntaxKind.Identifier) - .filter((i) => { - if (i.getText() === identifier.getText()) { - return false; - } - - if (ancestor && Node.isFunctionDeclaration(ancestor)) { - const declaration = i.getSymbol()?.getDeclarations()[0]; - - // ensure we dont collect identifiers from function inner scope in nested functions - if ( - declaration?.getFirstAncestorByKind( - SyntaxKind.FunctionDeclaration, - ) === ancestor - ) { - return false; - } - } - - const parent = i.getParent(); - - return ( - !Node.isBindingElement(parent) && - !Node.isPropertyAssignment(parent) && - !(Node.isPropertyAccessExpression(parent) && i.getChildIndex() !== 0) - ); - }); - - const dependenciesOfAncestor = getDependenciesForIdentifiers( - ancestorIdentifiers, - depth + 1, - ); - Object.assign(dependencies, dependenciesOfAncestor); - }); - - return dependencies; -}; - -const getRouteSegmentConfig = (sourceFile: SourceFile): string => { - let nextjsConfig = ""; - - sourceFile.getVariableStatements().forEach((statement) => { - statement.getDeclarations().forEach((declaration) => { - const id = declaration.getName() ?? ""; - - if ( - declaration.hasExportKeyword() && - ROUTE_SEGMENT_CONFIG_OPTIONS.includes(id) - ) { - nextjsConfig += `${statement.getText()} \n`; - } - }); - }); - - return nextjsConfig; -}; - -const getServerSideDataHookWithDeps = (sourceFile: SourceFile) => { - let dataHooksWithDeps = ""; - - const getDataAF = sourceFile - .getDescendantsOfKind(SyntaxKind.ArrowFunction) - .find((AF) => { - const parent = AF.getParent(); - return ( - Node.isVariableDeclaration(parent) && parent.getName() === "getData" - ); - }); - - if (getDataAF === undefined) { - return dataHooksWithDeps; - } - - const identifiers = getDataAF - .getBody() - .getDescendantsOfKind(SyntaxKind.Identifier); - - const dependencies = getDependenciesForIdentifiers(identifiers); - - dataHooksWithDeps += Object.values(dependencies).reverse().join("\n"); - dataHooksWithDeps += `${ - getDataAF.getFirstAncestorByKind(SyntaxKind.VariableStatement)?.getText() ?? - "" - } \n`; - - return dataHooksWithDeps; -}; - -const getPositionAfterImports = (sourceFile: SourceFile): number => { - const lastImportDeclaration = - sourceFile.getLastChildByKind(SyntaxKind.ImportDeclaration) ?? null; - - return (lastImportDeclaration?.getChildIndex() ?? 0) + 1; -}; - -const buildPageFileData = ( - api: DataAPI, - path: string, - options: Readonly>, - filePurpose: FilePurpose.ROUTE_PAGE, -): DataCommand => { - const { tsmorph } = api.getDependencies(); - - const rewriteWithTsMorph = ( - input: string, - legacyPageData: string, - ): string => { - const project = new tsmorph.Project({ - useInMemoryFileSystem: true, - skipFileDependencyResolution: true, - compilerOptions: { - allowJs: true, - }, - }); - - const oldPath = - typeof options.oldPath === "string" ? options.oldPath : null; - - const sourceFile = project.createSourceFile(path ?? "", input); - - const legacyPageSourceFile = project.createSourceFile( - oldPath ?? "", - legacyPageData, - ); - - // inserting route segment config to the future page - const routeSegmentConfig = getRouteSegmentConfig(legacyPageSourceFile); - - sourceFile.addStatements(routeSegmentConfig); - - // inserting server side data hooks along with its dependencies to the future page - const serverSideDataHooks = - getServerSideDataHookWithDeps(legacyPageSourceFile); - - const positionAfterImports = getPositionAfterImports(sourceFile); - - sourceFile.insertStatements(positionAfterImports, serverSideDataHooks); - - sourceFile.getFunctions().forEach((fn) => { - if (fn.isDefaultExport()) { - fn.remove(); - return; - } - - const id = fn.getName() ?? ""; - - if ( - ["getStaticProps", "getServerSideProps", "getStaticPaths"].includes(id) - ) { - fn.setIsExported(false); - } - }); - - sourceFile.getVariableStatements().forEach((statement) => { - statement.getDeclarations().forEach((declaration) => { - const id = declaration.getName() ?? ""; - - if ( - ["getStaticProps", "getServerSideProps", "getStaticPaths"].includes( - id, - ) && - declaration.hasExportKeyword() - ) { - statement.setIsExported(false); - } - }); - }); - - sourceFile - .getDescendantsOfKind(SyntaxKind.JsxOpeningElement) - .filter( - (jsxOpeningElement) => - jsxOpeningElement.getTagNameNode().getText() === "Head", - ) - .map((declaration) => { - return declaration.getFirstAncestorByKind(SyntaxKind.JsxElement); - }) - .forEach((jsxElement) => { - const parenthesizedExpressionParent = - jsxElement?.getParentIfKind(SyntaxKind.ParenthesizedExpression) ?? - null; - - if (parenthesizedExpressionParent !== null) { - parenthesizedExpressionParent.replaceWithText("null"); - - return; - } - - jsxElement?.replaceWithText(""); - }); - - if (filePurpose === FilePurpose.ROUTE_PAGE) { - sourceFile.getImportDeclarations().forEach((declaration) => { - const moduleSpecifier = declaration.getModuleSpecifierValue(); - - if (moduleSpecifier.startsWith("./")) { - declaration.setModuleSpecifier(`.${moduleSpecifier}`); - } else if (moduleSpecifier.startsWith("../")) { - declaration.setModuleSpecifier(`../${moduleSpecifier}`); - } - }); - } - - return sourceFile.getFullText(); - }; - - return { - kind: "upsertData", - path, - data: rewriteWithTsMorph( - String(options.oldData ?? ""), - String(options.legacyPageData ?? ""), - ), - }; -}; - -const SERVER_SIDE_DATA_HOOKS_NAMES = ["getStaticProps", "getServerSideProps"]; - -const usesServerSideData = (sourceFile: SourceFile) => { - return ( - sourceFile - .getFunctions() - .some((fn) => - SERVER_SIDE_DATA_HOOKS_NAMES.includes(fn.getName() ?? ""), - ) || - sourceFile - .getVariableStatements() - .some((statement) => - statement - .getDeclarations() - .some((declaration) => - SERVER_SIDE_DATA_HOOKS_NAMES.includes(declaration.getName() ?? ""), - ), - ) - ); -}; - -const usesLayout = (sourceFile: SourceFile) => { - return sourceFile - .getImportDeclarations() - .some( - (importDeclaration) => - importDeclaration.getNamedImports()[0]?.getName() === "getLayout", - ); -}; - -const getPageContent = ( - newPagePath: string, - usesLayout: boolean, - nestedPathWithoutExtension: string, -) => { - if (newPagePath.endsWith("embed")) { - return ` -import type { Params } from "next/dist/shared/lib/router/utils/route-matcher"; -import { getData } from "../page"; - -type PageProps = Readonly<{ - params: Params; -}>; - -const Page = ({ params }: PageProps) => { - await getData(params, true); - - return null; -}; - -export default Page;`; - } - if (newPagePath.includes("(individual-page-wrapper")) { - return ` -import OldPage from "@pages/${nestedPathWithoutExtension}"; -import { _generateMetadata } from "app/_utils"; -import type { Params } from "next/dist/shared/lib/router/utils/route-matcher"; -import PageWrapper from "@components/PageWrapperAppDir"; -import { headers, cookies } from "next/headers"; -import { buildLegacyCtx } from "@lib/buildLegacyCtx"; - -${ - usesLayout - ? 'import { getLayout } from "@calcom/features/MainLayoutAppDir";' - : "" -} - -export const generateMetadata = async () => await _generateMetadata(() => "", () => ""); - -type PageProps = Readonly<{ - params: Params; -}>; - -const Page = async ({ params }: PageProps) => { - const h = headers(); - const nonce = h.get("x-nonce") ?? undefined; - - const legacyCtx = buildLegacyCtx(headers(), cookies(), params); - const props = await getData(legacyCtx); - - return ( - - - - ); -}; - -export default Page;`; - } - - return ` -import Page from "@pages/${nestedPathWithoutExtension}"; -import { _generateMetadata } from "app/_utils"; - -export const generateMetadata = async () => await _generateMetadata(() => "", () => ""); - -export default Page;`; -}; - -const getNewPagePath = ( - directoryNames: string[], - fileName: string, - usesServerSideData: boolean, - usesLayout: boolean, -) => { - const newDirArr = directoryNames.map((name) => { - if (name !== "pages") { - return name; - } - - if (usesServerSideData) { - return "app/future/(individual-page-wrapper)"; - } - - if (usesLayout) { - return "app/future/(shared-page-wrapper)/(layout)"; - } - - return "app/future/(shared-page-wrapper)/(no-layout)"; - }); - - if (fileName !== "index") { - newDirArr.push(fileName); - } - - return newDirArr.join(sep); -}; - -const handleFile: Filemod< - Dependencies, - Record ->["handleFile"] = async (api, path, options) => { - const parsedPath = parse(path); - const directoryNames = parsedPath.dir.split(sep); - const endsWithPages = - directoryNames.length > 0 && - directoryNames.lastIndexOf("pages") === directoryNames.length - 1; - - const nameIsIndex = parsedPath.name === "index"; - - if (endsWithPages && nameIsIndex) { - return []; - } - - const oldData = await api.readFile(path); - - if (!endsWithPages) { - const project = new tsmorph.Project({ - useInMemoryFileSystem: true, - skipFileDependencyResolution: true, - compilerOptions: { - allowJs: true, - }, - }); - - const sourceFile = project.createSourceFile(path ?? "", oldData); - - const pageUsesServerSideData = usesServerSideData(sourceFile); - const pageUsesLayout = usesLayout(sourceFile); - - const newPagePath = getNewPagePath( - directoryNames, - parsedPath.name, - pageUsesServerSideData, - pageUsesLayout, - ); - - const nestedPathWithoutExtension = `${ - parsedPath.dir.split("/pages/")[1] ?? "" - }/${parsedPath.name}`; - - const pageContent = getPageContent( - newPagePath, - pageUsesLayout, - nestedPathWithoutExtension, - ); - - const commands: FileCommand[] = [ - { - kind: "upsertFile", - path: format({ - root: parsedPath.root, - dir: newPagePath, - ext: parsedPath.ext, - name: "page", - }), - options: { - ...options, - filePurpose: FilePurpose.ROUTE_PAGE, - oldPath: path, - oldData: removeLeadingLineBreaks(pageContent), - legacyPageData: oldData, - }, - }, - { - kind: "upsertFile", - path: format({ - root: parsedPath.root, - dir: parsedPath.dir, - ext: parsedPath.ext, - name: parsedPath.name, - }), - options: { - ...options, - filePurpose: FilePurpose.ORIGINAL_PAGE, - oldPath: path, - oldData, - }, - }, - ]; - - return commands; - } - - if (parsedPath.name === "_app" || parsedPath.name === "_document") { - return [ - { - kind: "deleteFile", - path, - }, - ]; - } - - return []; -}; - -const handleData: HandleData = async ( - api, - path, - __, - options, -) => { - try { - const filePurpose = (options.filePurpose ?? null) as FilePurpose | null; - - if (filePurpose === null) { - return { - kind: "noop", - }; - } - - const content = map.get(filePurpose) ?? null; - - if (content === null) { - return { - kind: "noop", - }; - } - - if (filePurpose === FilePurpose.ROUTE_PAGE && options.oldPath) { - return buildPageFileData(api, path, options, filePurpose); - } - - if ( - filePurpose === FilePurpose.ORIGINAL_PAGE && - options.oldPath && - options.oldData - ) { - return addUseClientStatement( - String(options.oldPath), - String(options.oldData), - ); - } - - return { - kind: "upsertData", - path, - data: content, - }; - } catch (error) { - return { - kind: "noop", - }; - } -}; - -export const repomod: Filemod = { - includePatterns: ["**/pages/**/*.{js,jsx,ts,tsx}"], - excludePatterns: ["**/node_modules/**", "**/pages/api/**"], - handleFile, - handleData, -}; diff --git a/codemods/cal.com/app-directory-boilerplate-calcom/test/test.ts b/codemods/cal.com/app-directory-boilerplate-calcom/test/test.ts deleted file mode 100644 index 2207e70a..00000000 --- a/codemods/cal.com/app-directory-boilerplate-calcom/test/test.ts +++ /dev/null @@ -1,443 +0,0 @@ -import { deepStrictEqual, ok } from "node:assert"; -import { buildApi, executeFilemod } from "@codemod-com/filemod"; -import { buildPathAPI, buildUnifiedFileSystem } from "@codemod-com/utilities"; -import type { DirectoryJSON } from "memfs"; -import { Volume, createFsFromVolume } from "memfs"; -import tsmorph from "ts-morph"; -import { describe, it } from "vitest"; -import { repomod } from "../src/index.js"; - -const transform = async (json: DirectoryJSON) => { - const volume = Volume.fromJSON(json); - const fs = createFsFromVolume(volume); - - const unifiedFileSystem = buildUnifiedFileSystem(fs); - const pathApi = buildPathAPI("/"); - - const api = buildApi<{ - tsmorph: typeof tsmorph; - }>( - unifiedFileSystem, - () => ({ - tsmorph, - }), - pathApi, - ); - - return executeFilemod(api, repomod, "/", {}, {}); -}; - -describe("cal.com app-directory-boilerplate-calcom", () => { - it("should build correct files", async () => { - const externalFileCommands = await transform({ - "/opt/project/pages/a/index.tsx": "TODO content", - "/opt/project/pages/a/embed.tsx": "TODO content", - "/opt/project/pages/a/b.tsx": ` - import { getLayout } from './getLayout'; - export default function B(props) { - return ; - } - B.getLayout = getLayout; - `, - "/opt/project/pages/a/[b]/c.tsx": ` - export const getServerSideProps = (ctx) => { - return null; - } - export default function C(props) { - return ; - } - `, - "/opt/project/pages/a/d.tsx": ` - export const getStaticProps = (ctx) => { - return null; - } - export default function C(props) { - return ; - } - `, - }); - - deepStrictEqual(externalFileCommands.length, 10); - - ok( - externalFileCommands.some( - (command) => - command.kind === "upsertFile" && - command.path === - "/opt/project/app/future/(shared-page-wrapper)/(no-layout)/a/page.tsx", - ), - ); - - ok( - externalFileCommands.some( - (command) => - command.kind === "upsertFile" && - command.path === "/opt/project/pages/a/index.tsx", - ), - ); - - ok( - externalFileCommands.some( - (command) => - command.kind === "upsertFile" && - command.path === "/opt/project/pages/a/embed.tsx", - ), - ); - - ok( - externalFileCommands.some( - (command) => - command.kind === "upsertFile" && - command.path === - "/opt/project/app/future/(shared-page-wrapper)/(layout)/a/b/page.tsx", - ), - ); - - ok( - externalFileCommands.some( - (command) => - command.kind === "upsertFile" && - command.path === "/opt/project/pages/a/b.tsx", - ), - ); - - ok( - externalFileCommands.some( - (command) => - command.kind === "upsertFile" && - command.path === - "/opt/project/app/future/(individual-page-wrapper)/a/[b]/c/page.tsx", - ), - ); - - ok( - externalFileCommands.some( - (command) => - command.kind === "upsertFile" && - command.path === "/opt/project/pages/a/[b]/c.tsx", - ), - ); - - ok( - externalFileCommands.some( - (command) => - command.kind === "upsertFile" && - command.path === - "/opt/project/app/future/(individual-page-wrapper)/a/d/page.tsx", - ), - ); - - ok( - externalFileCommands.some( - (command) => - command.kind === "upsertFile" && - command.path === "/opt/project/pages/a/d.tsx", - ), - ); - - ok( - externalFileCommands.some((command) => { - return ( - command.kind === "upsertFile" && - command.path === - "/opt/project/app/future/(shared-page-wrapper)/(no-layout)/a/embed/page.tsx" && - command.newData.replace(/\W/gm, "") === - ` - import type { Params } from "next/dist/shared/lib/router/utils/route-matcher"; - import { getData } from "../page"; - - type PageProps = Readonly<{ - params: Params; - }>; - - const Page = ({ params }: PageProps) => { - await getData(params, true); - - return null; - }; - - export default Page;`.replace(/\W/gm, "") - ); - }), - ); - - ok( - externalFileCommands.some((command) => { - return ( - command.kind === "upsertFile" && - command.path === - "/opt/project/app/future/(shared-page-wrapper)/(no-layout)/a/page.tsx" && - command.newData.replace(/\W/gm, "") === - ` - import Page from "@pages/a/index"; - import { _generateMetadata } from "app/_utils"; - - export const generateMetadata = async () => await _generateMetadata(() => "", () => ""); - export default Page; - `.replace(/\W/gm, "") - ); - }), - ); - - ok( - externalFileCommands.some((command) => { - return ( - command.kind === "upsertFile" && - command.path === "/opt/project/pages/a/index.tsx" && - command.newData.replace(/\W/gm, "") === - ` - 'use client'; - TODO content - `.replace(/\W/gm, "") - ); - }), - ); - - ok( - externalFileCommands.some((command) => { - return ( - command.kind === "upsertFile" && - command.path === - "/opt/project/app/future/(shared-page-wrapper)/(layout)/a/b/page.tsx" && - command.newData.replace(/\W/gm, "") === - ` - import Page from "@pages/a/b"; - import { _generateMetadata } from "app/_utils"; - - export const generateMetadata = async () => await _generateMetadata(() => "", () => ""); - export default Page; - `.replace(/\W/gm, "") - ); - }), - ); - - ok( - externalFileCommands.some((command) => { - return ( - command.kind === "upsertFile" && - command.path === "/opt/project/pages/a/b.tsx" && - command.newData.replace(/\W/gm, "") === - ` - 'use client'; - import { getLayout } from './getLayout'; - export default function B(props) { - return ; - } - B.getLayout = getLayout; - `.replace(/\W/gm, "") - ); - }), - ); - - ok( - externalFileCommands.some((command) => { - const expected = ` - import OldPage from "@pages/a/[b]/c"; - import { _generateMetadata } from "app/_utils"; - import type { Params } from "next/dist/shared/lib/router/utils/route-matcher"; - import PageWrapper from "@components/PageWrapperAppDir"; - import { headers, cookies } from "next/headers"; - import { buildLegacyCtx } from "@lib/buildLegacyCtx"; - - export const generateMetadata = async () => await _generateMetadata(() => "", () => ""); - - type PageProps = Readonly<{ - params: Params; - }>; - - const Page = async ({ params }: PageProps) => { - const h = headers(); - const nonce = h.get("x-nonce") ?? undefined; - - const legacyCtx = buildLegacyCtx(headers(), cookies(), params); - const props = await getData(legacyCtx); - - return ( - - - - ); - }; - - export default Page;`; - - return ( - command.kind === "upsertFile" && - command.path === - "/opt/project/app/future/(individual-page-wrapper)/a/[b]/c/page.tsx" && - command.newData.replace(/\W/gm, "") === expected.replace(/\W/gm, "") - ); - }), - ); - - ok( - externalFileCommands.some((command) => { - return ( - command.kind === "upsertFile" && - command.path === "/opt/project/pages/a/[b]/c.tsx" && - command.newData.replace(/\W/gm, "") === - ` - 'use client'; - export const getServerSideProps = (ctx) => { - return null; - } - export default function C(props) { - return ; - } - `.replace(/\W/gm, "") - ); - }), - ); - - ok( - externalFileCommands.some((command) => { - const expected = ` - import OldPage from "@pages/a/d"; - import { _generateMetadata } from "app/_utils"; - import type { Params } from "next/dist/shared/lib/router/utils/route-matcher"; - import PageWrapper from "@components/PageWrapperAppDir"; - import { headers, cookies } from "next/headers"; - import { buildLegacyCtx } from "@lib/buildLegacyCtx"; - - export const generateMetadata = async () => await _generateMetadata(() => "", () => ""); - - type PageProps = Readonly<{ - params: Params; - }>; - - const Page = async ({ params }: PageProps) => { - const h = headers(); - const nonce = h.get("x-nonce") ?? undefined; - - const legacyCtx = buildLegacyCtx(headers(), cookies(), params); - const props = await getData(legacyCtx); - - return ( - - - - ); - }; - - export default Page;`; - return ( - command.kind === "upsertFile" && - command.path === - "/opt/project/app/future/(individual-page-wrapper)/a/d/page.tsx" && - command.newData.replace(/\W/gm, "") === expected.replace(/\W/gm, "") - ); - }), - ); - - ok( - externalFileCommands.some((command) => { - return ( - command.kind === "upsertFile" && - command.path === "/opt/project/pages/a/d.tsx" && - command.newData.replace(/\W/gm, "") === - ` - 'use client'; - export const getStaticProps = (ctx) => { - return null; - } - export default function C(props) { - return ; - } - `.replace(/\W/gm, "") - ); - }), - ); - }); - - it("should insert router segment config and server-side data hooks to the future page", async () => { - const [upsertPageCommand] = await transform({ - "/opt/project/pages/a/index.tsx": ` - import C from 'C'; - import { a } from 'a'; - import b from 'b'; - - export const getServerSideProps = (ctx) => { - return a + b; - } - - const getData = () => { - getServerSideProps(); - } - - export default function P() { - return ; - } - - export const dynamic="force-dynamic"; - `, - }); - - deepStrictEqual(upsertPageCommand?.kind, "upsertFile"); - deepStrictEqual( - upsertPageCommand?.path, - "/opt/project/app/future/(individual-page-wrapper)/a/page.tsx", - ); - - deepStrictEqual( - upsertPageCommand?.newData.replace(/(?!\.)\s/gm, ""), - `import OldPage from "@pages/a/index"; - import {_generateMetadata} from "app/_utils"; - import type {Params} from "next/dist/shared/lib/router/utils/route-matcher"; - import PageWrapper from "@components/PageWrapperAppDir"; - import {headers, cookies} from "next/headers"; - import { buildLegacyCtx } from "@lib/buildLegacyCtx"; - - import b from 'b'; - import { a } from 'a'; - const getServerSideProps = (ctx) => { - return a + b; - } - const getData = () => { - getServerSideProps(); - } - - export const generateMetadata = async ()=> await _generateMetadata(()=>"",()=>""); - type PageProps=Readonly<{params:Params;}>; - const Page = async ({params}:PageProps)=>{ - const h=headers(); - const nonce=h.get("x-nonce") ?? undefined; - - const legacyCtx = buildLegacyCtx(headers(), cookies(), params); - const props = await getData(legacyCtx); - - return(); - }; - export default Page; - export const dynamic="force-dynamic"; - `.replace(/(?!\.)\s/gm, ""), - ); - }); - - it('should not insert "use client" directive twice', async () => { - const [, upsertLegacyPage] = await transform({ - "/opt/project/pages/a/index.tsx": ` - 'use client' - import C from 'C'; - - export default function P() { - return ; - } - - `, - }); - - deepStrictEqual(upsertLegacyPage?.kind, "upsertFile"); - deepStrictEqual(upsertLegacyPage?.path, "/opt/project/pages/a/index.tsx"); - - deepStrictEqual( - upsertLegacyPage?.newData.replace(/(?!\.)\s/gm, ""), - `'use client' - import C from 'C'; - - export default function P() { - return ; - } - `.replace(/(?!\.)\s/gm, ""), - ); - }); -}); diff --git a/codemods/cal.com/generate-metadata-tests-calcom/package.json b/codemods/cal.com/generate-metadata-tests-calcom/package.json deleted file mode 100644 index f8451941..00000000 --- a/codemods/cal.com/generate-metadata-tests-calcom/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "@codemod-com/codemod-cal.com-generate-metadata-tests-calcom", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "@codemod-com/filemod": "workspace:*", - "memfs": "^4.6.0", - "ts-morph": "^19.0.0", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/cal.com/generate-metadata-tests-calcom/test/test.ts b/codemods/cal.com/generate-metadata-tests-calcom/test/test.ts deleted file mode 100644 index 7037f436..00000000 --- a/codemods/cal.com/generate-metadata-tests-calcom/test/test.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { deepStrictEqual } from "node:assert"; -import { buildApi, executeFilemod } from "@codemod-com/filemod"; -import { buildPathAPI, buildUnifiedFileSystem } from "@codemod-com/utilities"; -import type { DirectoryJSON } from "memfs"; -import { Volume, createFsFromVolume } from "memfs"; -import { describe, it } from "vitest"; -import { buildData, repomod } from "../src/index.js"; - -const transform = async (json: DirectoryJSON) => { - const volume = Volume.fromJSON(json); - const fs = createFsFromVolume(volume); - - const unifiedFileSystem = buildUnifiedFileSystem(fs); - const pathApi = buildPathAPI("/"); - - const api = buildApi>( - unifiedFileSystem, - () => ({}), - pathApi, - ); - - return executeFilemod(api, repomod, "/", { testPath: "/opt/tests" }, {}); -}; - -type ExternalFileCommand = Awaited>[number]; - -const removeWhitespaces = ( - command: ExternalFileCommand, -): ExternalFileCommand => { - if (command.kind !== "upsertFile") { - return command; - } - - return { - ...command, - oldData: command.oldData.replace(/\s/, ""), - newData: command.newData.replace(/\s/, ""), - }; -}; - -describe("generate-metadata-tests", () => { - it("should build correct files", async () => { - const [command] = await transform({ - "/opt/project/pages/a/index.tsx": "", - }); - - const newData = buildData("a").replace(/\s/, ""); - - deepStrictEqual(removeWhitespaces(command!), { - kind: "upsertFile", - path: "/opt/tests/a.e2e.ts", - oldData: "", - newData, - }); - }); - - it("should build correct files", async () => { - const [command] = await transform({ - "/opt/project/pages/a/[b].tsx": "", - }); - - const newData = buildData("a/[b]").replace(/\s/, ""); - - deepStrictEqual(removeWhitespaces(command!), { - kind: "upsertFile", - path: "/opt/tests/a/[b].e2e.ts", - oldData: "", - newData, - }); - }); - - it("should build correct files", async () => { - const [command] = await transform({ - "/opt/project/pages/a/[b]/c.tsx": "", - }); - - const newData = buildData("a/[b]/c").replace(/\s/, ""); - - deepStrictEqual(removeWhitespaces(command!), { - kind: "upsertFile", - path: "/opt/tests/a/[b]/c.e2e.ts", - oldData: "", - newData, - }); - }); -}); diff --git a/codemods/cal.com/generate-url-patterns/package.json b/codemods/cal.com/generate-url-patterns/package.json deleted file mode 100644 index 6e2253d1..00000000 --- a/codemods/cal.com/generate-url-patterns/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "@codemod-com/codemod-cal.com-generate-url-patterns", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "@codemod-com/filemod": "workspace:*", - "memfs": "^4.6.0", - "ts-morph": "^19.0.0", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/cal.com/generate-url-patterns/test/test.ts b/codemods/cal.com/generate-url-patterns/test/test.ts deleted file mode 100644 index fd419258..00000000 --- a/codemods/cal.com/generate-url-patterns/test/test.ts +++ /dev/null @@ -1,223 +0,0 @@ -import { deepStrictEqual } from "node:assert"; -import { buildApi, executeFilemod } from "@codemod-com/filemod"; -import { buildPathAPI, buildUnifiedFileSystem } from "@codemod-com/utilities"; -import jscodeshift from "jscodeshift"; -import type { DirectoryJSON } from "memfs"; -import { Volume, createFsFromVolume } from "memfs"; -import { describe, it } from "vitest"; -import { repomod } from "../src/index.js"; - -const transform = async ( - json: DirectoryJSON, - options: { - turboPath: string; - abTestMiddlewarePath: string; - middlewarePath: string; - generateAsPageGroup?: boolean; - }, -) => { - const volume = Volume.fromJSON(json); - - const fs = createFsFromVolume(volume); - - const unifiedFileSystem = buildUnifiedFileSystem(fs); - const pathApi = buildPathAPI("/"); - - const api = buildApi<{ jscodeshift: typeof jscodeshift }>( - unifiedFileSystem, - () => ({ - jscodeshift, - }), - pathApi, - ); - - return executeFilemod(api, repomod, "/", options, {}); -}; - -type ExternalFileCommand = Awaited>[number]; - -const removeWhitespaces = ( - command: ExternalFileCommand, -): ExternalFileCommand => { - if (command.kind !== "upsertFile") { - return command; - } - - return { - ...command, - oldData: command.oldData.replace(/\s/gm, ""), - newData: command.newData.replace(/\s/gm, ""), - }; -}; - -const turboContent = JSON.stringify({ - globalEnv: ["OTHER_ENVVAR"], -}); - -const abTestMiddlewareContent = ` - import { type X } from 'y'; - const other = true; -`; -const middlewareContent = ` - export const config = { - matcher: [ - "otherPath", - ] - } -`; - -describe("generate-url-patterns", () => { - it("should build correct files", async () => { - const [turboJsonCommand, middlewareTsCommand, abTestMiddlewareTsCommand] = - await transform( - { - "/opt/project/turbo.json": turboContent, - "/opt/project/abTestMiddleware.ts": abTestMiddlewareContent, - "/opt/project/middleware.ts": middlewareContent, - "/opt/project/app/future/noSegment/page.tsx": "", - "/opt/project/app/future/dynamicSegment/[a]/page.tsx": "", - "/opt/project/app/future/dynamicSegment/[b]/[c]/page.tsx": "", - "/opt/project/app/future/catchAllDynamicSegments/[...d]/page.tsx": "", - "/opt/project/app/future/(someLayout)/optionalCatchAllDynamicSegments/[[...element]]/f/page.tsx": - "", - }, - { - turboPath: "/opt/project/turbo.json", - abTestMiddlewarePath: "/opt/project/abTestMiddleware.ts", - middlewarePath: "/opt/project/middleware.ts", - }, - ); - - const newData = JSON.stringify({ - globalEnv: [ - "APP_ROUTER_CATCHALLDYNAMICSEGMENTS_D_ENABLED", - "APP_ROUTER_DYNAMICSEGMENT_A_ENABLED", - "APP_ROUTER_DYNAMICSEGMENT_B_C_ENABLED", - "APP_ROUTER_NOSEGMENT_ENABLED", - "APP_ROUTER_OPTIONALCATCHALLDYNAMICSEGMENTS_ELEMENT_F_ENABLED", - "OTHER_ENVVAR", - ], - }); - - deepStrictEqual(removeWhitespaces(turboJsonCommand!), { - kind: "upsertFile", - path: "/opt/project/turbo.json", - oldData: turboContent, - newData, - }); - - deepStrictEqual( - removeWhitespaces(abTestMiddlewareTsCommand!), - removeWhitespaces({ - kind: "upsertFile", - path: "/opt/project/abTestMiddleware.ts", - oldData: abTestMiddlewareContent, - newData: `import { type X } from 'y'; - const other = true; - - const ROUTES: [URLPattern, boolean][] = [ - [ - "/catchAllDynamicSegments/:d+", - Boolean(process.env.APP_ROUTER_CATCHALLDYNAMICSEGMENTS_D_ENABLED) - ] as const, - [ - "/dynamicSegment/:a", - Boolean(process.env.APP_ROUTER_DYNAMICSEGMENT_A_ENABLED) - ] as const, - [ - "/dynamicSegment/:b/:c", - Boolean(process.env.APP_ROUTER_DYNAMICSEGMENT_B_C_ENABLED) - ] as const, - ["/noSegment", Boolean(process.env.APP_ROUTER_NOSEGMENT_ENABLED)] as const, - [ - "/optionalCatchAllDynamicSegments/:element*/f", - Boolean(process.env.APP_ROUTER_OPTIONALCATCHALLDYNAMICSEGMENTS_ELEMENT_F_ENABLED) - ] as const - ].map(([pathname, enabled]) => [new URLPattern({ - pathname - }), enabled]); -`, - }), - ); - - deepStrictEqual( - removeWhitespaces(middlewareTsCommand!), - removeWhitespaces({ - kind: "upsertFile", - path: "/opt/project/middleware.ts", - oldData: middlewareContent, - newData: ` - export const config = { - matcher: [ - "otherPath", - "/noSegment", - "/future/noSegment/", - - "/dynamicSegment/:a", - "/future/dynamicSegment/:a/", - - "/catchAllDynamicSegments/:d+", - "/future/catchAllDynamicSegments/:d+/", - - "/dynamicSegment/:b/:c", - "/future/dynamicSegment/:b/:c/", - - "/optionalCatchAllDynamicSegments/:element*/f", - "/future/optionalCatchAllDynamicSegments/:element*/f/" - ] - } - `, - }), - ); - }); - - it("should support generateAsPageGroup option", async () => { - const [turboJsonCommand, abTestMiddlewareTsCommand] = await transform( - { - "/opt/project/turbo.json": turboContent, - "/opt/project/abTestMiddleware.ts": abTestMiddlewareContent, - "/opt/project/app/future/top-level/page.tsx": "", - "/opt/project/app/future/top-level/a/page.tsx": "", - "/opt/project/app/future/top-level/b/page.tsx": "", - "/opt/project/app/future/top-level/a/b/page.tsx": "", - }, - { - turboPath: "/opt/project/turbo.json", - abTestMiddlewarePath: "/opt/project/abTestMiddleware.ts", - middlewarePath: "/opt/project/middleware.ts", - generateAsPageGroup: true, - }, - ); - - const newData = JSON.stringify({ - globalEnv: ["APP_ROUTER_TOP_LEVEL_ENABLED", "OTHER_ENVVAR"], - }); - - deepStrictEqual(removeWhitespaces(turboJsonCommand!), { - kind: "upsertFile", - path: "/opt/project/turbo.json", - oldData: turboContent, - newData, - }); - - deepStrictEqual( - removeWhitespaces(abTestMiddlewareTsCommand!), - removeWhitespaces({ - kind: "upsertFile", - path: "/opt/project/abTestMiddleware.ts", - oldData: abTestMiddlewareContent, - newData: `import { type X } from 'y'; - const other = true; - - const ROUTES: [URLPattern, boolean][] = [ - [ - "/top-level/:path*", - Boolean(process.env.APP_ROUTER_TOP_LEVEL_ENABLED) - ] as const - ].map(([pathname, enabled]) => [new URLPattern({ - pathname - }), enabled]);`, - }), - ); - }); -}); diff --git a/codemods/codemod-com/migrate-codemod-registry/package.json b/codemods/codemod-com/migrate-codemod-registry/package.json deleted file mode 100644 index 0b4fabe7..00000000 --- a/codemods/codemod-com/migrate-codemod-registry/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "@codemod-com/codemod-migrate-codemod-registry", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "@codemod-com/filemod": "workspace:*", - "memfs": "^4.6.0", - "ts-morph": "^19.0.0", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/devcycle/launchdarkly-to-devcycle/package.json b/codemods/devcycle/launchdarkly-to-devcycle/package.json deleted file mode 100644 index cdceaaf3..00000000 --- a/codemods/devcycle/launchdarkly-to-devcycle/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "launchdarkly-to-devcycle", - "author": "dmytrohryshyn", - "private": true, - "dependencies": {}, - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "5.2.2", - "vitest": "^1.0.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "license": "MIT", - "files": [ - "README.md", - ".codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/devcycle/launchdarkly-to-devcycle/test/test.ts b/codemods/devcycle/launchdarkly-to-devcycle/test/test.ts deleted file mode 100644 index 3ceac238..00000000 --- a/codemods/devcycle/launchdarkly-to-devcycle/test/test.ts +++ /dev/null @@ -1,71 +0,0 @@ -import assert from "node:assert"; -import { readFile } from "node:fs/promises"; -import { join } from "node:path"; -import jscodeshift, { type API } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -const buildApi = (parser: string | undefined): API => ({ - j: parser ? jscodeshift.withParser(parser) : jscodeshift, - jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, - stats: () => { - console.error( - "The stats function was called, which is not supported on purpose", - ); - }, - report: () => { - console.error( - "The report function was called, which is not supported on purpose", - ); - }, -}); - -describe("launchdarkly-to-devcycle", () => { - it("Should replace withLDProvider HOC", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/withLDProvider.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/withLDProvider.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); - - it("Should replace useFlags hook", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/useFlags.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/useFlags.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); -}); diff --git a/codemods/devcycle/launchdarkly-to-devcycle/tsconfig.json b/codemods/devcycle/launchdarkly-to-devcycle/tsconfig.json deleted file mode 100644 index 329a7d63..00000000 --- a/codemods/devcycle/launchdarkly-to-devcycle/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "@codemod-com/tsconfig/codemod.json", - "compilerOptions": { - "baseUrl": ".", - "outDir": "./dist" - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/devcycle/replace-feature-flag/package.json b/codemods/devcycle/replace-feature-flag/package.json deleted file mode 100644 index d5721444..00000000 --- a/codemods/devcycle/replace-feature-flag/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "devcycle/replace-feature-flag", - "author": "dmytrohryshyn", - "private": true, - "dependencies": {}, - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "5.2.2", - "vitest": "^1.0.1", - "ts-morph": "^22.0.0" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "license": "MIT", - "files": [ - "README.md", - ".codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/devcycle/replace-feature-flag/tsconfig.json b/codemods/devcycle/replace-feature-flag/tsconfig.json deleted file mode 100644 index 329a7d63..00000000 --- a/codemods/devcycle/replace-feature-flag/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "@codemod-com/tsconfig/codemod.json", - "compilerOptions": { - "baseUrl": ".", - "outDir": "./dist" - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/ember/5/app-controller-router-props/package.json b/codemods/ember/5/app-controller-router-props/package.json deleted file mode 100644 index 85f62223..00000000 --- a/codemods/ember/5/app-controller-router-props/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-ember-5-app-controller-router-props", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/ember/5/array-wrapper/package.json b/codemods/ember/5/array-wrapper/package.json deleted file mode 100644 index 6bdb23b4..00000000 --- a/codemods/ember/5/array-wrapper/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-ember-5-array-wrapper", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/ember/5/convert-module-for-to-setup-test/package.json b/codemods/ember/5/convert-module-for-to-setup-test/package.json deleted file mode 100644 index e0571fd5..00000000 --- a/codemods/ember/5/convert-module-for-to-setup-test/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-ember-5-convert-module-for-to-setup-test", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/ember/5/cp-property-map/package.json b/codemods/ember/5/cp-property-map/package.json deleted file mode 100644 index d2bbe495..00000000 --- a/codemods/ember/5/cp-property-map/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-ember-5-cp-property-map", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/ember/5/cp-property/package.json b/codemods/ember/5/cp-property/package.json deleted file mode 100644 index c25fbf51..00000000 --- a/codemods/ember/5/cp-property/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-ember-5-cp-property", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/ember/5/cp-volatile/package.json b/codemods/ember/5/cp-volatile/package.json deleted file mode 100644 index 225c0226..00000000 --- a/codemods/ember/5/cp-volatile/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-ember-5-cp-volatile", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/ember/5/deprecate-merge/package.json b/codemods/ember/5/deprecate-merge/package.json deleted file mode 100644 index db56eed1..00000000 --- a/codemods/ember/5/deprecate-merge/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-ember-5-deprecate-merge", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/ember/5/deprecate-router-events/package.json b/codemods/ember/5/deprecate-router-events/package.json deleted file mode 100644 index 2cd780a0..00000000 --- a/codemods/ember/5/deprecate-router-events/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-ember-5-deprecate-router-events", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/ember/5/ember-jquery-legacy/package.json b/codemods/ember/5/ember-jquery-legacy/package.json deleted file mode 100644 index ecd2a5c1..00000000 --- a/codemods/ember/5/ember-jquery-legacy/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-ember-5-ember-jquery-legacy", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/ember/5/es5-getter-ember-codemod/package.json b/codemods/ember/5/es5-getter-ember-codemod/package.json deleted file mode 100644 index 3ceb49e9..00000000 --- a/codemods/ember/5/es5-getter-ember-codemod/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-ember-5-es5-getter-ember-codemod", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/ember/5/fpe-computed/package.json b/codemods/ember/5/fpe-computed/package.json deleted file mode 100644 index c285b3ad..00000000 --- a/codemods/ember/5/fpe-computed/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-ember-5-fpe-computed", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/ember/5/fpe-observes/package.json b/codemods/ember/5/fpe-observes/package.json deleted file mode 100644 index b41bd8d3..00000000 --- a/codemods/ember/5/fpe-observes/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-ember-5-fpe-observes", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/ember/5/fpe-on/package.json b/codemods/ember/5/fpe-on/package.json deleted file mode 100644 index ef0166ba..00000000 --- a/codemods/ember/5/fpe-on/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-ember-5-fpe-on", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/ember/5/jquery-apis/package.json b/codemods/ember/5/jquery-apis/package.json deleted file mode 100644 index 2c042f6e..00000000 --- a/codemods/ember/5/jquery-apis/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-ember-5-jquery-apis", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/ember/5/jquery-event/package.json b/codemods/ember/5/jquery-event/package.json deleted file mode 100644 index f1ea6697..00000000 --- a/codemods/ember/5/jquery-event/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-ember-5-jquery-event", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/ember/5/notify-property-change/package.json b/codemods/ember/5/notify-property-change/package.json deleted file mode 100644 index 4b0c4828..00000000 --- a/codemods/ember/5/notify-property-change/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-ember-5-notify-property-change", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/ember/5/object-new-constructor/package.json b/codemods/ember/5/object-new-constructor/package.json deleted file mode 100644 index 66e4198e..00000000 --- a/codemods/ember/5/object-new-constructor/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-ember-5-object-new-constructor", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/eslint/biome/migrate-rules/package.json b/codemods/eslint/biome/migrate-rules/package.json deleted file mode 100644 index b3c4e3cd..00000000 --- a/codemods/eslint/biome/migrate-rules/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "@codemod-com/codemod-eslint-to-biome-rules", - "devDependencies": { - "@biomejs/biome": "catalog:", - "@codemod-com/filemod": "workspace:*", - "@codemod-com/utilities": "workspace:*", - "@vitest/coverage-v8": "catalog:", - "json-schema-to-typescript": "catalog:", - "memfs": "^4.6.0", - "ts-node": "^10.9.1", - "typescript": "^5.2.2", - "valibot": "catalog:", - "vitest": "^1.0.1" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "generate": "tsx generate-latest-dts.ts", - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/ethers/v6/big-numbers/package.json b/codemods/ethers/v6/big-numbers/package.json deleted file mode 100644 index 153dcbfe..00000000 --- a/codemods/ethers/v6/big-numbers/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "ethers-big-numbers", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "yugal41735" -} diff --git a/codemods/ethers/v6/big-numbers/tsconfig.json b/codemods/ethers/v6/big-numbers/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/ethers/v6/big-numbers/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/ethers/v6/contracts-ambiguous-methods/package.json b/codemods/ethers/v6/contracts-ambiguous-methods/package.json deleted file mode 100644 index d242277a..00000000 --- a/codemods/ethers/v6/contracts-ambiguous-methods/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "contract-to-typed-address-wrapper", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "yugal41735" -} diff --git a/codemods/ethers/v6/contracts-ambiguous-methods/tsconfig.json b/codemods/ethers/v6/contracts-ambiguous-methods/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/ethers/v6/contracts-ambiguous-methods/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/ethers/v6/contracts-other-methods/package.json b/codemods/ethers/v6/contracts-other-methods/package.json deleted file mode 100644 index de5a66c8..00000000 --- a/codemods/ethers/v6/contracts-other-methods/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "ethers-5-contract-methods-refactor", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "yugal41735" -} diff --git a/codemods/ethers/v6/contracts-other-methods/tsconfig.json b/codemods/ethers/v6/contracts-other-methods/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/ethers/v6/contracts-other-methods/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/ethers/v6/importing/package.json b/codemods/ethers/v6/importing/package.json deleted file mode 100644 index 38cceb7f..00000000 --- a/codemods/ethers/v6/importing/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "ethers-5-import-infura-provider-refactor", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "yugal41735" -} diff --git a/codemods/ethers/v6/importing/tsconfig.json b/codemods/ethers/v6/importing/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/ethers/v6/importing/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/ethers/v6/providers/package.json b/codemods/ethers/v6/providers/package.json deleted file mode 100644 index 7e56c6c7..00000000 --- a/codemods/ethers/v6/providers/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "ethers-5-provider-methods-update", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "yugal41735" -} diff --git a/codemods/ethers/v6/providers/tsconfig.json b/codemods/ethers/v6/providers/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/ethers/v6/providers/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/ethers/v6/singatures/package.json b/codemods/ethers/v6/singatures/package.json deleted file mode 100644 index 481e0251..00000000 --- a/codemods/ethers/v6/singatures/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "ethers-5-replace-split-join-signature", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "yugal41735" -} diff --git a/codemods/ethers/v6/singatures/tsconfig.json b/codemods/ethers/v6/singatures/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/ethers/v6/singatures/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/ethers/v6/transactions/package.json b/codemods/ethers/v6/transactions/package.json deleted file mode 100644 index c42d9a5f..00000000 --- a/codemods/ethers/v6/transactions/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "transaction-methods-refactoring", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "yugal41735" -} diff --git a/codemods/ethers/v6/transactions/tsconfig.json b/codemods/ethers/v6/transactions/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/ethers/v6/transactions/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/ethers/v6/utilities/package.json b/codemods/ethers/v6/utilities/package.json deleted file mode 100644 index 98cdbf3f..00000000 --- a/codemods/ethers/v6/utilities/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "ethers-utils-to-core-methods-migration", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "yugal41735" -} diff --git a/codemods/ethers/v6/utilities/tsconfig.json b/codemods/ethers/v6/utilities/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/ethers/v6/utilities/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/history/4/replace-state-object/package.json b/codemods/history/4/replace-state-object/package.json deleted file mode 100644 index e7e6fb7f..00000000 --- a/codemods/history/4/replace-state-object/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-history-4-replace-state-object", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/history/4/replace-state-object/test/test.ts b/codemods/history/4/replace-state-object/test/test.ts deleted file mode 100644 index 8ccf485d..00000000 --- a/codemods/history/4/replace-state-object/test/test.ts +++ /dev/null @@ -1,67 +0,0 @@ -import assert from "node:assert/strict"; -import { buildApi } from "@codemod-com/utilities"; -import type { FileInfo } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -describe("history v4 replace-state-object", () => { - it("should extract `state` object into the second argument", async () => { - const input = ` - import createHistory from 'history/createBrowserHistory'; - - const history = createHistory(); - - history.push({ pathname: '/new-path', search: 'search', hash: 'hash', state: { key: 'value' } }); - `; - - const output = ` - import createHistory from 'history/createBrowserHistory'; - - const history = createHistory(); - - history.push({ pathname: '/new-path', search: 'search', hash: 'hash' }, { key: 'value' }); - `; - - const fileInfo: FileInfo = { - path: "index.js", - source: input, - }; - - const actualOutput = transform(fileInfo, buildApi("js")); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - output.replace(/\W/gm, ""), - ); - }); - - it("should do nothing if the argument is simply a string.", async () => { - const input = ` - import createHistory from 'history/createBrowserHistory'; - - const history = createHistory(); - - history.push('/new-path'); - `; - - const output = ` - import createHistory from 'history/createBrowserHistory'; - - const history = createHistory(); - - history.push('/new-path'); - `; - - const fileInfo: FileInfo = { - path: "index.js", - source: input, - }; - - const actualOutput = transform(fileInfo, buildApi("js")); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - output.replace(/\W/gm, ""), - ); - }); -}); diff --git a/codemods/history/4/use-back/package.json b/codemods/history/4/use-back/package.json deleted file mode 100644 index 70c4e6ce..00000000 --- a/codemods/history/4/use-back/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-history-4-use-back", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/history/4/use-back/test/test.ts b/codemods/history/4/use-back/test/test.ts deleted file mode 100644 index 6d54d2b1..00000000 --- a/codemods/history/4/use-back/test/test.ts +++ /dev/null @@ -1,65 +0,0 @@ -import assert from "node:assert/strict"; -import { buildApi, trimLicense } from "@codemod-com/utilities"; -import type { FileInfo } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -describe("history v4 use-back", () => { - it("should replace history.goBack() with history.back()", async () => { - const input = ` - history.goBack(); - - const Component = () => { - const handleChange = () => { - history.goBack(); - }; - - useEffect(() => { - history.goBack(); - }, []); - - return ( -
- -
- ); - }; - `; - - const fileInfo: FileInfo = { - path: "index.js", - source: trimLicense(input), - }; - - const actualOutput = transform(fileInfo, buildApi("js")); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - trimLicense(output).replace(/\W/gm, ""), - ); - }); -}); diff --git a/codemods/history/4/use-block/package.json b/codemods/history/4/use-block/package.json deleted file mode 100644 index 331094cc..00000000 --- a/codemods/history/4/use-block/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-history-4-use-block", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/history/4/use-block/test/test.ts b/codemods/history/4/use-block/test/test.ts deleted file mode 100644 index cbdb641d..00000000 --- a/codemods/history/4/use-block/test/test.ts +++ /dev/null @@ -1,77 +0,0 @@ -import assert from "node:assert/strict"; -import { buildApi } from "@codemod-com/utilities"; -import type { FileInfo } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -describe("history v4 use-block", () => { - it("should replace history.listenBefore() with history.block() when location is used", async () => { - const input = ` - import createHistory from 'history/createBrowserHistory'; - - const history = createHistory(); - - history.listenBefore(location => { - console.log(location); - }); - `; - - const output = ` - import createHistory from 'history/createBrowserHistory'; - - const history = createHistory(); - - history.block(({ location }) => { - console.log(location); - }); - `; - - const fileInfo: FileInfo = { - path: "index.js", - source: input, - }; - - const actualOutput = transform(fileInfo, buildApi("js")); - - assert.deepEqual( - actualOutput?.replace(/[\s_;()]/gm, ""), - output.replace(/[\s_;()]/gm, ""), - ); - }); - - it("should replace history.listenBefore() with history.block() when both location and action are used", async () => { - const input = ` - import createHistory from 'history/createBrowserHistory'; - - const history = createHistory(); - - history.listenBefore((location, callback) => { - console.log(location); - callback(); - }); - `; - - const output = ` - import createHistory from 'history/createBrowserHistory'; - - const history = createHistory(); - - history.block(({ location, action }) => { - console.log(location); - action(); - }); - `; - - const fileInfo: FileInfo = { - path: "index.js", - source: input, - }; - - const actualOutput = transform(fileInfo, buildApi("js")); - - assert.deepEqual( - actualOutput?.replace(/[\s_;()]/gm, ""), - output.replace(/[\s_;()]/gm, ""), - ); - }); -}); diff --git a/codemods/history/4/use-location/package.json b/codemods/history/4/use-location/package.json deleted file mode 100644 index 825fdce3..00000000 --- a/codemods/history/4/use-location/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-history-4-use-location", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/history/4/use-location/test/test.ts b/codemods/history/4/use-location/test/test.ts deleted file mode 100644 index d9bfe333..00000000 --- a/codemods/history/4/use-location/test/test.ts +++ /dev/null @@ -1,37 +0,0 @@ -import assert from "node:assert/strict"; -import { buildApi, trimLicense } from "@codemod-com/utilities"; -import type { FileInfo } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -describe("history v4 use-location", () => { - it("should replace history.getCurrentLocation() with history.location", async () => { - const input = ` - import createHistory from 'history/createBrowserHistory'; - - const history = createHistory(); - - const currentLocation = history.getCurrentLocation(); - `; - - const output = ` - import createHistory from 'history/createBrowserHistory'; - - const history = createHistory(); - - const currentLocation = history.location; - `; - - const fileInfo: FileInfo = { - path: "index.js", - source: trimLicense(input), - }; - - const actualOutput = transform(fileInfo, buildApi("js")); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - trimLicense(output).replace(/\W/gm, ""), - ); - }); -}); diff --git a/codemods/i18n/package.json b/codemods/i18n/package.json deleted file mode 100644 index 297d453a..00000000 --- a/codemods/i18n/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "@codemod-com/codemod-i18n", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "@codemod-com/filemod": "workspace:*", - "memfs": "^4.6.0", - "ts-morph": "^19.0.0", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/i18n/test/test.ts b/codemods/i18n/test/test.ts deleted file mode 100644 index 409758d1..00000000 --- a/codemods/i18n/test/test.ts +++ /dev/null @@ -1,408 +0,0 @@ -import { deepStrictEqual } from "node:assert"; -import type { UnifiedFileSystem } from "@codemod-com/filemod"; -import { buildApi, executeFilemod } from "@codemod-com/filemod"; -import { buildPathAPI, buildUnifiedFileSystem } from "@codemod-com/utilities"; -import type { DirectoryJSON } from "memfs"; -import { Volume, createFsFromVolume } from "memfs"; -import tsmorph from "ts-morph"; -import { describe, it } from "vitest"; -import { repomod } from "../src/index.js"; - -const transform = async (json: DirectoryJSON) => { - const volume = Volume.fromJSON(json); - const fs = createFsFromVolume(volume); - - const unifiedFileSystem = buildUnifiedFileSystem(fs); - const pathApi = buildPathAPI("/"); - - const api = buildApi<{ - tsmorph: typeof tsmorph; - unifiedFileSystem: UnifiedFileSystem; - }>( - unifiedFileSystem, - () => ({ - tsmorph, - unifiedFileSystem, - }), - pathApi, - ); - - return executeFilemod(api, repomod, "/", {}, {}); -}; - -describe("i18n remove unused translations", () => { - it("should support t('translationKey')", async () => { - const A_CONTENT = ` - import { useLocale } from "@calcom/lib/hooks/useLocale"; - - export default function A() { - const { t } = useLocale(); - - return <> -

{t('key_1')}

-

{t( a ? 'key_2' : 'key_3')}

- - } - `; - - const LOCALE_CONTENT = ` - { - "key_1": "key1", - "key_2": "key2", - "key_3": "key3", - "key_4": "key4", - } - `; - - const [upsertDataCommand] = await transform({ - "/opt/project/components/A.tsx": A_CONTENT, - "/opt/project/public/static/locales/en/common.json": LOCALE_CONTENT, - }); - - const expectedResult = ` - { - "key_1": "key1", - "key_2": "key2", - "key_3": "key3", - } - `; - deepStrictEqual(upsertDataCommand?.kind, "upsertFile"); - - deepStrictEqual( - upsertDataCommand.path, - "/opt/project/public/static/locales/en/common.json", - ); - - deepStrictEqual( - upsertDataCommand.newData.replace(/\W/gm, ""), - expectedResult.replace(/\W/gm, ""), - ); - }); - - it("should support props.language('translationKey')", async () => { - const A_CONTENT = ` - import { useLocale } from "@calcom/lib/hooks/useLocale"; - - export default function A(props) { - return

{props.language('key_1')}

- } - `; - - const LOCALE_CONTENT = ` - { - "key_1": "key1", - "key_2": "key2" - } - `; - - const [upsertDataCommand] = await transform({ - "/opt/project/components/A.tsx": A_CONTENT, - "/opt/project/public/static/locales/en/common.json": LOCALE_CONTENT, - }); - - const expectedResult = ` - { - "key_1": "key1" - } - `; - deepStrictEqual(upsertDataCommand?.kind, "upsertFile"); - - deepStrictEqual( - upsertDataCommand.path, - "/opt/project/public/static/locales/en/common.json", - ); - - deepStrictEqual( - upsertDataCommand.newData.replace(/\W/gm, ""), - expectedResult.replace(/\W/gm, ""), - ); - }); - - it("should support this.getTextBody('translationKey1', 'translationText2')", async () => { - const A_CONTENT = ` - import { useLocale } from "@calcom/lib/hooks/useLocale"; - - export default class A extends B { - protected c() { - return { - text: this.getTextBody("key_1", "key_2"), - }; - } - } - `; - - const LOCALE_CONTENT = ` - { - "key_1": "key1", - "key_2": "key2", - "key_3": "key3, - } - `; - - const [upsertDataCommand] = await transform({ - "/opt/project/components/A.tsx": A_CONTENT, - "/opt/project/public/static/locales/en/common.json": LOCALE_CONTENT, - }); - - const expectedResult = ` - { - "key_1": "key1", - "key_2": "key2", - } - `; - deepStrictEqual(upsertDataCommand?.kind, "upsertFile"); - - deepStrictEqual( - upsertDataCommand.path, - "/opt/project/public/static/locales/en/common.json", - ); - - deepStrictEqual( - upsertDataCommand.newData.replace(/\W/gm, ""), - expectedResult.replace(/\W/gm, ""), - ); - }); - - it("should support a.translate('translationKey')", async () => { - const A_CONTENT = ` - import { useLocale } from "@calcom/lib/hooks/useLocale"; - - export default function A(props) { - return

{props.a.b.c.translate('key_1')}

- } - `; - - const LOCALE_CONTENT = ` - { - "key_1": "key1", - "key_2": "key2" - } - `; - - const [upsertDataCommand] = await transform({ - "/opt/project/components/A.tsx": A_CONTENT, - "/opt/project/public/static/locales/en/common.json": LOCALE_CONTENT, - }); - - const expectedResult = ` - { - "key_1": "key1" - } - `; - deepStrictEqual(upsertDataCommand?.kind, "upsertFile"); - - deepStrictEqual( - upsertDataCommand.path, - "/opt/project/public/static/locales/en/common.json", - ); - - deepStrictEqual( - upsertDataCommand.newData.replace(/\W/gm, ""), - expectedResult.replace(/\W/gm, ""), - ); - }); - - it("should support ", async () => { - const A_CONTENT = ` - import { Trans } from "next-i18next"; - - export default function A() { - return - } - `; - - const LOCALE_CONTENT = ` - { - "key_1": "key1", - "key_2": "key2" - } - `; - - const [upsertDataCommand] = await transform({ - "/opt/project/components/A.tsx": A_CONTENT, - "/opt/project/public/static/locales/en/common.json": LOCALE_CONTENT, - }); - - const expectedResult = ` - { - "key_1": "key1" - } - `; - deepStrictEqual(upsertDataCommand?.kind, "upsertFile"); - - deepStrictEqual( - upsertDataCommand.path, - "/opt/project/public/static/locales/en/common.json", - ); - - deepStrictEqual( - upsertDataCommand.newData.replace(/\W/gm, ""), - expectedResult.replace(/\W/gm, ""), - ); - }); - - it("should support ", async () => { - const A_CONTENT = ` - import { Trans } from "next-i18next"; - - const variable1 = "1"; - const variable2 = "2"; - - export default function A() { - return <> - -

{t(\`key_\${variable2}\`)}

- - } - `; - - const LOCALE_CONTENT = ` - { - "aaakey": "aaakey", - "key_1": "key1", - "key_2": "key2" - } - `; - - const [upsertDataCommand] = await transform({ - "/opt/project/components/A.tsx": A_CONTENT, - "/opt/project/public/static/locales/en/common.json": LOCALE_CONTENT, - }); - - const expectedResult = ` - { - "key_1": "key1", - "key_2": "key2" - } - `; - deepStrictEqual(upsertDataCommand?.kind, "upsertFile"); - - deepStrictEqual( - upsertDataCommand.path, - "/opt/project/public/static/locales/en/common.json", - ); - - deepStrictEqual( - upsertDataCommand.newData.replace(/\W/gm, ""), - expectedResult.replace(/\W/gm, ""), - ); - }); - - it("should support ", async () => { - const A_CONTENT = ` - import { Trans } from "next-i18next"; - - const variable = "1"; - - export default function A() { - return <> - - - } - `; - - const LOCALE_CONTENT = ` - { - "unused_key": "", - "key_tail": "", - } - `; - - const [upsertDataCommand] = await transform({ - "/opt/project/components/A.tsx": A_CONTENT, - "/opt/project/public/static/locales/en/common.json": LOCALE_CONTENT, - }); - - const expectedResult = ` - { - "key_tail": "", - } - `; - deepStrictEqual(upsertDataCommand?.kind, "upsertFile"); - - deepStrictEqual( - upsertDataCommand.path, - "/opt/project/public/static/locales/en/common.json", - ); - - deepStrictEqual( - upsertDataCommand.newData.replace(/\W/gm, ""), - expectedResult.replace(/\W/gm, ""), - ); - }); - - it("should support t(`${variable}_tail`)", async () => { - const A_CONTENT = ` - t(\`\${variable2}_tail\`); - `; - - const LOCALE_CONTENT = ` - { - "unused_key": "", - "key_tail": "", - } - `; - - const [upsertDataCommand] = await transform({ - "/opt/project/components/A.tsx": A_CONTENT, - "/opt/project/public/static/locales/en/common.json": LOCALE_CONTENT, - }); - - const expectedResult = ` - { - "key_tail": "", - } - `; - deepStrictEqual(upsertDataCommand?.kind, "upsertFile"); - - deepStrictEqual( - upsertDataCommand.path, - "/opt/project/public/static/locales/en/common.json", - ); - - deepStrictEqual( - upsertDataCommand.newData.replace(/\W/gm, ""), - expectedResult.replace(/\W/gm, ""), - ); - }); - - it("should consider snake_case component props i18n keys>", async () => { - const A_CONTENT = ` - export default function Component() { - return - } - `; - - const LOCALE_CONTENT = ` - { - "unused_key": "", - "key_1": "", - "key_2": "", - } - `; - - const [upsertDataCommand] = await transform({ - "/opt/project/components/A.tsx": A_CONTENT, - "/opt/project/public/static/locales/en/common.json": LOCALE_CONTENT, - }); - - const expectedResult = ` - { - "key_1": "", - "key_2": "", - } - `; - - deepStrictEqual(upsertDataCommand?.kind, "upsertFile"); - - deepStrictEqual( - upsertDataCommand.path, - "/opt/project/public/static/locales/en/common.json", - ); - - deepStrictEqual( - upsertDataCommand.newData.replace(/\W/gm, ""), - expectedResult.replace(/\W/gm, ""), - ); - }); -}); diff --git a/codemods/immutable/0/add-deprecation-comment/package.json b/codemods/immutable/0/add-deprecation-comment/package.json deleted file mode 100644 index 66670c36..00000000 --- a/codemods/immutable/0/add-deprecation-comment/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-immutable-0-add-deprecation-comment", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/immutable/0/nest-from-js/package.json b/codemods/immutable/0/nest-from-js/package.json deleted file mode 100644 index 1944ed0e..00000000 --- a/codemods/immutable/0/nest-from-js/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-immutable-0-nest-from-js", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/immutable/0/remove-from-js/package.json b/codemods/immutable/0/remove-from-js/package.json deleted file mode 100644 index f3866ccc..00000000 --- a/codemods/immutable/0/remove-from-js/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-immutable-0-remove-from-js", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/immutable/0/remove-import/package.json b/codemods/immutable/0/remove-import/package.json deleted file mode 100644 index 16d6caeb..00000000 --- a/codemods/immutable/0/remove-import/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-immutable-0-remove-import", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/immutable/0/remove-to-js/package.json b/codemods/immutable/0/remove-to-js/package.json deleted file mode 100644 index fef9db65..00000000 --- a/codemods/immutable/0/remove-to-js/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-immutable-0-remove-to-js", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/immutable/0/replace-get-in/package.json b/codemods/immutable/0/replace-get-in/package.json deleted file mode 100644 index 154291fb..00000000 --- a/codemods/immutable/0/replace-get-in/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-immutable-0-replace-get-in", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/immutable/0/replace-get/package.json b/codemods/immutable/0/replace-get/package.json deleted file mode 100644 index 2c084a1e..00000000 --- a/codemods/immutable/0/replace-get/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-immutable-0-replace-get", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/immutable/0/replace-merge/package.json b/codemods/immutable/0/replace-merge/package.json deleted file mode 100644 index c8db05ec..00000000 --- a/codemods/immutable/0/replace-merge/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-immutable-0-replace-merge", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/immutable/0/replace-set-in/package.json b/codemods/immutable/0/replace-set-in/package.json deleted file mode 100644 index 5317b1bf..00000000 --- a/codemods/immutable/0/replace-set-in/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-immutable-0-replace-set-in", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/immutable/0/replace-set/package.json b/codemods/immutable/0/replace-set/package.json deleted file mode 100644 index 347cb1b6..00000000 --- a/codemods/immutable/0/replace-set/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-immutable-0-replace-set", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/immutable/4/isterable-to-iscollection/package.json b/codemods/immutable/4/isterable-to-iscollection/package.json deleted file mode 100644 index bad5cc29..00000000 --- a/codemods/immutable/4/isterable-to-iscollection/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-immutable-4-isterable-to-iscollection", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/immutable/4/map-to-array/package.json b/codemods/immutable/4/map-to-array/package.json deleted file mode 100644 index ecc3f417..00000000 --- a/codemods/immutable/4/map-to-array/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-immutable-4-map-to-array", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/immutable/4/rename-to-seq/package.json b/codemods/immutable/4/rename-to-seq/package.json deleted file mode 100644 index 316733a4..00000000 --- a/codemods/immutable/4/rename-to-seq/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-immutable-4-rename-to-seq", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/jasmine/5.0/handling_env-execute/cdmd_dist/index.cjs b/codemods/jasmine/5.0/handling_env-execute/cdmd_dist/index.cjs deleted file mode 100644 index aaff7b66..00000000 --- a/codemods/jasmine/5.0/handling_env-execute/cdmd_dist/index.cjs +++ /dev/null @@ -1,30 +0,0 @@ -module.exports = function (fileInfo, api) { - const j = api.jscodeshift; - const root = j(fileInfo.source); - - // Find all CallExpressions where env.execute is called with a callback - root - .find(j.CallExpression, { - callee: { - type: "MemberExpression", - object: { name: "env" }, - property: { name: "execute" }, - }, - arguments: (args) => - args.length === 2 && j.FunctionExpression.check(args[1]), - }) - .forEach((path) => { - const callExpression = path.node; - - // Replace the function expression argument with async/await syntax - callExpression.arguments = []; - - // Wrap in an await expression - const awaitExpression = j.awaitExpression(callExpression); - - // Replace the old statement with await env.execute() - j(path).replaceWith(awaitExpression); - }); - - return root.toSource(); -}; diff --git a/codemods/jasmine/5.0/handling_env-execute/package.json b/codemods/jasmine/5.0/handling_env-execute/package.json deleted file mode 100644 index b17543d0..00000000 --- a/codemods/jasmine/5.0/handling_env-execute/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "handling-env-execute", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "yugal41735" -} diff --git a/codemods/jasmine/5.0/handling_env-execute/src/index.ts b/codemods/jasmine/5.0/handling_env-execute/src/index.ts deleted file mode 100644 index 104f8bc7..00000000 --- a/codemods/jasmine/5.0/handling_env-execute/src/index.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { API, FileInfo } from "jscodeshift"; - -export default function transformer(fileInfo: FileInfo, api: API) { - const j = api.jscodeshift; - const root = j(fileInfo.source); - - // Find all CallExpressions where env.execute is called with a callback - root - .find(j.CallExpression, { - callee: { - type: "MemberExpression", - object: { name: "env" }, - property: { name: "execute" }, - }, - arguments: (args: any[]) => - args.length === 2 && j.FunctionExpression.check(args[1]), - }) - .forEach((path) => { - const callExpression = path.node; - - // Replace the function expression argument with async/await syntax - callExpression.arguments = []; - - // Wrap in an await expression - const awaitExpression = j.awaitExpression(callExpression); - - // Replace the old statement with await env.execute() - j(path).replaceWith(awaitExpression); - }); - - return root.toSource(); -} diff --git a/codemods/jasmine/5.0/handling_env-execute/test/test.ts b/codemods/jasmine/5.0/handling_env-execute/test/test.ts deleted file mode 100644 index 2793385a..00000000 --- a/codemods/jasmine/5.0/handling_env-execute/test/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -import assert from "node:assert"; -import { readFile } from "node:fs/promises"; -import { join } from "node:path"; -import jscodeshift, { type API } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -const buildApi = (parser: string | undefined): API => ({ - j: parser ? jscodeshift.withParser(parser) : jscodeshift, - jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, - stats: () => { - console.error( - "The stats function was called, which is not supported on purpose", - ); - }, - report: () => { - console.error( - "The report function was called, which is not supported on purpose", - ); - }, -}); - -describe("three_transform_logluvloader", () => { - it("test #1", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); -}); diff --git a/codemods/jasmine/5.0/handling_env-execute/tsconfig.json b/codemods/jasmine/5.0/handling_env-execute/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/jasmine/5.0/handling_env-execute/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/jasmine/5.0/node-boot-removal/cdmd_dist/index.cjs b/codemods/jasmine/5.0/node-boot-removal/cdmd_dist/index.cjs deleted file mode 100644 index 2f9637e0..00000000 --- a/codemods/jasmine/5.0/node-boot-removal/cdmd_dist/index.cjs +++ /dev/null @@ -1,51 +0,0 @@ -/*! @license -The MIT License (MIT) - -Copyright (c) 2024 yugal41735 - -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. - -*/ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function () { - return transform; - }, -}); -function transform(file, api, options) { - const j = api.jscodeshift; - const root = j(file.source); - let dirtyFlag = false; - root - .find(j.VariableDeclarator, { - init: { - callee: { name: "require" }, - arguments: [{ value: "jasmine-core/node_boot.js" }], - }, - }) - .forEach((path) => { - const requireCall = path.value.init; - if ( - j.CallExpression.check(requireCall) && - requireCall.arguments.length === 1 - ) { - const arg = requireCall.arguments[0]; - if (j.Literal.check(arg) && arg.value === "jasmine-core/node_boot.js") { - path.value.init = j.memberExpression( - j.callExpression(j.identifier("require"), [ - j.literal("jasmine-core"), - ]), - j.identifier("boot"), - ); - dirtyFlag = true; - } - } - }); - return dirtyFlag ? root.toSource() : undefined; -} diff --git a/codemods/jasmine/5.0/node-boot-removal/package.json b/codemods/jasmine/5.0/node-boot-removal/package.json deleted file mode 100644 index 23c6a365..00000000 --- a/codemods/jasmine/5.0/node-boot-removal/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "jasmine-1-require-node-boot-to-boot", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "yugal41735" -} diff --git a/codemods/jasmine/5.0/node-boot-removal/test/test.ts b/codemods/jasmine/5.0/node-boot-removal/test/test.ts deleted file mode 100644 index 17261282..00000000 --- a/codemods/jasmine/5.0/node-boot-removal/test/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -import assert from "node:assert"; -import { readFile } from "node:fs/promises"; -import { join } from "node:path"; -import jscodeshift, { type API } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -const buildApi = (parser: string | undefined): API => ({ - j: parser ? jscodeshift.withParser(parser) : jscodeshift, - jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, - stats: () => { - console.error( - "The stats function was called, which is not supported on purpose", - ); - }, - report: () => { - console.error( - "The report function was called, which is not supported on purpose", - ); - }, -}); - -describe("jasmine/1/require-node-boot-to-boot", () => { - it("test #1", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); -}); diff --git a/codemods/jasmine/5.0/node-boot-removal/tsconfig.json b/codemods/jasmine/5.0/node-boot-removal/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/jasmine/5.0/node-boot-removal/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/jest/vitest/package.json b/codemods/jest/vitest/package.json deleted file mode 100644 index 4f0ac0ff..00000000 --- a/codemods/jest/vitest/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-jest-vitest", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/meteor/v3/fibers-to-async-promises/package.json b/codemods/meteor/v3/fibers-to-async-promises/package.json deleted file mode 100644 index 16eb6d5f..00000000 --- a/codemods/meteor/v3/fibers-to-async-promises/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "meteor-1-replace-fibers-with-promises", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "manishjha-04" -} diff --git a/codemods/meteor/v3/fibers-to-async-promises/tsconfig.json b/codemods/meteor/v3/fibers-to-async-promises/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/meteor/v3/fibers-to-async-promises/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/meteor/v3/meteor-renamed functions/package.json b/codemods/meteor/v3/meteor-renamed functions/package.json deleted file mode 100644 index 59b6f9a4..00000000 --- a/codemods/meteor/v3/meteor-renamed functions/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "synchronous-to-asynchronous-method-transform", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "manishjha-04" -} diff --git a/codemods/meteor/v3/meteor-renamed functions/tsconfig.json b/codemods/meteor/v3/meteor-renamed functions/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/meteor/v3/meteor-renamed functions/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/meteor/v3/mongoDb-async-methods/package.json b/codemods/meteor/v3/mongoDb-async-methods/package.json deleted file mode 100644 index 1a77e7e8..00000000 --- a/codemods/meteor/v3/mongoDb-async-methods/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "async-fetch-and-findone-transformation", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "manishjha-04" -} diff --git a/codemods/meteor/v3/mongoDb-async-methods/tsconfig.json b/codemods/meteor/v3/mongoDb-async-methods/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/meteor/v3/mongoDb-async-methods/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/meteor/v3/removedFunctions/package.json b/codemods/meteor/v3/removedFunctions/package.json deleted file mode 100644 index 75f653b8..00000000 --- a/codemods/meteor/v3/removedFunctions/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "meteor-1-async-await-transformation", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "manishjha-04" -} diff --git a/codemods/meteor/v3/removedFunctions/tsconfig.json b/codemods/meteor/v3/removedFunctions/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/meteor/v3/removedFunctions/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/meteor/v3/webapp-handler-renaming/package.json b/codemods/meteor/v3/webapp-handler-renaming/package.json deleted file mode 100644 index 0e7eace1..00000000 --- a/codemods/meteor/v3/webapp-handler-renaming/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "meteor-3-api-rename-express-migration", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "manishjha-04" -} diff --git a/codemods/meteor/v3/webapp-handler-renaming/tsconfig.json b/codemods/meteor/v3/webapp-handler-renaming/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/meteor/v3/webapp-handler-renaming/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/mocha/vitest/migrate-configuration/package.json b/codemods/mocha/vitest/migrate-configuration/package.json deleted file mode 100644 index 201d3c63..00000000 --- a/codemods/mocha/vitest/migrate-configuration/package.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "name": "@codemod-com/codemod-mocha-vitest-migrate-configuration", - "dependencies": { - "valibot": "catalog:" - }, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "@codemod-com/filemod": "workspace:*", - "@types/jscodeshift": "^0.11.10", - "jscodeshift": "^0.15.1", - "memfs": "^4.6.0", - "ts-node": "^10.9.1", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/mocha/vitest/migrate-tests/package.json b/codemods/mocha/vitest/migrate-tests/package.json deleted file mode 100644 index c3e8308b..00000000 --- a/codemods/mocha/vitest/migrate-tests/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-mocha-vitest-migrate-tests", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/msw/2/callback-signature/package.json b/codemods/msw/2/callback-signature/package.json deleted file mode 100644 index a6417b5c..00000000 --- a/codemods/msw/2/callback-signature/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@codemod-com/codemod-msw-2-callback-signature", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "ts-morph": "^19.0.0", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/msw/2/ctx-fetch/package.json b/codemods/msw/2/ctx-fetch/package.json deleted file mode 100644 index 88211738..00000000 --- a/codemods/msw/2/ctx-fetch/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@codemod-com/codemod-msw-2-ctx-fetch", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "ts-morph": "^19.0.0", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/msw/2/imports/package.json b/codemods/msw/2/imports/package.json deleted file mode 100644 index e1f4e98f..00000000 --- a/codemods/msw/2/imports/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-msw-2-imports", - "dependencies": {}, - "devDependencies": { - "@codemod.com/codemod-utils": "^1.0.0", - "typescript": "^5.7.2", - "ts-node": "^10.9.1", - "ts-morph": "^24.0.0", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1", - "@codemod.com/tsconfig": "workspace:*" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/msw/2/imports/tsconfig.json b/codemods/msw/2/imports/tsconfig.json deleted file mode 100644 index ad677cb2..00000000 --- a/codemods/msw/2/imports/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "@codemod.com/tsconfig/codemod.json", - "compilerOptions": { - "baseUrl": ".", - "outDir": "./dist" - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/msw/2/lifecycle-events-signature/package.json b/codemods/msw/2/lifecycle-events-signature/package.json deleted file mode 100644 index 37209485..00000000 --- a/codemods/msw/2/lifecycle-events-signature/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@codemod-com/codemod-msw-2-lifecycle-events-signature", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "ts-morph": "^19.0.0", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/msw/2/print-handler/package.json b/codemods/msw/2/print-handler/package.json deleted file mode 100644 index 5e93ce19..00000000 --- a/codemods/msw/2/print-handler/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@codemod-com/codemod-msw-2-print-handler", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "ts-morph": "^19.0.0", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/msw/2/req-passthrough/package.json b/codemods/msw/2/req-passthrough/package.json deleted file mode 100644 index 0c19b0a6..00000000 --- a/codemods/msw/2/req-passthrough/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@codemod-com/codemod-msw-2-req-passthrough", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "ts-morph": "^19.0.0", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/msw/2/request-changes/package.json b/codemods/msw/2/request-changes/package.json deleted file mode 100644 index f8ad0918..00000000 --- a/codemods/msw/2/request-changes/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@codemod-com/codemod-msw-2-request-changes", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "ts-morph": "^19.0.0", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/msw/2/response-usages/package.json b/codemods/msw/2/response-usages/package.json deleted file mode 100644 index e625f1d8..00000000 --- a/codemods/msw/2/response-usages/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "@codemod-com/codemod-msw-2-response-usages", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "ts-morph": "^19.0.0", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/msw/2/type-args/package.json b/codemods/msw/2/type-args/package.json deleted file mode 100644 index c8d4d8c6..00000000 --- a/codemods/msw/2/type-args/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@codemod-com/codemod-msw-2-type-args", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "ts-morph": "^19.0.0", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/mui/5/core-styles-import/package.json b/codemods/mui/5/core-styles-import/package.json deleted file mode 100644 index bf807335..00000000 --- a/codemods/mui/5/core-styles-import/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-mui-5-adapter-v4", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/mui/5/core-styles-import/test/test.ts b/codemods/mui/5/core-styles-import/test/test.ts deleted file mode 100644 index 2035462e..00000000 --- a/codemods/mui/5/core-styles-import/test/test.ts +++ /dev/null @@ -1,32 +0,0 @@ -import assert from "node:assert"; -import { buildApi } from "@codemod-com/utilities"; -import type { FileInfo } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -describe("mui/5/core-styles-import", () => { - it("basic test", () => { - const INPUT = ` - import { darken, lighten } from '@material-ui/core/styles/colorManipulator'; - import { Overrides } from '@material-ui/core/styles/overrides'; - import makeStyles from '@material-ui/core/styles/makeStyles'; - import { createTheme } from '@material-ui/core/styles'; - `; - - const OUTPUT = ` - import { createTheme, darken, lighten, Overrides, makeStyles } from '@material-ui/core/styles'; - `; - - const fileInfo: FileInfo = { - path: "index.ts", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx"), {}); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); -}); diff --git a/codemods/netlify-sdk/0.8.1/addBuildEventContext/package.json b/codemods/netlify-sdk/0.8.1/addBuildEventContext/package.json deleted file mode 100644 index d2900ad5..00000000 --- a/codemods/netlify-sdk/0.8.1/addBuildEventContext/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-netlify-sdk-0.8.1-addbuildeventcontext", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/netlify-sdk/0.8.1/addBuildEventHandler/package.json b/codemods/netlify-sdk/0.8.1/addBuildEventHandler/package.json deleted file mode 100644 index 115601ef..00000000 --- a/codemods/netlify-sdk/0.8.1/addBuildEventHandler/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-netlify-sdk-0.8.1-addbuildeventhandler", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/netlify-sdk/0.8.1/disableBuildEventHandlers/package.json b/codemods/netlify-sdk/0.8.1/disableBuildEventHandlers/package.json deleted file mode 100644 index 0ece2c1b..00000000 --- a/codemods/netlify-sdk/0.8.1/disableBuildEventHandlers/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-netlify-sdk-0.8.1-disablebuildeventhandlers", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/netlify-sdk/0.8.1/enableBuildEventHandlers/package.json b/codemods/netlify-sdk/0.8.1/enableBuildEventHandlers/package.json deleted file mode 100644 index 893a1897..00000000 --- a/codemods/netlify-sdk/0.8.1/enableBuildEventHandlers/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-netlify-sdk-0.8.1-enablebuildeventhandlers", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/netlify-sdk/0.8.1/exportZod/package.json b/codemods/netlify-sdk/0.8.1/exportZod/package.json deleted file mode 100644 index 1c54fdab..00000000 --- a/codemods/netlify-sdk/0.8.1/exportZod/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-netlify-sdk-0.8.1-exportzod", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/netlify-sdk/0.8.4/addApiHandler/package.json b/codemods/netlify-sdk/0.8.4/addApiHandler/package.json deleted file mode 100644 index 9f1de7e7..00000000 --- a/codemods/netlify-sdk/0.8.4/addApiHandler/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-netlify-sdk-0.8.4-addapihandler", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/netlify-sdk/0.8.5/createEnvironmentVariable/package.json b/codemods/netlify-sdk/0.8.5/createEnvironmentVariable/package.json deleted file mode 100644 index cd7bec50..00000000 --- a/codemods/netlify-sdk/0.8.5/createEnvironmentVariable/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-netlify-sdk-0.8.5-createenvironmentvariable", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/netlify-sdk/0.8.5/createOrUpdateVariable/package.json b/codemods/netlify-sdk/0.8.5/createOrUpdateVariable/package.json deleted file mode 100644 index c72eb2d7..00000000 --- a/codemods/netlify-sdk/0.8.5/createOrUpdateVariable/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-netlify-sdk-0.8.5-createorupdatevariable", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/netlify-sdk/0.8.5/createOrUpdateVariables/package.json b/codemods/netlify-sdk/0.8.5/createOrUpdateVariables/package.json deleted file mode 100644 index 688b00de..00000000 --- a/codemods/netlify-sdk/0.8.5/createOrUpdateVariables/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-netlify-sdk-0.8.5-createorupdatevariables", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/netlify-sdk/0.8.5/deleteEnvironmentVariable/package.json b/codemods/netlify-sdk/0.8.5/deleteEnvironmentVariable/package.json deleted file mode 100644 index 1c7d2037..00000000 --- a/codemods/netlify-sdk/0.8.5/deleteEnvironmentVariable/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "@codemod-com/codemod-netlify-sdk-0.8.5-deleteenvironmentvariable", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/netlify-sdk/0.8.5/deleteEnvironmentVariables/package.json b/codemods/netlify-sdk/0.8.5/deleteEnvironmentVariables/package.json deleted file mode 100644 index c26f005f..00000000 --- a/codemods/netlify-sdk/0.8.5/deleteEnvironmentVariables/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-netlify-sdk-0.8.5-deleteenvironmentvariables", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/netlify-sdk/0.8.5/getEnvironmentVariables/package.json b/codemods/netlify-sdk/0.8.5/getEnvironmentVariables/package.json deleted file mode 100644 index 7540992f..00000000 --- a/codemods/netlify-sdk/0.8.5/getEnvironmentVariables/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-netlify-sdk-0.8.5-getenvironmentvariables", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/netlify-sdk/0.8.5/patchEnvironmentVariable/package.json b/codemods/netlify-sdk/0.8.5/patchEnvironmentVariable/package.json deleted file mode 100644 index 7f6cd103..00000000 --- a/codemods/netlify-sdk/0.8.5/patchEnvironmentVariable/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-netlify-sdk-0.8.5-patchenvironmentvariable", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/netlify-sdk/0.8.5/updateEnvironmentVariable/package.json b/codemods/netlify-sdk/0.8.5/updateEnvironmentVariable/package.json deleted file mode 100644 index 7183e8c9..00000000 --- a/codemods/netlify-sdk/0.8.5/updateEnvironmentVariable/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-netlify-sdk-0.8.5-updateenvironmentvariable", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/netlify/add-zod-validation/package.json b/codemods/netlify/add-zod-validation/package.json deleted file mode 100644 index e3f3474d..00000000 --- a/codemods/netlify/add-zod-validation/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "add-zod-validation", - "license": "MIT", - "private": true, - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/workflow": "workspace:*" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "arybitskiy" -} diff --git a/codemods/netlify/add-zod-validation/tsconfig.json b/codemods/netlify/add-zod-validation/tsconfig.json deleted file mode 100644 index 329a7d63..00000000 --- a/codemods/netlify/add-zod-validation/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "@codemod-com/tsconfig/codemod.json", - "compilerOptions": { - "baseUrl": ".", - "outDir": "./dist" - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/netlify/replace-feature-flag/package.json b/codemods/netlify/replace-feature-flag/package.json deleted file mode 100644 index 70aa7354..00000000 --- a/codemods/netlify/replace-feature-flag/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "netlify/replace-feature-flag", - "author": "dmytrohryshyn", - "private": true, - "dependencies": {}, - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "5.2.2", - "vitest": "^1.0.1", - "ts-morph": "^22.0.0" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "license": "MIT", - "files": [ - "README.md", - ".codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/netlify/replace-feature-flag/tsconfig.json b/codemods/netlify/replace-feature-flag/tsconfig.json deleted file mode 100644 index 329a7d63..00000000 --- a/codemods/netlify/replace-feature-flag/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "@codemod-com/tsconfig/codemod.json", - "compilerOptions": { - "baseUrl": ".", - "outDir": "./dist" - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/next-i18next/copy-keys/package.json b/codemods/next-i18next/copy-keys/package.json deleted file mode 100644 index 4f97b60f..00000000 --- a/codemods/next-i18next/copy-keys/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "@codemod-com/codemod-next-i18next-copy-keys", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "@codemod-com/filemod": "workspace:*", - "memfs": "^4.6.0", - "ts-morph": "^19.0.0", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/next/13/ab-test/package.json b/codemods/next/13/ab-test/package.json deleted file mode 100644 index 0b0f5c60..00000000 --- a/codemods/next/13/ab-test/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "@codemod-com/codemod-next-13-ab-test", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "@codemod-com/filemod": "workspace:*", - "memfs": "^4.6.0", - "ts-morph": "^19.0.0", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/next/13/app-directory-boilerplate/package.json b/codemods/next/13/app-directory-boilerplate/package.json deleted file mode 100644 index f0727029..00000000 --- a/codemods/next/13/app-directory-boilerplate/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "@codemod-com/codemod-next-13-app-directory-boilerplate", - "dependencies": { - "mdast-util-from-markdown": "catalog:", - "mdast-util-to-markdown": "catalog:", - "micromark-extension-mdxjs": "catalog:", - "mdast-util-mdx": "catalog:", - "unist-util-visit": "catalog:" - }, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "@codemod-com/filemod": "workspace:*", - "memfs": "^4.6.0", - "ts-morph": "^19.0.0", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run test.ts", - "test:win": "vitest run test.win.ts", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/next/13/built-in-next-font/package.json b/codemods/next/13/built-in-next-font/package.json deleted file mode 100644 index 38d57797..00000000 --- a/codemods/next/13/built-in-next-font/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-next-13-built-in-next-font", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/next/13/comment-deletable-files/package.json b/codemods/next/13/comment-deletable-files/package.json deleted file mode 100644 index 87ecfa23..00000000 --- a/codemods/next/13/comment-deletable-files/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-next-13-comment-deletable-files", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/next/13/move-css-in-js-styles/package.json b/codemods/next/13/move-css-in-js-styles/package.json deleted file mode 100644 index f0bfae6e..00000000 --- a/codemods/next/13/move-css-in-js-styles/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "@codemod-com/codemod-next-13-move-css-in-js-styles", - "dependencies": { - "sinon": "catalog:" - }, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/next/13/new-image-experimental/package.json b/codemods/next/13/new-image-experimental/package.json deleted file mode 100644 index ffb0da18..00000000 --- a/codemods/next/13/new-image-experimental/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-next-13-new-image-experimental", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/next/13/new-link/package.json b/codemods/next/13/new-link/package.json deleted file mode 100644 index 7c902d07..00000000 --- a/codemods/next/13/new-link/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-next-13-new-link", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/next/13/next-image-to-legacy-image/package.json b/codemods/next/13/next-image-to-legacy-image/package.json deleted file mode 100644 index d0367a38..00000000 --- a/codemods/next/13/next-image-to-legacy-image/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-next-13-next-image-to-legacy-image", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/next/13/remove-get-static-props/package.json b/codemods/next/13/remove-get-static-props/package.json deleted file mode 100644 index c54f294c..00000000 --- a/codemods/next/13/remove-get-static-props/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "@codemod-com/codemod-next-13-remove-get-static-props", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "@codemod-com/filemod": "workspace:*", - "memfs": "^4.6.0", - "ts-morph": "^19.0.0", - "jscodeshift": "0.14.0", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/next/13/remove-next-export/package.json b/codemods/next/13/remove-next-export/package.json deleted file mode 100644 index bdc1c0d3..00000000 --- a/codemods/next/13/remove-next-export/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "@codemod-com/codemod-next-13-remove-next-export", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "@codemod-com/filemod": "workspace:*", - "memfs": "^4.6.0", - "ts-morph": "^19.0.0", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/next/13/replace-api-routes/package.json b/codemods/next/13/replace-api-routes/package.json deleted file mode 100644 index a8ef9da9..00000000 --- a/codemods/next/13/replace-api-routes/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "@codemod-com/codemod-next-13-replace-api-routes", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "@codemod-com/filemod": "workspace:*", - "memfs": "^4.6.0", - "ts-morph": "^19.0.0", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/next/13/replace-next-head/package.json b/codemods/next/13/replace-next-head/package.json deleted file mode 100644 index 4232a8b4..00000000 --- a/codemods/next/13/replace-next-head/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "@codemod-com/codemod-next-13-replace-next-head", - "dependencies": { - "mdast-util-from-markdown": "catalog:", - "mdast-util-to-markdown": "catalog:", - "micromark-extension-mdxjs": "catalog:", - "mdast-util-mdx": "catalog:", - "unist-util-visit": "catalog:", - "unist-util-filter": "catalog:" - }, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "@codemod-com/filemod": "workspace:*", - "memfs": "^4.6.0", - "ts-morph": "^19.0.0", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/next/13/replace-next-router/package.json b/codemods/next/13/replace-next-router/package.json deleted file mode 100644 index 121e56c5..00000000 --- a/codemods/next/13/replace-next-router/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "@codemod-com/codemod-next-13-replace-next-router", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "ts-morph": "^19.0.0", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/next/13/replace-use-search-params/package.json b/codemods/next/13/replace-use-search-params/package.json deleted file mode 100644 index e33045d5..00000000 --- a/codemods/next/13/replace-use-search-params/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "@codemod-com/codemod-next-13-replace-use-search-params", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "@codemod-com/filemod": "workspace:*", - "memfs": "^4.6.0", - "ts-morph": "^19.0.0", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/next/13/upsert-use-client-directive/package.json b/codemods/next/13/upsert-use-client-directive/package.json deleted file mode 100644 index 6e804f44..00000000 --- a/codemods/next/13/upsert-use-client-directive/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "@codemod-com/codemod-next-13-upsert-use-client-directive", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "ts-morph": "^19.0.0", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/next/14/metadata-to-viewport-export/package.json b/codemods/next/14/metadata-to-viewport-export/package.json deleted file mode 100644 index faeba17e..00000000 --- a/codemods/next/14/metadata-to-viewport-export/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-next-14-metadata-to-viewport-export", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/next/14/next-og-import/package.json b/codemods/next/14/next-og-import/package.json deleted file mode 100644 index e26aceb0..00000000 --- a/codemods/next/14/next-og-import/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-next-14-next-og-import", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/nextAuth/useSession-array-to-Object-destrucutring/package.json b/codemods/nextAuth/useSession-array-to-Object-destrucutring/package.json deleted file mode 100644 index 48b28a22..00000000 --- a/codemods/nextAuth/useSession-array-to-Object-destrucutring/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "nextjs-use-session-array-to-object-destructuring", - "license": "MIT", - "private": true, - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "manishjha-04" -} diff --git a/codemods/nextAuth/useSession-array-to-Object-destrucutring/test/test.ts b/codemods/nextAuth/useSession-array-to-Object-destrucutring/test/test.ts deleted file mode 100644 index 405dcaf2..00000000 --- a/codemods/nextAuth/useSession-array-to-Object-destrucutring/test/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -import assert from "node:assert"; -import { readFile } from "node:fs/promises"; -import { join } from "node:path"; -import jscodeshift, { type API } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -const buildApi = (parser: string | undefined): API => ({ - j: parser ? jscodeshift.withParser(parser) : jscodeshift, - jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, - stats: () => { - console.error( - "The stats function was called, which is not supported on purpose", - ); - }, - report: () => { - console.error( - "The report function was called, which is not supported on purpose", - ); - }, -}); - -describe("nextjs/use-session-array-to-object-destructuring", () => { - it("test #1", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/\s/gm, ""), - OUTPUT.replace(/\s/gm, ""), - ); - }); -}); diff --git a/codemods/nextAuth/useSession-array-to-Object-destrucutring/tsconfig.json b/codemods/nextAuth/useSession-array-to-Object-destrucutring/tsconfig.json deleted file mode 100644 index 0947cb85..00000000 --- a/codemods/nextAuth/useSession-array-to-Object-destrucutring/tsconfig.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/npm/esm-first-in-exports/package.json b/codemods/npm/esm-first-in-exports/package.json deleted file mode 100644 index 9fc9b600..00000000 --- a/codemods/npm/esm-first-in-exports/package.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "name": "@codemod/npm-esm-first-in-exports", - "license": "MIT", - "private": true, - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/workflow": "workspace:*" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "arybitskiy" -} diff --git a/codemods/npm/esm-first-in-exports/tsconfig.json b/codemods/npm/esm-first-in-exports/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/npm/esm-first-in-exports/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/nuxt/4/absolute-watch-path/package.json b/codemods/nuxt/4/absolute-watch-path/package.json deleted file mode 100644 index 113485dd..00000000 --- a/codemods/nuxt/4/absolute-watch-path/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/nuxt-4-absolute-watch-path", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/nuxt/4/absolute-watch-path/tsconfig.json b/codemods/nuxt/4/absolute-watch-path/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/nuxt/4/absolute-watch-path/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/nuxt/4/default-data-error-value/package.json b/codemods/nuxt/4/default-data-error-value/package.json deleted file mode 100644 index b00c5c75..00000000 --- a/codemods/nuxt/4/default-data-error-value/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/nuxt-4-default-data-error-value", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/nuxt/4/default-data-error-value/tsconfig.json b/codemods/nuxt/4/default-data-error-value/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/nuxt/4/default-data-error-value/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/nuxt/4/deprecated-dedupe-value/package.json b/codemods/nuxt/4/deprecated-dedupe-value/package.json deleted file mode 100644 index 397b612d..00000000 --- a/codemods/nuxt/4/deprecated-dedupe-value/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/nuxt-4-deprecated-dedupe-value", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/nuxt/4/deprecated-dedupe-value/tsconfig.json b/codemods/nuxt/4/deprecated-dedupe-value/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/nuxt/4/deprecated-dedupe-value/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/nuxt/4/file-structure/package.json b/codemods/nuxt/4/file-structure/package.json deleted file mode 100644 index 14bff8c9..00000000 --- a/codemods/nuxt/4/file-structure/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "@codemod/nuxt-4-file-structure", - "private": true, - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/workflow": "workspace:*" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/nuxt/4/file-structure/tsconfig.json b/codemods/nuxt/4/file-structure/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/nuxt/4/file-structure/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/nuxt/4/shallow-function-reactivity/package.json b/codemods/nuxt/4/shallow-function-reactivity/package.json deleted file mode 100644 index 31317165..00000000 --- a/codemods/nuxt/4/shallow-function-reactivity/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/nuxt-4-shallow-data-reactivity", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/nuxt/4/shallow-function-reactivity/tsconfig.json b/codemods/nuxt/4/shallow-function-reactivity/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/nuxt/4/shallow-function-reactivity/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/nuxt/4/template-compilation-changes/package.json b/codemods/nuxt/4/template-compilation-changes/package.json deleted file mode 100644 index b4f5c6ac..00000000 --- a/codemods/nuxt/4/template-compilation-changes/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/nuxt-4-template-compilation-changes", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/nuxt/4/template-compilation-changes/tsconfig.json b/codemods/nuxt/4/template-compilation-changes/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/nuxt/4/template-compilation-changes/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/openFeature/replace-feature-flags/package.json b/codemods/openFeature/replace-feature-flags/package.json deleted file mode 100644 index 8ac7eaa7..00000000 --- a/codemods/openFeature/replace-feature-flags/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "openFeature/replace-feature-flag", - "author": "dmytrohryshyn", - "private": true, - "dependencies": {}, - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "5.2.2", - "vitest": "^1.0.1", - "ts-morph": "^22.0.0" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "license": "MIT", - "files": [ - "README.md", - ".codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/openFeature/replace-feature-flags/tsconfig.json b/codemods/openFeature/replace-feature-flags/tsconfig.json deleted file mode 100644 index 329a7d63..00000000 --- a/codemods/openFeature/replace-feature-flags/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "@codemod-com/tsconfig/codemod.json", - "compilerOptions": { - "baseUrl": ".", - "outDir": "./dist" - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/pnpm/catalog/package.json b/codemods/pnpm/catalog/package.json deleted file mode 100644 index 79bb51b6..00000000 --- a/codemods/pnpm/catalog/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "@codemod.com/pnpm-catalog", - "license": "MIT", - "private": true, - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/workflow": "workspace:*", - "semver": "^7.6.2", - "@types/semver": "^7.5.8" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/pnpm/catalog/tsconfig.json b/codemods/pnpm/catalog/tsconfig.json deleted file mode 100644 index 329a7d63..00000000 --- a/codemods/pnpm/catalog/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "@codemod-com/tsconfig/codemod.json", - "compilerOptions": { - "baseUrl": ".", - "outDir": "./dist" - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/prisma/5/json-protocol/package.json b/codemods/prisma/5/json-protocol/package.json deleted file mode 100644 index 09e49e8e..00000000 --- a/codemods/prisma/5/json-protocol/package.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "name": "@codemod-com/codemod-prisma-json-protocol", - "devDependencies": { - "@codemod-com/filemod": "workspace:*", - "@codemod-com/utilities": "workspace:*", - "@loancrate/prisma-schema-parser": "^2.0.0", - "@types/jscodeshift": "^0.11.10", - "@vitest/coverage-v8": "catalog:", - "jscodeshift": "^0.15.1", - "memfs": "^4.6.0", - "ts-node": "^10.9.1", - "typescript": "^5.2.2", - "valibot": "catalog:", - "vitest": "^1.0.1" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module", - "dependencies": { - "@mrleebo/prisma-ast": "^0.12.0" - } -} diff --git a/codemods/react-native/74/migrate-to-fire-interval-seconds/package.json b/codemods/react-native/74/migrate-to-fire-interval-seconds/package.json deleted file mode 100644 index 2ac154c2..00000000 --- a/codemods/react-native/74/migrate-to-fire-interval-seconds/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-native-74-migrate-to-fire-interval-seconds", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-native/74/remove-alert-action/package.json b/codemods/react-native/74/remove-alert-action/package.json deleted file mode 100644 index da671615..00000000 --- a/codemods/react-native/74/remove-alert-action/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-native-74-remove-alert-action", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-native/74/remove-event-listener-callback/package.json b/codemods/react-native/74/remove-event-listener-callback/package.json deleted file mode 100644 index 79df5fc2..00000000 --- a/codemods/react-native/74/remove-event-listener-callback/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-native-74-remove-event-listener-callback", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-redux/0/add-state-type/package.json b/codemods/react-redux/0/add-state-type/package.json deleted file mode 100644 index ddb2c353..00000000 --- a/codemods/react-redux/0/add-state-type/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-redux-0-add-state-type", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-redux/0/add-state-type/test/test.ts b/codemods/react-redux/0/add-state-type/test/test.ts deleted file mode 100644 index 191cb82c..00000000 --- a/codemods/react-redux/0/add-state-type/test/test.ts +++ /dev/null @@ -1,343 +0,0 @@ -import assert from "node:assert"; -import { buildApi } from "@codemod-com/utilities"; -import type { FileInfo } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -describe("react-redux-8 add-state-type", () => { - it("should add the State type for state parameter of the mapStateToProps arrow function", () => { - const INPUT = ` - const mapStateToProps = (state) => ({ - a: selectA(state), - }); - `; - - const OUTPUT = ` - import { State } from "state"; - - const mapStateToProps = (state: State) => ({ - a: selectA(state), - }); - `; - - const fileInfo: FileInfo = { - path: "index.js", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx"), {}); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); - - it("should add the State type for state destructured parameter of the mapStateToProps arrow function", () => { - const INPUT = ` - const mapStateToProps = ({ a }) => ({ - a, - }); - `; - - const OUTPUT = ` - import { State } from "state"; - - const mapStateToProps = ({ a }: State) => ({ - a, - }); - `; - - const fileInfo: FileInfo = { - path: "index.js", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx"), {}); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); - - it("should add the State type for state parameter of the mapStateToProps function", () => { - const INPUT = ` - function mapStateToProps (a) { - return { - a - } - } - `; - - const OUTPUT = ` - import { State } from "state"; - - function mapStateToProps (a: State) { - return { - a - } - } - `; - - const fileInfo: FileInfo = { - path: "index.js", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx"), {}); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); - - it("should add the State type for state destructured parameter of the mapStateToProps function", () => { - const INPUT = ` - function mapStateToProps ({ a }) { - return { - a - } - } - `; - - const OUTPUT = ` - import { State } from "state"; - - function mapStateToProps ({ a }: State) { - return { - a - } - } - `; - - const fileInfo: FileInfo = { - path: "index.js", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx"), {}); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); - - it("should add the State type for state parameter of the mapDispatchToProps arrow function", () => { - const INPUT = ` - const mapDispatchToProps = (dispatch) => ({ - onA: (a) => dispatch(a), - }); - `; - - const OUTPUT = ` - import { ThunkDispatch } from "redux-thunk"; - import { State } from "state"; - - const mapDispatchToProps = (dispatch: ThunkDispatch) => ({ - onA: (a) => dispatch(a), - }); - `; - - const fileInfo: FileInfo = { - path: "index.js", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx"), {}); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); - - it("should add the State type for state parameter of the mapDispatchToProps arrow function", () => { - const INPUT = ` - function mapDispatchToProps (dispatch) { - return { - onA: (a) => dispatch(a), - } - }; - `; - - const OUTPUT = ` - import { ThunkDispatch } from "redux-thunk"; - import { State } from "state"; - - function mapDispatchToProps (dispatch: ThunkDispatch) { - return { - onA: (a) => dispatch(a), - } - }; - `; - - const fileInfo: FileInfo = { - path: "index.js", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx"), {}); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); - - it("should add the State type for state parameter of the mapStateToProps and the mapDispatchToProps arrow function", () => { - const INPUT = ` - function mapStateToProps (state) { - return { - ...state - } - } - - function mapDispatchToProps (dispatch) { - return { - onA: (a) => dispatch(a), - } - }; - `; - - const OUTPUT = ` - import { ThunkDispatch } from "redux-thunk"; - import { State } from "state"; - - function mapStateToProps (state: State) { - return { - ...state - } - } - - function mapDispatchToProps (dispatch: ThunkDispatch) { - return { - onA: (a) => dispatch(a), - } - }; - `; - - const fileInfo: FileInfo = { - path: "index.js", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx"), {}); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); - - it("should add the State type for state parameter of the mapStateToProps and the mapDispatchToProps function", () => { - const INPUT = ` - const mapStateToProps = (state) => { - return { - ...state - } - } - - const mapDispatchToProps = (dispatch) => { - return { - onA: (a) => dispatch(a), - } - }; - `; - - const OUTPUT = ` - import { ThunkDispatch } from "redux-thunk"; - import { State } from "state"; - - const mapStateToProps = (state: State) => { - return { - ...state - } - } - - const mapDispatchToProps = (dispatch: ThunkDispatch) => { - return { - onA: (a) => dispatch(a), - } - }; - `; - - const fileInfo: FileInfo = { - path: "index.js", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx"), {}); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); - - it("should add the State type for state parameter of the select function", () => { - const INPUT = ` - function selectX (state) { - return { - ...state - } - } - `; - - const OUTPUT = ` - import { State } from "state"; - - function selectX (state: State) { - return { - ...state - } - } - `; - - const fileInfo: FileInfo = { - path: "index.js", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx"), {}); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); - - it("should add the State type for state parameter of the select function", () => { - const INPUT = ` - const selectX = (state) => { - return { - ...state - } - } - `; - - const OUTPUT = ` - import { State } from "state"; - - const selectX = (state: State) => { - return { - ...state - } - } - `; - - const fileInfo: FileInfo = { - path: "index.js", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx"), {}); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); -}); diff --git a/codemods/react-router/4/add-exact-prop/package.json b/codemods/react-router/4/add-exact-prop/package.json deleted file mode 100644 index 05e42806..00000000 --- a/codemods/react-router/4/add-exact-prop/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-4-add-exact-prop", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/4/browser-router/package.json b/codemods/react-router/4/browser-router/package.json deleted file mode 100644 index b9bfff68..00000000 --- a/codemods/react-router/4/browser-router/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-4-browser-router", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/4/create-hash-history/package.json b/codemods/react-router/4/create-hash-history/package.json deleted file mode 100644 index c65c59b5..00000000 --- a/codemods/react-router/4/create-hash-history/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-4-create-hash-history", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/4/hash-router/package.json b/codemods/react-router/4/hash-router/package.json deleted file mode 100644 index 666d4e0f..00000000 --- a/codemods/react-router/4/hash-router/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-4-hash-router", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/4/index-route/package.json b/codemods/react-router/4/index-route/package.json deleted file mode 100644 index fdb543a6..00000000 --- a/codemods/react-router/4/index-route/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-4-index-route", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/4/move-HOC-to-global-scope/tsconfig.json b/codemods/react-router/4/move-HOC-to-global-scope/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/react-router/4/move-HOC-to-global-scope/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/react-router/4/remove-with-props/package.json b/codemods/react-router/4/remove-with-props/package.json deleted file mode 100644 index 79fc65f5..00000000 --- a/codemods/react-router/4/remove-with-props/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-4-remove-with-props", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/4/rename-imports/package.json b/codemods/react-router/4/rename-imports/package.json deleted file mode 100644 index 5815515d..00000000 --- a/codemods/react-router/4/rename-imports/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-4-rename-imports", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/4/replace-location-query/package.json b/codemods/react-router/4/replace-location-query/package.json deleted file mode 100644 index f6937e27..00000000 --- a/codemods/react-router/4/replace-location-query/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-4-replace-location-query", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/4/replace-nested-routes/package.json b/codemods/react-router/4/replace-nested-routes/package.json deleted file mode 100644 index f478fd90..00000000 --- a/codemods/react-router/4/replace-nested-routes/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-4-replace-nested-routes", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/4/replace-param-prop/package.json b/codemods/react-router/4/replace-param-prop/package.json deleted file mode 100644 index 50c624d8..00000000 --- a/codemods/react-router/4/replace-param-prop/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-4-replace-param-prop", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/4/use-history-hook/package.json b/codemods/react-router/4/use-history-hook/package.json deleted file mode 100644 index 78ce78fe..00000000 --- a/codemods/react-router/4/use-history-hook/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-4-use-history-hook", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "esbuild": "0.19.5", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "build:cjs": "cjs-builder ./src/index.ts", - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/4/wrap-with-switch/package.json b/codemods/react-router/4/wrap-with-switch/package.json deleted file mode 100644 index c9782d1a..00000000 --- a/codemods/react-router/4/wrap-with-switch/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-4-wrap-with-switch", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/6/compat-route/package.json b/codemods/react-router/6/compat-route/package.json deleted file mode 100644 index ae9c1c0b..00000000 --- a/codemods/react-router/6/compat-route/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-6-compat-route", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/6/compat-router/package.json b/codemods/react-router/6/compat-router/package.json deleted file mode 100644 index 152af2dc..00000000 --- a/codemods/react-router/6/compat-router/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-6-compat-router", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/6/link-to-props/package.json b/codemods/react-router/6/link-to-props/package.json deleted file mode 100644 index 9fec4e5e..00000000 --- a/codemods/react-router/6/link-to-props/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-6-link-to-props", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/6/match-path-arguments/package.json b/codemods/react-router/6/match-path-arguments/package.json deleted file mode 100644 index 1316361e..00000000 --- a/codemods/react-router/6/match-path-arguments/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-6-match-path-arguments", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/6/navlink-exact-end/package.json b/codemods/react-router/6/navlink-exact-end/package.json deleted file mode 100644 index 4b2c98a8..00000000 --- a/codemods/react-router/6/navlink-exact-end/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-6-navlink-exact-end", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/6/redirect-to-navigate/package.json b/codemods/react-router/6/redirect-to-navigate/package.json deleted file mode 100644 index 5dcaed84..00000000 --- a/codemods/react-router/6/redirect-to-navigate/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-6-redirect-to-navigate", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/6/remove-active-classname/package.json b/codemods/react-router/6/remove-active-classname/package.json deleted file mode 100644 index 4bf6cf56..00000000 --- a/codemods/react-router/6/remove-active-classname/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-6-remove-active-classname", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/6/remove-active-style/package.json b/codemods/react-router/6/remove-active-style/package.json deleted file mode 100644 index 0c822e01..00000000 --- a/codemods/react-router/6/remove-active-style/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-6-remove-active-style", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/6/remove-compat-router/package.json b/codemods/react-router/6/remove-compat-router/package.json deleted file mode 100644 index 095a2def..00000000 --- a/codemods/react-router/6/remove-compat-router/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-6-remove-compat-router", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/6/remove-go-hooks/package.json b/codemods/react-router/6/remove-go-hooks/package.json deleted file mode 100644 index 4af6e5c4..00000000 --- a/codemods/react-router/6/remove-go-hooks/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-6-remove-go-hooks", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/6/remove-redirect-inside-switch/package.json b/codemods/react-router/6/remove-redirect-inside-switch/package.json deleted file mode 100644 index bd735766..00000000 --- a/codemods/react-router/6/remove-redirect-inside-switch/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-6-remove-redirect-inside-switch", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/6/rename-compat-imports/package.json b/codemods/react-router/6/rename-compat-imports/package.json deleted file mode 100644 index c72fa434..00000000 --- a/codemods/react-router/6/rename-compat-imports/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-6-rename-compat-imports", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/6/static-router-imports/package.json b/codemods/react-router/6/static-router-imports/package.json deleted file mode 100644 index 6dd29c22..00000000 --- a/codemods/react-router/6/static-router-imports/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-6-static-router-imports", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/6/use-location/package.json b/codemods/react-router/6/use-location/package.json deleted file mode 100644 index d22ca27a..00000000 --- a/codemods/react-router/6/use-location/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-6-use-location", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/6/use-navigate/package.json b/codemods/react-router/6/use-navigate/package.json deleted file mode 100644 index 48750afd..00000000 --- a/codemods/react-router/6/use-navigate/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-6-use-navigate", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/6/use-params/package.json b/codemods/react-router/6/use-params/package.json deleted file mode 100644 index 588277f3..00000000 --- a/codemods/react-router/6/use-params/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-6-use-params", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react-router/6/use-route-match/package.json b/codemods/react-router/6/use-route-match/package.json deleted file mode 100644 index b496dfcd..00000000 --- a/codemods/react-router/6/use-route-match/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-router-6-use-route-match", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react/19/remove-context-provider/package.json b/codemods/react/19/remove-context-provider/package.json deleted file mode 100644 index 919c2e27..00000000 --- a/codemods/react/19/remove-context-provider/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-19-remove-context-provider", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react/19/remove-forward-ref/package.json b/codemods/react/19/remove-forward-ref/package.json deleted file mode 100644 index 97b7d5c5..00000000 --- a/codemods/react/19/remove-forward-ref/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-remove-forward-ref", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "@codemod.com/codemod-utils": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react/19/remove-legacy-context/package.json b/codemods/react/19/remove-legacy-context/package.json deleted file mode 100644 index 97adaeb9..00000000 --- a/codemods/react/19/remove-legacy-context/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "remove-legacy-context", - "license": "MIT", - "private": true, - "devDependencies": { - "@codemod.com/codemod-utils": "workspace:*", - "@types/jscodeshift": "^0.11.10", - "@types/node": "20.9.0", - "jscodeshift": "^0.15.1", - "typescript": "^5.2.2", - "vitest": "^1.0.1" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "dmytrohryshyn" -} diff --git a/codemods/react/19/remove-legacy-context/src/index.ts b/codemods/react/19/remove-legacy-context/src/index.ts deleted file mode 100644 index 84b302d7..00000000 --- a/codemods/react/19/remove-legacy-context/src/index.ts +++ /dev/null @@ -1,79 +0,0 @@ -// BUILT WITH https://codemod.studio - -import type { API, FileInfo, JSCodeshift } from "jscodeshift"; -import { findPatterns } from "./analyze.js"; - -import { getClassMethod } from "@codemod.com/codemod-utils"; -// const FooContext = React.createContext(); -const buildContextVariableDeclaration = (j: JSCodeshift) => - j.variableDeclaration("const", [ - j.variableDeclarator( - j.identifier("Context"), - j.callExpression( - j.memberExpression( - j.identifier("React"), - j.identifier("createContext"), - ), - [], - ), - ), - ]); - -const buildContextProvider = (j: JSCodeshift, value: any, renderedJsx: any) => - j.jsxElement( - j.jsxOpeningElement(j.jsxIdentifier("Context"), [ - j.jsxAttribute(j.jsxIdentifier("value"), j.jsxExpressionContainer(value)), - ]), - j.jsxClosingElement(j.jsxIdentifier("Context")), - [renderedJsx], - ); - -export default function transform( - file: FileInfo, - api: API, -): string | undefined { - const j = api.jscodeshift; - const root = j(file.source); - - let isDirty = false; - - findPatterns(j, root)?.forEach((pattern) => { - if (!pattern) { - return; - } - isDirty = true; - - const { classComponent, getChildContext, childContextTypes } = pattern; - - const childContextValue = - j(getChildContext).find(j.ReturnStatement).paths().at(0)?.value - .argument ?? null; - - j(childContextTypes).remove(); - j(getChildContext).remove(); - - // add Context variable declaration - const variableDeclaration = buildContextVariableDeclaration(j); - classComponent.insertBefore(variableDeclaration); - - const render = getClassMethod(j, classComponent, "render"); - - const renderReturnStatement = render - ? j(render).find(j.ReturnStatement).paths().at(0) - : null; - - const renderedJsx = renderReturnStatement?.value.argument; - - if (!renderedJsx) { - return; - } - - renderReturnStatement.value.argument = buildContextProvider( - j, - childContextValue, - renderedJsx, - ); - }); - - return isDirty ? root.toSource() : undefined; -} diff --git a/codemods/react/19/remove-legacy-context/tsconfig.json b/codemods/react/19/remove-legacy-context/tsconfig.json deleted file mode 100644 index 329a7d63..00000000 --- a/codemods/react/19/remove-legacy-context/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "@codemod-com/tsconfig/codemod.json", - "compilerOptions": { - "baseUrl": ".", - "outDir": "./dist" - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/react/19/remove-memoization/package.json b/codemods/react/19/remove-memoization/package.json deleted file mode 100644 index e66f042b..00000000 --- a/codemods/react/19/remove-memoization/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-19-remove-memoization-hooks", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "@codemod.com/codemod-utils": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react/19/replace-act-import/package.json b/codemods/react/19/replace-act-import/package.json deleted file mode 100644 index 07381e7c..00000000 --- a/codemods/react/19/replace-act-import/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-replace-act-import", - "version": "1.0.0", - "private": true, - "dependencies": {}, - "devDependencies": { - "@types/node": "^20.12.3", - "@types/jscodeshift": "^0.11.10", - "jscodeshift": "^0.15.1", - "typescript": "^5.2.2", - "vitest": "^1.0.1" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react/19/replace-act-import/tsconfig.json b/codemods/react/19/replace-act-import/tsconfig.json deleted file mode 100644 index 329a7d63..00000000 --- a/codemods/react/19/replace-act-import/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "@codemod-com/tsconfig/codemod.json", - "compilerOptions": { - "baseUrl": ".", - "outDir": "./dist" - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/react/19/replace-create-factory/package.json b/codemods/react/19/replace-create-factory/package.json deleted file mode 100644 index eba345ab..00000000 --- a/codemods/react/19/replace-create-factory/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "react-19-replace-create-factory", - "license": "MIT", - "private": true, - "devDependencies": { - "@codemod.com/codemod-utils": "workspace:*", - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react/19/replace-create-factory/tsconfig.json b/codemods/react/19/replace-create-factory/tsconfig.json deleted file mode 100644 index 329a7d63..00000000 --- a/codemods/react/19/replace-create-factory/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "@codemod-com/tsconfig/codemod.json", - "compilerOptions": { - "baseUrl": ".", - "outDir": "./dist" - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/react/19/replace-default-props/package.json b/codemods/react/19/replace-default-props/package.json deleted file mode 100644 index 0c1983c4..00000000 --- a/codemods/react/19/replace-default-props/package.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "name": "react-19-replace-default-props", - "license": "MIT", - "private": true, - "devDependencies": { - "@codemod.com/codemod-utils": "^1.0.0", - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "@codemod.com/tsconfig": "workspace:*" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react/19/replace-default-props/tsconfig.json b/codemods/react/19/replace-default-props/tsconfig.json deleted file mode 100644 index ad677cb2..00000000 --- a/codemods/react/19/replace-default-props/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "@codemod.com/tsconfig/codemod.json", - "compilerOptions": { - "baseUrl": ".", - "outDir": "./dist" - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/react/19/replace-react-test-renderer-import/package.json b/codemods/react/19/replace-react-test-renderer-import/package.json deleted file mode 100644 index 9c7314d4..00000000 --- a/codemods/react/19/replace-react-test-renderer-import/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "react/19/replace-react-test-renderer-import", - "license": "MIT", - "private": true, - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "dmytrohryshyn" -} diff --git a/codemods/react/19/replace-react-test-renderer-import/tsconfig.json b/codemods/react/19/replace-react-test-renderer-import/tsconfig.json deleted file mode 100644 index 329a7d63..00000000 --- a/codemods/react/19/replace-react-test-renderer-import/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "@codemod-com/tsconfig/codemod.json", - "compilerOptions": { - "baseUrl": ".", - "outDir": "./dist" - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/react/19/replace-reactdom-render/package.json b/codemods/react/19/replace-reactdom-render/package.json deleted file mode 100644 index 53b0ef5f..00000000 --- a/codemods/react/19/replace-reactdom-render/package.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "name": "react/19/replace-reactdom-render", - "author": "dmytrohryshyn", - "private": true, - "dependencies": {}, - "devDependencies": { - "@codemod.com/codemod-utils": "workspace:*", - "@types/node": "20.9.0", - "typescript": "5.2.2", - "vitest": "^1.0.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "license": "MIT", - "files": [ - "README.md", - ".codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react/19/replace-reactdom-render/tsconfig.json b/codemods/react/19/replace-reactdom-render/tsconfig.json deleted file mode 100644 index 329a7d63..00000000 --- a/codemods/react/19/replace-reactdom-render/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "@codemod-com/tsconfig/codemod.json", - "compilerOptions": { - "baseUrl": ".", - "outDir": "./dist" - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/react/19/replace-string-ref/package.json b/codemods/react/19/replace-string-ref/package.json deleted file mode 100644 index eab45de1..00000000 --- a/codemods/react/19/replace-string-ref/package.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-19-replace-string-ref", - "author": "codemod", - "dependencies": {}, - "devDependencies": { - "@codemod.com/codemod-utils": "workspace:*", - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react/19/replace-string-ref/tsconfig.json b/codemods/react/19/replace-string-ref/tsconfig.json deleted file mode 100644 index 329a7d63..00000000 --- a/codemods/react/19/replace-string-ref/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "@codemod-com/tsconfig/codemod.json", - "compilerOptions": { - "baseUrl": ".", - "outDir": "./dist" - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/react/19/replace-use-form-state/package.json b/codemods/react/19/replace-use-form-state/package.json deleted file mode 100644 index e779a229..00000000 --- a/codemods/react/19/replace-use-form-state/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-replace-use-form-state", - "version": "1.0.7", - "private": true, - "dependencies": {}, - "devDependencies": { - "@types/node": "^20.12.3", - "@types/jscodeshift": "^0.11.10", - "jscodeshift": "^0.15.1", - "typescript": "^5.2.2", - "vitest": "^1.0.1" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react/19/replace-use-form-state/tsconfig.json b/codemods/react/19/replace-use-form-state/tsconfig.json deleted file mode 100644 index 329a7d63..00000000 --- a/codemods/react/19/replace-use-form-state/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "@codemod-com/tsconfig/codemod.json", - "compilerOptions": { - "baseUrl": ".", - "outDir": "./dist" - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/react/19/use-context-hook/package.json b/codemods/react/19/use-context-hook/package.json deleted file mode 100644 index 29a282e8..00000000 --- a/codemods/react/19/use-context-hook/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-19-use-context", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react/create-element-to-jsx/cdmd_dist/index.js b/codemods/react/create-element-to-jsx/cdmd_dist/index.js deleted file mode 100644 index a5b43df5..00000000 --- a/codemods/react/create-element-to-jsx/cdmd_dist/index.js +++ /dev/null @@ -1,251 +0,0 @@ -export default function transform(file, api, options) { - const j = api.jscodeshift; - const printOptions = options.printOptions || {}; - const root = j(file.source); - const ReactUtils = require("@react-codemods/utils")(j); - const encodeJSXTextValue = (value) => - value.replace(//g, ">"); - - const canLiteralBePropString = (node) => - node.raw.indexOf("\\") === -1 && node.value.indexOf('"') === -1; - - const convertExpressionToJSXAttributes = (expression) => { - if (!expression) { - return { - attributes: [], - extraComments: [], - }; - } - - const isReactSpread = - expression.type === "CallExpression" && - expression.callee.type === "MemberExpression" && - expression.callee.object.name === "React" && - expression.callee.property.name === "__spread"; - - const isObjectAssign = - expression.type === "CallExpression" && - expression.callee.type === "MemberExpression" && - expression.callee.object.name === "Object" && - expression.callee.property.name === "assign"; - - const validSpreadTypes = [ - "Identifier", - "MemberExpression", - "CallExpression", - ]; - - if (isReactSpread || isObjectAssign) { - const resultAttributes = []; - const resultExtraComments = expression.comments || []; - const { callee } = expression; - for (const node of [callee, callee.object, callee.property]) { - resultExtraComments.push(...(node.comments || [])); - } - expression.arguments.forEach((expression) => { - const { attributes, extraComments } = - convertExpressionToJSXAttributes(expression); - resultAttributes.push(...attributes); - resultExtraComments.push(...extraComments); - }); - - return { - attributes: resultAttributes, - extraComments: resultExtraComments, - }; - } else if (validSpreadTypes.indexOf(expression.type) != -1) { - return { - attributes: [j.jsxSpreadAttribute(expression)], - extraComments: [], - }; - } else if (expression.type === "ObjectExpression") { - const attributes = expression.properties.map((property) => { - if (property.type === "SpreadProperty") { - const spreadAttribute = j.jsxSpreadAttribute(property.argument); - spreadAttribute.comments = property.comments; - return spreadAttribute; - } else if (property.type === "Property") { - const propertyValueType = property.value.type; - - let value; - if ( - propertyValueType === "Literal" && - typeof property.value.value === "string" && - canLiteralBePropString(property.value) - ) { - value = j.literal(property.value.value); - value.comments = property.value.comments; - } else { - value = j.jsxExpressionContainer(property.value); - } - - let jsxIdentifier; - if (property.key.type === "Literal") { - jsxIdentifier = j.jsxIdentifier(property.key.value); - } else { - jsxIdentifier = j.jsxIdentifier(property.key.name); - } - jsxIdentifier.comments = property.key.comments; - - const jsxAttribute = j.jsxAttribute(jsxIdentifier, value); - jsxAttribute.comments = property.comments; - return jsxAttribute; - } - return null; - }); - - return { - attributes, - extraComments: expression.comments || [], - }; - } else if (expression.type === "Literal" && expression.value === null) { - return { - attributes: [], - extraComments: expression.comments || [], - }; - } else { - throw new Error(`Unexpected attribute of type "${expression.type}"`); - } - }; - - const canConvertToJSXIdentifier = (node) => - (node.type === "Literal" && typeof node.value === "string") || - node.type === "Identifier" || - (node.type === "MemberExpression" && - !node.computed && - canConvertToJSXIdentifier(node.object) && - canConvertToJSXIdentifier(node.property)); - - const jsxIdentifierFor = (node) => { - let identifier; - let comments = node.comments || []; - if (node.type === "Literal") { - identifier = j.jsxIdentifier(node.value); - } else if (node.type === "MemberExpression") { - let { identifier: objectIdentifier, comments: objectComments } = - jsxIdentifierFor(node.object); - let { identifier: propertyIdentifier, comments: propertyComments } = - jsxIdentifierFor(node.property); - identifier = j.jsxMemberExpression(objectIdentifier, propertyIdentifier); - comments.push(...objectComments, ...propertyComments); - } else { - identifier = j.jsxIdentifier(node.name); - } - return { identifier, comments }; - }; - - const isCapitalizationInvalid = (node) => - (node.type === "Literal" && !/^[a-z]/.test(node.value)) || - (node.type === "Identifier" && /^[a-z]/.test(node.name)); - - const convertNodeToJSX = (node) => { - const comments = node.value.comments || []; - const { callee } = node.value; - for (const calleeNode of [callee, callee.object, callee.property]) { - for (const comment of calleeNode.comments || []) { - comment.leading = true; - comment.trailing = false; - comments.push(comment); - } - } - - const args = node.value.arguments; - - if ( - isCapitalizationInvalid(args[0]) || - !canConvertToJSXIdentifier(args[0]) - ) { - return node.value; - } - - const { identifier: jsxIdentifier, comments: identifierComments } = - jsxIdentifierFor(args[0]); - const props = args[1]; - - const { attributes, extraComments } = - convertExpressionToJSXAttributes(props); - - for (const comment of [...identifierComments, ...extraComments]) { - comment.leading = false; - comment.trailing = true; - comments.push(comment); - } - - const children = args.slice(2).map((child, index) => { - if ( - child.type === "Literal" && - typeof child.value === "string" && - !child.comments && - child.value !== "" && - child.value.trim() === child.value - ) { - return j.jsxText(encodeJSXTextValue(child.value)); - } else if ( - child.type === "CallExpression" && - child.callee.object && - child.callee.object.name === "React" && - child.callee.property.name === "createElement" - ) { - const jsxChild = convertNodeToJSX(node.get("arguments", index + 2)); - if ( - jsxChild.type !== "JSXElement" || - (jsxChild.comments || []).length > 0 - ) { - return j.jsxExpressionContainer(jsxChild); - } else { - return jsxChild; - } - } else if (child.type === "SpreadElement") { - return j.jsxExpressionContainer(child.argument); - } else { - return j.jsxExpressionContainer(child); - } - }); - - const openingElement = j.jsxOpeningElement(jsxIdentifier, attributes); - - if (children.length) { - const endIdentifier = Object.assign({}, jsxIdentifier, { comments: [] }); - // Add text newline nodes between elements so recast formats one child per - // line instead of all children on one line. - const paddedChildren = [j.jsxText("\n")]; - for (const child of children) { - paddedChildren.push(child, j.jsxText("\n")); - } - const element = j.jsxElement( - openingElement, - j.jsxClosingElement(endIdentifier), - paddedChildren, - ); - element.comments = comments; - return element; - } else { - openingElement.selfClosing = true; - const element = j.jsxElement(openingElement); - element.comments = comments; - return element; - } - }; - - if (options["explicit-require"] === false || ReactUtils.hasReact(root)) { - const mutations = root - .find(j.CallExpression, { - callee: { - object: { - name: "React", - }, - property: { - name: "createElement", - }, - }, - }) - .replaceWith(convertNodeToJSX) - .size(); - - if (mutations) { - return root.toSource(printOptions); - } - } - - return null; -}; diff --git a/codemods/react/create-element-to-jsx/package.json b/codemods/react/create-element-to-jsx/package.json deleted file mode 100644 index ba26015f..00000000 --- a/codemods/react/create-element-to-jsx/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "create-element-to-jsx", - "license": "MIT", - "devDependencies": { - "@codemod.com/codemod-utils": "*", - "@types/jscodeshift": "^0.11.10", - "@types/node": "20.9.0", - "jscodeshift": "^0.15.1", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@react-codemods/utils": "workspace:*" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "amirabbas-gh", - "dependencies": { - "ast-types": "^0.14.2" - } -} diff --git a/codemods/react/create-element-to-jsx/src/index.js b/codemods/react/create-element-to-jsx/src/index.js deleted file mode 100644 index a5b43df5..00000000 --- a/codemods/react/create-element-to-jsx/src/index.js +++ /dev/null @@ -1,251 +0,0 @@ -export default function transform(file, api, options) { - const j = api.jscodeshift; - const printOptions = options.printOptions || {}; - const root = j(file.source); - const ReactUtils = require("@react-codemods/utils")(j); - const encodeJSXTextValue = (value) => - value.replace(//g, ">"); - - const canLiteralBePropString = (node) => - node.raw.indexOf("\\") === -1 && node.value.indexOf('"') === -1; - - const convertExpressionToJSXAttributes = (expression) => { - if (!expression) { - return { - attributes: [], - extraComments: [], - }; - } - - const isReactSpread = - expression.type === "CallExpression" && - expression.callee.type === "MemberExpression" && - expression.callee.object.name === "React" && - expression.callee.property.name === "__spread"; - - const isObjectAssign = - expression.type === "CallExpression" && - expression.callee.type === "MemberExpression" && - expression.callee.object.name === "Object" && - expression.callee.property.name === "assign"; - - const validSpreadTypes = [ - "Identifier", - "MemberExpression", - "CallExpression", - ]; - - if (isReactSpread || isObjectAssign) { - const resultAttributes = []; - const resultExtraComments = expression.comments || []; - const { callee } = expression; - for (const node of [callee, callee.object, callee.property]) { - resultExtraComments.push(...(node.comments || [])); - } - expression.arguments.forEach((expression) => { - const { attributes, extraComments } = - convertExpressionToJSXAttributes(expression); - resultAttributes.push(...attributes); - resultExtraComments.push(...extraComments); - }); - - return { - attributes: resultAttributes, - extraComments: resultExtraComments, - }; - } else if (validSpreadTypes.indexOf(expression.type) != -1) { - return { - attributes: [j.jsxSpreadAttribute(expression)], - extraComments: [], - }; - } else if (expression.type === "ObjectExpression") { - const attributes = expression.properties.map((property) => { - if (property.type === "SpreadProperty") { - const spreadAttribute = j.jsxSpreadAttribute(property.argument); - spreadAttribute.comments = property.comments; - return spreadAttribute; - } else if (property.type === "Property") { - const propertyValueType = property.value.type; - - let value; - if ( - propertyValueType === "Literal" && - typeof property.value.value === "string" && - canLiteralBePropString(property.value) - ) { - value = j.literal(property.value.value); - value.comments = property.value.comments; - } else { - value = j.jsxExpressionContainer(property.value); - } - - let jsxIdentifier; - if (property.key.type === "Literal") { - jsxIdentifier = j.jsxIdentifier(property.key.value); - } else { - jsxIdentifier = j.jsxIdentifier(property.key.name); - } - jsxIdentifier.comments = property.key.comments; - - const jsxAttribute = j.jsxAttribute(jsxIdentifier, value); - jsxAttribute.comments = property.comments; - return jsxAttribute; - } - return null; - }); - - return { - attributes, - extraComments: expression.comments || [], - }; - } else if (expression.type === "Literal" && expression.value === null) { - return { - attributes: [], - extraComments: expression.comments || [], - }; - } else { - throw new Error(`Unexpected attribute of type "${expression.type}"`); - } - }; - - const canConvertToJSXIdentifier = (node) => - (node.type === "Literal" && typeof node.value === "string") || - node.type === "Identifier" || - (node.type === "MemberExpression" && - !node.computed && - canConvertToJSXIdentifier(node.object) && - canConvertToJSXIdentifier(node.property)); - - const jsxIdentifierFor = (node) => { - let identifier; - let comments = node.comments || []; - if (node.type === "Literal") { - identifier = j.jsxIdentifier(node.value); - } else if (node.type === "MemberExpression") { - let { identifier: objectIdentifier, comments: objectComments } = - jsxIdentifierFor(node.object); - let { identifier: propertyIdentifier, comments: propertyComments } = - jsxIdentifierFor(node.property); - identifier = j.jsxMemberExpression(objectIdentifier, propertyIdentifier); - comments.push(...objectComments, ...propertyComments); - } else { - identifier = j.jsxIdentifier(node.name); - } - return { identifier, comments }; - }; - - const isCapitalizationInvalid = (node) => - (node.type === "Literal" && !/^[a-z]/.test(node.value)) || - (node.type === "Identifier" && /^[a-z]/.test(node.name)); - - const convertNodeToJSX = (node) => { - const comments = node.value.comments || []; - const { callee } = node.value; - for (const calleeNode of [callee, callee.object, callee.property]) { - for (const comment of calleeNode.comments || []) { - comment.leading = true; - comment.trailing = false; - comments.push(comment); - } - } - - const args = node.value.arguments; - - if ( - isCapitalizationInvalid(args[0]) || - !canConvertToJSXIdentifier(args[0]) - ) { - return node.value; - } - - const { identifier: jsxIdentifier, comments: identifierComments } = - jsxIdentifierFor(args[0]); - const props = args[1]; - - const { attributes, extraComments } = - convertExpressionToJSXAttributes(props); - - for (const comment of [...identifierComments, ...extraComments]) { - comment.leading = false; - comment.trailing = true; - comments.push(comment); - } - - const children = args.slice(2).map((child, index) => { - if ( - child.type === "Literal" && - typeof child.value === "string" && - !child.comments && - child.value !== "" && - child.value.trim() === child.value - ) { - return j.jsxText(encodeJSXTextValue(child.value)); - } else if ( - child.type === "CallExpression" && - child.callee.object && - child.callee.object.name === "React" && - child.callee.property.name === "createElement" - ) { - const jsxChild = convertNodeToJSX(node.get("arguments", index + 2)); - if ( - jsxChild.type !== "JSXElement" || - (jsxChild.comments || []).length > 0 - ) { - return j.jsxExpressionContainer(jsxChild); - } else { - return jsxChild; - } - } else if (child.type === "SpreadElement") { - return j.jsxExpressionContainer(child.argument); - } else { - return j.jsxExpressionContainer(child); - } - }); - - const openingElement = j.jsxOpeningElement(jsxIdentifier, attributes); - - if (children.length) { - const endIdentifier = Object.assign({}, jsxIdentifier, { comments: [] }); - // Add text newline nodes between elements so recast formats one child per - // line instead of all children on one line. - const paddedChildren = [j.jsxText("\n")]; - for (const child of children) { - paddedChildren.push(child, j.jsxText("\n")); - } - const element = j.jsxElement( - openingElement, - j.jsxClosingElement(endIdentifier), - paddedChildren, - ); - element.comments = comments; - return element; - } else { - openingElement.selfClosing = true; - const element = j.jsxElement(openingElement); - element.comments = comments; - return element; - } - }; - - if (options["explicit-require"] === false || ReactUtils.hasReact(root)) { - const mutations = root - .find(j.CallExpression, { - callee: { - object: { - name: "React", - }, - property: { - name: "createElement", - }, - }, - }) - .replaceWith(convertNodeToJSX) - .size(); - - if (mutations) { - return root.toSource(printOptions); - } - } - - return null; -}; diff --git a/codemods/react/create-element-to-jsx/tsconfig.json b/codemods/react/create-element-to-jsx/tsconfig.json deleted file mode 100644 index 03c15498..00000000 --- a/codemods/react/create-element-to-jsx/tsconfig.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js", - "src/index.cjs" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/react/prop-types-typescript/package.json b/codemods/react/prop-types-typescript/package.json deleted file mode 100644 index 39dc98fa..00000000 --- a/codemods/react/prop-types-typescript/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-prop-types-typescript", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:", - "ast-types": "^0.15.0" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react/replace-react-fc-typescript/package.json b/codemods/react/replace-react-fc-typescript/package.json deleted file mode 100644 index c33482be..00000000 --- a/codemods/react/replace-react-fc-typescript/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-react-replace-react-fc-typescript", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/react/update-react-imports/package.json b/codemods/react/update-react-imports/package.json deleted file mode 100644 index 1c05eca8..00000000 --- a/codemods/react/update-react-imports/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "react-update-react-imports", - "license": "MIT", - "devDependencies": { - "@codemod.com/codemod-utils": "*", - "@types/jscodeshift": "^0.11.10", - "@types/node": "20.9.0", - "jscodeshift": "^0.15.1", - "typescript": "^5.2.2", - "vitest": "^1.0.1" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "amirabbas-gh", - "dependencies": { - "@types/react": "^19.0.1", - "react": "^19.0.0" - } -} diff --git a/codemods/react/update-react-imports/tsconfig.json b/codemods/react/update-react-imports/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/react/update-react-imports/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/redwoodjs/core/4/auth-decoder/package.json b/codemods/redwoodjs/core/4/auth-decoder/package.json deleted file mode 100644 index 33dcce32..00000000 --- a/codemods/redwoodjs/core/4/auth-decoder/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-redwoodjs-core-4-auth-decoder", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/redwoodjs/core/4/auth-decoder/test/test.ts b/codemods/redwoodjs/core/4/auth-decoder/test/test.ts deleted file mode 100644 index b1a31c80..00000000 --- a/codemods/redwoodjs/core/4/auth-decoder/test/test.ts +++ /dev/null @@ -1,51 +0,0 @@ -import assert from "node:assert/strict"; -import { readFile } from "node:fs/promises"; -import { join } from "node:path"; -import { fileURLToPath } from "node:url"; -import type { API, FileInfo } from "jscodeshift"; -import jscodeshift from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -const __dirname = fileURLToPath(new URL(".", import.meta.url)); - -describe("@redwoodjs/core v4 auth-decoder", () => { - it("should add authDecoder", async () => { - const input = await readFile(join(__dirname, "../__testfixtures__/input.js"), { - encoding: "utf8", - }); - - const output = await readFile(join(__dirname, "../__testfixtures__/output.js"), { - encoding: "utf8", - }); - - const fileInfo: FileInfo = { - path: "index.js", - source: input, - }; - - const buildApi = (parser: string): API => ({ - j: jscodeshift.withParser(parser), - jscodeshift: jscodeshift.withParser(parser), - stats: () => { - console.error( - "The stats function was called, which is not supported on purpose", - ); - }, - report: () => { - console.error( - "The report function was called, which is not supported on purpose", - ); - }, - }); - - const actualOutput = transform(fileInfo, buildApi("js"), { - quote: "single", - }); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - output.replace(/\W/gm, ""), - ); - }); -}); diff --git a/codemods/redwoodjs/core/4/redwood-apollo-provider/package.json b/codemods/redwoodjs/core/4/redwood-apollo-provider/package.json deleted file mode 100644 index 43794c88..00000000 --- a/codemods/redwoodjs/core/4/redwood-apollo-provider/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-redwoodjs-core-4-redwood-apollo-provider", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/redwoodjs/core/4/redwood-apollo-provider/test/test.ts b/codemods/redwoodjs/core/4/redwood-apollo-provider/test/test.ts deleted file mode 100644 index 32ff49ff..00000000 --- a/codemods/redwoodjs/core/4/redwood-apollo-provider/test/test.ts +++ /dev/null @@ -1,51 +0,0 @@ -import assert from "node:assert/strict"; -import { readFile } from "node:fs/promises"; -import { join } from "node:path"; -import { fileURLToPath } from "node:url"; -import type { API, FileInfo } from "jscodeshift"; -import jscodeshift from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -const __dirname = fileURLToPath(new URL(".", import.meta.url)); - -describe("@redwoodjs/core v4 redwood-apollo-provider", () => { - it("should add AuthProvider and useAuth", async () => { - const input = await readFile(join(__dirname, "../__testfixtures__/input.js"), { - encoding: "utf8", - }); - - const output = await readFile(join(__dirname, "../__testfixtures__/output.js"), { - encoding: "utf8", - }); - - const fileInfo: FileInfo = { - path: "index.js", - source: input, - }; - - const buildApi = (parser: string): API => ({ - j: jscodeshift.withParser(parser), - jscodeshift: jscodeshift.withParser(parser), - stats: () => { - console.error( - "The stats function was called, which is not supported on purpose", - ); - }, - report: () => { - console.error( - "The report function was called, which is not supported on purpose", - ); - }, - }); - - const actualOutput = transform(fileInfo, buildApi("js"), { - quote: "single", - }); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - output.replace(/\W/gm, ""), - ); - }); -}); diff --git a/codemods/redwoodjs/core/4/router-use-auth/package.json b/codemods/redwoodjs/core/4/router-use-auth/package.json deleted file mode 100644 index 83136433..00000000 --- a/codemods/redwoodjs/core/4/router-use-auth/package.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "name": "@codemod-com/codemod-redwoodjs-core-4-router-use-auth", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/redwoodjs/core/4/router-use-auth/test/test.ts b/codemods/redwoodjs/core/4/router-use-auth/test/test.ts deleted file mode 100644 index 347bb623..00000000 --- a/codemods/redwoodjs/core/4/router-use-auth/test/test.ts +++ /dev/null @@ -1,51 +0,0 @@ -import assert from "node:assert/strict"; -import { readFile } from "node:fs/promises"; -import { join } from "node:path"; -import { fileURLToPath } from "node:url"; -import type { API, FileInfo } from "jscodeshift"; -import jscodeshift from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -const __dirname = fileURLToPath(new URL(".", import.meta.url)); - -describe("@redwoodjs/core v4 router-use-auth", () => { - it("should add useAuth", async () => { - const input = await readFile(join(__dirname, "../__testfixtures__/input.js"), { - encoding: "utf8", - }); - - const output = await readFile(join(__dirname, "../__testfixtures__/output.js"), { - encoding: "utf8", - }); - - const fileInfo: FileInfo = { - path: "index.js", - source: input, - }; - - const buildApi = (parser: string): API => ({ - j: jscodeshift.withParser(parser), - jscodeshift: jscodeshift.withParser(parser), - stats: () => { - console.error( - "The stats function was called, which is not supported on purpose", - ); - }, - report: () => { - console.error( - "The report function was called, which is not supported on purpose", - ); - }, - }); - - const actualOutput = transform(fileInfo, buildApi("js"), { - quote: "single", - }); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - output.replace(/\W/gm, ""), - ); - }); -}); diff --git a/codemods/redwoodjs/core/4/use-armor/package.json b/codemods/redwoodjs/core/4/use-armor/package.json deleted file mode 100644 index 43ce6aa6..00000000 --- a/codemods/redwoodjs/core/4/use-armor/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "@codemod-com/codemod-redwoodjs-core-4-use-armor", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/remove-unused-feature-flags-2/package.json b/codemods/remove-unused-feature-flags-2/package.json deleted file mode 100644 index adf1e3dc..00000000 --- a/codemods/remove-unused-feature-flags-2/package.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "@codemod-com/codemod-remove-unused-feature-flags-2", - "dependencies": {}, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "@codemod-com/filemod": "workspace:*", - "memfs": "^4.6.0", - "ts-morph": "^19.0.0", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/replace-feature-flag-core/package.json b/codemods/replace-feature-flag-core/package.json deleted file mode 100644 index af1cec81..00000000 --- a/codemods/replace-feature-flag-core/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "replace-feature-flag-core", - "author": "dmytrohryshyn", - "private": true, - "dependencies": {}, - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "5.2.2", - "vitest": "^1.0.1", - "ts-morph": "^22.0.0" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "license": "MIT", - "files": [ - "README.md", - ".codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/replace-feature-flag-core/tsconfig.json b/codemods/replace-feature-flag-core/tsconfig.json deleted file mode 100644 index 329a7d63..00000000 --- a/codemods/replace-feature-flag-core/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "@codemod-com/tsconfig/codemod.json", - "compilerOptions": { - "baseUrl": ".", - "outDir": "./dist" - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/sql/add-index-before-select/package.json b/codemods/sql/add-index-before-select/package.json deleted file mode 100644 index 3d94288b..00000000 --- a/codemods/sql/add-index-before-select/package.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "name": "@codemod-com/sql-add-index-before-select", - "license": "MIT", - "private": true, - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/workflow": "workspace:*" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/sql/add-index-before-select/tsconfig.json b/codemods/sql/add-index-before-select/tsconfig.json deleted file mode 100644 index 0947cb85..00000000 --- a/codemods/sql/add-index-before-select/tsconfig.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/statsig/replace-gate/package.json b/codemods/statsig/replace-gate/package.json deleted file mode 100644 index 61e6d86b..00000000 --- a/codemods/statsig/replace-gate/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "statsig/replace-gate", - "author": "dmytrohryshyn", - "dependencies": {}, - "private": true, - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "5.2.2", - "vitest": "^1.0.1", - "ts-morph": "^22.0.0" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "license": "MIT", - "files": [ - "README.md", - ".codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/statsig/replace-gate/tsconfig.json b/codemods/statsig/replace-gate/tsconfig.json deleted file mode 100644 index 329a7d63..00000000 --- a/codemods/statsig/replace-gate/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "@codemod-com/tsconfig/codemod.json", - "compilerOptions": { - "baseUrl": ".", - "outDir": "./dist" - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/styledictionary/4/asynchronous-api-file-headers/package.json b/codemods/styledictionary/4/asynchronous-api-file-headers/package.json deleted file mode 100644 index e278abf1..00000000 --- a/codemods/styledictionary/4/asynchronous-api-file-headers/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/styledictionary-4-asynchronous-api-file-headers", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/styledictionary/4/asynchronous-api-file-headers/tsconfig.json b/codemods/styledictionary/4/asynchronous-api-file-headers/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/styledictionary/4/asynchronous-api-file-headers/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/styledictionary/4/asynchronous-api/package.json b/codemods/styledictionary/4/asynchronous-api/package.json deleted file mode 100644 index eb0c8418..00000000 --- a/codemods/styledictionary/4/asynchronous-api/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/styledictionary-4-asynchronous-api", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/styledictionary/4/asynchronous-api/tsconfig.json b/codemods/styledictionary/4/asynchronous-api/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/styledictionary/4/asynchronous-api/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/styledictionary/4/format-helpers/package.json b/codemods/styledictionary/4/format-helpers/package.json deleted file mode 100644 index 80966e96..00000000 --- a/codemods/styledictionary/4/format-helpers/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/styledictionary-4-format-helpers", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/styledictionary/4/format-helpers/tsconfig.json b/codemods/styledictionary/4/format-helpers/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/styledictionary/4/format-helpers/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/styledictionary/4/formatting-options/package.json b/codemods/styledictionary/4/formatting-options/package.json deleted file mode 100644 index 4bb4edda..00000000 --- a/codemods/styledictionary/4/formatting-options/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/styledictionary-4-formatting-options", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/styledictionary/4/formatting-options/tsconfig.json b/codemods/styledictionary/4/formatting-options/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/styledictionary/4/formatting-options/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/styledictionary/4/hook-api-actions/package.json b/codemods/styledictionary/4/hook-api-actions/package.json deleted file mode 100644 index b45639b1..00000000 --- a/codemods/styledictionary/4/hook-api-actions/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/styledictionary-4-hook-api-actions", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/styledictionary/4/hook-api-actions/tsconfig.json b/codemods/styledictionary/4/hook-api-actions/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/styledictionary/4/hook-api-actions/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/styledictionary/4/hook-api-file-header/package.json b/codemods/styledictionary/4/hook-api-file-header/package.json deleted file mode 100644 index 6b151ce2..00000000 --- a/codemods/styledictionary/4/hook-api-file-header/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/styledictionary-4-hook-api-file-header", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/styledictionary/4/hook-api-file-header/tsconfig.json b/codemods/styledictionary/4/hook-api-file-header/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/styledictionary/4/hook-api-file-header/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/styledictionary/4/hook-api-filters/package.json b/codemods/styledictionary/4/hook-api-filters/package.json deleted file mode 100644 index 20aee807..00000000 --- a/codemods/styledictionary/4/hook-api-filters/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/styledictionary-4-hook-api-filters", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/styledictionary/4/hook-api-filters/tsconfig.json b/codemods/styledictionary/4/hook-api-filters/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/styledictionary/4/hook-api-filters/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/styledictionary/4/hook-api-formats/package.json b/codemods/styledictionary/4/hook-api-formats/package.json deleted file mode 100644 index 4da83cc4..00000000 --- a/codemods/styledictionary/4/hook-api-formats/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/styledictionary-4-hook-api-formats", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/styledictionary/4/hook-api-formats/tsconfig.json b/codemods/styledictionary/4/hook-api-formats/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/styledictionary/4/hook-api-formats/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/styledictionary/4/hook-api-parsers/package.json b/codemods/styledictionary/4/hook-api-parsers/package.json deleted file mode 100644 index 3c248e6b..00000000 --- a/codemods/styledictionary/4/hook-api-parsers/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/styledictionary-4-hook-api-parsers", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/styledictionary/4/hook-api-parsers/tsconfig.json b/codemods/styledictionary/4/hook-api-parsers/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/styledictionary/4/hook-api-parsers/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/styledictionary/4/hook-api-preprocessors/package.json b/codemods/styledictionary/4/hook-api-preprocessors/package.json deleted file mode 100644 index dd2865ec..00000000 --- a/codemods/styledictionary/4/hook-api-preprocessors/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/styledictionary-4-hook-api-preprocessors", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/styledictionary/4/hook-api-preprocessors/tsconfig.json b/codemods/styledictionary/4/hook-api-preprocessors/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/styledictionary/4/hook-api-preprocessors/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/styledictionary/4/hook-api-transform-groups/package.json b/codemods/styledictionary/4/hook-api-transform-groups/package.json deleted file mode 100644 index 0372094b..00000000 --- a/codemods/styledictionary/4/hook-api-transform-groups/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/styledictionary-4-hook-api-transform-groups", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/styledictionary/4/hook-api-transform-groups/tsconfig.json b/codemods/styledictionary/4/hook-api-transform-groups/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/styledictionary/4/hook-api-transform-groups/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/styledictionary/4/hook-api-transform/package.json b/codemods/styledictionary/4/hook-api-transform/package.json deleted file mode 100644 index 52952bda..00000000 --- a/codemods/styledictionary/4/hook-api-transform/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/styledictionary-4-hook-api-transform", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/styledictionary/4/hook-api-transform/tsconfig.json b/codemods/styledictionary/4/hook-api-transform/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/styledictionary/4/hook-api-transform/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/styledictionary/4/instantiating-style-dictionary/package.json b/codemods/styledictionary/4/instantiating-style-dictionary/package.json deleted file mode 100644 index f123f510..00000000 --- a/codemods/styledictionary/4/instantiating-style-dictionary/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/styledictionary-4-instantiating-style-dictionary", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/styledictionary/4/instantiating-style-dictionary/tsconfig.json b/codemods/styledictionary/4/instantiating-style-dictionary/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/styledictionary/4/instantiating-style-dictionary/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/styledictionary/4/logging/package.json b/codemods/styledictionary/4/logging/package.json deleted file mode 100644 index a8352de5..00000000 --- a/codemods/styledictionary/4/logging/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/styledictionary-4-logging", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/styledictionary/4/logging/tsconfig.json b/codemods/styledictionary/4/logging/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/styledictionary/4/logging/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/styledictionary/4/module-common-js/package.json b/codemods/styledictionary/4/module-common-js/package.json deleted file mode 100644 index bc576f86..00000000 --- a/codemods/styledictionary/4/module-common-js/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/styledictionary-4-module-common-js", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/styledictionary/4/module-common-js/tsconfig.json b/codemods/styledictionary/4/module-common-js/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/styledictionary/4/module-common-js/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/styledictionary/4/reference-utils/package.json b/codemods/styledictionary/4/reference-utils/package.json deleted file mode 100644 index 8e87f176..00000000 --- a/codemods/styledictionary/4/reference-utils/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/styledictionary-4-reference-utils", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/styledictionary/4/reference-utils/tsconfig.json b/codemods/styledictionary/4/reference-utils/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/styledictionary/4/reference-utils/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/styledictionary/4/type/package.json b/codemods/styledictionary/4/type/package.json deleted file mode 100644 index 6f2508e7..00000000 --- a/codemods/styledictionary/4/type/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/styledictionary-4-type", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/styledictionary/4/type/tsconfig.json b/codemods/styledictionary/4/type/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/styledictionary/4/type/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/styledictionary/4/updated-and-removed-transforms/package.json b/codemods/styledictionary/4/updated-and-removed-transforms/package.json deleted file mode 100644 index cc8d1578..00000000 --- a/codemods/styledictionary/4/updated-and-removed-transforms/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/styledictionary-4-updated-and-removed-transforms", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/styledictionary/4/updated-and-removed-transforms/tsconfig.json b/codemods/styledictionary/4/updated-and-removed-transforms/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/styledictionary/4/updated-and-removed-transforms/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/svelte/5/components-as-functions-destroyfunction/package.json b/codemods/svelte/5/components-as-functions-destroyfunction/package.json deleted file mode 100644 index f1777f69..00000000 --- a/codemods/svelte/5/components-as-functions-destroyfunction/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/svelte-5-components-as-functions-destroyfunction", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/svelte/5/components-as-functions-destroyfunction/tsconfig.json b/codemods/svelte/5/components-as-functions-destroyfunction/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/svelte/5/components-as-functions-destroyfunction/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/svelte/5/components-as-functions-onfunction/package.json b/codemods/svelte/5/components-as-functions-onfunction/package.json deleted file mode 100644 index 64db4e50..00000000 --- a/codemods/svelte/5/components-as-functions-onfunction/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/svelte-5-components-as-functions-onfunction", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/svelte/5/components-as-functions-onfunction/tsconfig.json b/codemods/svelte/5/components-as-functions-onfunction/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/svelte/5/components-as-functions-onfunction/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/svelte/5/components-as-functions/package.json b/codemods/svelte/5/components-as-functions/package.json deleted file mode 100644 index 6ed7abe4..00000000 --- a/codemods/svelte/5/components-as-functions/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/svelte-5-components-as-functions", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/svelte/5/components-as-functions/tsconfig.json b/codemods/svelte/5/components-as-functions/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/svelte/5/components-as-functions/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/svelte/5/is-where-scoping/package.json b/codemods/svelte/5/is-where-scoping/package.json deleted file mode 100644 index 215cc274..00000000 --- a/codemods/svelte/5/is-where-scoping/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/svelte-5-is-where-scoping", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/svelte/5/is-where-scoping/tsconfig.json b/codemods/svelte/5/is-where-scoping/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/svelte/5/is-where-scoping/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/svelte/5/server-api-changes/package.json b/codemods/svelte/5/server-api-changes/package.json deleted file mode 100644 index 19b57900..00000000 --- a/codemods/svelte/5/server-api-changes/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/svelte-5-server-api-changes", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/svelte/5/server-api-changes/tsconfig.json b/codemods/svelte/5/server-api-changes/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/svelte/5/server-api-changes/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/svelte/5/svelte-element-expression/package.json b/codemods/svelte/5/svelte-element-expression/package.json deleted file mode 100644 index 98433b49..00000000 --- a/codemods/svelte/5/svelte-element-expression/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "@codemod/svelte-5-svelte-element-expression", - "private": true, - "dependencies": {}, - "devDependencies": { - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "^1.0.1" - }, - "scripts": {}, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/svelte/5/svelte-element-expression/tsconfig.json b/codemods/svelte/5/svelte-element-expression/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/svelte/5/svelte-element-expression/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/tanStack/codeSplitting/package.json b/codemods/tanStack/codeSplitting/package.json deleted file mode 100644 index 34fe4190..00000000 --- a/codemods/tanStack/codeSplitting/package.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "name": "tanStackRouter-CodeSplitting", - "private": true, - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.5.4", - "vitest": "^1.0.1" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "dependencies": { - "@codemod.com/workflow": "^0.0.31", - "fast-glob": "^3.3.2" - } -} diff --git a/codemods/tanStack/codeSplitting/tsconfig.json b/codemods/tanStack/codeSplitting/tsconfig.json deleted file mode 100644 index 9811f48b..00000000 --- a/codemods/tanStack/codeSplitting/tsconfig.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "outDir": "./dist", - "esModuleInterop": true, - "forceConsistentCasingInFileNames": true, - "isolatedModules": true, - "module": "NodeNext", - "skipLibCheck": true, - "strict": true, - "target": "ES6", - "allowJs": true, - "noUncheckedIndexedAccess": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/three/r168/deactivate-to-disconnect/cdmd_dist/index.cjs b/codemods/three/r168/deactivate-to-disconnect/cdmd_dist/index.cjs deleted file mode 100644 index d4257289..00000000 --- a/codemods/three/r168/deactivate-to-disconnect/cdmd_dist/index.cjs +++ /dev/null @@ -1,57 +0,0 @@ -/*! @license -The MIT License (MIT) - -Copyright (c) 2024 yugal41735 - -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. - -*/ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function () { - return transform; - }, -}); -function transform(file, api, options) { - const j = api.jscodeshift; - const root = j(file.source); - let dirtyFlag = false; - root - .find(j.CallExpression, { - callee: { type: "MemberExpression", property: { name: "deactivate" } }, - }) - .forEach((path) => { - const memberExpr = path.node.callee; - if (j.MemberExpression.check(memberExpr)) { - const object = memberExpr.object; - if (j.MemberExpression.check(object)) { - path.replace( - j.callExpression( - j.memberExpression(object.object, j.identifier("disconnect")), - [], - ), - ); - dirtyFlag = true; - } - } - }); - root - .find(j.CallExpression, { - callee: { - type: "MemberExpression", - object: { type: "Identifier", name: "dragControls" }, - property: { name: "deactivate" }, - }, - }) - .forEach((path) => { - path.replace(j.callExpression(j.identifier("disconnect"), [])); - dirtyFlag = true; - }); - return dirtyFlag ? root.toSource() : undefined; -} diff --git a/codemods/three/r168/deactivate-to-disconnect/package.json b/codemods/three/r168/deactivate-to-disconnect/package.json deleted file mode 100644 index fe1d1df4..00000000 --- a/codemods/three/r168/deactivate-to-disconnect/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "deactivate-to-disconnect", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "yugal41735" -} diff --git a/codemods/three/r168/deactivate-to-disconnect/test/test.ts b/codemods/three/r168/deactivate-to-disconnect/test/test.ts deleted file mode 100644 index 31be9832..00000000 --- a/codemods/three/r168/deactivate-to-disconnect/test/test.ts +++ /dev/null @@ -1,73 +0,0 @@ -import assert from "node:assert"; -import { readFile } from "node:fs/promises"; -import { join } from "node:path"; -import jscodeshift, { type API } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -const buildApi = (parser: string | undefined): API => ({ - j: parser ? jscodeshift.withParser(parser) : jscodeshift, - jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, - stats: () => { - console.error( - "The stats function was called, which is not supported on purpose", - ); - }, - report: () => { - console.error( - "The report function was called, which is not supported on purpose", - ); - }, -}); - -describe("deactivate-to-disconnect", () => { - it("test #1", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); - - it("test #2", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture2.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture2.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); -}); diff --git a/codemods/three/r168/deactivate-to-disconnect/tsconfig.json b/codemods/three/r168/deactivate-to-disconnect/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/three/r168/deactivate-to-disconnect/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/three/r168/drag-controls-to-connect/cdmd_dist/index.cjs b/codemods/three/r168/drag-controls-to-connect/cdmd_dist/index.cjs deleted file mode 100644 index 7ece3338..00000000 --- a/codemods/three/r168/drag-controls-to-connect/cdmd_dist/index.cjs +++ /dev/null @@ -1,48 +0,0 @@ -/*! @license -The MIT License (MIT) - -Copyright (c) 2024 yugal41735 - -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. - -*/ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function () { - return transform; - }, -}); -function transform(file, api, options) { - const j = api.jscodeshift; - const root = j(file.source); - let dirtyFlag = false; - root - .find(j.CallExpression, { - callee: { type: "MemberExpression", property: { name: "activate" } }, - }) - .forEach((path) => { - const { object } = path.node.callee; - if (j.Identifier.check(object) && object.name === "dragControls") { - j(path).replaceWith(j.callExpression(j.identifier("connect"), [])); - dirtyFlag = true; - } else if ( - j.MemberExpression.check(object) && - object.property.name === "dragControls" - ) { - j(path).replaceWith( - j.callExpression( - j.memberExpression(object.object, j.identifier("connect")), - [], - ), - ); - dirtyFlag = true; - } - }); - return dirtyFlag ? root.toSource() : undefined; -} diff --git a/codemods/three/r168/drag-controls-to-connect/package.json b/codemods/three/r168/drag-controls-to-connect/package.json deleted file mode 100644 index 081ae0b8..00000000 --- a/codemods/three/r168/drag-controls-to-connect/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "drag-controls-to-connect", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "yugal41735" -} diff --git a/codemods/three/r168/drag-controls-to-connect/test/test.ts b/codemods/three/r168/drag-controls-to-connect/test/test.ts deleted file mode 100644 index 6580cb55..00000000 --- a/codemods/three/r168/drag-controls-to-connect/test/test.ts +++ /dev/null @@ -1,73 +0,0 @@ -import assert from "node:assert"; -import { readFile } from "node:fs/promises"; -import { join } from "node:path"; -import jscodeshift, { type API } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -const buildApi = (parser: string | undefined): API => ({ - j: parser ? jscodeshift.withParser(parser) : jscodeshift, - jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, - stats: () => { - console.error( - "The stats function was called, which is not supported on purpose", - ); - }, - report: () => { - console.error( - "The report function was called, which is not supported on purpose", - ); - }, -}); - -describe("drag-controls-to-connect", () => { - it("test #1", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); - - it("test #2", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture2.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture2.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); -}); diff --git a/codemods/three/r168/drag-controls-to-connect/tsconfig.json b/codemods/three/r168/drag-controls-to-connect/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/three/r168/drag-controls-to-connect/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/three/r168/pointer-lock-controls-to-controls-object/.codemodrc.json b/codemods/three/r168/pointer-lock-controls-to-controls-object/.codemodrc.json deleted file mode 100644 index e606a187..00000000 --- a/codemods/three/r168/pointer-lock-controls-to-controls-object/.codemodrc.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "$schema": "https://codemod-utils.s3.us-west-1.amazonaws.com/configuration_schema.json", - "name": "three/r168/pointerlockcontrols-object-to-controls-object", - "version": "1.0.0", - "engine": "jscodeshift", - "private": false, - "arguments": [], - "meta": { - "tags": ["three", "migration", "r168"] - } -} diff --git a/codemods/three/r168/pointer-lock-controls-to-controls-object/README.md b/codemods/three/r168/pointer-lock-controls-to-controls-object/README.md deleted file mode 100644 index 92c1ffb3..00000000 --- a/codemods/three/r168/pointer-lock-controls-to-controls-object/README.md +++ /dev/null @@ -1,39 +0,0 @@ -This codemod helps in transforming `PointerLockControls.getObject()` to `controls.object` - -## Example - -### Before - -```ts -pointerLockControls.getObject().translateX(translationVelocity.x * delta); -``` - -### After - -```ts -controls.object.translateX(translationVelocity.x * delta); -``` - -### Before - -```ts -pointerLockControls.getObject().translateY(translationVelocity.y * delta); -``` - -### After - -```ts -controls.object.translateY(translationVelocity.y * delta); -``` - -### Before - -```ts -pointerLockControls.getObject().translateZ(translationVelocity.z * delta); -``` - -### After - -```ts -controls.object.translateZ(translationVelocity.z * delta); -``` diff --git a/codemods/three/r168/pointer-lock-controls-to-controls-object/__testfixtures__/fixture1.input.ts b/codemods/three/r168/pointer-lock-controls-to-controls-object/__testfixtures__/fixture1.input.ts deleted file mode 100644 index f9923c46..00000000 --- a/codemods/three/r168/pointer-lock-controls-to-controls-object/__testfixtures__/fixture1.input.ts +++ /dev/null @@ -1 +0,0 @@ -pointerLockControls.getObject().translateX(translationVelocity.x * delta); diff --git a/codemods/three/r168/pointer-lock-controls-to-controls-object/__testfixtures__/fixture1.output.ts b/codemods/three/r168/pointer-lock-controls-to-controls-object/__testfixtures__/fixture1.output.ts deleted file mode 100644 index afc62498..00000000 --- a/codemods/three/r168/pointer-lock-controls-to-controls-object/__testfixtures__/fixture1.output.ts +++ /dev/null @@ -1 +0,0 @@ -controls.object.translateX(translationVelocity.x * delta); diff --git a/codemods/three/r168/pointer-lock-controls-to-controls-object/__testfixtures__/fixture2.input.ts b/codemods/three/r168/pointer-lock-controls-to-controls-object/__testfixtures__/fixture2.input.ts deleted file mode 100644 index dd37a4dd..00000000 --- a/codemods/three/r168/pointer-lock-controls-to-controls-object/__testfixtures__/fixture2.input.ts +++ /dev/null @@ -1 +0,0 @@ -pointerLockControls.getObject().translateY(translationVelocity.y * delta); diff --git a/codemods/three/r168/pointer-lock-controls-to-controls-object/__testfixtures__/fixture2.output.ts b/codemods/three/r168/pointer-lock-controls-to-controls-object/__testfixtures__/fixture2.output.ts deleted file mode 100644 index 40dfe608..00000000 --- a/codemods/three/r168/pointer-lock-controls-to-controls-object/__testfixtures__/fixture2.output.ts +++ /dev/null @@ -1 +0,0 @@ -controls.object.translateY(translationVelocity.y * delta); diff --git a/codemods/three/r168/pointer-lock-controls-to-controls-object/__testfixtures__/fixture3.input.ts b/codemods/three/r168/pointer-lock-controls-to-controls-object/__testfixtures__/fixture3.input.ts deleted file mode 100644 index 802eccda..00000000 --- a/codemods/three/r168/pointer-lock-controls-to-controls-object/__testfixtures__/fixture3.input.ts +++ /dev/null @@ -1 +0,0 @@ -pointerLockControls.getObject().translateZ(translationVelocity.z * delta); diff --git a/codemods/three/r168/pointer-lock-controls-to-controls-object/__testfixtures__/fixture3.output.ts b/codemods/three/r168/pointer-lock-controls-to-controls-object/__testfixtures__/fixture3.output.ts deleted file mode 100644 index 04595da3..00000000 --- a/codemods/three/r168/pointer-lock-controls-to-controls-object/__testfixtures__/fixture3.output.ts +++ /dev/null @@ -1 +0,0 @@ -controls.object.translateZ(translationVelocity.z * delta); diff --git a/codemods/three/r168/pointer-lock-controls-to-controls-object/cdmd_dist/index.cjs b/codemods/three/r168/pointer-lock-controls-to-controls-object/cdmd_dist/index.cjs deleted file mode 100644 index d2f57fb2..00000000 --- a/codemods/three/r168/pointer-lock-controls-to-controls-object/cdmd_dist/index.cjs +++ /dev/null @@ -1,56 +0,0 @@ -/*! @license -The MIT License (MIT) - -Copyright (c) 2024 yugal41735 - -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. - -*/ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function () { - return transform; - }, -}); -function transform(file, api, options) { - const j = api.jscodeshift; - const root = j(file.source); - let dirtyFlag = false; - root.find(j.CallExpression).forEach((path) => { - const { callee } = path.node; - if (j.MemberExpression.check(callee)) { - const { object, property } = callee; - if (j.CallExpression.check(object)) { - const { callee: innerCallee } = object; - if (j.MemberExpression.check(innerCallee)) { - const { object: innerObject, property: innerProperty } = innerCallee; - if ( - j.Identifier.check(innerObject) && - innerObject.name === "pointerLockControls" - ) { - if ( - j.Identifier.check(innerProperty) && - innerProperty.name === "getObject" - ) { - path.node.callee = j.memberExpression( - j.memberExpression( - j.identifier("controls"), - j.identifier("object"), - ), - property, - ); - dirtyFlag = true; - } - } - } - } - } - }); - return dirtyFlag ? root.toSource() : undefined; -} diff --git a/codemods/three/r168/pointer-lock-controls-to-controls-object/package.json b/codemods/three/r168/pointer-lock-controls-to-controls-object/package.json deleted file mode 100644 index fa35e85b..00000000 --- a/codemods/three/r168/pointer-lock-controls-to-controls-object/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "three-js-pointer-lock-controls-to-controls-object", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "yugal41735" -} diff --git a/codemods/three/r168/pointer-lock-controls-to-controls-object/src/index.ts b/codemods/three/r168/pointer-lock-controls-to-controls-object/src/index.ts deleted file mode 100644 index 36cb6e4e..00000000 --- a/codemods/three/r168/pointer-lock-controls-to-controls-object/src/index.ts +++ /dev/null @@ -1,49 +0,0 @@ -export default function transform(file, api, options) { - const j = api.jscodeshift; - const root = j(file.source); - let dirtyFlag = false; - - // Find all CallExpressions - root.find(j.CallExpression).forEach((path) => { - const { callee } = path.node; - - // Check if the callee is a MemberExpression - if (j.MemberExpression.check(callee)) { - const { object, property } = callee; - - // Check if the object is another CallExpression - if (j.CallExpression.check(object)) { - const { callee: innerCallee } = object; - - // Check if the inner callee is a MemberExpression - if (j.MemberExpression.check(innerCallee)) { - const { object: innerObject, property: innerProperty } = innerCallee; - - // Check if the inner object is an Identifier named 'pointerLockControls' - if ( - j.Identifier.check(innerObject) && - innerObject.name === "pointerLockControls" - ) { - // Check if the inner property is an Identifier named 'getObject' - if ( - j.Identifier.check(innerProperty) && - innerProperty.name === "getObject" - ) { - // Replace 'pointerLockControls.getObject()' with 'controls.object' - path.node.callee = j.memberExpression( - j.memberExpression( - j.identifier("controls"), - j.identifier("object"), - ), - property, - ); - dirtyFlag = true; - } - } - } - } - } - }); - - return dirtyFlag ? root.toSource() : undefined; -} diff --git a/codemods/three/r168/pointer-lock-controls-to-controls-object/test/test.ts b/codemods/three/r168/pointer-lock-controls-to-controls-object/test/test.ts deleted file mode 100644 index 90ad0932..00000000 --- a/codemods/three/r168/pointer-lock-controls-to-controls-object/test/test.ts +++ /dev/null @@ -1,98 +0,0 @@ -import assert from "node:assert"; -import { readFile } from "node:fs/promises"; -import { join } from "node:path"; -import jscodeshift, { type API } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -const buildApi = (parser: string | undefined): API => ({ - j: parser ? jscodeshift.withParser(parser) : jscodeshift, - jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, - stats: () => { - console.error( - "The stats function was called, which is not supported on purpose", - ); - }, - report: () => { - console.error( - "The report function was called, which is not supported on purpose", - ); - }, -}); - -describe("three-js/pointer-lock-controls-to-controls-object", () => { - it("test #1", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); - - it("test #2", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture2.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture2.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); - - it("test #3", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture3.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture3.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); -}); diff --git a/codemods/three/r168/pointer-lock-controls-to-controls-object/tsconfig.json b/codemods/three/r168/pointer-lock-controls-to-controls-object/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/three/r168/pointer-lock-controls-to-controls-object/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/three/r168/replace-dragcontrols-getraycaster/cdmd_dist/index.cjs b/codemods/three/r168/replace-dragcontrols-getraycaster/cdmd_dist/index.cjs deleted file mode 100644 index 4e738824..00000000 --- a/codemods/three/r168/replace-dragcontrols-getraycaster/cdmd_dist/index.cjs +++ /dev/null @@ -1,53 +0,0 @@ -/*! @license -The MIT License (MIT) - -Copyright (c) 2024 yugal41735 - -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. - -*/ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function () { - return transform; - }, -}); -function transform(file, api, options) { - const j = api.jscodeshift; - const root = j(file.source); - let dirtyFlag = false; - root - .find(j.CallExpression, { - callee: { - object: { name: "dragcontrols" }, - property: { name: "getRaycaster" }, - }, - }) - .forEach((path) => { - j(path).replaceWith( - j.memberExpression(j.identifier("controls"), j.identifier("raycaster")), - ); - dirtyFlag = true; - }); - root - .find(j.MemberExpression, { - object: { type: "MemberExpression", property: { name: "dragcontrols" } }, - property: { name: "getRaycaster" }, - }) - .forEach((path) => { - j(path).replaceWith( - j.memberExpression( - j.memberExpression(path.node.object.object, j.identifier("controls")), - j.identifier("raycaster"), - ), - ); - dirtyFlag = true; - }); - return dirtyFlag ? root.toSource() : undefined; -} diff --git a/codemods/three/r168/replace-dragcontrols-getraycaster/package.json b/codemods/three/r168/replace-dragcontrols-getraycaster/package.json deleted file mode 100644 index 026efbb2..00000000 --- a/codemods/three/r168/replace-dragcontrols-getraycaster/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "threejs-replace-dragcontrols-getraycaster", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "yugal41735" -} diff --git a/codemods/three/r168/replace-dragcontrols-getraycaster/test/test.ts b/codemods/three/r168/replace-dragcontrols-getraycaster/test/test.ts deleted file mode 100644 index 0d395090..00000000 --- a/codemods/three/r168/replace-dragcontrols-getraycaster/test/test.ts +++ /dev/null @@ -1,98 +0,0 @@ -import assert from "node:assert"; -import { readFile } from "node:fs/promises"; -import { join } from "node:path"; -import jscodeshift, { type API } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -const buildApi = (parser: string | undefined): API => ({ - j: parser ? jscodeshift.withParser(parser) : jscodeshift, - jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, - stats: () => { - console.error( - "The stats function was called, which is not supported on purpose", - ); - }, - report: () => { - console.error( - "The report function was called, which is not supported on purpose", - ); - }, -}); - -describe("threejs/replace-dragcontrols-getraycaster", () => { - it("test #1", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); - - it("test #2", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture2.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture2.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); - - it("test #3", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture3.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture3.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); -}); diff --git a/codemods/three/r168/replace-dragcontrols-getraycaster/tsconfig.json b/codemods/three/r168/replace-dragcontrols-getraycaster/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/three/r168/replace-dragcontrols-getraycaster/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/cdmd_dist/index.cjs b/codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/cdmd_dist/index.cjs deleted file mode 100644 index 6000b344..00000000 --- a/codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/cdmd_dist/index.cjs +++ /dev/null @@ -1,42 +0,0 @@ -/*! @license -The MIT License (MIT) - -Copyright (c) 2024 yugal41735 - -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. - -*/ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function () { - return transform; - }, -}); -function transform(file, api, options) { - const j = api.jscodeshift; - const root = j(file.source); - let dirtyFlag = false; - root.find(j.Identifier, { name: "viewportBottomLeft" }).forEach((path) => { - const parent = path.parent.node; - if ( - j.AssignmentExpression.check(parent) || - j.VariableDeclarator.check(parent) || - j.CallExpression.check(parent) - ) { - j(path).replaceWith( - j.callExpression( - j.memberExpression(j.identifier("viewportUV"), j.identifier("flipY")), - [], - ), - ); - dirtyFlag = true; - } - }); - return dirtyFlag ? root.toSource() : undefined; -} diff --git a/codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/package.json b/codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/package.json deleted file mode 100644 index 112a04ca..00000000 --- a/codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "replace-viewport-bottom-left-with-viewportuv-flipy", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "yugal41735" -} diff --git a/codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/test/test.ts b/codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/test/test.ts deleted file mode 100644 index bf81079c..00000000 --- a/codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/test/test.ts +++ /dev/null @@ -1,73 +0,0 @@ -import assert from "node:assert"; -import { readFile } from "node:fs/promises"; -import { join } from "node:path"; -import jscodeshift, { type API } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -const buildApi = (parser: string | undefined): API => ({ - j: parser ? jscodeshift.withParser(parser) : jscodeshift, - jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, - stats: () => { - console.error( - "The stats function was called, which is not supported on purpose", - ); - }, - report: () => { - console.error( - "The report function was called, which is not supported on purpose", - ); - }, -}); - -describe("replace-viewport-bottom-left-with-viewportuv-flipy", () => { - it("test #1", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); - - it("test #2", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture2.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture2.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); -}); diff --git a/codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/tsconfig.json b/codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/three/r168/replace-viewport-top-left-with-viewport-uv/cdmd_dist/index.cjs b/codemods/three/r168/replace-viewport-top-left-with-viewport-uv/cdmd_dist/index.cjs deleted file mode 100644 index 840cb5fd..00000000 --- a/codemods/three/r168/replace-viewport-top-left-with-viewport-uv/cdmd_dist/index.cjs +++ /dev/null @@ -1,46 +0,0 @@ -/*! @license -The MIT License (MIT) - -Copyright (c) 2024 yugal41735 - -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. - -*/ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -Object.defineProperty(exports, "default", { - enumerable: true, - get: function () { - return transform; - }, -}); -function transform(file, api, options) { - const j = api.jscodeshift; - const root = j(file.source); - let dirtyFlag = false; - root.find(j.Identifier, { name: "viewportTopLeft" }).replaceWith((path) => { - dirtyFlag = true; - return j.identifier("viewportUV"); - }); - root.find(j.ImportDeclaration).forEach((path) => { - const specifiers = path.node.specifiers; - let importChanged = false; - specifiers.forEach((specifier) => { - if ( - j.ImportSpecifier.check(specifier) && - specifier.imported.name === "viewportTopLeft" - ) { - specifier.imported = j.identifier("viewportUV"); - importChanged = true; - } - }); - if (importChanged) { - dirtyFlag = true; - } - }); - return dirtyFlag ? root.toSource() : undefined; -} diff --git a/codemods/three/r168/replace-viewport-top-left-with-viewport-uv/package.json b/codemods/three/r168/replace-viewport-top-left-with-viewport-uv/package.json deleted file mode 100644 index 4769ae04..00000000 --- a/codemods/three/r168/replace-viewport-top-left-with-viewport-uv/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "replace-viewport-top-left-with-viewport-uv", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "yugal41735" -} diff --git a/codemods/three/r168/replace-viewport-top-left-with-viewport-uv/test/test.ts b/codemods/three/r168/replace-viewport-top-left-with-viewport-uv/test/test.ts deleted file mode 100644 index d799d31b..00000000 --- a/codemods/three/r168/replace-viewport-top-left-with-viewport-uv/test/test.ts +++ /dev/null @@ -1,73 +0,0 @@ -import assert from "node:assert"; -import { readFile } from "node:fs/promises"; -import { join } from "node:path"; -import jscodeshift, { type API } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -const buildApi = (parser: string | undefined): API => ({ - j: parser ? jscodeshift.withParser(parser) : jscodeshift, - jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, - stats: () => { - console.error( - "The stats function was called, which is not supported on purpose", - ); - }, - report: () => { - console.error( - "The report function was called, which is not supported on purpose", - ); - }, -}); - -describe("replace-viewport-top-left-with-viewport-uv", () => { - it("test #1", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); - - it("test #2", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture2.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture2.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); -}); diff --git a/codemods/three/r168/replace-viewport-top-left-with-viewport-uv/tsconfig.json b/codemods/three/r168/replace-viewport-top-left-with-viewport-uv/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/three/r168/replace-viewport-top-left-with-viewport-uv/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/three/r168/transform_logluvloader/cdmd_dist/index.cjs b/codemods/three/r168/transform_logluvloader/cdmd_dist/index.cjs deleted file mode 100644 index 9c459c5b..00000000 --- a/codemods/three/r168/transform_logluvloader/cdmd_dist/index.cjs +++ /dev/null @@ -1,77 +0,0 @@ -module.exports = function (fileInfo, api) { - const j = api.jscodeshift; - const root = j(fileInfo.source); - - // Replace import declarations - root.find(j.ImportDeclaration).forEach((path) => { - path.node.specifiers.forEach((specifier) => { - if (specifier.imported && specifier.imported.name === "LogLuvLoader") { - specifier.imported.name = "UltraHDRLoader"; - specifier.local.name = "UltraHDRLoader"; - } - }); - - // Also replace the source path if it contains LogLuvLoader - if (path.node.source.value.includes("LogLuvLoader")) { - path.node.source.value = path.node.source.value.replace( - "LogLuvLoader", - "UltraHDRLoader", - ); - } - }); - - // Replace export statements - root.find(j.ExportAllDeclaration).forEach((path) => { - if (path.node.source && path.node.source.value.includes("LogLuvLoader")) { - path.node.source.value = path.node.source.value.replace( - "LogLuvLoader", - "UltraHDRLoader", - ); - } - }); - - // Replace New Expressions (instantiation) - root - .find(j.NewExpression, { callee: { name: "LogLuvLoader" } }) - .forEach((path) => { - path.node.callee.name = "UltraHDRLoader"; - }); - - // Replace identifiers and any other usage - root.find(j.Identifier, { name: "LogLuvLoader" }).forEach((path) => { - path.node.name = "UltraHDRLoader"; - }); - - // Replace strings that contain 'LogLuvLoader' - root - .find(j.Literal) - .filter( - (path) => - typeof path.node.value === "string" && - path.node.value.includes("LogLuvLoader"), - ) - .forEach((path) => { - path.node.value = path.node.value.replace( - /LogLuvLoader/g, - "UltraHDRLoader", - ); - }); - - // Replace Template Literals that contain 'LogLuvLoader' - root.find(j.TemplateLiteral).forEach((path) => { - path.node.quasis.forEach((quasi) => { - if (quasi.value.raw.includes("LogLuvLoader")) { - quasi.value.raw = quasi.value.raw.replace( - /LogLuvLoader/g, - "UltraHDRLoader", - ); - quasi.value.cooked = quasi.value.cooked.replace( - /LogLuvLoader/g, - "UltraHDRLoader", - ); - } - }); - }); - - return root.toSource(); -}; diff --git a/codemods/three/r168/transform_logluvloader/package.json b/codemods/three/r168/transform_logluvloader/package.json deleted file mode 100644 index b50010c6..00000000 --- a/codemods/three/r168/transform_logluvloader/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "three-transform-logluvloader", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "yugal41735" -} diff --git a/codemods/three/r168/transform_logluvloader/src/index.ts b/codemods/three/r168/transform_logluvloader/src/index.ts deleted file mode 100644 index 3601b487..00000000 --- a/codemods/three/r168/transform_logluvloader/src/index.ts +++ /dev/null @@ -1,79 +0,0 @@ -import { API, FileInfo } from "jscodeshift"; - -export default function transformer(fileInfo: FileInfo, api: API) { - const j = api.jscodeshift; - const root = j(fileInfo.source); - - // Replace import declarations - root.find(j.ImportDeclaration).forEach((path) => { - path.node.specifiers.forEach((specifier) => { - if (specifier.imported && specifier.imported.name === "LogLuvLoader") { - specifier.imported.name = "UltraHDRLoader"; - specifier.local.name = "UltraHDRLoader"; - } - }); - - // Also replace the source path if it contains LogLuvLoader - if (path.node.source.value.includes("LogLuvLoader")) { - path.node.source.value = path.node.source.value.replace( - "LogLuvLoader", - "UltraHDRLoader", - ); - } - }); - - // Replace export statements - root.find(j.ExportAllDeclaration).forEach((path) => { - if (path.node.source && path.node.source.value.includes("LogLuvLoader")) { - path.node.source.value = path.node.source.value.replace( - "LogLuvLoader", - "UltraHDRLoader", - ); - } - }); - - // Replace New Expressions (instantiation) - root - .find(j.NewExpression, { callee: { name: "LogLuvLoader" } }) - .forEach((path) => { - path.node.callee.name = "UltraHDRLoader"; - }); - - // Replace identifiers and any other usage - root.find(j.Identifier, { name: "LogLuvLoader" }).forEach((path) => { - path.node.name = "UltraHDRLoader"; - }); - - // Replace strings that contain 'LogLuvLoader' - root - .find(j.Literal) - .filter( - (path) => - typeof path.node.value === "string" && - path.node.value.includes("LogLuvLoader"), - ) - .forEach((path) => { - path.node.value = path.node.value.replace( - /LogLuvLoader/g, - "UltraHDRLoader", - ); - }); - - // Replace Template Literals that contain 'LogLuvLoader' - root.find(j.TemplateLiteral).forEach((path) => { - path.node.quasis.forEach((quasi) => { - if (quasi.value.raw.includes("LogLuvLoader")) { - quasi.value.raw = quasi.value.raw.replace( - /LogLuvLoader/g, - "UltraHDRLoader", - ); - quasi.value.cooked = quasi.value.cooked.replace( - /LogLuvLoader/g, - "UltraHDRLoader", - ); - } - }); - }); - - return root.toSource(); -} diff --git a/codemods/three/r168/transform_logluvloader/test/test.ts b/codemods/three/r168/transform_logluvloader/test/test.ts deleted file mode 100644 index 2793385a..00000000 --- a/codemods/three/r168/transform_logluvloader/test/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -import assert from "node:assert"; -import { readFile } from "node:fs/promises"; -import { join } from "node:path"; -import jscodeshift, { type API } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -const buildApi = (parser: string | undefined): API => ({ - j: parser ? jscodeshift.withParser(parser) : jscodeshift, - jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, - stats: () => { - console.error( - "The stats function was called, which is not supported on purpose", - ); - }, - report: () => { - console.error( - "The report function was called, which is not supported on purpose", - ); - }, -}); - -describe("three_transform_logluvloader", () => { - it("test #1", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); -}); diff --git a/codemods/three/r168/transform_logluvloader/tsconfig.json b/codemods/three/r168/transform_logluvloader/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/three/r168/transform_logluvloader/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/three/r168/uniforms-to-uniformarray/LICENSE b/codemods/three/r168/uniforms-to-uniformarray/LICENSE deleted file mode 100644 index eead6d69..00000000 --- a/codemods/three/r168/uniforms-to-uniformarray/LICENSE +++ /dev/null @@ -1,9 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2024 yugal41735 - -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/codemods/three/r168/uniforms-to-uniformarray/cdmd_dist/index.cjs b/codemods/three/r168/uniforms-to-uniformarray/cdmd_dist/index.cjs deleted file mode 100644 index cd130ee2..00000000 --- a/codemods/three/r168/uniforms-to-uniformarray/cdmd_dist/index.cjs +++ /dev/null @@ -1,21 +0,0 @@ -module.exports = function (fileInfo, api) { - const j = api.jscodeshift; - const root = j(fileInfo.source); - - // Find all CallExpressions where .uniforms() is called - root - .find(j.CallExpression, { - callee: { - type: "MemberExpression", - property: { - name: "uniforms", - }, - }, - }) - .forEach((path) => { - // Replace 'uniforms' with 'uniformArray' - path.node.callee.property.name = "uniformArray"; - }); - - return root.toSource(); -}; diff --git a/codemods/three/r168/uniforms-to-uniformarray/package.json b/codemods/three/r168/uniforms-to-uniformarray/package.json deleted file mode 100644 index 72ad5cba..00000000 --- a/codemods/three/r168/uniforms-to-uniformarray/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "three-r168-uniforms-to-uniformarray", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "yugal41735" -} diff --git a/codemods/three/r168/uniforms-to-uniformarray/src/index.ts b/codemods/three/r168/uniforms-to-uniformarray/src/index.ts deleted file mode 100644 index 4f3506a1..00000000 --- a/codemods/three/r168/uniforms-to-uniformarray/src/index.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { API, FileInfo } from "jscodeshift"; - -export default function transformer(fileInfo: FileInfo, api: API) { - const j = api.jscodeshift; - const root = j(fileInfo.source); - - // Find all CallExpressions where .uniforms() is called - root - .find(j.CallExpression, { - callee: { - type: "MemberExpression", - property: { - name: "uniforms", - }, - }, - }) - .forEach((path) => { - // Replace 'uniforms' with 'uniformArray' - path.node.callee.property.name = "uniformArray"; - }); - - return root.toSource(); -} diff --git a/codemods/three/r168/uniforms-to-uniformarray/test/test.ts b/codemods/three/r168/uniforms-to-uniformarray/test/test.ts deleted file mode 100644 index df399bc0..00000000 --- a/codemods/three/r168/uniforms-to-uniformarray/test/test.ts +++ /dev/null @@ -1,48 +0,0 @@ -import assert from "node:assert"; -import { readFile } from "node:fs/promises"; -import { join } from "node:path"; -import jscodeshift, { type API } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -const buildApi = (parser: string | undefined): API => ({ - j: parser ? jscodeshift.withParser(parser) : jscodeshift, - jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, - stats: () => { - console.error( - "The stats function was called, which is not supported on purpose", - ); - }, - report: () => { - console.error( - "The report function was called, which is not supported on purpose", - ); - }, -}); - -describe("three/r168/uniforms-to-uniformarray", () => { - it("test #1", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); -}); diff --git a/codemods/three/r168/uniforms-to-uniformarray/tsconfig.json b/codemods/three/r168/uniforms-to-uniformarray/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/three/r168/uniforms-to-uniformarray/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/typescript/remove-public-modifier/package.json b/codemods/typescript/remove-public-modifier/package.json deleted file mode 100644 index f1c52fe1..00000000 --- a/codemods/typescript/remove-public-modifier/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "@codemod-com/typescript-remove-public-modifier", - "dependencies": {}, - "devDependencies": { - "@codemod-com/tsconfig": "workspace:*", - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/typescript/remove-public-modifier/test/test.ts b/codemods/typescript/remove-public-modifier/test/test.ts deleted file mode 100644 index d85a4e27..00000000 --- a/codemods/typescript/remove-public-modifier/test/test.ts +++ /dev/null @@ -1,137 +0,0 @@ -import assert from "node:assert"; -import { buildApi } from "@codemod-com/utilities"; -import type { FileInfo } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -describe("remove-public-modifier", () => { - it("basic", () => { - const INPUT = ` - class MyClass { - public myProperty: string; - - public constructor() { - } - - public myMethod(): void { - } - } - `; - - const OUTPUT = ` - class MyClass { - myProperty: string; - - constructor() { - } - - myMethod(): void { - } - } - `; - const fileInfo: FileInfo = { - path: "index.ts", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx")); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); - - it("no public modifier", () => { - const INPUT = ` - class MyClass { - myMethod(): void { - } - - myProperty: string = 'value'; - } - `; - - const OUTPUT = ` - class MyClass { - myMethod(): void { - } - - myProperty: string = 'value'; - } - `; - const fileInfo: FileInfo = { - path: "index.ts", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx")); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); - - it("class with other modifiers (private, protected, static, readonly)", () => { - const INPUT = ` - class MyClass { - public static readonly myProperty: string = 'value'; - private secondProperty: string = 'value'; - protected thirdProperty: string = 'value'; - } - `; - - const OUTPUT = ` - class MyClass { - static readonly myProperty: string = 'value'; - private secondProperty: string = 'value'; - protected thirdProperty: string = 'value'; - } - `; - const fileInfo: FileInfo = { - path: "index.ts", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx")); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); - - it("multiple classes in the same file", () => { - const INPUT = ` - class Class1 { - public method1(): void {} - } - - class Class2 { - public method2(): void {} - } - `; - - const OUTPUT = ` - class Class1 { - method1(): void {} - } - - class Class2 { - method2(): void {} - } - `; - const fileInfo: FileInfo = { - path: "index.ts", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx")); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); -}); diff --git a/codemods/typescript/use-template-literals/package.json b/codemods/typescript/use-template-literals/package.json deleted file mode 100644 index 71ee04ed..00000000 --- a/codemods/typescript/use-template-literals/package.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "name": "@codemod-com/typescript-use-template-literals", - "dependencies": {}, - "devDependencies": { - "@codemod-com/tsconfig": "workspace:*", - "@codemod-com/utilities": "workspace:*", - "typescript": "^5.2.2", - "ts-node": "^10.9.1", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - }, - "private": true, - "main": "./dist/index.cjs", - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/typescript/use-template-literals/test/test.ts b/codemods/typescript/use-template-literals/test/test.ts deleted file mode 100644 index 2e586296..00000000 --- a/codemods/typescript/use-template-literals/test/test.ts +++ /dev/null @@ -1,238 +0,0 @@ -import assert from "node:assert"; -import { buildApi } from "@codemod-com/utilities"; -import type { FileInfo } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -describe("use-template-literals", () => { - describe("variables declared with let", () => { - it("one variable", () => { - const INPUT = ` - let name = 'John'; - let greeting = 'Hello, ' + name + '!'; - `; - - const OUTPUT = ` - let name = 'John'; - let greeting = \`Hello, \${name}!\`; - `; - const fileInfo: FileInfo = { - path: "index.ts", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx")); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); - - it("two variables", () => { - const INPUT = ` - let name = 'John'; - let age = 12; - let greeting = name + 'is ' + age + ' years old!'; - `; - - const OUTPUT = ` - let name = 'John'; - let age = 12; - let greeting = \`\${name} is \${age} years old!\`; - `; - const fileInfo: FileInfo = { - path: "index.ts", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx")); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); - - it("three variables", () => { - const INPUT = ` - let name = 'John'; - let age = 12; - let gender = 'male'; - let greeting = name + age + gender; - `; - - const OUTPUT = ` - let name = 'John'; - let age = 12; - let gender = 'male'; - let greeting = \`\${name}\${age}\${gender}\`; - `; - const fileInfo: FileInfo = { - path: "index.ts", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx")); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); - }); - - describe("variables declared with var", () => { - it("one variable", () => { - const INPUT = ` - var name = 'John'; - var greeting = 'Hello, ' + name + '!'; - `; - - const OUTPUT = ` - var name = 'John'; - var greeting = \`Hello, \${name}!\`; - `; - const fileInfo: FileInfo = { - path: "index.ts", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx")); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); - - it("two variables", () => { - const INPUT = ` - var name = 'John'; - var age = 12; - var greeting = name + 'is ' + age + ' years old!'; - `; - - const OUTPUT = ` - var name = 'John'; - var age = 12; - var greeting = \`\${name} is \${age} years old!\`; - `; - const fileInfo: FileInfo = { - path: "index.ts", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx")); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); - - it("three variables", () => { - const INPUT = ` - var name = 'John'; - var age = 12; - var gender = 'male'; - var greeting = name + age + gender; - `; - - const OUTPUT = ` - var name = 'John'; - var age = 12; - var gender = 'male'; - var greeting = \`\${name}\${age}\${gender}\`; - `; - const fileInfo: FileInfo = { - path: "index.ts", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx")); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); - }); - - describe("variables declared with const", () => { - it("one variable", () => { - const INPUT = ` - const name = 'John'; - const greeting = 'Hello, ' + name + '!'; - `; - - const OUTPUT = ` - const name = 'John'; - const greeting = \`Hello, \${name}!\`; - `; - const fileInfo: FileInfo = { - path: "index.ts", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx")); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); - - it("two variables", () => { - const INPUT = ` - const name = 'John'; - const age = 12; - const greeting = name + 'is ' + age + ' years old!'; - `; - - const OUTPUT = ` - const name = 'John'; - const age = 12; - const greeting = \`\${name} is \${age} years old!\`; - `; - const fileInfo: FileInfo = { - path: "index.ts", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx")); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); - - it("three variables", () => { - const INPUT = ` - const name = 'John'; - const age = 12; - const gender = 'male'; - const greeting = name + age + gender; - `; - - const OUTPUT = ` - const name = 'John'; - const age = 12; - const gender = 'male'; - const greeting = \`\${name}\${age}\${gender}\`; - `; - const fileInfo: FileInfo = { - path: "index.ts", - source: INPUT, - }; - - const actualOutput = transform(fileInfo, buildApi("tsx")); - - assert.deepEqual( - actualOutput?.replace(/\W/gm, ""), - OUTPUT.replace(/\W/gm, ""), - ); - }); - }); -}); diff --git a/codemods/vue/3/render-function-api/package.json b/codemods/vue/3/render-function-api/package.json deleted file mode 100644 index d441adda..00000000 --- a/codemods/vue/3/render-function-api/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "@codemod-com/vue-render-function-api", - "version": "1.0.0", - "dependencies": {}, - "devDependencies": { - "@types/node": "^20.12.3", - "@types/jscodeshift": "^0.11.10", - "jscodeshift": "^0.15.1", - "typescript": "^5.2.2", - "vitest": "^1.0.1" - }, - "private": true, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "./README.md", - "./.codemodrc.json", - "./dist/index.cjs" - ], - "type": "module" -} diff --git a/codemods/vue/3/render-function-api/test/test.ts b/codemods/vue/3/render-function-api/test/test.ts deleted file mode 100644 index db47d21a..00000000 --- a/codemods/vue/3/render-function-api/test/test.ts +++ /dev/null @@ -1,47 +0,0 @@ -import assert from "node:assert"; -import { readFile } from "node:fs/promises"; -import { join } from "node:path"; -import jscodeshift, { type API } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -const buildApi = (parser: string | undefined): API => ({ - j: parser ? jscodeshift.withParser(parser) : jscodeshift, - jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, - stats: () => { - console.error( - "The stats function was called, which is not supported on purpose", - ); - }, - report: () => { - console.error( - "The report function was called, which is not supported on purpose", - ); - }, -}); - -describe("codemod", () => { - it("test #1", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); -}); diff --git a/codemods/vue/3/render-function-api/tsconfig.json b/codemods/vue/3/render-function-api/tsconfig.json deleted file mode 100644 index 329a7d63..00000000 --- a/codemods/vue/3/render-function-api/tsconfig.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": "@codemod-com/tsconfig/codemod.json", - "compilerOptions": { - "baseUrl": ".", - "outDir": "./dist" - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/webpack/v5/json-imports-to-default-imports/package.json b/codemods/webpack/v5/json-imports-to-default-imports/package.json deleted file mode 100644 index 517dcd8d..00000000 --- a/codemods/webpack/v5/json-imports-to-default-imports/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "json-imports-to-default-imports", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "akash-kumar-dev" -} diff --git a/codemods/webpack/v5/json-imports-to-default-imports/test/test.ts b/codemods/webpack/v5/json-imports-to-default-imports/test/test.ts deleted file mode 100644 index 2493f438..00000000 --- a/codemods/webpack/v5/json-imports-to-default-imports/test/test.ts +++ /dev/null @@ -1,132 +0,0 @@ -import assert from "node:assert"; -import { readFile } from "node:fs/promises"; -import { join } from "node:path"; -import jscodeshift, { type API } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -const buildApi = (parser: string | undefined): API => ({ - j: parser ? jscodeshift.withParser(parser) : jscodeshift, - jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, - stats: () => { - console.error( - "The stats function was called, which is not supported on purpose", - ); - }, - report: () => { - console.error( - "The report function was called, which is not supported on purpose", - ); - }, -}); - -describe("json-imports-to-default-imports", () => { - /** - * Test Case 1: Basic Named Import Transformation - * This test validates that named imports from JSON files - */ - it("test #1 - Basic Named Import Transformation", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); - - it("test #2 - Basic Named Import Transformation", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture2.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture2.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); - - /** - * Test Case 3: Nested References Transformation - * This test validates that named imports with nested references - */ - it("test #3 - Nested References Transformation", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture3.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture3.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); - - // Test Case 4: Multiple Named Imports - it("test #4 - Multiple Named Imports", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture4.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture4.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); -}); diff --git a/codemods/webpack/v5/json-imports-to-default-imports/tsconfig.json b/codemods/webpack/v5/json-imports-to-default-imports/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/webpack/v5/json-imports-to-default-imports/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/webpack/v5/migrate-library-target-to-library-object/package.json b/codemods/webpack/v5/migrate-library-target-to-library-object/package.json deleted file mode 100644 index 912979bf..00000000 --- a/codemods/webpack/v5/migrate-library-target-to-library-object/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "migrate-library-target-to-library-object", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "akash-kumar-dev" -} diff --git a/codemods/webpack/v5/migrate-library-target-to-library-object/test/test.ts b/codemods/webpack/v5/migrate-library-target-to-library-object/test/test.ts deleted file mode 100644 index 0f0d15e0..00000000 --- a/codemods/webpack/v5/migrate-library-target-to-library-object/test/test.ts +++ /dev/null @@ -1,123 +0,0 @@ -import assert from "node:assert"; -import { readFile } from "node:fs/promises"; -import { join } from "node:path"; -import jscodeshift, { type API } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -const buildApi = (parser: string | undefined): API => ({ - j: parser ? jscodeshift.withParser(parser) : jscodeshift, - jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, - stats: () => { - console.error( - "The stats function was called, which is not supported on purpose", - ); - }, - report: () => { - console.error( - "The report function was called, which is not supported on purpose", - ); - }, -}); - -describe("webpack/1/migrate-library-target-to-library-object", () => { - it("test #1", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/\s/gm, ""), - OUTPUT.replace(/\s/gm, ""), - ); - }); - - it("test #2", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture2.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture2.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); - - it("test #3", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture3.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture3.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); - - it("test #4", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture4.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture4.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); -}); diff --git a/codemods/webpack/v5/migrate-library-target-to-library-object/tsconfig.json b/codemods/webpack/v5/migrate-library-target-to-library-object/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/webpack/v5/migrate-library-target-to-library-object/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/codemods/webpack/v5/set-target-to-false-and-update-plugins/.gitignore b/codemods/webpack/v5/set-target-to-false-and-update-plugins/.gitignore deleted file mode 100644 index 76add878..00000000 --- a/codemods/webpack/v5/set-target-to-false-and-update-plugins/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -dist \ No newline at end of file diff --git a/codemods/webpack/v5/set-target-to-false-and-update-plugins/package.json b/codemods/webpack/v5/set-target-to-false-and-update-plugins/package.json deleted file mode 100644 index 5c404841..00000000 --- a/codemods/webpack/v5/set-target-to-false-and-update-plugins/package.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "name": "set-target-to-false-and-update-plugins", - "license": "MIT", - "devDependencies": { - "@types/node": "20.9.0", - "typescript": "^5.2.2", - "vitest": "^1.0.1", - "@codemod.com/codemod-utils": "*", - "jscodeshift": "^0.15.1", - "@types/jscodeshift": "^0.11.10" - }, - "scripts": { - "test": "vitest run", - "test:watch": "vitest watch" - }, - "files": [ - "README.md", - ".codemodrc.json", - "/dist/index.cjs" - ], - "type": "module", - "author": "akash-kumar-dev" -} diff --git a/codemods/webpack/v5/set-target-to-false-and-update-plugins/test/test.ts b/codemods/webpack/v5/set-target-to-false-and-update-plugins/test/test.ts deleted file mode 100644 index 0af3e3d9..00000000 --- a/codemods/webpack/v5/set-target-to-false-and-update-plugins/test/test.ts +++ /dev/null @@ -1,123 +0,0 @@ -import assert from "node:assert"; -import { readFile } from "node:fs/promises"; -import { join } from "node:path"; -import jscodeshift, { type API } from "jscodeshift"; -import { describe, it } from "vitest"; -import transform from "../src/index.js"; - -const buildApi = (parser: string | undefined): API => ({ - j: parser ? jscodeshift.withParser(parser) : jscodeshift, - jscodeshift: parser ? jscodeshift.withParser(parser) : jscodeshift, - stats: () => { - console.error( - "The stats function was called, which is not supported on purpose", - ); - }, - report: () => { - console.error( - "The report function was called, which is not supported on purpose", - ); - }, -}); - -describe("common-js/export-target-to-plugin-conversion", () => { - it("test #1", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture1.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); - - it("test #2", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture2.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture2.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); - - it("test #3", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture3.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture3.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); - - it("test #4", async () => { - const INPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture4.input.ts"), - "utf-8", - ); - const OUTPUT = await readFile( - join(__dirname, "..", "__testfixtures__/fixture4.output.ts"), - "utf-8", - ); - - const actualOutput = transform( - { - path: "index.js", - source: INPUT, - }, - buildApi("tsx"), - {}, - ); - - assert.deepEqual( - actualOutput?.replace(/W/gm, ""), - OUTPUT.replace(/W/gm, ""), - ); - }); -}); diff --git a/codemods/webpack/v5/set-target-to-false-and-update-plugins/tsconfig.json b/codemods/webpack/v5/set-target-to-false-and-update-plugins/tsconfig.json deleted file mode 100644 index e63ca9bd..00000000 --- a/codemods/webpack/v5/set-target-to-false-and-update-plugins/tsconfig.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/package.json b/package.json index ced536a0..ff55f736 100644 --- a/package.json +++ b/package.json @@ -4,33 +4,26 @@ "description": "Codemods, public or private, are preferred to reside in repositories owned by the main organization of their respective projects. This repository serves as a catch-all for some codemod sources that still have not found thier way to their ideal home or for Codemod-compatible forks of existing codemods for easier publishing. Please [chat with us](https://go.codemod.com/community) before making any major contribution.", "main": "index.js", "devDependencies": { - "@biomejs/biome": "^1.6.4", - "@codemod-com/tsconfig": "workspace:*", - "@codemod-com/utilities": "workspace:*", - "turbo": "^1.10.14", - "vitest": "^1.0.1", - "husky": "^9.1.7", - "lint-staged": "^15.2.11" + "@biomejs/biome": "^2.2.2" }, "scripts": { - "build": "turbo run build", - "clean": "turbo run clean", - "prepare": "husky && husky install" + "build:legacy": "pnpm --filter './tooling-legacy/**' build", + "test:legacy": "pnpm --filter './tooling-legacy/**' --filter './codemods-legacy/**' test", + "lint": "biome lint ./", + "pre-commit": "biome check ./ --write" }, "repository": { "type": "git", "url": "git+https://github.com/codemod-com/commons.git" }, - "keywords": ["codemod", "migration"], + "keywords": [ + "codemod", + "migration" + ], "author": "Codemod, Inc.", "license": "ISC", "bugs": { "url": "https://github.com/codemod-com/commons/issues" }, - "homepage": "https://github.com/codemod-com/commons#readme", - "lint-staged": { - "*": [ - "biome check --write --no-errors-on-unmatched --files-ignore-unknown=true --diagnostic-level=error" - ] - } + "homepage": "https://github.com/codemod-com/commons#readme" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6a476adf..25fa00a8 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,96 +6,9 @@ settings: catalogs: default: - '@ast-grep/cli': - specifier: ^0.25.4 - version: 0.25.7 - '@ast-grep/napi': - specifier: ^0.25.4 - version: 0.25.7 - '@biomejs/biome': - specifier: 1.5.3 - version: 1.5.3 - '@octokit/rest': - specifier: ^20.0.2 - version: 20.1.1 - '@sindresorhus/slugify': - specifier: ^2.2.1 - version: 2.2.1 - '@types/adm-zip': - specifier: ^0.5.5 - version: 0.5.7 - '@types/diff': - specifier: ^5.0.3 - version: 5.2.3 - '@types/inquirer': - specifier: ^9.0.7 - version: 9.0.7 - '@types/js-beautify': - specifier: ^1.14.3 - version: 1.14.3 - '@types/lodash-es': - specifier: ^4.17.4 - version: 4.17.12 - '@types/ms': - specifier: ^0.7.34 - version: 0.7.34 - '@types/pako': - specifier: ^2.0.0 - version: 2.0.3 - '@types/tar': - specifier: ^6.1.11 - version: 6.1.13 - '@types/tar-stream': - specifier: ^3.1.3 - version: 3.1.3 - '@types/unzipper': - specifier: ^0.10.9 - version: 0.10.10 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0 - adm-zip: - specifier: ^0.5.14 - version: 0.5.16 - change-case: - specifier: ^5.2.0 - version: 5.4.4 - colors-cli: - specifier: ^1.0.33 - version: 1.0.33 - detect-indent: - specifier: ^7.0.1 - version: 7.0.1 - detect-newline: - specifier: ^4.0.1 - version: 4.0.1 - diff: - specifier: ^5.1.0 - version: 5.2.0 - filenamify: - specifier: ^6.0.0 - version: 6.0.0 - git-url-parse: - specifier: ^14.0.0 - version: 14.1.0 glob: specifier: ^10.4.5 version: 10.4.5 - inquirer: - specifier: ^9.2.16 - version: 9.3.7 - js-beautify: - specifier: ^1.14.11 - version: 1.15.1 - json-schema-to-typescript: - specifier: ^13.1.2 - version: 13.1.2 - lodash-es: - specifier: ^4.17.21 - version: 4.17.21 - magic-string: - specifier: ^0.30.10 - version: 0.30.17 mdast-util-from-markdown: specifier: ^2.0.0 version: 2.0.2 @@ -108,149 +21,98 @@ catalogs: micromark-extension-mdxjs: specifier: ^2.0.0 version: 2.0.0 - ms: - specifier: ^2.1.3 - version: 2.1.3 - openai: - specifier: 4.23.0 - version: 4.23.0 - pako: - specifier: ^2.1.0 - version: 2.1.0 - simple-git: - specifier: ^3.24.0 - version: 3.27.0 - sinon: - specifier: ^15.0.1 - version: 15.2.0 - tar-stream: - specifier: ^3.1.7 - version: 3.1.7 - tree-kill: - specifier: ^1.2.2 - version: 1.2.2 - ts-invariant: - specifier: ^0.10.3 - version: 0.10.3 - unist-util-filter: - specifier: ^5.0.1 - version: 5.0.1 unist-util-visit: specifier: ^5.0.0 version: 5.0.0 - unzipper: - specifier: ^0.11.6 - version: 0.11.6 valibot: specifier: ^0.34.0 version: 0.34.0 - yaml: - specifier: ^2.4.5 - version: 2.7.0 importers: .: devDependencies: '@biomejs/biome': - specifier: ^1.6.4 - version: 1.9.4 - '@codemod-com/tsconfig': - specifier: workspace:* - version: link:tooling/tsconfig - '@codemod-com/utilities': - specifier: workspace:* - version: link:tooling/utilities - husky: - specifier: ^9.1.7 - version: 9.1.7 - lint-staged: - specifier: ^15.2.11 - version: 15.5.2 - turbo: - specifier: ^1.10.14 - version: 1.13.4 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + specifier: ^2.2.2 + version: 2.2.2 - codemods/Feature Flags/remove-unused-feature-flags: + codemods-legacy/Feature Flags/remove-unused-feature-flags: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../tooling/utilities + version: link:../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + '@types/node': + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/Go/remove-unnecessary-nested-block: {} + codemods-legacy/Go/remove-unnecessary-nested-block: {} - codemods/Java/delete-unused-fields: {} + codemods-legacy/Java/delete-unused-fields: {} - codemods/antd/5/props-changed-migration: + codemods-legacy/antd/5/props-changed-migration: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - codemods/antd/5/remove-style-import: + codemods-legacy/antd/5/remove-style-import: dependencies: '@codemod-com/antd5-utils': specifier: workspace:* version: link:../utils devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - codemods/antd/5/removed-component-migration: + codemods-legacy/antd/5/removed-component-migration: dependencies: '@codemod-com/antd5-utils': specifier: workspace:* version: link:../utils devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 @@ -261,15 +123,18 @@ importers: specifier: ^5.2.2 version: 5.7.3 - codemods/antd/5/removed-static-method-migration: + codemods-legacy/antd/5/removed-static-method-migration: dependencies: '@codemod-com/antd5-utils': specifier: workspace:* version: link:../utils devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 @@ -280,17 +145,20 @@ importers: specifier: ^5.2.2 version: 5.7.3 - codemods/antd/5/utils: + codemods-legacy/antd/5/utils: devDependencies: jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - codemods/axios/fetch: + codemods-legacy/axios/fetch: devDependencies: - '@codemod.com/workflow': + '@codemod-com/tsconfig': specifier: workspace:* - version: link:../../../tooling/workflow + version: link:../../../tooling-legacy/tsconfig + '@codemod.com/workflow': + specifier: 0.0.31 + version: 0.0.31(@babel/preset-env@7.26.7(@babel/core@7.26.7)) '@types/node': specifier: 20.9.0 version: 20.9.0 @@ -301,31 +169,25 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/bull/bullmq: + codemods-legacy/bull/bullmq: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../tooling/utilities + version: link:../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/cal.com/app-directory-boilerplate-calcom: + codemods-legacy/cal.com/app-directory-boilerplate-calcom: dependencies: mdast-util-from-markdown: specifier: 'catalog:' @@ -345,16 +207,19 @@ importers: devDependencies: '@codemod-com/filemod': specifier: workspace:* - version: link:../../../tooling/filemod + version: link:../../../tooling-legacy/filemod + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../tooling/utilities + version: link:../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + '@types/node': + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) @@ -364,30 +229,27 @@ importers: ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/cal.com/generate-metadata-tests-calcom: + codemods-legacy/cal.com/generate-metadata-tests-calcom: devDependencies: '@codemod-com/filemod': specifier: workspace:* - version: link:../../../tooling/filemod + version: link:../../../tooling-legacy/filemod + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../tooling/utilities + version: link:../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + '@types/node': + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) @@ -397,30 +259,27 @@ importers: ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/cal.com/generate-url-patterns: + codemods-legacy/cal.com/generate-url-patterns: devDependencies: '@codemod-com/filemod': specifier: workspace:* - version: link:../../../tooling/filemod + version: link:../../../tooling-legacy/filemod + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../tooling/utilities + version: link:../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + '@types/node': + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) @@ -430,30 +289,24 @@ importers: ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/codemod-com/migrate-codemod-registry: + codemods-legacy/codemod-com/migrate-codemod-registry: devDependencies: '@codemod-com/filemod': specifier: workspace:* - version: link:../../../tooling/filemod + version: link:../../../tooling-legacy/filemod + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../tooling/utilities + version: link:../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) @@ -463,36 +316,33 @@ importers: ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/devcycle/launchdarkly-to-devcycle: + codemods-legacy/devcycle/launchdarkly-to-devcycle: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 '@types/node': - specifier: 20.9.0 - version: 20.9.0 + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) typescript: specifier: 5.2.2 version: 5.2.2 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.9.0) - codemods/devcycle/replace-feature-flag: + codemods-legacy/devcycle/replace-feature-flag: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../tooling-legacy/tsconfig '@types/node': specifier: 20.9.0 version: 20.9.0 @@ -506,437 +356,377 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/ember/5/app-controller-router-props: + codemods-legacy/ember/5/app-controller-router-props: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/ember/5/array-wrapper: + codemods-legacy/ember/5/array-wrapper: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/ember/5/convert-module-for-to-setup-test: + codemods-legacy/ember/5/convert-module-for-to-setup-test: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/ember/5/cp-property: + codemods-legacy/ember/5/cp-property: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/ember/5/cp-property-map: + codemods-legacy/ember/5/cp-property-map: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/ember/5/cp-volatile: + codemods-legacy/ember/5/cp-volatile: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/ember/5/deprecate-merge: + codemods-legacy/ember/5/deprecate-merge: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/ember/5/deprecate-router-events: + codemods-legacy/ember/5/deprecate-router-events: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/ember/5/ember-jquery-legacy: + codemods-legacy/ember/5/ember-jquery-legacy: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/ember/5/es5-getter-ember-codemod: + codemods-legacy/ember/5/es5-getter-ember-codemod: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/ember/5/fpe-computed: + codemods-legacy/ember/5/fpe-computed: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/ember/5/fpe-observes: + codemods-legacy/ember/5/fpe-observes: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/ember/5/fpe-on: + codemods-legacy/ember/5/fpe-on: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/ember/5/jquery-apis: + codemods-legacy/ember/5/jquery-apis: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/ember/5/jquery-event: + codemods-legacy/ember/5/jquery-event: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/ember/5/notify-property-change: + codemods-legacy/ember/5/notify-property-change: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/ember/5/object-new-constructor: + codemods-legacy/ember/5/object-new-constructor: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/eslint/biome/migrate-rules: + codemods-legacy/eslint/biome/migrate-rules: devDependencies: - '@biomejs/biome': - specifier: 'catalog:' - version: 1.5.3 '@codemod-com/filemod': specifier: workspace:* - version: link:../../../../tooling/filemod + version: link:../../../../tooling-legacy/filemod + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) - json-schema-to-typescript: - specifier: 'catalog:' - version: 13.1.2 + version: link:../../../../tooling-legacy/utilities memfs: specifier: ^4.6.0 version: 4.17.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 @@ -945,10 +735,13 @@ importers: version: 0.34.0 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/ethers/v6/big-numbers: + codemods-legacy/ethers/v6/big-numbers: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': specifier: '*' version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) @@ -968,11 +761,14 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/ethers/v6/contracts-ambiguous-methods: + codemods-legacy/ethers/v6/contracts-ambiguous-methods: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 @@ -989,11 +785,14 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/ethers/v6/contracts-other-methods: + codemods-legacy/ethers/v6/contracts-other-methods: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 @@ -1010,11 +809,14 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/ethers/v6/importing: + codemods-legacy/ethers/v6/importing: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 @@ -1031,13 +833,16 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/ethers/v6/migration-recipe: {} + codemods-legacy/ethers/v6/migration-recipe: {} - codemods/ethers/v6/providers: + codemods-legacy/ethers/v6/providers: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 @@ -1054,11 +859,14 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/ethers/v6/singatures: + codemods-legacy/ethers/v6/singatures: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 @@ -1075,11 +883,14 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/ethers/v6/transactions: + codemods-legacy/ethers/v6/transactions: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 @@ -1096,11 +907,14 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/ethers/v6/utilities: + codemods-legacy/ethers/v6/utilities: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 @@ -1117,116 +931,107 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/history/4/replace-state-object: + codemods-legacy/history/4/replace-state-object: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + '@types/node': + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/history/4/use-back: + codemods-legacy/history/4/use-back: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + '@types/node': + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/history/4/use-block: + codemods-legacy/history/4/use-block: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + '@types/node': + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/history/4/use-location: + codemods-legacy/history/4/use-location: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + '@types/node': + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/i18n: + codemods-legacy/i18n: devDependencies: '@codemod-com/filemod': specifier: workspace:* - version: link:../../tooling/filemod + version: link:../../tooling-legacy/filemod + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../tooling/utilities + version: link:../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + '@types/node': + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) @@ -1236,401 +1041,320 @@ importers: ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/immutable/0/add-deprecation-comment: + codemods-legacy/immutable/0/add-deprecation-comment: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/immutable/0/nest-from-js: + codemods-legacy/immutable/0/nest-from-js: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/immutable/0/remove-from-js: + codemods-legacy/immutable/0/remove-from-js: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/immutable/0/remove-import: + codemods-legacy/immutable/0/remove-import: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/immutable/0/remove-to-js: + codemods-legacy/immutable/0/remove-to-js: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/immutable/0/replace-get: + codemods-legacy/immutable/0/replace-get: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/immutable/0/replace-get-in: + codemods-legacy/immutable/0/replace-get-in: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/immutable/0/replace-merge: + codemods-legacy/immutable/0/replace-merge: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/immutable/0/replace-set: + codemods-legacy/immutable/0/replace-set: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/immutable/0/replace-set-in: + codemods-legacy/immutable/0/replace-set-in: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/immutable/4/isterable-to-iscollection: + codemods-legacy/immutable/4/isterable-to-iscollection: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/immutable/4/map-to-array: + codemods-legacy/immutable/4/map-to-array: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/immutable/4/rename-to-seq: + codemods-legacy/immutable/4/rename-to-seq: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/jasmine/5.0/handling_env-execute: + codemods-legacy/jasmine/5.0/handling_env-execute: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 '@types/node': - specifier: 20.9.0 - version: 20.9.0 + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.9.0) - codemods/jasmine/5.0/jasmine_migration_recipe: {} + codemods-legacy/jasmine/5.0/jasmine_migration_recipe: {} - codemods/jasmine/5.0/node-boot-removal: + codemods-legacy/jasmine/5.0/node-boot-removal: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 '@types/node': - specifier: 20.9.0 - version: 20.9.0 + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.9.0) - codemods/jest/vitest: + codemods-legacy/jest/vitest: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../tooling/utilities + version: link:../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/meteor/v3/fibers-to-async-promises: + codemods-legacy/meteor/v3/fibers-to-async-promises: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 @@ -1647,11 +1371,14 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/meteor/v3/meteor-renamed functions: + codemods-legacy/meteor/v3/meteor-renamed functions: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 @@ -1668,11 +1395,14 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/meteor/v3/mongoDb-async-methods: + codemods-legacy/meteor/v3/mongoDb-async-methods: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 @@ -1689,11 +1419,14 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/meteor/v3/removedFunctions: + codemods-legacy/meteor/v3/removedFunctions: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 @@ -1710,11 +1443,14 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/meteor/v3/webapp-handler-renaming: + codemods-legacy/meteor/v3/webapp-handler-renaming: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 @@ -1731,7 +1467,7 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/mocha/vitest/migrate-configuration: + codemods-legacy/mocha/vitest/migrate-configuration: dependencies: valibot: specifier: 'catalog:' @@ -1739,619 +1475,499 @@ importers: devDependencies: '@codemod-com/filemod': specifier: workspace:* - version: link:../../../../tooling/filemod + version: link:../../../../tooling-legacy/filemod + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) memfs: specifier: ^4.6.0 version: 4.17.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/mocha/vitest/migrate-tests: + codemods-legacy/mocha/vitest/migrate-tests: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/mocha/vitest/recipe: {} + codemods-legacy/mocha/vitest/recipe: {} - codemods/msw/2/callback-signature: + codemods-legacy/msw/2/callback-signature: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + version: link:../../../../tooling-legacy/utilities ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/msw/2/ctx-fetch: + codemods-legacy/msw/2/ctx-fetch: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + version: link:../../../../tooling-legacy/utilities ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/msw/2/imports: + codemods-legacy/msw/2/imports: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: ^1.0.0 - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - '@codemod.com/tsconfig': specifier: workspace:* - version: link:../../../../tooling/typescript - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + version: link:../../../../tooling-legacy/codemod-utils ts-morph: specifier: ^24.0.0 version: 24.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.7.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/msw/2/lifecycle-events-signature: + codemods-legacy/msw/2/lifecycle-events-signature: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + version: link:../../../../tooling-legacy/utilities ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/msw/2/print-handler: + codemods-legacy/msw/2/print-handler: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + version: link:../../../../tooling-legacy/utilities ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/msw/2/req-passthrough: + codemods-legacy/msw/2/req-passthrough: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + version: link:../../../../tooling-legacy/utilities ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/msw/2/request-changes: + codemods-legacy/msw/2/request-changes: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + version: link:../../../../tooling-legacy/utilities ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/msw/2/response-usages: + codemods-legacy/msw/2/response-usages: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + version: link:../../../../tooling-legacy/utilities ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/msw/2/type-args: + codemods-legacy/msw/2/type-args: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + version: link:../../../../tooling-legacy/utilities ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/msw/2/upgrade-recipe: {} + codemods-legacy/msw/2/upgrade-recipe: {} - codemods/mui/5/core-styles-import: + codemods-legacy/mui/5/core-styles-import: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + '@types/node': + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/netlify-sdk/0.8.1/addBuildEventContext: + codemods-legacy/netlify-sdk/0.8.1/addBuildEventContext: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/netlify-sdk/0.8.1/addBuildEventHandler: + codemods-legacy/netlify-sdk/0.8.1/addBuildEventHandler: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/netlify-sdk/0.8.1/disableBuildEventHandlers: + codemods-legacy/netlify-sdk/0.8.1/disableBuildEventHandlers: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/netlify-sdk/0.8.1/enableBuildEventHandlers: + codemods-legacy/netlify-sdk/0.8.1/enableBuildEventHandlers: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/netlify-sdk/0.8.1/exportZod: + codemods-legacy/netlify-sdk/0.8.1/exportZod: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/netlify-sdk/0.8.4/addApiHandler: + codemods-legacy/netlify-sdk/0.8.4/addApiHandler: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/netlify-sdk/0.8.5/createEnvironmentVariable: + codemods-legacy/netlify-sdk/0.8.5/createEnvironmentVariable: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/netlify-sdk/0.8.5/createOrUpdateVariable: + codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariable: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/netlify-sdk/0.8.5/createOrUpdateVariables: + codemods-legacy/netlify-sdk/0.8.5/createOrUpdateVariables: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/netlify-sdk/0.8.5/deleteEnvironmentVariable: + codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariable: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/netlify-sdk/0.8.5/deleteEnvironmentVariables: + codemods-legacy/netlify-sdk/0.8.5/deleteEnvironmentVariables: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/netlify-sdk/0.8.5/getEnvironmentVariables: + codemods-legacy/netlify-sdk/0.8.5/getEnvironmentVariables: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/netlify-sdk/0.8.5/netlify-sdk-0.8.5-recipe: {} + codemods-legacy/netlify-sdk/0.8.5/netlify-sdk-0.8.5-recipe: {} - codemods/netlify-sdk/0.8.5/patchEnvironmentVariable: + codemods-legacy/netlify-sdk/0.8.5/patchEnvironmentVariable: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/netlify-sdk/0.8.5/updateEnvironmentVariable: + codemods-legacy/netlify-sdk/0.8.5/updateEnvironmentVariable: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/netlify/add-zod-validation: + codemods-legacy/netlify/add-zod-validation: devDependencies: - '@codemod.com/workflow': + '@codemod-com/tsconfig': specifier: workspace:* - version: link:../../../tooling/workflow + version: link:../../../tooling-legacy/tsconfig + '@codemod.com/workflow': + specifier: 0.0.31 + version: 0.0.31(@babel/preset-env@7.26.7(@babel/core@7.26.7)) '@types/node': specifier: 20.9.0 version: 20.9.0 @@ -2362,8 +1978,11 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/netlify/replace-feature-flag: + codemods-legacy/netlify/replace-feature-flag: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../tooling-legacy/tsconfig '@types/node': specifier: 20.9.0 version: 20.9.0 @@ -2377,20 +1996,17 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/next-i18next/copy-keys: + codemods-legacy/next-i18next/copy-keys: devDependencies: '@codemod-com/filemod': specifier: workspace:* - version: link:../../../tooling/filemod + version: link:../../../tooling-legacy/filemod '@codemod-com/utilities': specifier: workspace:* - version: link:../../../tooling/utilities + version: link:../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) @@ -2400,30 +2016,24 @@ importers: ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/next/13/ab-test: + codemods-legacy/next/13/ab-test: devDependencies: '@codemod-com/filemod': specifier: workspace:* - version: link:../../../../tooling/filemod + version: link:../../../../tooling-legacy/filemod '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) @@ -2433,17 +2043,14 @@ importers: ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/next/13/app-directory-boilerplate: + codemods-legacy/next/13/app-directory-boilerplate: dependencies: mdast-util-from-markdown: specifier: 'catalog:' @@ -2463,16 +2070,13 @@ importers: devDependencies: '@codemod-com/filemod': specifier: workspace:* - version: link:../../../../tooling/filemod + version: link:../../../../tooling-legacy/filemod '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) @@ -2482,180 +2086,131 @@ importers: ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/next/13/app-router-recipe: {} + codemods-legacy/next/13/app-router-recipe: {} - codemods/next/13/built-in-next-font: + codemods-legacy/next/13/built-in-next-font: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/next/13/comment-deletable-files: + codemods-legacy/next/13/comment-deletable-files: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/next/13/move-css-in-js-styles: - dependencies: - sinon: - specifier: 'catalog:' - version: 15.2.0 + codemods-legacy/next/13/move-css-in-js-styles: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) + sinon: + specifier: ^15.0.1 + version: 15.2.0 typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/next/13/new-image-experimental: + codemods-legacy/next/13/new-image-experimental: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/next/13/new-link: + codemods-legacy/next/13/new-link: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/next/13/next-image-to-legacy-image: + codemods-legacy/next/13/next-image-to-legacy-image: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/next/13/remove-get-static-props: + codemods-legacy/next/13/remove-get-static-props: devDependencies: '@codemod-com/filemod': specifier: workspace:* - version: link:../../../../tooling/filemod + version: link:../../../../tooling-legacy/filemod '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: 0.14.0 version: 0.14.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) @@ -2665,30 +2220,24 @@ importers: ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/next/13/remove-next-export: + codemods-legacy/next/13/remove-next-export: devDependencies: '@codemod-com/filemod': specifier: workspace:* - version: link:../../../../tooling/filemod + version: link:../../../../tooling-legacy/filemod '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) @@ -2698,30 +2247,24 @@ importers: ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/next/13/replace-api-routes: + codemods-legacy/next/13/replace-api-routes: devDependencies: '@codemod-com/filemod': specifier: workspace:* - version: link:../../../../tooling/filemod + version: link:../../../../tooling-legacy/filemod '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) @@ -2731,17 +2274,14 @@ importers: ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/next/13/replace-next-head: + codemods-legacy/next/13/replace-next-head: dependencies: mdast-util-from-markdown: specifier: 'catalog:' @@ -2756,7 +2296,7 @@ importers: specifier: 'catalog:' version: 2.0.0 unist-util-filter: - specifier: 'catalog:' + specifier: ^5.0.1 version: 5.0.1 unist-util-visit: specifier: 'catalog:' @@ -2764,16 +2304,13 @@ importers: devDependencies: '@codemod-com/filemod': specifier: workspace:* - version: link:../../../../tooling/filemod + version: link:../../../../tooling-legacy/filemod '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) @@ -2783,51 +2320,39 @@ importers: ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/next/13/replace-next-router: + codemods-legacy/next/13/replace-next-router: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + version: link:../../../../tooling-legacy/utilities ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/next/13/replace-use-search-params: + codemods-legacy/next/13/replace-use-search-params: devDependencies: '@codemod-com/filemod': specifier: workspace:* - version: link:../../../../tooling/filemod + version: link:../../../../tooling-legacy/filemod '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) @@ -2837,108 +2362,84 @@ importers: ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/next/13/upsert-use-client-directive: + codemods-legacy/next/13/upsert-use-client-directive: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + version: link:../../../../tooling-legacy/utilities ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/next/14/metadata-to-viewport-export: + codemods-legacy/next/14/metadata-to-viewport-export: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/next/14/next-og-import: + codemods-legacy/next/14/next-og-import: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/nextAuth/useSession-array-to-Object-destrucutring: + codemods-legacy/nextAuth/useSession-array-to-Object-destrucutring: devDependencies: '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 '@types/node': - specifier: 20.9.0 - version: 20.9.0 + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.9.0) - codemods/npm/esm-first-in-exports: + codemods-legacy/npm/esm-first-in-exports: devDependencies: '@codemod.com/workflow': - specifier: workspace:* - version: link:../../../tooling/workflow + specifier: 0.0.31 + version: 0.0.31(@babel/preset-env@7.26.7(@babel/core@7.26.7)) '@types/node': specifier: 20.9.0 version: 20.9.0 @@ -2949,130 +2450,103 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/nuxt/4/absolute-watch-path: + codemods-legacy/nuxt/4/absolute-watch-path: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/nuxt/4/default-data-error-value: + codemods-legacy/nuxt/4/default-data-error-value: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/nuxt/4/deprecated-dedupe-value: + codemods-legacy/nuxt/4/deprecated-dedupe-value: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/nuxt/4/file-structure: + codemods-legacy/nuxt/4/file-structure: devDependencies: - '@codemod.com/workflow': + '@codemod-com/tsconfig': specifier: workspace:* - version: link:../../../../tooling/workflow + version: link:../../../../tooling-legacy/tsconfig + '@codemod.com/workflow': + specifier: 0.0.31 + version: 0.0.31(@babel/preset-env@7.26.7(@babel/core@7.26.7)) '@types/node': specifier: 20.9.0 version: 20.9.0 typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.9.0) - codemods/nuxt/4/migration-recipe: {} + codemods-legacy/nuxt/4/migration-recipe: {} - codemods/nuxt/4/shallow-function-reactivity: + codemods-legacy/nuxt/4/shallow-function-reactivity: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/nuxt/4/template-compilation-changes: + codemods-legacy/nuxt/4/template-compilation-changes: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/openFeature/replace-feature-flags: + codemods-legacy/openFeature/replace-feature-flags: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../tooling-legacy/tsconfig '@types/node': specifier: 20.9.0 version: 20.9.0 @@ -3086,11 +2560,11 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/pnpm/catalog: + codemods-legacy/pnpm/catalog: devDependencies: '@codemod.com/workflow': - specifier: workspace:* - version: link:../../../tooling/workflow + specifier: 0.0.31 + version: 0.0.31(@babel/preset-env@7.26.7(@babel/core@7.26.7)) '@types/node': specifier: 20.9.0 version: 20.9.0 @@ -3103,11 +2577,8 @@ importers: typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.9.0) - codemods/prisma/5/json-protocol: + codemods-legacy/prisma/5/json-protocol: dependencies: '@mrleebo/prisma-ast': specifier: ^0.12.0 @@ -3115,28 +2586,22 @@ importers: devDependencies: '@codemod-com/filemod': specifier: workspace:* - version: link:../../../../tooling/filemod + version: link:../../../../tooling-legacy/filemod '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@loancrate/prisma-schema-parser': specifier: ^2.0.0 version: 2.0.0 '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) memfs: specifier: ^4.6.0 version: 4.17.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 @@ -3145,227 +2610,173 @@ importers: version: 0.34.0 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/python/orjson/recipe: {} + codemods-legacy/python/orjson/recipe: {} - codemods/react-native/74/migrate-to-fire-interval-seconds: + codemods-legacy/react-native/74/migrate-to-fire-interval-seconds: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react-native/74/remove-alert-action: + codemods-legacy/react-native/74/remove-alert-action: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react-native/74/remove-event-listener-callback: + codemods-legacy/react-native/74/remove-event-listener-callback: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react-redux/0/add-state-type: + codemods-legacy/react-redux/0/add-state-type: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + '@types/node': + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/react-router/4/add-exact-prop: + codemods-legacy/react-router/4/add-exact-prop: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react-router/4/browser-router: + codemods-legacy/react-router/4/browser-router: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react-router/4/create-hash-history: + codemods-legacy/react-router/4/create-hash-history: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react-router/4/hash-router: + codemods-legacy/react-router/4/hash-router: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react-router/4/index-route: + codemods-legacy/react-router/4/index-route: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react-router/4/move-HOC-to-global-scope: + codemods-legacy/react-router/4/move-HOC-to-global-scope: devDependencies: '@types/jscodeshift': specifier: ^0.11.10 @@ -3383,643 +2794,454 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/react-router/4/remove-with-props: + codemods-legacy/react-router/4/remove-with-props: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react-router/4/rename-imports: + codemods-legacy/react-router/4/rename-imports: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react-router/4/replace-location-query: + codemods-legacy/react-router/4/replace-location-query: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react-router/4/replace-nested-routes: + codemods-legacy/react-router/4/replace-nested-routes: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react-router/4/replace-param-prop: + codemods-legacy/react-router/4/replace-param-prop: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react-router/4/use-history-hook: + codemods-legacy/react-router/4/use-history-hook: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) esbuild: specifier: 0.19.5 version: 0.19.5 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react-router/4/wrap-with-switch: + codemods-legacy/react-router/4/wrap-with-switch: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react-router/6/compat-route: + codemods-legacy/react-router/6/compat-route: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/react-router/6/compat-router: + codemods-legacy/react-router/6/compat-router: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/react-router/6/link-to-props: + codemods-legacy/react-router/6/link-to-props: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/react-router/6/match-path-arguments: + codemods-legacy/react-router/6/match-path-arguments: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/react-router/6/navlink-exact-end: + codemods-legacy/react-router/6/navlink-exact-end: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/react-router/6/redirect-to-navigate: + codemods-legacy/react-router/6/redirect-to-navigate: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/react-router/6/remove-active-classname: + codemods-legacy/react-router/6/remove-active-classname: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react-router/6/remove-active-style: + codemods-legacy/react-router/6/remove-active-style: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react-router/6/remove-compat-router: + codemods-legacy/react-router/6/remove-compat-router: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/react-router/6/remove-go-hooks: + codemods-legacy/react-router/6/remove-go-hooks: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/react-router/6/remove-redirect-inside-switch: + codemods-legacy/react-router/6/remove-redirect-inside-switch: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react-router/6/rename-compat-imports: + codemods-legacy/react-router/6/rename-compat-imports: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/react-router/6/static-router-imports: + codemods-legacy/react-router/6/static-router-imports: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/react-router/6/use-location: + codemods-legacy/react-router/6/use-location: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/react-router/6/use-navigate: + codemods-legacy/react-router/6/use-navigate: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/react-router/6/use-params: + codemods-legacy/react-router/6/use-params: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/react-router/6/use-route-match: + codemods-legacy/react-router/6/use-route-match: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/react/19/migration-recipe: {} + codemods-legacy/react/19/migration-recipe: {} - codemods/react/19/remove-context-provider: + codemods-legacy/react/19/remove-context-provider: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react/19/remove-forward-ref: + codemods-legacy/react/19/remove-forward-ref: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@codemod.com/codemod-utils': specifier: workspace:* - version: link:../../../../tooling/codemod-utils + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + specifier: ^3.2.4 + version: 3.2.4(@types/debug@4.1.12)(@types/node@24.3.0) - codemods/react/19/remove-legacy-context: + codemods-legacy/react/19/remove-legacy-context: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': specifier: workspace:* - version: link:../../../../tooling/codemod-utils + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 @@ -4033,38 +3255,38 @@ importers: specifier: ^5.2.2 version: 5.7.3 vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.9.0) + specifier: '^3.2.4 ' + version: 3.2.4(@types/debug@4.1.12)(@types/node@20.9.0) - codemods/react/19/remove-memoization: + codemods-legacy/react/19/remove-memoization: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@codemod.com/codemod-utils': specifier: workspace:* - version: link:../../../../tooling/codemod-utils + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react/19/replace-act-import: + codemods-legacy/react/19/replace-act-import: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 @@ -4081,11 +3303,14 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.17.16) - codemods/react/19/replace-create-factory: + codemods-legacy/react/19/replace-create-factory: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': specifier: workspace:* - version: link:../../../../tooling/codemod-utils + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 @@ -4099,17 +3324,17 @@ importers: specifier: ^5.2.2 version: 5.7.3 vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.9.0) + specifier: ^3.2.4 + version: 3.2.4(@types/debug@4.1.12)(@types/node@20.9.0) - codemods/react/19/replace-default-props: + codemods-legacy/react/19/replace-default-props: devDependencies: - '@codemod.com/codemod-utils': - specifier: ^1.0.0 - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - '@codemod.com/tsconfig': + '@codemod-com/tsconfig': specifier: workspace:* - version: link:../../../../tooling/typescript + version: link:../../../../tooling-legacy/tsconfig + '@codemod.com/codemod-utils': + specifier: 'workspace:' + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 @@ -4126,8 +3351,11 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/react/19/replace-react-test-renderer-import: + codemods-legacy/react/19/replace-react-test-renderer-import: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 @@ -4144,11 +3372,14 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/react/19/replace-reactdom-render: + codemods-legacy/react/19/replace-reactdom-render: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': specifier: workspace:* - version: link:../../../../tooling/codemod-utils + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 @@ -4165,35 +3396,35 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/react/19/replace-string-ref: + codemods-legacy/react/19/replace-string-ref: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@codemod.com/codemod-utils': specifier: workspace:* - version: link:../../../../tooling/codemod-utils + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react/19/replace-use-form-state: + codemods-legacy/react/19/replace-use-form-state: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 @@ -4210,48 +3441,39 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.17.16) - codemods/react/19/use-context-hook: + codemods-legacy/react/19/use-context-hook: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../tooling/utilities + version: link:../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react/create-element-to-jsx: + codemods-legacy/react/create-element-to-jsx: dependencies: ast-types: specifier: ^0.14.2 version: 0.14.2 devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - '@react-codemods/utils': specifier: workspace:* - version: link:../../../tooling/react-utils - '@types/jscodeshift': - specifier: ^0.11.10 - version: 0.11.11 - '@types/node': - specifier: 20.9.0 - version: 20.9.0 + version: link:../../../tooling-legacy/codemod-utils jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) @@ -4260,60 +3482,54 @@ importers: version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.9.0) + version: 1.6.0(@types/node@24.3.0) - codemods/react/prop-types-typescript: + codemods-legacy/react/prop-types-typescript: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../tooling/utilities + version: link:../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) ast-types: specifier: ^0.15.0 version: 0.15.2 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react/replace-react-fc-typescript: + codemods-legacy/react/replace-react-fc-typescript: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../tooling/utilities + version: link:../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/react/update-react-imports: + codemods-legacy/react/update-react-imports: dependencies: '@types/react': specifier: ^19.0.1 @@ -4322,9 +3538,12 @@ importers: specifier: ^19.0.0 version: 19.0.0 devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 @@ -4341,116 +3560,89 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/redwoodjs/core/4/auth-decoder: + codemods-legacy/redwoodjs/core/4/auth-decoder: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../../tooling/utilities + version: link:../../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + '@types/node': + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/redwoodjs/core/4/redwood-apollo-provider: + codemods-legacy/redwoodjs/core/4/redwood-apollo-provider: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../../tooling/utilities + version: link:../../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + '@types/node': + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/redwoodjs/core/4/router-use-auth: + codemods-legacy/redwoodjs/core/4/router-use-auth: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../../tooling/utilities + version: link:../../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + '@types/node': + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/redwoodjs/core/4/use-armor: + codemods-legacy/redwoodjs/core/4/use-armor: devDependencies: '@codemod-com/utilities': specifier: workspace:* - version: link:../../../../../tooling/utilities + version: link:../../../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/remove-unused-feature-flags-2: + codemods-legacy/remove-unused-feature-flags-2: devDependencies: '@codemod-com/filemod': specifier: workspace:* - version: link:../../tooling/filemod + version: link:../../tooling-legacy/filemod + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../tooling/utilities + version: link:../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) @@ -4460,17 +3652,14 @@ importers: ts-morph: specifier: ^19.0.0 version: 19.0.0 - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) + version: 1.6.0(@types/node@24.3.0) - codemods/replace-feature-flag-core: + codemods-legacy/replace-feature-flag-core: devDependencies: '@types/node': specifier: 20.9.0 @@ -4485,23 +3674,23 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/sql/add-index-before-select: + codemods-legacy/sql/add-index-before-select: devDependencies: '@codemod.com/workflow': - specifier: workspace:* - version: link:../../../tooling/workflow + specifier: 0.0.31 + version: 0.0.31(@babel/preset-env@7.26.7(@babel/core@7.26.7)) '@types/node': specifier: 20.9.0 version: 20.9.0 typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.9.0) - codemods/statsig/replace-gate: + codemods-legacy/statsig/replace-gate: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../tooling-legacy/tsconfig '@types/node': specifier: 20.9.0 version: 20.9.0 @@ -4515,515 +3704,371 @@ importers: specifier: ^1.0.1 version: 1.6.0(@types/node@20.9.0) - codemods/styledictionary/4/asynchronous-api: + codemods-legacy/styledictionary/4/asynchronous-api: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/styledictionary/4/asynchronous-api-file-headers: + codemods-legacy/styledictionary/4/asynchronous-api-file-headers: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/styledictionary/4/format-helpers: + codemods-legacy/styledictionary/4/format-helpers: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/styledictionary/4/formatting-options: + codemods-legacy/styledictionary/4/formatting-options: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/styledictionary/4/hook-api-actions: + codemods-legacy/styledictionary/4/hook-api-actions: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/styledictionary/4/hook-api-file-header: + codemods-legacy/styledictionary/4/hook-api-file-header: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/styledictionary/4/hook-api-filters: + codemods-legacy/styledictionary/4/hook-api-filters: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/styledictionary/4/hook-api-formats: + codemods-legacy/styledictionary/4/hook-api-formats: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/styledictionary/4/hook-api-parsers: + codemods-legacy/styledictionary/4/hook-api-parsers: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/styledictionary/4/hook-api-preprocessors: + codemods-legacy/styledictionary/4/hook-api-preprocessors: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/styledictionary/4/hook-api-transform: + codemods-legacy/styledictionary/4/hook-api-transform: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/styledictionary/4/hook-api-transform-groups: + codemods-legacy/styledictionary/4/hook-api-transform-groups: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/styledictionary/4/instantiating-style-dictionary: + codemods-legacy/styledictionary/4/instantiating-style-dictionary: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/styledictionary/4/logging: + codemods-legacy/styledictionary/4/logging: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/styledictionary/4/migration-recipe: {} + codemods-legacy/styledictionary/4/migration-recipe: {} - codemods/styledictionary/4/module-common-js: + codemods-legacy/styledictionary/4/module-common-js: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/styledictionary/4/reference-utils: + codemods-legacy/styledictionary/4/reference-utils: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/styledictionary/4/type: + codemods-legacy/styledictionary/4/type: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/styledictionary/4/updated-and-removed-transforms: + codemods-legacy/styledictionary/4/updated-and-removed-transforms: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/svelte/5/components-as-functions: + codemods-legacy/svelte/5/components-as-functions: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/svelte/5/components-as-functions-destroyfunction: + codemods-legacy/svelte/5/components-as-functions-destroyfunction: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/svelte/5/components-as-functions-onfunction: + codemods-legacy/svelte/5/components-as-functions-onfunction: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/svelte/5/is-where-scoping: + codemods-legacy/svelte/5/is-where-scoping: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/svelte/5/migration-recipe: {} + codemods-legacy/svelte/5/migration-recipe: {} - codemods/svelte/5/server-api-changes: + codemods-legacy/svelte/5/server-api-changes: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/svelte/5/svelte-element-expression: + codemods-legacy/svelte/5/svelte-element-expression: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: ^1.0.1 - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/tanStack/codeSplitting: + codemods-legacy/tanStack/codeSplitting: dependencies: '@codemod.com/workflow': specifier: ^0.0.31 @@ -5032,48 +4077,30 @@ importers: specifier: ^3.3.2 version: 3.3.3 devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../tooling-legacy/tsconfig '@types/node': specifier: 20.9.0 version: 20.9.0 typescript: specifier: ^5.5.4 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.9.0) - - codemods/three/r168/deactivate-to-disconnect: - devDependencies: - '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - '@types/jscodeshift': - specifier: ^0.11.10 - version: 0.11.11 - '@types/node': - specifier: 20.9.0 - version: 20.9.0 - jscodeshift: - specifier: ^0.15.1 - version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - typescript: - specifier: ^5.2.2 - version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.9.0) - codemods/three/r168/drag-controls-to-connect: + codemods-legacy/three/r168/deactivate-to-disconnect: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 '@types/node': - specifier: 20.9.0 - version: 20.9.0 + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) @@ -5082,82 +4109,85 @@ importers: version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.9.0) + version: 1.6.0(@types/node@24.3.0) - codemods/three/r168/pointer-lock-controls-to-controls-object: + codemods-legacy/three/r168/drag-controls-to-connect: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 '@types/node': - specifier: 20.9.0 - version: 20.9.0 + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.9.0) - codemods/three/r168/replace-dragcontrols-getraycaster: + codemods-legacy/three/r168/replace-dragcontrols-getraycaster: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 '@types/node': - specifier: 20.9.0 - version: 20.9.0 + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.9.0) - codemods/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy: + codemods-legacy/three/r168/replace-viewport-bottom-left-with-viewportuv-flipy: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 '@types/node': - specifier: 20.9.0 - version: 20.9.0 + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.9.0) - codemods/three/r168/replace-viewport-top-left-with-viewport-uv: + codemods-legacy/three/r168/replace-viewport-top-left-with-viewport-uv: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 '@types/node': - specifier: 20.9.0 - version: 20.9.0 + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) @@ -5166,42 +4196,45 @@ importers: version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.9.0) + version: 1.6.0(@types/node@24.3.0) - codemods/three/r168/three_migration_recipe: {} + codemods-legacy/three/r168/three_migration_recipe: {} - codemods/three/r168/transform_logluvloader: + codemods-legacy/three/r168/transform_logluvloader: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 '@types/node': - specifier: 20.9.0 - version: 20.9.0 + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.9.0) - codemods/three/r168/uniforms-to-uniformarray: + codemods-legacy/three/r168/uniforms-to-uniformarray: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 '@types/node': - specifier: 20.9.0 - version: 20.9.0 + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) @@ -5210,146 +4243,134 @@ importers: version: 5.7.3 vitest: specifier: ^1.0.1 - version: 1.6.0(@types/node@20.9.0) + version: 1.6.0(@types/node@24.3.0) - codemods/typescript/remove-public-modifier: + codemods-legacy/typescript/remove-public-modifier: devDependencies: '@codemod-com/tsconfig': specifier: workspace:* - version: link:../../../tooling/tsconfig + version: link:../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../tooling/utilities + version: link:../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + '@types/node': + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/typescript/use-template-literals: + codemods-legacy/typescript/use-template-literals: devDependencies: '@codemod-com/tsconfig': specifier: workspace:* - version: link:../../../tooling/tsconfig + version: link:../../../tooling-legacy/tsconfig '@codemod-com/utilities': specifier: workspace:* - version: link:../../../tooling/utilities + version: link:../../../tooling-legacy/utilities '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.17.16)) + '@types/node': + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ts-node: - specifier: ^10.9.1 - version: 10.9.1(@types/node@20.17.16)(typescript@5.7.3) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/vue/3/render-function-api: + codemods-legacy/vue/3/render-function-api: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 '@types/node': - specifier: ^20.12.3 - version: 20.17.16 + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.17.16) - codemods/webpack/v5/json-imports-to-default-imports: + codemods-legacy/webpack/v5/json-imports-to-default-imports: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 '@types/node': - specifier: 20.9.0 - version: 20.9.0 + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.9.0) - codemods/webpack/v5/migrate-library-target-to-library-object: + codemods-legacy/webpack/v5/migrate-library-target-to-library-object: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 '@types/node': - specifier: 20.9.0 - version: 20.9.0 + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.9.0) - codemods/webpack/v5/migration-recipe: {} + codemods-legacy/webpack/v5/migration-recipe: {} - codemods/webpack/v5/set-target-to-false-and-update-plugins: + codemods-legacy/webpack/v5/set-target-to-false-and-update-plugins: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../../../../tooling-legacy/tsconfig '@codemod.com/codemod-utils': - specifier: '*' - version: 1.0.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)) + specifier: workspace:* + version: link:../../../../tooling-legacy/codemod-utils '@types/jscodeshift': specifier: ^0.11.10 version: 0.11.11 '@types/node': - specifier: 20.9.0 - version: 20.9.0 + specifier: ^24.3.0 + version: 24.3.0 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) typescript: specifier: ^5.2.2 version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.9.0) - tooling/codemod-utils: + tooling-legacy/codemod-utils: dependencies: '@babel/parser': specifier: ^7.24.4 @@ -5361,71 +4382,64 @@ importers: specifier: ^0.16.1 version: 0.16.1(@babel/preset-env@7.26.7(@babel/core@7.26.7)) devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../tsconfig '@types/node': specifier: 20.10.3 version: 20.10.3 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.10.3)) - ts-node: - specifier: 10.9.1 - version: 10.9.1(@types/node@20.10.3)(typescript@5.7.3) + typescript: + specifier: ^5.9.2 + version: 5.9.2 vitest: specifier: ^1.0.1 version: 1.6.0(@types/node@20.10.3) - tooling/filemod: + tooling-legacy/filemod: devDependencies: + '@codemod-com/tsconfig': + specifier: workspace:* + version: link:../tsconfig '@types/node': specifier: 20.8.5 version: 20.8.5 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.8.5)) glob: specifier: 'catalog:' version: 10.4.5 memfs: specifier: ^4.6.0 version: 4.17.0 - ts-node: - specifier: 10.9.1 - version: 10.9.1(@types/node@20.8.5)(typescript@5.7.3) + typescript: + specifier: ^5.2.2 + version: 5.7.3 vitest: specifier: ^1.0.1 version: 1.6.0(@types/node@20.8.5) - tooling/react-utils: {} - - tooling/tsconfig: {} - - tooling/typescript: {} + tooling-legacy/tsconfig: {} - tooling/utilities: + tooling-legacy/utilities: dependencies: '@codemod-com/filemod': specifier: workspace:* version: link:../filemod adm-zip: - specifier: 'catalog:' + specifier: 0.5.16 version: 0.5.16 change-case: - specifier: 'catalog:' + specifier: ^5.2.0 version: 5.4.4 glob: specifier: 'catalog:' version: 10.4.5 js-beautify: - specifier: 'catalog:' + specifier: ' ^1.14.11' version: 1.15.1 jscodeshift: specifier: ^0.15.1 version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - ms: - specifier: 'catalog:' - version: 2.1.3 pako: - specifier: 'catalog:' + specifier: ^2.1.0 version: 2.1.0 prettier: specifier: ^3.2.5 @@ -5437,10 +4451,10 @@ importers: specifier: ^6.1.15 version: 6.2.1 tar-stream: - specifier: 'catalog:' + specifier: ^3.1.7 version: 3.1.7 unzipper: - specifier: 'catalog:' + specifier: ^0.11.6 version: 0.11.6 valibot: specifier: 'catalog:' @@ -5450,141 +4464,38 @@ importers: specifier: workspace:* version: link:../tsconfig '@types/adm-zip': - specifier: 'catalog:' + specifier: 0.5.7 version: 0.5.7 '@types/js-beautify': - specifier: 'catalog:' + specifier: ^1.14.3 version: 1.14.3 '@types/jscodeshift': specifier: ^0.11.11 version: 0.11.11 - '@types/ms': - specifier: 'catalog:' - version: 0.7.34 '@types/node': specifier: 20.10.3 version: 20.10.3 '@types/pako': - specifier: 'catalog:' + specifier: ^2.0.0 version: 2.0.3 '@types/semver': specifier: ^7.5.8 version: 7.5.8 '@types/tar': - specifier: 'catalog:' + specifier: 6.1.13 version: 6.1.13 '@types/tar-stream': - specifier: 'catalog:' + specifier: ^3.1.3 version: 3.1.3 '@types/unzipper': - specifier: 'catalog:' + specifier: ^0.10.9 version: 0.10.10 - '@vitest/coverage-v8': - specifier: 'catalog:' - version: 1.6.0(vitest@1.6.0(@types/node@20.10.3)) memfs: specifier: ^4.15.2 version: 4.17.0 - ts-node: - specifier: 10.9.1 - version: 10.9.1(@types/node@20.10.3)(typescript@5.7.3) - typescript: - specifier: ^5.5.4 - version: 5.7.3 - vitest: - specifier: ^1.0.1 - version: 1.6.0(@types/node@20.10.3) - - tooling/workflow: - dependencies: - '@ast-grep/cli': - specifier: 'catalog:' - version: 0.25.7 - '@ast-grep/napi': - specifier: 'catalog:' - version: 0.25.7 - '@octokit/rest': - specifier: 'catalog:' - version: 20.1.1 - '@sindresorhus/slugify': - specifier: 'catalog:' - version: 2.2.1 - '@types/jscodeshift': - specifier: ^0.11.6 - version: 0.11.11 - colors-cli: - specifier: 'catalog:' - version: 1.0.33 - detect-indent: - specifier: 'catalog:' - version: 7.0.1 - detect-newline: - specifier: 'catalog:' - version: 4.0.1 - diff: - specifier: 'catalog:' - version: 5.2.0 - filenamify: - specifier: 'catalog:' - version: 6.0.0 - git-url-parse: - specifier: 'catalog:' - version: 14.1.0 - glob: - specifier: 'catalog:' - version: 10.4.5 - inquirer: - specifier: 'catalog:' - version: 9.3.7 - jscodeshift: - specifier: ^0.15.0 - version: 0.15.2(@babel/preset-env@7.26.7(@babel/core@7.26.7)) - lodash-es: - specifier: 'catalog:' - version: 4.17.21 - magic-string: - specifier: 'catalog:' - version: 0.30.17 - openai: - specifier: 'catalog:' - version: 4.23.0 - prettier: - specifier: ^3.2.5 - version: 3.4.2 - simple-git: - specifier: 'catalog:' - version: 3.27.0 - tree-kill: - specifier: 'catalog:' - version: 1.2.2 - ts-invariant: - specifier: 'catalog:' - version: 0.10.3 - yaml: - specifier: 'catalog:' - version: 2.7.0 - devDependencies: - '@codemod-com/utilities': - specifier: workspace:* - version: link:../utilities - '@types/diff': - specifier: 'catalog:' - version: 5.2.3 - '@types/git-url-parse': - specifier: ^9.0.3 - version: 9.0.3 - '@types/inquirer': - specifier: 'catalog:' - version: 9.0.7 - '@types/lodash-es': - specifier: 'catalog:' - version: 4.17.12 - esbuild: - specifier: ^0.17.14 - version: 0.17.19 typescript: - specifier: ^5.2.2 - version: 5.7.3 + specifier: ^5.9.2 + version: 5.9.2 packages: @@ -6261,115 +5172,55 @@ packages: resolution: {integrity: sha512-t8kDRGrKXyp6+tjUh7hw2RLyclsW4TRoRvRHtSyAX9Bb5ldlFh+90YAYY6awRXrlB4G5G2izNeGySpATlFzmOg==} engines: {node: '>=6.9.0'} - '@bcherny/json-schema-ref-parser@10.0.5-fork': - resolution: {integrity: sha512-E/jKbPoca1tfUPj3iSbitDZTGnq6FUFjkH6L8U2oDwSuwK1WhnnVtCG7oFOTg/DDnyoXbQYUiUiGOibHqaGVnw==} - engines: {node: '>= 16'} - - '@bcoe/v8-coverage@0.2.3': - resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} - - '@biomejs/biome@1.5.3': - resolution: {integrity: sha512-yvZCa/g3akwTaAQ7PCwPWDCkZs3Qa5ONg/fgOUT9e6wAWsPftCjLQFPXBeGxPK30yZSSpgEmRCfpGTmVbUjGgg==} - engines: {node: '>=14.*'} - hasBin: true - - '@biomejs/biome@1.9.4': - resolution: {integrity: sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog==} + '@biomejs/biome@2.2.2': + resolution: {integrity: sha512-j1omAiQWCkhuLgwpMKisNKnsM6W8Xtt1l0WZmqY/dFj8QPNkIoTvk4tSsi40FaAAkBE1PU0AFG2RWFBWenAn+w==} engines: {node: '>=14.21.3'} hasBin: true - '@biomejs/cli-darwin-arm64@1.5.3': - resolution: {integrity: sha512-ImU7mh1HghEDyqNmxEZBoMPr8SxekkZuYcs+gynKlNW+TALQs7swkERiBLkG9NR0K1B3/2uVzlvYowXrmlW8hw==} - engines: {node: '>=14.*'} - cpu: [arm64] - os: [darwin] - - '@biomejs/cli-darwin-arm64@1.9.4': - resolution: {integrity: sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw==} + '@biomejs/cli-darwin-arm64@2.2.2': + resolution: {integrity: sha512-6ePfbCeCPryWu0CXlzsWNZgVz/kBEvHiPyNpmViSt6A2eoDf4kXs3YnwQPzGjy8oBgQulrHcLnJL0nkCh80mlQ==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [darwin] - '@biomejs/cli-darwin-x64@1.5.3': - resolution: {integrity: sha512-vCdASqYnlpq/swErH7FD6nrFz0czFtK4k/iLgj0/+VmZVjineFPgevOb+Sr9vz0tk0GfdQO60bSpI74zU8M9Dw==} - engines: {node: '>=14.*'} - cpu: [x64] - os: [darwin] - - '@biomejs/cli-darwin-x64@1.9.4': - resolution: {integrity: sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg==} + '@biomejs/cli-darwin-x64@2.2.2': + resolution: {integrity: sha512-Tn4JmVO+rXsbRslml7FvKaNrlgUeJot++FkvYIhl1OkslVCofAtS35MPlBMhXgKWF9RNr9cwHanrPTUUXcYGag==} engines: {node: '>=14.21.3'} cpu: [x64] os: [darwin] - '@biomejs/cli-linux-arm64-musl@1.5.3': - resolution: {integrity: sha512-DYuMizUYUBYfS0IHGjDrOP1RGipqWfMGEvNEJ398zdtmCKLXaUvTimiox5dvx4X15mBK5M2m8wgWUgOP1giUpQ==} - engines: {node: '>=14.*'} - cpu: [arm64] - os: [linux] - - '@biomejs/cli-linux-arm64-musl@1.9.4': - resolution: {integrity: sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA==} + '@biomejs/cli-linux-arm64-musl@2.2.2': + resolution: {integrity: sha512-/MhYg+Bd6renn6i1ylGFL5snYUn/Ct7zoGVKhxnro3bwekiZYE8Kl39BSb0MeuqM+72sThkQv4TnNubU9njQRw==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - '@biomejs/cli-linux-arm64@1.5.3': - resolution: {integrity: sha512-cupBQv0sNF1OKqBfx7EDWMSsKwRrBUZfjXawT4s6hKV6ALq7p0QzWlxr/sDmbKMLOaLQtw2Qgu/77N9rm+f9Rg==} - engines: {node: '>=14.*'} - cpu: [arm64] - os: [linux] - - '@biomejs/cli-linux-arm64@1.9.4': - resolution: {integrity: sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g==} + '@biomejs/cli-linux-arm64@2.2.2': + resolution: {integrity: sha512-JfrK3gdmWWTh2J5tq/rcWCOsImVyzUnOS2fkjhiYKCQ+v8PqM+du5cfB7G1kXas+7KQeKSWALv18iQqdtIMvzw==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [linux] - '@biomejs/cli-linux-x64-musl@1.5.3': - resolution: {integrity: sha512-UUHiAnlDqr2Y/LpvshBFhUYMWkl2/Jn+bi3U6jKuav0qWbbBKU/ByHgR4+NBxpKBYoCtWxhnmatfH1bpPIuZMw==} - engines: {node: '>=14.*'} - cpu: [x64] - os: [linux] - - '@biomejs/cli-linux-x64-musl@1.9.4': - resolution: {integrity: sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg==} + '@biomejs/cli-linux-x64-musl@2.2.2': + resolution: {integrity: sha512-ZCLXcZvjZKSiRY/cFANKg+z6Fhsf9MHOzj+NrDQcM+LbqYRT97LyCLWy2AS+W2vP+i89RyRM+kbGpUzbRTYWig==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - '@biomejs/cli-linux-x64@1.5.3': - resolution: {integrity: sha512-YQrSArQvcv4FYsk7Q91Yv4uuu5F8hJyORVcv3zsjCLGkjIjx2RhjYLpTL733SNL7v33GmOlZY0eFR1ko38tuUw==} - engines: {node: '>=14.*'} - cpu: [x64] - os: [linux] - - '@biomejs/cli-linux-x64@1.9.4': - resolution: {integrity: sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg==} + '@biomejs/cli-linux-x64@2.2.2': + resolution: {integrity: sha512-Ogb+77edO5LEP/xbNicACOWVLt8mgC+E1wmpUakr+O4nKwLt9vXe74YNuT3T1dUBxC/SnrVmlzZFC7kQJEfquQ==} engines: {node: '>=14.21.3'} cpu: [x64] os: [linux] - '@biomejs/cli-win32-arm64@1.5.3': - resolution: {integrity: sha512-HxatYH7vf/kX9nrD+pDYuV2GI9GV8EFo6cfKkahAecTuZLPxryHx1WEfJthp5eNsE0+09STGkKIKjirP0ufaZA==} - engines: {node: '>=14.*'} - cpu: [arm64] - os: [win32] - - '@biomejs/cli-win32-arm64@1.9.4': - resolution: {integrity: sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg==} + '@biomejs/cli-win32-arm64@2.2.2': + resolution: {integrity: sha512-wBe2wItayw1zvtXysmHJQoQqXlTzHSpQRyPpJKiNIR21HzH/CrZRDFic1C1jDdp+zAPtqhNExa0owKMbNwW9cQ==} engines: {node: '>=14.21.3'} cpu: [arm64] os: [win32] - '@biomejs/cli-win32-x64@1.5.3': - resolution: {integrity: sha512-fMvbSouZEASU7mZH8SIJSANDm5OqsjgtVXlbUqxwed6BP7uuHRSs396Aqwh2+VoW8fwTpp6ybIUoC9FrzB0kyA==} - engines: {node: '>=14.*'} - cpu: [x64] - os: [win32] - - '@biomejs/cli-win32-x64@1.9.4': - resolution: {integrity: sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA==} + '@biomejs/cli-win32-x64@2.2.2': + resolution: {integrity: sha512-DAuHhHekGfiGb6lCcsT4UyxQmVwQiBCBUMwVra/dcOSs9q8OhfaZgey51MlekT3p8UwRqtXQfFuEJBhJNdLZwg==} engines: {node: '>=14.21.3'} cpu: [x64] os: [win32] @@ -6392,22 +5243,12 @@ packages: '@codemod.com/workflow@0.0.31': resolution: {integrity: sha512-8xmbxwjxr6d0ZUm3RS/eQqud2mUGXwQgf2v+YEjwQQVwOse6yShgoFljrg7ujvJlhzymivYloL0T0VSS9YubNw==} - '@cspotcode/source-map-support@0.8.1': - resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} - engines: {node: '>=12'} - '@esbuild/aix-ppc64@0.21.5': resolution: {integrity: sha512-1SDgH6ZSPTlggy1yI6+Dbkiz8xzpHJEVAlF/AM1tHPLsf5STom9rwtjE4hKAF20FfXXNTFqEYXyJNWh1GiZedQ==} engines: {node: '>=12'} cpu: [ppc64] os: [aix] - '@esbuild/android-arm64@0.17.19': - resolution: {integrity: sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==} - engines: {node: '>=12'} - cpu: [arm64] - os: [android] - '@esbuild/android-arm64@0.19.5': resolution: {integrity: sha512-5d1OkoJxnYQfmC+Zd8NBFjkhyCNYwM4n9ODrycTFY6Jk1IGiZ+tjVJDDSwDt77nK+tfpGP4T50iMtVi4dEGzhQ==} engines: {node: '>=12'} @@ -6420,12 +5261,6 @@ packages: cpu: [arm64] os: [android] - '@esbuild/android-arm@0.17.19': - resolution: {integrity: sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==} - engines: {node: '>=12'} - cpu: [arm] - os: [android] - '@esbuild/android-arm@0.19.5': resolution: {integrity: sha512-bhvbzWFF3CwMs5tbjf3ObfGqbl/17ict2/uwOSfr3wmxDE6VdS2GqY/FuzIPe0q0bdhj65zQsvqfArI9MY6+AA==} engines: {node: '>=12'} @@ -6438,12 +5273,6 @@ packages: cpu: [arm] os: [android] - '@esbuild/android-x64@0.17.19': - resolution: {integrity: sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==} - engines: {node: '>=12'} - cpu: [x64] - os: [android] - '@esbuild/android-x64@0.19.5': resolution: {integrity: sha512-9t+28jHGL7uBdkBjL90QFxe7DVA+KGqWlHCF8ChTKyaKO//VLuoBricQCgwhOjA1/qOczsw843Fy4cbs4H3DVA==} engines: {node: '>=12'} @@ -6456,12 +5285,6 @@ packages: cpu: [x64] os: [android] - '@esbuild/darwin-arm64@0.17.19': - resolution: {integrity: sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [darwin] - '@esbuild/darwin-arm64@0.19.5': resolution: {integrity: sha512-mvXGcKqqIqyKoxq26qEDPHJuBYUA5KizJncKOAf9eJQez+L9O+KfvNFu6nl7SCZ/gFb2QPaRqqmG0doSWlgkqw==} engines: {node: '>=12'} @@ -6474,12 +5297,6 @@ packages: cpu: [arm64] os: [darwin] - '@esbuild/darwin-x64@0.17.19': - resolution: {integrity: sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==} - engines: {node: '>=12'} - cpu: [x64] - os: [darwin] - '@esbuild/darwin-x64@0.19.5': resolution: {integrity: sha512-Ly8cn6fGLNet19s0X4unjcniX24I0RqjPv+kurpXabZYSXGM4Pwpmf85WHJN3lAgB8GSth7s5A0r856S+4DyiA==} engines: {node: '>=12'} @@ -6492,12 +5309,6 @@ packages: cpu: [x64] os: [darwin] - '@esbuild/freebsd-arm64@0.17.19': - resolution: {integrity: sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==} - engines: {node: '>=12'} - cpu: [arm64] - os: [freebsd] - '@esbuild/freebsd-arm64@0.19.5': resolution: {integrity: sha512-GGDNnPWTmWE+DMchq1W8Sd0mUkL+APvJg3b11klSGUDvRXh70JqLAO56tubmq1s2cgpVCSKYywEiKBfju8JztQ==} engines: {node: '>=12'} @@ -6510,12 +5321,6 @@ packages: cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-x64@0.17.19': - resolution: {integrity: sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==} - engines: {node: '>=12'} - cpu: [x64] - os: [freebsd] - '@esbuild/freebsd-x64@0.19.5': resolution: {integrity: sha512-1CCwDHnSSoA0HNwdfoNY0jLfJpd7ygaLAp5EHFos3VWJCRX9DMwWODf96s9TSse39Br7oOTLryRVmBoFwXbuuQ==} engines: {node: '>=12'} @@ -6528,12 +5333,6 @@ packages: cpu: [x64] os: [freebsd] - '@esbuild/linux-arm64@0.17.19': - resolution: {integrity: sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==} - engines: {node: '>=12'} - cpu: [arm64] - os: [linux] - '@esbuild/linux-arm64@0.19.5': resolution: {integrity: sha512-o3vYippBmSrjjQUCEEiTZ2l+4yC0pVJD/Dl57WfPwwlvFkrxoSO7rmBZFii6kQB3Wrn/6GwJUPLU5t52eq2meA==} engines: {node: '>=12'} @@ -6546,12 +5345,6 @@ packages: cpu: [arm64] os: [linux] - '@esbuild/linux-arm@0.17.19': - resolution: {integrity: sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - '@esbuild/linux-arm@0.19.5': resolution: {integrity: sha512-lrWXLY/vJBzCPC51QN0HM71uWgIEpGSjSZZADQhq7DKhPcI6NH1IdzjfHkDQws2oNpJKpR13kv7/pFHBbDQDwQ==} engines: {node: '>=12'} @@ -6559,15 +5352,9 @@ packages: os: [linux] '@esbuild/linux-arm@0.21.5': - resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} - engines: {node: '>=12'} - cpu: [arm] - os: [linux] - - '@esbuild/linux-ia32@0.17.19': - resolution: {integrity: sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==} + resolution: {integrity: sha512-bPb5AHZtbeNGjCKVZ9UGqGwo8EUu4cLq68E95A53KlxAPRmUyYv2D6F0uUI65XisGOL1hBP5mTronbgo+0bFcA==} engines: {node: '>=12'} - cpu: [ia32] + cpu: [arm] os: [linux] '@esbuild/linux-ia32@0.19.5': @@ -6582,12 +5369,6 @@ packages: cpu: [ia32] os: [linux] - '@esbuild/linux-loong64@0.17.19': - resolution: {integrity: sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==} - engines: {node: '>=12'} - cpu: [loong64] - os: [linux] - '@esbuild/linux-loong64@0.19.5': resolution: {integrity: sha512-42GwZMm5oYOD/JHqHska3Jg0r+XFb/fdZRX+WjADm3nLWLcIsN27YKtqxzQmGNJgu0AyXg4HtcSK9HuOk3v1Dw==} engines: {node: '>=12'} @@ -6600,12 +5381,6 @@ packages: cpu: [loong64] os: [linux] - '@esbuild/linux-mips64el@0.17.19': - resolution: {integrity: sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==} - engines: {node: '>=12'} - cpu: [mips64el] - os: [linux] - '@esbuild/linux-mips64el@0.19.5': resolution: {integrity: sha512-kcjndCSMitUuPJobWCnwQ9lLjiLZUR3QLQmlgaBfMX23UEa7ZOrtufnRds+6WZtIS9HdTXqND4yH8NLoVVIkcg==} engines: {node: '>=12'} @@ -6618,12 +5393,6 @@ packages: cpu: [mips64el] os: [linux] - '@esbuild/linux-ppc64@0.17.19': - resolution: {integrity: sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==} - engines: {node: '>=12'} - cpu: [ppc64] - os: [linux] - '@esbuild/linux-ppc64@0.19.5': resolution: {integrity: sha512-yJAxJfHVm0ZbsiljbtFFP1BQKLc8kUF6+17tjQ78QjqjAQDnhULWiTA6u0FCDmYT1oOKS9PzZ2z0aBI+Mcyj7Q==} engines: {node: '>=12'} @@ -6636,12 +5405,6 @@ packages: cpu: [ppc64] os: [linux] - '@esbuild/linux-riscv64@0.17.19': - resolution: {integrity: sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==} - engines: {node: '>=12'} - cpu: [riscv64] - os: [linux] - '@esbuild/linux-riscv64@0.19.5': resolution: {integrity: sha512-5u8cIR/t3gaD6ad3wNt1MNRstAZO+aNyBxu2We8X31bA8XUNyamTVQwLDA1SLoPCUehNCymhBhK3Qim1433Zag==} engines: {node: '>=12'} @@ -6654,12 +5417,6 @@ packages: cpu: [riscv64] os: [linux] - '@esbuild/linux-s390x@0.17.19': - resolution: {integrity: sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==} - engines: {node: '>=12'} - cpu: [s390x] - os: [linux] - '@esbuild/linux-s390x@0.19.5': resolution: {integrity: sha512-Z6JrMyEw/EmZBD/OFEFpb+gao9xJ59ATsoTNlj39jVBbXqoZm4Xntu6wVmGPB/OATi1uk/DB+yeDPv2E8PqZGw==} engines: {node: '>=12'} @@ -6672,12 +5429,6 @@ packages: cpu: [s390x] os: [linux] - '@esbuild/linux-x64@0.17.19': - resolution: {integrity: sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==} - engines: {node: '>=12'} - cpu: [x64] - os: [linux] - '@esbuild/linux-x64@0.19.5': resolution: {integrity: sha512-psagl+2RlK1z8zWZOmVdImisMtrUxvwereIdyJTmtmHahJTKb64pAcqoPlx6CewPdvGvUKe2Jw+0Z/0qhSbG1A==} engines: {node: '>=12'} @@ -6690,12 +5441,6 @@ packages: cpu: [x64] os: [linux] - '@esbuild/netbsd-x64@0.17.19': - resolution: {integrity: sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==} - engines: {node: '>=12'} - cpu: [x64] - os: [netbsd] - '@esbuild/netbsd-x64@0.19.5': resolution: {integrity: sha512-kL2l+xScnAy/E/3119OggX8SrWyBEcqAh8aOY1gr4gPvw76la2GlD4Ymf832UCVbmuWeTf2adkZDK+h0Z/fB4g==} engines: {node: '>=12'} @@ -6708,12 +5453,6 @@ packages: cpu: [x64] os: [netbsd] - '@esbuild/openbsd-x64@0.17.19': - resolution: {integrity: sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==} - engines: {node: '>=12'} - cpu: [x64] - os: [openbsd] - '@esbuild/openbsd-x64@0.19.5': resolution: {integrity: sha512-sPOfhtzFufQfTBgRnE1DIJjzsXukKSvZxloZbkJDG383q0awVAq600pc1nfqBcl0ice/WN9p4qLc39WhBShRTA==} engines: {node: '>=12'} @@ -6726,12 +5465,6 @@ packages: cpu: [x64] os: [openbsd] - '@esbuild/sunos-x64@0.17.19': - resolution: {integrity: sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==} - engines: {node: '>=12'} - cpu: [x64] - os: [sunos] - '@esbuild/sunos-x64@0.19.5': resolution: {integrity: sha512-dGZkBXaafuKLpDSjKcB0ax0FL36YXCvJNnztjKV+6CO82tTYVDSH2lifitJ29jxRMoUhgkg9a+VA/B03WK5lcg==} engines: {node: '>=12'} @@ -6744,12 +5477,6 @@ packages: cpu: [x64] os: [sunos] - '@esbuild/win32-arm64@0.17.19': - resolution: {integrity: sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==} - engines: {node: '>=12'} - cpu: [arm64] - os: [win32] - '@esbuild/win32-arm64@0.19.5': resolution: {integrity: sha512-dWVjD9y03ilhdRQ6Xig1NWNgfLtf2o/STKTS+eZuF90fI2BhbwD6WlaiCGKptlqXlURVB5AUOxUj09LuwKGDTg==} engines: {node: '>=12'} @@ -6762,12 +5489,6 @@ packages: cpu: [arm64] os: [win32] - '@esbuild/win32-ia32@0.17.19': - resolution: {integrity: sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==} - engines: {node: '>=12'} - cpu: [ia32] - os: [win32] - '@esbuild/win32-ia32@0.19.5': resolution: {integrity: sha512-4liggWIA4oDgUxqpZwrDhmEfAH4d0iljanDOK7AnVU89T6CzHon/ony8C5LeOdfgx60x5cnQJFZwEydVlYx4iw==} engines: {node: '>=12'} @@ -6780,12 +5501,6 @@ packages: cpu: [ia32] os: [win32] - '@esbuild/win32-x64@0.17.19': - resolution: {integrity: sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==} - engines: {node: '>=12'} - cpu: [x64] - os: [win32] - '@esbuild/win32-x64@0.19.5': resolution: {integrity: sha512-czTrygUsB/jlM8qEW5MD8bgYU2Xg14lo6kBDXW6HdxKjh8M5PzETGiSHaz9MtbXBYDloHNUAUW2tMiKW4KM9Mw==} engines: {node: '>=12'} @@ -6806,10 +5521,6 @@ packages: resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==} engines: {node: '>=12'} - '@istanbuljs/schema@0.1.3': - resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} - engines: {node: '>=8'} - '@jest/schemas@29.6.3': resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -6832,12 +5543,6 @@ packages: '@jridgewell/trace-mapping@0.3.25': resolution: {integrity: sha512-vNk6aEwybGtawWmy/PzwnGDOjCkLWSD2wqvjGGAgOAwCGWySYXfYoxt00IJkTF+8Lb57DwOb3Aa0o9CApepiYQ==} - '@jridgewell/trace-mapping@0.3.9': - resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} - - '@jsdevtools/ono@7.1.3': - resolution: {integrity: sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==} - '@jsonjoy.com/base64@1.1.2': resolution: {integrity: sha512-q6XAnWQDIMA3+FTiOYajoYqySkO+JSat0ytXGSuRdq9uXE7o92gzuQwQM14xaCRlBLGq3v5miDGC4vkVTn54xA==} engines: {node: '>=10.0'} @@ -7070,29 +5775,20 @@ packages: '@ts-morph/common@0.25.0': resolution: {integrity: sha512-kMnZz+vGGHi4GoHnLmMhGNjm44kGtKUXGnOvrKmMwAuvNjM/PgKVGfUnL7IDvK7Jb2QQ82jq3Zmp04Gy+r3Dkg==} - '@tsconfig/node10@1.0.11': - resolution: {integrity: sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==} - - '@tsconfig/node12@1.0.11': - resolution: {integrity: sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==} - - '@tsconfig/node14@1.0.3': - resolution: {integrity: sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==} - - '@tsconfig/node16@1.0.4': - resolution: {integrity: sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==} - '@types/acorn@4.0.6': resolution: {integrity: sha512-veQTnWP+1D/xbxVrPC3zHnCZRjSrKfhbMUlEA43iMZLu7EsnTtkJklIuwrCPbOi8YkvDQAiW05VQQFvvz9oieQ==} '@types/adm-zip@0.5.7': resolution: {integrity: sha512-DNEs/QvmyRLurdQPChqq0Md4zGvPwHerAJYWk9l2jCbD1VPpnzRJorOdiq4zsw09NFbYnhfsoEhWtxIzXpn2yw==} + '@types/chai@5.2.2': + resolution: {integrity: sha512-8kB30R7Hwqf40JPiKhVzodJs2Qc1ZJ5zuT3uzw5Hq/dhNCl3G3l83jfpdI1e20BP348+fV7VIL/+FxaXkqBmWg==} + '@types/debug@4.1.12': resolution: {integrity: sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==} - '@types/diff@5.2.3': - resolution: {integrity: sha512-K0Oqlrq3kQMaO2RhfrNQX5trmt+XLyom88zS0u84nnIcLvFnRUMRRHmrGny5GSM+kNO9IZLARsdQHDzkhAgmrQ==} + '@types/deep-eql@4.0.2': + resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} '@types/estree-jsx@1.0.5': resolution: {integrity: sha512-52CcUVNFyfb1A2ALocQw/Dd1BQFNmSdkuC3BkZ6iqhdMfQz7JWOFRuJFloOzjk+6WijU56m9oKXFAXc7o3Towg==} @@ -7100,42 +5796,18 @@ packages: '@types/estree@1.0.6': resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} - '@types/git-url-parse@9.0.3': - resolution: {integrity: sha512-Wrb8zeghhpKbYuqAOg203g+9YSNlrZWNZYvwxJuDF4dTmerijqpnGbI79yCuPtHSXHPEwv1pAFUB4zsSqn82Og==} - - '@types/glob@7.2.0': - resolution: {integrity: sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA==} - '@types/hast@3.0.4': resolution: {integrity: sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==} - '@types/inquirer@9.0.7': - resolution: {integrity: sha512-Q0zyBupO6NxGRZut/JdmqYKOnN95Eg5V8Csg3PGKkP+FnvsUZx1jAyK7fztIszxxMuoBA6E3KXWvdZVXIpx60g==} - '@types/js-beautify@1.14.3': resolution: {integrity: sha512-FMbQHz+qd9DoGvgLHxeqqVPaNRffpIu5ZjozwV8hf9JAGpIOzuAf4wGbRSo8LNITHqGjmmVjaMggTT5P4v4IHg==} '@types/jscodeshift@0.11.11': resolution: {integrity: sha512-d7CAfFGOupj5qCDqMODXxNz2/NwCv/Lha78ZFbnr6qpk3K98iSB8I+ig9ERE2+EeYML352VMRsjPyOpeA+04eQ==} - '@types/json-schema@7.0.15': - resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==} - - '@types/lodash-es@4.17.12': - resolution: {integrity: sha512-0NgftHUcV4v34VhXm8QBSftKVXtbkBG3ViCjs6+eJ5a6y6Mi/jiFGPc1sC7QK+9BFhWrURE3EOggmWaSxL9OzQ==} - - '@types/lodash@4.17.15': - resolution: {integrity: sha512-w/P33JFeySuhN6JLkysYUK2gEmy9kHHFN7E8ro0tkfmlDOgxBDzWEZ/J8cWA+fHqFevpswDTFZnDx+R9lbL6xw==} - '@types/mdast@4.0.4': resolution: {integrity: sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==} - '@types/minimatch@5.1.2': - resolution: {integrity: sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA==} - - '@types/ms@0.7.34': - resolution: {integrity: sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==} - '@types/ms@2.1.0': resolution: {integrity: sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==} @@ -7157,12 +5829,12 @@ packages: '@types/node@20.9.0': resolution: {integrity: sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==} + '@types/node@24.3.0': + resolution: {integrity: sha512-aPTXCrfwnDLj4VvXrm+UUCQjNEvJgNA8s5F1cvwQU+3KNltTOkBm1j30uNLyqqPNe7gE3KFzImYoZEfLhp4Yow==} + '@types/pako@2.0.3': resolution: {integrity: sha512-bq0hMV9opAcrmE0Byyo0fY3Ew4tgOevJmQ9grUhpXQhYfyLJ1Kqg3P33JT5fdbT2AjeAjR51zqqVjAL/HMkx7Q==} - '@types/prettier@2.7.3': - resolution: {integrity: sha512-+68kP9yzs4LMp7VNh8gdzMSPZFL44MLGqiHWvttYJe+6qnuVr4Ek9wSBQoveqY/r+LwjCcU29kNVkidwim+kYA==} - '@types/react@19.0.8': resolution: {integrity: sha512-9P/o1IGdfmQxrujGbIMDyYaaCykhLKc0NGCtYcECNUr9UAaDe4gwvV9bR6tvd5Br1SG0j+PBpbKr2UYY8CwqSw==} @@ -7175,9 +5847,6 @@ packages: '@types/tar@6.1.13': resolution: {integrity: sha512-IznnlmU5f4WcGTh2ltRu/Ijpmk8wiWXfF0VA4s+HPjHZgvFggk1YaIkbo5krX/zUCzWF8N/l4+W/LNxnvAJ8nw==} - '@types/through@0.0.33': - resolution: {integrity: sha512-HsJ+z3QuETzP3cswwtzt2vEIiHBk/dCcHGhbmG5X3ecnwFD/lPrMpliGXxSCg03L9AhrdwA4Oz/qfspkDW+xGQ==} - '@types/unist@2.0.11': resolution: {integrity: sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==} @@ -7187,26 +5856,50 @@ packages: '@types/unzipper@0.10.10': resolution: {integrity: sha512-jKJdNxhmCHTZsaKW5x0qjn6rB+gHk0w5VFbEKsw84i+RJqXZyfTmGnpjDcKqzMpjz7VVLsUBMtO5T3mVidpt0g==} - '@vitest/coverage-v8@1.6.0': - resolution: {integrity: sha512-KvapcbMY/8GYIG0rlwwOKCVNRc0OL20rrhFkg/CHNzncV03TE2XWvO5w9uZYoxNiMEBacAJt3unSOiZ7svePew==} - peerDependencies: - vitest: 1.6.0 - '@vitest/expect@1.6.0': resolution: {integrity: sha512-ixEvFVQjycy/oNgHjqsL6AZCDduC+tflRluaHIzKIsdbzkLn2U/iBnVeJwB6HsIjQBdfMR8Z0tRxKUsvFJEeWQ==} + '@vitest/expect@3.2.4': + resolution: {integrity: sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==} + + '@vitest/mocker@3.2.4': + resolution: {integrity: sha512-46ryTE9RZO/rfDd7pEqFl7etuyzekzEhUbTW3BvmeO/BcCMEgq59BKhek3dXDWgAj4oMK6OZi+vRr1wPW6qjEQ==} + peerDependencies: + msw: ^2.4.9 + vite: ^5.0.0 || ^6.0.0 || ^7.0.0-0 + peerDependenciesMeta: + msw: + optional: true + vite: + optional: true + + '@vitest/pretty-format@3.2.4': + resolution: {integrity: sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==} + '@vitest/runner@1.6.0': resolution: {integrity: sha512-P4xgwPjwesuBiHisAVz/LSSZtDjOTPYZVmNAnpHHSR6ONrf8eCJOFRvUwdHn30F5M1fxhqtl7QZQUk2dprIXAg==} + '@vitest/runner@3.2.4': + resolution: {integrity: sha512-oukfKT9Mk41LreEW09vt45f8wx7DordoWUZMYdY/cyAk7w5TWkTRCNZYF7sX7n2wB7jyGAl74OxgwhPgKaqDMQ==} + '@vitest/snapshot@1.6.0': resolution: {integrity: sha512-+Hx43f8Chus+DCmygqqfetcAZrDJwvTj0ymqjQq4CvmpKFSTVteEOBzCusu1x2tt4OJcvBflyHUE0DZSLgEMtQ==} + '@vitest/snapshot@3.2.4': + resolution: {integrity: sha512-dEYtS7qQP2CjU27QBC5oUOxLE/v5eLkGqPE0ZKEIDGMs4vKWe7IjgLOeauHsR0D5YuuycGRO5oSRXnwnmA78fQ==} + '@vitest/spy@1.6.0': resolution: {integrity: sha512-leUTap6B/cqi/bQkXUu6bQV5TZPx7pmMBKBQiI0rJA8c3pB56ZsaTbREnF7CJfmvAS4V2cXIBAh/3rVwrrCYgw==} + '@vitest/spy@3.2.4': + resolution: {integrity: sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==} + '@vitest/utils@1.6.0': resolution: {integrity: sha512-21cPiuGMoMZwiOHa2i4LXkMkMkCGzA+MVFV70jRwHo95dL4x/ts5GZhML1QWuy7yfp3WzK3lRvZi3JnXTYqrBw==} + '@vitest/utils@3.2.4': + resolution: {integrity: sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==} + abbrev@2.0.0: resolution: {integrity: sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} @@ -7241,10 +5934,6 @@ packages: resolution: {integrity: sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==} engines: {node: '>=8'} - ansi-escapes@7.0.0: - resolution: {integrity: sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==} - engines: {node: '>=18'} - ansi-regex@5.0.1: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} @@ -7265,15 +5954,6 @@ packages: resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} engines: {node: '>=12'} - any-promise@1.3.0: - resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} - - arg@4.1.3: - resolution: {integrity: sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==} - - argparse@2.0.1: - resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} - array-buffer-byte-length@1.0.2: resolution: {integrity: sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==} engines: {node: '>= 0.4'} @@ -7285,6 +5965,10 @@ packages: assertion-error@1.1.0: resolution: {integrity: sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==} + assertion-error@2.0.1: + resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} + engines: {node: '>=12'} + ast-types@0.14.2: resolution: {integrity: sha512-O0yuUDnZeQDL+ncNGlJ78BiO4jnYI3bvMsD5prT0/nsgijG/LpNBIr63gTjVTNsiGkgQhiyCShTgxt8oXOrklA==} engines: {node: '>=4'} @@ -7393,9 +6077,6 @@ packages: resolution: {integrity: sha512-YTd+6wGlNlPxSuri7Y6X8tY2dmm12UMH66RpKMhiX6rsk5wXXnYgbUcOt8kiS31/AjfoTOvCsE+w8nZQLQnzHA==} engines: {node: '>= 0.4'} - call-me-maybe@1.0.2: - resolution: {integrity: sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==} - caniuse-lite@1.0.30001696: resolution: {integrity: sha512-pDCPkvzfa39ehJtJ+OwGT/2yvT2SbjfHhiIW2LWOAcMQ7BzwxT/XuyUp4OTOd0XFWA6BKw0JalnBHgSi5DGJBQ==} @@ -7409,14 +6090,14 @@ packages: resolution: {integrity: sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==} engines: {node: '>=4'} + chai@5.3.3: + resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==} + engines: {node: '>=18'} + chalk@4.1.2: resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==} engines: {node: '>=10'} - chalk@5.4.1: - resolution: {integrity: sha512-zgVZuo2WcZgfUEmsn6eO3kINexW8RAE4maiQ8QNs8CtpPCSyMiYsULR3HQYkm3w8FIA3SberyMJMSldGsW+U3w==} - engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} - change-case@5.4.4: resolution: {integrity: sha512-HRQyTk2/YPEkt9TnUPbOpr64Uw3KOicFWPVBb+xiHvd6eBx/qPr9xqfBFDT8P2vWsvvz4jbEkfDe71W3VyNu2w==} @@ -7441,6 +6122,10 @@ packages: check-error@1.0.3: resolution: {integrity: sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==} + check-error@2.1.1: + resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} + engines: {node: '>= 16'} + chevrotain@10.5.0: resolution: {integrity: sha512-Pkv5rBY3+CsHOYfV5g/Vs5JY9WTHHDEKOlohI2XeygaZhUeqhAlldZ8Hz9cRmxu709bvS08YzxHdTPHhffc13A==} @@ -7448,26 +6133,14 @@ packages: resolution: {integrity: sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==} engines: {node: '>=10'} - cli-color@2.0.4: - resolution: {integrity: sha512-zlnpg0jNcibNrO7GG9IeHH7maWFeCz+Ja1wx/7tZNU5ASSSSZ+/qZciM0/LHCYxSdqv5h2sdbQ/PXYdOuetXvA==} - engines: {node: '>=0.10'} - cli-cursor@3.1.0: resolution: {integrity: sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==} engines: {node: '>=8'} - cli-cursor@5.0.0: - resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==} - engines: {node: '>=18'} - cli-spinners@2.9.2: resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==} engines: {node: '>=6'} - cli-truncate@4.0.0: - resolution: {integrity: sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==} - engines: {node: '>=18'} - cli-width@4.1.0: resolution: {integrity: sha512-ouuZd4/dm2Sw5Gmqy6bGyNNNe1qt9RpmxveLSO7KcgsTnU7RXfsw+/bukWGo1abgBiMAic068rclZsO4IWmmxQ==} engines: {node: '>= 12'} @@ -7493,9 +6166,6 @@ packages: color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - colorette@2.0.20: - resolution: {integrity: sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==} - colors-cli@1.0.33: resolution: {integrity: sha512-PWGsmoJFdOB0t+BeHgmtuoRZUQucOLl5ii81NBzOOGVxlgE04muFNHlR5j8i8MKbOPELBl3243AI6lGBTj5ICQ==} hasBin: true @@ -7508,10 +6178,6 @@ packages: resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} engines: {node: '>=14'} - commander@13.1.0: - resolution: {integrity: sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==} - engines: {node: '>=18'} - commondir@1.0.1: resolution: {integrity: sha512-W9pAhw0ja1Edb5GVdIF1mjZw/ASI0AlShXM83UUGe2DVr5TdAPEA1OA8m/g8zWp9x6On7gqufY+FatDbC3MDQg==} @@ -7533,9 +6199,6 @@ packages: core-util-is@1.0.3: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} - create-require@1.1.1: - resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} - cross-spawn@7.0.6: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} @@ -7546,10 +6209,6 @@ packages: csstype@3.1.3: resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} - d@1.0.2: - resolution: {integrity: sha512-MOqHvMWF9/9MX6nza0KgvFH4HpMU0EF5uUDXqX/BtxtU8NfB0QzRtJ8Oe/6SuS4kbhyzVJwjd97EA4PKrzJ8bw==} - engines: {node: '>=0.12'} - data-view-buffer@1.0.2: resolution: {integrity: sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==} engines: {node: '>= 0.4'} @@ -7571,6 +6230,15 @@ packages: supports-color: optional: true + debug@4.4.1: + resolution: {integrity: sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + decode-named-character-reference@1.0.2: resolution: {integrity: sha512-O8x12RzrUF8xyVcY0KJowWsmaJxQbmy0/EtnNtHRpsOcT7dFk5W598coHqBVpmWo1oQQfsCqfCmkZN5DJrZVdg==} @@ -7578,6 +6246,10 @@ packages: resolution: {integrity: sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==} engines: {node: '>=6'} + deep-eql@5.0.2: + resolution: {integrity: sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==} + engines: {node: '>=6'} + defaults@1.0.4: resolution: {integrity: sha512-eFuaLoy/Rxalv2kr+lqMlUnrDWV+3j4pljOIJgLIhI058IQfWJ7vXhyEIHu+HtC738klGALYxOKDO0bQP3tg8A==} @@ -7619,10 +6291,6 @@ packages: resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} - diff@4.0.2: - resolution: {integrity: sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==} - engines: {node: '>=0.3.1'} - diff@5.2.0: resolution: {integrity: sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==} engines: {node: '>=0.3.1'} @@ -7648,19 +6316,12 @@ packages: electron-to-chromium@1.5.90: resolution: {integrity: sha512-C3PN4aydfW91Natdyd449Kw+BzhLmof6tzy5W1pFC5SpQxVXT+oyiyOG9AgYYSN9OdA/ik3YkCrpwqI8ug5Tug==} - emoji-regex@10.4.0: - resolution: {integrity: sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==} - emoji-regex@8.0.0: resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==} emoji-regex@9.2.2: resolution: {integrity: sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==} - environment@1.1.0: - resolution: {integrity: sha512-xUtoPkMggbz0MPyPiIWr1Kp4aeWJjDZ6SMvURhimjdZgsRuDplF5/s9hcgGhyXMhs+6vpnuoiZ2kFiu3FMnS8Q==} - engines: {node: '>=18'} - error-cause@1.0.8: resolution: {integrity: sha512-FzJMFOPX/920y2mE2idEv6vGotM9S+Wv0sGW2m5fLoK0ajOg6C9NLNlPOYQaySFEtLtRL5OyDA1sOYdHCFXEpg==} engines: {node: '>= 0.4'} @@ -7681,6 +6342,9 @@ packages: resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} engines: {node: '>= 0.4'} + es-module-lexer@1.7.0: + resolution: {integrity: sha512-jEQoCwk8hyb2AZziIOLhDqpm5+2ww5uIE6lkO/6jcOCusfk6LhMHpXXfBLXTZ7Ydyt0j4VoUQv6uGNYbdW+kBA==} + es-object-atoms@1.1.1: resolution: {integrity: sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==} engines: {node: '>= 0.4'} @@ -7693,25 +6357,6 @@ packages: resolution: {integrity: sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==} engines: {node: '>= 0.4'} - es5-ext@0.10.64: - resolution: {integrity: sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==} - engines: {node: '>=0.10'} - - es6-iterator@2.0.3: - resolution: {integrity: sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==} - - es6-symbol@3.1.4: - resolution: {integrity: sha512-U9bFFjX8tFiATgtkJ1zg25+KviIXpgRvRHS8sau3GfhVzThRQrOeksPeT0BWW2MNZs1OEWJ1DPXOQMn0KKRkvg==} - engines: {node: '>=0.12'} - - es6-weak-map@2.0.3: - resolution: {integrity: sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA==} - - esbuild@0.17.19: - resolution: {integrity: sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==} - engines: {node: '>=12'} - hasBin: true - esbuild@0.19.5: resolution: {integrity: sha512-bUxalY7b1g8vNhQKdB24QDmHeY4V4tw/s6Ak5z+jJX9laP5MoQseTOMemAr0gxssjNcH0MCViG8ONI2kksvfFQ==} engines: {node: '>=12'} @@ -7730,10 +6375,6 @@ packages: resolution: {integrity: sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==} engines: {node: '>=12'} - esniff@2.0.1: - resolution: {integrity: sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==} - engines: {node: '>=0.10'} - esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} @@ -7752,22 +6393,17 @@ packages: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} - event-emitter@0.3.5: - resolution: {integrity: sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==} - event-target-shim@5.0.1: resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} engines: {node: '>=6'} - eventemitter3@5.0.1: - resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} - execa@8.0.1: resolution: {integrity: sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==} engines: {node: '>=16.17'} - ext@1.7.0: - resolution: {integrity: sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==} + expect-type@1.2.2: + resolution: {integrity: sha512-JhFGDVJ7tmDJItKhYgJCGLOWjuK9vPxiXoUFLwLDc99NlmklilbiQJwoctZtt13+xMw91MCk/REan6MWHqDjyA==} + engines: {node: '>=12.0.0'} external-editor@3.1.0: resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} @@ -7791,6 +6427,15 @@ packages: picomatch: optional: true + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} + peerDependencies: + picomatch: ^3 || ^4 + peerDependenciesMeta: + picomatch: + optional: true + filename-reserved-regex@3.0.0: resolution: {integrity: sha512-hn4cQfU6GOT/7cFHXBqeBg2TbrMBgdD0kcjLhvSQYYwm3s4B6cjvBfb7nBALJLAXqmU5xajSa7X2NnUud/VCdw==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} @@ -7865,10 +6510,6 @@ packages: resolution: {integrity: sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg==} engines: {node: '>=6.9.0'} - get-east-asian-width@1.3.0: - resolution: {integrity: sha512-vpeMIQKxczTD/0s2CdEWHcb0eeJe6TFjxb+J5xgX7hScxqrGuyjmv4c1D4A/gelKfyox0gJJwIHF+fLjeaM8kQ==} - engines: {node: '>=18'} - get-func-name@2.0.2: resolution: {integrity: sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==} @@ -7880,10 +6521,6 @@ packages: resolution: {integrity: sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==} engines: {node: '>= 0.4'} - get-stdin@8.0.0: - resolution: {integrity: sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==} - engines: {node: '>=10'} - get-stream@8.0.1: resolution: {integrity: sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==} engines: {node: '>=16'} @@ -7902,12 +6539,6 @@ packages: resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} engines: {node: '>= 6'} - glob-promise@4.2.2: - resolution: {integrity: sha512-xcUzJ8NWN5bktoTIX7eOclO1Npxd/dyVqUJxlLIDasT4C7KZyqlPIwkdJ0Ypiy3p2ZKahTjK4M9uC3sNSfNMzw==} - engines: {node: '>=12'} - peerDependencies: - glob: ^7.1.6 - glob@10.4.5: resolution: {integrity: sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==} hasBin: true @@ -7958,9 +6589,6 @@ packages: resolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==} engines: {node: '>= 0.4'} - html-escaper@2.0.2: - resolution: {integrity: sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==} - human-signals@5.0.0: resolution: {integrity: sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==} engines: {node: '>=16.17.0'} @@ -7968,11 +6596,6 @@ packages: humanize-ms@1.2.1: resolution: {integrity: sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==} - husky@9.1.7: - resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==} - engines: {node: '>=18'} - hasBin: true - hyperdyperid@1.2.0: resolution: {integrity: sha512-Y93lCzHYgGWdrJ66yIktxiaGULYc6oGiABxhcO5AufBeOyoIdZF7bIfLaOrbM0iGIOXQQgxxRrFEnb+Y6w1n4A==} engines: {node: '>=10.18'} @@ -8062,14 +6685,6 @@ packages: resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==} engines: {node: '>=8'} - is-fullwidth-code-point@4.0.0: - resolution: {integrity: sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==} - engines: {node: '>=12'} - - is-fullwidth-code-point@5.0.0: - resolution: {integrity: sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==} - engines: {node: '>=18'} - is-generator-function@1.1.0: resolution: {integrity: sha512-nPUB5km40q9e8UfN/Zc24eLlzdSf9OfKByBw9CIdw4H1giPMeA0OIJvbchsCu4npfI2QcMVBsGEBHKZ7wLTWmQ==} engines: {node: '>= 0.4'} @@ -8101,9 +6716,6 @@ packages: resolution: {integrity: sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==} engines: {node: '>=0.10.0'} - is-promise@2.2.2: - resolution: {integrity: sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==} - is-regex@1.2.1: resolution: {integrity: sha512-MjYsKHO5O7mCsmRGxWcLWheFqN9DJ/2TmngvjKXihe6efViPqc274+Fx/4fYj/r03+ESvBdTXK0V6tA3rgez1g==} engines: {node: '>= 0.4'} @@ -8164,22 +6776,6 @@ packages: resolution: {integrity: sha512-WhB9zCku7EGTj/HQQRz5aUQEUeoQZH2bWcltRErOpymJ4boYE6wL9Tbr23krRPSZ+C5zqNSrSw+Cc7sZZ4b7vg==} engines: {node: '>=0.10.0'} - istanbul-lib-coverage@3.2.2: - resolution: {integrity: sha512-O8dpsF+r0WV/8MNRKfnmrtCWhuKjxrq2w+jpzBL5UZKTi2LeVWnWOmWRxFlesJONmc+wLAGvKQZEOanko0LFTg==} - engines: {node: '>=8'} - - istanbul-lib-report@3.0.1: - resolution: {integrity: sha512-GCfE1mtsHGOELCU8e/Z7YWzpmybrx/+dSTfLrvY8qRmaY6zXTKWn6WQIjaAFw069icm6GVMNkgu0NzI4iPZUNw==} - engines: {node: '>=10'} - - istanbul-lib-source-maps@5.0.6: - resolution: {integrity: sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==} - engines: {node: '>=10'} - - istanbul-reports@3.1.7: - resolution: {integrity: sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==} - engines: {node: '>=8'} - jackspeak@3.4.3: resolution: {integrity: sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==} @@ -8198,10 +6794,6 @@ packages: js-tokens@9.0.1: resolution: {integrity: sha512-mxa9E9ITFOt0ban3j6L5MpjwegGz6lBQmM1IJkWeBZGcMxto50+eWdjC/52xDbS2vy0k7vIMK0Fe2wfL9OQSpQ==} - js-yaml@4.1.0: - resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} - hasBin: true - jscodeshift@0.14.0: resolution: {integrity: sha512-7eCC1knD7bLUPuSCwXsMZUH51O8jIcoVyKtI6P0XM0IVzlGjckPy3FIwQlorzbN0Sg79oK+RlohN32Mqf/lrYA==} hasBin: true @@ -8236,11 +6828,6 @@ packages: engines: {node: '>=6'} hasBin: true - json-schema-to-typescript@13.1.2: - resolution: {integrity: sha512-17G+mjx4nunvOpkPvcz7fdwUwYCEwyH8vR3Ym3rFiQ8uzAL3go+c1306Kk7iGRk8HuXBXqy+JJJmpYl0cvOllw==} - engines: {node: '>=12.0.0'} - hasBin: true - json5@2.2.3: resolution: {integrity: sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg==} engines: {node: '>=6'} @@ -8257,19 +6844,6 @@ packages: resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} engines: {node: '>=10'} - lilconfig@3.1.3: - resolution: {integrity: sha512-/vlFKAoH5Cgt3Ie+JLhRbwOsCQePABiU3tJ1egGvyQ+33R/vcwM2Zl2QR/LzjsBeItPt3oSVXapn+m4nQDvpzw==} - engines: {node: '>=14'} - - lint-staged@15.5.2: - resolution: {integrity: sha512-YUSOLq9VeRNAo/CTaVmhGDKG+LBtA8KF1X4K5+ykMSwWST1vDxJRB2kv2COgLb1fvpCo+A/y9A0G0znNVmdx4w==} - engines: {node: '>=18.12.0'} - hasBin: true - - listr2@8.3.3: - resolution: {integrity: sha512-LWzX2KsqcB1wqQ4AHgYb4RsDXauQiqhjLk+6hjbaeHG4zpjjVAB6wC/gz6X0l+Du1cN3pUB5ZlrvTbhGSNnUQQ==} - engines: {node: '>=18.0.0'} - local-pkg@0.5.1: resolution: {integrity: sha512-9rrA30MRRP3gBD3HTGnC6cDFpaE1kVDWxWgqWJUN0RvDNAo+Nz/9GxB+nHOH0ifbVFy0hSA1V6vFDvnx54lTEQ==} engines: {node: '>=14'} @@ -8295,16 +6869,15 @@ packages: resolution: {integrity: sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==} engines: {node: '>=10'} - log-update@6.1.0: - resolution: {integrity: sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==} - engines: {node: '>=18'} - longest-streak@3.1.0: resolution: {integrity: sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==} loupe@2.3.7: resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} + loupe@3.2.1: + resolution: {integrity: sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==} + lower-case@2.0.2: resolution: {integrity: sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==} @@ -8314,26 +6887,13 @@ packages: lru-cache@5.1.1: resolution: {integrity: sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==} - lru-queue@0.1.0: - resolution: {integrity: sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ==} - magic-string@0.30.17: resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==} - magicast@0.3.5: - resolution: {integrity: sha512-L0WhttDl+2BOsybvEOLK7fW3UA0OQ0IQ2d6Zl2x/a6vVRs3bAY0ECOSHHeL5jD+SbOpOCUEi0y1DgHEn9Qn1AQ==} - make-dir@2.1.0: resolution: {integrity: sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==} engines: {node: '>=6'} - make-dir@4.0.0: - resolution: {integrity: sha512-hXdUTZYIVOt1Ex//jAQi+wTZZpUpwBj/0QsOzqegb3rGMMeJiSEu5xLHnYfBrRV4RH2+OCSOO95Is/7x1WJ4bw==} - engines: {node: '>=10'} - - make-error@1.3.6: - resolution: {integrity: sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==} - math-intrinsics@1.1.0: resolution: {integrity: sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==} engines: {node: '>= 0.4'} @@ -8369,10 +6929,6 @@ packages: resolution: {integrity: sha512-4eirfZ7thblFmqFjywlTmuWVSvccHAJbn1r8qQLzmTO11qcqpohOjmY2mFce6x7x7WtskzRqApPD0hv+Oa74jg==} engines: {node: '>= 4.0.0'} - memoizee@0.4.17: - resolution: {integrity: sha512-DGqD7Hjpi/1or4F/aYAspXKNm5Yili0QDAFAY4QYvpqpgiY6+1jOfqpmByzjxbWd/T9mChbCArXAbDAsTm5oXA==} - engines: {node: '>=0.12'} - merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} @@ -8484,10 +7040,6 @@ packages: resolution: {integrity: sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==} engines: {node: '>=12'} - mimic-function@5.0.1: - resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==} - engines: {node: '>=18'} - minimatch@3.1.2: resolution: {integrity: sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==} @@ -8555,9 +7107,6 @@ packages: resolution: {integrity: sha512-avsJQhyd+680gKXyG/sQc0nXaC6rBkPOfyHYcFb9+hdkqQkR9bdnkJ0AMZhke0oesPqIO+mFFJ+IdBc7mst4IA==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - mz@2.7.0: - resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} - nanoid@3.3.8: resolution: {integrity: sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==} engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1} @@ -8566,9 +7115,6 @@ packages: neo-async@2.6.2: resolution: {integrity: sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==} - next-tick@1.1.0: - resolution: {integrity: sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==} - nise@5.1.9: resolution: {integrity: sha512-qOnoujW4SV6e40dYxJOb3uvuoPHtmLzIk4TFo+j0jPJoC+5Z9xja5qH5JZobEPsa8+YYphMrOSwnrshEhG2qww==} @@ -8582,6 +7128,7 @@ packages: node-domexception@1.0.0: resolution: {integrity: sha512-/jKZoMpw0F8GRwl4/eLROPA3cfcXtLApP0QzLmUT/HuPCZWyB7IY9ZrMeKw2O/nFIqPQB3PVM9aYm0F312AXDQ==} engines: {node: '>=10.5.0'} + deprecated: Use your platform's native DOMException instead node-fetch@2.7.0: resolution: {integrity: sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==} @@ -8604,10 +7151,6 @@ packages: resolution: {integrity: sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - object-assign@4.1.1: - resolution: {integrity: sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==} - engines: {node: '>=0.10.0'} - object-inspect@1.13.3: resolution: {integrity: sha512-kDCGIbxkDSXE3euJZZXzc6to7fCrKHNI/hSRQnRuQ+BWjFNzZwiFF8fj/6o2t2G9/jTj8PSIYTfCLelLZEeRpA==} engines: {node: '>= 0.4'} @@ -8631,10 +7174,6 @@ packages: resolution: {integrity: sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==} engines: {node: '>=12'} - onetime@7.0.0: - resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==} - engines: {node: '>=18'} - openai@4.23.0: resolution: {integrity: sha512-ey2CXh1OTcTUa0AWZWuTpgA9t5GuAG3DVU1MofCRUI7fQJij8XJ3Sr0VtgxoAE69C9wbHBMCux8Z/IQZfSwHiA==} hasBin: true @@ -8717,9 +7256,16 @@ packages: pathe@2.0.2: resolution: {integrity: sha512-15Ztpk+nov8DR524R4BF7uEuzESgzUEAV4Ah7CUMNGXdE5ELuvxElxGXndBl32vMSsWa1jpNf22Z+Er3sKwq+w==} + pathe@2.0.3: + resolution: {integrity: sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==} + pathval@1.1.1: resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} + pathval@2.0.1: + resolution: {integrity: sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==} + engines: {node: '>= 14.16'} + picocolors@1.1.1: resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==} @@ -8731,11 +7277,6 @@ packages: resolution: {integrity: sha512-M7BAV6Rlcy5u+m6oPhAPFgJTzAioX/6B0DxyvDlo9l8+T3nLKbrczg2WLUyzd45L8RqfUMyGPzekbMvX2Ldkwg==} engines: {node: '>=12'} - pidtree@0.6.0: - resolution: {integrity: sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==} - engines: {node: '>=0.10'} - hasBin: true - pify@4.0.1: resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} engines: {node: '>=6'} @@ -8759,11 +7300,6 @@ packages: resolution: {integrity: sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ==} engines: {node: ^10 || ^12 || >=14} - prettier@2.8.8: - resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} - engines: {node: '>=10.13.0'} - hasBin: true - prettier@3.4.2: resolution: {integrity: sha512-e9MewbtFo+Fevyuxn/4rrcDAaq0IYxPGLvObpQjiZBMAzB9IGmzlnG9RZy3FFas+eBMu2vA0CszMeduow5dIuQ==} engines: {node: '>=14'} @@ -8855,17 +7391,10 @@ packages: resolution: {integrity: sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==} engines: {node: '>=8'} - restore-cursor@5.1.0: - resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==} - engines: {node: '>=18'} - reusify@1.0.4: resolution: {integrity: sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==} engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - rfdc@1.4.1: - resolution: {integrity: sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==} - rimraf@2.6.3: resolution: {integrity: sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==} deprecated: Rimraf versions prior to v4 are no longer supported @@ -8982,14 +7511,6 @@ packages: resolution: {integrity: sha512-nPS85arNqwBXaIsFCkolHjGIkFo+Oxu9vbgmBJizLAhqe6P2o3Qmj3KCUoRkfhHtvgDhZdWD3risLHAUJ8npjw==} deprecated: 16.1.1 - slice-ansi@5.0.0: - resolution: {integrity: sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==} - engines: {node: '>=12'} - - slice-ansi@7.1.0: - resolution: {integrity: sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==} - engines: {node: '>=18'} - source-map-js@1.2.1: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} @@ -9007,13 +7528,12 @@ packages: std-env@3.8.0: resolution: {integrity: sha512-Bc3YwwCB+OzldMxOXJIIvC6cPRWr/LxOp48CdQTOkPyk/t4JWWJbrilwBd7RJzKV8QW7tJkcgAmeuLLJugl5/w==} + std-env@3.9.0: + resolution: {integrity: sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==} + streamx@2.22.0: resolution: {integrity: sha512-sLh1evHOzBy/iWRiR6d1zRcLao4gGZr3C1kzNz4fopCOKJb6xD9ub8Mpi9Mr1R6id5o43S+d93fI48UC5uM9aw==} - string-argv@0.3.2: - resolution: {integrity: sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==} - engines: {node: '>=0.6.19'} - string-width@4.2.3: resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==} engines: {node: '>=8'} @@ -9022,10 +7542,6 @@ packages: resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==} engines: {node: '>=12'} - string-width@7.2.0: - resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==} - engines: {node: '>=18'} - string.prototype.trim@1.2.10: resolution: {integrity: sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==} engines: {node: '>= 0.4'} @@ -9062,6 +7578,9 @@ packages: strip-literal@2.1.1: resolution: {integrity: sha512-631UJ6O00eNGfMiWG78ck80dfBab8X6IVFB51jZK5Icd7XAs60Z5y7QdSd/wGIklnWvRbUNloVzhOKKmutxQ6Q==} + strip-literal@3.0.0: + resolution: {integrity: sha512-TcccoMhJOM3OebGhSBEmp3UZ2SfDMZUEBdRA/9ynfLi8yYajyWX3JiXArcJt4Umh4vISpspkQIY8ZZoCqjbviA==} + supports-color@7.2.0: resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} engines: {node: '>=8'} @@ -9085,48 +7604,52 @@ packages: resolution: {integrity: sha512-yYrrsWnrXMcdsnu/7YMYAofM1ktpL5By7vZhf15CrXijWWrEYZks5AXBudalfSWJLlnen/QUJUB5aoB0kqZUGA==} engines: {node: '>=6.0.0'} - test-exclude@6.0.0: - resolution: {integrity: sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==} - engines: {node: '>=8'} - text-decoder@1.2.3: resolution: {integrity: sha512-3/o9z3X0X0fTupwsYvR03pJ/DjWuqqrfwBgTQzdWDiQSm9KitAyz/9WqsT2JQW7KV2m+bC2ol/zqpW37NHxLaA==} - thenify-all@1.6.0: - resolution: {integrity: sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==} - engines: {node: '>=0.8'} - - thenify@3.3.1: - resolution: {integrity: sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==} - thingies@1.21.0: resolution: {integrity: sha512-hsqsJsFMsV+aD4s3CWKk85ep/3I9XzYV/IXaSouJMYIoDlgyi11cBhsqYe9/geRfB0YIikBQg6raRaM+nIMP9g==} engines: {node: '>=10.18'} peerDependencies: tslib: ^2 - timers-ext@0.1.8: - resolution: {integrity: sha512-wFH7+SEAcKfJpfLPkrgMPvvwnEtj8W4IurvEyrKsDleXnKLCDw71w8jltvfLa8Rm4qQxxT4jmDBYbJG/z7qoww==} - engines: {node: '>=0.12'} - tiny-invariant@1.3.3: resolution: {integrity: sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==} tinybench@2.9.0: resolution: {integrity: sha512-0+DUvqWMValLmha6lr4kD8iAMK1HzV0/aKnCtWb9v9641TnP/MFb7Pc2bxoxQjTXAErryXVgUOfv2YqNllqGeg==} + tinyexec@0.3.2: + resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} + tinyglobby@0.2.10: resolution: {integrity: sha512-Zc+8eJlFMvgatPZTl6A9L/yht8QqdmUNtURHaKZLmKBE12hNPSrqNkUp2cs3M/UKmNVVAMFQYSjYIVHDjW5zew==} engines: {node: '>=12.0.0'} + tinyglobby@0.2.14: + resolution: {integrity: sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==} + engines: {node: '>=12.0.0'} + tinypool@0.8.4: resolution: {integrity: sha512-i11VH5gS6IFeLY3gMBQ00/MmLncVP7JLXOw1vlgkytLmJK7QnEr7NXf0LBdxfmNPAeyetukOk0bOYrJrFGjYJQ==} engines: {node: '>=14.0.0'} + tinypool@1.1.1: + resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==} + engines: {node: ^18.0.0 || >=20.0.0} + + tinyrainbow@2.0.0: + resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} + engines: {node: '>=14.0.0'} + tinyspy@2.2.1: resolution: {integrity: sha512-KYad6Vy5VDWV4GH3fjpseMQ/XU2BhIYP7Vzd0LG44qRWm/Yt2WCOTicFdvmgo6gWaqooMQCawTtILVQJupKu7A==} engines: {node: '>=14.0.0'} + tinyspy@4.0.3: + resolution: {integrity: sha512-t2T/WLB2WRgZ9EpE4jgPJ9w+i66UZfDc8wHh0xrwiRNN+UwH98GIJkTeZqX9rg0i0ptwzqW+uYeIF0T4F8LR7A==} + engines: {node: '>=14.0.0'} + tmp@0.0.33: resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} engines: {node: '>=0.6.0'} @@ -9144,73 +7667,25 @@ packages: peerDependencies: tslib: '2' - tree-kill@1.2.2: - resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} - hasBin: true - - ts-invariant@0.10.3: - resolution: {integrity: sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ==} - engines: {node: '>=8'} - - ts-morph@19.0.0: - resolution: {integrity: sha512-D6qcpiJdn46tUqV45vr5UGM2dnIEuTGNxVhg0sk5NX11orcouwj6i1bMqZIz2mZTZB1Hcgy7C3oEVhAT+f6mbQ==} - - ts-morph@22.0.0: - resolution: {integrity: sha512-M9MqFGZREyeb5fTl6gNHKZLqBQA0TjA1lea+CR48R8EBTDuWrNqW6ccC5QvjNR4s6wDumD3LTCjOFSp9iwlzaw==} - - ts-morph@24.0.0: - resolution: {integrity: sha512-2OAOg/Ob5yx9Et7ZX4CvTCc0UFoZHwLEJ+dpDPSUi5TgwwlTlX47w+iFRrEwzUZwYACjq83cgjS/Da50Ga37uw==} - - ts-node@10.9.1: - resolution: {integrity: sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==} - hasBin: true - peerDependencies: - '@swc/core': '>=1.2.50' - '@swc/wasm': '>=1.2.50' - '@types/node': '*' - typescript: '>=2.7' - peerDependenciesMeta: - '@swc/core': - optional: true - '@swc/wasm': - optional: true - - tslib@2.8.1: - resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} - - turbo-darwin-64@1.13.4: - resolution: {integrity: sha512-A0eKd73R7CGnRinTiS7txkMElg+R5rKFp9HV7baDiEL4xTG1FIg/56Vm7A5RVgg8UNgG2qNnrfatJtb+dRmNdw==} - cpu: [x64] - os: [darwin] - - turbo-darwin-arm64@1.13.4: - resolution: {integrity: sha512-eG769Q0NF6/Vyjsr3mKCnkG/eW6dKMBZk6dxWOdrHfrg6QgfkBUk0WUUujzdtVPiUIvsh4l46vQrNVd9EOtbyA==} - cpu: [arm64] - os: [darwin] - - turbo-linux-64@1.13.4: - resolution: {integrity: sha512-Bq0JphDeNw3XEi+Xb/e4xoKhs1DHN7OoLVUbTIQz+gazYjigVZvtwCvgrZI7eW9Xo1eOXM2zw2u1DGLLUfmGkQ==} - cpu: [x64] - os: [linux] + tree-kill@1.2.2: + resolution: {integrity: sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==} + hasBin: true - turbo-linux-arm64@1.13.4: - resolution: {integrity: sha512-BJcXw1DDiHO/okYbaNdcWN6szjXyHWx9d460v6fCHY65G8CyqGU3y2uUTPK89o8lq/b2C8NK0yZD+Vp0f9VoIg==} - cpu: [arm64] - os: [linux] + ts-invariant@0.10.3: + resolution: {integrity: sha512-uivwYcQaxAucv1CzRp2n/QdYPo4ILf9VXgH19zEIjFx2EJufV16P0JtJVpYHy89DItG6Kwj2oIUjrcK5au+4tQ==} + engines: {node: '>=8'} - turbo-windows-64@1.13.4: - resolution: {integrity: sha512-OFFhXHOFLN7A78vD/dlVuuSSVEB3s9ZBj18Tm1hk3aW1HTWTuAw0ReN6ZNlVObZUHvGy8d57OAGGxf2bT3etQw==} - cpu: [x64] - os: [win32] + ts-morph@19.0.0: + resolution: {integrity: sha512-D6qcpiJdn46tUqV45vr5UGM2dnIEuTGNxVhg0sk5NX11orcouwj6i1bMqZIz2mZTZB1Hcgy7C3oEVhAT+f6mbQ==} - turbo-windows-arm64@1.13.4: - resolution: {integrity: sha512-u5A+VOKHswJJmJ8o8rcilBfU5U3Y1TTAfP9wX8bFh8teYF1ghP0EhtMRLjhtp6RPa+XCxHHVA2CiC3gbh5eg5g==} - cpu: [arm64] - os: [win32] + ts-morph@22.0.0: + resolution: {integrity: sha512-M9MqFGZREyeb5fTl6gNHKZLqBQA0TjA1lea+CR48R8EBTDuWrNqW6ccC5QvjNR4s6wDumD3LTCjOFSp9iwlzaw==} - turbo@1.13.4: - resolution: {integrity: sha512-1q7+9UJABuBAHrcC4Sxp5lOqYS5mvxRrwa33wpIyM18hlOCpRD/fTJNxZ0vhbMcJmz15o9kkVm743mPn7p6jpQ==} - hasBin: true + ts-morph@24.0.0: + resolution: {integrity: sha512-2OAOg/Ob5yx9Et7ZX4CvTCc0UFoZHwLEJ+dpDPSUi5TgwwlTlX47w+iFRrEwzUZwYACjq83cgjS/Da50Ga37uw==} + + tslib@2.8.1: + resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} type-detect@4.0.8: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} @@ -9228,9 +7703,6 @@ packages: resolution: {integrity: sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==} engines: {node: '>=12.20'} - type@2.7.3: - resolution: {integrity: sha512-8j+1QmAbPvLZow5Qpi6NCaN8FB60p/6x8/vfNqOk/hC+HuvFZhL4+WfekuhQLiqFZXOgQdrs3B+XxEmCc6b3FQ==} - typed-array-buffer@1.0.3: resolution: {integrity: sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==} engines: {node: '>= 0.4'} @@ -9257,6 +7729,11 @@ packages: engines: {node: '>=14.17'} hasBin: true + typescript@5.9.2: + resolution: {integrity: sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==} + engines: {node: '>=14.17'} + hasBin: true + ufo@1.5.4: resolution: {integrity: sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==} @@ -9273,6 +7750,9 @@ packages: undici-types@6.19.8: resolution: {integrity: sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==} + undici-types@7.10.0: + resolution: {integrity: sha512-t5Fy/nfn+14LuOc2KNYg75vZqClpAiqscVvMygNnlsHBFpSXdJaYtXMcdNLpl/Qvc3P2cB3s6lOV51nqsFq4ag==} + unicode-canonical-property-names-ecmascript@2.0.1: resolution: {integrity: sha512-dA8WbNeb2a6oQzAQ55YlT5vQAWGV9WXOsi3SskE3bcCdM0P4SDd+24zS/OCacdRq5BkdsRj9q3Pg6YyQoxIGqg==} engines: {node: '>=4'} @@ -9322,9 +7802,6 @@ packages: util-deprecate@1.0.2: resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - v8-compile-cache-lib@3.0.1: - resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} - valibot@0.34.0: resolution: {integrity: sha512-TELvxO0hEB1/6XjTS5Jfi4dS0oyawA5flxs4/sK/tSUXnlLMiKTMYE6Atuu0a7kvtP3eqPv3yZ80msfM+qMDHA==} @@ -9336,6 +7813,11 @@ packages: engines: {node: ^18.0.0 || >=20.0.0} hasBin: true + vite-node@3.2.4: + resolution: {integrity: sha512-EbKSKh+bh1E1IFxeO0pg1n4dvoOTt0UDiXMd/qn++r98+jPO1xtJilvXldeuQ8giIB5IkpjCgMleHMNEsGH6pg==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + vite@5.4.14: resolution: {integrity: sha512-EK5cY7Q1D8JNhSaPKVK4pwBFvaTmZxEnoKXLG/U9gmdDcihQGNzFlgIvaxezFR4glP1LsuiedwMBqCXH3wZccA==} engines: {node: ^18.0.0 || >=20.0.0} @@ -9392,6 +7874,34 @@ packages: jsdom: optional: true + vitest@3.2.4: + resolution: {integrity: sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==} + engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} + hasBin: true + peerDependencies: + '@edge-runtime/vm': '*' + '@types/debug': ^4.1.12 + '@types/node': ^18.0.0 || ^20.0.0 || >=22.0.0 + '@vitest/browser': 3.2.4 + '@vitest/ui': 3.2.4 + happy-dom: '*' + jsdom: '*' + peerDependenciesMeta: + '@edge-runtime/vm': + optional: true + '@types/debug': + optional: true + '@types/node': + optional: true + '@vitest/browser': + optional: true + '@vitest/ui': + optional: true + happy-dom: + optional: true + jsdom: + optional: true + wcwidth@1.0.1: resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} @@ -9447,10 +7957,6 @@ packages: resolution: {integrity: sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==} engines: {node: '>=12'} - wrap-ansi@9.0.0: - resolution: {integrity: sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==} - engines: {node: '>=18'} - wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} @@ -9472,10 +7978,6 @@ packages: engines: {node: '>= 14'} hasBin: true - yn@3.1.1: - resolution: {integrity: sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==} - engines: {node: '>=6'} - yocto-queue@1.1.1: resolution: {integrity: sha512-b4JR1PFR10y1mKjhHY9LaGo6tmrgjit7hxVIeAmyMw3jegXR4dhYqLaQF5zMXZxY7tLpMyJeLjr1C4rLmkVe8g==} engines: {node: '>=12.20'} @@ -9639,7 +8141,7 @@ snapshots: '@babel/core': 7.26.7 '@babel/helper-compilation-targets': 7.26.5 '@babel/helper-plugin-utils': 7.26.5 - debug: 4.4.0 + debug: 4.4.1 lodash.debounce: 4.0.8 resolve: 1.22.10 transitivePeerDependencies: @@ -10297,83 +8799,39 @@ snapshots: '@babel/helper-string-parser': 7.25.9 '@babel/helper-validator-identifier': 7.25.9 - '@bcherny/json-schema-ref-parser@10.0.5-fork': - dependencies: - '@jsdevtools/ono': 7.1.3 - '@types/json-schema': 7.0.15 - call-me-maybe: 1.0.2 - js-yaml: 4.1.0 - - '@bcoe/v8-coverage@0.2.3': {} - - '@biomejs/biome@1.5.3': + '@biomejs/biome@2.2.2': optionalDependencies: - '@biomejs/cli-darwin-arm64': 1.5.3 - '@biomejs/cli-darwin-x64': 1.5.3 - '@biomejs/cli-linux-arm64': 1.5.3 - '@biomejs/cli-linux-arm64-musl': 1.5.3 - '@biomejs/cli-linux-x64': 1.5.3 - '@biomejs/cli-linux-x64-musl': 1.5.3 - '@biomejs/cli-win32-arm64': 1.5.3 - '@biomejs/cli-win32-x64': 1.5.3 - - '@biomejs/biome@1.9.4': - optionalDependencies: - '@biomejs/cli-darwin-arm64': 1.9.4 - '@biomejs/cli-darwin-x64': 1.9.4 - '@biomejs/cli-linux-arm64': 1.9.4 - '@biomejs/cli-linux-arm64-musl': 1.9.4 - '@biomejs/cli-linux-x64': 1.9.4 - '@biomejs/cli-linux-x64-musl': 1.9.4 - '@biomejs/cli-win32-arm64': 1.9.4 - '@biomejs/cli-win32-x64': 1.9.4 - - '@biomejs/cli-darwin-arm64@1.5.3': - optional: true - - '@biomejs/cli-darwin-arm64@1.9.4': - optional: true - - '@biomejs/cli-darwin-x64@1.5.3': - optional: true - - '@biomejs/cli-darwin-x64@1.9.4': - optional: true - - '@biomejs/cli-linux-arm64-musl@1.5.3': - optional: true - - '@biomejs/cli-linux-arm64-musl@1.9.4': - optional: true - - '@biomejs/cli-linux-arm64@1.5.3': - optional: true - - '@biomejs/cli-linux-arm64@1.9.4': - optional: true - - '@biomejs/cli-linux-x64-musl@1.5.3': + '@biomejs/cli-darwin-arm64': 2.2.2 + '@biomejs/cli-darwin-x64': 2.2.2 + '@biomejs/cli-linux-arm64': 2.2.2 + '@biomejs/cli-linux-arm64-musl': 2.2.2 + '@biomejs/cli-linux-x64': 2.2.2 + '@biomejs/cli-linux-x64-musl': 2.2.2 + '@biomejs/cli-win32-arm64': 2.2.2 + '@biomejs/cli-win32-x64': 2.2.2 + + '@biomejs/cli-darwin-arm64@2.2.2': optional: true - '@biomejs/cli-linux-x64-musl@1.9.4': + '@biomejs/cli-darwin-x64@2.2.2': optional: true - '@biomejs/cli-linux-x64@1.5.3': + '@biomejs/cli-linux-arm64-musl@2.2.2': optional: true - '@biomejs/cli-linux-x64@1.9.4': + '@biomejs/cli-linux-arm64@2.2.2': optional: true - '@biomejs/cli-win32-arm64@1.5.3': + '@biomejs/cli-linux-x64-musl@2.2.2': optional: true - '@biomejs/cli-win32-arm64@1.9.4': + '@biomejs/cli-linux-x64@2.2.2': optional: true - '@biomejs/cli-win32-x64@1.5.3': + '@biomejs/cli-win32-arm64@2.2.2': optional: true - '@biomejs/cli-win32-x64@1.9.4': + '@biomejs/cli-win32-x64@2.2.2': optional: true '@chevrotain/cst-dts-gen@10.5.0': @@ -10429,205 +8887,135 @@ snapshots: - encoding - supports-color - '@cspotcode/source-map-support@0.8.1': - dependencies: - '@jridgewell/trace-mapping': 0.3.9 - '@esbuild/aix-ppc64@0.21.5': optional: true - '@esbuild/android-arm64@0.17.19': - optional: true - '@esbuild/android-arm64@0.19.5': optional: true '@esbuild/android-arm64@0.21.5': optional: true - '@esbuild/android-arm@0.17.19': - optional: true - '@esbuild/android-arm@0.19.5': optional: true '@esbuild/android-arm@0.21.5': optional: true - '@esbuild/android-x64@0.17.19': - optional: true - '@esbuild/android-x64@0.19.5': optional: true '@esbuild/android-x64@0.21.5': optional: true - '@esbuild/darwin-arm64@0.17.19': - optional: true - '@esbuild/darwin-arm64@0.19.5': optional: true '@esbuild/darwin-arm64@0.21.5': optional: true - '@esbuild/darwin-x64@0.17.19': - optional: true - '@esbuild/darwin-x64@0.19.5': optional: true '@esbuild/darwin-x64@0.21.5': optional: true - '@esbuild/freebsd-arm64@0.17.19': - optional: true - '@esbuild/freebsd-arm64@0.19.5': optional: true '@esbuild/freebsd-arm64@0.21.5': optional: true - '@esbuild/freebsd-x64@0.17.19': - optional: true - '@esbuild/freebsd-x64@0.19.5': optional: true '@esbuild/freebsd-x64@0.21.5': optional: true - '@esbuild/linux-arm64@0.17.19': - optional: true - '@esbuild/linux-arm64@0.19.5': optional: true '@esbuild/linux-arm64@0.21.5': optional: true - '@esbuild/linux-arm@0.17.19': - optional: true - '@esbuild/linux-arm@0.19.5': optional: true '@esbuild/linux-arm@0.21.5': optional: true - '@esbuild/linux-ia32@0.17.19': - optional: true - '@esbuild/linux-ia32@0.19.5': optional: true '@esbuild/linux-ia32@0.21.5': optional: true - '@esbuild/linux-loong64@0.17.19': - optional: true - '@esbuild/linux-loong64@0.19.5': optional: true '@esbuild/linux-loong64@0.21.5': optional: true - '@esbuild/linux-mips64el@0.17.19': - optional: true - '@esbuild/linux-mips64el@0.19.5': optional: true '@esbuild/linux-mips64el@0.21.5': optional: true - '@esbuild/linux-ppc64@0.17.19': - optional: true - '@esbuild/linux-ppc64@0.19.5': optional: true '@esbuild/linux-ppc64@0.21.5': optional: true - '@esbuild/linux-riscv64@0.17.19': - optional: true - '@esbuild/linux-riscv64@0.19.5': optional: true '@esbuild/linux-riscv64@0.21.5': optional: true - '@esbuild/linux-s390x@0.17.19': - optional: true - '@esbuild/linux-s390x@0.19.5': optional: true '@esbuild/linux-s390x@0.21.5': optional: true - '@esbuild/linux-x64@0.17.19': - optional: true - '@esbuild/linux-x64@0.19.5': optional: true '@esbuild/linux-x64@0.21.5': optional: true - '@esbuild/netbsd-x64@0.17.19': - optional: true - '@esbuild/netbsd-x64@0.19.5': optional: true '@esbuild/netbsd-x64@0.21.5': optional: true - '@esbuild/openbsd-x64@0.17.19': - optional: true - '@esbuild/openbsd-x64@0.19.5': optional: true '@esbuild/openbsd-x64@0.21.5': optional: true - '@esbuild/sunos-x64@0.17.19': - optional: true - '@esbuild/sunos-x64@0.19.5': optional: true '@esbuild/sunos-x64@0.21.5': optional: true - '@esbuild/win32-arm64@0.17.19': - optional: true - '@esbuild/win32-arm64@0.19.5': optional: true '@esbuild/win32-arm64@0.21.5': optional: true - '@esbuild/win32-ia32@0.17.19': - optional: true - '@esbuild/win32-ia32@0.19.5': optional: true '@esbuild/win32-ia32@0.21.5': optional: true - '@esbuild/win32-x64@0.17.19': - optional: true - '@esbuild/win32-x64@0.19.5': optional: true @@ -10645,8 +9033,6 @@ snapshots: wrap-ansi: 8.1.0 wrap-ansi-cjs: wrap-ansi@7.0.0 - '@istanbuljs/schema@0.1.3': {} - '@jest/schemas@29.6.3': dependencies: '@sinclair/typebox': 0.27.8 @@ -10668,13 +9054,6 @@ snapshots: '@jridgewell/resolve-uri': 3.1.2 '@jridgewell/sourcemap-codec': 1.5.0 - '@jridgewell/trace-mapping@0.3.9': - dependencies: - '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.0 - - '@jsdevtools/ono@7.1.3': {} - '@jsonjoy.com/base64@1.1.2(tslib@2.8.1)': dependencies: tslib: 2.8.1 @@ -10693,7 +9072,7 @@ snapshots: '@kwsites/file-exists@1.1.1': dependencies: - debug: 4.4.0 + debug: 4.4.1 transitivePeerDependencies: - supports-color @@ -10899,27 +9278,23 @@ snapshots: path-browserify: 1.0.1 tinyglobby: 0.2.10 - '@tsconfig/node10@1.0.11': {} - - '@tsconfig/node12@1.0.11': {} - - '@tsconfig/node14@1.0.3': {} - - '@tsconfig/node16@1.0.4': {} - '@types/acorn@4.0.6': dependencies: '@types/estree': 1.0.6 '@types/adm-zip@0.5.7': dependencies: - '@types/node': 20.17.16 + '@types/node': 24.3.0 + + '@types/chai@5.2.2': + dependencies: + '@types/deep-eql': 4.0.2 '@types/debug@4.1.12': dependencies: '@types/ms': 2.1.0 - '@types/diff@5.2.3': {} + '@types/deep-eql@4.0.2': {} '@types/estree-jsx@1.0.5': dependencies: @@ -10927,22 +9302,10 @@ snapshots: '@types/estree@1.0.6': {} - '@types/git-url-parse@9.0.3': {} - - '@types/glob@7.2.0': - dependencies: - '@types/minimatch': 5.1.2 - '@types/node': 20.17.16 - '@types/hast@3.0.4': dependencies: '@types/unist': 3.0.3 - '@types/inquirer@9.0.7': - dependencies: - '@types/through': 0.0.33 - rxjs: 7.8.1 - '@types/js-beautify@1.14.3': {} '@types/jscodeshift@0.11.11': @@ -10950,27 +9313,15 @@ snapshots: ast-types: 0.14.2 recast: 0.20.5 - '@types/json-schema@7.0.15': {} - - '@types/lodash-es@4.17.12': - dependencies: - '@types/lodash': 4.17.15 - - '@types/lodash@4.17.15': {} - '@types/mdast@4.0.4': dependencies: '@types/unist': 3.0.3 - '@types/minimatch@5.1.2': {} - - '@types/ms@0.7.34': {} - '@types/ms@2.1.0': {} '@types/node-fetch@2.6.12': dependencies: - '@types/node': 20.17.16 + '@types/node': 24.3.0 form-data: 4.0.1 '@types/node@18.19.74': @@ -10993,9 +9344,11 @@ snapshots: dependencies: undici-types: 5.26.5 - '@types/pako@2.0.3': {} + '@types/node@24.3.0': + dependencies: + undici-types: 7.10.0 - '@types/prettier@2.7.3': {} + '@types/pako@2.0.3': {} '@types/react@19.0.8': dependencies: @@ -11005,87 +9358,54 @@ snapshots: '@types/tar-stream@3.1.3': dependencies: - '@types/node': 20.17.16 + '@types/node': 24.3.0 '@types/tar@6.1.13': dependencies: - '@types/node': 20.17.16 + '@types/node': 24.3.0 minipass: 4.2.8 - '@types/through@0.0.33': - dependencies: - '@types/node': 20.17.16 - '@types/unist@2.0.11': {} '@types/unist@3.0.3': {} '@types/unzipper@0.10.10': dependencies: - '@types/node': 20.17.16 + '@types/node': 24.3.0 - '@vitest/coverage-v8@1.6.0(vitest@1.6.0(@types/node@20.10.3))': + '@vitest/expect@1.6.0': dependencies: - '@ampproject/remapping': 2.3.0 - '@bcoe/v8-coverage': 0.2.3 - debug: 4.4.0 - istanbul-lib-coverage: 3.2.2 - istanbul-lib-report: 3.0.1 - istanbul-lib-source-maps: 5.0.6 - istanbul-reports: 3.1.7 - magic-string: 0.30.17 - magicast: 0.3.5 - picocolors: 1.1.1 - std-env: 3.8.0 - strip-literal: 2.1.1 - test-exclude: 6.0.0 - vitest: 1.6.0(@types/node@20.10.3) - transitivePeerDependencies: - - supports-color + '@vitest/spy': 1.6.0 + '@vitest/utils': 1.6.0 + chai: 4.5.0 - '@vitest/coverage-v8@1.6.0(vitest@1.6.0(@types/node@20.17.16))': + '@vitest/expect@3.2.4': dependencies: - '@ampproject/remapping': 2.3.0 - '@bcoe/v8-coverage': 0.2.3 - debug: 4.4.0 - istanbul-lib-coverage: 3.2.2 - istanbul-lib-report: 3.0.1 - istanbul-lib-source-maps: 5.0.6 - istanbul-reports: 3.1.7 + '@types/chai': 5.2.2 + '@vitest/spy': 3.2.4 + '@vitest/utils': 3.2.4 + chai: 5.3.3 + tinyrainbow: 2.0.0 + + '@vitest/mocker@3.2.4(vite@5.4.14(@types/node@20.9.0))': + dependencies: + '@vitest/spy': 3.2.4 + estree-walker: 3.0.3 magic-string: 0.30.17 - magicast: 0.3.5 - picocolors: 1.1.1 - std-env: 3.8.0 - strip-literal: 2.1.1 - test-exclude: 6.0.0 - vitest: 1.6.0(@types/node@20.17.16) - transitivePeerDependencies: - - supports-color + optionalDependencies: + vite: 5.4.14(@types/node@20.9.0) - '@vitest/coverage-v8@1.6.0(vitest@1.6.0(@types/node@20.8.5))': + '@vitest/mocker@3.2.4(vite@5.4.14(@types/node@24.3.0))': dependencies: - '@ampproject/remapping': 2.3.0 - '@bcoe/v8-coverage': 0.2.3 - debug: 4.4.0 - istanbul-lib-coverage: 3.2.2 - istanbul-lib-report: 3.0.1 - istanbul-lib-source-maps: 5.0.6 - istanbul-reports: 3.1.7 + '@vitest/spy': 3.2.4 + estree-walker: 3.0.3 magic-string: 0.30.17 - magicast: 0.3.5 - picocolors: 1.1.1 - std-env: 3.8.0 - strip-literal: 2.1.1 - test-exclude: 6.0.0 - vitest: 1.6.0(@types/node@20.8.5) - transitivePeerDependencies: - - supports-color + optionalDependencies: + vite: 5.4.14(@types/node@24.3.0) - '@vitest/expect@1.6.0': + '@vitest/pretty-format@3.2.4': dependencies: - '@vitest/spy': 1.6.0 - '@vitest/utils': 1.6.0 - chai: 4.5.0 + tinyrainbow: 2.0.0 '@vitest/runner@1.6.0': dependencies: @@ -11093,16 +9413,32 @@ snapshots: p-limit: 5.0.0 pathe: 1.1.2 + '@vitest/runner@3.2.4': + dependencies: + '@vitest/utils': 3.2.4 + pathe: 2.0.3 + strip-literal: 3.0.0 + '@vitest/snapshot@1.6.0': dependencies: magic-string: 0.30.17 pathe: 1.1.2 pretty-format: 29.7.0 + '@vitest/snapshot@3.2.4': + dependencies: + '@vitest/pretty-format': 3.2.4 + magic-string: 0.30.17 + pathe: 2.0.3 + '@vitest/spy@1.6.0': dependencies: tinyspy: 2.2.1 + '@vitest/spy@3.2.4': + dependencies: + tinyspy: 4.0.3 + '@vitest/utils@1.6.0': dependencies: diff-sequences: 29.6.3 @@ -11110,6 +9446,12 @@ snapshots: loupe: 2.3.7 pretty-format: 29.7.0 + '@vitest/utils@3.2.4': + dependencies: + '@vitest/pretty-format': 3.2.4 + loupe: 3.2.1 + tinyrainbow: 2.0.0 + abbrev@2.0.0: {} abort-controller@3.0.0: @@ -11136,10 +9478,6 @@ snapshots: dependencies: type-fest: 0.21.3 - ansi-escapes@7.0.0: - dependencies: - environment: 1.1.0 - ansi-regex@5.0.1: {} ansi-regex@6.1.0: {} @@ -11152,12 +9490,6 @@ snapshots: ansi-styles@6.2.1: {} - any-promise@1.3.0: {} - - arg@4.1.3: {} - - argparse@2.0.1: {} - array-buffer-byte-length@1.0.2: dependencies: call-bound: 1.0.3 @@ -11175,6 +9507,8 @@ snapshots: assertion-error@1.1.0: {} + assertion-error@2.0.1: {} + ast-types@0.14.2: dependencies: tslib: 2.8.1 @@ -11292,8 +9626,6 @@ snapshots: call-bind-apply-helpers: 1.0.1 get-intrinsic: 1.2.7 - call-me-maybe@1.0.2: {} - caniuse-lite@1.0.30001696: {} catch-unknown@1.0.0: {} @@ -11310,13 +9642,19 @@ snapshots: pathval: 1.1.1 type-detect: 4.1.0 + chai@5.3.3: + dependencies: + assertion-error: 2.0.1 + check-error: 2.1.1 + deep-eql: 5.0.2 + loupe: 3.2.1 + pathval: 2.0.1 + chalk@4.1.2: dependencies: ansi-styles: 4.3.0 supports-color: 7.2.0 - chalk@5.4.1: {} - change-case@5.4.4: {} character-entities-html4@2.1.0: {} @@ -11335,6 +9673,8 @@ snapshots: dependencies: get-func-name: 2.0.2 + check-error@2.1.1: {} + chevrotain@10.5.0: dependencies: '@chevrotain/cst-dts-gen': 10.5.0 @@ -11346,29 +9686,12 @@ snapshots: chownr@2.0.0: {} - cli-color@2.0.4: - dependencies: - d: 1.0.2 - es5-ext: 0.10.64 - es6-iterator: 2.0.3 - memoizee: 0.4.17 - timers-ext: 0.1.8 - cli-cursor@3.1.0: dependencies: restore-cursor: 3.1.0 - cli-cursor@5.0.0: - dependencies: - restore-cursor: 5.1.0 - cli-spinners@2.9.2: {} - cli-truncate@4.0.0: - dependencies: - slice-ansi: 5.0.0 - string-width: 7.2.0 - cli-width@4.1.0: {} clone-deep@4.0.1: @@ -11389,8 +9712,6 @@ snapshots: color-name@1.1.4: {} - colorette@2.0.20: {} - colors-cli@1.0.33: {} combined-stream@1.0.8: @@ -11399,8 +9720,6 @@ snapshots: commander@10.0.1: {} - commander@13.1.0: {} - commondir@1.0.1: {} concat-map@0.0.1: {} @@ -11420,8 +9739,6 @@ snapshots: core-util-is@1.0.3: {} - create-require@1.1.1: {} - cross-spawn@7.0.6: dependencies: path-key: 3.1.1 @@ -11432,11 +9749,6 @@ snapshots: csstype@3.1.3: {} - d@1.0.2: - dependencies: - es5-ext: 0.10.64 - type: 2.7.3 - data-view-buffer@1.0.2: dependencies: call-bound: 1.0.3 @@ -11459,6 +9771,10 @@ snapshots: dependencies: ms: 2.1.3 + debug@4.4.1: + dependencies: + ms: 2.1.3 + decode-named-character-reference@1.0.2: dependencies: character-entities: 2.0.2 @@ -11467,6 +9783,8 @@ snapshots: dependencies: type-detect: 4.1.0 + deep-eql@5.0.2: {} + defaults@1.0.4: dependencies: clone: 1.0.4 @@ -11501,8 +9819,6 @@ snapshots: diff-sequences@29.6.3: {} - diff@4.0.2: {} - diff@5.2.0: {} digest-fetch@1.3.0: @@ -11531,14 +9847,10 @@ snapshots: electron-to-chromium@1.5.90: {} - emoji-regex@10.4.0: {} - emoji-regex@8.0.0: {} emoji-regex@9.2.2: {} - environment@1.1.0: {} - error-cause@1.0.8: dependencies: call-bind: 1.0.8 @@ -11618,6 +9930,8 @@ snapshots: es-errors@1.3.0: {} + es-module-lexer@1.7.0: {} + es-object-atoms@1.1.1: dependencies: es-errors: 1.3.0 @@ -11635,56 +9949,6 @@ snapshots: is-date-object: 1.1.0 is-symbol: 1.1.1 - es5-ext@0.10.64: - dependencies: - es6-iterator: 2.0.3 - es6-symbol: 3.1.4 - esniff: 2.0.1 - next-tick: 1.1.0 - - es6-iterator@2.0.3: - dependencies: - d: 1.0.2 - es5-ext: 0.10.64 - es6-symbol: 3.1.4 - - es6-symbol@3.1.4: - dependencies: - d: 1.0.2 - ext: 1.7.0 - - es6-weak-map@2.0.3: - dependencies: - d: 1.0.2 - es5-ext: 0.10.64 - es6-iterator: 2.0.3 - es6-symbol: 3.1.4 - - esbuild@0.17.19: - optionalDependencies: - '@esbuild/android-arm': 0.17.19 - '@esbuild/android-arm64': 0.17.19 - '@esbuild/android-x64': 0.17.19 - '@esbuild/darwin-arm64': 0.17.19 - '@esbuild/darwin-x64': 0.17.19 - '@esbuild/freebsd-arm64': 0.17.19 - '@esbuild/freebsd-x64': 0.17.19 - '@esbuild/linux-arm': 0.17.19 - '@esbuild/linux-arm64': 0.17.19 - '@esbuild/linux-ia32': 0.17.19 - '@esbuild/linux-loong64': 0.17.19 - '@esbuild/linux-mips64el': 0.17.19 - '@esbuild/linux-ppc64': 0.17.19 - '@esbuild/linux-riscv64': 0.17.19 - '@esbuild/linux-s390x': 0.17.19 - '@esbuild/linux-x64': 0.17.19 - '@esbuild/netbsd-x64': 0.17.19 - '@esbuild/openbsd-x64': 0.17.19 - '@esbuild/sunos-x64': 0.17.19 - '@esbuild/win32-arm64': 0.17.19 - '@esbuild/win32-ia32': 0.17.19 - '@esbuild/win32-x64': 0.17.19 - esbuild@0.19.5: optionalDependencies: '@esbuild/android-arm': 0.19.5 @@ -11740,13 +10004,6 @@ snapshots: escape-string-regexp@5.0.0: {} - esniff@2.0.1: - dependencies: - d: 1.0.2 - es5-ext: 0.10.64 - event-emitter: 0.3.5 - type: 2.7.3 - esprima@4.0.1: {} estree-util-is-identifier-name@2.1.0: {} @@ -11762,15 +10019,8 @@ snapshots: esutils@2.0.3: {} - event-emitter@0.3.5: - dependencies: - d: 1.0.2 - es5-ext: 0.10.64 - event-target-shim@5.0.1: {} - eventemitter3@5.0.1: {} - execa@8.0.1: dependencies: cross-spawn: 7.0.6 @@ -11783,9 +10033,7 @@ snapshots: signal-exit: 4.1.0 strip-final-newline: 3.0.0 - ext@1.7.0: - dependencies: - type: 2.7.3 + expect-type@1.2.2: {} external-editor@3.1.0: dependencies: @@ -11807,7 +10055,11 @@ snapshots: dependencies: reusify: 1.0.4 - fdir@6.4.3(picomatch@4.0.2): + fdir@6.4.3(picomatch@4.0.2): + optionalDependencies: + picomatch: 4.0.2 + + fdir@6.5.0(picomatch@4.0.2): optionalDependencies: picomatch: 4.0.2 @@ -11886,8 +10138,6 @@ snapshots: gensync@1.0.0-beta.2: {} - get-east-asian-width@1.3.0: {} - get-func-name@2.0.2: {} get-intrinsic@1.2.7: @@ -11908,8 +10158,6 @@ snapshots: dunder-proto: 1.0.1 es-object-atoms: 1.1.1 - get-stdin@8.0.0: {} - get-stream@8.0.1: {} get-symbol-description@1.1.0: @@ -11931,11 +10179,6 @@ snapshots: dependencies: is-glob: 4.0.3 - glob-promise@4.2.2(glob@7.2.3): - dependencies: - '@types/glob': 7.2.0 - glob: 7.2.3 - glob@10.4.5: dependencies: foreground-child: 3.3.0 @@ -11987,16 +10230,12 @@ snapshots: dependencies: function-bind: 1.1.2 - html-escaper@2.0.2: {} - human-signals@5.0.0: {} humanize-ms@1.2.1: dependencies: ms: 2.1.3 - husky@9.1.7: {} - hyperdyperid@1.2.0: {} iconv-lite@0.4.24: @@ -12096,12 +10335,6 @@ snapshots: is-fullwidth-code-point@3.0.0: {} - is-fullwidth-code-point@4.0.0: {} - - is-fullwidth-code-point@5.0.0: - dependencies: - get-east-asian-width: 1.3.0 - is-generator-function@1.1.0: dependencies: call-bound: 1.0.3 @@ -12130,8 +10363,6 @@ snapshots: dependencies: isobject: 3.0.1 - is-promise@2.2.2: {} - is-regex@1.2.1: dependencies: call-bound: 1.0.3 @@ -12187,27 +10418,6 @@ snapshots: isobject@3.0.1: {} - istanbul-lib-coverage@3.2.2: {} - - istanbul-lib-report@3.0.1: - dependencies: - istanbul-lib-coverage: 3.2.2 - make-dir: 4.0.0 - supports-color: 7.2.0 - - istanbul-lib-source-maps@5.0.6: - dependencies: - '@jridgewell/trace-mapping': 0.3.25 - debug: 4.4.0 - istanbul-lib-coverage: 3.2.2 - transitivePeerDependencies: - - supports-color - - istanbul-reports@3.1.7: - dependencies: - html-escaper: 2.0.2 - istanbul-lib-report: 3.0.1 - jackspeak@3.4.3: dependencies: '@isaacs/cliui': 8.0.2 @@ -12228,10 +10438,6 @@ snapshots: js-tokens@9.0.1: {} - js-yaml@4.1.0: - dependencies: - argparse: 2.0.1 - jscodeshift@0.14.0(@babel/preset-env@7.26.7(@babel/core@7.26.7)): dependencies: '@babel/core': 7.26.7 @@ -12314,23 +10520,6 @@ snapshots: jsesc@3.1.0: {} - json-schema-to-typescript@13.1.2: - dependencies: - '@bcherny/json-schema-ref-parser': 10.0.5-fork - '@types/json-schema': 7.0.15 - '@types/lodash': 4.17.15 - '@types/prettier': 2.7.3 - cli-color: 2.0.4 - get-stdin: 8.0.0 - glob: 7.2.3 - glob-promise: 4.2.2(glob@7.2.3) - is-glob: 4.0.3 - lodash: 4.17.21 - minimist: 1.2.8 - mkdirp: 1.0.4 - mz: 2.7.0 - prettier: 2.8.8 - json5@2.2.3: {} just-extend@6.2.0: {} @@ -12339,32 +10528,6 @@ snapshots: lilconfig@2.1.0: {} - lilconfig@3.1.3: {} - - lint-staged@15.5.2: - dependencies: - chalk: 5.4.1 - commander: 13.1.0 - debug: 4.4.0 - execa: 8.0.1 - lilconfig: 3.1.3 - listr2: 8.3.3 - micromatch: 4.0.8 - pidtree: 0.6.0 - string-argv: 0.3.2 - yaml: 2.7.0 - transitivePeerDependencies: - - supports-color - - listr2@8.3.3: - dependencies: - cli-truncate: 4.0.0 - colorette: 2.0.20 - eventemitter3: 5.0.1 - log-update: 6.1.0 - rfdc: 1.4.1 - wrap-ansi: 9.0.0 - local-pkg@0.5.1: dependencies: mlly: 1.7.4 @@ -12388,20 +10551,14 @@ snapshots: chalk: 4.1.2 is-unicode-supported: 0.1.0 - log-update@6.1.0: - dependencies: - ansi-escapes: 7.0.0 - cli-cursor: 5.0.0 - slice-ansi: 7.1.0 - strip-ansi: 7.1.0 - wrap-ansi: 9.0.0 - longest-streak@3.1.0: {} loupe@2.3.7: dependencies: get-func-name: 2.0.2 + loupe@3.2.1: {} + lower-case@2.0.2: dependencies: tslib: 2.8.1 @@ -12412,31 +10569,15 @@ snapshots: dependencies: yallist: 3.1.1 - lru-queue@0.1.0: - dependencies: - es5-ext: 0.10.64 - magic-string@0.30.17: dependencies: '@jridgewell/sourcemap-codec': 1.5.0 - magicast@0.3.5: - dependencies: - '@babel/parser': 7.26.7 - '@babel/types': 7.26.7 - source-map-js: 1.2.1 - make-dir@2.1.0: dependencies: pify: 4.0.1 semver: 5.7.2 - make-dir@4.0.0: - dependencies: - semver: 7.7.0 - - make-error@1.3.6: {} - math-intrinsics@1.1.0: {} md5@2.3.0: @@ -12539,17 +10680,6 @@ snapshots: tree-dump: 1.0.2(tslib@2.8.1) tslib: 2.8.1 - memoizee@0.4.17: - dependencies: - d: 1.0.2 - es5-ext: 0.10.64 - es6-weak-map: 2.0.3 - event-emitter: 0.3.5 - is-promise: 2.2.2 - lru-queue: 0.1.0 - next-tick: 1.1.0 - timers-ext: 0.1.8 - merge-stream@2.0.0: {} merge2@1.4.1: {} @@ -12776,8 +10906,6 @@ snapshots: mimic-fn@4.0.0: {} - mimic-function@5.0.1: {} - minimatch@3.1.2: dependencies: brace-expansion: 1.1.11 @@ -12832,18 +10960,10 @@ snapshots: mute-stream@1.0.0: {} - mz@2.7.0: - dependencies: - any-promise: 1.3.0 - object-assign: 4.1.1 - thenify-all: 1.6.0 - nanoid@3.3.8: {} neo-async@2.6.2: {} - next-tick@1.1.0: {} - nise@5.1.9: dependencies: '@sinonjs/commons': 3.0.1 @@ -12877,8 +10997,6 @@ snapshots: dependencies: path-key: 4.0.0 - object-assign@4.1.1: {} - object-inspect@1.13.3: {} object-keys@1.1.1: {} @@ -12904,10 +11022,6 @@ snapshots: dependencies: mimic-fn: 4.0.0 - onetime@7.0.0: - dependencies: - mimic-function: 5.0.1 - openai@4.23.0: dependencies: '@types/node': 18.19.74 @@ -13001,16 +11115,18 @@ snapshots: pathe@2.0.2: {} + pathe@2.0.3: {} + pathval@1.1.1: {} + pathval@2.0.1: {} + picocolors@1.1.1: {} picomatch@2.3.1: {} picomatch@4.0.2: {} - pidtree@0.6.0: {} - pify@4.0.1: {} pirates@4.0.6: {} @@ -13033,8 +11149,6 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 - prettier@2.8.8: {} - prettier@3.4.2: {} pretty-format@29.7.0: @@ -13153,15 +11267,8 @@ snapshots: onetime: 5.1.2 signal-exit: 3.0.7 - restore-cursor@5.1.0: - dependencies: - onetime: 7.0.0 - signal-exit: 4.1.0 - reusify@1.0.4: {} - rfdc@1.4.1: {} - rimraf@2.6.3: dependencies: glob: 7.2.3 @@ -13306,7 +11413,7 @@ snapshots: dependencies: '@kwsites/file-exists': 1.1.1 '@kwsites/promise-deferred': 1.1.1 - debug: 4.4.0 + debug: 4.4.1 transitivePeerDependencies: - supports-color @@ -13319,16 +11426,6 @@ snapshots: nise: 5.1.9 supports-color: 7.2.0 - slice-ansi@5.0.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 4.0.0 - - slice-ansi@7.1.0: - dependencies: - ansi-styles: 6.2.1 - is-fullwidth-code-point: 5.0.0 - source-map-js@1.2.1: {} source-map-support@0.5.21: @@ -13342,6 +11439,8 @@ snapshots: std-env@3.8.0: {} + std-env@3.9.0: {} + streamx@2.22.0: dependencies: fast-fifo: 1.3.2 @@ -13349,8 +11448,6 @@ snapshots: optionalDependencies: bare-events: 2.5.4 - string-argv@0.3.2: {} - string-width@4.2.3: dependencies: emoji-regex: 8.0.0 @@ -13363,12 +11460,6 @@ snapshots: emoji-regex: 9.2.2 strip-ansi: 7.1.0 - string-width@7.2.0: - dependencies: - emoji-regex: 10.4.0 - get-east-asian-width: 1.3.0 - strip-ansi: 7.1.0 - string.prototype.trim@1.2.10: dependencies: call-bind: 1.0.8 @@ -13419,6 +11510,10 @@ snapshots: dependencies: js-tokens: 9.0.1 + strip-literal@3.0.0: + dependencies: + js-tokens: 9.0.1 + supports-color@7.2.0: dependencies: has-flag: 4.0.0 @@ -13449,46 +11544,40 @@ snapshots: mkdirp: 0.5.6 rimraf: 2.6.3 - test-exclude@6.0.0: - dependencies: - '@istanbuljs/schema': 0.1.3 - glob: 7.2.3 - minimatch: 3.1.2 - text-decoder@1.2.3: dependencies: b4a: 1.6.7 - thenify-all@1.6.0: - dependencies: - thenify: 3.3.1 - - thenify@3.3.1: - dependencies: - any-promise: 1.3.0 - thingies@1.21.0(tslib@2.8.1): dependencies: tslib: 2.8.1 - timers-ext@0.1.8: - dependencies: - es5-ext: 0.10.64 - next-tick: 1.1.0 - tiny-invariant@1.3.3: {} tinybench@2.9.0: {} + tinyexec@0.3.2: {} + tinyglobby@0.2.10: dependencies: fdir: 6.4.3(picomatch@4.0.2) picomatch: 4.0.2 + tinyglobby@0.2.14: + dependencies: + fdir: 6.5.0(picomatch@4.0.2) + picomatch: 4.0.2 + tinypool@0.8.4: {} + tinypool@1.1.1: {} + + tinyrainbow@2.0.0: {} + tinyspy@2.2.1: {} + tinyspy@4.0.3: {} + tmp@0.0.33: dependencies: os-tmpdir: 1.0.2 @@ -13524,89 +11613,8 @@ snapshots: '@ts-morph/common': 0.25.0 code-block-writer: 13.0.3 - ts-node@10.9.1(@types/node@20.10.3)(typescript@5.7.3): - dependencies: - '@cspotcode/source-map-support': 0.8.1 - '@tsconfig/node10': 1.0.11 - '@tsconfig/node12': 1.0.11 - '@tsconfig/node14': 1.0.3 - '@tsconfig/node16': 1.0.4 - '@types/node': 20.10.3 - acorn: 8.14.0 - acorn-walk: 8.3.4 - arg: 4.1.3 - create-require: 1.1.1 - diff: 4.0.2 - make-error: 1.3.6 - typescript: 5.7.3 - v8-compile-cache-lib: 3.0.1 - yn: 3.1.1 - - ts-node@10.9.1(@types/node@20.17.16)(typescript@5.7.3): - dependencies: - '@cspotcode/source-map-support': 0.8.1 - '@tsconfig/node10': 1.0.11 - '@tsconfig/node12': 1.0.11 - '@tsconfig/node14': 1.0.3 - '@tsconfig/node16': 1.0.4 - '@types/node': 20.17.16 - acorn: 8.14.0 - acorn-walk: 8.3.4 - arg: 4.1.3 - create-require: 1.1.1 - diff: 4.0.2 - make-error: 1.3.6 - typescript: 5.7.3 - v8-compile-cache-lib: 3.0.1 - yn: 3.1.1 - - ts-node@10.9.1(@types/node@20.8.5)(typescript@5.7.3): - dependencies: - '@cspotcode/source-map-support': 0.8.1 - '@tsconfig/node10': 1.0.11 - '@tsconfig/node12': 1.0.11 - '@tsconfig/node14': 1.0.3 - '@tsconfig/node16': 1.0.4 - '@types/node': 20.8.5 - acorn: 8.14.0 - acorn-walk: 8.3.4 - arg: 4.1.3 - create-require: 1.1.1 - diff: 4.0.2 - make-error: 1.3.6 - typescript: 5.7.3 - v8-compile-cache-lib: 3.0.1 - yn: 3.1.1 - tslib@2.8.1: {} - turbo-darwin-64@1.13.4: - optional: true - - turbo-darwin-arm64@1.13.4: - optional: true - - turbo-linux-64@1.13.4: - optional: true - - turbo-linux-arm64@1.13.4: - optional: true - - turbo-windows-64@1.13.4: - optional: true - - turbo-windows-arm64@1.13.4: - optional: true - - turbo@1.13.4: - optionalDependencies: - turbo-darwin-64: 1.13.4 - turbo-darwin-arm64: 1.13.4 - turbo-linux-64: 1.13.4 - turbo-linux-arm64: 1.13.4 - turbo-windows-64: 1.13.4 - turbo-windows-arm64: 1.13.4 - type-detect@4.0.8: {} type-detect@4.1.0: {} @@ -13615,8 +11623,6 @@ snapshots: type-fest@2.19.0: {} - type@2.7.3: {} - typed-array-buffer@1.0.3: dependencies: call-bound: 1.0.3 @@ -13654,6 +11660,8 @@ snapshots: typescript@5.7.3: {} + typescript@5.9.2: {} + ufo@1.5.4: {} unbox-primitive@1.1.0: @@ -13669,6 +11677,8 @@ snapshots: undici-types@6.19.8: {} + undici-types@7.10.0: {} + unicode-canonical-property-names-ecmascript@2.0.1: {} unicode-match-property-ecmascript@2.0.0: @@ -13727,8 +11737,6 @@ snapshots: util-deprecate@1.0.2: {} - v8-compile-cache-lib@3.0.1: {} - valibot@0.34.0: {} vfile-message@4.0.2: @@ -13808,6 +11816,60 @@ snapshots: - supports-color - terser + vite-node@1.6.0(@types/node@24.3.0): + dependencies: + cac: 6.7.14 + debug: 4.4.0 + pathe: 1.1.2 + picocolors: 1.1.1 + vite: 5.4.14(@types/node@24.3.0) + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + + vite-node@3.2.4(@types/node@20.9.0): + dependencies: + cac: 6.7.14 + debug: 4.4.1 + es-module-lexer: 1.7.0 + pathe: 2.0.3 + vite: 5.4.14(@types/node@20.9.0) + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + + vite-node@3.2.4(@types/node@24.3.0): + dependencies: + cac: 6.7.14 + debug: 4.4.1 + es-module-lexer: 1.7.0 + pathe: 2.0.3 + vite: 5.4.14(@types/node@24.3.0) + transitivePeerDependencies: + - '@types/node' + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + vite@5.4.14(@types/node@20.10.3): dependencies: esbuild: 0.21.5 @@ -13844,6 +11906,15 @@ snapshots: '@types/node': 20.9.0 fsevents: 2.3.3 + vite@5.4.14(@types/node@24.3.0): + dependencies: + esbuild: 0.21.5 + postcss: 8.5.1 + rollup: 4.32.1 + optionalDependencies: + '@types/node': 24.3.0 + fsevents: 2.3.3 + vitest@1.6.0(@types/node@20.10.3): dependencies: '@vitest/expect': 1.6.0 @@ -13980,6 +12051,118 @@ snapshots: - supports-color - terser + vitest@1.6.0(@types/node@24.3.0): + dependencies: + '@vitest/expect': 1.6.0 + '@vitest/runner': 1.6.0 + '@vitest/snapshot': 1.6.0 + '@vitest/spy': 1.6.0 + '@vitest/utils': 1.6.0 + acorn-walk: 8.3.4 + chai: 4.5.0 + debug: 4.4.0 + execa: 8.0.1 + local-pkg: 0.5.1 + magic-string: 0.30.17 + pathe: 1.1.2 + picocolors: 1.1.1 + std-env: 3.8.0 + strip-literal: 2.1.1 + tinybench: 2.9.0 + tinypool: 0.8.4 + vite: 5.4.14(@types/node@24.3.0) + vite-node: 1.6.0(@types/node@24.3.0) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/node': 24.3.0 + transitivePeerDependencies: + - less + - lightningcss + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + + vitest@3.2.4(@types/debug@4.1.12)(@types/node@20.9.0): + dependencies: + '@types/chai': 5.2.2 + '@vitest/expect': 3.2.4 + '@vitest/mocker': 3.2.4(vite@5.4.14(@types/node@20.9.0)) + '@vitest/pretty-format': 3.2.4 + '@vitest/runner': 3.2.4 + '@vitest/snapshot': 3.2.4 + '@vitest/spy': 3.2.4 + '@vitest/utils': 3.2.4 + chai: 5.3.3 + debug: 4.4.1 + expect-type: 1.2.2 + magic-string: 0.30.17 + pathe: 2.0.3 + picomatch: 4.0.2 + std-env: 3.9.0 + tinybench: 2.9.0 + tinyexec: 0.3.2 + tinyglobby: 0.2.14 + tinypool: 1.1.1 + tinyrainbow: 2.0.0 + vite: 5.4.14(@types/node@20.9.0) + vite-node: 3.2.4(@types/node@20.9.0) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/debug': 4.1.12 + '@types/node': 20.9.0 + transitivePeerDependencies: + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + + vitest@3.2.4(@types/debug@4.1.12)(@types/node@24.3.0): + dependencies: + '@types/chai': 5.2.2 + '@vitest/expect': 3.2.4 + '@vitest/mocker': 3.2.4(vite@5.4.14(@types/node@24.3.0)) + '@vitest/pretty-format': 3.2.4 + '@vitest/runner': 3.2.4 + '@vitest/snapshot': 3.2.4 + '@vitest/spy': 3.2.4 + '@vitest/utils': 3.2.4 + chai: 5.3.3 + debug: 4.4.1 + expect-type: 1.2.2 + magic-string: 0.30.17 + pathe: 2.0.3 + picomatch: 4.0.2 + std-env: 3.9.0 + tinybench: 2.9.0 + tinyexec: 0.3.2 + tinyglobby: 0.2.14 + tinypool: 1.1.1 + tinyrainbow: 2.0.0 + vite: 5.4.14(@types/node@24.3.0) + vite-node: 3.2.4(@types/node@24.3.0) + why-is-node-running: 2.3.0 + optionalDependencies: + '@types/debug': 4.1.12 + '@types/node': 24.3.0 + transitivePeerDependencies: + - less + - lightningcss + - msw + - sass + - sass-embedded + - stylus + - sugarss + - supports-color + - terser + wcwidth@1.0.1: dependencies: defaults: 1.0.4 @@ -14062,12 +12245,6 @@ snapshots: string-width: 5.1.2 strip-ansi: 7.1.0 - wrap-ansi@9.0.0: - dependencies: - ansi-styles: 6.2.1 - string-width: 7.2.0 - strip-ansi: 7.1.0 - wrappy@1.0.2: {} write-file-atomic@2.4.3: @@ -14087,8 +12264,6 @@ snapshots: yaml@2.7.0: {} - yn@3.1.1: {} - yocto-queue@1.1.1: {} yoctocolors-cjs@2.1.2: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 87afbc40..a6925278 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,285 +1,47 @@ packages: - - codemods/** - - tooling/* + - codemods-legacy/** + - tooling-legacy/* + catalog: - "@ariakit/react": ^0.4.6 - "@artsy/fresnel": ^7.1.4 - "@ast-grep/cli": ^0.25.4 - "@ast-grep/napi": ^0.25.4 - "@aws-sdk/client-s3": ^3.549.0 - "@aws-sdk/s3-request-presigner": ^3.549.0 - "@babel/plugin-syntax-flow": ^7.14.5 - "@babel/plugin-transform-react-jsx": ^7.14.9 - "@babel/preset-typescript": ^7.24.1 - "@babel/traverse": 7.24.1 - "@biomejs/biome": 1.5.3 - "@clerk/backend": ^1.2.1 - "@clerk/clerk-react": 4.30.3 - "@clerk/fastify": 0.6.47 - "@clerk/nextjs": 5.0.9 - "@clerk/themes": 1.7.10 - "@faker-js/faker": ^8.4.1 - "@fastify/busboy": ^2.1.1 - "@fastify/cors": 8.5.0 - "@fastify/multipart": ^8.1.0 - "@fastify/rate-limit": 9.0.1 - "@hookform/resolvers": ^3.3.2 - "@octokit/rest": "^20.0.2" - "@phosphor-icons/react": ^2.0.10 - "@portabletext/react": ^3.0.11 - "@portabletext/types": ^2.0.8 - "@preact/preset-vite": ^2.5.0 - "@prisma/client": ^5.14.0 - "@radix-ui/react-alert-dialog": ^1.0.4 - "@radix-ui/react-avatar": ^1.0.4 - "@radix-ui/react-dialog": ^1.0.4 - "@radix-ui/react-dropdown-menu": ^2.0.5 - "@radix-ui/react-label": ^2.0.2 - "@radix-ui/react-progress": ^1.0.3 - "@radix-ui/react-select": ^1.2.2 - "@radix-ui/react-separator": ^1.0.3 - "@radix-ui/react-slot": ^1.0.2 - "@radix-ui/react-switch": ^1.0.3 - "@radix-ui/react-tabs": ^1.0.4 - "@radix-ui/react-toast": ^1.1.5 - "@radix-ui/react-tooltip": ^1.0.6 - "@reduxjs/toolkit": ^1.9.5 - "@sanity/code-input": ^4.1.3 - "@sanity/orderable-document-list": ^1.2.1 - "@sanity/preview-url-secret": ^1.6.3 - "@sanity/react-loader": ^1.8.5 - "@sanity/table": ^1.1.2 - "@sanity/vision": ^3.29.1 - "@sindresorhus/slugify": ^2.2.1 - "@slack/web-api": ^7.2.0 - "@svgr/hast-util-to-babel-ast": ^7.0.0 - "@t3-oss/env-nextjs": ^0.7.1 - "@tailwindcss/typography": 0.5.10 - "@testing-library/dom": ^9.0.0 - "@testing-library/jest-dom": ^5.16.5 - "@testing-library/react": ^13.4.0 - "@testing-library/user-event": ^13.5.0 - "@tinloof/sanity-studio": ^1.0.0 - "@tinloof/sanity-web": ^0.1.0 - "@tippyjs/react": ^4.2.6 - "@tiptap/extension-code-block-lowlight": ^2.1.8 - "@tiptap/pm": ^2.1.8 - "@tiptap/react": ^2.1.8 - "@tiptap/starter-kit": ^2.1.8 - "@total-typescript/ts-reset": ^0.5.1 - "@types/adm-zip": ^0.5.5 - "@types/babel__traverse": ^7.20.1 - "@types/blessed": ^0.1.25 - "@types/chai": ^4.3.4 - "@types/cli-progress": ^3.11.5 - "@types/columnify": ^1.5.4 - "@types/diff": ^5.0.3 - "@types/git-url-parse": ^9.0.3 - "@types/glob": ^8.0.0 - "@types/inquirer": ^9.0.7 - "@types/jest": ^27.5.2 - "@types/js-beautify": ^1.14.3 - "@types/js-yaml": 4.0.9 - "@types/lodash-es": ^4.17.4 - "@types/mocha": ^10.0.1 - "@types/ms": ^0.7.34 - "@types/pako": ^2.0.0 - "@types/parse-github-url": 1.0.3 - "@types/pg": ^8.11.2 - "@types/prettier": ^2.7.3 - "@types/prettyjson": ^0.0.33 - "@types/ramda": ^0.29.12 - "@types/react-dom": ^18.0.11 - "@types/react-syntax-highlighter": ^15.5.6 - "@types/react-treeview": ^0.4.3 - "@types/react-virtualized": ^9.21.21 - "@types/react-virtualized-auto-sizer": ^1.0.1 - "@types/supertest": ^6.0.2 - "@types/tar": ^6.1.11 - "@types/tar-stream": ^3.1.3 - "@types/testing-library__jest-dom": ^5.14.5 - "@types/unzipper": ^0.10.9 - "@types/vscode": ^1.74.0 - "@types/vscode-webview": ^1.57.1 - "@types/yargs": ^17.0.13 - "@unkey/api": "^0.26.2" - "@vercel/analytics": ^1.2.2 - "@vercel/stega": ^0.1.0 - "@vitejs/plugin-react": ^4.0.0 - "@vitest/coverage-v8": ^1.0.1 - "@vscode/test-electron": ^2.2.2 - "@vscode/vsce": ^2.22.0 - "@vscode/webview-ui-toolkit": ^1.2.2 - "@vue/compiler-sfc": ^3.4.21 - adm-zip: ^0.5.14 - applicationinsights: ^2.9.1 - assert: ^2.0.0 - ast-node-builder: ^4.2.1 + '@ast-grep/cli': ^0.25.4 + '@ast-grep/napi': ^0.25.4 + '@octokit/rest': ^20.0.2 + '@sindresorhus/slugify': ^2.2.1 + '@types/diff': ^5.0.3 + '@types/git-url-parse': ^9.0.3 + '@types/glob': ^8.0.0 + '@types/inquirer': ^9.0.7 + '@types/lodash-es': ^4.17.4 + '@types/parse-github-url': 1.0.3 + '@types/tar': ^6.1.11 ast-types: ^0.14.2 - autoprefixer: 10.4.17 - axios: ^1.7.4 - axios-retry: ^4.0.0 - blessed: ^0.1.81 - boxen: ^7.1.1 - bullmq: ^5.7.5 - chai: ^4.3.7 - chalk: ^5.3.0 - change-case: ^5.2.0 - chart.js: ^4.4.2 - chatgpt: 5.2.5 - chromadb: 1.7.2 - class-variance-authority: ^0.7.0 - cli-progress: ^3.12.0 - clsx: ^2.0.0 colors-cli: ^1.0.33 - columnify: ^1.6.0 - constants-browserify: ^1.0.0 - cron: ^3.1.6 - cspell-cli: ^6.17.1 - csstype: ^3.1.1 - csv-parser: ^3.0.0 - cva: npm:class-variance-authority@^0.7.0 detect-indent: ^7.0.1 detect-newline: ^4.0.1 diff: ^5.1.0 - dotenv: ^16.4.5 - dotenv-cli: ^7.4.1 - esbuild-plugin-copy: ^2.1.1 - eslint: 8.56.0 - eslint-config-next: 14.1.0 - eslint-config-prettier: ^9.1.0 - eslint-plugin-prettier: ^5.1.3 - eslint-plugin-simple-import-sort: 12.0.0 - exponential-backoff: ^3.1.1 - fast-deep-equal: ^3.1.3 - fastify: 4.28.1 - fastify-plugin: 4.5.1 filenamify: ^6.0.0 - form-data: ^4.0.0 - framer-motion: ^11.0.6 - fuse.js: ^7.0.0 - fuzzysort: ^2.0.4 - get-youtube-id: ^1.0.1 git-url-parse: ^14.0.0 glob: ^10.4.5 - husky: ^9.0.11 inquirer: ^9.2.16 - intro.js: ^7.2.0 - intro.js-react: ^1.0.0 - io-ts: ^2.2.20 - io-ts-reporters: ^2.0.1 - io-ts-types: ^0.5.19 - ioredis: ^5.4.1 - js-beautify: ^1.14.11 - js-yaml: 4.1.0 json-schema-to-typescript: ^13.1.2 - jszip: ^3.10.1 - katex: ^0.16.10 - keytar: ^7.9.0 - langchain: 0.3.6 lodash-es: ^4.17.21 - lottie-react: ^2.4.0 - lowlight: ^3.0.0 - lucide-react: ^0.265.0 magic-string: ^0.30.10 - match-sorter: ^6.3.4 mdast-util-from-markdown: ^2.0.0 mdast-util-mdx: ^3.0.0 mdast-util-to-markdown: ^2.1.0 micromark-extension-mdxjs: ^2.0.0 - monaco-editor-webpack-plugin: ^7.0.1 - monocle-ts: ^2.3.13 - ms: ^2.1.3 - newtype-ts: ^0.3.5 - next: ^14.2.3 - next-sanity: ^8.5.0 - nock: ^13.5.1 - node-fetch: ^3.3.2 - null-loader: ^4.0.1 - open: ^8.4.2 openai: 4.23.0 - openai-edge: 1.2.2 - ora: ^8.0.1 - os-browserify: ^0.3.0 - pako: ^2.1.0 parse-github-url: 1.0.2 - pg: ^8.11.3 - postcss: 8.4.35 - postcss-multiple-tailwind: ^1.0.1 - posthog-node: ^4.0.0 - preact: ^10.13.2 - preact-compat: ^3.19.0 - prettier-plugin-packagejson: 2.4.10 - prettier-plugin-tailwindcss: 0.5.11 - prettyjson: ^1.2.5 - prism-react-renderer: ^2.3.1 - prisma: ^5.14.0 - prop-types: ^15.8.1 - ramda: ^0.29.1 - raw-loader: ^4.0.2 - rc-progress: ^3.4.1 - react-chartjs-2: ^5.2.0 - react-hook-form: ^7.48.2 - react-hot-toast: ^2.4.0 - react-markdown: ^8.0.7 - react-syntax-highlighter: ^15.5.0 - react-textarea-autosize: ^8.5.2 - react-toastify: ^9.1.3 - react-tooltip: ^5.9.0 - react-treeview: ^0.4.7 - react-tweet: ^3.2.0 - react-use: ^17.5.1 - reactjs-popup: ^2.0.5 - recast: ^0.22.0 - redux-persist: ^6.0.0 - rehype-sanitize: ^6.0.0 - remark-gfm: ^3.0.1 - remark-math: ^5.1.1 - replicate: 0.25.2 - sanity: ^3.36.4 - sanity-plugin-asset-source-ogimage: ^2.0.0-2 - sanity-plugin-documents-pane: ^2.2.1 - sanity-plugin-media: ^2.2.5 - sanity-plugin-mux-input: ^2.2.4 - server-only: 0.0.1 simple-git: ^3.24.0 - sinon: ^15.0.1 - socket.io: ^4.7.5 - socket.io-client: ^4.7.5 - sonner: ^1.4.2 - styled-components: ^6.1.8 - supertest: ^6.3.4 - swr: ^2.2.5 - tailwind-merge: ^1.10.0 - tailwindcss: 3.4.1 - tailwindcss-animate: ^1.0.7 - tar: ^6.1.15 - tar-stream: ^3.1.7 - terminal-link: ^3.0.0 - tippy.js: ^6.3.7 tree-kill: ^1.2.2 ts-invariant: ^0.10.3 - ts-loader: ^9.4.2 - ts-node-dev: ^2.0.0 - tslib: 2.4.1 - umd-compat-loader: ^2.1.2 - unified: ^10.1.2 - unist-util-filter: ^5.0.1 unist-util-visit: ^5.0.0 - universal-base64url: ^1.1.0 - unzipper: ^0.11.6 valibot: ^0.34.0 vaul: ^0.9.0 - vite: ^4.5.3 - vite-plugin-monaco-editor: ^1.1.0 - vite-plugin-svgr: ^2.4.0 - vite-tsconfig-paths: ^4.2.0 - vue-sfc-descriptor-to-string: ^2.0.0 - web-vitals: ^2.1.4 - webpack: 5.91.0 - webpack-cli: 5.1.4 - wrap-ansi: ^9.0.0 yaml: ^2.4.5 - yargs: ^17.6.2 - zod: 3.22.3 - zustand: ^4.5.2 + +onlyBuiltDependencies: + - '@ast-grep/cli' + - '@biomejs/biome' + - es5-ext + - esbuild diff --git a/tooling/.DS_Store b/tooling-legacy/.DS_Store similarity index 100% rename from tooling/.DS_Store rename to tooling-legacy/.DS_Store diff --git a/tooling/codemod-utils/README.md b/tooling-legacy/codemod-utils/README.md similarity index 100% rename from tooling/codemod-utils/README.md rename to tooling-legacy/codemod-utils/README.md diff --git a/tooling-legacy/codemod-utils/package.json b/tooling-legacy/codemod-utils/package.json new file mode 100644 index 00000000..ff3a5ede --- /dev/null +++ b/tooling-legacy/codemod-utils/package.json @@ -0,0 +1,39 @@ +{ + "name": "@codemod.com/codemod-utils", + "author": "Codemod, Inc.", + "imports": { + "#*": "./src/*" + }, + "version": "1.0.0", + "description": "Set of utilities for jscodeshift", + "type": "commonjs", + "main": "./dist/index.js", + "module": "./dist/index.js", + "types": "./dist/index.d.ts", + "files": [ + "./dist", + "!**/*.test.js", + "!**/*.test.d.ts", + "LICENSE", + "README.md", + "tsconfig.json" + ], + "scripts": { + "build": "tsc", + "test": "vitest run", + "test:watch": "vitest watch" + }, + "keywords": [], + "license": "Apache-2.0", + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.10.3", + "vitest": "^1.0.1", + "typescript": "^5.9.2" + }, + "dependencies": { + "@types/jscodeshift": "^0.11.11", + "@babel/parser": "^7.24.4", + "jscodeshift": "^0.16.1" + } +} diff --git a/tooling/codemod-utils/src/index.ts b/tooling-legacy/codemod-utils/src/index.ts similarity index 100% rename from tooling/codemod-utils/src/index.ts rename to tooling-legacy/codemod-utils/src/index.ts diff --git a/tooling/codemod-utils/src/jscodeshift/call-expression.ts b/tooling-legacy/codemod-utils/src/jscodeshift/call-expression.ts similarity index 100% rename from tooling/codemod-utils/src/jscodeshift/call-expression.ts rename to tooling-legacy/codemod-utils/src/jscodeshift/call-expression.ts diff --git a/tooling/codemod-utils/src/jscodeshift/class.ts b/tooling-legacy/codemod-utils/src/jscodeshift/class.ts similarity index 100% rename from tooling/codemod-utils/src/jscodeshift/class.ts rename to tooling-legacy/codemod-utils/src/jscodeshift/class.ts diff --git a/tooling/codemod-utils/src/jscodeshift/function.ts b/tooling-legacy/codemod-utils/src/jscodeshift/function.ts similarity index 100% rename from tooling/codemod-utils/src/jscodeshift/function.ts rename to tooling-legacy/codemod-utils/src/jscodeshift/function.ts diff --git a/tooling/codemod-utils/src/jscodeshift/global.ts b/tooling-legacy/codemod-utils/src/jscodeshift/global.ts similarity index 100% rename from tooling/codemod-utils/src/jscodeshift/global.ts rename to tooling-legacy/codemod-utils/src/jscodeshift/global.ts diff --git a/tooling/codemod-utils/src/jscodeshift/import-declaration.ts b/tooling-legacy/codemod-utils/src/jscodeshift/import-declaration.ts similarity index 100% rename from tooling/codemod-utils/src/jscodeshift/import-declaration.ts rename to tooling-legacy/codemod-utils/src/jscodeshift/import-declaration.ts diff --git a/tooling/codemod-utils/src/jscodeshift/parser.ts b/tooling-legacy/codemod-utils/src/jscodeshift/parser.ts similarity index 100% rename from tooling/codemod-utils/src/jscodeshift/parser.ts rename to tooling-legacy/codemod-utils/src/jscodeshift/parser.ts diff --git a/tooling/codemod-utils/src/jscodeshift/react.ts b/tooling-legacy/codemod-utils/src/jscodeshift/react.ts similarity index 100% rename from tooling/codemod-utils/src/jscodeshift/react.ts rename to tooling-legacy/codemod-utils/src/jscodeshift/react.ts diff --git a/tooling/codemod-utils/src/jscodeshift/tests.ts b/tooling-legacy/codemod-utils/src/jscodeshift/tests.ts similarity index 100% rename from tooling/codemod-utils/src/jscodeshift/tests.ts rename to tooling-legacy/codemod-utils/src/jscodeshift/tests.ts diff --git a/tooling/codemod-utils/test/call-expression.ts b/tooling-legacy/codemod-utils/test/call-expression.ts similarity index 100% rename from tooling/codemod-utils/test/call-expression.ts rename to tooling-legacy/codemod-utils/test/call-expression.ts diff --git a/tooling/codemod-utils/test/function.ts b/tooling-legacy/codemod-utils/test/function.ts similarity index 100% rename from tooling/codemod-utils/test/function.ts rename to tooling-legacy/codemod-utils/test/function.ts diff --git a/tooling/codemod-utils/test/global.ts b/tooling-legacy/codemod-utils/test/global.ts similarity index 100% rename from tooling/codemod-utils/test/global.ts rename to tooling-legacy/codemod-utils/test/global.ts diff --git a/tooling/codemod-utils/test/import.ts b/tooling-legacy/codemod-utils/test/import.ts similarity index 100% rename from tooling/codemod-utils/test/import.ts rename to tooling-legacy/codemod-utils/test/import.ts diff --git a/tooling/codemod-utils/test/react.ts b/tooling-legacy/codemod-utils/test/react.ts similarity index 100% rename from tooling/codemod-utils/test/react.ts rename to tooling-legacy/codemod-utils/test/react.ts diff --git a/tooling-legacy/codemod-utils/tsconfig.json b/tooling-legacy/codemod-utils/tsconfig.json new file mode 100644 index 00000000..559d7332 --- /dev/null +++ b/tooling-legacy/codemod-utils/tsconfig.json @@ -0,0 +1,11 @@ +{ + "include": ["src"], + "exclude": ["dist", "build", "node_modules"], + "extends": "@codemod-com/tsconfig/lib.json", + "compilerOptions": { + "baseUrl": ".", + "rootDir": "src", + "outDir": "dist", + "declaration": true, + } +} diff --git a/tooling-legacy/codemod-utils/vitest.config.ts b/tooling-legacy/codemod-utils/vitest.config.ts new file mode 100644 index 00000000..772ad4c3 --- /dev/null +++ b/tooling-legacy/codemod-utils/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/test/*.ts"], + }, +}); diff --git a/tooling/filemod/README.md b/tooling-legacy/filemod/README.md similarity index 100% rename from tooling/filemod/README.md rename to tooling-legacy/filemod/README.md diff --git a/tooling-legacy/filemod/package.json b/tooling-legacy/filemod/package.json new file mode 100644 index 00000000..310fb9b5 --- /dev/null +++ b/tooling-legacy/filemod/package.json @@ -0,0 +1,33 @@ +{ + "name": "@codemod-com/filemod", + "author": "Codemod, Inc.", + "version": "2.1.0", + "description": "The filemod by Codemod.com", + "type": "module", + "main": "./dist/index.js", + "module": "./dist/index.js", + "types": "./dist/index.d.ts", + "private": true, + "files": [ + "./dist", + "!**/*.test.js", + "!**/*.test.d.ts", + "LICENSE", + "README.md", + "tsconfig.json" + ], + "scripts": { + "build": "tsc", + "test": "vitest run" + }, + "keywords": [], + "license": "Apache-2.0", + "devDependencies": { + "@codemod-com/tsconfig": "workspace:*", + "@types/node": "20.8.5", + "memfs": "^4.6.0", + "glob": "catalog:", + "vitest": "^1.0.1", + "typescript": "^5.2.2" + } +} diff --git a/tooling/filemod/src/api.ts b/tooling-legacy/filemod/src/api.ts similarity index 100% rename from tooling/filemod/src/api.ts rename to tooling-legacy/filemod/src/api.ts diff --git a/tooling/filemod/src/filemod.ts b/tooling-legacy/filemod/src/filemod.ts similarity index 100% rename from tooling/filemod/src/filemod.ts rename to tooling-legacy/filemod/src/filemod.ts diff --git a/tooling/filemod/src/index.ts b/tooling-legacy/filemod/src/index.ts similarity index 100% rename from tooling/filemod/src/index.ts rename to tooling-legacy/filemod/src/index.ts diff --git a/tooling/filemod/src/left-right-hashset-manager.ts b/tooling-legacy/filemod/src/left-right-hashset-manager.ts similarity index 100% rename from tooling/filemod/src/left-right-hashset-manager.ts rename to tooling-legacy/filemod/src/left-right-hashset-manager.ts diff --git a/tooling/filemod/src/options.ts b/tooling-legacy/filemod/src/options.ts similarity index 100% rename from tooling/filemod/src/options.ts rename to tooling-legacy/filemod/src/options.ts diff --git a/tooling/filemod/src/types/external-commands.ts b/tooling-legacy/filemod/src/types/external-commands.ts similarity index 100% rename from tooling/filemod/src/types/external-commands.ts rename to tooling-legacy/filemod/src/types/external-commands.ts diff --git a/tooling/filemod/src/types/internal-commands.ts b/tooling-legacy/filemod/src/types/internal-commands.ts similarity index 100% rename from tooling/filemod/src/types/internal-commands.ts rename to tooling-legacy/filemod/src/types/internal-commands.ts diff --git a/tooling/filemod/src/types/options.ts b/tooling-legacy/filemod/src/types/options.ts similarity index 100% rename from tooling/filemod/src/types/options.ts rename to tooling-legacy/filemod/src/types/options.ts diff --git a/tooling/filemod/src/unified-file-system.test.ts b/tooling-legacy/filemod/src/unified-file-system.test.ts similarity index 100% rename from tooling/filemod/src/unified-file-system.test.ts rename to tooling-legacy/filemod/src/unified-file-system.test.ts diff --git a/tooling/filemod/src/unified-file-system.ts b/tooling-legacy/filemod/src/unified-file-system.ts similarity index 100% rename from tooling/filemod/src/unified-file-system.ts rename to tooling-legacy/filemod/src/unified-file-system.ts diff --git a/tooling/filemod/tsconfig.json b/tooling-legacy/filemod/tsconfig.json similarity index 100% rename from tooling/filemod/tsconfig.json rename to tooling-legacy/filemod/tsconfig.json diff --git a/tooling-legacy/filemod/vitest.config.ts b/tooling-legacy/filemod/vitest.config.ts new file mode 100644 index 00000000..31444f27 --- /dev/null +++ b/tooling-legacy/filemod/vitest.config.ts @@ -0,0 +1,7 @@ +import { configDefaults, defineConfig } from "vitest/config"; + +export default defineConfig({ + test: { + include: [...configDefaults.include, "**/*test.ts"], + }, +}); diff --git a/tooling/tsconfig/base.json b/tooling-legacy/tsconfig/base.json similarity index 88% rename from tooling/tsconfig/base.json rename to tooling-legacy/tsconfig/base.json index 9ce77b15..06b3a685 100644 --- a/tooling/tsconfig/base.json +++ b/tooling-legacy/tsconfig/base.json @@ -25,8 +25,5 @@ "noUncheckedIndexedAccess": true, "noPropertyAccessFromIndexSignature": false }, - "exclude": ["node_modules/**/*", "dist/**/*"], - "ts-node": { - "transpileOnly": true - } + "exclude": ["node_modules/**/*", "dist/**/*"] } diff --git a/tooling/tsconfig/codemod.json b/tooling-legacy/tsconfig/codemod.json similarity index 100% rename from tooling/tsconfig/codemod.json rename to tooling-legacy/tsconfig/codemod.json diff --git a/tooling/tsconfig/lib.json b/tooling-legacy/tsconfig/lib.json similarity index 100% rename from tooling/tsconfig/lib.json rename to tooling-legacy/tsconfig/lib.json diff --git a/tooling-legacy/tsconfig/package.json b/tooling-legacy/tsconfig/package.json new file mode 100644 index 00000000..e679e669 --- /dev/null +++ b/tooling-legacy/tsconfig/package.json @@ -0,0 +1,14 @@ +{ + "name": "@codemod-com/tsconfig", + "version": "0.0.0", + "private": true, + "license": "MIT", + "files": [ + "base.json", + "codemod.json", + "lib.json" + ], + "publishConfig": { + "access": "public" + } +} diff --git a/tooling/utilities/CHANGELOG.md b/tooling-legacy/utilities/CHANGELOG.md similarity index 100% rename from tooling/utilities/CHANGELOG.md rename to tooling-legacy/utilities/CHANGELOG.md diff --git a/tooling/utilities/README.md b/tooling-legacy/utilities/README.md similarity index 100% rename from tooling/utilities/README.md rename to tooling-legacy/utilities/README.md diff --git a/tooling-legacy/utilities/package.json b/tooling-legacy/utilities/package.json new file mode 100644 index 00000000..183fd616 --- /dev/null +++ b/tooling-legacy/utilities/package.json @@ -0,0 +1,54 @@ +{ + "name": "@codemod-com/utilities", + "author": "Codemod, Inc.", + "version": "1.1.8", + "description": "The utilities used across Codemod.com packages", + "type": "commonjs", + "main": "./dist/index.js", + "module": "./dist/index.js", + "types": "./dist/index.d.ts", + "sideEffects": false, + "files": [ + "./dist", + "!**/*.test.js", + "!**/*.test.d.ts", + "LICENSE", + "README.md", + "tsconfig.json" + ], + "private": true, + "scripts": { + "build": "tsc" + }, + "keywords": [], + "license": "Apache-2.0", + "devDependencies": { + "@types/adm-zip": "0.5.7", + "@types/js-beautify": "^1.14.3", + "@types/jscodeshift": "^0.11.11", + "@types/node": "20.10.3", + "@types/pako": "^2.0.0", + "@types/semver": "^7.5.8", + "@types/tar": "6.1.13", + "@types/tar-stream": "^3.1.3", + "@types/unzipper": "^0.10.9", + "memfs": "^4.15.2", + "typescript": "^5.9.2", + "@codemod-com/tsconfig": "workspace:*" + }, + "dependencies": { + "@codemod-com/filemod": "workspace:*", + "adm-zip": "0.5.16", + "change-case": "^5.2.0", + "glob": "catalog:", + "js-beautify": " ^1.14.11", + "jscodeshift": "^0.15.1", + "pako": "^2.1.0", + "prettier": "^3.2.5", + "semver": "^7.6.2", + "tar": "^6.1.15", + "tar-stream": "^3.1.7", + "unzipper": "^0.11.6", + "valibot": "catalog:" + } +} diff --git a/tooling/utilities/src/constants.ts b/tooling-legacy/utilities/src/constants.ts similarity index 100% rename from tooling/utilities/src/constants.ts rename to tooling-legacy/utilities/src/constants.ts diff --git a/tooling/utilities/src/functions/archive.ts b/tooling-legacy/utilities/src/functions/archive.ts similarity index 100% rename from tooling/utilities/src/functions/archive.ts rename to tooling-legacy/utilities/src/functions/archive.ts diff --git a/tooling/utilities/src/functions/codemods.ts b/tooling-legacy/utilities/src/functions/codemods.ts similarity index 100% rename from tooling/utilities/src/functions/codemods.ts rename to tooling-legacy/utilities/src/functions/codemods.ts diff --git a/tooling/utilities/src/functions/crypto.ts b/tooling-legacy/utilities/src/functions/crypto.ts similarity index 100% rename from tooling/utilities/src/functions/crypto.ts rename to tooling-legacy/utilities/src/functions/crypto.ts diff --git a/tooling/utilities/src/functions/debounce.ts b/tooling-legacy/utilities/src/functions/debounce.ts similarity index 100% rename from tooling/utilities/src/functions/debounce.ts rename to tooling-legacy/utilities/src/functions/debounce.ts diff --git a/tooling/utilities/src/functions/formatting.ts b/tooling-legacy/utilities/src/functions/formatting.ts similarity index 100% rename from tooling/utilities/src/functions/formatting.ts rename to tooling-legacy/utilities/src/functions/formatting.ts diff --git a/tooling/utilities/src/functions/hash.ts b/tooling-legacy/utilities/src/functions/hash.ts similarity index 100% rename from tooling/utilities/src/functions/hash.ts rename to tooling-legacy/utilities/src/functions/hash.ts diff --git a/tooling/utilities/src/functions/node.ts b/tooling-legacy/utilities/src/functions/node.ts similarity index 100% rename from tooling/utilities/src/functions/node.ts rename to tooling-legacy/utilities/src/functions/node.ts diff --git a/tooling/utilities/src/functions/project-root.ts b/tooling-legacy/utilities/src/functions/project-root.ts similarity index 100% rename from tooling/utilities/src/functions/project-root.ts rename to tooling-legacy/utilities/src/functions/project-root.ts diff --git a/tooling/utilities/src/functions/validation.ts b/tooling-legacy/utilities/src/functions/validation.ts similarity index 100% rename from tooling/utilities/src/functions/validation.ts rename to tooling-legacy/utilities/src/functions/validation.ts diff --git a/tooling/utilities/src/index.ts b/tooling-legacy/utilities/src/index.ts similarity index 100% rename from tooling/utilities/src/index.ts rename to tooling-legacy/utilities/src/index.ts diff --git a/tooling/utilities/src/package-boilerplate.ts b/tooling-legacy/utilities/src/package-boilerplate.ts similarity index 98% rename from tooling/utilities/src/package-boilerplate.ts rename to tooling-legacy/utilities/src/package-boilerplate.ts index 5d0a713c..ee93e284 100644 --- a/tooling/utilities/src/package-boilerplate.ts +++ b/tooling-legacy/utilities/src/package-boilerplate.ts @@ -1,8 +1,8 @@ import * as changeCase from "change-case"; import jsBeautify from "js-beautify"; -import baseTsconfig from "@codemod-com/tsconfig/base.json" assert { type: "json" }; -import codemodTsconfig from "@codemod-com/tsconfig/codemod.json" assert { type: "json" }; +import baseTsconfig from "@codemod-com/tsconfig/base.json"; +import codemodTsconfig from "@codemod-com/tsconfig/codemod.json"; import { isNeitherNullNorUndefined } from "./functions/validation.js"; import { type CodemodConfigInput, @@ -189,10 +189,7 @@ const tsconfigJson = () => { "./test/**/*.ts", "./test/**/*.js" ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } + "exclude": ["node_modules", "./dist/**/*"] } `); }; diff --git a/tooling/utilities/src/registry.ts b/tooling-legacy/utilities/src/registry.ts similarity index 100% rename from tooling/utilities/src/registry.ts rename to tooling-legacy/utilities/src/registry.ts diff --git a/tooling/utilities/src/schemata/argument-record.ts b/tooling-legacy/utilities/src/schemata/argument-record.ts similarity index 100% rename from tooling/utilities/src/schemata/argument-record.ts rename to tooling-legacy/utilities/src/schemata/argument-record.ts diff --git a/tooling/utilities/src/schemata/codemod-config.ts b/tooling-legacy/utilities/src/schemata/codemod-config.ts similarity index 100% rename from tooling/utilities/src/schemata/codemod-config.ts rename to tooling-legacy/utilities/src/schemata/codemod-config.ts diff --git a/tooling/utilities/src/schemata/codemod.ts b/tooling-legacy/utilities/src/schemata/codemod.ts similarity index 100% rename from tooling/utilities/src/schemata/codemod.ts rename to tooling-legacy/utilities/src/schemata/codemod.ts diff --git a/tooling/utilities/src/schemata/engine-options.ts b/tooling-legacy/utilities/src/schemata/engine-options.ts similarity index 100% rename from tooling/utilities/src/schemata/engine-options.ts rename to tooling-legacy/utilities/src/schemata/engine-options.ts diff --git a/tooling/utilities/src/schemata/file-commands.ts b/tooling-legacy/utilities/src/schemata/file-commands.ts similarity index 100% rename from tooling/utilities/src/schemata/file-commands.ts rename to tooling-legacy/utilities/src/schemata/file-commands.ts diff --git a/tooling/utilities/src/schemata/github-run.ts b/tooling-legacy/utilities/src/schemata/github-run.ts similarity index 100% rename from tooling/utilities/src/schemata/github-run.ts rename to tooling-legacy/utilities/src/schemata/github-run.ts diff --git a/tooling/utilities/tsconfig.json b/tooling-legacy/utilities/tsconfig.json similarity index 100% rename from tooling/utilities/tsconfig.json rename to tooling-legacy/utilities/tsconfig.json diff --git a/tooling/LICENSE b/tooling/LICENSE deleted file mode 100644 index a1d2c6c5..00000000 --- a/tooling/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2023 Codemod, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/tooling/README.md b/tooling/README.md deleted file mode 100644 index dd049b13..00000000 --- a/tooling/README.md +++ /dev/null @@ -1 +0,0 @@ -# Workflow diff --git a/tooling/build.js b/tooling/build.js deleted file mode 100644 index d4274677..00000000 --- a/tooling/build.js +++ /dev/null @@ -1,35 +0,0 @@ -import { build } from "esbuild"; - -build({ - entryPoints: ["./src/index.ts"], - bundle: true, - minify: true, - platform: "node", - target: "node18", - format: "esm", - legalComments: "inline", - outfile: "./dist/index.mjs", - external: [ - "@ast-grep/napi", - "@ast-grep/cli", - "@sindresorhus/slugify", - "colors-cli", - "filenamify", - "glob", - "lodash", - "magic-string", - "openai", - "simple-git", - "tree-kill", - "ts-invariant", - "prettier", - "jscodeshift", - "yaml", - "inquirer", - "detect-indent", - "detect-newline", - "@octokit/rest", - "git-url-parse", - "diff", - ], -}); diff --git a/tooling/codemod-utils/package.json b/tooling/codemod-utils/package.json deleted file mode 100644 index 9c8543b7..00000000 --- a/tooling/codemod-utils/package.json +++ /dev/null @@ -1,39 +0,0 @@ -{ - "name": "@codemod.com/codemod-utils", - "author": "Codemod, Inc.", - "imports": { - "#*": "./src/*" - }, - "version": "1.0.0", - "description": "Set of utilities for jscodeshift", - "type": "module", - "main": "./dist/index.js", - "types": "./dist/index.d.ts", - "files": [ - "./dist", - "!**/*.test.js", - "!**/*.test.d.ts", - "LICENSE", - "README.md", - "tsconfig.json" - ], - "scripts": { - "build": "tsc", - "test": "vitest run", - "test:watch": "vitest watch", - "coverage": "vitest run --coverage" - }, - "keywords": [], - "license": "Apache-2.0", - "devDependencies": { - "@types/node": "20.10.3", - "@vitest/coverage-v8": "catalog:", - "ts-node": "10.9.1", - "vitest": "^1.0.1" - }, - "dependencies": { - "@types/jscodeshift": "^0.11.11", - "@babel/parser": "^7.24.4", - "jscodeshift": "^0.16.1" - } -} diff --git a/tooling/codemod-utils/tsconfig.json b/tooling/codemod-utils/tsconfig.json deleted file mode 100644 index bd24df88..00000000 --- a/tooling/codemod-utils/tsconfig.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "include": ["./src"], - "exclude": ["./dist", "./node_modules"], - "extends": "@codemod-com/tsconfig/lib.json", - "compilerOptions": { - "baseUrl": ".", - "rootDir": "./src", - "outDir": "./dist" - } -} diff --git a/tooling/examples/codemod@2.0.ts b/tooling/examples/codemod@2.0.ts deleted file mode 100644 index 83203d2b..00000000 --- a/tooling/examples/codemod@2.0.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { Api } from "../src/index.js"; - -export async function workflow({ files }: Api) { - await files(`**/*.input.ts`).jsFam().astGrep("$SCHEMA($$$REST, [$$$ACTIONS])") - .ai` - SCHEMA could be one of 'any', 'array', 'bigint', 'blob', 'boolean', 'custom', 'date', 'enum_', 'instance', 'intersect', - 'lazy', 'literal', 'looseObject', 'looseTuple', 'map', 'nan', 'never', 'nonNullable', 'nonNullish', 'nonOptional', - 'null_', 'nullable', 'nullish', 'number', 'object', 'objectWithRest', 'optional', 'picklist', 'record', 'set', - 'strictObject', 'strictTuple', 'string', 'symbol', 'tuple', 'tupleWithRest', 'undefined_', 'union', 'unknown', 'variant', - 'void_' - ACTIONS is array of calls to one of 'bic', 'brand', 'bytes', 'check', 'creditCard', 'cuid2', 'decimal', 'email', - 'emoji', 'empty', 'endsWith', 'every', 'excludes', 'finite', 'hash', 'hexadecimal', 'hexColor', 'imei', 'includes', - 'integer', 'ip', 'ipv4', 'ipv6', 'isoDate', 'isoDateTime', 'isoTime', 'isoTimeSecond', 'isoTimestamp', 'isoWeek', - 'length', 'mac', 'mac48', 'mac64', 'maxBytes', 'maxLength', 'maxSize', 'maxValue', 'mimeType', 'minBytes', - 'minLength', 'minSize', 'minValue', 'multipleOf', 'nonEmpty', 'notBytes', 'notLength', 'notSize', 'notValue', 'octal', - 'readonly', 'regex', 'safeInteger', 'size', 'some', 'startsWith', 'toLowerCase', 'toMaxValue', 'toMinValue', 'toUpperCase', - 'transform', 'trim', 'trimEnd', 'trimStart', 'ulid', 'url', 'uuid', 'value', 'forward' - - If $SCHEMA is not one of SCHEMA, skip - If $$$ACTIONS is not one of ACTIONS, skip - - If skipping - return same string - - Take into account recursive replacements - - Example - Before: v.string('some string', [v.email()]) - After: v.pipe(v.string('some string'), v.email()) - `; -} diff --git a/tooling/examples/git-example.ts b/tooling/examples/git-example.ts deleted file mode 100644 index afdc6af9..00000000 --- a/tooling/examples/git-example.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Api } from "../src/index.js"; - -export async function workflow({ git }: Api) { - await git - .clone("git@github.com:codemod-com/codemod.git") - .branch("convert-console-log-to-error") - .files() - .jsFam() - .astGrep("console.log($$$ARGS)") - .replace("console.error($$$ARGS)"); -} diff --git a/tooling/examples/github.ts b/tooling/examples/github.ts deleted file mode 100644 index 73f8f9e7..00000000 --- a/tooling/examples/github.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { Api } from "../src/index.js"; - -export async function workflow({ github }: Api) { - await github.fork`git@github.com:codemod-com/codemod.git`.clone( - async ({ branch, codemod, commit, push, pr }) => { - await branch("pnpm-catalog"); - await codemod("pnpm/catalog"); - await commit("migration to pnpm catalog"); - await push(); - await pr({ - title: "chore: pnpm catalog migration", - body: `# Migration to pnpm catalog -## Updated description -This PR migrates to the [pnpm catalog](https://pnpm.io/catalogs), a new feature that is available starting pnpm@9.5.0 -Using [pnpm catalog codemod](https://codemod.com/registry/pnpm-catalog). -PR is safe to merge. -`, - }); - }, - ); -} diff --git a/tooling/filemod/package.json b/tooling/filemod/package.json deleted file mode 100644 index ba0464ce..00000000 --- a/tooling/filemod/package.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "name": "@codemod-com/filemod", - "author": "Codemod, Inc.", - "version": "2.1.0", - "description": "The filemod by Codemod.com", - "type": "module", - "main": "./dist/index.js", - "module": "./dist/index.js", - "types": "./dist/index.d.ts", - "private": true, - "files": [ - "./dist", - "!**/*.test.js", - "!**/*.test.d.ts", - "LICENSE", - "README.md", - "tsconfig.json" - ], - "scripts": { - "build": "tsc", - "test": "vitest run", - "coverage": "vitest run --coverage" - }, - "keywords": [], - "license": "Apache-2.0", - "devDependencies": { - "@types/node": "20.8.5", - "memfs": "^4.6.0", - "glob": "catalog:", - "ts-node": "10.9.1", - "vitest": "^1.0.1", - "@vitest/coverage-v8": "catalog:" - } -} diff --git a/tooling/package.json b/tooling/package.json deleted file mode 100644 index cc6a8e68..00000000 --- a/tooling/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "name": "@codemod.com/workflow", - "author": "Codemod, Inc.", - "type": "module", - "version": "0.0.31", - "description": "Workflow Engine for Codemod", - "main": "./dist/index.mjs", - "types": "./dist/index.d.ts", - "sideEffects": false, - "private": false, - "files": [ - "./dist", - "!**/*.test.js", - "!**/*.test.d.ts", - "LICENSE", - "README.md" - ], - "scripts": { - "build": "tsc && node ./build.js", - "test": "vitest run", - "coverage": "vitest run --coverage", - "prepublish": "cp package.json package.json.bak && jq 'del(.devDependencies)' package.json.bak > package.json", - "postpublish": "rm package.json && mv package.json.bak package.json" - }, - "keywords": [], - "license": "Apache-2.0", - "repository": { - "type": "git", - "url": "https://github.com/codemod-com/codemod.git", - "directory": "packages/workflow" - }, - "dependencies": { - "@ast-grep/cli": "catalog:", - "@ast-grep/napi": "catalog:", - "@octokit/rest": "catalog:", - "@sindresorhus/slugify": "catalog:", - "@types/jscodeshift": "^0.11.6", - "colors-cli": "catalog:", - "detect-indent": "catalog:", - "detect-newline": "catalog:", - "filenamify": "catalog:", - "glob": "catalog:", - "git-url-parse": "catalog:", - "jscodeshift": "^0.15.0", - "lodash-es": "catalog:", - "magic-string": "catalog:", - "openai": "catalog:", - "prettier": "^3.2.5", - "simple-git": "catalog:", - "tree-kill": "catalog:", - "ts-invariant": "catalog:", - "yaml": "catalog:", - "inquirer": "catalog:", - "diff": "catalog:" - }, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "@types/lodash-es": "catalog:", - "esbuild": "^0.17.14", - "typescript": "^5.2.2", - "@types/inquirer": "catalog:", - "simple-git": "^3.24.0", - "tree-kill": "^1.2.2", - "ts-invariant": "^0.10.3", - "yaml": "^2.4.5", - "@types/git-url-parse": "^9.0.3", - "@types/diff": "catalog:" - } -} diff --git a/tooling/react-utils/index.js b/tooling/react-utils/index.js deleted file mode 100644 index 3bc680c5..00000000 --- a/tooling/react-utils/index.js +++ /dev/null @@ -1,308 +0,0 @@ -/** - * Copyright 2015-present, Facebook, Inc. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - * - */ - -'use strict'; - -module.exports = function(j) { - const REACT_CREATE_CLASS_MEMBER_EXPRESSION = { - type: 'MemberExpression', - object: { - name: 'React', - }, - property: { - name: 'createClass', - }, - }; - - // --------------------------------------------------------------------------- - // Checks if the file requires a certain module - const hasModule = (path, module) => - path - .findVariableDeclarators() - .filter(j.filters.VariableDeclarator.requiresModule(module)) - .size() === 1 || - path - .find(j.ImportDeclaration, { - type: 'ImportDeclaration', - source: { - type: 'Literal', - }, - }) - .filter(declarator => declarator.value.source.value === module) - .size() === 1; - - const hasReact = path => ( - hasModule(path, 'React') || - hasModule(path, 'react') || - hasModule(path, 'react/addons') || - hasModule(path, 'react-native') - ); - - // --------------------------------------------------------------------------- - // Finds all variable declarations that call React.createClass - const findReactCreateClassCallExpression = path => - j(path).find(j.CallExpression, { - callee: REACT_CREATE_CLASS_MEMBER_EXPRESSION, - }); - - const findReactCreateClass = path => - path - .findVariableDeclarators() - .filter(decl => findReactCreateClassCallExpression(decl).size() > 0); - - const findReactCreateClassExportDefault = path => - path.find(j.ExportDeclaration, { - default: true, - declaration: { - type: 'CallExpression', - callee: REACT_CREATE_CLASS_MEMBER_EXPRESSION, - }, - }); - - const findReactCreateClassModuleExports = path => - path - .find(j.AssignmentExpression, { - left: { - type: 'MemberExpression', - object: { - type: 'Identifier', - name: 'module', - }, - property: { - type: 'Identifier', - name: 'exports', - }, - }, - right: { - type: 'CallExpression', - callee: REACT_CREATE_CLASS_MEMBER_EXPRESSION, - }, - }); - - const getReactCreateClassSpec = classPath => { - const {value} = classPath; - const args = (value.init || value.right || value.declaration).arguments; - if (args && args.length) { - const spec = args[0]; - if (spec.type === 'ObjectExpression' && Array.isArray(spec.properties)) { - return spec; - } - } - return null; - }; - - // --------------------------------------------------------------------------- - // Finds alias for React.Component if used as named import. - const findReactComponentNameByParent = (path, parentClassName) => { - const reactImportDeclaration = path - .find(j.ImportDeclaration, { - type: 'ImportDeclaration', - source: { - type: 'Literal', - }, - }) - .filter(importDeclaration => hasReact(path)); - - const componentImportSpecifier = reactImportDeclaration - .find(j.ImportSpecifier, { - type: 'ImportSpecifier', - imported: { - type: 'Identifier', - name: parentClassName, - }, - }).at(0); - - const paths = componentImportSpecifier.paths(); - return paths.length - ? paths[0].value.local.name - : undefined; - }; - - const removeUnusedSuperClassImport = (path, file, superClassName) => { - if (path.find(j.Identifier, { - type: 'Identifier', - name: superClassName - }).length === 0) { - file.find(j.ImportSpecifier, { - type: 'ImportSpecifier', - imported: { - type: 'Identifier', - name: superClassName, - } - }).remove(); - } - }; - - const findReactES6ClassDeclarationByParent = (path, parentClassName) => { - const componentImport = findReactComponentNameByParent(path, parentClassName); - - const selector = componentImport - ? { - superClass: { - type: 'Identifier', - name: componentImport, - }, - } - : { - superClass: { - type: 'MemberExpression', - object: { - type: 'Identifier', - name: 'React', - }, - property: { - type: 'Identifier', - name: parentClassName, - }, - }, - }; - - return path - .find(j.ClassDeclaration, selector); - }; - - // Finds all classes that extend React.Component - const findReactES6ClassDeclaration = path => { - let classDeclarations = findReactES6ClassDeclarationByParent(path, 'Component'); - if (classDeclarations.size() === 0) { - classDeclarations = findReactES6ClassDeclarationByParent(path, 'PureComponent'); - } - return classDeclarations; - }; - - // --------------------------------------------------------------------------- - // Checks if the React class has mixins - const isMixinProperty = property => { - const key = property.key; - const value = property.value; - return ( - key.name === 'mixins' && - value.type === 'ArrayExpression' && - Array.isArray(value.elements) && - value.elements.length - ); - }; - - const hasMixins = classPath => { - const spec = getReactCreateClassSpec(classPath); - return spec && spec.properties.some(isMixinProperty); - }; - - // --------------------------------------------------------------------------- - // Others - const getClassExtendReactSpec = classPath => classPath.value.body; - - const createCreateReactClassCallExpression = properties => - j.callExpression( - j.memberExpression( - j.identifier('React'), - j.identifier('createClass'), - false - ), - [j.objectExpression(properties)] - ); - - const getComponentName = - classPath => classPath.node.id && classPath.node.id.name; - - // --------------------------------------------------------------------------- - // Direct methods! (see explanation below) - const findAllReactCreateClassCalls = path => - path.find(j.CallExpression, { - callee: REACT_CREATE_CLASS_MEMBER_EXPRESSION, - }); - - // Mixin Stuff - const containSameElements = (ls1, ls2) => { - if (ls1.length !== ls2.length) { - return false; - } - - return ( - ls1.reduce((res, x) => res && ls2.indexOf(x) !== -1, true) && - ls2.reduce((res, x) => res && ls1.indexOf(x) !== -1, true) - ); - }; - - const keyNameIsMixins = property => property.key.name === 'mixins'; - - const isSpecificMixinsProperty = (property, mixinIdentifierNames) => { - const key = property.key; - const value = property.value; - - return ( - key.name === 'mixins' && - value.type === 'ArrayExpression' && - Array.isArray(value.elements) && - value.elements.every(elem => elem.type === 'Identifier') && - containSameElements(value.elements.map(elem => elem.name), mixinIdentifierNames) - ); - }; - - // These following methods assume that the argument is - // a `React.createClass` call expression. In other words, - // they should only be used with `findAllReactCreateClassCalls`. - const directlyGetCreateClassSpec = classPath => { - if (!classPath || !classPath.value) { - return null; - } - const args = classPath.value.arguments; - if (args && args.length) { - const spec = args[0]; - if (spec.type === 'ObjectExpression' && Array.isArray(spec.properties)) { - return spec; - } - } - return null; - }; - - const directlyGetComponentName = classPath => { - let result = ''; - if ( - classPath.parentPath.value && - classPath.parentPath.value.type === 'VariableDeclarator' - ) { - result = classPath.parentPath.value.id.name; - } - return result; - }; - - const directlyHasMixinsField = classPath => { - const spec = directlyGetCreateClassSpec(classPath); - return spec && spec.properties.some(keyNameIsMixins); - }; - - const directlyHasSpecificMixins = (classPath, mixinIdentifierNames) => { - const spec = directlyGetCreateClassSpec(classPath); - return spec && spec.properties.some(prop => isSpecificMixinsProperty(prop, mixinIdentifierNames)); - }; - - return { - createCreateReactClassCallExpression, - findReactES6ClassDeclaration, - findReactCreateClass, - findReactCreateClassCallExpression, - findReactCreateClassModuleExports, - findReactCreateClassExportDefault, - getComponentName, - getReactCreateClassSpec, - getClassExtendReactSpec, - hasMixins, - hasModule, - hasReact, - isMixinProperty, - removeUnusedSuperClassImport, - - // "direct" methods - findAllReactCreateClassCalls, - directlyGetComponentName, - directlyGetCreateClassSpec, - directlyHasMixinsField, - directlyHasSpecificMixins, - }; -}; \ No newline at end of file diff --git a/tooling/react-utils/package.json b/tooling/react-utils/package.json deleted file mode 100644 index 8a1f6a27..00000000 --- a/tooling/react-utils/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@react-codemods/utils", - "version": "1.0.0", - "private": true, - "files": [ - "*.js" - ] -} diff --git a/tooling/src/PLazy.ts b/tooling/src/PLazy.ts deleted file mode 100644 index 30406210..00000000 --- a/tooling/src/PLazy.ts +++ /dev/null @@ -1,65 +0,0 @@ -// https://github.com/sindresorhus/p-lazy -// @ts-ignore -export class PLazy extends Promise { - #executor; - #promise?: Promise; - - constructor( - executor: ( - resolve: (resolvedValue: ValueType) => void, - reject: (error: any) => void, - ) => void, - ) { - super((resolve) => { - // @ts-ignore - resolve(); - }); - - this.#executor = executor; - } - - // @ts-ignore - static from(function_) { - // @ts-ignore - return new PLazy((resolve) => { - resolve(function_()); - }); - } - - // @ts-ignore - static resolve(value) { - // @ts-ignore - return new PLazy((resolve) => { - resolve(value); - }); - } - - // @ts-ignore - static reject(error) { - // @ts-ignore - return new PLazy((resolve, reject) => { - reject(error); - }); - } - - // biome-ignore lint/suspicious/noThenProperty: - override then( - onFulfilled: - | ((resolvedValue: ValueType) => TResult1 | PromiseLike) - | null - | undefined, - onRejected: - | ((error: any) => TResult2 | PromiseLike) - | null - | undefined, - ) { - this.#promise ??= new Promise(this.#executor); - return this.#promise.then(onFulfilled, onRejected); - } - - // @ts-ignore - catch(onRejected) { - this.#promise = this.#promise || new Promise(this.#executor); - return this.#promise.catch(onRejected); - } -} diff --git a/tooling/src/ai/ai.ts b/tooling/src/ai/ai.ts deleted file mode 100644 index 7f37232b..00000000 --- a/tooling/src/ai/ai.ts +++ /dev/null @@ -1,244 +0,0 @@ -import { mapValues } from "lodash-es"; -import OpenAI from "openai"; -import type { PLazy } from "../PLazy.js"; -import { getAstGrepNodeContext, getFileContext } from "../contexts.js"; -import { FileContext } from "../contexts/FileContext.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { clc } from "../helpers.js"; - -const SYSTEM_PROMPT = ` -You are a meticulous engineer assigned to migrate a codebase by updating its code when necessary. - -When you write code, the code works on the first try, and is complete. Take into account the current repository's language, code style, and dependencies. - -You will be given a Context File, a Migration Description and a Source File. You will rewrite the Source File in order to apply the changes described in the Migration Description. - -You will use a Context File to understand the codebase and the Migration Description to apply the changes. -Context file will be surrounded by triple single quotes like this: -''' -context file here -''' - -If a line of code is not affected by the migration, you should keep it as it is. - -Source file will be split into multiple parts, each part starts with a comment like this: -// codemod#ai#0 -part code here -// codemod#ai#0 -where 0 is a number that represents the part number. - -You must print the modified Source File in the following format: - -\`\`\` -modified Source File -\`\`\` - -You must preserve parts naming and order. -`; - -type CodeSample = { - filename: string; - contents: string; - startPosition: number; - endPosition: number; - text: string; -}; - -class AiHandler { - private beforesSamples: Record = {}; - public query: string | undefined; - private _usage: OpenAI.Completions.CompletionUsage = { - completion_tokens: 0, - prompt_tokens: 0, - total_tokens: 0, - }; - - constructor(private userPrompt: string) {} - - addBefore(before: CodeSample) { - this.beforesSamples[before.filename] ??= []; - this.beforesSamples[before.filename]?.push(before); - } - - private get prompts() { - return mapValues( - this.beforesSamples, - (samples) => ` -You are migrating a code, which matches ast-grep pattern: -${this.query ?? ""} - -Context file: -''' -${samples[0]?.contents} -''' - -${this.userPrompt} - -${samples - .map( - (before, index) => ` -// codemod#ai#${index} -${before.text} -// codemod#ai#${index} - -`, - ) - .join("")}`, - ); - } - - public get usage() { - return this._usage; - } - - public static getReplacements(completionText?: string | null) { - // Match code block inside ``` and replace those quotes with empty string - const code = completionText - ?.match(/```([\s\S]*?)```/g)?.[0] - ?.replace(/^```/g, "") - ?.replace(/```$/g, ""); - - const replacements: string[] = []; - const parts = code?.split("\n") ?? []; - let currentIndex = -1; - let currentCode = ""; - for (const part of parts) { - const index = Number.parseInt( - part.match(/\/\/ codemod#ai#(\d+)/)?.[1] ?? "", - 10, - ); - if (!Number.isNaN(index)) { - if (currentIndex === index) { - replacements.push(currentCode); - currentCode = ""; - } else { - currentIndex = index; - } - continue; - } - - currentCode += part; - } - - return replacements; - } - - async execute() { - const apiKey = process.argv - .find((arg) => arg.startsWith("--OPENAI_API_KEY=")) - ?.replace("--OPENAI_API_KEY=", ""); - if (!apiKey) { - console.error( - `Please set OPENAI_API_KEY environment variable like "codemod ... --OPENAI_API_KEY=YOUR_API_KEY"`, - ); - process.exit(1); - } - const openai = new OpenAI({ apiKey }); - - await Promise.all( - Object.entries(this.prompts).map(async ([filename, prompt]) => { - const response = await openai.chat.completions.create({ - model: "gpt-4-turbo", - seed: 7, - messages: [ - { role: "system", content: SYSTEM_PROMPT }, - { role: "user", content: prompt }, - ], - temperature: 0.001, - n: 1, - }); - const usage = response?.usage; - if (usage) { - this._usage.completion_tokens += usage.completion_tokens; - this._usage.prompt_tokens += usage.prompt_tokens; - this._usage.total_tokens += usage.total_tokens; - } - const completion = response?.choices[0]?.message.content; - const replacements = AiHandler.getReplacements(completion); - const foundReplacements: { - startPosition: number; - endPosition: number; - text: string; - }[] = []; - const beforeSamples = this.beforesSamples[filename] ?? []; - for (let i = 0; i < beforeSamples.length; i++) { - const before = beforeSamples[i] as CodeSample; - const after = replacements[i] as string; - foundReplacements.push({ - startPosition: before.startPosition, - endPosition: before.endPosition, - text: after, - }); - } - if (foundReplacements.length) { - try { - const fileContext = new FileContext({ file: filename }); - for (const replacement of foundReplacements) { - await fileContext.update({ - start: replacement.startPosition, - end: replacement.endPosition, - replacement: replacement.text, - }); - } - await fileContext.save(); - } catch (e) { - // - } - } - }), - ); - - console.log( - `Codemod2.0 ${clc.blueBright("usage")}: ${clc.green("Prompt tokens")}(${ - this._usage.prompt_tokens - }), ${clc.green("Completion tokens")}(${ - this._usage.completion_tokens - }), ${clc.green("Total tokens")}(${this._usage.total_tokens})`, - ); - } -} - -export type AiReturn = PLazy & AiHelpers; - -/** - * @description Replaces code found with `ast-grep` pattern using instructions provided to LLM. Whole file would be passed as a context. Currently, it only supports OpenAI's GPT-4 Turbo model. You will have to provide your OpenAI API key to use this function when you call codemod in CLI - provide `--OPENAI_API_KEY`. - * @param prompt - The prompt to be used for LLM. - * @example - * ```ts - * await files() - * .astGrep('console.log($$$A)') - * .ai`Convert console.log to console.error` - * ``` - */ -export function aiLogic(rawPrompt: string | readonly string[]): AiReturn { - const prompt = typeof rawPrompt === "string" ? rawPrompt : rawPrompt.join(""); - const aiHandler = new AiHandler(prompt); - - return new FunctionExecutor("ai") - .arguments(() => ({ prompt })) - .helpers(aiHelpers) - .executor(async () => { - const { node, query } = getAstGrepNodeContext(); - const fileContext = getFileContext(); - const range = node.range(); - aiHandler.query = - typeof query === "string" ? query : JSON.stringify(query); - aiHandler.addBefore({ - filename: fileContext.file, - contents: await fileContext.contents(), - startPosition: range.start.index, - endPosition: range.end.index, - text: node.text(), - }); - }) - .return(async (self) => { - await aiHandler.execute(); - return self.wrappedHelpers(); - }) - .run(); -} - -export const ai = fnWrapper("ai", aiLogic); - -const aiHelpers = {}; -type AiHelpers = typeof aiHelpers; diff --git a/tooling/src/astGrep/astGrep.ts b/tooling/src/astGrep/astGrep.ts deleted file mode 100644 index 9b69942e..00000000 --- a/tooling/src/astGrep/astGrep.ts +++ /dev/null @@ -1,381 +0,0 @@ -import * as childProcess from "node:child_process"; -import * as fs from "node:fs/promises"; -import * as path from "node:path"; -import * as util from "node:util"; -import { Lang, type NapiConfig, SgNode, parse } from "@ast-grep/napi"; -import * as YAML from "yaml"; -import type { PLazy } from "../PLazy.js"; -import { ai } from "../ai/ai.js"; -import { - type AstGrepNodeContext, - astGrepNodeContext, - getFileContext, -} from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { clc } from "../helpers.js"; -import { exists } from "./exists.js"; -import { filter } from "./filter.js"; -import { map } from "./map.js"; -import { replace } from "./replace.js"; - -export { SgNode }; - -const fileExtensionToLang: Record = { - css: Lang.Css, - html: Lang.Html, - js: Lang.JavaScript, - jsx: Lang.JavaScript, - mjs: Lang.JavaScript, - mts: Lang.TypeScript, - cjs: Lang.JavaScript, - cts: Lang.TypeScript, - ts: Lang.TypeScript, - "d.ts": Lang.TypeScript, - tsx: Lang.Tsx, - sh: Lang.Bash, - c: Lang.C, - h: Lang.C, - cpp: Lang.Cpp, - hpp: Lang.Cpp, - cs: Lang.CSharp, - dart: Lang.Dart, - ex: Lang.Elixir, - exs: Lang.Elixir, - go: Lang.Go, - java: Lang.Java, - json: Lang.Json, - kt: Lang.Kotlin, - lua: Lang.Lua, - php: Lang.Php, - py: Lang.Python, - py3: Lang.Python, - rb: Lang.Ruby, - rs: Lang.Rust, - scala: Lang.Scala, - swift: Lang.Swift, - // TODO: remove after will be supported in ast-grep - // @ts-ignore - sql: Lang.Sql, - // @ts-ignore - psql: Lang.Sql, - // @ts-ignore - mysql: Lang.Sql, -}; - -type AstGrepPattern = - | string - | { - selector: string; - context: string; - strictness?: "cst" | "smart" | "ast" | "relaxed" | "signature"; - }; -type AstGrepStopBy = "end" | "neighbour" | AstGrepInsideRule; -type AstGrepInsideRule = { - pattern: AstGrepPattern; - stopBy?: AstGrepStopBy; - field?: string; -}; -type AstGrepHasRule = { - kind: string; - stopBy?: AstGrepStopBy; - field?: string; -}; -type AstGrepSiblingRule = { - kind: string; - stopBy?: AstGrepStopBy; -}; -type AstGrepAtomicRule = { - pattern: AstGrepPattern; - kind?: string; - regex?: string; - inside?: AstGrepInsideRule; - has?: AstGrepHasRule; - precedes?: AstGrepSiblingRule; - follows?: AstGrepSiblingRule; -}; -type AstGrepAllRule = { - all: AstGrepRules[]; -}; -type AstGrepAnyRule = { - any: AstGrepRules[]; -}; -type AstGrepNotRule = { - not: AstGrepRules; -}; -type AstGrepMatchRule = { - match: string; -}; -type AstGrepRules = - | AstGrepAtomicRule - | AstGrepAllRule - | AstGrepAnyRule - | AstGrepNotRule - | AstGrepMatchRule; - -type AstGrepAPI = { - id: string; - language: - | "Bash" - | "C" - | "Cpp" - | "CSharp" - | "Css" - | "Dart" - | "Elixir" - | "Go" - | "Html" - | "Java" - | "JavaScript" - | "Json" - | "Kotlin" - | "Lua" - | "Php" - | "Python" - | "Ruby" - | "Rust" - | "Scala" - | "Swift" - | "TypeScript" - | "Tsx"; - rule: AstGrepRules; - utils?: any; - fix?: any; -}; - -const execFile = util.promisify(childProcess.execFile); - -const runExternalAstGrepRule = async (rule: any, filepath: string) => { - const packageJsonFilepath = require.resolve("@ast-grep/cli/package.json"); - const { bin: binaries } = JSON.parse( - await fs.readFile(packageJsonFilepath, "utf-8"), - ); - const binaryPath = path.join( - path.dirname(require.resolve("@ast-grep/cli/package.json")), - binaries.sg, - ); - await execFile(binaryPath, [ - "scan", - "--update-all", - "--inline-rules", - JSON.stringify(rule), - filepath, - ]); -}; - -export type AstGrepHelpers = typeof astGrepHelpers; -export type AstGrepAPIHelpers = typeof astGrepAPIHelpers; - -/** - * @description Search for a pattern in the file using [ast-grep](https://ast-grep.github.io/). There are 2 ways to use this function: controlled and uncontrolled. If you will provide `id` in the `query` object - it will be passed to ast-grep CLI (`uncontrolled` mode). In all other cases `controlled` mode will be used with Napi (Node.js bindings to Rust). - * @param query It could be a string, string literal, [NapiConfig object](https://ast-grep.github.io/reference/api.html#napiconfig) - * @example - * ```ts - * // Pass parameter as string - * await astGrep("import React from 'react'") - * ``` - * @example - * ```ts - * // Pass parameter as string literal - * await astGrep`import React from 'react'` - * ``` - * @example - * ```ts - * // Pass parameter as NapiConfig - * await astGrep({ - * rule: { - * pattern: { - * context: "import React from 'react'", - * strictness: "relaxed", - * }, - * }, - * }) - * ``` - * @example - * ```ts - * // Pass parameter as YAML string literal - * await astGrep` - * rule: - * pattern: - * context: "import React from 'react'" - * strictness: "relaxed" - * ` - * ``` - * @see {@link map} - * @see {@link filter} - * @see {@link exists} - * @see {@link replace} - * @see {@link ai} - */ -export function astGrepLogic( - query: string | readonly string[] | NapiConfig, -): ReturnType; - -/** - * @description Search for a pattern in the file using [ast-grep](https://ast-grep.github.io/). There are 2 ways to use this function: controlled and uncontrolled. If you will provide `id` in the `query` object - it will be passed to ast-grep CLI (`uncontrolled` mode). In all other cases `controlled` mode will be used with Napi (Node.js bindings to Rust). - * @description This function is used for `uncontrolled` mode. You can chain call multiple `astGrep` functions to search for multiple patterns in the file using this mode. - * @param query It could be a string, string literal, [NapiConfig object](https://ast-grep.github.io/reference/api.html#napiconfig) - * @example - * ```ts - * // Pass directly to ast-grep CLI - * await astGrep({ - * id: "unique-id", - * rule: { - * pattern: { - * context: "import React from 'react'", - * strictness: "relaxed", - * }, - * }, - * fix: "import * as React from 'react'", - * }) - * ``` - * @example - * ```ts - * // Chain call - * await astGrep({ - * id: "unique-id", - * rule: { - * pattern: { - * context: "import React from 'react'", - * strictness: "relaxed", - * }, - * }, - * fix: "import * as React from 'react'", - * }) - * .astGrep({ - * id: "another-unique-id", - * rule: { - * pattern: { - * context: "import { useState } from 'react'", - * strictness: "relaxed", - * }, - * }, - * fix: "import { useRef } from 'react'", - * }) - * ``` - */ -export function astGrepLogic(apiQuery: AstGrepAPI): ReturnTypeAPI; - -/** - * @description Search for a pattern in the file using [ast-grep](https://ast-grep.github.io/). There are 2 ways to use this function: controlled and uncontrolled. If you will provide `id` in the `query` object - it will be passed to ast-grep CLI (`uncontrolled` mode). In all other cases `controlled` mode will be used with Napi (Node.js bindings to Rust). - * @param query It could be a string, string literal, [NapiConfig object](https://ast-grep.github.io/reference/api.html#napiconfig) - * @param callback Function which will be called for each found node wich accepts one argument - object with helpers, which could be used to manipulate the found nodes. Callback will have all the helpers that `astGrep` returns, like `map`, `replace` etc... - * @example - * ```ts - * // Use callback - * await astGrep("console.log($$$ARGS)", async ({ map, replace }) => { - * console.log(`Found code occurencies: ${(await map(({ getNode }) => getNode().text())).join(", ")}`); - * await replace("console.error($$$ARGS)"); - * }) - * ``` - * @see {@link map} - * @see {@link filter} - * @see {@link exists} - * @see {@link replace} - * @see {@link ai} - */ -export function astGrepLogic( - query: string | readonly string[] | NapiConfig, - callback: (helpers: AstGrepHelpers) => Promise | void, -): ReturnType; -export function astGrepLogic< - Q extends string | readonly string[] | NapiConfig | AstGrepAPI, - H = Q extends AstGrepAPI ? AstGrepAPIHelpers : AstGrepHelpers, ->( - query: Q, - callback?: (helpers: AstGrepHelpers) => Promise | void, - // @ts-ignore -): Promise & H { - return new FunctionExecutor("astGrep") - .arguments(() => { - let grep: string | NapiConfig | AstGrepAPI = query as string; - if (typeof query === "object") { - grep = Array.isArray(query) - ? query.join("") - : (query as NapiConfig | AstGrepAPI); - } - return { grep, callback }; - }) - .helpers((self) => { - const { grep } = self.getArguments(); - if (typeof grep === "object" && "id" in grep) { - return astGrepAPIHelpers; - } - - return astGrepHelpers; - }) - .return((self) => self.wrappedHelpers()) - .executor(async (next, self) => { - const fileContext = getFileContext(); - const { grep, callback } = self.getArguments(); - let napiConfig: NapiConfig | AstGrepAPI; - if (typeof grep === "string") { - try { - napiConfig = YAML.parse(grep); - } catch (e) { - napiConfig = { - rule: { - pattern: { - context: grep, - strictness: "relaxed", - }, - }, - }; - } - } else { - napiConfig = grep; - } - - if (typeof grep === "object" && "id" in grep) { - await runExternalAstGrepRule( - napiConfig as AstGrepAPI, - fileContext.file, - ); - } else { - if (!fileContext.extension) { - return; - } - const lang = fileExtensionToLang[fileContext.extension]; - if (!lang) { - console.warn( - `${clc.yellow("WARN")} Unsupported file extension: ${fileContext.extension}`, - ); - return; - } - const nodes = parse(lang, await fileContext.contents()) - .root() - .findAll(napiConfig as NapiConfig) - .reverse(); - const astContext = { query: grep } as AstGrepNodeContext; - - for (const node of nodes) { - if (next) { - astContext.node = node; - await astGrepNodeContext.run(astContext, async () => { - await callback?.(astGrepHelpers); - return await next(); - }); - } - } - - await fileContext.save(); - } - }) - .run() as any; -} - -export const astGrep = fnWrapper("astGrep", astGrepLogic); - -export type ReturnType = PLazy & AstGrepHelpers; -export type ReturnTypeAPI = PLazy & AstGrepAPIHelpers; - -const astGrepHelpers = { - replace, - map, - ai, - filter, - exists, -}; - -const astGrepAPIHelpers = { - astGrep, -}; diff --git a/tooling/src/astGrep/exists.ts b/tooling/src/astGrep/exists.ts deleted file mode 100644 index e9d627c6..00000000 --- a/tooling/src/astGrep/exists.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; - -/** - * @description Returns true if astGrep found at least one node that matches the given query. - * @example - * ```ts - * // Check if there is at least one console.log in the code - * const areConsoleLogExist = await astGrep`console.log($$$A)` - * .exists() - * ``` - */ -export function existsLogic(): Promise { - let result = false; - return new FunctionExecutor("exists") - .executor(async (next, self) => { - result = true; - await next?.(); - }) - .return(() => result) - .run(); -} - -export const exists = fnWrapper("exists", existsLogic); diff --git a/tooling/src/astGrep/filter.ts b/tooling/src/astGrep/filter.ts deleted file mode 100644 index 9fe7831d..00000000 --- a/tooling/src/astGrep/filter.ts +++ /dev/null @@ -1,58 +0,0 @@ -import type { PLazy } from "../PLazy.js"; -import { ai } from "../ai/ai.js"; -import { getAstGrepNodeContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { exists } from "./exists.js"; -import { map } from "./map.js"; -import { replace } from "./replace.js"; - -const callbackHelpers = { - getNode: () => getAstGrepNodeContext().node, - getMatch: (m: string) => getAstGrepNodeContext().node.getMatch(m), - getMultipleMatches: (m: string) => - getAstGrepNodeContext().node.getMultipleMatches(m), -}; - -export type CallbackHelpers = typeof callbackHelpers; - -export type FilterReturn = PLazy & Helpers; - -/** - * @description Filter the nodes found with astGrep using callback function. If function returns true - node will be included in the result, otherwise - excluded. - * @param callback - Callback function that will be executed for each node found with astGrep. If function returns true - node will be included in the result, otherwise - excluded. - * @example - * ```ts - * // Replace all console.log calls with "2" where the first argument is "1" - * await astGrep`console.log($A)` - * .filter(({ getMatch }) => getMatch("A") === "1") - * .replace`console.log(2)` - * ``` - * @see {@link map} - * @see {@link replace} - * @see {@link filter} - * @see {@link exists} - * @see {@link ai} - */ -export function filterLogic( - callback: (helpers: CallbackHelpers) => Promise | boolean, -): FilterReturn { - return new FunctionExecutor("replace") - .arguments(() => { - return { callback }; - }) - .helpers(() => helpers) - .return((self) => self.wrappedHelpers()) - .executor(async (next, self) => { - const { callback } = self.getArguments(); - if (await callback(self.wrapHelpers(callbackHelpers))) { - await next(); - } - }) - .run(); -} - -export const filter = fnWrapper("filter", filterLogic); - -const helpers = { map, filter, replace, ai, exists }; - -type Helpers = typeof helpers; diff --git a/tooling/src/astGrep/getImports.ts b/tooling/src/astGrep/getImports.ts deleted file mode 100644 index a0676faa..00000000 --- a/tooling/src/astGrep/getImports.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { astGrep } from "./astGrep.js"; - -/** - * Same as astGrep, but searches with single and double quotes - * @deprecated - * @example - * ```ts - * await getImports("import React from 'react'"); - * // is equal to - * await astGrep("import React from 'react'"); - * // and - * await astGrep('import React from "react"'); - * ``` - */ -export function getImports(source: string) { - return astGrep({ - rule: { - any: [ - { pattern: source.replace(/"/g, "'") }, - { pattern: source.replace(/'/g, '"') }, - ], - }, - }); -} diff --git a/tooling/src/astGrep/map.ts b/tooling/src/astGrep/map.ts deleted file mode 100644 index bcab8d5e..00000000 --- a/tooling/src/astGrep/map.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { getAstGrepNodeContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; - -/** - * @description Map each found with astGrep node and return resulting array. Could be used to retrieve some information from code. - * @param callback - Callback function that will be called for each found node. - * @example - * ```ts - * // Retrieve first argument for every console.log expression - * await astGrep`console.log($A)` - * .map(({ getMatch }) => getMatch('A')) - * ``` - */ -export function mapLogic< - CALLBACK extends ( - helpers: Helpers, - ) => ReturnType | Promise>, - RETURN extends ReturnType, ->(callback: CALLBACK): Promise { - const response = [] as RETURN[]; - return new FunctionExecutor("map") - .helpers(helpers) - .arguments(() => ({ callback })) - .executor(async (next, self) => { - const { callback } = self.getArguments(); - const result = await callback(helpers); - response.push(result as RETURN); - await next?.(); - }) - .return(() => response) - .run(); -} - -export const map = fnWrapper("map", mapLogic); - -const helpers = { - getNode: () => getAstGrepNodeContext().node, - getMatch: (m: string) => getAstGrepNodeContext().node.getMatch(m), - getMultipleMatches: (m: string) => - getAstGrepNodeContext().node.getMultipleMatches(m), -}; - -export type Helpers = typeof helpers; diff --git a/tooling/src/astGrep/replace.ts b/tooling/src/astGrep/replace.ts deleted file mode 100644 index ee0e813a..00000000 --- a/tooling/src/astGrep/replace.ts +++ /dev/null @@ -1,119 +0,0 @@ -import type { PLazy } from "../PLazy.js"; -import { getAstGrepNodeContext, getFileContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { map } from "./map.js"; - -const callbackHelpers = { - getNode: () => getAstGrepNodeContext().node, - getMatch: (m: string) => getAstGrepNodeContext().node.getMatch(m), - getMultipleMatches: (m: string) => - getAstGrepNodeContext().node.getMultipleMatches(m), -}; - -export type CallbackHelpers = typeof callbackHelpers; - -export type ReplaceReturn = PLazy & Helpers; - -/** - * @description Replace every found with astGrep node with the replacement string (or template literal). String can contain single match or multiple matches. - * @param replacement The replacement string or template literal - * @example - * ```ts - * // Replace every console.log with remove message - * await astGrep`console.log($$$A)` - * .replace('∕* removed console.log *∕') - * ``` - * @example - * ```ts - * // Replace every console.log with console.error - * await astGrep`console.log($$$A)` - * .replace`console.error($$$A)` - * ``` - */ -export function replaceLogic( - rawReplacement: string | Readonly, -): ReplaceReturn; - -/** - * @description Replace every found with astGrep node with the replacement string (or template literal) using callback. - * @param callback The callback function that returns the replacement string or template literal. First argument is the helpers object, which has getNode, getMatch and getMultipleMatches functions. - * @example - * ```ts - * // Replace every console.log with remove message - * await astGrep`console.log($$$A)` - * .replace(({ getMultipleMatches }) => - * `console.error(${getMultipleMatches('A').join(', ')}`) - * ``` - */ -export function replaceLogic( - callback: ( - helpers: CallbackHelpers, - ) => Promise | string | undefined, -): ReplaceReturn; -export function replaceLogic( - replacementOrCallback: - | string - | Readonly - | (( - helpers: CallbackHelpers, - ) => Promise | string | undefined), -): PLazy & Helpers { - return new FunctionExecutor("replace") - .arguments(() => { - let replacement: string | undefined; - if (typeof replacementOrCallback === "string") { - replacement = replacementOrCallback; - } else if (Array.isArray(replacementOrCallback)) { - replacement = replacementOrCallback.join(""); - } - - const callback = - typeof replacementOrCallback === "function" - ? replacementOrCallback - : undefined; - - return { replacement, callback }; - }) - .helpers(() => helpers) - .return((self) => self.wrappedHelpers()) - .executor(async (_next, self) => { - const fileContext = getFileContext(); - const { node } = getAstGrepNodeContext(); - let { callback, replacement } = self.getArguments(); - if (callback) { - replacement = await callback(self.wrapHelpers(callbackHelpers)); - } - - if (replacement) { - const text = replacement.replace( - /(\$\$)?\$([A-Z]+)/gm, - // @ts-ignore - (match, isMultiMatch, varName) => { - if (isMultiMatch) { - return node - ?.getMultipleMatches(varName) - .map((n) => n.text()) - .join(" "); - } - - return node.getMatch(varName)?.text() || ""; - }, - ); - - const range = node.range(); - - await fileContext.update({ - start: range.start.index, - end: range.end.index, - replacement: text, - }); - } - }) - .run(); -} - -export const replace = fnWrapper("replace", replaceLogic); - -const helpers = { map }; - -export type Helpers = typeof helpers; diff --git a/tooling/src/authService.ts b/tooling/src/authService.ts deleted file mode 100644 index 9c8cc266..00000000 --- a/tooling/src/authService.ts +++ /dev/null @@ -1,14 +0,0 @@ -let authService: AuthServiceInterface | undefined; - -export interface AuthServiceInterface { - getGithubAPIKey(): Promise; - ensureGithubScopes(scopes?: string[]): Promise; -} - -export function setAuthService(service: AuthServiceInterface) { - authService = service; -} - -export function getAuthService(): AuthServiceInterface | undefined { - return authService; -} diff --git a/tooling/src/codemod.ts b/tooling/src/codemod.ts deleted file mode 100644 index d1e4cf9c..00000000 --- a/tooling/src/codemod.ts +++ /dev/null @@ -1,79 +0,0 @@ -import type { PLazy } from "./PLazy.js"; -import { getCwdContext } from "./contexts.js"; -import { FunctionExecutor, fnWrapper } from "./engineHelpers.js"; -import { exec } from "./exec.js"; -import { clc } from "./helpers.js"; -import { spawn } from "./spawn.js"; - -export type CodemodReturn = PLazy & CodemodHelpers; - -/** - * Run a codemod in current working directory - * @param name The name of the codemod (check for available codemods at https://codemod.com/registry) - * @param args Arguments to pass to the codemod, e.g. `{ dry: true }`, where `dry` is a flag that the codemod accepts - * - * @example - * ```ts - * // Simple run - * await codemod("valibot/upgrade-v0.31"); - * ``` - * - * @example - * ```ts - * // Run with arguments - * await codemod("valibot/upgrade-v0.31", { dry: true }); - * ``` - * - * @example - * ```ts - * // Chaining codemods - * await codemod("valibot/upgrade-v0.31") - * .codemod("valibot/upgrade-v0.32") - * .codemod("valibot/upgrade-v0.33"); - * ``` - */ -export function codemodLogic( - name: string, - args?: Record< - string, - string | number | boolean | (string | number | boolean)[] - >, -): CodemodReturn { - return new FunctionExecutor("codemod") - .arguments(() => ({ - name, - args, - })) - .helpers(codemodHelpers) - .executor(async (next, self) => { - const { cwd } = getCwdContext(); - const args = Object.entries(self.getArguments().args ?? {}).reduce( - (acc, [key, value]) => { - if (Array.isArray(value)) { - value.forEach((v) => acc.push(`--${key}=${v}`)); - } else { - acc.push(`--${key}=${value}`); - } - return acc; - }, - ["--no-interactive"] as string[], - ); - console.log( - `${clc.blueBright(`codemod ${name} ${args.join(" ")}`)} ${cwd}`, - ); - await spawn("npx", ["codemod@latest", name, ...args], { - cwd, - doNotThrowError: true, - printOutput: true, - }); - await next?.(); - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const codemod = fnWrapper("codemod", codemodLogic); - -const codemodHelpers = { codemod, exec }; - -type CodemodHelpers = typeof codemodHelpers; diff --git a/tooling/src/contexts.ts b/tooling/src/contexts.ts deleted file mode 100644 index af7f21be..00000000 --- a/tooling/src/contexts.ts +++ /dev/null @@ -1,135 +0,0 @@ -import { AsyncLocalStorage } from "node:async_hooks"; -import type { NapiConfig, SgNode } from "@ast-grep/napi"; - -import { invariant } from "ts-invariant"; -import type { FileContext } from "./contexts/FileContext.js"; -import { GitContext } from "./contexts/GitContext.js"; -import { noContextFn } from "./helpers.js"; - -const registeredContexts = new Map>(); - -export const registerContext = (name: string, ctx: AsyncLocalStorage) => { - registeredContexts.set(name, ctx); - return ctx; -}; - -export type AstGrepNodeContext = { - query: string | NapiConfig; - node: SgNode; -}; - -export const parentContextLegacy = new AsyncLocalStorage< - (...args: any[]) => any ->(); - -export const getParentContext = () => { - const fn = parentContextLegacy.getStore(); - - return fn ?? noContextFn; -}; - -export const gitContext = registerContext( - "git", - new AsyncLocalStorage(), -); -export const astGrepNodeContext = registerContext( - "astGrepNodeContext", - new AsyncLocalStorage(), -); -export const describeContext = registerContext( - "describeContext", - new AsyncLocalStorage<{ name: string }>(), -); -export const migrateContext = registerContext( - "migrateContext", - new AsyncLocalStorage<{ name: string }>(), -); -export const cwdContext = registerContext( - "cwdContext", - new AsyncLocalStorage<{ - cwd: string; - }>(), -); -export const parentCwdContext = registerContext( - "parentCwdContext", - new AsyncLocalStorage<{ - cwd: string; - }>(), -); -export const fileContext = registerContext( - "fileContext", - new AsyncLocalStorage(), -); -export const repositoryContext = registerContext( - "repositoryContext", - new AsyncLocalStorage<{ - repository: string; - branch: string; - forkedFrom?: string; - }>(), -); -export const repositoriesContext = registerContext( - "repositoriesContext", - new AsyncLocalStorage<{ - repositories: string[]; - }>(), -); - -export const getContextsSnapshot = () => { - return [...registeredContexts.entries()] - .map(([name, ctx]) => [name, ctx.getStore()]) - .filter(([, store]) => typeof store !== "undefined"); -}; - -export const getAstGrepNodeContext = () => { - const ctx = astGrepNodeContext.getStore(); - invariant(ctx, "No ast-grep node context found"); - return ctx; -}; - -export const getCwdContext = () => { - const cwd = cwdContext.getStore(); - - return cwd ?? { cwd: process.cwd() }; -}; - -export const getParentCwdContext = () => { - const cwd = parentCwdContext.getStore(); - - return cwd ?? { cwd: process.cwd() }; -}; - -export const getFileContext = () => { - const file = fileContext.getStore(); - invariant(file, "No file context found"); - return file; -}; - -export const getGitContext = () => { - const git = gitContext.getStore(); - if (git) { - return git; - } - - const newGit = new GitContext({ repository: "", id: "" }); - - return newGit; -}; - -export const getRepositoryContext = () => { - const repo = repositoryContext.getStore(); - invariant(repo, "No repository context found"); - return repo; -}; - -export const getRepositoriesContext = () => { - const repo = repositoriesContext.getStore(); - invariant(repo, "No repositories context found"); - return repo; -}; - -export const getDescribeContext = () => { - const repo = describeContext.getStore(); - invariant(repo, "No describe context found"); - return repo; -}; diff --git a/tooling/src/contexts/Context.ts b/tooling/src/contexts/Context.ts deleted file mode 100644 index 52ba3b3c..00000000 --- a/tooling/src/contexts/Context.ts +++ /dev/null @@ -1,15 +0,0 @@ -export class Context> { - protected _context: T; - - constructor(data: T) { - this._context = data; - } - - set(key: keyof T, value: T[keyof T]) { - (this._context as Record)[key] = value; - } - - get(key: keyof T) { - return this._context[key]; - } -} diff --git a/tooling/src/contexts/FileContext.ts b/tooling/src/contexts/FileContext.ts deleted file mode 100644 index 1dcfdd1c..00000000 --- a/tooling/src/contexts/FileContext.ts +++ /dev/null @@ -1,102 +0,0 @@ -import * as fs from "node:fs/promises"; -import { formatText } from "@codemod-com/utilities"; -import { convertChangesToDMP, diffLines } from "diff"; -import MagicString from "magic-string"; -import { clc } from "../helpers.js"; -import { Context } from "./Context.js"; - -const formatByDefault = process.argv.includes("--format"); - -export type FileContextData = { file: string }; - -export class FileContext extends Context { - private _contents: string | undefined = undefined; - private _magicString: MagicString | undefined = undefined; - private _contentsChanged = false; - private _oldContents: string | undefined = undefined; - public importsUpdates: { type: "add" | "remove"; import: string }[] = []; - - get file() { - return this.get("file"); - } - - async contents() { - if (typeof this._contents === "undefined") { - this._contents = await fs.readFile(this.file, { encoding: "utf-8" }); - this._oldContents = this._contents; - } - if (typeof this._magicString !== "undefined") { - return this._magicString.toString(); - } - return this._contents; - } - - setContents(contents: string) { - this._contents = contents; - this._magicString = undefined; - this._contentsChanged = true; - } - - async magicString() { - if (typeof this._magicString === "undefined") { - this._magicString = new MagicString(await this.contents()); - } - return this._magicString; - } - - async update({ - start, - end, - replacement, - }: { - start: number; - end: number; - replacement: string; - }) { - const magicString = await this.magicString(); - magicString.update(start, end, replacement); - } - - async save({ format }: { format?: boolean } = {}) { - let contents: string | undefined; - if (this._magicString?.hasChanged()) { - contents = this._magicString.toString(); - } else if (this._contentsChanged) { - contents = this._contents; - } - if (typeof contents === "string") { - const oldContents = this._oldContents; - const newContents = format - ? await formatText(this.file, contents) - : contents; - await fs.writeFile(this.file, newContents); - this._oldContents = undefined; - this._contents = undefined; - this._magicString = undefined; - this._contentsChanged = false; - console.error(`${clc.blueBright("FILE")} ${this.file}`); - // @TODO improve diffs - const changes = convertChangesToDMP( - diffLines(oldContents ?? newContents, newContents), - ); - for (const [type, code] of changes) { - switch (type) { - // case 0: - // process.stdout.write(code); - // break; - case -1: - process.stdout.write(clc.red(code)); - break; - case 1: - process.stdout.write(clc.green(code)); - break; - } - } - process.stdout.write("\n"); - } - } - - get extension() { - return this.file.split(".").pop(); - } -} diff --git a/tooling/src/contexts/GitContext.ts b/tooling/src/contexts/GitContext.ts deleted file mode 100644 index 9e6ca095..00000000 --- a/tooling/src/contexts/GitContext.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { simpleGit } from "simple-git"; -import { getCwdContext } from "../contexts.js"; -import { Context } from "./Context.js"; - -export type GitContextData = { repository: string; id: string }; - -export class GitContext extends Context { - get simpleGit() { - return simpleGit(getCwdContext().cwd); - } - - async checkout({ branch, force }: { branch: string; force?: boolean }) { - try { - await this.simpleGit.checkout(branch); - } catch (e) { - if (force) { - await this.simpleGit.checkout(["-b", branch]); - } else { - throw e; - } - } - } -} diff --git a/tooling/src/engineHelpers.ts b/tooling/src/engineHelpers.ts deleted file mode 100644 index f08bf1bf..00000000 --- a/tooling/src/engineHelpers.ts +++ /dev/null @@ -1,254 +0,0 @@ -import { AsyncLocalStorage } from "node:async_hooks"; -import { createHash } from "node:crypto"; -import { mapValues, memoize } from "lodash-es"; -import { PLazy } from "./PLazy.js"; -import { noContextFn } from "./helpers.js"; - -function getHash(data: any) { - const h = createHash("sha1"); - h.update(JSON.stringify(data)); - return h.digest("hex"); -} - -class NodeContext { - public name: string; - public hash: string; - public arguments: any[]; - public children: NodeContext[]; - constructor(name: string, fn: string, args: any[]) { - this.name = name; - this.arguments = args.map((arg) => String(arg)); - this.hash = getHash({ name, fn: fn.toString(), args }); - this.children = []; - } -} - -const selfContext = new AsyncLocalStorage(); - -const parentContext = new AsyncLocalStorage(); - -export const wrapContext = new AsyncLocalStorage<(...args: any[]) => any>(); - -const tree: { children: NodeContext[] } = { - children: [], -}; - -export const getTree = () => tree; - -export function fnWrapper any>( - name: string, - fn: T, -): T { - return ((...args: any[]) => { - const parent = parentContext.getStore(); - const self = new NodeContext(name, fn.toString(), args); - if (parent) { - parent.children.push(self); - } else { - tree.children.push(self); - } - return selfContext.run(self, fn, ...args); - }) as any; -} - -export class FunctionExecutor< - I extends ((...args: any[]) => any) | undefined = undefined, // init - H extends - | Record - | ((self: FunctionExecutor) => Record) - | undefined = undefined, // helpers - R extends ((...args: any[]) => Promise | any) | undefined = undefined, // return - W extends boolean = true, // return wrapped helpers like PLazy & H or not - E extends ((...args: any[]) => Promise | any) | undefined = undefined, // executor - C extends ((...args: any[]) => Promise | any) | undefined = undefined, // callback - A extends - | ((self: { - getChildArg: (name: string) => T | undefined; - }) => Promise | any) - | undefined = undefined, // arguments parser -> { - // @ts-ignore - private _init?: I; - private _helpers?: H; - private _return?: R; - private _context: NodeContext; - private _copyHelpersToPromise: W = true as W; - private _executor?: E; - private _parentWrapper: (...args: any[]) => any; - private _callback?: C; - private _arguments?: A; - private _done: any; - private parentArgs: any[] = []; - private childArgs: any[] = []; - private initiated = false; - - constructor(public name: string) { - this._context = selfContext.getStore() as NodeContext; - this._parentWrapper = wrapContext.getStore() ?? noContextFn; - } - - public setParentArgs(...args: any[]) { - this.parentArgs = args; - return this; - } - - public getChildArgs() { - return this.childArgs; - } - - public getChildArg(name: string) { - return this.childArgs.find((args) => typeof args[name] !== "undefined")?.[ - name - ]; - } - - doNotCopyHelpersToPromise(): FunctionExecutor { - this._copyHelpersToPromise = false as W; - return this as any; - } - - init any>( - init: (self: FunctionExecutor) => Promise | void, - ): FunctionExecutor { - if (init) { - this._init = memoize(init) as any; - } - return this as any; - } - - done(cb: any) { - this._done = cb; - return this; - } - - arguments< - AE extends (self: { - getChildArg: (name: string) => T | undefined; - }) => Promise | any, - >(args: AE): FunctionExecutor { - this._arguments = args as any; - return this as any; - } - - getArguments(): A extends (self: { - getChildArg: (name: string) => T | undefined; - }) => any | Promise - ? Awaited> - : undefined { - return this._arguments?.(this); - } - - helpers>( - helpers: HE | ((self: FunctionExecutor) => HE), - ): FunctionExecutor { - this._helpers = helpers as any; - return this as any; - } - - callback< - CE extends ( - self: FunctionExecutor, - ) => Promise | any, - >(callback: CE): FunctionExecutor { - this._callback = callback as any; - return this as any; - } - - wrappedHelpers(): H extends (...args: any[]) => any ? ReturnType : H { - return mapValues( - // @ts-ignore - typeof this._helpers === "function" ? this._helpers(this) : this._helpers, - (fn: any) => - (...args: any[]) => - // @ts-ignore - parentContext.run(this._context, () => - wrapContext.run(this.context(), () => fn(...args)), - ), - ) as any; - } - - wrapHelpers
>(helpers: HR): HR { - return mapValues( - // @ts-ignore - helpers, - (fn: any) => - (...args: any[]) => - // @ts-ignore - parentContext.run(this._context, () => - wrapContext.run(this.context(), () => fn(...args)), - ), - ) as any; - } - - context() { - return (cb?: any, ...childArgs: any[]) => { - this.childArgs = childArgs; - return this._parentWrapper( - () => { - return (this._executor ?? noContextFn)(async () => { - if (this._init && !this.initiated) { - this.initiated = true; - await this._init(this); - } - if (this._callback) { - await parentContext.run(this._context, this._callback, this); - } - return cb?.(); - }, this); - }, - ...this.parentArgs, - ); - }; - } - - return< - RE extends ( - self: FunctionExecutor, - ) => Promise | any, - >(_return: RE): FunctionExecutor { - this._return = _return as any; - return this as any; - } - - executor< - EE extends ( - next: (...args: any[]) => Promise | void, - self: FunctionExecutor, - ) => Promise | any, - >(executor: EE): FunctionExecutor { - this._executor = executor as any; - return this as any; - } - - run(): R extends (...args: any[]) => Promise | any - ? W extends true - ? PLazy>> & Awaited> - : PLazy>> - : void { - const promise = new PLazy((resolve, reject) => { - (async () => { - let res: any; - let isCalled = false; - await this.context()(async () => { - res = await this._return?.(this); - isCalled = true; - }); - if (!isCalled) { - res = await this._return?.(this); - } - return res; - })() - .then(resolve) - .catch(reject); - }) as any; - - if (this._copyHelpersToPromise) { - const wrappedHelpers = this.wrappedHelpers(); - for (const key in wrappedHelpers) { - promise[key] = wrappedHelpers[key]; - } - } - - return promise; - } -} diff --git a/tooling/src/exec.ts b/tooling/src/exec.ts deleted file mode 100644 index 9e0f2737..00000000 --- a/tooling/src/exec.ts +++ /dev/null @@ -1,63 +0,0 @@ -import type { PLazy } from "./PLazy.js"; -import { codemod } from "./codemod.js"; -import { getCwdContext } from "./contexts.js"; -import { FunctionExecutor, fnWrapper } from "./engineHelpers.js"; -import { clc } from "./helpers.js"; -import { spawn } from "./spawn.js"; - -/** - * Run a command in current working directory - * @param command The command to run - * @param args Arguments to pass to the command - * - * @example - * Simple run - * ```ts - * await exec("ls"); - * ``` - * - * @example - * Run with arguments - * ```ts - * await exec("ls", ["-al"]); - * ``` - * - * @example - * Chaining commands - * ```ts - * await exec("ls") - * .exec("pwd") - * .exec("ls", ["-al"]); - * ``` - */ -export function execLogic( - command: string, - args?: string[], -): PLazy & ExecHelpers { - return new FunctionExecutor("exec") - .arguments(() => ({ - command, - args, - })) - .helpers(execHelpers) - .executor(async (next, self) => { - const { cwd } = getCwdContext(); - const { command, args } = self.getArguments(); - console.log( - `${clc.blueBright(`${command} ${args?.join(" ") ?? ""}`)} ${cwd}`, - ); - await spawn(command, args ?? [], { - cwd, - doNotThrowError: true, - }); - await next?.(); - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const exec = fnWrapper("exec", execLogic); - -const execHelpers = { exec, codemod }; - -type ExecHelpers = typeof execHelpers; diff --git a/tooling/src/files.ts b/tooling/src/files.ts deleted file mode 100644 index 3135ae9f..00000000 --- a/tooling/src/files.ts +++ /dev/null @@ -1,114 +0,0 @@ -import * as path from "node:path"; -import * as glob from "glob"; -import type { PLazy } from "./PLazy.js"; -import { astGrep } from "./astGrep/astGrep.js"; -import { fileContext, getCwdContext } from "./contexts.js"; -import { FileContext } from "./contexts/FileContext.js"; -import { FunctionExecutor, fnWrapper } from "./engineHelpers.js"; -import { move } from "./fs/move.js"; -import { parseMultistring } from "./helpers.js"; -import { jsFam } from "./jsFam.js"; -import { json } from "./json/json.js"; -import { yaml } from "./yaml/yaml.js"; - -export type FilesReturn = PLazy & Helpers; - -/** - * @description Will find all the files in current working directory. If following function will be called to get specific context, for example `files().jsFam()` - it will search for any js/ts file, basically it will change behaviour of files function. - * @example - * ```ts - * // will search for all the files within current working directory with **∕* pattern - * await files().astGrep`import React from 'react'` - * ``` - * @see {@link jsFam} - * @see {@link astGrep} - * @see {@link json} - * @see {@link yaml} - * @see {@link move} - * @example - * ```ts - * // will search for all the js/ts files within current working directory using **∕*.{js,ts,jsx,tsx,cjs,mjs} pattern - * await files().jsFam().astGrep`import React from 'react'` - * ``` - */ -export function filesLogic(): FilesReturn; -/** - * @description Filter file by glob pattern - * @param globs string or array of globs to search for a files, could be comma/space separated string - * @example - * ```ts - * await jsFiles('src/app.ts,src/**∕*.tsx').astGrep`import React from 'react'`; - * ``` - * @see {@link jsFam} - * @see {@link astGrep} - * @see {@link json} - * @see {@link yaml} - * @see {@link move} - */ -export function filesLogic(globs: string | readonly string[]): FilesReturn; -export function filesLogic( - globs: string | readonly string[], - callback: (helpers: Helpers) => void | Promise, -): FilesReturn; -export function filesLogic( - callback: (helpers: Helpers) => void | Promise, -): FilesReturn; -export function filesLogic( - rawGlobs?: - | string - | readonly string[] - | ((helpers: Helpers) => void | Promise), - maybeCallback?: (helpers: Helpers) => void | Promise, -): FilesReturn { - return new FunctionExecutor("files") - .arguments((self) => { - const defaultGlob = self.getChildArg("defaultGlob") ?? "**/*.*"; - const globs = parseMultistring( - !rawGlobs || typeof rawGlobs === "function" ? defaultGlob : rawGlobs, - /[\n; ]/, - ); - - const callback = - typeof rawGlobs === "function" ? rawGlobs : maybeCallback; - return { globs, callback }; - }) - .helpers(helpers) - .executor(async (next, self) => { - const { globs, callback } = self.getArguments(); - const { cwd } = getCwdContext(); - const absolutePaths = globs.filter((g) => path.isAbsolute(g)); - const relativePaths = globs.filter((g) => !path.isAbsolute(g)); - const files = [ - ...( - await glob.glob(relativePaths, { - cwd, - nodir: true, - ignore: [ - "**/node_modules/**", - "**/.git/**", - "**/dist/**", - "**/build/**", - ], - }) - ).map((f) => path.join(cwd, f)), - ...absolutePaths, - ]; - - for (const file of files) { - await fileContext.run(new FileContext({ file }), async () => { - if (callback) { - await callback(helpers); - } - - await next(); - }); - } - }) - .run() as any; -} - -export const files = fnWrapper("files", filesLogic); - -const helpers = { jsFam, move, astGrep, yaml, json }; - -type Helpers = typeof helpers; diff --git a/tooling/src/fs.ts b/tooling/src/fs.ts deleted file mode 100644 index 8bbe934d..00000000 --- a/tooling/src/fs.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ -import * as fs from "node:fs/promises"; -import * as os from "node:os"; -import * as path from "node:path"; -import slugify from "@sindresorhus/slugify"; -import filenamify from "filenamify"; -import * as glob from "glob"; -import { fileContext, getCwdContext } from "./contexts.js"; -import { FileContext } from "./contexts/FileContext.js"; - -const DIRECTORY = "cm"; - -export const getTmpDir = (...rawParts: string[]) => { - const parts = rawParts.map((part) => { - const slug = slugify(part); - return filenamify(slug); - }); - const dirpath = path.join(os.tmpdir(), DIRECTORY, ...parts); - - return dirpath; -}; - -export const rm = async (dir: string) => { - await fs.rm(dir, { - recursive: true, - force: true, - retryDelay: 1000, - maxRetries: 5, - }); -}; - -export const files = async ( - pattern: string | string[], - cb: () => Promise, -) => { - const { cwd } = getCwdContext(); - const files = await glob.glob(pattern, { cwd, nodir: true }); - for (const file of files) { - await fileContext.run(new FileContext({ file: path.join(cwd, file) }), cb); - } -}; - -export const jsonFiles = async ( - pattern: string | string[], - cb: (args: { - update: (updater: T | ((input: T) => T | Promise)) => Promise; - }) => Promise, -) => { - const { cwd } = getCwdContext(); - const files = await glob.glob(pattern, { cwd, nodir: true }); - await cb({ - update: async (updater: T | ((input: T) => T | Promise)) => { - for (const file of files) { - const filepath = path.join(cwd, file); - if (typeof updater === "function") { - const contents = JSON.parse(await fs.readFile(filepath, "utf-8")); - // @ts-ignore - const updatedContents = (await updater(contents)) as T; - await fs.writeFile( - filepath, - JSON.stringify(updatedContents, null, 2), - ); - } else { - await fs.writeFile(filepath, JSON.stringify(updater, null, 2)); - } - } - }, - }); -}; - -export const isDirectory = async (dir: string) => { - try { - const stats = await fs.stat(dir); - await fs.access( - dir, - fs.constants.R_OK | fs.constants.W_OK | fs.constants.X_OK, - ); - return stats.isDirectory(); - } catch { - return false; - } -}; diff --git a/tooling/src/fs/dirs.ts b/tooling/src/fs/dirs.ts deleted file mode 100644 index 3df9a559..00000000 --- a/tooling/src/fs/dirs.ts +++ /dev/null @@ -1,118 +0,0 @@ -import * as fs from "node:fs/promises"; -import * as path from "node:path"; -import * as glob from "glob"; -import type { PLazy } from "../PLazy.js"; -import { codemod } from "../codemod.js"; -import { cwdContext, getCwdContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { exec } from "../exec.js"; -import { files } from "../files.js"; -import { parseMultistring } from "../helpers.js"; -import { jsFiles } from "../jsFiles.js"; -import { map } from "./map.js"; -import { move } from "./move.js"; - -type DirsParams = { - dirs: string | readonly string[]; - create?: boolean; - ignore?: string | string[] | glob.IgnoreLike; -}; - -/** - * @description Run a callback for each directory matching the pattern - * @param pattern Glob pattern or array of glob patterns - * @param cb - * @example dirs`apps` - * .jsFiles`*.ts` - * .astGrep`import React from 'react'` - * .remove(); - * @example dirs('apps/*', async ({ jsFiles }) => { - * await jsFiles`*.ts` - * .astGrep`import React from 'react'` - * .remove(); - * }); - * @example dirs(async ({ jsFiles }) => { - * await jsFiles`*.ts` - * .astGrep`import React from 'react'` - * .remove(); - * }); - */ -export function dirsLogic( - pattern: string | readonly string[] | DirsParams, - callback?: (helpers: DirsHelpers) => Promise | void, -): PLazy & DirsHelpers { - return new FunctionExecutor("dirs") - .arguments(() => { - if (typeof pattern === "object" && !Array.isArray(pattern)) { - const { dirs, ...rest } = pattern as DirsParams; - return { - params: { - ...rest, - dirs: parseMultistring(dirs), - }, - callback, - }; - } - - const patterns = parseMultistring(pattern); - - const create = - patterns.length === 1 && !glob.hasMagic(patterns[0] as string); - - return { - params: { - create, - dirs: patterns, - }, - callback, - }; - }) - .helpers(dirsHelpers) - .executor(async (next, self) => { - const { - params: { dirs: directories, create, ignore }, - } = self.getArguments(); - const { cwd } = getCwdContext(); - const dirs = await glob.glob(directories, { cwd, ignore }); - const directoriesWalked = new Set(); - for (const dir of dirs) { - if (directoriesWalked.has(dir)) { - continue; - } - directoriesWalked.add(dir); - await cwdContext.run({ cwd: path.join(cwd, dir) }, next); - } - if (create) { - for (const directoryShouldExist of directories) { - if ( - !glob.hasMagic(directoryShouldExist) && - !directoriesWalked.has(directoryShouldExist) - ) { - directoriesWalked.add(directoryShouldExist); - console.log( - `Creating directory ${path.join(cwd, directoryShouldExist)}`, - ); - await fs.mkdir(path.join(cwd, directoryShouldExist), { - recursive: true, - }); - await cwdContext.run( - { cwd: path.join(cwd, directoryShouldExist) }, - next, - ); - } - } - } - }) - .callback(async (self) => { - const { callback } = self.getArguments(); - await callback?.(dirsHelpers); - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const dirs = fnWrapper("dirs", dirsLogic); - -const dirsHelpers = { dirs, jsFiles, codemod, exec, move, map, files }; - -type DirsHelpers = typeof dirsHelpers; diff --git a/tooling/src/fs/map.ts b/tooling/src/fs/map.ts deleted file mode 100644 index bb4a79f8..00000000 --- a/tooling/src/fs/map.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { getCwdContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; - -export function mapLogic< - CALLBACK extends (helpers: Helpers) => ReturnType, - RETURN extends ReturnType, ->(callback: CALLBACK): Promise { - const response = [] as RETURN[]; - return new FunctionExecutor("map") - .helpers(helpers) - .executor(async () => { - const result = await callback(helpers); - response.push(result as any); - }) - .return(() => response) - .run(); -} - -export const map = fnWrapper("map", mapLogic); - -const helpers = { - cwd: () => getCwdContext().cwd, -}; - -type Helpers = typeof helpers; diff --git a/tooling/src/fs/move.ts b/tooling/src/fs/move.ts deleted file mode 100644 index 634a6a08..00000000 --- a/tooling/src/fs/move.ts +++ /dev/null @@ -1,241 +0,0 @@ -import * as fs from "node:fs/promises"; -import * as path from "node:path"; -import * as pathPosix from "node:path/posix"; -import * as glob from "glob"; -import type { PLazy } from "../PLazy.js"; -import { - cwdContext, - fileContext, - getCwdContext, - getFileContext, - getParentCwdContext, -} from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { files } from "../files.js"; - -const ALL_JS_EXTENSIONS = ["js", "jsx", "ts", "tsx", "cjs", "mjs"]; - -const getPathBeforeRename = ( - newPath: string, - renames: Record, -) => { - for (const [beforeRename, afterRename] of Object.entries(renames)) { - if (newPath === afterRename) { - return beforeRename; - } - } - return undefined; -}; - -const getRenamedPath = async ( - oldPath: string, - renames: Record, -) => { - if (oldPath in renames) { - return renames[oldPath]; - } - - // Try remove query params - const queryIndex = oldPath.indexOf("?"); - if (queryIndex !== -1) { - const maybeFilePath = oldPath.slice(0, queryIndex); - if (maybeFilePath in renames) { - return `${renames[maybeFilePath]}?${oldPath.slice(queryIndex + 1)}`; - } - } - - // Try to guess imports - // If it is a JS file - for (const ext of ALL_JS_EXTENSIONS) { - const maybeFilePath = `${oldPath}.${ext}`; - if (maybeFilePath in renames) { - return pathPosix.format({ - ...pathPosix.parse(renames[maybeFilePath] as string), - base: undefined, - ext: undefined, - }); - } - } - // If it is directory - try { - if ((await fs.stat(oldPath)).isDirectory()) { - for (const ext of ALL_JS_EXTENSIONS) { - const maybeFilePath = `${pathPosix.join(oldPath, "index")}.${ext}`; - if (maybeFilePath in renames) { - return pathPosix.format({ - ...pathPosix.parse(renames[maybeFilePath] as string), - base: undefined, - ext: undefined, - name: undefined, - }); - } - } - } - } catch (e) { - // do nothing - } - - return undefined; -}; - -const renameImport = async ( - newAbsoluteSelfPath: string, - renames: Record, - importPath: string, -) => { - // Only relative, excluding package.json - if (importPath?.startsWith(".") && !importPath.endsWith("package.json")) { - const oldAbsoluteSelfPath = getPathBeforeRename( - newAbsoluteSelfPath, - renames, - ); - const oldAbsoluteImportPath = pathPosix.resolve( - pathPosix.dirname(oldAbsoluteSelfPath ?? newAbsoluteSelfPath), - importPath, - ); - const newAbsoluteImportPath = - (await getRenamedPath(oldAbsoluteImportPath, renames)) ?? - oldAbsoluteImportPath; - let relativePath = pathPosix.join( - pathPosix.relative( - pathPosix.dirname(newAbsoluteSelfPath), - pathPosix.dirname(newAbsoluteImportPath), - ), - pathPosix.basename(newAbsoluteImportPath), - ); - if (!relativePath.startsWith(".")) { - relativePath = `./${relativePath}`; - } - - let extension: string | undefined = pathPosix.extname(relativePath); - if (extension === ".ts") { - extension = ".js"; - } else if (extension === ".tsx" || extension === ".jsx") { - extension = undefined; - } - - relativePath = pathPosix.format({ - ...pathPosix.parse(relativePath), - base: undefined, - ext: extension, - }); - - if (importPath !== relativePath) { - return relativePath; - } - - return importPath; - } - return importPath; -}; - -/** - * @description Move directories or files matching the pattern - */ -export function moveLogic(target: string): PLazy & Helpers { - return new FunctionExecutor("move") - .arguments(() => ({ - target, - })) - .helpers(helpers) - .executor(async (next, self) => { - const { target } = self.getArguments(); - const { cwd } = getCwdContext(); - const file = fileContext.getStore(); - let foundFiles: string[] = []; - let isFile = false; - if (file) { - isFile = true; - foundFiles = [path.basename(file.file)]; - } else { - foundFiles = await glob.glob("**/*.*", { - cwd, - nodir: true, - ignore: [ - "**/node_modules/**", - "**/.git/**", - "**/dist/**", - "**/build/**", - ], - }); - } - const renames: Record = {}; - for (const file of foundFiles) { - const source = path.resolve(cwd, file); - const dest = path.resolve( - target, - ...(isFile ? [] : [path.basename(cwd)]), - file, - ); - console.log(`Moving ${source} to ${dest}`); - await fs.mkdir(path.dirname(dest), { recursive: true }); - await fs.rename(source, dest); - if (dest.match(/\.(ts|js|tsx|jsx|cjs|mjs)$/)) { - renames[source] = dest; - } - try { - if ( - await fs.readdir(path.dirname(source)).then((x) => x.length === 0) - ) { - await fs.rmdir(path.dirname(source)); - } - } catch (e) {} - } - try { - if (await fs.readdir(cwd).then((x) => x.length === 0)) { - await fs.rmdir(cwd); - } - } catch (e) {} - - await cwdContext.run( - getParentCwdContext(), - async () => - await files("**/*.{js,jsx,ts,tsx,cjs,mjs}").jsFam( - async ({ astGrep }) => { - const file = getFileContext().file; - await astGrep({ - rule: { - any: [ - { - kind: "string_fragment", - inside: { - kind: "string", - inside: { - any: [ - { kind: "import_statement" }, - { kind: "export_statement" }, - ], - }, - }, - }, - { - kind: "string_fragment", - inside: { - kind: "string", - inside: { - kind: "arguments", - inside: { - kind: "call_expression", - regex: "^require", - }, - }, - }, - }, - ], - }, - }).replace(async ({ getNode }) => { - return await renameImport(file, renames, getNode().text()); - }); - }, - ), - ); - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const move = fnWrapper("move", moveLogic); - -const helpers = {}; - -type Helpers = typeof helpers; diff --git a/tooling/src/git/branch.ts b/tooling/src/git/branch.ts deleted file mode 100644 index ae57cbd6..00000000 --- a/tooling/src/git/branch.ts +++ /dev/null @@ -1,127 +0,0 @@ -import { memoize } from "lodash-es"; -import type { PLazy } from "../PLazy.js"; -import { codemod } from "../codemod.js"; -import { getGitContext } from "../contexts.js"; -import type { GitContext } from "../contexts/GitContext.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { exec } from "../exec.js"; -import { files } from "../files.js"; -import { dirs } from "../fs/dirs.js"; -import { jsFiles } from "../jsFiles.js"; -import { commit } from "./commit.js"; -import { push } from "./push.js"; - -interface BranchOptions { - /** - * @description Branch name to checkout - */ - branch: string; - /** - * @description Force checkout to branch - * @default true - */ - force?: boolean; -} - -export type BranchReturn = PLazy & BranchHelpers; - -/** - * @description Creates branch for every repository - * @param newBranch Branch name to checkout, could be a string or an object with branch and force - * @example - * ```ts - * // chain call - * import { git } from '@codemod.com/workflow' - * await git.clone('git@github.com:codemod-com/codemod.git') - * .branch('new-branch') - * ``` - * @example - * ```ts - * // existing branch - * import { git } from '@codemod.com/workflow' - * await git.clone('git@github.com:codemod-com/codemod.git') - * .branch({ - * branch: 'new-branch', - * force: false - * }) - * ``` - * @see {@link jsFiles} - * @see {@link files} - * @see {@link dirs} - * @see {@link exec} - * @see {@link commit} - * @see {@link push} - * @see {@link codemod} - */ -export function branchLogic(newBranch: string | BranchOptions): BranchReturn; - -/** - * Creates branch for current repository - * @param newBranch Branch name to checkout, could be a string or an object with branch and force - * @param callback A callback would be called after the branch is created with first argument as helpers - * @example - * ```ts - * // inside callback - * import { git } from '@codemod.com/workflow' - * await git.clone('git@github.com:codemod-com/codemod.git', async ({ branch }) => { - * await branch('new-branch') - * }) - * ``` - * @see {@link jsFiles} - * @see {@link files} - * @see {@link dirs} - * @see {@link exec} - * @see {@link commit} - * @see {@link push} - * @see {@link codemod} - */ -export function branchLogic( - newBranch: string | BranchOptions, - callback: (helpers: BranchHelpers) => void | Promise, -): BranchReturn; - -export function branchLogic( - newBranch: string | BranchOptions, - callback?: (helpers: BranchHelpers) => void | Promise, -): BranchReturn { - const branchoutMemoized = memoize( - (key: string, gitContext: GitContext, branch: string, force?: boolean) => - gitContext.checkout({ branch, force }), - ); - return new FunctionExecutor("branch") - .arguments(() => { - return { - branchArg: - typeof newBranch === "string" - ? ({ branch: newBranch, force: true } as BranchOptions) - : newBranch, - callback, - }; - }) - .helpers(branchHelpers) - .executor(async (next, self) => { - const { branchArg } = self.getArguments(); - const gitContext = getGitContext(); - await branchoutMemoized( - `${gitContext.get("id")}-${branchArg.branch}-${String( - branchArg.force, - )}`, - gitContext, - branchArg.branch, - branchArg.force, - ); - await next(); - }) - .callback(async (self) => { - const { callback } = self.getArguments(); - await callback?.(branchHelpers); - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const branch = fnWrapper("branch", branchLogic); - -const branchHelpers = { jsFiles, commit, push, dirs, codemod, exec, files }; - -export type BranchHelpers = typeof branchHelpers; diff --git a/tooling/src/git/clone.ts b/tooling/src/git/clone.ts deleted file mode 100644 index 7f7d787d..00000000 --- a/tooling/src/git/clone.ts +++ /dev/null @@ -1,270 +0,0 @@ -import { memoize } from "lodash-es"; -import { getTmpDir } from "src/fs.js"; -import type { PLazy } from "../PLazy.js"; -import { codemod } from "../codemod.js"; -import { - cwdContext, - gitContext, - parentCwdContext, - repositoryContext, -} from "../contexts.js"; -import { GitContext } from "../contexts/GitContext.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { exec } from "../exec.js"; -import { files } from "../files.js"; -import { dirs } from "../fs/dirs.js"; -import { pr } from "../github/pr.js"; -import { parseMultistring } from "../helpers.js"; -import { jsFiles } from "../jsFiles.js"; -import { branch } from "./branch.js"; -import { commit } from "./commit.js"; -import { cloneRepository, syncForkRepository } from "./helpers.js"; -import { push } from "./push.js"; - -interface CloneOptions { - repository: string; - branch?: string; - shallow?: boolean; -} - -export type CloneReturn = PLazy & CloneHelpers; - -const mapCloneOptions = (options: string | CloneOptions): CloneOptions => { - if (typeof options === "string") { - return { repository: options, shallow: true }; - } - return options; -}; - -/** - * @description Clone a repository (could be used as follow up for github.fork) - * @example - * ```ts - * import { github } from '@codemod.com/workflow' - * await github.fork('git://github.com/codemod-com/codemod.git') - * .clone() - * .branch('new-branch') - * .files() - * .jsFam() - * .astGrep('console.log($$$ARGS)') - * .replace('console.error($$$ARGS)') - * ``` - * @see {@link branch} - * @see {@link commit} - * @see {@link push} - * @see {@link files} - * @see {@link jsFiles} - * @see {@link pr} - * @see {@link codemod} - * @see {@link dirs} - * @see {@link exec} - */ -export function cloneLogic(): CloneReturn; - -/** - * @description Clone a repository with a callback (could be used as follow up for github.fork) - * @param callback A callback would be called after the repositories are cloned with first argument as helpers - * @example - * ```ts - * import { github } from '@codemod.com/workflow' - * await github.fork('git://github.com/codemod-com/codemod.git') - * .clone(({ branch, commit, push, files }) => { - * await branch('new-branch') - * await files() - * .jsFam() - * .astGrep('console.log($$$ARGS)') - * .replace('console.error($$$ARGS)') - * await commit('feat: new branch') - * await push() - * }) - * ``` - * @see {@link branch} - * @see {@link commit} - * @see {@link push} - * @see {@link files} - * @see {@link jsFiles} - * @see {@link pr} - * @see {@link codemod} - * @see {@link dirs} - * @see {@link exec} - */ -export function cloneLogic( - callback: (helpers: CloneHelpers) => void | Promise, -): CloneReturn; - -/** - * @description Clone repositories - * @param repositories List of repositories to clone, could be a string, template literals can be used to pass multiple repositories, array of strings, objects with repository and branch to clone - * @example - * ```ts - * import { github } from '@codemod.com/workflow' - * await github.clone('git://github.com/codemod-com/codemod.git') - * .branch('new-branch') - * .files() - * .jsFam() - * .astGrep('console.log($$$ARGS)') - * .replace('console.error($$$ARGS)') - * ``` - * @see {@link branch} - * @see {@link commit} - * @see {@link push} - * @see {@link files} - * @see {@link jsFiles} - * @see {@link pr} - * @see {@link codemod} - * @see {@link dirs} - * @see {@link exec} - */ -export function cloneLogic( - repositories: - | (string | CloneOptions)[] - | string - | readonly string[] - | CloneOptions - | CloneOptions[], -): CloneReturn; - -/** - * @description Clone repositories with a callback - * @param repositories List of repositories to clone, could be a string, template literals can be used to pass multiple repositories, array of strings, objects with repository and branch to clone - * @param callback A callback would be called after the repositories are cloned with first argument as helpers - * @example - * ```ts - * import { github } from '@codemod.com/workflow' - * await github.clone('git://github.com/codemod-com/codemod.git', ({ branch, commit, push, files }) => { - * await branch('new-branch') - * await files() - * .jsFam() - * .astGrep('console.log($$$ARGS)') - * .replace('console.error($$$ARGS)') - * await commit('feat: new branch') - * await push() - * }) - * ``` - * @see {@link branch} - * @see {@link commit} - * @see {@link push} - * @see {@link files} - * @see {@link jsFiles} - * @see {@link pr} - * @see {@link codemod} - * @see {@link dirs} - * @see {@link exec} - */ -export function cloneLogic( - repositories: - | (string | CloneOptions)[] - | string - | readonly string[] - | CloneOptions - | CloneOptions[], - callback: (helpers: CloneHelpers) => void | Promise, -): CloneReturn; - -export function cloneLogic( - rawRepositories?: - | (string | CloneOptions)[] - | string - | readonly string[] - | CloneOptions - | CloneOptions[] - | ((helpers: CloneHelpers) => void | Promise), - callback?: (helpers: CloneHelpers) => void | Promise, -): CloneReturn { - const memoizedCloneRepo = memoize(cloneRepository); - const memoizedSyncForkedRepo = memoize(syncForkRepository); - return new FunctionExecutor("clone") - .arguments(() => { - let repositories: CloneOptions[] = []; - let resultCallback = callback; - - if ( - typeof rawRepositories === "string" || - (Array.isArray(rawRepositories) && - rawRepositories.every((repo) => typeof repo === "string")) - ) { - repositories = parseMultistring( - rawRepositories as string | readonly string[], - ).map(mapCloneOptions); - } else if (Array.isArray(rawRepositories)) { - repositories = rawRepositories.map(mapCloneOptions); - } else if (typeof rawRepositories === "function") { - repositories = []; - resultCallback = rawRepositories; - } else if (rawRepositories) { - repositories = [ - mapCloneOptions(rawRepositories as string | CloneOptions), - ]; - } - - return { - repositories, - callback: resultCallback, - }; - }) - .helpers(cloneHelpers) - .executor(async (next, self) => { - const { repositories } = self.getArguments(); - const repo = repositoryContext.getStore(); - if (repositories.length === 0) { - if (repo) { - repositories.push({ ...repo, shallow: true }); - } - } - await Promise.all( - repositories.map(({ repository, shallow, branch }, index) => - cwdContext.run({ cwd: process.cwd() }, async () => { - const id = `${repository}, ${String(index)}, ${String( - shallow, - )}, ${String(branch)}`; - const tmpDir = getTmpDir(`${repository}${String(index)}`); - const cwd = cwdContext.getStore(); - const parentCwd = parentCwdContext.getStore(); - if (cwd) { - cwd.cwd = tmpDir; - } - if (parentCwd) { - parentCwd.cwd = tmpDir; - } - await memoizedCloneRepo(id, { - repositoryUrl: repository, - branch, - shallow, - extraName: String(index), - tmpDir, - }); - if (repo?.forkedFrom) { - await memoizedSyncForkedRepo(``, { - branch, - upstream: repo.forkedFrom, - fork: repository, - }); - } - await gitContext.run(new GitContext({ repository, id }), next); - }), - ), - ); - }) - .callback(async (self) => { - const { callback } = self.getArguments(); - await callback?.(cloneHelpers); - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const clone = fnWrapper("clone", cloneLogic); - -const cloneHelpers = { - jsFiles, - branch, - commit, - push, - dirs, - codemod, - exec, - files, - pr, -}; - -export type CloneHelpers = typeof cloneHelpers; diff --git a/tooling/src/git/commit.ts b/tooling/src/git/commit.ts deleted file mode 100644 index 6f191d2d..00000000 --- a/tooling/src/git/commit.ts +++ /dev/null @@ -1,66 +0,0 @@ -import type { PLazy } from "../PLazy.js"; -import { getCwdContext, repositoryContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { logger } from "../helpers.js"; -import { spawn } from "../spawn.js"; -import { push } from "./push.js"; - -export type CommitReturn = PLazy & Helpers; - -/** - * @description Commit changes to the current repository, adds all the files with `git add .` - * @param message Commit message - * @example - * ```ts - * import { git } from '@codemod.com/workflow' - * await git.clone('git://github.com/codemod-com/codemod.git') - * .branch('new-branch', async ({ files, commit, push }) => { - * await files() - * .jsFam() - * .astGrep('console.log($$$ARGS)') - * .replace('console.error($$$ARGS)') - * await commit('feat: new branch') - * await push() - * }) - * ``` - */ -export function commitLogic(message: string): CommitReturn { - return new FunctionExecutor("commit") - .arguments(() => ({ - message, - })) - .helpers(helpers) - .executor(async (next, self) => { - const { message } = self.getArguments(); - const { cwd } = getCwdContext(); - const repoContext = repositoryContext.getStore(); - const log = logger( - `Committing${repoContext ? ` to ${repoContext.repository}/tree/${repoContext.branch}` : ""}${ - message ? ` with message: ${JSON.stringify(message)}` : "" - }`, - ); - try { - await spawn("git", ["add", "."], { cwd }); - const { stdout } = await spawn("git", ["commit", "-m", message], { - cwd: cwd, - doNotThrowError: true, - }); - if (stdout.join("").match(/nothing to commit, working tree clean/gm)) { - log.warn("Nothing to commit"); - } else { - log.success(stdout.join("")); - } - } catch (e: any) { - log.fail(e.toString()); - } - await next(); - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const commit = fnWrapper("commit", commitLogic); - -const helpers = { push }; - -type Helpers = typeof helpers; diff --git a/tooling/src/git/git.ts b/tooling/src/git/git.ts deleted file mode 100644 index b0de4c3b..00000000 --- a/tooling/src/git/git.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { branch } from "./branch.js"; -import { clone } from "./clone.js"; -import { commit } from "./commit.js"; -import { push } from "./push.js"; - -export const git = { clone, branch, push, commit }; diff --git a/tooling/src/git/helpers.ts b/tooling/src/git/helpers.ts deleted file mode 100644 index 003acf03..00000000 --- a/tooling/src/git/helpers.ts +++ /dev/null @@ -1,146 +0,0 @@ -import { CleanOptions, simpleGit } from "simple-git"; -import { invariant } from "ts-invariant"; -import { cwdContext } from "../contexts.js"; -import { isDirectory } from "../fs.js"; -import { logger } from "../helpers.js"; - -/** - * Get the default branch from a remote repository - */ -export const getDefaultBranchFromRemote = async (repository: string) => { - const stdout = await simpleGit().listRemote(["--symref", repository, "HEAD"]); - return stdout.match(/refs\/heads\/(\S+)/m)?.[1]; -}; - -/** - * Get the hash of a branch from a remote repository - */ -const getBranchHashFromRemote = async ( - repositoryUrl: string, - branch: string, -) => { - const stdout = await simpleGit().listRemote([repositoryUrl, branch]); - return stdout.split("\t")[0]; -}; - -const ensureBranchHash = async ({ - cwd, - hash, - branch, -}: { - cwd: string; - hash: string; - branch: string; -}) => { - const localHash = await simpleGit(cwd).revparse("HEAD"); - if (localHash !== hash) { - await simpleGit(cwd).pull("origin", branch); - } -}; - -export const syncForkRepository = async ( - key: string, - { - branch, - upstream, - fork, - }: { branch?: string; upstream: string; fork: string }, -) => { - const cwd = cwdContext.getStore(); - invariant(cwd, "No cwd found"); - const git = simpleGit(cwd.cwd); - const remoteDefaultBranch = await getDefaultBranchFromRemote(upstream); - invariant( - remoteDefaultBranch, - `No remote default branch found in ${upstream}`, - ); - const remoteDefaultBranchHashes = await Promise.all([ - getBranchHashFromRemote(upstream, remoteDefaultBranch), - getBranchHashFromRemote(fork, remoteDefaultBranch), - ]); - if (remoteDefaultBranchHashes[0] !== remoteDefaultBranchHashes[1]) { - const log = logger("Syncing forked repository"); - try { - if ( - !(await git.getRemotes()).some((remote) => remote.name === "upstream") - ) { - await git.addRemote("upstream", upstream); - } - await git.fetch("upstream", remoteDefaultBranch); - await git.checkout(branch || remoteDefaultBranch); - await git.mergeFromTo( - `upstream/${remoteDefaultBranch}`, - branch || remoteDefaultBranch, - ); - await git.push("origin", branch || remoteDefaultBranch); - log.success(); - } catch (error: any) { - log.fail(error.toString()); - } - } -}; - -export const cloneRepository = async ( - key: string, - { - repositoryUrl, - extraName, - shallow, - branch, - tmpDir, - }: { - repositoryUrl: string; - extraName?: string; - shallow?: boolean; - branch?: string; - tmpDir: string; - }, -) => { - if (await isDirectory(tmpDir)) { - const git = simpleGit(tmpDir); - console.log(`Directory ${tmpDir} already exists, skipping clone`); - await git.clean(CleanOptions.FORCE + CleanOptions.RECURSIVE); - await git.reset(["--hard"]); - const remoteDefaultBranch = await getDefaultBranchFromRemote(repositoryUrl); - invariant( - remoteDefaultBranch, - `No remote default branch found in ${repositoryUrl}`, - ); - await git.checkout(remoteDefaultBranch); - const remoteDefaultBranchHash = - remoteDefaultBranch && - (await getBranchHashFromRemote(repositoryUrl, remoteDefaultBranch)); - invariant( - remoteDefaultBranchHash, - `No remote default branch hash found in remote ${repositoryUrl}`, - ); - await ensureBranchHash({ - cwd: tmpDir, - hash: remoteDefaultBranchHash, - branch: remoteDefaultBranch, - }); - - const localBranches = (await git.branchLocal()).all.filter( - (branchName) => branchName !== remoteDefaultBranch, - ); - if (localBranches.length) { - await git.deleteLocalBranches(localBranches, true); - } - return; - } - - const log = logger(`Cloning repository: ${repositoryUrl} to ${tmpDir}`); - await simpleGit().clone( - repositoryUrl, - tmpDir, - shallow - ? [ - "--depth", - "1", - "--single-branch", - ...(branch ? [`--branch=${branch}`] : []), - ] - : [], - ); - log.success(); -}; diff --git a/tooling/src/git/push.ts b/tooling/src/git/push.ts deleted file mode 100644 index 7e4581ca..00000000 --- a/tooling/src/git/push.ts +++ /dev/null @@ -1,61 +0,0 @@ -import type { PLazy } from "../PLazy.js"; -import { getCwdContext, getRepositoryContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { logger } from "../helpers.js"; -import { spawn } from "../spawn.js"; - -export interface PushOptions { - /** - * @description Force push - * @default true - */ - force: boolean; -} - -export type PushReturn = PLazy & Helpers; - -/** - * @description Push changes to the current repository - * @param {PushOptions} options Options for push, force push is true by default - * @example - * ```ts - * import { git } from '@codemod.com/workflow' - * await git.clone('git://github.com/codemod-com/codemod.git', async ({ files, commit, push }) => { - * await files() - * .jsFam() - * .astGrep('console.log($$$ARGS)') - * .replace('console.error($$$ARGS)') - * await commit('feat: new branch') - * await push({ force: false }) - * }) - */ -export function pushLogic( - { force }: PushOptions = { force: true }, -): PushReturn { - return new FunctionExecutor("push") - .arguments(() => ({ force })) - .helpers(helpers) - .executor(async (next) => { - const { repository, branch } = getRepositoryContext(); - const { cwd } = getCwdContext(); - - const log = logger(`Pushing to ${repository}/tree/${branch}`); - try { - await spawn("git", ["push", ...(force ? ["-f"] : [])], { - cwd, - }); - log.success(); - } catch (e: any) { - log.fail(e.toString()); - } - await next(); - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const push = fnWrapper("push", pushLogic); - -const helpers = {}; - -type Helpers = typeof helpers; diff --git a/tooling/src/github/fork.ts b/tooling/src/github/fork.ts deleted file mode 100644 index 00fcbcc4..00000000 --- a/tooling/src/github/fork.ts +++ /dev/null @@ -1,127 +0,0 @@ -import type { RestEndpointMethodTypes } from "@octokit/rest"; -import { Octokit } from "@octokit/rest"; -import { memoize } from "lodash-es"; -import type { PLazy } from "../PLazy.js"; -import { getAuthService } from "../authService.js"; -import { repositoryContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { clone } from "../git/clone.js"; -import { logger, parseMultistring } from "../helpers.js"; -import { pr } from "./pr.js"; -import { getForkParameters } from "./utils.js"; - -type ForkConfig = RestEndpointMethodTypes["repos"]["createFork"]["parameters"]; - -export const forkRepository = async ( - key: string, - { - githubAPIKey, - parameters, - }: { - githubAPIKey: string; - parameters: ForkConfig; - }, -) => { - const octokit = new Octokit({ - auth: githubAPIKey, - }); - const log = logger(`Forking ${parameters.owner}/${parameters.repo}`); - try { - const response = await octokit.repos.createFork(parameters); - log.success(`Forked to ${response.data.full_name}`); - const sshUrl = response.data.ssh_url; - const branch = response.data.parent?.default_branch ?? "main"; - return { - repository: sshUrl, - branch, - }; - } catch (error: any) { - log.fail(error.toString()); - } -}; - -export type ForkReturn = PLazy & Helpers; - -export type ForkOptions = - | string - | readonly string[] - | ForkConfig - | (ForkConfig | string)[]; - -/** - * @description Forks a repository in github, requires authentication via Codemod CLI and Github permissions. - * @param urlOrParameters - The URL of the repository to fork or an array of URLs to fork. - * @param callback - A callback function to run after the fork is complete. - */ -export function forkLogic( - urlOrParameters: ForkOptions, - callback?: (helpers: Helpers) => void | Promise, -): ForkReturn { - const fork = memoize(forkRepository); - return new FunctionExecutor("fork") - .arguments(() => { - let forkParameters: ForkConfig[]; - - if ( - typeof urlOrParameters === "string" || - (Array.isArray(urlOrParameters) && - urlOrParameters.every((param) => typeof param === "string")) - ) { - forkParameters = - parseMultistring(urlOrParameters).map(getForkParameters); - } else if (Array.isArray(urlOrParameters)) { - forkParameters = urlOrParameters.map((param) => - typeof param === "string" ? getForkParameters(param) : param, - ); - } else { - forkParameters = [urlOrParameters as ForkConfig]; - } - - return { - forkParameters, - callback, - }; - }) - .helpers(helpers) - .executor(async (next, self) => { - const { forkParameters } = self.getArguments(); - const authService = getAuthService(); - const isAvailable = await authService?.ensureGithubScopes(["repo"]); - if (!isAvailable) { - console.log("Github scopes not available"); - return; - } - const githubAPIKey = await authService?.getGithubAPIKey(); - if (githubAPIKey) { - for (const parameters of forkParameters) { - const id = `${parameters.owner}/${parameters.repo}`; - const clonedRepo = await fork(id, { - githubAPIKey, - parameters, - }); - if (!clonedRepo) { - return; - } - await repositoryContext.run( - { - ...clonedRepo, - forkedFrom: `https://github.com/${parameters.owner}/${parameters.repo}`, - }, - () => next(), - ); - } - } - }) - .callback(async (self) => { - const { callback } = self.getArguments(); - await callback?.(helpers); - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const fork = fnWrapper("fork", forkLogic); - -const helpers = { clone, pr }; - -export type Helpers = typeof helpers; diff --git a/tooling/src/github/github.ts b/tooling/src/github/github.ts deleted file mode 100644 index 24d16827..00000000 --- a/tooling/src/github/github.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { fork } from "./fork.js"; -import { pr } from "./pr.js"; - -export const github = { fork, pr }; diff --git a/tooling/src/github/pr.ts b/tooling/src/github/pr.ts deleted file mode 100644 index 03186d36..00000000 --- a/tooling/src/github/pr.ts +++ /dev/null @@ -1,146 +0,0 @@ -import { Octokit, type RestEndpointMethodTypes } from "@octokit/rest"; -import parseGitUrl from "git-url-parse"; -import type { PLazy } from "../PLazy.js"; -import { getAuthService } from "../authService.js"; -import { getGitContext, repositoryContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { getDefaultBranchFromRemote } from "../git/helpers.js"; -import { logger } from "../helpers.js"; - -export type PrOptions = { - /** - * Title of the PR - */ - title: string; - /** - * Body of the PR - */ - body?: string; - /** - * Whether the PR should be a draft - */ - draft?: boolean; -}; - -export type PrReturn = PLazy & Helpers; - -/** - * @description Create a PR (should be used together with fork) - * @param options Options for creating a PR - * @param options.title Title of the PR - * @param options.body Body of the PR - * @param options.draft Whether the PR should be a draft - * @example - * ```ts - * await github.fork`https://github.com/codemod-com/codemod.git` - * .clone(async ({ commit, files, push, pr, branch }) => { - * await branch`console-log-to-error`; - * await files() - * .jsFam() - * .astGrep`console.log($$$A)` - * .replace`console.error($$$A)` - * await commit`Change console.log to console.error` - * await push() - * await pr({ - * title: "Change console.log to console.error", - * body: "This PR changes all console.log to console.error", - * draft: true, - * }) - * }) - * ``` - */ -export function prLogic({ title, body, draft }: PrOptions): PrReturn { - return new FunctionExecutor("pr") - .arguments(() => { - return { - title, - body, - }; - }) - .helpers(helpers) - .executor(async (next, self) => { - const { body, title } = self.getArguments(); - const authService = getAuthService(); - const isAvailable = await authService?.ensureGithubScopes(["repo"]); - if (!isAvailable) { - console.log("Github scopes not available"); - return; - } - const githubAPIKey = await authService?.getGithubAPIKey(); - const gitContext = getGitContext(); - if (githubAPIKey) { - const octokit = new Octokit({ - auth: githubAPIKey, - }); - const url = parseGitUrl(gitContext.get("repository")); - let owner = url.owner; - let repo = url.name; - let head = (await gitContext.simpleGit.branchLocal()).current; - - const repository = repositoryContext.getStore(); - if (repository?.forkedFrom) { - const parentUrl = parseGitUrl(repository?.forkedFrom); - owner = parentUrl.owner; - repo = parentUrl.name; - head = `${url.owner}:${head}`; - } - - const parameters: RestEndpointMethodTypes["pulls"]["create"]["parameters"] = - { - owner, - repo, - title, - head, - base: (await getDefaultBranchFromRemote( - gitContext.get("repository"), - )) as string, - body, - draft, - }; - const log = logger(`Creating PR for ${owner}/${repo}`); - - try { - const response = await octokit.pulls.create(parameters); - log.success(`Created PR ${response.data.html_url}`); - } catch (error: any) { - if (error.toString().includes("A pull request already exists")) { - // Update PR - const prs = await octokit.pulls.list({ - owner, - repo, - head, - }); - if (prs.data.length > 0) { - const pr = prs - .data[0] as RestEndpointMethodTypes["pulls"]["list"]["response"]["data"][0]; - try { - await octokit.pulls.update({ - owner, - repo, - pull_number: pr.number, - title, - body, - }); - log.success(`Updated PR ${pr.html_url}`); - } catch (error: any) { - log.fail(error.toString()); - } - } else { - log.fail(error.toString()); - } - } else { - log.fail(error.toString()); - } - } - await next(); - } - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const pr = fnWrapper("pr", prLogic); - -const helpers = {}; - -type Helpers = typeof helpers; diff --git a/tooling/src/github/utils.ts b/tooling/src/github/utils.ts deleted file mode 100644 index 3258e4db..00000000 --- a/tooling/src/github/utils.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { RestEndpointMethodTypes } from "@octokit/rest"; -import parseGitUrl from "git-url-parse"; - -export const getForkParameters = ( - repoUrl: string, -): RestEndpointMethodTypes["repos"]["createFork"]["parameters"] => { - const url = parseGitUrl(repoUrl); - - return { - owner: url.owner, - repo: url.name, - name: url.name, - }; -}; diff --git a/tooling/src/helpers.ts b/tooling/src/helpers.ts deleted file mode 100644 index a5d9575e..00000000 --- a/tooling/src/helpers.ts +++ /dev/null @@ -1,93 +0,0 @@ -// @ts-ignore -import colors from "colors-cli"; -import { flattenDeep, identity, mapValues } from "lodash-es"; -import { getRepositoriesContext, parentContextLegacy } from "./contexts.js"; - -export const clc = { - blueBright: (text: string) => colors.blue_bt(text), - green: (text: string) => colors.green(text), - red: (text: string) => colors.red(text), - yellow: (text: string) => colors.yellow(text), -}; - -export const promiseTimeout = (ms: number) => - new Promise((resolve) => setTimeout(resolve, ms)); - -export const logger = (message: string) => { - console.info(`${clc.blueBright("RUN ")} ${message}`); - - return { - success: (output?: string) => - console.info( - `${clc.green("SUCC")} ${message}${ - output - ? `\n ${output - .split("\n") - .map((line) => `\n ${line}`) - .join("") - .trim()}` - : "" - }`, - ), - fail: (error: string) => - console.error(`${clc.red("ERR ")} ${message} - ${error}`), - warn: (warning: string) => - console.warn(`${clc.yellow("WARN")} ${message} - ${warning}`), - }; -}; - -export const parseRepositories = ( - repos: string | Readonly | ((...args: any[]) => Promise), -) => { - if (typeof repos === "string") { - return repos - .split(/[\n,; ]/) - .map((repository) => repository.trim()) - .filter(identity); - } - - if (typeof repos === "function") { - return getRepositoriesContext().repositories; - } - - return flattenDeep( - repos.map((repository) => - repository.split(/[\n, ;]/).map((repository) => repository.trim()), - ), - ).filter(identity); -}; - -export const parseMultistring = ( - repos: string | readonly string[], - splitWith = /[\n,; ]/, -) => { - if (typeof repos === "string") { - return repos - .split(splitWith) - .map((repository) => repository.trim()) - .filter(identity); - } - - return flattenDeep( - repos.map((repository) => - repository.split(splitWith).map((repository) => repository.trim()), - ), - ).filter(identity); -}; - -export type MapChildren any>> = - { - [Property in keyof Type]: ReturnType; - }; - -export const noContextFn = ReturnType>(cb: T) => - cb(); -export const wrapHelpers = (helpers: H, context: C): H => - mapValues( - // @ts-ignore - helpers, - (value: any) => - (...args: any[]) => - // @ts-ignore - parentContextLegacy.run(context, () => value(...args)), - ) as any; diff --git a/tooling/src/index.ts b/tooling/src/index.ts deleted file mode 100644 index 9109cca5..00000000 --- a/tooling/src/index.ts +++ /dev/null @@ -1,61 +0,0 @@ -import * as contexts from "./contexts.js"; - -export * from "./contexts.js"; - -import { git } from "./git/git.js"; - -import { SgNode, astGrep } from "./astGrep/astGrep.js"; - -import { jsFiles } from "./jsFiles.js"; - -import { dirs } from "./fs/dirs.js"; - -import { codemod } from "./codemod.js"; - -import { getTree } from "./engineHelpers.js"; - -import { files } from "./files.js"; - -import { exec } from "./exec.js"; - -import { question } from "./question.js"; - -import { github } from "./github/github.js"; - -import { AuthServiceInterface, setAuthService } from "./authService.js"; - -export { - git, - astGrep, - jsFiles, - contexts, - dirs, - codemod, - getTree, - files, - exec, - question, - github, - setAuthService, - AuthServiceInterface, - SgNode, -}; - -export const api = { - git, - astGrep, - jsFiles, - contexts, - dirs, - codemod, - getTree, - files, - exec, - question, - github, - setAuthService, -}; - -export { isWorkflowEngineFile } from "./isWorkflowEngineFile.js"; - -export type Api = typeof api; diff --git a/tooling/src/isWorkflowEngineFile.ts b/tooling/src/isWorkflowEngineFile.ts deleted file mode 100644 index f26a6619..00000000 --- a/tooling/src/isWorkflowEngineFile.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { files } from "./files.js"; - -export async function isWorkflowEngineFile(filename: string) { - const maybeWorkflowFiles = files(filename); - return ( - (await maybeWorkflowFiles.astGrep`module.exports={workflow}`.exists()) || - (await maybeWorkflowFiles.astGrep`rule: - pattern: - context: "{ workflow: () => $_ }" -`.exists()) || - (await maybeWorkflowFiles.astGrep`rule: - pattern: - context: "export async function workflow($$$_) { $$$_ }" -`.exists()) - ); -} diff --git a/tooling/src/jsFam.ts b/tooling/src/jsFam.ts deleted file mode 100644 index 6bd58285..00000000 --- a/tooling/src/jsFam.ts +++ /dev/null @@ -1,144 +0,0 @@ -import { type NapiConfig, type SgNode, ts as astGrepTsx } from "@ast-grep/napi"; -import type { PLazy } from "./PLazy.js"; -import { astGrep } from "./astGrep/astGrep.js"; -import { getImports } from "./astGrep/getImports.js"; -import { getFileContext } from "./contexts.js"; -import { FunctionExecutor, fnWrapper } from "./engineHelpers.js"; -import { jscodeshift } from "./jsFam/jscodeshift.js"; - -export type JsFamReturn = PLazy & Helpers; - -/** - * @description Adds javascript/typescript context to get specific helpers (jscodeshift, work with imports). Also, it will change glob pattern for `files()` search function. - * @example - * ```ts - * await files() - * .jsFam() - * .jscodeshift((file, api) => { - * const j = api.jscodeshift; - * return j(file.source) - * .find(j.Identifier) - * .forEach((path) => { - * j(path).replaceWith(j.identifier("Hello")); - * }) - * }) - * ``` - */ -export function jsFamLogic(): JsFamReturn; -/** - * @description Adds javascript/typescript context to get specific helpers (jscodeshift, work with imports). Also, it will change glob pattern for `files()` search function. - * @param callback - A function that will be executed in the context of the javascript/typescript helpers. - * @example - * ```ts - * await files() - * .jsFam(({ jscodeshift }) => { - * jscodeshift((file, api) => { - * const j = api.jscodeshift; - * return j(file.source) - * .find(j.Identifier) - * .forEach((path) => { - * j(path).replaceWith(j.identifier("Hello")); - * }) - * }) - * }) - * ``` - * @see {@link astGrep} - * @see {@link jscodeshift} - * @see {@link addImport} - * @see {@link removeImport} - */ -export function jsFamLogic( - callback: (helpers: Helpers) => void | Promise, -): JsFamReturn; -export function jsFamLogic( - callback?: (helpers: Helpers) => void | Promise, -): JsFamReturn { - return new FunctionExecutor("jsFam") - .arguments(() => { - return { callback }; - }) - .helpers(helpers) - .setParentArgs({ defaultGlob: "**/*.{js,jsx,ts,tsx,cjs,mjs,cts,mts,d.ts}" }) - .return((self) => self.wrappedHelpers()) - .executor(async (next, self) => { - const { callback } = self.getArguments(); - - if (callback) { - await callback(helpers); - } - - await next(); - - const { importsUpdates } = getFileContext(); - const getImportInfo = (node: SgNode) => ({ - from: node.getMatch("FROM")?.text(), - imports: node - .getMultipleMatches("IMPORTS") - .filter((n) => n.kind() !== ",") - .map((n) => n.text()), - }); - const importRule: NapiConfig = { - rule: { - any: [ - { pattern: "import { $$$IMPORTS } from '$FROM'" }, - { pattern: 'import { $$$IMPORTS } from "$FROM"' }, - ], - }, - }; - if (importsUpdates.length) { - for (const { type, import: line } of importsUpdates) { - const namedImportsToChange = astGrepTsx - .parse(line) - .root() - .findAll(importRule); - for (const node of namedImportsToChange) { - const importChange = getImportInfo(node); - await astGrep(importRule).replace(({ getNode }) => { - const currentImports = getImportInfo(getNode()); - let modified = false; - if (currentImports.from === importChange.from) { - for (const namedImport of importChange.imports) { - if (type === "add") { - if (!currentImports.imports.includes(namedImport)) { - modified = true; - currentImports.imports.push(namedImport); - } - } else if (type === "remove") { - if (currentImports.imports.includes(namedImport)) { - modified = true; - currentImports.imports = currentImports.imports.filter( - (imp) => imp !== namedImport, - ); - } - } - } - } - if (modified) { - return `import { ${currentImports.imports.join(", ")} } from "${ - currentImports.from - }"`; - } - return undefined; - }); - } - } - } - }) - .run() as any; -} - -export const jsFam = fnWrapper("jsFam", jsFamLogic); - -const helpers = { - astGrep, - getImports, - addImport: (line: string) => { - getFileContext().importsUpdates.push({ type: "add", import: line }); - }, - removeImport: (line: string) => { - getFileContext().importsUpdates.push({ type: "remove", import: line }); - }, - jscodeshift, -}; - -export type Helpers = typeof helpers; diff --git a/tooling/src/jsFam/jscodeshift.ts b/tooling/src/jsFam/jscodeshift.ts deleted file mode 100644 index a74f5dd3..00000000 --- a/tooling/src/jsFam/jscodeshift.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { buildApi } from "@codemod-com/utilities"; -import type { API, FileInfo, Options } from "jscodeshift"; -import type { PLazy } from "../PLazy.js"; -import { getFileContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; - -export type JscodeshiftReturn = PLazy & Helpers; - -/** - * Run jscodeshift codemod for files in context - * @param callback - */ -export function jscodeshiftLogic( - callback: ( - file: FileInfo, - api: API, - options: Options, - ) => void | Promise | Promise | string, -): JscodeshiftReturn { - const api = buildApi("tsx"); - return new FunctionExecutor("jscodeshift") - .arguments(() => ({ callback })) - .helpers(() => helpers) - .return((self) => self.wrappedHelpers()) - .executor(async (next, self) => { - const { callback } = self.getArguments(); - const fileContext = getFileContext(); - const source = await fileContext.contents(); - - try { - const newData = await callback( - { path: fileContext.file, source }, - api, - {}, - ); - if (typeof newData === "string" && source !== newData) { - fileContext.setContents(newData); - await fileContext.save(); - } - } catch (e) { - console.error(`jscodeshift error: ${e} in ${fileContext.file}`); - } - - await next(); - }) - .run(); -} - -export const jscodeshift = fnWrapper("jscodeshift", jscodeshiftLogic); - -const helpers = {}; - -type Helpers = typeof helpers; diff --git a/tooling/src/jsFiles.ts b/tooling/src/jsFiles.ts deleted file mode 100644 index 17a5c253..00000000 --- a/tooling/src/jsFiles.ts +++ /dev/null @@ -1,165 +0,0 @@ -import * as path from "node:path"; -import { type NapiConfig, type SgNode, ts as astGrepTsx } from "@ast-grep/napi"; -import * as glob from "glob"; -import type { PLazy } from "./PLazy.js"; -import { astGrep } from "./astGrep/astGrep.js"; -import { getImports } from "./astGrep/getImports.js"; -import { fileContext, getCwdContext, getFileContext } from "./contexts.js"; -import { FileContext } from "./contexts/FileContext.js"; -import { FunctionExecutor, fnWrapper } from "./engineHelpers.js"; -import { parseMultistring } from "./helpers.js"; - -export type JsFilesReturn = PLazy & Helpers; - -/** - * @description Filter all js/ts files in current directory - * @deprecated Use `files().jsFam()` instead - */ -export function jsFilesLogic(): JsFilesReturn; -/** - * @description Filter file by glob pattern - * @deprecated Use `files(glob).jsFam()` instead - * @param globs string or array of globs to search for a files, could be comma/space separated string - * @example - * ```ts - * await jsFiles('src/app.ts,src/**∕*.tsx').astGrep`import React from 'react'`; - * ``` - */ -export function jsFilesLogic(globs: string | readonly string[]): JsFilesReturn; -/** - * @description Filter file by glob pattern and apply callback - * @deprecated Use `files(glob).jsFam(callback)` instead - */ -export function jsFilesLogic( - globs: string | readonly string[], - callback: (helpers: Helpers) => void | Promise, -): JsFilesReturn; -/** - * @description Filter all js/ts files in current directory and apply callback - * @deprecated Use `files().jsFam(callback)` instead - */ -export function jsFilesLogic( - callback: (helpers: Helpers) => void | Promise, -): JsFilesReturn; -export function jsFilesLogic( - rawGlobs?: - | string - | readonly string[] - | ((helpers: Helpers) => void | Promise), - maybeCallback?: (helpers: Helpers) => void | Promise, -): JsFilesReturn { - return new FunctionExecutor("jsFiles") - .arguments(() => { - const globs = parseMultistring( - !rawGlobs || typeof rawGlobs === "function" - ? "**/*.{js,jsx,ts,tsx,cjs,mjs}" - : rawGlobs, - /[\n; ]/, - ); - - const callback = - typeof rawGlobs === "function" ? rawGlobs : maybeCallback; - return { globs, callback }; - }) - .helpers(helpers) - .executor(async (next, self) => { - const { globs, callback } = self.getArguments(); - const { cwd } = getCwdContext(); - const files = await glob.glob(globs, { - cwd, - nodir: true, - ignore: [ - "**/node_modules/**", - "**/.git/**", - "**/dist/**", - "**/build/**", - ], - }); - - for (const file of files) { - await fileContext.run( - new FileContext({ file: path.join(cwd, file) }), - async () => { - if (callback) { - await callback(helpers); - } - - await next(); - - const { importsUpdates } = getFileContext(); - const getImportInfo = (node: SgNode) => ({ - from: node.getMatch("FROM")?.text(), - imports: node - .getMultipleMatches("IMPORTS") - .filter((n) => n.kind() !== ",") - .map((n) => n.text()), - }); - const importRule: NapiConfig = { - rule: { - any: [ - { pattern: "import { $$$IMPORTS } from '$FROM'" }, - { pattern: 'import { $$$IMPORTS } from "$FROM"' }, - ], - }, - }; - if (importsUpdates.length) { - for (const { type, import: line } of importsUpdates) { - const namedImportsToChange = astGrepTsx - .parse(line) - .root() - .findAll(importRule); - for (const node of namedImportsToChange) { - const importChange = getImportInfo(node); - await astGrep(importRule).replace(({ getNode }) => { - const currentImports = getImportInfo(getNode()); - let modified = false; - if (currentImports.from === importChange.from) { - for (const namedImport of importChange.imports) { - if (type === "add") { - if (!currentImports.imports.includes(namedImport)) { - modified = true; - currentImports.imports.push(namedImport); - } - } else if (type === "remove") { - if (currentImports.imports.includes(namedImport)) { - modified = true; - currentImports.imports = - currentImports.imports.filter( - (imp) => imp !== namedImport, - ); - } - } - } - } - if (modified) { - return `import { ${currentImports.imports.join( - ", ", - )} } from "${currentImports.from}"`; - } - return undefined; - }); - } - } - } - }, - ); - } - }) - .return((self) => self.wrappedHelpers()) - .run() as any; -} - -export const jsFiles = fnWrapper("jsFiles", jsFilesLogic); - -const helpers = { - astGrep, - getImports, - addImport: (line: string) => { - getFileContext().importsUpdates.push({ type: "add", import: line }); - }, - removeImport: (line: string) => { - getFileContext().importsUpdates.push({ type: "remove", import: line }); - }, -}; - -type Helpers = typeof helpers; diff --git a/tooling/src/json/json.ts b/tooling/src/json/json.ts deleted file mode 100644 index 7cd32e2a..00000000 --- a/tooling/src/json/json.ts +++ /dev/null @@ -1,41 +0,0 @@ -import type { PLazy } from "../PLazy.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { map } from "./map.js"; -import { update } from "./update.js"; - -export type JsonReturn = PLazy & Helpers; - -/** - * @description Filter all json files - */ -export function jsonLogic(): PLazy & Helpers; -export function jsonLogic( - callback: (helpers: Helpers) => void | Promise, -): JsonReturn; -export function jsonLogic( - callback?: (helpers: Helpers) => void | Promise, -): JsonReturn { - return new FunctionExecutor("json") - .arguments(() => { - return { callback }; - }) - .helpers(helpers) - .setParentArgs({ defaultGlob: "**/*.json" }) - .return((self) => self.wrappedHelpers()) - .executor(async (next, self) => { - const { callback } = self.getArguments(); - - if (callback) { - await callback(helpers); - } - - await next(); - }) - .run() as any; -} - -export const json = fnWrapper("json", jsonLogic); - -const helpers = { map, update }; - -export type Helpers = typeof helpers; diff --git a/tooling/src/json/map.ts b/tooling/src/json/map.ts deleted file mode 100644 index 37592830..00000000 --- a/tooling/src/json/map.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { getFileContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; - -/** - * Map json file contents - */ -export function mapLogic< - CALLBACK extends (helpers: Helpers) => ReturnType, - RETURN extends ReturnType, ->(callback: CALLBACK): Promise[]> { - const response = [] as Awaited[]; - return new FunctionExecutor("map") - .helpers(helpers) - .arguments(() => ({ callback })) - .executor(async (next, self) => { - const { callback } = self.getArguments(); - const result = await callback(helpers); - response.push(result as Awaited); - await next?.(); - }) - .return(() => response) - .run(); -} - -export const map = fnWrapper("map", mapLogic); - -const helpers = { - getContents: async () => - JSON.parse(await getFileContext().contents()) as T, -}; - -type Helpers = typeof helpers; diff --git a/tooling/src/json/update.ts b/tooling/src/json/update.ts deleted file mode 100644 index a4b69e27..00000000 --- a/tooling/src/json/update.ts +++ /dev/null @@ -1,42 +0,0 @@ -import detectIndent from "detect-indent"; -import { detectNewline } from "detect-newline"; -import type { PLazy } from "../PLazy.js"; -import { getFileContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; - -export type UpdateReturn = PLazy & Helpers; - -/** - * Update the contents of a json file - */ -export function updateLogic( - callback: (before: T) => T | Promise, -): UpdateReturn { - return new FunctionExecutor("update") - .helpers(helpers) - .arguments(() => ({ callback })) - .executor(async (next, self) => { - const { callback } = self.getArguments(); - const file = getFileContext(); - const beforeContents = await file.contents(); - const indent = detectIndent(beforeContents).indent || " "; - const newline = detectNewline(beforeContents) || "\n"; - const possibleNewline = beforeContents.slice(-newline.length); - const newlineToInsert = - newline.localeCompare(possibleNewline) === 0 ? newline : ""; - const afterContents = await callback(JSON.parse(beforeContents)); - file.setContents( - JSON.stringify(afterContents, null, indent).concat(newlineToInsert), - ); - await file.save(); - await next?.(); - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const update = fnWrapper("update", updateLogic); - -const helpers = {}; - -type Helpers = typeof helpers; diff --git a/tooling/src/question.ts b/tooling/src/question.ts deleted file mode 100644 index aa749125..00000000 --- a/tooling/src/question.ts +++ /dev/null @@ -1,26 +0,0 @@ -import inquirer, { type Answers } from "inquirer"; -import { FunctionExecutor, fnWrapper } from "./engineHelpers.js"; - -type Arguments = Parameters; - -/** - * Ask a question using [inquirer](https://www.npmjs.com/package/inquirer) - * @param args [questions, answers] - * @returns Promise - */ -export function questionLogic( - ...args: Arguments -): Promise { - let response: Return; - return new FunctionExecutor("question") - .arguments(() => ({ questions: args[0], answers: args[1] })) - .executor(async (next, self) => { - const { questions, answers } = self.getArguments(); - response = (await inquirer.prompt(questions, answers)) as any; - await next?.(); - }) - .return(() => response) - .run(); -} - -export const question = fnWrapper("question", questionLogic); diff --git a/tooling/src/spawn.ts b/tooling/src/spawn.ts deleted file mode 100644 index 4fc580d2..00000000 --- a/tooling/src/spawn.ts +++ /dev/null @@ -1,158 +0,0 @@ -import * as childProcess from "node:child_process"; -import * as fs from "node:fs"; - -import { noop, pickBy } from "lodash-es"; -import treeKill from "tree-kill"; - -export const spawn = ( - cmd: string, - args: string[], - miscOptions: childProcess.SpawnOptionsWithoutStdio & { - doNotThrowError?: boolean; - printOutput?: boolean; - printNewline?: boolean; - watch?: string; - doNotKill?: boolean; - filterEnv?: (key: string, value: any) => boolean; - } = {}, -): Promise<{ - stdout: string[]; - stderr: string[]; - error: Error; - kill: () => void; -}> => { - const cwd = miscOptions.cwd ?? process.cwd(); - - if (!fs.existsSync(cwd)) { - return Promise.reject( - new Error(`Provided directory: ${cwd} does not exist`), - ); - } - - return new Promise((resolve, reject) => { - const { - doNotThrowError, - printOutput, - printNewline, - watch, - doNotKill, - filterEnv, - ...execOptions - } = miscOptions; - - const env = pickBy( - { ...process.env, ...execOptions?.env, FORCE_COLOR: "" }, - (value, key) => filterEnv?.(key, value) ?? true, - ); - - const proc = childProcess.spawn(cmd, args, { - ...execOptions, - cwd, - env, - }); - - const pid = proc.pid as number; - const stderr = [] as string[]; - const stdout = [] as string[]; - - let caughtError: Error; - let killed = false; - - const kill = doNotKill - ? () => { - killed = true; - treeKill(pid, "SIGKILL"); - proc.stdin.end(); - proc.stdout.destroy(); - proc.stderr.destroy(); - } - : noop; - - proc.stdout.on("data", (data) => { - const chunk = data.toString(); - stdout.push(chunk); - if (chunk.includes("Proceed")) { - proc.stdin.write("y\n"); - } - if (watch && chunk.includes(watch)) { - if (!doNotKill) { - killed = true; - treeKill(pid, "SIGKILL"); - proc.stdin.end(); - proc.stdout.destroy(); - proc.stderr.destroy(); - } - resolve({ stdout, stderr, error: caughtError, kill }); - return; - } - - if (!killed) { - if (printOutput) { - process.stdout.write(chunk); - } - if (printNewline) { - proc.stdin.write("\n"); - } - } - }); - - proc.stderr.on("data", (data) => { - const chunk = data.toString(); - stderr.push(chunk); - if (watch && chunk.includes(watch)) { - if (!doNotKill) { - killed = true; - treeKill(pid, "SIGKILL"); - proc.stdin.end(); - proc.stdout.destroy(); - proc.stderr.destroy(); - } - resolve({ stdout, stderr, error: caughtError, kill }); - return; - } - - if (!killed) { - if (printOutput) { - process.stdout.write(chunk); - } - if (printNewline) { - proc.stdin.write("\n"); - } - } - }); - - proc.on("error", (error) => { - // console.log(error); - caughtError = error; - }); - - proc.on("close", (code) => { - if (!doNotThrowError) { - if (caughtError) { - reject( - new Error( - `Failed to execute command "${cmd} ${args.join( - " ", - )}" with error ${caughtError.toString()}`, - ), - ); - return; - } - - if (code) { - console.error(stdout.join("\n")); - console.error(stderr.join("\n")); - reject( - new Error( - `Failed to execute command "${cmd} ${args.join( - " ", - )}" with code ${code}`, - ), - ); - return; - } - } - resolve({ stdout, stderr, error: caughtError, kill }); - }); - }); -}; diff --git a/tooling/src/yaml/map.ts b/tooling/src/yaml/map.ts deleted file mode 100644 index ff2f64b1..00000000 --- a/tooling/src/yaml/map.ts +++ /dev/null @@ -1,35 +0,0 @@ -import * as YAML from "yaml"; -import { getFileContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; - -/** - * Map yaml file contents - */ -export function mapLogic< - CALLBACK extends ( - helpers: Helpers, - ) => ReturnType | Promise>, - RETURN extends ReturnType, ->(callback: CALLBACK): Promise[]> { - const response = [] as Awaited[]; - return new FunctionExecutor("map") - .helpers(helpers) - .arguments(() => ({ callback })) - .executor(async (next, self) => { - const { callback } = self.getArguments(); - const result = await callback(helpers); - response.push(result as Awaited); - await next?.(); - }) - .return(() => response) - .run(); -} - -export const map = fnWrapper("map", mapLogic); - -const helpers = { - getContents: async () => - YAML.parse(await getFileContext().contents()) as T, -}; - -type Helpers = typeof helpers; diff --git a/tooling/src/yaml/update.ts b/tooling/src/yaml/update.ts deleted file mode 100644 index 6e446053..00000000 --- a/tooling/src/yaml/update.ts +++ /dev/null @@ -1,36 +0,0 @@ -import detectIndent from "detect-indent"; -import * as YAML from "yaml"; -import type { PLazy } from "../PLazy.js"; -import { getFileContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; - -export type UpdateReturn = PLazy & Helpers; - -/** - * Update the contents of a yaml file - */ -export function updateLogic( - callback: (before: T) => T | Promise, -): UpdateReturn { - return new FunctionExecutor("update") - .helpers(helpers) - .arguments(() => ({ callback })) - .executor(async (next, self) => { - const { callback } = self.getArguments(); - const file = getFileContext(); - const beforeContents = await file.contents(); - const indent = detectIndent(beforeContents).amount || 2; - const afterContents = await callback(YAML.parse(beforeContents)); - file.setContents(YAML.stringify(afterContents, { indent })); - await file.save(); - await next?.(); - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const update = fnWrapper("update", updateLogic); - -const helpers = {}; - -type Helpers = typeof helpers; diff --git a/tooling/src/yaml/yaml.ts b/tooling/src/yaml/yaml.ts deleted file mode 100644 index 258a7071..00000000 --- a/tooling/src/yaml/yaml.ts +++ /dev/null @@ -1,41 +0,0 @@ -import type { PLazy } from "../PLazy.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { map } from "./map.js"; -import { update } from "./update.js"; - -export type YamlReturn = PLazy & Helpers; - -/** - * Filter all yaml files - */ -export function yamlLogic(): PLazy & Helpers; -export function yamlLogic( - callback: (helpers: Helpers) => void | Promise, -): YamlReturn; -export function yamlLogic( - callback?: (helpers: Helpers) => void | Promise, -): YamlReturn { - return new FunctionExecutor("yaml") - .arguments(() => { - return { callback }; - }) - .helpers(helpers) - .setParentArgs({ defaultGlob: "**/*.yaml" }) - .return((self) => self.wrappedHelpers()) - .executor(async (next, self) => { - const { callback } = self.getArguments(); - - if (callback) { - await callback(helpers); - } - - await next(); - }) - .run() as any; -} - -export const yaml = fnWrapper("yaml", yamlLogic); - -const helpers = { map, update }; - -export type Helpers = typeof helpers; diff --git a/tooling/tsconfig.json b/tooling/tsconfig.json deleted file mode 100644 index bc6b5943..00000000 --- a/tooling/tsconfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": ".", - "rootDir": "./src", - "outDir": "./dist", - - "allowJs": true, - "checkJs": false, - "declaration": true, - "emitDeclarationOnly": true, - "isolatedModules": false - }, - "include": ["src/**/*"], - "exclude": ["dist/**/*", "node_modules/**/*"], - "extends": "@codemod-com/tsconfig/base.json" -} diff --git a/tooling/tsconfig/backend.json b/tooling/tsconfig/backend.json deleted file mode 100644 index e01c06a4..00000000 --- a/tooling/tsconfig/backend.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/tsconfig", - "compilerOptions": { - "allowJs": true, - "checkJs": false, - "noEmit": true - }, - "extends": ["./base.json"] -} diff --git a/tooling/tsconfig/extension.json b/tooling/tsconfig/extension.json deleted file mode 100644 index 6ca1dd74..00000000 --- a/tooling/tsconfig/extension.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "compilerOptions": { - "experimentalDecorators": true, - "module": "commonjs", - "target": "ES2020", - "lib": ["ES2020"], - "sourceMap": false, - "strict": true, - "noUncheckedIndexedAccess": true, - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - "noUnusedParameters": true, - "noUnusedLocals": true, - "esModuleInterop": true, - "skipLibCheck": true - } -} diff --git a/tooling/tsconfig/package.json b/tooling/tsconfig/package.json deleted file mode 100644 index 6d2bc1f3..00000000 --- a/tooling/tsconfig/package.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "@codemod-com/tsconfig", - "version": "0.0.0", - "private": true, - "license": "MIT", - "files": [ - "base.json", - "codemod.json", - "lib.json", - "extension.json" - ], - "publishConfig": { - "access": "public" - } -} diff --git a/tooling/typescript/codemod.json b/tooling/typescript/codemod.json deleted file mode 100644 index e63ca9bd..00000000 --- a/tooling/typescript/codemod.json +++ /dev/null @@ -1,35 +0,0 @@ -{ - "compilerOptions": { - "module": "NodeNext", - "target": "ESNext", - "moduleResolution": "NodeNext", - "lib": ["ESNext", "DOM"], - "skipLibCheck": true, - "esModuleInterop": true, - "resolveJsonModule": true, - "allowSyntheticDefaultImports": true, - "isolatedModules": true, - "jsx": "react-jsx", - "useDefineForClassFields": true, - "noFallthroughCasesInSwitch": true, - "noUnusedLocals": false, - "noUnusedParameters": false, - "preserveWatchOutput": true, - "strict": true, - "strictNullChecks": true, - "incremental": true, - "noUncheckedIndexedAccess": true, - "noPropertyAccessFromIndexSignature": false, - "allowJs": true - }, - "include": [ - "./src/**/*.ts", - "./src/**/*.js", - "./test/**/*.ts", - "./test/**/*.js" - ], - "exclude": ["node_modules", "./dist/**/*"], - "ts-node": { - "transpileOnly": true - } -} diff --git a/tooling/typescript/package.json b/tooling/typescript/package.json deleted file mode 100644 index c00de409..00000000 --- a/tooling/typescript/package.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "name": "@codemod.com/tsconfig", - "version": "1.0.0", - "private": true, - "files": [ - "*.json" - ] -} diff --git a/tooling/utilities/package.json b/tooling/utilities/package.json deleted file mode 100644 index fb2cd1f3..00000000 --- a/tooling/utilities/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "name": "@codemod-com/utilities", - "author": "Codemod, Inc.", - "imports": { - "#*": "./src/*" - }, - "version": "1.1.8", - "description": "The utilities used across Codemod.com packages", - "type": "module", - "main": "./dist/index.js", - "module": "./dist/index.js", - "types": "./dist/index.d.ts", - "sideEffects": false, - "files": [ - "./dist", - "!**/*.test.js", - "!**/*.test.d.ts", - "LICENSE", - "README.md", - "tsconfig.json" - ], - "private": true, - "scripts": { - "build": "tsc", - "coverage": "vitest run --coverage" - }, - "keywords": [], - "license": "Apache-2.0", - "devDependencies": { - "@types/adm-zip": "catalog:", - "@types/js-beautify": "catalog:", - "@types/jscodeshift": "^0.11.11", - "@types/ms": "catalog:", - "@types/node": "20.10.3", - "@types/pako": "catalog:", - "@types/semver": "^7.5.8", - "@types/tar": "catalog:", - "@types/tar-stream": "catalog:", - "@types/unzipper": "catalog:", - "@vitest/coverage-v8": "catalog:", - "memfs": "^4.15.2", - "ts-node": "10.9.1", - "typescript": "^5.5.4", - "vitest": "^1.0.1", - "@codemod-com/tsconfig": "workspace:*" - }, - "dependencies": { - "@codemod-com/filemod": "workspace:*", - "adm-zip": "catalog:", - "change-case": "catalog:", - "glob": "catalog:", - "js-beautify": "catalog:", - "jscodeshift": "^0.15.1", - "ms": "catalog:", - "pako": "catalog:", - "prettier": "^3.2.5", - "semver": "^7.6.2", - "tar": "^6.1.15", - "tar-stream": "catalog:", - "unzipper": "catalog:", - "valibot": "catalog:" - } -} diff --git a/tooling/utilities/tsconfig.tsbuildinfo b/tooling/utilities/tsconfig.tsbuildinfo deleted file mode 100644 index 18a64f20..00000000 --- a/tooling/utilities/tsconfig.tsbuildinfo +++ /dev/null @@ -1 +0,0 @@ -{"fileNames":["../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2024.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2024.collection.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2024.object.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2024.promise.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.es2024.string.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.esnext.iterator.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/.pnpm/typescript@5.7.2/node_modules/typescript/lib/lib.decorators.legacy.d.ts","./src/constants.ts","../../node_modules/.pnpm/change-case@5.4.4/node_modules/change-case/dist/index.d.ts","../../node_modules/.pnpm/@types+js-beautify@1.14.3/node_modules/@types/js-beautify/index.d.ts","../tsconfig/base.json","../tsconfig/codemod.json","./src/functions/validation.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/classes/semver.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/parse.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/valid.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/clean.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/inc.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/diff.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/major.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/minor.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/patch.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/prerelease.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/compare.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/rcompare.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/compare-loose.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/compare-build.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/sort.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/rsort.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/gt.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/lt.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/eq.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/neq.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/gte.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/lte.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/cmp.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/coerce.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/classes/comparator.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/classes/range.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/functions/satisfies.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/ranges/max-satisfying.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/ranges/min-satisfying.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/ranges/to-comparators.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/ranges/min-version.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/ranges/valid.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/ranges/outside.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/ranges/gtr.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/ranges/ltr.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/ranges/intersects.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/ranges/simplify.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/ranges/subset.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/internals/identifiers.d.ts","../../node_modules/.pnpm/@types+semver@7.5.8/node_modules/@types/semver/index.d.ts","../../node_modules/.pnpm/valibot@0.34.0/node_modules/valibot/dist/index.d.ts","../../node_modules/.pnpm/prettier@3.4.2/node_modules/prettier/doc.d.ts","../../node_modules/.pnpm/prettier@3.4.2/node_modules/prettier/index.d.ts","./src/functions/formatting.ts","./src/schemata/argument-record.ts","./src/schemata/codemod-config.ts","./src/package-boilerplate.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/assert.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/assert/strict.d.ts","../../node_modules/.pnpm/buffer@5.7.1/node_modules/buffer/index.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/header.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/readable.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/file.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/fetch.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/formdata.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/connector.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/client.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/errors.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/dispatcher.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/global-dispatcher.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/global-origin.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/pool-stats.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/pool.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/handlers.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/balanced-pool.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/agent.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/mock-interceptor.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/mock-agent.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/mock-client.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/mock-pool.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/mock-errors.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/proxy-agent.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/api.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/cookies.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/patch.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/filereader.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/diagnostics-channel.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/websocket.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/content-type.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/cache.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/interceptors.d.ts","../../node_modules/.pnpm/undici-types@5.26.5/node_modules/undici-types/index.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/globals.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/async_hooks.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/buffer.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/child_process.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/cluster.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/console.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/constants.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/crypto.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/dgram.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/dns.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/dns/promises.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/domain.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/dom-events.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/events.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/fs.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/fs/promises.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/http.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/http2.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/https.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/inspector.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/module.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/net.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/os.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/path.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/perf_hooks.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/process.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/punycode.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/querystring.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/readline.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/readline/promises.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/repl.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/stream.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/stream/promises.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/stream/consumers.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/stream/web.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/string_decoder.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/test.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/timers.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/timers/promises.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/tls.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/trace_events.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/tty.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/url.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/util.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/v8.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/vm.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/wasi.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/worker_threads.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/zlib.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/globals.global.d.ts","../../node_modules/.pnpm/@types+node@20.10.3/node_modules/@types/node/index.d.ts","../../node_modules/.pnpm/minipass@7.1.2/node_modules/minipass/dist/esm/index.d.ts","../../node_modules/.pnpm/lru-cache@10.4.3/node_modules/lru-cache/dist/esm/index.d.ts","../../node_modules/.pnpm/path-scurry@1.11.1/node_modules/path-scurry/dist/esm/index.d.ts","../../node_modules/.pnpm/minimatch@9.0.5/node_modules/minimatch/dist/esm/ast.d.ts","../../node_modules/.pnpm/minimatch@9.0.5/node_modules/minimatch/dist/esm/escape.d.ts","../../node_modules/.pnpm/minimatch@9.0.5/node_modules/minimatch/dist/esm/unescape.d.ts","../../node_modules/.pnpm/minimatch@9.0.5/node_modules/minimatch/dist/esm/index.d.ts","../../node_modules/.pnpm/glob@10.4.5/node_modules/glob/dist/esm/pattern.d.ts","../../node_modules/.pnpm/glob@10.4.5/node_modules/glob/dist/esm/processor.d.ts","../../node_modules/.pnpm/glob@10.4.5/node_modules/glob/dist/esm/walker.d.ts","../../node_modules/.pnpm/glob@10.4.5/node_modules/glob/dist/esm/ignore.d.ts","../../node_modules/.pnpm/glob@10.4.5/node_modules/glob/dist/esm/glob.d.ts","../../node_modules/.pnpm/glob@10.4.5/node_modules/glob/dist/esm/has-magic.d.ts","../../node_modules/.pnpm/glob@10.4.5/node_modules/glob/dist/esm/index.d.ts","../../node_modules/.pnpm/ast-types@0.14.2/node_modules/ast-types/types.d.ts","../../node_modules/.pnpm/ast-types@0.14.2/node_modules/ast-types/gen/namedtypes.d.ts","../../node_modules/.pnpm/ast-types@0.14.2/node_modules/ast-types/gen/kinds.d.ts","../../node_modules/.pnpm/ast-types@0.14.2/node_modules/ast-types/gen/builders.d.ts","../../node_modules/.pnpm/ast-types@0.14.2/node_modules/ast-types/lib/types.d.ts","../../node_modules/.pnpm/ast-types@0.14.2/node_modules/ast-types/lib/path.d.ts","../../node_modules/.pnpm/ast-types@0.14.2/node_modules/ast-types/lib/scope.d.ts","../../node_modules/.pnpm/ast-types@0.14.2/node_modules/ast-types/lib/node-path.d.ts","../../node_modules/.pnpm/ast-types@0.14.2/node_modules/ast-types/lib/path-visitor.d.ts","../../node_modules/.pnpm/ast-types@0.14.2/node_modules/ast-types/gen/visitor.d.ts","../../node_modules/.pnpm/ast-types@0.14.2/node_modules/ast-types/main.d.ts","../../node_modules/.pnpm/recast@0.20.5/node_modules/recast/lib/options.d.ts","../../node_modules/.pnpm/recast@0.20.5/node_modules/recast/lib/parser.d.ts","../../node_modules/.pnpm/recast@0.20.5/node_modules/recast/lib/printer.d.ts","../../node_modules/.pnpm/recast@0.20.5/node_modules/recast/main.d.ts","../../node_modules/.pnpm/@types+jscodeshift@0.11.11/node_modules/@types/jscodeshift/src/collections/jsxelement.d.ts","../../node_modules/.pnpm/@types+jscodeshift@0.11.11/node_modules/@types/jscodeshift/src/collections/node.d.ts","../../node_modules/.pnpm/@types+jscodeshift@0.11.11/node_modules/@types/jscodeshift/src/collections/variabledeclarator.d.ts","../../node_modules/.pnpm/@types+jscodeshift@0.11.11/node_modules/@types/jscodeshift/src/collection.d.ts","../../node_modules/.pnpm/@types+jscodeshift@0.11.11/node_modules/@types/jscodeshift/src/template.d.ts","../../node_modules/.pnpm/@types+jscodeshift@0.11.11/node_modules/@types/jscodeshift/src/core.d.ts","../../node_modules/.pnpm/@types+jscodeshift@0.11.11/node_modules/@types/jscodeshift/index.d.ts","../../node_modules/.pnpm/memfs@4.15.2/node_modules/memfs/lib/encoding.d.ts","../../node_modules/.pnpm/memfs@4.15.2/node_modules/memfs/lib/constants.d.ts","../../node_modules/.pnpm/memfs@4.15.2/node_modules/memfs/lib/settimeoutunref.d.ts","../../node_modules/.pnpm/memfs@4.15.2/node_modules/memfs/lib/node/types/options.d.ts","../../node_modules/.pnpm/memfs@4.15.2/node_modules/memfs/lib/node/types/misc.d.ts","../../node_modules/.pnpm/memfs@4.15.2/node_modules/memfs/lib/dirent.d.ts","../../node_modules/.pnpm/memfs@4.15.2/node_modules/memfs/lib/node/types/fscallbackapi.d.ts","../../node_modules/.pnpm/memfs@4.15.2/node_modules/memfs/lib/node/types/fssynchronousapi.d.ts","../../node_modules/.pnpm/memfs@4.15.2/node_modules/memfs/lib/node/types/fspromisesapi.d.ts","../../node_modules/.pnpm/memfs@4.15.2/node_modules/memfs/lib/node/types/index.d.ts","../../node_modules/.pnpm/memfs@4.15.2/node_modules/memfs/lib/print/index.d.ts","../../node_modules/.pnpm/memfs@4.15.2/node_modules/memfs/lib/dir.d.ts","../../node_modules/.pnpm/memfs@4.15.2/node_modules/memfs/lib/volume.d.ts","../../node_modules/.pnpm/memfs@4.15.2/node_modules/memfs/lib/node.d.ts","../../node_modules/.pnpm/memfs@4.15.2/node_modules/memfs/lib/stats.d.ts","../../node_modules/.pnpm/memfs@4.15.2/node_modules/memfs/lib/index.d.ts","../filemod/dist/options.d.ts","../filemod/dist/types/external-commands.d.ts","../filemod/dist/unified-file-system.d.ts","../filemod/dist/api.d.ts","../filemod/dist/types/options.d.ts","../filemod/dist/types/internal-commands.d.ts","../filemod/dist/filemod.d.ts","../filemod/dist/index.d.ts","./src/registry.ts","../../node_modules/.pnpm/@types+adm-zip@0.5.7/node_modules/@types/adm-zip/util.d.ts","../../node_modules/.pnpm/@types+adm-zip@0.5.7/node_modules/@types/adm-zip/index.d.ts","../../node_modules/.pnpm/@types+pako@2.0.3/node_modules/@types/pako/index.d.ts","../../node_modules/.pnpm/minipass@4.2.8/node_modules/minipass/index.d.ts","../../node_modules/.pnpm/@types+tar@6.1.13/node_modules/@types/tar/index.d.ts","../../node_modules/.pnpm/@types+tar-stream@3.1.3/node_modules/@types/tar-stream/index.d.ts","../../node_modules/.pnpm/@types+unzipper@0.10.10/node_modules/@types/unzipper/index.d.ts","./src/functions/archive.ts","./src/functions/codemods.ts","./src/functions/crypto.ts","./src/functions/debounce.ts","./src/functions/hash.ts","./src/functions/node.ts","./src/functions/project-root.ts","./src/schemata/engine-options.ts","./src/schemata/file-commands.ts","./src/schemata/codemod.ts","./src/schemata/github-run.ts","./src/index.ts","../../node_modules/.pnpm/@types+ms@0.7.34/node_modules/@types/ms/index.d.ts","../../node_modules/.pnpm/@types+prettier@2.7.3/node_modules/@types/prettier/index.d.ts"],"fileIdsList":[[181,217,279],[252],[236,239,246,247,248,249],[239,242,250],[236,239,242,250],[236,239,242,246,247,249,250,251],[131],[167],[168,173,201],[169,180,181,188,198,209],[169,170,180,188],[171,210],[172,173,181,189],[173,198,206],[174,176,180,188],[175],[176,177],[180],[178,180],[167,180],[180,181,182,198,209],[180,181,182,195,198,201],[165,168,214],[176,180,183,188,198,209],[180,181,183,184,188,198,206,209],[183,185,198,206,209],[131,132,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216],[180,186],[187,209,214],[176,180,188,198],[189],[190],[167,191],[192,208,214],[193],[194],[180,195,196],[195,197,210,212],[168,180,198,199,200,201],[168,198,200],[198,199],[201],[202],[167,198],[180,204,205],[204,205],[173,188,198,206],[207],[188,208],[168,183,194,209],[173,210],[198,211],[187,212],[213],[168,173,180,182,191,198,209,212,214],[198,215],[84,123],[84,108,123],[123],[84],[84,109,123],[84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122],[109,123],[198,217],[181,198,215,217,282],[183,198,217],[233,234],[233],[232,234,236],[233,239,240],[232,236,237,238],[232,236,239,241],[232,236],[232],[232,233,235],[232,233,235,236,237,239,240,241],[218,220,224,225,228],[229],[220,224,227],[218,220,224,227,228,229,230],[224],[220,224,225,227],[218,220,225,226,228],[257,258,267],[254,258,267],[255,258,259,263,266,268],[180,266,268],[257,258],[255,257,258],[260,261,262],[180,181,198,255,256,257],[258],[263],[267],[180,181,198,254,255,256,257,258,259,260,263,264,265,267,268],[221,222,223],[180,198,217],[180,202,217],[181,190,217,218,219],[125],[243],[242,243,244,245],[142,146,209],[142,198,209],[137],[139,142,206,209],[188,206],[217],[137,217],[139,142,188,209],[134,135,138,141,168,180,198,209],[134,140],[138,142,168,201,209,217],[168,217],[158,168,217],[136,137,217],[142],[136,137,138,139,140,141,142,143,144,146,147,148,149,150,151,152,153,154,155,156,157,159,160,161,162,163,164],[142,149,150],[140,142,150,151],[141],[134,137,142],[142,146,150,151],[146],[140,142,145,209],[134,139,140,142,146,149],[168,198],[137,142,158,168,214,217],[270,272],[270,271,273,275],[271,272,273,274,275,276],[274],[271],[182,190,198,280,281,283,284,285],[127,129,182,190,231],[173],[126,190],[169,210],[182,190,291],[78,83,127,128,129,130,278,286,287,288,289,290,291,292,293,294,295,296],[79,80,81,82,83,129],[173,181,190,231,253,269,277],[124],[123,124,127,128],[124,128,129,293,294]],"fileInfos":[{"version":"e41c290ef7dd7dab3493e6cbe5909e0148edf4a8dad0271be08edec368a0f7b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","impliedFormat":1},{"version":"ee7bad0c15b58988daa84371e0b89d313b762ab83cb5b31b8a2d1162e8eb41c2","impliedFormat":1},{"version":"27bdc30a0e32783366a5abeda841bc22757c1797de8681bbe81fbc735eeb1c10","impliedFormat":1},{"version":"8fd575e12870e9944c7e1d62e1f5a73fcf23dd8d3a321f2a2c74c20d022283fe","impliedFormat":1},{"version":"e12a46ce14b817d4c9e6b2b478956452330bf00c9801b79de46f7a1815b5bd40","impliedFormat":1},{"version":"4fd3f3422b2d2a3dfd5cdd0f387b3a8ec45f006c6ea896a4cb41264c2100bb2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"62bb211266ee48b2d0edf0d8d1b191f0c24fc379a82bd4c1692a082c540bc6b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"936e80ad36a2ee83fc3caf008e7c4c5afe45b3cf3d5c24408f039c1d47bdc1df","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"fef8cfad2e2dc5f5b3d97a6f4f2e92848eb1b88e897bb7318cef0e2820bceaab","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"f1e2a172204962276504466a6393426d2ca9c54894b1ad0a6c9dad867a65f876","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true,"impliedFormat":1},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true,"impliedFormat":1},{"version":"959d36cddf5e7d572a65045b876f2956c973a586da58e5d26cde519184fd9b8a","affectsGlobalScope":true,"impliedFormat":1},{"version":"965f36eae237dd74e6cca203a43e9ca801ce38824ead814728a2807b1910117d","affectsGlobalScope":true,"impliedFormat":1},{"version":"3925a6c820dcb1a06506c90b1577db1fdbf7705d65b62b99dce4be75c637e26b","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a3d63ef2b853447ec4f749d3f368ce642264246e02911fcb1590d8c161b8005","affectsGlobalScope":true,"impliedFormat":1},{"version":"b5ce7a470bc3628408429040c4e3a53a27755022a32fd05e2cb694e7015386c7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true,"impliedFormat":1},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true,"impliedFormat":1},{"version":"b4b67b1a91182421f5df999988c690f14d813b9850b40acd06ed44691f6727ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"bab26767638ab3557de12c900f0b91f710c7dc40ee9793d5a27d32c04f0bf646","affectsGlobalScope":true,"impliedFormat":1},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e3c06ea092138bf9fa5e874a1fdbc9d54805d074bee1de31b99a11e2fec239d","affectsGlobalScope":true,"impliedFormat":1},{"version":"87dc0f382502f5bbce5129bdc0aea21e19a3abbc19259e0b43ae038a9fc4e326","affectsGlobalScope":true,"impliedFormat":1},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true,"impliedFormat":1},{"version":"56e4ed5aab5f5920980066a9409bfaf53e6d21d3f8d020c17e4de584d29600ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ece9f17b3866cc077099c73f4983bddbcb1dc7ddb943227f1ec070f529dedd1","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a6282c8827e4b9a95f4bf4f5c205673ada31b982f50572d27103df8ceb8013c","affectsGlobalScope":true,"impliedFormat":1},{"version":"1c9319a09485199c1f7b0498f2988d6d2249793ef67edda49d1e584746be9032","affectsGlobalScope":true,"impliedFormat":1},{"version":"e3a2a0cee0f03ffdde24d89660eba2685bfbdeae955a6c67e8c4c9fd28928eeb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"51ad4c928303041605b4d7ae32e0c1ee387d43a24cd6f1ebf4a2699e1076d4fa","affectsGlobalScope":true,"impliedFormat":1},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true,"impliedFormat":1},{"version":"61d6a2092f48af66dbfb220e31eea8b10bc02b6932d6e529005fd2d7b3281290","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"cee2b7daae2dd4d7b524a9fc70dc699f3a927f001526fb89e67b305230a9be0f","signature":"fd82c5e0d1a3a696493342cea6ed5f7fb34602ee9372cbbbf59e84f225af4639","impliedFormat":99},{"version":"aa2d47f2b18eb606f14535c47ea5322505a69682f4dee80cb63cdbd1023bb22b","impliedFormat":99},{"version":"35cd69e8415abcc14f1fb0b467de0ca9673e7f5daf52ae66a99467fdb893c0ca","impliedFormat":1},"df47aba906620c12376c3589a2cd32a999e0ca320fa18e627c3fc513e33487d4","bcd9db147005eb6dd35355009ff7b551e54e45067bb48d67f512b89326818445",{"version":"cd9f3c9f0544fe61c620218801ed2fa5c41ab3d048b15de8709ff2baf04a9158","signature":"518eaac99317a0bebe2b3c4b98140d9f49b42688e7802ac43ddcf58f8774bd47","impliedFormat":99},{"version":"cf3d384d082b933d987c4e2fe7bfb8710adfd9dc8155190056ed6695a25a559e","impliedFormat":1},{"version":"9871b7ee672bc16c78833bdab3052615834b08375cb144e4d2cba74473f4a589","impliedFormat":1},{"version":"c863198dae89420f3c552b5a03da6ed6d0acfa3807a64772b895db624b0de707","impliedFormat":1},{"version":"8b03a5e327d7db67112ebbc93b4f744133eda2c1743dbb0a990c61a8007823ef","impliedFormat":1},{"version":"86c73f2ee1752bac8eeeece234fd05dfcf0637a4fbd8032e4f5f43102faa8eec","impliedFormat":1},{"version":"42fad1f540271e35ca37cecda12c4ce2eef27f0f5cf0f8dd761d723c744d3159","impliedFormat":1},{"version":"ff3743a5de32bee10906aff63d1de726f6a7fd6ee2da4b8229054dfa69de2c34","impliedFormat":1},{"version":"83acd370f7f84f203e71ebba33ba61b7f1291ca027d7f9a662c6307d74e4ac22","impliedFormat":1},{"version":"1445cec898f90bdd18b2949b9590b3c012f5b7e1804e6e329fb0fe053946d5ec","impliedFormat":1},{"version":"0e5318ec2275d8da858b541920d9306650ae6ac8012f0e872fe66eb50321a669","impliedFormat":1},{"version":"cf530297c3fb3a92ec9591dd4fa229d58b5981e45fe6702a0bd2bea53a5e59be","impliedFormat":1},{"version":"c1f6f7d08d42148ddfe164d36d7aba91f467dbcb3caa715966ff95f55048b3a4","impliedFormat":1},{"version":"f4e9bf9103191ef3b3612d3ec0044ca4044ca5be27711fe648ada06fad4bcc85","impliedFormat":1},{"version":"0c1ee27b8f6a00097c2d6d91a21ee4d096ab52c1e28350f6362542b55380059a","impliedFormat":1},{"version":"7677d5b0db9e020d3017720f853ba18f415219fb3a9597343b1b1012cfd699f7","impliedFormat":1},{"version":"bc1c6bc119c1784b1a2be6d9c47addec0d83ef0d52c8fbe1f14a51b4dfffc675","impliedFormat":1},{"version":"52cf2ce99c2a23de70225e252e9822a22b4e0adb82643ab0b710858810e00bf1","impliedFormat":1},{"version":"770625067bb27a20b9826255a8d47b6b5b0a2d3dfcbd21f89904c731f671ba77","impliedFormat":1},{"version":"d1ed6765f4d7906a05968fb5cd6d1db8afa14dbe512a4884e8ea5c0f5e142c80","impliedFormat":1},{"version":"799c0f1b07c092626cf1efd71d459997635911bb5f7fc1196efe449bba87e965","impliedFormat":1},{"version":"2a184e4462b9914a30b1b5c41cf80c6d3428f17b20d3afb711fff3f0644001fd","impliedFormat":1},{"version":"9eabde32a3aa5d80de34af2c2206cdc3ee094c6504a8d0c2d6d20c7c179503cc","impliedFormat":1},{"version":"397c8051b6cfcb48aa22656f0faca2553c5f56187262135162ee79d2b2f6c966","impliedFormat":1},{"version":"a8ead142e0c87dcd5dc130eba1f8eeed506b08952d905c47621dc2f583b1bff9","impliedFormat":1},{"version":"a02f10ea5f73130efca046429254a4e3c06b5475baecc8f7b99a0014731be8b3","impliedFormat":1},{"version":"c2576a4083232b0e2d9bd06875dd43d371dee2e090325a9eac0133fd5650c1cb","impliedFormat":1},{"version":"4c9a0564bb317349de6a24eb4efea8bb79898fa72ad63a1809165f5bd42970dd","impliedFormat":1},{"version":"f40ac11d8859092d20f953aae14ba967282c3bb056431a37fced1866ec7a2681","impliedFormat":1},{"version":"cc11e9e79d4746cc59e0e17473a59d6f104692fd0eeea1bdb2e206eabed83b03","impliedFormat":1},{"version":"b444a410d34fb5e98aa5ee2b381362044f4884652e8bc8a11c8fe14bbd85518e","impliedFormat":1},{"version":"c35808c1f5e16d2c571aa65067e3cb95afeff843b259ecfa2fc107a9519b5392","impliedFormat":1},{"version":"14d5dc055143e941c8743c6a21fa459f961cbc3deedf1bfe47b11587ca4b3ef5","impliedFormat":1},{"version":"a3ad4e1fc542751005267d50a6298e6765928c0c3a8dce1572f2ba6ca518661c","impliedFormat":1},{"version":"f237e7c97a3a89f4591afd49ecb3bd8d14f51a1c4adc8fcae3430febedff5eb6","impliedFormat":1},{"version":"3ffdfbec93b7aed71082af62b8c3e0cc71261cc68d796665faa1e91604fbae8f","impliedFormat":1},{"version":"662201f943ed45b1ad600d03a90dffe20841e725203ced8b708c91fcd7f9379a","impliedFormat":1},{"version":"c9ef74c64ed051ea5b958621e7fb853fe3b56e8787c1587aefc6ea988b3c7e79","impliedFormat":1},{"version":"2462ccfac5f3375794b861abaa81da380f1bbd9401de59ffa43119a0b644253d","impliedFormat":1},{"version":"34baf65cfee92f110d6653322e2120c2d368ee64b3c7981dff08ed105c4f19b0","impliedFormat":1},{"version":"7d8ddf0f021c53099e34ee831a06c394d50371816caa98684812f089b4c6b3d4","impliedFormat":1},{"version":"b2641f9c8ea1d9558cab5cc067a7954875bdad3baa263f2b8cd9642b402f3ba4","impliedFormat":99},{"version":"f63cb353cd53da6be4a34f6fdece6316dac14fd62cccf9a4d2ce6bab2c37bc8c","impliedFormat":1},{"version":"a4676f40ff11a1da1d274a594b3ad1ba9c11630f7e0eeeeb91013035d47799ee","impliedFormat":1},{"version":"fe09170c472aa8055c006790e090616556f8960870eeb8b0abad3710659a24d4","signature":"2680b205fc45e71bfc4e1bbff568302283c5abbb950756fc27627c9262cc7424","impliedFormat":99},{"version":"1fa64f00e895bf2f5fc203dacd5fce50f9662a387130f346637f0d0b1dd8ac78","signature":"980c76869dc4c45375b21ff4bfeb9cf367bdfe7f6de4f2cb9985b226784a251c","impliedFormat":99},{"version":"13964cf9b02ee0637209b01ca0a01f902ce505578861365d24970840c313702d","signature":"52e341a1a33232f4b8d02a6e632c1b8e24d2166a880bb5d746f83b36dae3352e","impliedFormat":99},{"version":"212364f557a5654bf9f86c54630a800392abfaaecd5fc4597a303927d6bde861","signature":"988526584d2e636028a78bfc5954470a83eb790f22af7bff398b379e9fc7ca69","impliedFormat":99},{"version":"efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","impliedFormat":1},{"version":"7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","impliedFormat":1},{"version":"8e9c23ba78aabc2e0a27033f18737a6df754067731e69dc5f52823957d60a4b6","impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","impliedFormat":1},{"version":"3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","impliedFormat":1},{"version":"e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","impliedFormat":1},{"version":"471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","impliedFormat":1},{"version":"c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","impliedFormat":1},{"version":"40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","impliedFormat":1},{"version":"339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","impliedFormat":1},{"version":"9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","impliedFormat":1},{"version":"8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","impliedFormat":1},{"version":"4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1","impliedFormat":1},{"version":"cc5e65fb1729463665074b9d7163e78a4225b7af7f3a6b3c74492f415166612f","affectsGlobalScope":true,"impliedFormat":1},{"version":"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c","impliedFormat":1},{"version":"185282b122cbca820c297a02a57b89cf5967ab43e220e3e174d872d3f9a94d2c","affectsGlobalScope":true,"impliedFormat":1},{"version":"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","impliedFormat":1},{"version":"7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba","impliedFormat":1},{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true,"impliedFormat":1},{"version":"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","impliedFormat":1},{"version":"e8968b394e4365588f8f89cfff86435258cf10062585c1d2224627ab92acda22","impliedFormat":1},{"version":"285e512c7a0db217a0599e18c462d565fa35be4a5153dd7b80bee88c83e83ddf","impliedFormat":1},{"version":"b5b719a47968cd61a6f83f437236bb6fe22a39223b6620da81ef89f5d7a78fb7","impliedFormat":1},{"version":"8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","impliedFormat":1},{"version":"af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","impliedFormat":1},{"version":"b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e","impliedFormat":1},{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ae9dc7dbb58cd843065639707815df85c044babaa0947116f97bdb824d07204","affectsGlobalScope":true,"impliedFormat":1},{"version":"7aae1df2053572c2cfc2089a77847aadbb38eedbaa837a846c6a49fb37c6e5bd","impliedFormat":1},{"version":"313a0b063f5188037db113509de1b934a0e286f14e9479af24fada241435e707","impliedFormat":1},{"version":"1f758340b027b18ae8773ac3d33a60648a2af49eaae9e4fde18d0a0dd608642c","impliedFormat":1},{"version":"87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","impliedFormat":1},{"version":"396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","impliedFormat":1},{"version":"21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac","impliedFormat":1},{"version":"dea4c00820d4fac5e530d4842aed2fb20d6744d75a674b95502cbd433f88bcb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"a5fe4cc622c3bf8e09ababde5f4096ceac53163eefcd95e9cd53f062ff9bb67a","impliedFormat":1},{"version":"45b1053e691c5af9bfe85060a3e1542835f8d84a7e6e2e77ca305251eda0cb3c","impliedFormat":1},{"version":"0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7","impliedFormat":1},{"version":"0d832a0650a74aafc276cb3f7bb26bde2e2270a6f87e6c871a64122e9203079b","affectsGlobalScope":true,"impliedFormat":1},{"version":"c6f3869f12bb5c3bb8ecd0b050ea20342b89b944eae18d313cde6b0ccc0925d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","impliedFormat":1},{"version":"d742ed2db6d5425b3b6ac5fb1f2e4b1ed2ae74fbeee8d0030d852121a4b05d2f","impliedFormat":1},{"version":"d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","impliedFormat":1},{"version":"8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","impliedFormat":1},{"version":"01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","impliedFormat":1},{"version":"458b216959c231df388a5de9dcbcafd4b4ca563bc3784d706d0455467d7d4942","impliedFormat":1},{"version":"269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","impliedFormat":1},{"version":"93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","impliedFormat":1},{"version":"f8c87b19eae111f8720b0345ab301af8d81add39621b63614dfc2d15fd6f140a","impliedFormat":1},{"version":"831c22d257717bf2cbb03afe9c4bcffc5ccb8a2074344d4238bf16d3a857bb12","impliedFormat":1},{"version":"2225100373ca3d63bcc7f206e1177152d2e2161285a0bd83c8374db1503a0d1f","affectsGlobalScope":true,"impliedFormat":1},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true,"impliedFormat":1},{"version":"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","impliedFormat":1},{"version":"eefcdf86cefff36e5d87de36a3638ab5f7d16c2b68932be4a72c14bb924e43c1","impliedFormat":1},{"version":"7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","impliedFormat":1},{"version":"7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df","impliedFormat":1},{"version":"4d0405568cf6e0ff36a4861c4a77e641366feaefa751600b0a4d12a5e8f730a8","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5b5dc128973498b75f52b1b8c2d5f8629869104899733ae485100c2309b4c12","affectsGlobalScope":true,"impliedFormat":1},{"version":"e393915d3dc385e69c0e2390739c87b2d296a610662eb0b1cb85224e55992250","impliedFormat":1},{"version":"79bad8541d5779c85e82a9fb119c1fe06af77a71cc40f869d62ad379473d4b75","impliedFormat":1},{"version":"4a34b074b11c3597fb2ff890bc8f1484375b3b80793ab01f974534808d5777c7","impliedFormat":1},{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true,"impliedFormat":1},{"version":"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795","impliedFormat":1},{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true,"impliedFormat":1},{"version":"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447","impliedFormat":1},{"version":"4115aa147c5a64817fb55274b44087cbf1bc90f54906bfdfc9ee847a71cd91cf","impliedFormat":99},{"version":"0838507efff4f479c6f603ec812810ddfe14ab32abf8f4a8def140be970fe439","impliedFormat":99},{"version":"2612d12378afc08cbddaffce6d2cdee3c8ee1d79a6c819a417b9f1d9cf99d323","impliedFormat":99},{"version":"7212c2d58855b8df35275180e97903a4b6093d4fbaefea863d8d028da63938c6","impliedFormat":99},{"version":"de0199a112f75809a7f80ec071495159dcf3e434bc021347e0175627398264c3","impliedFormat":99},{"version":"1a2bed55cfa62b4649485df27c0e560b04d4da4911e3a9f0475468721495563f","impliedFormat":99},{"version":"854045924626ba585f454b53531c42aed4365f02301aa8eca596423f4675b71f","impliedFormat":99},{"version":"dd9faff42b456b5f03b85d8fbd64838eb92f6f7b03b36322cbc59c005b7033d3","impliedFormat":99},{"version":"6ff702721d87c0ba8e7f8950e7b0a3b009dfd912fab3997e0b63fab8d83919c3","impliedFormat":99},{"version":"9dce9fc12e9a79d1135699d525aa6b44b71a45e32e3fa0cf331060b980b16317","impliedFormat":99},{"version":"586b2fd8a7d582329658aaceec22f8a5399e05013deb49bcfde28f95f093c8ee","impliedFormat":99},{"version":"dedc0ab5f7babe4aef870618cd2d4bc43dc67d1584ee43b68fc6e05554ef8f34","impliedFormat":99},{"version":"ef1f3eadd7bed282de45bafd7c2c00105cf1db93e22f6cd763bec8a9c2cf6df1","impliedFormat":99},{"version":"3d8885d13f76ff35b7860039e83c936ff37553849707c2fd1d580d193a52be5b","impliedFormat":99},{"version":"cc2dc362fc50995684e9f7e9b38ad9bdf19e74919294a694cbc05392352cad7d","impliedFormat":1},{"version":"abef3012ae70d98baa449664e9dda50c96fc68b0fd11a592d6590d85bb89cd10","impliedFormat":1},{"version":"456e83839c811cedebb65c8b05027120336b3bd6920259817d728ffc52d41e2f","impliedFormat":1},{"version":"ea79d9641e700b2b4a04a857ed1ef692c4caf988017fbabd64c4111f7c287673","impliedFormat":1},{"version":"0a90b9435b81f45b88c5fb8d30e85b77d3508eb0760dc40b9fb825fd29f92375","impliedFormat":1},{"version":"8cd7362102d928e21b291a013f80fc68a038d4506d26ea9948c676e3fa1110d9","impliedFormat":1},{"version":"90f6830fb380f4d2b69df018343ae80ce92991e85a0d7be8d214c643b39d1175","impliedFormat":1},{"version":"1bfe6db4f3dffacd1da82748cb8f0acec04e8a4d7bd36c09573d5d80a7dec28b","impliedFormat":1},{"version":"6a8d6deca8ec4250630fea4e5f23bd9bf0face98739ccd22e08a17173117155b","impliedFormat":1},{"version":"a1d51fd5a8f9c1c038799a43c038397ca3ed99ee73cc0b0aada897e7cc8aca91","impliedFormat":1},{"version":"6c9708ae545db5f8deb8ef774d412fd1b46adade794664d7c6cfd0a1f6dfd64f","impliedFormat":1},{"version":"9d14fcf0b69094271127c7b6acb36987be5d1bffa4eb948359549f040fb50349","impliedFormat":1},{"version":"e3a5287471fb08f053c06fd998632792aa5f022e45278f1e6dd55fb2fa9e7362","impliedFormat":1},{"version":"28a6c8eeb48e165920067b9193555649fc43c2a28c450f23f622e5eb043d9463","impliedFormat":1},{"version":"1147c3efa5a256bcd6a3d2cfaf764185b7120bf985f8412d9bae596a0348f77b","impliedFormat":1},{"version":"67aee88594abc44cd58820dea2ed1a9d373c1c2a59941234e4abe797464bc4da","impliedFormat":1},{"version":"2d940af7c1b73ae897c7d2a9706914d1af5fa4fdc0c5571e3495fd75986b597e","impliedFormat":1},{"version":"f8cb94e0dffd21068a952754ec67d01d35a15fa61bd3af951f949e9b8bde7976","impliedFormat":1},{"version":"65414b42714fc6fb8d4e6d625ccc4254959a1364d48dfdd256c6b0e3cfa33787","impliedFormat":1},{"version":"3c7ef314f6691dbba43cb1310a82d610ea648cc4498cd685c3e25442ea2d98a0","impliedFormat":1},{"version":"eeaed2fc620edd14f536ff9af99acb05f400ef42ad6d69c5cbbdadbd6905f2b9","impliedFormat":1},{"version":"c97f00f075490014bb4aaf97814fecfec1ca8f7befcf06d4ff0a0b995e46ce57","impliedFormat":1},{"version":"af2a93ce5f3cd023b17bcd8e1e249a910152212d193180185cff3f9ea9c0dcd4","impliedFormat":1},{"version":"ff7cdbf6c87126a97178016c56217623b9057eb2400083c252ff81c673a71273","impliedFormat":1},{"version":"2438ed5118f6d58c8a020fca2385677e094e51562c5fcf6a5694876ce98716e5","impliedFormat":1},{"version":"46ae5dd8fc33d80f86539b7bc1852791f091e7108dc9250bece0fc2538301b84","impliedFormat":1},{"version":"df7174e55badfdbc6827288deb5950b4321bf5ab3a02147624f039492bc1eeb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce91238820b6aaa9272f38153dabc3997a3a5feae80d4f283f39cfaedf93e1fb","impliedFormat":1},{"version":"c0277c2229bde124aad3761da0a597f0bac579dbc9d99fe545a51b662b394454","impliedFormat":1},{"version":"0be53a2c2058e82a81ec15824e60f857767e114df357a846dc9d0e21b2552d4c","impliedFormat":1},{"version":"1d42a92e9cfd7c8ec3138044a5e56835f443f77ffbc1e63aba36b3b965bb63df","impliedFormat":1},{"version":"51eb2203f7a1f634c4114d4a0ff9b3c1b0a85a8fc04ee91425f7c6ea7e744fb6","impliedFormat":1},{"version":"6cfbbeeaa8483c02672f856cb5ab4c1182d46dbcb85f4f56aaed16d14b7d6e08","impliedFormat":1},{"version":"de6544688d5a6bd3453790afd376923e02acf4e7854497471172317f53117312","impliedFormat":1},{"version":"81e8ec24391a60da873b601837bd3eb401da100a84c63589f3cf5c62e6678e3a","impliedFormat":1},{"version":"5894375433e46cc951fb971ba1bfe86583e0b776ac70db8799a7d8aba69ab893","impliedFormat":1},{"version":"f7d16d528328705965dc6351ba026b892dfdf3f9542208f8888604da217bee5b","impliedFormat":1},{"version":"fa72d66b4db779c7c421e9da907525f4acd8bc317e1791c68ec843dc921642a4","impliedFormat":1},{"version":"b8f4c64fdd9c3d85c609789c10f4ff4b884c3af967dbdedbaef66ec1d29ec917","impliedFormat":99},{"version":"0d54c552f85facf3cd49d99fec028402e786d5059020cde4aac6c6c120dd08a4","impliedFormat":99},{"version":"52c31aa5303b1df12e7c0f6bdf2212ea273c74f74b68807dc0beeae149e8b1da","impliedFormat":99},{"version":"976a50d5f0b6af3ca0a3ae141e07a5f3771798fed33619ea3d66c19f09b6deee","impliedFormat":99},{"version":"b8f4c64fdd9c3d85c609789c10f4ff4b884c3af967dbdedbaef66ec1d29ec917","impliedFormat":99},{"version":"2a1ca006c0b1e49857161edf6c49b2a5677cd41a1099f2da73c91f86b18378ec","impliedFormat":99},{"version":"08e023e73fafe008de0451fcd33fa9aa6cf8131f58cf4cb250ff15c70f167f83","impliedFormat":99},{"version":"ff84509c0f447a641300f16b77884df151097b6c1632f1f3a7ae6cde9de37651","impliedFormat":99},{"version":"1fed9cd22a72280ec943bc0328e7d103430682333848bef359e7572cccc8d0d1","signature":"512ca8fff497890019bc7a3fe8f7110cdd2ec452711f94c5e5d003c60adef627","impliedFormat":99},{"version":"9063bd95bf4fe06fe71b4f1abd4dce7d41b684d9036ff4afae6e079eb252b19e","impliedFormat":1},{"version":"bb0c5cb27578678fe7a8479404efd988ceab67ff93238baf16cef721610658f7","impliedFormat":1},{"version":"c634df3e1b52761b2a219edcc61d0a7f748cdc54b93d73bcb817619452a6388a","impliedFormat":1},{"version":"58b63c0f3bfac04d639c31a9fe094089c0bdcc8cda7bc35f1f23828677aa7926","impliedFormat":1},{"version":"d51d662a37aa1f1b97ed4caf4f1c25832047b9bfffcc707b53aedd07cd245303","impliedFormat":1},{"version":"1c335c43fcd4f39e1fdf77bdc399a98fd7a783189181a8c8e8645ce51f4c26e0","impliedFormat":1},{"version":"74622088e543094948155578f4d313a69de3af52200ba96fd1cf35364c958074","impliedFormat":1},{"version":"8af4afb6b76321b3a88043bd51e450fd4a0cb66ec302752572cdce331f125c28","signature":"2313f6cb37529f62b597a8129d956c805561fe12deb88603a254a11c8d992391","impliedFormat":99},{"version":"e394ef2959f3e9d7a09bf2b528bdf1c711d5ee123ec4572cb02a53e7b10bf4c6","signature":"004fff5e52ca9747a73e4906d6d6e061d562f3afe6a1c81991e636bee8bac763","impliedFormat":99},{"version":"ec8160b21bdc77ac0000c159cc4e3258b9b00c1f6861ff4dbc5ce8756c246bd8","signature":"594f3a2b8bf1f65d2ce924c3ddfa22d88093ac69ba7d58218da09052f1dae24e","impliedFormat":99},{"version":"df2911d3950dd7107be85464f01d954771801500f1d6f3ed2a9b7492a252cb23","signature":"18afd88a7348d94f68fbdb4cb64806b53b04d63fdaa5d5e53635b97fbcbebdac","impliedFormat":99},{"version":"bb8b25fde6d287d434f0be302c9c835a289d2870a65d5186494d5de0da14dd5c","signature":"12e84aede88621044ed2fc81731e70f8cae8c298f77e9712827cd1e70941176b","impliedFormat":99},{"version":"d72ba80e1669c40cfd7176d5e4e8762a4bbde7b5bfa2a100e85e2be5b4ebcf1a","signature":"16ba6a8f6d3fdee017eeaf504583e08205236ec3f971ae98f1ee926be0561e50","impliedFormat":99},{"version":"f93d57bc18db7459ee5c7f26a0e06a3ae3d6b5af7fd0d591cb97dea0b7917773","signature":"ef70cf4eda1ab4dd234a9986094388df4368bb595d8825b121269e722ce1895d","impliedFormat":99},{"version":"c5347c5fb4a81074ea55760e684e102ff6101c90b0308160fdfeeead3afbdba7","signature":"4d7ceeeb4f45af5e5c9a9715ef862326a3e26cd018df439268a37acd64ed6320","impliedFormat":99},{"version":"d7f741d6b4f0f54658cb5b31b3c4c83b33e4296722084fbc3680bb218d1b867e","signature":"715b94114036b53824a10a16a68bccefb1fa517cdae8845d53d1ee1fee398e89","impliedFormat":99},{"version":"838b4209fa898921c55a2a72e88822b033a4627925b64fddc49b87b78d06a1dc","signature":"8acf13d97f90db633c96acdc33dcdb0d72b17a157d296a91cd6e21299f6c3f87","impliedFormat":99},{"version":"b947baddf9bfda146ffe672213e463fc5a5de56576360714179b2a5338c381eb","signature":"a34e7f883f70c6b737d4eadb36197f7af9d1462144d701ab0d141e52997132ee","impliedFormat":99},{"version":"aca113ba727c5fabee6f7aee0b80e7c16ee0c468baad1d617201c2589e05dae2","signature":"419f70e6c1fa128c634a804b1c8b8439ad9a53e7fb5f718a6ea06e6da67dcb5e","impliedFormat":99},{"version":"68cc8d6fcc2f270d7108f02f3ebc59480a54615be3e09a47e14527f349e9d53e","impliedFormat":1},{"version":"d88a5e779faf033be3d52142a04fbe1cb96009868e3bbdd296b2bc6c59e06c0e","impliedFormat":1}],"root":[78,83,[127,130],278,[286,297]],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"declarationMap":true,"esModuleInterop":true,"jsx":4,"module":199,"noFallthroughCasesInSwitch":true,"noPropertyAccessFromIndexSignature":false,"noUncheckedIndexedAccess":true,"noUnusedLocals":false,"noUnusedParameters":false,"outDir":"./dist","rootDir":"./src","skipLibCheck":true,"strict":true,"strictNullChecks":true,"target":99,"useDefineForClassFields":true},"referencedMap":[[280,1],[253,2],[250,3],[247,4],[248,5],[249,4],[252,6],[251,2],[131,7],[132,7],[167,8],[168,9],[169,10],[170,11],[171,12],[172,13],[173,14],[174,15],[175,16],[176,17],[177,17],[179,18],[178,19],[180,20],[181,21],[182,22],[166,23],[183,24],[184,25],[185,26],[217,27],[186,28],[187,29],[188,30],[189,31],[190,32],[191,33],[192,34],[193,35],[194,36],[195,37],[196,37],[197,38],[198,39],[200,40],[199,41],[201,42],[202,43],[203,44],[204,45],[205,46],[206,47],[207,48],[208,49],[209,50],[210,51],[211,52],[212,53],[213,54],[214,55],[215,56],[108,57],[109,58],[84,59],[87,59],[106,57],[107,57],[97,57],[96,60],[94,57],[89,57],[102,57],[100,57],[104,57],[88,57],[101,57],[105,57],[90,57],[91,57],[103,57],[85,57],[92,57],[93,57],[95,57],[99,57],[110,61],[98,57],[86,57],[123,62],[117,61],[119,63],[118,61],[111,61],[112,61],[114,61],[116,61],[120,63],[121,63],[113,63],[115,63],[284,64],[283,65],[285,66],[235,67],[234,68],[233,69],[241,70],[239,71],[240,72],[237,73],[238,74],[236,75],[242,76],[229,77],[230,78],[228,79],[231,80],[225,81],[226,82],[227,83],[265,84],[259,85],[269,86],[267,87],[260,88],[262,89],[261,88],[263,90],[258,91],[257,92],[264,93],[268,94],[266,95],[221,81],[222,81],[224,96],[223,81],[282,97],[218,98],[220,99],[126,100],[243,74],[244,101],[246,102],[149,103],[156,104],[148,103],[163,105],[140,106],[139,107],[162,108],[157,109],[160,110],[142,111],[141,112],[137,113],[136,114],[159,115],[138,116],[143,117],[147,117],[165,118],[164,117],[151,119],[152,120],[154,121],[150,122],[153,123],[158,108],[145,124],[146,125],[155,126],[135,127],[161,128],[273,129],[276,130],[277,131],[275,132],[272,133],[286,134],[287,135],[288,136],[127,137],[290,136],[291,138],[292,139],[297,140],[130,141],[278,142],[128,143],[129,144],[295,145],[293,143],[296,143]],"version":"5.7.2"} \ No newline at end of file diff --git a/tooling/workflow/LICENSE b/tooling/workflow/LICENSE deleted file mode 100644 index a1d2c6c5..00000000 --- a/tooling/workflow/LICENSE +++ /dev/null @@ -1,201 +0,0 @@ - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2023 Codemod, Inc. - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/tooling/workflow/README.md b/tooling/workflow/README.md deleted file mode 100644 index dd049b13..00000000 --- a/tooling/workflow/README.md +++ /dev/null @@ -1 +0,0 @@ -# Workflow diff --git a/tooling/workflow/build.js b/tooling/workflow/build.js deleted file mode 100644 index d4274677..00000000 --- a/tooling/workflow/build.js +++ /dev/null @@ -1,35 +0,0 @@ -import { build } from "esbuild"; - -build({ - entryPoints: ["./src/index.ts"], - bundle: true, - minify: true, - platform: "node", - target: "node18", - format: "esm", - legalComments: "inline", - outfile: "./dist/index.mjs", - external: [ - "@ast-grep/napi", - "@ast-grep/cli", - "@sindresorhus/slugify", - "colors-cli", - "filenamify", - "glob", - "lodash", - "magic-string", - "openai", - "simple-git", - "tree-kill", - "ts-invariant", - "prettier", - "jscodeshift", - "yaml", - "inquirer", - "detect-indent", - "detect-newline", - "@octokit/rest", - "git-url-parse", - "diff", - ], -}); diff --git a/tooling/workflow/examples/codemod@2.0.ts b/tooling/workflow/examples/codemod@2.0.ts deleted file mode 100644 index 83203d2b..00000000 --- a/tooling/workflow/examples/codemod@2.0.ts +++ /dev/null @@ -1,30 +0,0 @@ -import type { Api } from "../src/index.js"; - -export async function workflow({ files }: Api) { - await files(`**/*.input.ts`).jsFam().astGrep("$SCHEMA($$$REST, [$$$ACTIONS])") - .ai` - SCHEMA could be one of 'any', 'array', 'bigint', 'blob', 'boolean', 'custom', 'date', 'enum_', 'instance', 'intersect', - 'lazy', 'literal', 'looseObject', 'looseTuple', 'map', 'nan', 'never', 'nonNullable', 'nonNullish', 'nonOptional', - 'null_', 'nullable', 'nullish', 'number', 'object', 'objectWithRest', 'optional', 'picklist', 'record', 'set', - 'strictObject', 'strictTuple', 'string', 'symbol', 'tuple', 'tupleWithRest', 'undefined_', 'union', 'unknown', 'variant', - 'void_' - ACTIONS is array of calls to one of 'bic', 'brand', 'bytes', 'check', 'creditCard', 'cuid2', 'decimal', 'email', - 'emoji', 'empty', 'endsWith', 'every', 'excludes', 'finite', 'hash', 'hexadecimal', 'hexColor', 'imei', 'includes', - 'integer', 'ip', 'ipv4', 'ipv6', 'isoDate', 'isoDateTime', 'isoTime', 'isoTimeSecond', 'isoTimestamp', 'isoWeek', - 'length', 'mac', 'mac48', 'mac64', 'maxBytes', 'maxLength', 'maxSize', 'maxValue', 'mimeType', 'minBytes', - 'minLength', 'minSize', 'minValue', 'multipleOf', 'nonEmpty', 'notBytes', 'notLength', 'notSize', 'notValue', 'octal', - 'readonly', 'regex', 'safeInteger', 'size', 'some', 'startsWith', 'toLowerCase', 'toMaxValue', 'toMinValue', 'toUpperCase', - 'transform', 'trim', 'trimEnd', 'trimStart', 'ulid', 'url', 'uuid', 'value', 'forward' - - If $SCHEMA is not one of SCHEMA, skip - If $$$ACTIONS is not one of ACTIONS, skip - - If skipping - return same string - - Take into account recursive replacements - - Example - Before: v.string('some string', [v.email()]) - After: v.pipe(v.string('some string'), v.email()) - `; -} diff --git a/tooling/workflow/examples/git-example.ts b/tooling/workflow/examples/git-example.ts deleted file mode 100644 index afdc6af9..00000000 --- a/tooling/workflow/examples/git-example.ts +++ /dev/null @@ -1,11 +0,0 @@ -import type { Api } from "../src/index.js"; - -export async function workflow({ git }: Api) { - await git - .clone("git@github.com:codemod-com/codemod.git") - .branch("convert-console-log-to-error") - .files() - .jsFam() - .astGrep("console.log($$$ARGS)") - .replace("console.error($$$ARGS)"); -} diff --git a/tooling/workflow/examples/github.ts b/tooling/workflow/examples/github.ts deleted file mode 100644 index 73f8f9e7..00000000 --- a/tooling/workflow/examples/github.ts +++ /dev/null @@ -1,21 +0,0 @@ -import type { Api } from "../src/index.js"; - -export async function workflow({ github }: Api) { - await github.fork`git@github.com:codemod-com/codemod.git`.clone( - async ({ branch, codemod, commit, push, pr }) => { - await branch("pnpm-catalog"); - await codemod("pnpm/catalog"); - await commit("migration to pnpm catalog"); - await push(); - await pr({ - title: "chore: pnpm catalog migration", - body: `# Migration to pnpm catalog -## Updated description -This PR migrates to the [pnpm catalog](https://pnpm.io/catalogs), a new feature that is available starting pnpm@9.5.0 -Using [pnpm catalog codemod](https://codemod.com/registry/pnpm-catalog). -PR is safe to merge. -`, - }); - }, - ); -} diff --git a/tooling/workflow/package.json b/tooling/workflow/package.json deleted file mode 100644 index 82e6d1bb..00000000 --- a/tooling/workflow/package.json +++ /dev/null @@ -1,67 +0,0 @@ -{ - "name": "@codemod.com/workflow", - "author": "Codemod, Inc.", - "type": "module", - "version": "0.0.31", - "description": "Workflow Engine for Codemod", - "main": "./dist/index.mjs", - "types": "./dist/index.d.ts", - "sideEffects": false, - "private": false, - "files": [ - "./dist", - "!**/*.test.js", - "!**/*.test.d.ts", - "LICENSE", - "README.md" - ], - "scripts": { - "build": "tsc && node ./build.js", - "prepublish": "cp package.json package.json.bak && jq 'del(.devDependencies)' package.json.bak > package.json", - "postpublish": "rm package.json && mv package.json.bak package.json" - }, - "keywords": [], - "license": "Apache-2.0", - "repository": { - "type": "git", - "url": "https://github.com/codemod-com/codemod.git", - "directory": "packages/workflow" - }, - "dependencies": { - "@ast-grep/cli": "catalog:", - "@ast-grep/napi": "catalog:", - "@octokit/rest": "catalog:", - "@sindresorhus/slugify": "catalog:", - "@types/jscodeshift": "^0.11.6", - "colors-cli": "catalog:", - "detect-indent": "catalog:", - "detect-newline": "catalog:", - "filenamify": "catalog:", - "glob": "catalog:", - "git-url-parse": "catalog:", - "jscodeshift": "^0.15.0", - "lodash-es": "catalog:", - "magic-string": "catalog:", - "openai": "catalog:", - "prettier": "^3.2.5", - "simple-git": "catalog:", - "tree-kill": "catalog:", - "ts-invariant": "catalog:", - "yaml": "catalog:", - "inquirer": "catalog:", - "diff": "catalog:" - }, - "devDependencies": { - "@codemod-com/utilities": "workspace:*", - "@types/lodash-es": "catalog:", - "esbuild": "^0.17.14", - "typescript": "^5.2.2", - "@types/inquirer": "catalog:", - "simple-git": "^3.24.0", - "tree-kill": "^1.2.2", - "ts-invariant": "^0.10.3", - "yaml": "^2.4.5", - "@types/git-url-parse": "^9.0.3", - "@types/diff": "catalog:" - } -} diff --git a/tooling/workflow/src/PLazy.ts b/tooling/workflow/src/PLazy.ts deleted file mode 100644 index 30406210..00000000 --- a/tooling/workflow/src/PLazy.ts +++ /dev/null @@ -1,65 +0,0 @@ -// https://github.com/sindresorhus/p-lazy -// @ts-ignore -export class PLazy extends Promise { - #executor; - #promise?: Promise; - - constructor( - executor: ( - resolve: (resolvedValue: ValueType) => void, - reject: (error: any) => void, - ) => void, - ) { - super((resolve) => { - // @ts-ignore - resolve(); - }); - - this.#executor = executor; - } - - // @ts-ignore - static from(function_) { - // @ts-ignore - return new PLazy((resolve) => { - resolve(function_()); - }); - } - - // @ts-ignore - static resolve(value) { - // @ts-ignore - return new PLazy((resolve) => { - resolve(value); - }); - } - - // @ts-ignore - static reject(error) { - // @ts-ignore - return new PLazy((resolve, reject) => { - reject(error); - }); - } - - // biome-ignore lint/suspicious/noThenProperty: - override then( - onFulfilled: - | ((resolvedValue: ValueType) => TResult1 | PromiseLike) - | null - | undefined, - onRejected: - | ((error: any) => TResult2 | PromiseLike) - | null - | undefined, - ) { - this.#promise ??= new Promise(this.#executor); - return this.#promise.then(onFulfilled, onRejected); - } - - // @ts-ignore - catch(onRejected) { - this.#promise = this.#promise || new Promise(this.#executor); - return this.#promise.catch(onRejected); - } -} diff --git a/tooling/workflow/src/ai/ai.ts b/tooling/workflow/src/ai/ai.ts deleted file mode 100644 index 7f37232b..00000000 --- a/tooling/workflow/src/ai/ai.ts +++ /dev/null @@ -1,244 +0,0 @@ -import { mapValues } from "lodash-es"; -import OpenAI from "openai"; -import type { PLazy } from "../PLazy.js"; -import { getAstGrepNodeContext, getFileContext } from "../contexts.js"; -import { FileContext } from "../contexts/FileContext.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { clc } from "../helpers.js"; - -const SYSTEM_PROMPT = ` -You are a meticulous engineer assigned to migrate a codebase by updating its code when necessary. - -When you write code, the code works on the first try, and is complete. Take into account the current repository's language, code style, and dependencies. - -You will be given a Context File, a Migration Description and a Source File. You will rewrite the Source File in order to apply the changes described in the Migration Description. - -You will use a Context File to understand the codebase and the Migration Description to apply the changes. -Context file will be surrounded by triple single quotes like this: -''' -context file here -''' - -If a line of code is not affected by the migration, you should keep it as it is. - -Source file will be split into multiple parts, each part starts with a comment like this: -// codemod#ai#0 -part code here -// codemod#ai#0 -where 0 is a number that represents the part number. - -You must print the modified Source File in the following format: - -\`\`\` -modified Source File -\`\`\` - -You must preserve parts naming and order. -`; - -type CodeSample = { - filename: string; - contents: string; - startPosition: number; - endPosition: number; - text: string; -}; - -class AiHandler { - private beforesSamples: Record = {}; - public query: string | undefined; - private _usage: OpenAI.Completions.CompletionUsage = { - completion_tokens: 0, - prompt_tokens: 0, - total_tokens: 0, - }; - - constructor(private userPrompt: string) {} - - addBefore(before: CodeSample) { - this.beforesSamples[before.filename] ??= []; - this.beforesSamples[before.filename]?.push(before); - } - - private get prompts() { - return mapValues( - this.beforesSamples, - (samples) => ` -You are migrating a code, which matches ast-grep pattern: -${this.query ?? ""} - -Context file: -''' -${samples[0]?.contents} -''' - -${this.userPrompt} - -${samples - .map( - (before, index) => ` -// codemod#ai#${index} -${before.text} -// codemod#ai#${index} - -`, - ) - .join("")}`, - ); - } - - public get usage() { - return this._usage; - } - - public static getReplacements(completionText?: string | null) { - // Match code block inside ``` and replace those quotes with empty string - const code = completionText - ?.match(/```([\s\S]*?)```/g)?.[0] - ?.replace(/^```/g, "") - ?.replace(/```$/g, ""); - - const replacements: string[] = []; - const parts = code?.split("\n") ?? []; - let currentIndex = -1; - let currentCode = ""; - for (const part of parts) { - const index = Number.parseInt( - part.match(/\/\/ codemod#ai#(\d+)/)?.[1] ?? "", - 10, - ); - if (!Number.isNaN(index)) { - if (currentIndex === index) { - replacements.push(currentCode); - currentCode = ""; - } else { - currentIndex = index; - } - continue; - } - - currentCode += part; - } - - return replacements; - } - - async execute() { - const apiKey = process.argv - .find((arg) => arg.startsWith("--OPENAI_API_KEY=")) - ?.replace("--OPENAI_API_KEY=", ""); - if (!apiKey) { - console.error( - `Please set OPENAI_API_KEY environment variable like "codemod ... --OPENAI_API_KEY=YOUR_API_KEY"`, - ); - process.exit(1); - } - const openai = new OpenAI({ apiKey }); - - await Promise.all( - Object.entries(this.prompts).map(async ([filename, prompt]) => { - const response = await openai.chat.completions.create({ - model: "gpt-4-turbo", - seed: 7, - messages: [ - { role: "system", content: SYSTEM_PROMPT }, - { role: "user", content: prompt }, - ], - temperature: 0.001, - n: 1, - }); - const usage = response?.usage; - if (usage) { - this._usage.completion_tokens += usage.completion_tokens; - this._usage.prompt_tokens += usage.prompt_tokens; - this._usage.total_tokens += usage.total_tokens; - } - const completion = response?.choices[0]?.message.content; - const replacements = AiHandler.getReplacements(completion); - const foundReplacements: { - startPosition: number; - endPosition: number; - text: string; - }[] = []; - const beforeSamples = this.beforesSamples[filename] ?? []; - for (let i = 0; i < beforeSamples.length; i++) { - const before = beforeSamples[i] as CodeSample; - const after = replacements[i] as string; - foundReplacements.push({ - startPosition: before.startPosition, - endPosition: before.endPosition, - text: after, - }); - } - if (foundReplacements.length) { - try { - const fileContext = new FileContext({ file: filename }); - for (const replacement of foundReplacements) { - await fileContext.update({ - start: replacement.startPosition, - end: replacement.endPosition, - replacement: replacement.text, - }); - } - await fileContext.save(); - } catch (e) { - // - } - } - }), - ); - - console.log( - `Codemod2.0 ${clc.blueBright("usage")}: ${clc.green("Prompt tokens")}(${ - this._usage.prompt_tokens - }), ${clc.green("Completion tokens")}(${ - this._usage.completion_tokens - }), ${clc.green("Total tokens")}(${this._usage.total_tokens})`, - ); - } -} - -export type AiReturn = PLazy & AiHelpers; - -/** - * @description Replaces code found with `ast-grep` pattern using instructions provided to LLM. Whole file would be passed as a context. Currently, it only supports OpenAI's GPT-4 Turbo model. You will have to provide your OpenAI API key to use this function when you call codemod in CLI - provide `--OPENAI_API_KEY`. - * @param prompt - The prompt to be used for LLM. - * @example - * ```ts - * await files() - * .astGrep('console.log($$$A)') - * .ai`Convert console.log to console.error` - * ``` - */ -export function aiLogic(rawPrompt: string | readonly string[]): AiReturn { - const prompt = typeof rawPrompt === "string" ? rawPrompt : rawPrompt.join(""); - const aiHandler = new AiHandler(prompt); - - return new FunctionExecutor("ai") - .arguments(() => ({ prompt })) - .helpers(aiHelpers) - .executor(async () => { - const { node, query } = getAstGrepNodeContext(); - const fileContext = getFileContext(); - const range = node.range(); - aiHandler.query = - typeof query === "string" ? query : JSON.stringify(query); - aiHandler.addBefore({ - filename: fileContext.file, - contents: await fileContext.contents(), - startPosition: range.start.index, - endPosition: range.end.index, - text: node.text(), - }); - }) - .return(async (self) => { - await aiHandler.execute(); - return self.wrappedHelpers(); - }) - .run(); -} - -export const ai = fnWrapper("ai", aiLogic); - -const aiHelpers = {}; -type AiHelpers = typeof aiHelpers; diff --git a/tooling/workflow/src/astGrep/astGrep.ts b/tooling/workflow/src/astGrep/astGrep.ts deleted file mode 100644 index 9b69942e..00000000 --- a/tooling/workflow/src/astGrep/astGrep.ts +++ /dev/null @@ -1,381 +0,0 @@ -import * as childProcess from "node:child_process"; -import * as fs from "node:fs/promises"; -import * as path from "node:path"; -import * as util from "node:util"; -import { Lang, type NapiConfig, SgNode, parse } from "@ast-grep/napi"; -import * as YAML from "yaml"; -import type { PLazy } from "../PLazy.js"; -import { ai } from "../ai/ai.js"; -import { - type AstGrepNodeContext, - astGrepNodeContext, - getFileContext, -} from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { clc } from "../helpers.js"; -import { exists } from "./exists.js"; -import { filter } from "./filter.js"; -import { map } from "./map.js"; -import { replace } from "./replace.js"; - -export { SgNode }; - -const fileExtensionToLang: Record = { - css: Lang.Css, - html: Lang.Html, - js: Lang.JavaScript, - jsx: Lang.JavaScript, - mjs: Lang.JavaScript, - mts: Lang.TypeScript, - cjs: Lang.JavaScript, - cts: Lang.TypeScript, - ts: Lang.TypeScript, - "d.ts": Lang.TypeScript, - tsx: Lang.Tsx, - sh: Lang.Bash, - c: Lang.C, - h: Lang.C, - cpp: Lang.Cpp, - hpp: Lang.Cpp, - cs: Lang.CSharp, - dart: Lang.Dart, - ex: Lang.Elixir, - exs: Lang.Elixir, - go: Lang.Go, - java: Lang.Java, - json: Lang.Json, - kt: Lang.Kotlin, - lua: Lang.Lua, - php: Lang.Php, - py: Lang.Python, - py3: Lang.Python, - rb: Lang.Ruby, - rs: Lang.Rust, - scala: Lang.Scala, - swift: Lang.Swift, - // TODO: remove after will be supported in ast-grep - // @ts-ignore - sql: Lang.Sql, - // @ts-ignore - psql: Lang.Sql, - // @ts-ignore - mysql: Lang.Sql, -}; - -type AstGrepPattern = - | string - | { - selector: string; - context: string; - strictness?: "cst" | "smart" | "ast" | "relaxed" | "signature"; - }; -type AstGrepStopBy = "end" | "neighbour" | AstGrepInsideRule; -type AstGrepInsideRule = { - pattern: AstGrepPattern; - stopBy?: AstGrepStopBy; - field?: string; -}; -type AstGrepHasRule = { - kind: string; - stopBy?: AstGrepStopBy; - field?: string; -}; -type AstGrepSiblingRule = { - kind: string; - stopBy?: AstGrepStopBy; -}; -type AstGrepAtomicRule = { - pattern: AstGrepPattern; - kind?: string; - regex?: string; - inside?: AstGrepInsideRule; - has?: AstGrepHasRule; - precedes?: AstGrepSiblingRule; - follows?: AstGrepSiblingRule; -}; -type AstGrepAllRule = { - all: AstGrepRules[]; -}; -type AstGrepAnyRule = { - any: AstGrepRules[]; -}; -type AstGrepNotRule = { - not: AstGrepRules; -}; -type AstGrepMatchRule = { - match: string; -}; -type AstGrepRules = - | AstGrepAtomicRule - | AstGrepAllRule - | AstGrepAnyRule - | AstGrepNotRule - | AstGrepMatchRule; - -type AstGrepAPI = { - id: string; - language: - | "Bash" - | "C" - | "Cpp" - | "CSharp" - | "Css" - | "Dart" - | "Elixir" - | "Go" - | "Html" - | "Java" - | "JavaScript" - | "Json" - | "Kotlin" - | "Lua" - | "Php" - | "Python" - | "Ruby" - | "Rust" - | "Scala" - | "Swift" - | "TypeScript" - | "Tsx"; - rule: AstGrepRules; - utils?: any; - fix?: any; -}; - -const execFile = util.promisify(childProcess.execFile); - -const runExternalAstGrepRule = async (rule: any, filepath: string) => { - const packageJsonFilepath = require.resolve("@ast-grep/cli/package.json"); - const { bin: binaries } = JSON.parse( - await fs.readFile(packageJsonFilepath, "utf-8"), - ); - const binaryPath = path.join( - path.dirname(require.resolve("@ast-grep/cli/package.json")), - binaries.sg, - ); - await execFile(binaryPath, [ - "scan", - "--update-all", - "--inline-rules", - JSON.stringify(rule), - filepath, - ]); -}; - -export type AstGrepHelpers = typeof astGrepHelpers; -export type AstGrepAPIHelpers = typeof astGrepAPIHelpers; - -/** - * @description Search for a pattern in the file using [ast-grep](https://ast-grep.github.io/). There are 2 ways to use this function: controlled and uncontrolled. If you will provide `id` in the `query` object - it will be passed to ast-grep CLI (`uncontrolled` mode). In all other cases `controlled` mode will be used with Napi (Node.js bindings to Rust). - * @param query It could be a string, string literal, [NapiConfig object](https://ast-grep.github.io/reference/api.html#napiconfig) - * @example - * ```ts - * // Pass parameter as string - * await astGrep("import React from 'react'") - * ``` - * @example - * ```ts - * // Pass parameter as string literal - * await astGrep`import React from 'react'` - * ``` - * @example - * ```ts - * // Pass parameter as NapiConfig - * await astGrep({ - * rule: { - * pattern: { - * context: "import React from 'react'", - * strictness: "relaxed", - * }, - * }, - * }) - * ``` - * @example - * ```ts - * // Pass parameter as YAML string literal - * await astGrep` - * rule: - * pattern: - * context: "import React from 'react'" - * strictness: "relaxed" - * ` - * ``` - * @see {@link map} - * @see {@link filter} - * @see {@link exists} - * @see {@link replace} - * @see {@link ai} - */ -export function astGrepLogic( - query: string | readonly string[] | NapiConfig, -): ReturnType; - -/** - * @description Search for a pattern in the file using [ast-grep](https://ast-grep.github.io/). There are 2 ways to use this function: controlled and uncontrolled. If you will provide `id` in the `query` object - it will be passed to ast-grep CLI (`uncontrolled` mode). In all other cases `controlled` mode will be used with Napi (Node.js bindings to Rust). - * @description This function is used for `uncontrolled` mode. You can chain call multiple `astGrep` functions to search for multiple patterns in the file using this mode. - * @param query It could be a string, string literal, [NapiConfig object](https://ast-grep.github.io/reference/api.html#napiconfig) - * @example - * ```ts - * // Pass directly to ast-grep CLI - * await astGrep({ - * id: "unique-id", - * rule: { - * pattern: { - * context: "import React from 'react'", - * strictness: "relaxed", - * }, - * }, - * fix: "import * as React from 'react'", - * }) - * ``` - * @example - * ```ts - * // Chain call - * await astGrep({ - * id: "unique-id", - * rule: { - * pattern: { - * context: "import React from 'react'", - * strictness: "relaxed", - * }, - * }, - * fix: "import * as React from 'react'", - * }) - * .astGrep({ - * id: "another-unique-id", - * rule: { - * pattern: { - * context: "import { useState } from 'react'", - * strictness: "relaxed", - * }, - * }, - * fix: "import { useRef } from 'react'", - * }) - * ``` - */ -export function astGrepLogic(apiQuery: AstGrepAPI): ReturnTypeAPI; - -/** - * @description Search for a pattern in the file using [ast-grep](https://ast-grep.github.io/). There are 2 ways to use this function: controlled and uncontrolled. If you will provide `id` in the `query` object - it will be passed to ast-grep CLI (`uncontrolled` mode). In all other cases `controlled` mode will be used with Napi (Node.js bindings to Rust). - * @param query It could be a string, string literal, [NapiConfig object](https://ast-grep.github.io/reference/api.html#napiconfig) - * @param callback Function which will be called for each found node wich accepts one argument - object with helpers, which could be used to manipulate the found nodes. Callback will have all the helpers that `astGrep` returns, like `map`, `replace` etc... - * @example - * ```ts - * // Use callback - * await astGrep("console.log($$$ARGS)", async ({ map, replace }) => { - * console.log(`Found code occurencies: ${(await map(({ getNode }) => getNode().text())).join(", ")}`); - * await replace("console.error($$$ARGS)"); - * }) - * ``` - * @see {@link map} - * @see {@link filter} - * @see {@link exists} - * @see {@link replace} - * @see {@link ai} - */ -export function astGrepLogic( - query: string | readonly string[] | NapiConfig, - callback: (helpers: AstGrepHelpers) => Promise | void, -): ReturnType; -export function astGrepLogic< - Q extends string | readonly string[] | NapiConfig | AstGrepAPI, - H = Q extends AstGrepAPI ? AstGrepAPIHelpers : AstGrepHelpers, ->( - query: Q, - callback?: (helpers: AstGrepHelpers) => Promise | void, - // @ts-ignore -): Promise & H { - return new FunctionExecutor("astGrep") - .arguments(() => { - let grep: string | NapiConfig | AstGrepAPI = query as string; - if (typeof query === "object") { - grep = Array.isArray(query) - ? query.join("") - : (query as NapiConfig | AstGrepAPI); - } - return { grep, callback }; - }) - .helpers((self) => { - const { grep } = self.getArguments(); - if (typeof grep === "object" && "id" in grep) { - return astGrepAPIHelpers; - } - - return astGrepHelpers; - }) - .return((self) => self.wrappedHelpers()) - .executor(async (next, self) => { - const fileContext = getFileContext(); - const { grep, callback } = self.getArguments(); - let napiConfig: NapiConfig | AstGrepAPI; - if (typeof grep === "string") { - try { - napiConfig = YAML.parse(grep); - } catch (e) { - napiConfig = { - rule: { - pattern: { - context: grep, - strictness: "relaxed", - }, - }, - }; - } - } else { - napiConfig = grep; - } - - if (typeof grep === "object" && "id" in grep) { - await runExternalAstGrepRule( - napiConfig as AstGrepAPI, - fileContext.file, - ); - } else { - if (!fileContext.extension) { - return; - } - const lang = fileExtensionToLang[fileContext.extension]; - if (!lang) { - console.warn( - `${clc.yellow("WARN")} Unsupported file extension: ${fileContext.extension}`, - ); - return; - } - const nodes = parse(lang, await fileContext.contents()) - .root() - .findAll(napiConfig as NapiConfig) - .reverse(); - const astContext = { query: grep } as AstGrepNodeContext; - - for (const node of nodes) { - if (next) { - astContext.node = node; - await astGrepNodeContext.run(astContext, async () => { - await callback?.(astGrepHelpers); - return await next(); - }); - } - } - - await fileContext.save(); - } - }) - .run() as any; -} - -export const astGrep = fnWrapper("astGrep", astGrepLogic); - -export type ReturnType = PLazy & AstGrepHelpers; -export type ReturnTypeAPI = PLazy & AstGrepAPIHelpers; - -const astGrepHelpers = { - replace, - map, - ai, - filter, - exists, -}; - -const astGrepAPIHelpers = { - astGrep, -}; diff --git a/tooling/workflow/src/astGrep/exists.ts b/tooling/workflow/src/astGrep/exists.ts deleted file mode 100644 index e9d627c6..00000000 --- a/tooling/workflow/src/astGrep/exists.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; - -/** - * @description Returns true if astGrep found at least one node that matches the given query. - * @example - * ```ts - * // Check if there is at least one console.log in the code - * const areConsoleLogExist = await astGrep`console.log($$$A)` - * .exists() - * ``` - */ -export function existsLogic(): Promise { - let result = false; - return new FunctionExecutor("exists") - .executor(async (next, self) => { - result = true; - await next?.(); - }) - .return(() => result) - .run(); -} - -export const exists = fnWrapper("exists", existsLogic); diff --git a/tooling/workflow/src/astGrep/filter.ts b/tooling/workflow/src/astGrep/filter.ts deleted file mode 100644 index 9fe7831d..00000000 --- a/tooling/workflow/src/astGrep/filter.ts +++ /dev/null @@ -1,58 +0,0 @@ -import type { PLazy } from "../PLazy.js"; -import { ai } from "../ai/ai.js"; -import { getAstGrepNodeContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { exists } from "./exists.js"; -import { map } from "./map.js"; -import { replace } from "./replace.js"; - -const callbackHelpers = { - getNode: () => getAstGrepNodeContext().node, - getMatch: (m: string) => getAstGrepNodeContext().node.getMatch(m), - getMultipleMatches: (m: string) => - getAstGrepNodeContext().node.getMultipleMatches(m), -}; - -export type CallbackHelpers = typeof callbackHelpers; - -export type FilterReturn = PLazy & Helpers; - -/** - * @description Filter the nodes found with astGrep using callback function. If function returns true - node will be included in the result, otherwise - excluded. - * @param callback - Callback function that will be executed for each node found with astGrep. If function returns true - node will be included in the result, otherwise - excluded. - * @example - * ```ts - * // Replace all console.log calls with "2" where the first argument is "1" - * await astGrep`console.log($A)` - * .filter(({ getMatch }) => getMatch("A") === "1") - * .replace`console.log(2)` - * ``` - * @see {@link map} - * @see {@link replace} - * @see {@link filter} - * @see {@link exists} - * @see {@link ai} - */ -export function filterLogic( - callback: (helpers: CallbackHelpers) => Promise | boolean, -): FilterReturn { - return new FunctionExecutor("replace") - .arguments(() => { - return { callback }; - }) - .helpers(() => helpers) - .return((self) => self.wrappedHelpers()) - .executor(async (next, self) => { - const { callback } = self.getArguments(); - if (await callback(self.wrapHelpers(callbackHelpers))) { - await next(); - } - }) - .run(); -} - -export const filter = fnWrapper("filter", filterLogic); - -const helpers = { map, filter, replace, ai, exists }; - -type Helpers = typeof helpers; diff --git a/tooling/workflow/src/astGrep/getImports.ts b/tooling/workflow/src/astGrep/getImports.ts deleted file mode 100644 index a0676faa..00000000 --- a/tooling/workflow/src/astGrep/getImports.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { astGrep } from "./astGrep.js"; - -/** - * Same as astGrep, but searches with single and double quotes - * @deprecated - * @example - * ```ts - * await getImports("import React from 'react'"); - * // is equal to - * await astGrep("import React from 'react'"); - * // and - * await astGrep('import React from "react"'); - * ``` - */ -export function getImports(source: string) { - return astGrep({ - rule: { - any: [ - { pattern: source.replace(/"/g, "'") }, - { pattern: source.replace(/'/g, '"') }, - ], - }, - }); -} diff --git a/tooling/workflow/src/astGrep/map.ts b/tooling/workflow/src/astGrep/map.ts deleted file mode 100644 index bcab8d5e..00000000 --- a/tooling/workflow/src/astGrep/map.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { getAstGrepNodeContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; - -/** - * @description Map each found with astGrep node and return resulting array. Could be used to retrieve some information from code. - * @param callback - Callback function that will be called for each found node. - * @example - * ```ts - * // Retrieve first argument for every console.log expression - * await astGrep`console.log($A)` - * .map(({ getMatch }) => getMatch('A')) - * ``` - */ -export function mapLogic< - CALLBACK extends ( - helpers: Helpers, - ) => ReturnType | Promise>, - RETURN extends ReturnType, ->(callback: CALLBACK): Promise { - const response = [] as RETURN[]; - return new FunctionExecutor("map") - .helpers(helpers) - .arguments(() => ({ callback })) - .executor(async (next, self) => { - const { callback } = self.getArguments(); - const result = await callback(helpers); - response.push(result as RETURN); - await next?.(); - }) - .return(() => response) - .run(); -} - -export const map = fnWrapper("map", mapLogic); - -const helpers = { - getNode: () => getAstGrepNodeContext().node, - getMatch: (m: string) => getAstGrepNodeContext().node.getMatch(m), - getMultipleMatches: (m: string) => - getAstGrepNodeContext().node.getMultipleMatches(m), -}; - -export type Helpers = typeof helpers; diff --git a/tooling/workflow/src/astGrep/replace.ts b/tooling/workflow/src/astGrep/replace.ts deleted file mode 100644 index ee0e813a..00000000 --- a/tooling/workflow/src/astGrep/replace.ts +++ /dev/null @@ -1,119 +0,0 @@ -import type { PLazy } from "../PLazy.js"; -import { getAstGrepNodeContext, getFileContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { map } from "./map.js"; - -const callbackHelpers = { - getNode: () => getAstGrepNodeContext().node, - getMatch: (m: string) => getAstGrepNodeContext().node.getMatch(m), - getMultipleMatches: (m: string) => - getAstGrepNodeContext().node.getMultipleMatches(m), -}; - -export type CallbackHelpers = typeof callbackHelpers; - -export type ReplaceReturn = PLazy & Helpers; - -/** - * @description Replace every found with astGrep node with the replacement string (or template literal). String can contain single match or multiple matches. - * @param replacement The replacement string or template literal - * @example - * ```ts - * // Replace every console.log with remove message - * await astGrep`console.log($$$A)` - * .replace('∕* removed console.log *∕') - * ``` - * @example - * ```ts - * // Replace every console.log with console.error - * await astGrep`console.log($$$A)` - * .replace`console.error($$$A)` - * ``` - */ -export function replaceLogic( - rawReplacement: string | Readonly, -): ReplaceReturn; - -/** - * @description Replace every found with astGrep node with the replacement string (or template literal) using callback. - * @param callback The callback function that returns the replacement string or template literal. First argument is the helpers object, which has getNode, getMatch and getMultipleMatches functions. - * @example - * ```ts - * // Replace every console.log with remove message - * await astGrep`console.log($$$A)` - * .replace(({ getMultipleMatches }) => - * `console.error(${getMultipleMatches('A').join(', ')}`) - * ``` - */ -export function replaceLogic( - callback: ( - helpers: CallbackHelpers, - ) => Promise | string | undefined, -): ReplaceReturn; -export function replaceLogic( - replacementOrCallback: - | string - | Readonly - | (( - helpers: CallbackHelpers, - ) => Promise | string | undefined), -): PLazy & Helpers { - return new FunctionExecutor("replace") - .arguments(() => { - let replacement: string | undefined; - if (typeof replacementOrCallback === "string") { - replacement = replacementOrCallback; - } else if (Array.isArray(replacementOrCallback)) { - replacement = replacementOrCallback.join(""); - } - - const callback = - typeof replacementOrCallback === "function" - ? replacementOrCallback - : undefined; - - return { replacement, callback }; - }) - .helpers(() => helpers) - .return((self) => self.wrappedHelpers()) - .executor(async (_next, self) => { - const fileContext = getFileContext(); - const { node } = getAstGrepNodeContext(); - let { callback, replacement } = self.getArguments(); - if (callback) { - replacement = await callback(self.wrapHelpers(callbackHelpers)); - } - - if (replacement) { - const text = replacement.replace( - /(\$\$)?\$([A-Z]+)/gm, - // @ts-ignore - (match, isMultiMatch, varName) => { - if (isMultiMatch) { - return node - ?.getMultipleMatches(varName) - .map((n) => n.text()) - .join(" "); - } - - return node.getMatch(varName)?.text() || ""; - }, - ); - - const range = node.range(); - - await fileContext.update({ - start: range.start.index, - end: range.end.index, - replacement: text, - }); - } - }) - .run(); -} - -export const replace = fnWrapper("replace", replaceLogic); - -const helpers = { map }; - -export type Helpers = typeof helpers; diff --git a/tooling/workflow/src/authService.ts b/tooling/workflow/src/authService.ts deleted file mode 100644 index 9c8cc266..00000000 --- a/tooling/workflow/src/authService.ts +++ /dev/null @@ -1,14 +0,0 @@ -let authService: AuthServiceInterface | undefined; - -export interface AuthServiceInterface { - getGithubAPIKey(): Promise; - ensureGithubScopes(scopes?: string[]): Promise; -} - -export function setAuthService(service: AuthServiceInterface) { - authService = service; -} - -export function getAuthService(): AuthServiceInterface | undefined { - return authService; -} diff --git a/tooling/workflow/src/codemod.ts b/tooling/workflow/src/codemod.ts deleted file mode 100644 index d1e4cf9c..00000000 --- a/tooling/workflow/src/codemod.ts +++ /dev/null @@ -1,79 +0,0 @@ -import type { PLazy } from "./PLazy.js"; -import { getCwdContext } from "./contexts.js"; -import { FunctionExecutor, fnWrapper } from "./engineHelpers.js"; -import { exec } from "./exec.js"; -import { clc } from "./helpers.js"; -import { spawn } from "./spawn.js"; - -export type CodemodReturn = PLazy & CodemodHelpers; - -/** - * Run a codemod in current working directory - * @param name The name of the codemod (check for available codemods at https://codemod.com/registry) - * @param args Arguments to pass to the codemod, e.g. `{ dry: true }`, where `dry` is a flag that the codemod accepts - * - * @example - * ```ts - * // Simple run - * await codemod("valibot/upgrade-v0.31"); - * ``` - * - * @example - * ```ts - * // Run with arguments - * await codemod("valibot/upgrade-v0.31", { dry: true }); - * ``` - * - * @example - * ```ts - * // Chaining codemods - * await codemod("valibot/upgrade-v0.31") - * .codemod("valibot/upgrade-v0.32") - * .codemod("valibot/upgrade-v0.33"); - * ``` - */ -export function codemodLogic( - name: string, - args?: Record< - string, - string | number | boolean | (string | number | boolean)[] - >, -): CodemodReturn { - return new FunctionExecutor("codemod") - .arguments(() => ({ - name, - args, - })) - .helpers(codemodHelpers) - .executor(async (next, self) => { - const { cwd } = getCwdContext(); - const args = Object.entries(self.getArguments().args ?? {}).reduce( - (acc, [key, value]) => { - if (Array.isArray(value)) { - value.forEach((v) => acc.push(`--${key}=${v}`)); - } else { - acc.push(`--${key}=${value}`); - } - return acc; - }, - ["--no-interactive"] as string[], - ); - console.log( - `${clc.blueBright(`codemod ${name} ${args.join(" ")}`)} ${cwd}`, - ); - await spawn("npx", ["codemod@latest", name, ...args], { - cwd, - doNotThrowError: true, - printOutput: true, - }); - await next?.(); - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const codemod = fnWrapper("codemod", codemodLogic); - -const codemodHelpers = { codemod, exec }; - -type CodemodHelpers = typeof codemodHelpers; diff --git a/tooling/workflow/src/contexts.ts b/tooling/workflow/src/contexts.ts deleted file mode 100644 index af7f21be..00000000 --- a/tooling/workflow/src/contexts.ts +++ /dev/null @@ -1,135 +0,0 @@ -import { AsyncLocalStorage } from "node:async_hooks"; -import type { NapiConfig, SgNode } from "@ast-grep/napi"; - -import { invariant } from "ts-invariant"; -import type { FileContext } from "./contexts/FileContext.js"; -import { GitContext } from "./contexts/GitContext.js"; -import { noContextFn } from "./helpers.js"; - -const registeredContexts = new Map>(); - -export const registerContext = (name: string, ctx: AsyncLocalStorage) => { - registeredContexts.set(name, ctx); - return ctx; -}; - -export type AstGrepNodeContext = { - query: string | NapiConfig; - node: SgNode; -}; - -export const parentContextLegacy = new AsyncLocalStorage< - (...args: any[]) => any ->(); - -export const getParentContext = () => { - const fn = parentContextLegacy.getStore(); - - return fn ?? noContextFn; -}; - -export const gitContext = registerContext( - "git", - new AsyncLocalStorage(), -); -export const astGrepNodeContext = registerContext( - "astGrepNodeContext", - new AsyncLocalStorage(), -); -export const describeContext = registerContext( - "describeContext", - new AsyncLocalStorage<{ name: string }>(), -); -export const migrateContext = registerContext( - "migrateContext", - new AsyncLocalStorage<{ name: string }>(), -); -export const cwdContext = registerContext( - "cwdContext", - new AsyncLocalStorage<{ - cwd: string; - }>(), -); -export const parentCwdContext = registerContext( - "parentCwdContext", - new AsyncLocalStorage<{ - cwd: string; - }>(), -); -export const fileContext = registerContext( - "fileContext", - new AsyncLocalStorage(), -); -export const repositoryContext = registerContext( - "repositoryContext", - new AsyncLocalStorage<{ - repository: string; - branch: string; - forkedFrom?: string; - }>(), -); -export const repositoriesContext = registerContext( - "repositoriesContext", - new AsyncLocalStorage<{ - repositories: string[]; - }>(), -); - -export const getContextsSnapshot = () => { - return [...registeredContexts.entries()] - .map(([name, ctx]) => [name, ctx.getStore()]) - .filter(([, store]) => typeof store !== "undefined"); -}; - -export const getAstGrepNodeContext = () => { - const ctx = astGrepNodeContext.getStore(); - invariant(ctx, "No ast-grep node context found"); - return ctx; -}; - -export const getCwdContext = () => { - const cwd = cwdContext.getStore(); - - return cwd ?? { cwd: process.cwd() }; -}; - -export const getParentCwdContext = () => { - const cwd = parentCwdContext.getStore(); - - return cwd ?? { cwd: process.cwd() }; -}; - -export const getFileContext = () => { - const file = fileContext.getStore(); - invariant(file, "No file context found"); - return file; -}; - -export const getGitContext = () => { - const git = gitContext.getStore(); - if (git) { - return git; - } - - const newGit = new GitContext({ repository: "", id: "" }); - - return newGit; -}; - -export const getRepositoryContext = () => { - const repo = repositoryContext.getStore(); - invariant(repo, "No repository context found"); - return repo; -}; - -export const getRepositoriesContext = () => { - const repo = repositoriesContext.getStore(); - invariant(repo, "No repositories context found"); - return repo; -}; - -export const getDescribeContext = () => { - const repo = describeContext.getStore(); - invariant(repo, "No describe context found"); - return repo; -}; diff --git a/tooling/workflow/src/contexts/Context.ts b/tooling/workflow/src/contexts/Context.ts deleted file mode 100644 index 52ba3b3c..00000000 --- a/tooling/workflow/src/contexts/Context.ts +++ /dev/null @@ -1,15 +0,0 @@ -export class Context> { - protected _context: T; - - constructor(data: T) { - this._context = data; - } - - set(key: keyof T, value: T[keyof T]) { - (this._context as Record)[key] = value; - } - - get(key: keyof T) { - return this._context[key]; - } -} diff --git a/tooling/workflow/src/contexts/FileContext.ts b/tooling/workflow/src/contexts/FileContext.ts deleted file mode 100644 index 1dcfdd1c..00000000 --- a/tooling/workflow/src/contexts/FileContext.ts +++ /dev/null @@ -1,102 +0,0 @@ -import * as fs from "node:fs/promises"; -import { formatText } from "@codemod-com/utilities"; -import { convertChangesToDMP, diffLines } from "diff"; -import MagicString from "magic-string"; -import { clc } from "../helpers.js"; -import { Context } from "./Context.js"; - -const formatByDefault = process.argv.includes("--format"); - -export type FileContextData = { file: string }; - -export class FileContext extends Context { - private _contents: string | undefined = undefined; - private _magicString: MagicString | undefined = undefined; - private _contentsChanged = false; - private _oldContents: string | undefined = undefined; - public importsUpdates: { type: "add" | "remove"; import: string }[] = []; - - get file() { - return this.get("file"); - } - - async contents() { - if (typeof this._contents === "undefined") { - this._contents = await fs.readFile(this.file, { encoding: "utf-8" }); - this._oldContents = this._contents; - } - if (typeof this._magicString !== "undefined") { - return this._magicString.toString(); - } - return this._contents; - } - - setContents(contents: string) { - this._contents = contents; - this._magicString = undefined; - this._contentsChanged = true; - } - - async magicString() { - if (typeof this._magicString === "undefined") { - this._magicString = new MagicString(await this.contents()); - } - return this._magicString; - } - - async update({ - start, - end, - replacement, - }: { - start: number; - end: number; - replacement: string; - }) { - const magicString = await this.magicString(); - magicString.update(start, end, replacement); - } - - async save({ format }: { format?: boolean } = {}) { - let contents: string | undefined; - if (this._magicString?.hasChanged()) { - contents = this._magicString.toString(); - } else if (this._contentsChanged) { - contents = this._contents; - } - if (typeof contents === "string") { - const oldContents = this._oldContents; - const newContents = format - ? await formatText(this.file, contents) - : contents; - await fs.writeFile(this.file, newContents); - this._oldContents = undefined; - this._contents = undefined; - this._magicString = undefined; - this._contentsChanged = false; - console.error(`${clc.blueBright("FILE")} ${this.file}`); - // @TODO improve diffs - const changes = convertChangesToDMP( - diffLines(oldContents ?? newContents, newContents), - ); - for (const [type, code] of changes) { - switch (type) { - // case 0: - // process.stdout.write(code); - // break; - case -1: - process.stdout.write(clc.red(code)); - break; - case 1: - process.stdout.write(clc.green(code)); - break; - } - } - process.stdout.write("\n"); - } - } - - get extension() { - return this.file.split(".").pop(); - } -} diff --git a/tooling/workflow/src/contexts/GitContext.ts b/tooling/workflow/src/contexts/GitContext.ts deleted file mode 100644 index 9e6ca095..00000000 --- a/tooling/workflow/src/contexts/GitContext.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { simpleGit } from "simple-git"; -import { getCwdContext } from "../contexts.js"; -import { Context } from "./Context.js"; - -export type GitContextData = { repository: string; id: string }; - -export class GitContext extends Context { - get simpleGit() { - return simpleGit(getCwdContext().cwd); - } - - async checkout({ branch, force }: { branch: string; force?: boolean }) { - try { - await this.simpleGit.checkout(branch); - } catch (e) { - if (force) { - await this.simpleGit.checkout(["-b", branch]); - } else { - throw e; - } - } - } -} diff --git a/tooling/workflow/src/engineHelpers.ts b/tooling/workflow/src/engineHelpers.ts deleted file mode 100644 index f08bf1bf..00000000 --- a/tooling/workflow/src/engineHelpers.ts +++ /dev/null @@ -1,254 +0,0 @@ -import { AsyncLocalStorage } from "node:async_hooks"; -import { createHash } from "node:crypto"; -import { mapValues, memoize } from "lodash-es"; -import { PLazy } from "./PLazy.js"; -import { noContextFn } from "./helpers.js"; - -function getHash(data: any) { - const h = createHash("sha1"); - h.update(JSON.stringify(data)); - return h.digest("hex"); -} - -class NodeContext { - public name: string; - public hash: string; - public arguments: any[]; - public children: NodeContext[]; - constructor(name: string, fn: string, args: any[]) { - this.name = name; - this.arguments = args.map((arg) => String(arg)); - this.hash = getHash({ name, fn: fn.toString(), args }); - this.children = []; - } -} - -const selfContext = new AsyncLocalStorage(); - -const parentContext = new AsyncLocalStorage(); - -export const wrapContext = new AsyncLocalStorage<(...args: any[]) => any>(); - -const tree: { children: NodeContext[] } = { - children: [], -}; - -export const getTree = () => tree; - -export function fnWrapper any>( - name: string, - fn: T, -): T { - return ((...args: any[]) => { - const parent = parentContext.getStore(); - const self = new NodeContext(name, fn.toString(), args); - if (parent) { - parent.children.push(self); - } else { - tree.children.push(self); - } - return selfContext.run(self, fn, ...args); - }) as any; -} - -export class FunctionExecutor< - I extends ((...args: any[]) => any) | undefined = undefined, // init - H extends - | Record - | ((self: FunctionExecutor) => Record) - | undefined = undefined, // helpers - R extends ((...args: any[]) => Promise | any) | undefined = undefined, // return - W extends boolean = true, // return wrapped helpers like PLazy & H or not - E extends ((...args: any[]) => Promise | any) | undefined = undefined, // executor - C extends ((...args: any[]) => Promise | any) | undefined = undefined, // callback - A extends - | ((self: { - getChildArg: (name: string) => T | undefined; - }) => Promise | any) - | undefined = undefined, // arguments parser -> { - // @ts-ignore - private _init?: I; - private _helpers?: H; - private _return?: R; - private _context: NodeContext; - private _copyHelpersToPromise: W = true as W; - private _executor?: E; - private _parentWrapper: (...args: any[]) => any; - private _callback?: C; - private _arguments?: A; - private _done: any; - private parentArgs: any[] = []; - private childArgs: any[] = []; - private initiated = false; - - constructor(public name: string) { - this._context = selfContext.getStore() as NodeContext; - this._parentWrapper = wrapContext.getStore() ?? noContextFn; - } - - public setParentArgs(...args: any[]) { - this.parentArgs = args; - return this; - } - - public getChildArgs() { - return this.childArgs; - } - - public getChildArg(name: string) { - return this.childArgs.find((args) => typeof args[name] !== "undefined")?.[ - name - ]; - } - - doNotCopyHelpersToPromise(): FunctionExecutor { - this._copyHelpersToPromise = false as W; - return this as any; - } - - init any>( - init: (self: FunctionExecutor) => Promise | void, - ): FunctionExecutor { - if (init) { - this._init = memoize(init) as any; - } - return this as any; - } - - done(cb: any) { - this._done = cb; - return this; - } - - arguments< - AE extends (self: { - getChildArg: (name: string) => T | undefined; - }) => Promise | any, - >(args: AE): FunctionExecutor { - this._arguments = args as any; - return this as any; - } - - getArguments(): A extends (self: { - getChildArg: (name: string) => T | undefined; - }) => any | Promise - ? Awaited> - : undefined { - return this._arguments?.(this); - } - - helpers>( - helpers: HE | ((self: FunctionExecutor) => HE), - ): FunctionExecutor { - this._helpers = helpers as any; - return this as any; - } - - callback< - CE extends ( - self: FunctionExecutor, - ) => Promise | any, - >(callback: CE): FunctionExecutor { - this._callback = callback as any; - return this as any; - } - - wrappedHelpers(): H extends (...args: any[]) => any ? ReturnType : H { - return mapValues( - // @ts-ignore - typeof this._helpers === "function" ? this._helpers(this) : this._helpers, - (fn: any) => - (...args: any[]) => - // @ts-ignore - parentContext.run(this._context, () => - wrapContext.run(this.context(), () => fn(...args)), - ), - ) as any; - } - - wrapHelpers
>(helpers: HR): HR { - return mapValues( - // @ts-ignore - helpers, - (fn: any) => - (...args: any[]) => - // @ts-ignore - parentContext.run(this._context, () => - wrapContext.run(this.context(), () => fn(...args)), - ), - ) as any; - } - - context() { - return (cb?: any, ...childArgs: any[]) => { - this.childArgs = childArgs; - return this._parentWrapper( - () => { - return (this._executor ?? noContextFn)(async () => { - if (this._init && !this.initiated) { - this.initiated = true; - await this._init(this); - } - if (this._callback) { - await parentContext.run(this._context, this._callback, this); - } - return cb?.(); - }, this); - }, - ...this.parentArgs, - ); - }; - } - - return< - RE extends ( - self: FunctionExecutor, - ) => Promise | any, - >(_return: RE): FunctionExecutor { - this._return = _return as any; - return this as any; - } - - executor< - EE extends ( - next: (...args: any[]) => Promise | void, - self: FunctionExecutor, - ) => Promise | any, - >(executor: EE): FunctionExecutor { - this._executor = executor as any; - return this as any; - } - - run(): R extends (...args: any[]) => Promise | any - ? W extends true - ? PLazy>> & Awaited> - : PLazy>> - : void { - const promise = new PLazy((resolve, reject) => { - (async () => { - let res: any; - let isCalled = false; - await this.context()(async () => { - res = await this._return?.(this); - isCalled = true; - }); - if (!isCalled) { - res = await this._return?.(this); - } - return res; - })() - .then(resolve) - .catch(reject); - }) as any; - - if (this._copyHelpersToPromise) { - const wrappedHelpers = this.wrappedHelpers(); - for (const key in wrappedHelpers) { - promise[key] = wrappedHelpers[key]; - } - } - - return promise; - } -} diff --git a/tooling/workflow/src/exec.ts b/tooling/workflow/src/exec.ts deleted file mode 100644 index 9e0f2737..00000000 --- a/tooling/workflow/src/exec.ts +++ /dev/null @@ -1,63 +0,0 @@ -import type { PLazy } from "./PLazy.js"; -import { codemod } from "./codemod.js"; -import { getCwdContext } from "./contexts.js"; -import { FunctionExecutor, fnWrapper } from "./engineHelpers.js"; -import { clc } from "./helpers.js"; -import { spawn } from "./spawn.js"; - -/** - * Run a command in current working directory - * @param command The command to run - * @param args Arguments to pass to the command - * - * @example - * Simple run - * ```ts - * await exec("ls"); - * ``` - * - * @example - * Run with arguments - * ```ts - * await exec("ls", ["-al"]); - * ``` - * - * @example - * Chaining commands - * ```ts - * await exec("ls") - * .exec("pwd") - * .exec("ls", ["-al"]); - * ``` - */ -export function execLogic( - command: string, - args?: string[], -): PLazy & ExecHelpers { - return new FunctionExecutor("exec") - .arguments(() => ({ - command, - args, - })) - .helpers(execHelpers) - .executor(async (next, self) => { - const { cwd } = getCwdContext(); - const { command, args } = self.getArguments(); - console.log( - `${clc.blueBright(`${command} ${args?.join(" ") ?? ""}`)} ${cwd}`, - ); - await spawn(command, args ?? [], { - cwd, - doNotThrowError: true, - }); - await next?.(); - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const exec = fnWrapper("exec", execLogic); - -const execHelpers = { exec, codemod }; - -type ExecHelpers = typeof execHelpers; diff --git a/tooling/workflow/src/files.ts b/tooling/workflow/src/files.ts deleted file mode 100644 index 3135ae9f..00000000 --- a/tooling/workflow/src/files.ts +++ /dev/null @@ -1,114 +0,0 @@ -import * as path from "node:path"; -import * as glob from "glob"; -import type { PLazy } from "./PLazy.js"; -import { astGrep } from "./astGrep/astGrep.js"; -import { fileContext, getCwdContext } from "./contexts.js"; -import { FileContext } from "./contexts/FileContext.js"; -import { FunctionExecutor, fnWrapper } from "./engineHelpers.js"; -import { move } from "./fs/move.js"; -import { parseMultistring } from "./helpers.js"; -import { jsFam } from "./jsFam.js"; -import { json } from "./json/json.js"; -import { yaml } from "./yaml/yaml.js"; - -export type FilesReturn = PLazy & Helpers; - -/** - * @description Will find all the files in current working directory. If following function will be called to get specific context, for example `files().jsFam()` - it will search for any js/ts file, basically it will change behaviour of files function. - * @example - * ```ts - * // will search for all the files within current working directory with **∕* pattern - * await files().astGrep`import React from 'react'` - * ``` - * @see {@link jsFam} - * @see {@link astGrep} - * @see {@link json} - * @see {@link yaml} - * @see {@link move} - * @example - * ```ts - * // will search for all the js/ts files within current working directory using **∕*.{js,ts,jsx,tsx,cjs,mjs} pattern - * await files().jsFam().astGrep`import React from 'react'` - * ``` - */ -export function filesLogic(): FilesReturn; -/** - * @description Filter file by glob pattern - * @param globs string or array of globs to search for a files, could be comma/space separated string - * @example - * ```ts - * await jsFiles('src/app.ts,src/**∕*.tsx').astGrep`import React from 'react'`; - * ``` - * @see {@link jsFam} - * @see {@link astGrep} - * @see {@link json} - * @see {@link yaml} - * @see {@link move} - */ -export function filesLogic(globs: string | readonly string[]): FilesReturn; -export function filesLogic( - globs: string | readonly string[], - callback: (helpers: Helpers) => void | Promise, -): FilesReturn; -export function filesLogic( - callback: (helpers: Helpers) => void | Promise, -): FilesReturn; -export function filesLogic( - rawGlobs?: - | string - | readonly string[] - | ((helpers: Helpers) => void | Promise), - maybeCallback?: (helpers: Helpers) => void | Promise, -): FilesReturn { - return new FunctionExecutor("files") - .arguments((self) => { - const defaultGlob = self.getChildArg("defaultGlob") ?? "**/*.*"; - const globs = parseMultistring( - !rawGlobs || typeof rawGlobs === "function" ? defaultGlob : rawGlobs, - /[\n; ]/, - ); - - const callback = - typeof rawGlobs === "function" ? rawGlobs : maybeCallback; - return { globs, callback }; - }) - .helpers(helpers) - .executor(async (next, self) => { - const { globs, callback } = self.getArguments(); - const { cwd } = getCwdContext(); - const absolutePaths = globs.filter((g) => path.isAbsolute(g)); - const relativePaths = globs.filter((g) => !path.isAbsolute(g)); - const files = [ - ...( - await glob.glob(relativePaths, { - cwd, - nodir: true, - ignore: [ - "**/node_modules/**", - "**/.git/**", - "**/dist/**", - "**/build/**", - ], - }) - ).map((f) => path.join(cwd, f)), - ...absolutePaths, - ]; - - for (const file of files) { - await fileContext.run(new FileContext({ file }), async () => { - if (callback) { - await callback(helpers); - } - - await next(); - }); - } - }) - .run() as any; -} - -export const files = fnWrapper("files", filesLogic); - -const helpers = { jsFam, move, astGrep, yaml, json }; - -type Helpers = typeof helpers; diff --git a/tooling/workflow/src/fs.ts b/tooling/workflow/src/fs.ts deleted file mode 100644 index 8bbe934d..00000000 --- a/tooling/workflow/src/fs.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* eslint-disable @typescript-eslint/ban-ts-comment */ -import * as fs from "node:fs/promises"; -import * as os from "node:os"; -import * as path from "node:path"; -import slugify from "@sindresorhus/slugify"; -import filenamify from "filenamify"; -import * as glob from "glob"; -import { fileContext, getCwdContext } from "./contexts.js"; -import { FileContext } from "./contexts/FileContext.js"; - -const DIRECTORY = "cm"; - -export const getTmpDir = (...rawParts: string[]) => { - const parts = rawParts.map((part) => { - const slug = slugify(part); - return filenamify(slug); - }); - const dirpath = path.join(os.tmpdir(), DIRECTORY, ...parts); - - return dirpath; -}; - -export const rm = async (dir: string) => { - await fs.rm(dir, { - recursive: true, - force: true, - retryDelay: 1000, - maxRetries: 5, - }); -}; - -export const files = async ( - pattern: string | string[], - cb: () => Promise, -) => { - const { cwd } = getCwdContext(); - const files = await glob.glob(pattern, { cwd, nodir: true }); - for (const file of files) { - await fileContext.run(new FileContext({ file: path.join(cwd, file) }), cb); - } -}; - -export const jsonFiles = async ( - pattern: string | string[], - cb: (args: { - update: (updater: T | ((input: T) => T | Promise)) => Promise; - }) => Promise, -) => { - const { cwd } = getCwdContext(); - const files = await glob.glob(pattern, { cwd, nodir: true }); - await cb({ - update: async (updater: T | ((input: T) => T | Promise)) => { - for (const file of files) { - const filepath = path.join(cwd, file); - if (typeof updater === "function") { - const contents = JSON.parse(await fs.readFile(filepath, "utf-8")); - // @ts-ignore - const updatedContents = (await updater(contents)) as T; - await fs.writeFile( - filepath, - JSON.stringify(updatedContents, null, 2), - ); - } else { - await fs.writeFile(filepath, JSON.stringify(updater, null, 2)); - } - } - }, - }); -}; - -export const isDirectory = async (dir: string) => { - try { - const stats = await fs.stat(dir); - await fs.access( - dir, - fs.constants.R_OK | fs.constants.W_OK | fs.constants.X_OK, - ); - return stats.isDirectory(); - } catch { - return false; - } -}; diff --git a/tooling/workflow/src/fs/dirs.ts b/tooling/workflow/src/fs/dirs.ts deleted file mode 100644 index 3df9a559..00000000 --- a/tooling/workflow/src/fs/dirs.ts +++ /dev/null @@ -1,118 +0,0 @@ -import * as fs from "node:fs/promises"; -import * as path from "node:path"; -import * as glob from "glob"; -import type { PLazy } from "../PLazy.js"; -import { codemod } from "../codemod.js"; -import { cwdContext, getCwdContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { exec } from "../exec.js"; -import { files } from "../files.js"; -import { parseMultistring } from "../helpers.js"; -import { jsFiles } from "../jsFiles.js"; -import { map } from "./map.js"; -import { move } from "./move.js"; - -type DirsParams = { - dirs: string | readonly string[]; - create?: boolean; - ignore?: string | string[] | glob.IgnoreLike; -}; - -/** - * @description Run a callback for each directory matching the pattern - * @param pattern Glob pattern or array of glob patterns - * @param cb - * @example dirs`apps` - * .jsFiles`*.ts` - * .astGrep`import React from 'react'` - * .remove(); - * @example dirs('apps/*', async ({ jsFiles }) => { - * await jsFiles`*.ts` - * .astGrep`import React from 'react'` - * .remove(); - * }); - * @example dirs(async ({ jsFiles }) => { - * await jsFiles`*.ts` - * .astGrep`import React from 'react'` - * .remove(); - * }); - */ -export function dirsLogic( - pattern: string | readonly string[] | DirsParams, - callback?: (helpers: DirsHelpers) => Promise | void, -): PLazy & DirsHelpers { - return new FunctionExecutor("dirs") - .arguments(() => { - if (typeof pattern === "object" && !Array.isArray(pattern)) { - const { dirs, ...rest } = pattern as DirsParams; - return { - params: { - ...rest, - dirs: parseMultistring(dirs), - }, - callback, - }; - } - - const patterns = parseMultistring(pattern); - - const create = - patterns.length === 1 && !glob.hasMagic(patterns[0] as string); - - return { - params: { - create, - dirs: patterns, - }, - callback, - }; - }) - .helpers(dirsHelpers) - .executor(async (next, self) => { - const { - params: { dirs: directories, create, ignore }, - } = self.getArguments(); - const { cwd } = getCwdContext(); - const dirs = await glob.glob(directories, { cwd, ignore }); - const directoriesWalked = new Set(); - for (const dir of dirs) { - if (directoriesWalked.has(dir)) { - continue; - } - directoriesWalked.add(dir); - await cwdContext.run({ cwd: path.join(cwd, dir) }, next); - } - if (create) { - for (const directoryShouldExist of directories) { - if ( - !glob.hasMagic(directoryShouldExist) && - !directoriesWalked.has(directoryShouldExist) - ) { - directoriesWalked.add(directoryShouldExist); - console.log( - `Creating directory ${path.join(cwd, directoryShouldExist)}`, - ); - await fs.mkdir(path.join(cwd, directoryShouldExist), { - recursive: true, - }); - await cwdContext.run( - { cwd: path.join(cwd, directoryShouldExist) }, - next, - ); - } - } - } - }) - .callback(async (self) => { - const { callback } = self.getArguments(); - await callback?.(dirsHelpers); - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const dirs = fnWrapper("dirs", dirsLogic); - -const dirsHelpers = { dirs, jsFiles, codemod, exec, move, map, files }; - -type DirsHelpers = typeof dirsHelpers; diff --git a/tooling/workflow/src/fs/map.ts b/tooling/workflow/src/fs/map.ts deleted file mode 100644 index bb4a79f8..00000000 --- a/tooling/workflow/src/fs/map.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { getCwdContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; - -export function mapLogic< - CALLBACK extends (helpers: Helpers) => ReturnType, - RETURN extends ReturnType, ->(callback: CALLBACK): Promise { - const response = [] as RETURN[]; - return new FunctionExecutor("map") - .helpers(helpers) - .executor(async () => { - const result = await callback(helpers); - response.push(result as any); - }) - .return(() => response) - .run(); -} - -export const map = fnWrapper("map", mapLogic); - -const helpers = { - cwd: () => getCwdContext().cwd, -}; - -type Helpers = typeof helpers; diff --git a/tooling/workflow/src/fs/move.ts b/tooling/workflow/src/fs/move.ts deleted file mode 100644 index 634a6a08..00000000 --- a/tooling/workflow/src/fs/move.ts +++ /dev/null @@ -1,241 +0,0 @@ -import * as fs from "node:fs/promises"; -import * as path from "node:path"; -import * as pathPosix from "node:path/posix"; -import * as glob from "glob"; -import type { PLazy } from "../PLazy.js"; -import { - cwdContext, - fileContext, - getCwdContext, - getFileContext, - getParentCwdContext, -} from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { files } from "../files.js"; - -const ALL_JS_EXTENSIONS = ["js", "jsx", "ts", "tsx", "cjs", "mjs"]; - -const getPathBeforeRename = ( - newPath: string, - renames: Record, -) => { - for (const [beforeRename, afterRename] of Object.entries(renames)) { - if (newPath === afterRename) { - return beforeRename; - } - } - return undefined; -}; - -const getRenamedPath = async ( - oldPath: string, - renames: Record, -) => { - if (oldPath in renames) { - return renames[oldPath]; - } - - // Try remove query params - const queryIndex = oldPath.indexOf("?"); - if (queryIndex !== -1) { - const maybeFilePath = oldPath.slice(0, queryIndex); - if (maybeFilePath in renames) { - return `${renames[maybeFilePath]}?${oldPath.slice(queryIndex + 1)}`; - } - } - - // Try to guess imports - // If it is a JS file - for (const ext of ALL_JS_EXTENSIONS) { - const maybeFilePath = `${oldPath}.${ext}`; - if (maybeFilePath in renames) { - return pathPosix.format({ - ...pathPosix.parse(renames[maybeFilePath] as string), - base: undefined, - ext: undefined, - }); - } - } - // If it is directory - try { - if ((await fs.stat(oldPath)).isDirectory()) { - for (const ext of ALL_JS_EXTENSIONS) { - const maybeFilePath = `${pathPosix.join(oldPath, "index")}.${ext}`; - if (maybeFilePath in renames) { - return pathPosix.format({ - ...pathPosix.parse(renames[maybeFilePath] as string), - base: undefined, - ext: undefined, - name: undefined, - }); - } - } - } - } catch (e) { - // do nothing - } - - return undefined; -}; - -const renameImport = async ( - newAbsoluteSelfPath: string, - renames: Record, - importPath: string, -) => { - // Only relative, excluding package.json - if (importPath?.startsWith(".") && !importPath.endsWith("package.json")) { - const oldAbsoluteSelfPath = getPathBeforeRename( - newAbsoluteSelfPath, - renames, - ); - const oldAbsoluteImportPath = pathPosix.resolve( - pathPosix.dirname(oldAbsoluteSelfPath ?? newAbsoluteSelfPath), - importPath, - ); - const newAbsoluteImportPath = - (await getRenamedPath(oldAbsoluteImportPath, renames)) ?? - oldAbsoluteImportPath; - let relativePath = pathPosix.join( - pathPosix.relative( - pathPosix.dirname(newAbsoluteSelfPath), - pathPosix.dirname(newAbsoluteImportPath), - ), - pathPosix.basename(newAbsoluteImportPath), - ); - if (!relativePath.startsWith(".")) { - relativePath = `./${relativePath}`; - } - - let extension: string | undefined = pathPosix.extname(relativePath); - if (extension === ".ts") { - extension = ".js"; - } else if (extension === ".tsx" || extension === ".jsx") { - extension = undefined; - } - - relativePath = pathPosix.format({ - ...pathPosix.parse(relativePath), - base: undefined, - ext: extension, - }); - - if (importPath !== relativePath) { - return relativePath; - } - - return importPath; - } - return importPath; -}; - -/** - * @description Move directories or files matching the pattern - */ -export function moveLogic(target: string): PLazy & Helpers { - return new FunctionExecutor("move") - .arguments(() => ({ - target, - })) - .helpers(helpers) - .executor(async (next, self) => { - const { target } = self.getArguments(); - const { cwd } = getCwdContext(); - const file = fileContext.getStore(); - let foundFiles: string[] = []; - let isFile = false; - if (file) { - isFile = true; - foundFiles = [path.basename(file.file)]; - } else { - foundFiles = await glob.glob("**/*.*", { - cwd, - nodir: true, - ignore: [ - "**/node_modules/**", - "**/.git/**", - "**/dist/**", - "**/build/**", - ], - }); - } - const renames: Record = {}; - for (const file of foundFiles) { - const source = path.resolve(cwd, file); - const dest = path.resolve( - target, - ...(isFile ? [] : [path.basename(cwd)]), - file, - ); - console.log(`Moving ${source} to ${dest}`); - await fs.mkdir(path.dirname(dest), { recursive: true }); - await fs.rename(source, dest); - if (dest.match(/\.(ts|js|tsx|jsx|cjs|mjs)$/)) { - renames[source] = dest; - } - try { - if ( - await fs.readdir(path.dirname(source)).then((x) => x.length === 0) - ) { - await fs.rmdir(path.dirname(source)); - } - } catch (e) {} - } - try { - if (await fs.readdir(cwd).then((x) => x.length === 0)) { - await fs.rmdir(cwd); - } - } catch (e) {} - - await cwdContext.run( - getParentCwdContext(), - async () => - await files("**/*.{js,jsx,ts,tsx,cjs,mjs}").jsFam( - async ({ astGrep }) => { - const file = getFileContext().file; - await astGrep({ - rule: { - any: [ - { - kind: "string_fragment", - inside: { - kind: "string", - inside: { - any: [ - { kind: "import_statement" }, - { kind: "export_statement" }, - ], - }, - }, - }, - { - kind: "string_fragment", - inside: { - kind: "string", - inside: { - kind: "arguments", - inside: { - kind: "call_expression", - regex: "^require", - }, - }, - }, - }, - ], - }, - }).replace(async ({ getNode }) => { - return await renameImport(file, renames, getNode().text()); - }); - }, - ), - ); - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const move = fnWrapper("move", moveLogic); - -const helpers = {}; - -type Helpers = typeof helpers; diff --git a/tooling/workflow/src/git/branch.ts b/tooling/workflow/src/git/branch.ts deleted file mode 100644 index ae57cbd6..00000000 --- a/tooling/workflow/src/git/branch.ts +++ /dev/null @@ -1,127 +0,0 @@ -import { memoize } from "lodash-es"; -import type { PLazy } from "../PLazy.js"; -import { codemod } from "../codemod.js"; -import { getGitContext } from "../contexts.js"; -import type { GitContext } from "../contexts/GitContext.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { exec } from "../exec.js"; -import { files } from "../files.js"; -import { dirs } from "../fs/dirs.js"; -import { jsFiles } from "../jsFiles.js"; -import { commit } from "./commit.js"; -import { push } from "./push.js"; - -interface BranchOptions { - /** - * @description Branch name to checkout - */ - branch: string; - /** - * @description Force checkout to branch - * @default true - */ - force?: boolean; -} - -export type BranchReturn = PLazy & BranchHelpers; - -/** - * @description Creates branch for every repository - * @param newBranch Branch name to checkout, could be a string or an object with branch and force - * @example - * ```ts - * // chain call - * import { git } from '@codemod.com/workflow' - * await git.clone('git@github.com:codemod-com/codemod.git') - * .branch('new-branch') - * ``` - * @example - * ```ts - * // existing branch - * import { git } from '@codemod.com/workflow' - * await git.clone('git@github.com:codemod-com/codemod.git') - * .branch({ - * branch: 'new-branch', - * force: false - * }) - * ``` - * @see {@link jsFiles} - * @see {@link files} - * @see {@link dirs} - * @see {@link exec} - * @see {@link commit} - * @see {@link push} - * @see {@link codemod} - */ -export function branchLogic(newBranch: string | BranchOptions): BranchReturn; - -/** - * Creates branch for current repository - * @param newBranch Branch name to checkout, could be a string or an object with branch and force - * @param callback A callback would be called after the branch is created with first argument as helpers - * @example - * ```ts - * // inside callback - * import { git } from '@codemod.com/workflow' - * await git.clone('git@github.com:codemod-com/codemod.git', async ({ branch }) => { - * await branch('new-branch') - * }) - * ``` - * @see {@link jsFiles} - * @see {@link files} - * @see {@link dirs} - * @see {@link exec} - * @see {@link commit} - * @see {@link push} - * @see {@link codemod} - */ -export function branchLogic( - newBranch: string | BranchOptions, - callback: (helpers: BranchHelpers) => void | Promise, -): BranchReturn; - -export function branchLogic( - newBranch: string | BranchOptions, - callback?: (helpers: BranchHelpers) => void | Promise, -): BranchReturn { - const branchoutMemoized = memoize( - (key: string, gitContext: GitContext, branch: string, force?: boolean) => - gitContext.checkout({ branch, force }), - ); - return new FunctionExecutor("branch") - .arguments(() => { - return { - branchArg: - typeof newBranch === "string" - ? ({ branch: newBranch, force: true } as BranchOptions) - : newBranch, - callback, - }; - }) - .helpers(branchHelpers) - .executor(async (next, self) => { - const { branchArg } = self.getArguments(); - const gitContext = getGitContext(); - await branchoutMemoized( - `${gitContext.get("id")}-${branchArg.branch}-${String( - branchArg.force, - )}`, - gitContext, - branchArg.branch, - branchArg.force, - ); - await next(); - }) - .callback(async (self) => { - const { callback } = self.getArguments(); - await callback?.(branchHelpers); - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const branch = fnWrapper("branch", branchLogic); - -const branchHelpers = { jsFiles, commit, push, dirs, codemod, exec, files }; - -export type BranchHelpers = typeof branchHelpers; diff --git a/tooling/workflow/src/git/clone.ts b/tooling/workflow/src/git/clone.ts deleted file mode 100644 index 7f7d787d..00000000 --- a/tooling/workflow/src/git/clone.ts +++ /dev/null @@ -1,270 +0,0 @@ -import { memoize } from "lodash-es"; -import { getTmpDir } from "src/fs.js"; -import type { PLazy } from "../PLazy.js"; -import { codemod } from "../codemod.js"; -import { - cwdContext, - gitContext, - parentCwdContext, - repositoryContext, -} from "../contexts.js"; -import { GitContext } from "../contexts/GitContext.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { exec } from "../exec.js"; -import { files } from "../files.js"; -import { dirs } from "../fs/dirs.js"; -import { pr } from "../github/pr.js"; -import { parseMultistring } from "../helpers.js"; -import { jsFiles } from "../jsFiles.js"; -import { branch } from "./branch.js"; -import { commit } from "./commit.js"; -import { cloneRepository, syncForkRepository } from "./helpers.js"; -import { push } from "./push.js"; - -interface CloneOptions { - repository: string; - branch?: string; - shallow?: boolean; -} - -export type CloneReturn = PLazy & CloneHelpers; - -const mapCloneOptions = (options: string | CloneOptions): CloneOptions => { - if (typeof options === "string") { - return { repository: options, shallow: true }; - } - return options; -}; - -/** - * @description Clone a repository (could be used as follow up for github.fork) - * @example - * ```ts - * import { github } from '@codemod.com/workflow' - * await github.fork('git://github.com/codemod-com/codemod.git') - * .clone() - * .branch('new-branch') - * .files() - * .jsFam() - * .astGrep('console.log($$$ARGS)') - * .replace('console.error($$$ARGS)') - * ``` - * @see {@link branch} - * @see {@link commit} - * @see {@link push} - * @see {@link files} - * @see {@link jsFiles} - * @see {@link pr} - * @see {@link codemod} - * @see {@link dirs} - * @see {@link exec} - */ -export function cloneLogic(): CloneReturn; - -/** - * @description Clone a repository with a callback (could be used as follow up for github.fork) - * @param callback A callback would be called after the repositories are cloned with first argument as helpers - * @example - * ```ts - * import { github } from '@codemod.com/workflow' - * await github.fork('git://github.com/codemod-com/codemod.git') - * .clone(({ branch, commit, push, files }) => { - * await branch('new-branch') - * await files() - * .jsFam() - * .astGrep('console.log($$$ARGS)') - * .replace('console.error($$$ARGS)') - * await commit('feat: new branch') - * await push() - * }) - * ``` - * @see {@link branch} - * @see {@link commit} - * @see {@link push} - * @see {@link files} - * @see {@link jsFiles} - * @see {@link pr} - * @see {@link codemod} - * @see {@link dirs} - * @see {@link exec} - */ -export function cloneLogic( - callback: (helpers: CloneHelpers) => void | Promise, -): CloneReturn; - -/** - * @description Clone repositories - * @param repositories List of repositories to clone, could be a string, template literals can be used to pass multiple repositories, array of strings, objects with repository and branch to clone - * @example - * ```ts - * import { github } from '@codemod.com/workflow' - * await github.clone('git://github.com/codemod-com/codemod.git') - * .branch('new-branch') - * .files() - * .jsFam() - * .astGrep('console.log($$$ARGS)') - * .replace('console.error($$$ARGS)') - * ``` - * @see {@link branch} - * @see {@link commit} - * @see {@link push} - * @see {@link files} - * @see {@link jsFiles} - * @see {@link pr} - * @see {@link codemod} - * @see {@link dirs} - * @see {@link exec} - */ -export function cloneLogic( - repositories: - | (string | CloneOptions)[] - | string - | readonly string[] - | CloneOptions - | CloneOptions[], -): CloneReturn; - -/** - * @description Clone repositories with a callback - * @param repositories List of repositories to clone, could be a string, template literals can be used to pass multiple repositories, array of strings, objects with repository and branch to clone - * @param callback A callback would be called after the repositories are cloned with first argument as helpers - * @example - * ```ts - * import { github } from '@codemod.com/workflow' - * await github.clone('git://github.com/codemod-com/codemod.git', ({ branch, commit, push, files }) => { - * await branch('new-branch') - * await files() - * .jsFam() - * .astGrep('console.log($$$ARGS)') - * .replace('console.error($$$ARGS)') - * await commit('feat: new branch') - * await push() - * }) - * ``` - * @see {@link branch} - * @see {@link commit} - * @see {@link push} - * @see {@link files} - * @see {@link jsFiles} - * @see {@link pr} - * @see {@link codemod} - * @see {@link dirs} - * @see {@link exec} - */ -export function cloneLogic( - repositories: - | (string | CloneOptions)[] - | string - | readonly string[] - | CloneOptions - | CloneOptions[], - callback: (helpers: CloneHelpers) => void | Promise, -): CloneReturn; - -export function cloneLogic( - rawRepositories?: - | (string | CloneOptions)[] - | string - | readonly string[] - | CloneOptions - | CloneOptions[] - | ((helpers: CloneHelpers) => void | Promise), - callback?: (helpers: CloneHelpers) => void | Promise, -): CloneReturn { - const memoizedCloneRepo = memoize(cloneRepository); - const memoizedSyncForkedRepo = memoize(syncForkRepository); - return new FunctionExecutor("clone") - .arguments(() => { - let repositories: CloneOptions[] = []; - let resultCallback = callback; - - if ( - typeof rawRepositories === "string" || - (Array.isArray(rawRepositories) && - rawRepositories.every((repo) => typeof repo === "string")) - ) { - repositories = parseMultistring( - rawRepositories as string | readonly string[], - ).map(mapCloneOptions); - } else if (Array.isArray(rawRepositories)) { - repositories = rawRepositories.map(mapCloneOptions); - } else if (typeof rawRepositories === "function") { - repositories = []; - resultCallback = rawRepositories; - } else if (rawRepositories) { - repositories = [ - mapCloneOptions(rawRepositories as string | CloneOptions), - ]; - } - - return { - repositories, - callback: resultCallback, - }; - }) - .helpers(cloneHelpers) - .executor(async (next, self) => { - const { repositories } = self.getArguments(); - const repo = repositoryContext.getStore(); - if (repositories.length === 0) { - if (repo) { - repositories.push({ ...repo, shallow: true }); - } - } - await Promise.all( - repositories.map(({ repository, shallow, branch }, index) => - cwdContext.run({ cwd: process.cwd() }, async () => { - const id = `${repository}, ${String(index)}, ${String( - shallow, - )}, ${String(branch)}`; - const tmpDir = getTmpDir(`${repository}${String(index)}`); - const cwd = cwdContext.getStore(); - const parentCwd = parentCwdContext.getStore(); - if (cwd) { - cwd.cwd = tmpDir; - } - if (parentCwd) { - parentCwd.cwd = tmpDir; - } - await memoizedCloneRepo(id, { - repositoryUrl: repository, - branch, - shallow, - extraName: String(index), - tmpDir, - }); - if (repo?.forkedFrom) { - await memoizedSyncForkedRepo(``, { - branch, - upstream: repo.forkedFrom, - fork: repository, - }); - } - await gitContext.run(new GitContext({ repository, id }), next); - }), - ), - ); - }) - .callback(async (self) => { - const { callback } = self.getArguments(); - await callback?.(cloneHelpers); - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const clone = fnWrapper("clone", cloneLogic); - -const cloneHelpers = { - jsFiles, - branch, - commit, - push, - dirs, - codemod, - exec, - files, - pr, -}; - -export type CloneHelpers = typeof cloneHelpers; diff --git a/tooling/workflow/src/git/commit.ts b/tooling/workflow/src/git/commit.ts deleted file mode 100644 index 6f191d2d..00000000 --- a/tooling/workflow/src/git/commit.ts +++ /dev/null @@ -1,66 +0,0 @@ -import type { PLazy } from "../PLazy.js"; -import { getCwdContext, repositoryContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { logger } from "../helpers.js"; -import { spawn } from "../spawn.js"; -import { push } from "./push.js"; - -export type CommitReturn = PLazy & Helpers; - -/** - * @description Commit changes to the current repository, adds all the files with `git add .` - * @param message Commit message - * @example - * ```ts - * import { git } from '@codemod.com/workflow' - * await git.clone('git://github.com/codemod-com/codemod.git') - * .branch('new-branch', async ({ files, commit, push }) => { - * await files() - * .jsFam() - * .astGrep('console.log($$$ARGS)') - * .replace('console.error($$$ARGS)') - * await commit('feat: new branch') - * await push() - * }) - * ``` - */ -export function commitLogic(message: string): CommitReturn { - return new FunctionExecutor("commit") - .arguments(() => ({ - message, - })) - .helpers(helpers) - .executor(async (next, self) => { - const { message } = self.getArguments(); - const { cwd } = getCwdContext(); - const repoContext = repositoryContext.getStore(); - const log = logger( - `Committing${repoContext ? ` to ${repoContext.repository}/tree/${repoContext.branch}` : ""}${ - message ? ` with message: ${JSON.stringify(message)}` : "" - }`, - ); - try { - await spawn("git", ["add", "."], { cwd }); - const { stdout } = await spawn("git", ["commit", "-m", message], { - cwd: cwd, - doNotThrowError: true, - }); - if (stdout.join("").match(/nothing to commit, working tree clean/gm)) { - log.warn("Nothing to commit"); - } else { - log.success(stdout.join("")); - } - } catch (e: any) { - log.fail(e.toString()); - } - await next(); - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const commit = fnWrapper("commit", commitLogic); - -const helpers = { push }; - -type Helpers = typeof helpers; diff --git a/tooling/workflow/src/git/git.ts b/tooling/workflow/src/git/git.ts deleted file mode 100644 index b0de4c3b..00000000 --- a/tooling/workflow/src/git/git.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { branch } from "./branch.js"; -import { clone } from "./clone.js"; -import { commit } from "./commit.js"; -import { push } from "./push.js"; - -export const git = { clone, branch, push, commit }; diff --git a/tooling/workflow/src/git/helpers.ts b/tooling/workflow/src/git/helpers.ts deleted file mode 100644 index 003acf03..00000000 --- a/tooling/workflow/src/git/helpers.ts +++ /dev/null @@ -1,146 +0,0 @@ -import { CleanOptions, simpleGit } from "simple-git"; -import { invariant } from "ts-invariant"; -import { cwdContext } from "../contexts.js"; -import { isDirectory } from "../fs.js"; -import { logger } from "../helpers.js"; - -/** - * Get the default branch from a remote repository - */ -export const getDefaultBranchFromRemote = async (repository: string) => { - const stdout = await simpleGit().listRemote(["--symref", repository, "HEAD"]); - return stdout.match(/refs\/heads\/(\S+)/m)?.[1]; -}; - -/** - * Get the hash of a branch from a remote repository - */ -const getBranchHashFromRemote = async ( - repositoryUrl: string, - branch: string, -) => { - const stdout = await simpleGit().listRemote([repositoryUrl, branch]); - return stdout.split("\t")[0]; -}; - -const ensureBranchHash = async ({ - cwd, - hash, - branch, -}: { - cwd: string; - hash: string; - branch: string; -}) => { - const localHash = await simpleGit(cwd).revparse("HEAD"); - if (localHash !== hash) { - await simpleGit(cwd).pull("origin", branch); - } -}; - -export const syncForkRepository = async ( - key: string, - { - branch, - upstream, - fork, - }: { branch?: string; upstream: string; fork: string }, -) => { - const cwd = cwdContext.getStore(); - invariant(cwd, "No cwd found"); - const git = simpleGit(cwd.cwd); - const remoteDefaultBranch = await getDefaultBranchFromRemote(upstream); - invariant( - remoteDefaultBranch, - `No remote default branch found in ${upstream}`, - ); - const remoteDefaultBranchHashes = await Promise.all([ - getBranchHashFromRemote(upstream, remoteDefaultBranch), - getBranchHashFromRemote(fork, remoteDefaultBranch), - ]); - if (remoteDefaultBranchHashes[0] !== remoteDefaultBranchHashes[1]) { - const log = logger("Syncing forked repository"); - try { - if ( - !(await git.getRemotes()).some((remote) => remote.name === "upstream") - ) { - await git.addRemote("upstream", upstream); - } - await git.fetch("upstream", remoteDefaultBranch); - await git.checkout(branch || remoteDefaultBranch); - await git.mergeFromTo( - `upstream/${remoteDefaultBranch}`, - branch || remoteDefaultBranch, - ); - await git.push("origin", branch || remoteDefaultBranch); - log.success(); - } catch (error: any) { - log.fail(error.toString()); - } - } -}; - -export const cloneRepository = async ( - key: string, - { - repositoryUrl, - extraName, - shallow, - branch, - tmpDir, - }: { - repositoryUrl: string; - extraName?: string; - shallow?: boolean; - branch?: string; - tmpDir: string; - }, -) => { - if (await isDirectory(tmpDir)) { - const git = simpleGit(tmpDir); - console.log(`Directory ${tmpDir} already exists, skipping clone`); - await git.clean(CleanOptions.FORCE + CleanOptions.RECURSIVE); - await git.reset(["--hard"]); - const remoteDefaultBranch = await getDefaultBranchFromRemote(repositoryUrl); - invariant( - remoteDefaultBranch, - `No remote default branch found in ${repositoryUrl}`, - ); - await git.checkout(remoteDefaultBranch); - const remoteDefaultBranchHash = - remoteDefaultBranch && - (await getBranchHashFromRemote(repositoryUrl, remoteDefaultBranch)); - invariant( - remoteDefaultBranchHash, - `No remote default branch hash found in remote ${repositoryUrl}`, - ); - await ensureBranchHash({ - cwd: tmpDir, - hash: remoteDefaultBranchHash, - branch: remoteDefaultBranch, - }); - - const localBranches = (await git.branchLocal()).all.filter( - (branchName) => branchName !== remoteDefaultBranch, - ); - if (localBranches.length) { - await git.deleteLocalBranches(localBranches, true); - } - return; - } - - const log = logger(`Cloning repository: ${repositoryUrl} to ${tmpDir}`); - await simpleGit().clone( - repositoryUrl, - tmpDir, - shallow - ? [ - "--depth", - "1", - "--single-branch", - ...(branch ? [`--branch=${branch}`] : []), - ] - : [], - ); - log.success(); -}; diff --git a/tooling/workflow/src/git/push.ts b/tooling/workflow/src/git/push.ts deleted file mode 100644 index 7e4581ca..00000000 --- a/tooling/workflow/src/git/push.ts +++ /dev/null @@ -1,61 +0,0 @@ -import type { PLazy } from "../PLazy.js"; -import { getCwdContext, getRepositoryContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { logger } from "../helpers.js"; -import { spawn } from "../spawn.js"; - -export interface PushOptions { - /** - * @description Force push - * @default true - */ - force: boolean; -} - -export type PushReturn = PLazy & Helpers; - -/** - * @description Push changes to the current repository - * @param {PushOptions} options Options for push, force push is true by default - * @example - * ```ts - * import { git } from '@codemod.com/workflow' - * await git.clone('git://github.com/codemod-com/codemod.git', async ({ files, commit, push }) => { - * await files() - * .jsFam() - * .astGrep('console.log($$$ARGS)') - * .replace('console.error($$$ARGS)') - * await commit('feat: new branch') - * await push({ force: false }) - * }) - */ -export function pushLogic( - { force }: PushOptions = { force: true }, -): PushReturn { - return new FunctionExecutor("push") - .arguments(() => ({ force })) - .helpers(helpers) - .executor(async (next) => { - const { repository, branch } = getRepositoryContext(); - const { cwd } = getCwdContext(); - - const log = logger(`Pushing to ${repository}/tree/${branch}`); - try { - await spawn("git", ["push", ...(force ? ["-f"] : [])], { - cwd, - }); - log.success(); - } catch (e: any) { - log.fail(e.toString()); - } - await next(); - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const push = fnWrapper("push", pushLogic); - -const helpers = {}; - -type Helpers = typeof helpers; diff --git a/tooling/workflow/src/github/fork.ts b/tooling/workflow/src/github/fork.ts deleted file mode 100644 index 00fcbcc4..00000000 --- a/tooling/workflow/src/github/fork.ts +++ /dev/null @@ -1,127 +0,0 @@ -import type { RestEndpointMethodTypes } from "@octokit/rest"; -import { Octokit } from "@octokit/rest"; -import { memoize } from "lodash-es"; -import type { PLazy } from "../PLazy.js"; -import { getAuthService } from "../authService.js"; -import { repositoryContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { clone } from "../git/clone.js"; -import { logger, parseMultistring } from "../helpers.js"; -import { pr } from "./pr.js"; -import { getForkParameters } from "./utils.js"; - -type ForkConfig = RestEndpointMethodTypes["repos"]["createFork"]["parameters"]; - -export const forkRepository = async ( - key: string, - { - githubAPIKey, - parameters, - }: { - githubAPIKey: string; - parameters: ForkConfig; - }, -) => { - const octokit = new Octokit({ - auth: githubAPIKey, - }); - const log = logger(`Forking ${parameters.owner}/${parameters.repo}`); - try { - const response = await octokit.repos.createFork(parameters); - log.success(`Forked to ${response.data.full_name}`); - const sshUrl = response.data.ssh_url; - const branch = response.data.parent?.default_branch ?? "main"; - return { - repository: sshUrl, - branch, - }; - } catch (error: any) { - log.fail(error.toString()); - } -}; - -export type ForkReturn = PLazy & Helpers; - -export type ForkOptions = - | string - | readonly string[] - | ForkConfig - | (ForkConfig | string)[]; - -/** - * @description Forks a repository in github, requires authentication via Codemod CLI and Github permissions. - * @param urlOrParameters - The URL of the repository to fork or an array of URLs to fork. - * @param callback - A callback function to run after the fork is complete. - */ -export function forkLogic( - urlOrParameters: ForkOptions, - callback?: (helpers: Helpers) => void | Promise, -): ForkReturn { - const fork = memoize(forkRepository); - return new FunctionExecutor("fork") - .arguments(() => { - let forkParameters: ForkConfig[]; - - if ( - typeof urlOrParameters === "string" || - (Array.isArray(urlOrParameters) && - urlOrParameters.every((param) => typeof param === "string")) - ) { - forkParameters = - parseMultistring(urlOrParameters).map(getForkParameters); - } else if (Array.isArray(urlOrParameters)) { - forkParameters = urlOrParameters.map((param) => - typeof param === "string" ? getForkParameters(param) : param, - ); - } else { - forkParameters = [urlOrParameters as ForkConfig]; - } - - return { - forkParameters, - callback, - }; - }) - .helpers(helpers) - .executor(async (next, self) => { - const { forkParameters } = self.getArguments(); - const authService = getAuthService(); - const isAvailable = await authService?.ensureGithubScopes(["repo"]); - if (!isAvailable) { - console.log("Github scopes not available"); - return; - } - const githubAPIKey = await authService?.getGithubAPIKey(); - if (githubAPIKey) { - for (const parameters of forkParameters) { - const id = `${parameters.owner}/${parameters.repo}`; - const clonedRepo = await fork(id, { - githubAPIKey, - parameters, - }); - if (!clonedRepo) { - return; - } - await repositoryContext.run( - { - ...clonedRepo, - forkedFrom: `https://github.com/${parameters.owner}/${parameters.repo}`, - }, - () => next(), - ); - } - } - }) - .callback(async (self) => { - const { callback } = self.getArguments(); - await callback?.(helpers); - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const fork = fnWrapper("fork", forkLogic); - -const helpers = { clone, pr }; - -export type Helpers = typeof helpers; diff --git a/tooling/workflow/src/github/github.ts b/tooling/workflow/src/github/github.ts deleted file mode 100644 index 24d16827..00000000 --- a/tooling/workflow/src/github/github.ts +++ /dev/null @@ -1,4 +0,0 @@ -import { fork } from "./fork.js"; -import { pr } from "./pr.js"; - -export const github = { fork, pr }; diff --git a/tooling/workflow/src/github/pr.ts b/tooling/workflow/src/github/pr.ts deleted file mode 100644 index 03186d36..00000000 --- a/tooling/workflow/src/github/pr.ts +++ /dev/null @@ -1,146 +0,0 @@ -import { Octokit, type RestEndpointMethodTypes } from "@octokit/rest"; -import parseGitUrl from "git-url-parse"; -import type { PLazy } from "../PLazy.js"; -import { getAuthService } from "../authService.js"; -import { getGitContext, repositoryContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { getDefaultBranchFromRemote } from "../git/helpers.js"; -import { logger } from "../helpers.js"; - -export type PrOptions = { - /** - * Title of the PR - */ - title: string; - /** - * Body of the PR - */ - body?: string; - /** - * Whether the PR should be a draft - */ - draft?: boolean; -}; - -export type PrReturn = PLazy & Helpers; - -/** - * @description Create a PR (should be used together with fork) - * @param options Options for creating a PR - * @param options.title Title of the PR - * @param options.body Body of the PR - * @param options.draft Whether the PR should be a draft - * @example - * ```ts - * await github.fork`https://github.com/codemod-com/codemod.git` - * .clone(async ({ commit, files, push, pr, branch }) => { - * await branch`console-log-to-error`; - * await files() - * .jsFam() - * .astGrep`console.log($$$A)` - * .replace`console.error($$$A)` - * await commit`Change console.log to console.error` - * await push() - * await pr({ - * title: "Change console.log to console.error", - * body: "This PR changes all console.log to console.error", - * draft: true, - * }) - * }) - * ``` - */ -export function prLogic({ title, body, draft }: PrOptions): PrReturn { - return new FunctionExecutor("pr") - .arguments(() => { - return { - title, - body, - }; - }) - .helpers(helpers) - .executor(async (next, self) => { - const { body, title } = self.getArguments(); - const authService = getAuthService(); - const isAvailable = await authService?.ensureGithubScopes(["repo"]); - if (!isAvailable) { - console.log("Github scopes not available"); - return; - } - const githubAPIKey = await authService?.getGithubAPIKey(); - const gitContext = getGitContext(); - if (githubAPIKey) { - const octokit = new Octokit({ - auth: githubAPIKey, - }); - const url = parseGitUrl(gitContext.get("repository")); - let owner = url.owner; - let repo = url.name; - let head = (await gitContext.simpleGit.branchLocal()).current; - - const repository = repositoryContext.getStore(); - if (repository?.forkedFrom) { - const parentUrl = parseGitUrl(repository?.forkedFrom); - owner = parentUrl.owner; - repo = parentUrl.name; - head = `${url.owner}:${head}`; - } - - const parameters: RestEndpointMethodTypes["pulls"]["create"]["parameters"] = - { - owner, - repo, - title, - head, - base: (await getDefaultBranchFromRemote( - gitContext.get("repository"), - )) as string, - body, - draft, - }; - const log = logger(`Creating PR for ${owner}/${repo}`); - - try { - const response = await octokit.pulls.create(parameters); - log.success(`Created PR ${response.data.html_url}`); - } catch (error: any) { - if (error.toString().includes("A pull request already exists")) { - // Update PR - const prs = await octokit.pulls.list({ - owner, - repo, - head, - }); - if (prs.data.length > 0) { - const pr = prs - .data[0] as RestEndpointMethodTypes["pulls"]["list"]["response"]["data"][0]; - try { - await octokit.pulls.update({ - owner, - repo, - pull_number: pr.number, - title, - body, - }); - log.success(`Updated PR ${pr.html_url}`); - } catch (error: any) { - log.fail(error.toString()); - } - } else { - log.fail(error.toString()); - } - } else { - log.fail(error.toString()); - } - } - await next(); - } - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const pr = fnWrapper("pr", prLogic); - -const helpers = {}; - -type Helpers = typeof helpers; diff --git a/tooling/workflow/src/github/utils.ts b/tooling/workflow/src/github/utils.ts deleted file mode 100644 index 3258e4db..00000000 --- a/tooling/workflow/src/github/utils.ts +++ /dev/null @@ -1,14 +0,0 @@ -import type { RestEndpointMethodTypes } from "@octokit/rest"; -import parseGitUrl from "git-url-parse"; - -export const getForkParameters = ( - repoUrl: string, -): RestEndpointMethodTypes["repos"]["createFork"]["parameters"] => { - const url = parseGitUrl(repoUrl); - - return { - owner: url.owner, - repo: url.name, - name: url.name, - }; -}; diff --git a/tooling/workflow/src/helpers.ts b/tooling/workflow/src/helpers.ts deleted file mode 100644 index a5d9575e..00000000 --- a/tooling/workflow/src/helpers.ts +++ /dev/null @@ -1,93 +0,0 @@ -// @ts-ignore -import colors from "colors-cli"; -import { flattenDeep, identity, mapValues } from "lodash-es"; -import { getRepositoriesContext, parentContextLegacy } from "./contexts.js"; - -export const clc = { - blueBright: (text: string) => colors.blue_bt(text), - green: (text: string) => colors.green(text), - red: (text: string) => colors.red(text), - yellow: (text: string) => colors.yellow(text), -}; - -export const promiseTimeout = (ms: number) => - new Promise((resolve) => setTimeout(resolve, ms)); - -export const logger = (message: string) => { - console.info(`${clc.blueBright("RUN ")} ${message}`); - - return { - success: (output?: string) => - console.info( - `${clc.green("SUCC")} ${message}${ - output - ? `\n ${output - .split("\n") - .map((line) => `\n ${line}`) - .join("") - .trim()}` - : "" - }`, - ), - fail: (error: string) => - console.error(`${clc.red("ERR ")} ${message} - ${error}`), - warn: (warning: string) => - console.warn(`${clc.yellow("WARN")} ${message} - ${warning}`), - }; -}; - -export const parseRepositories = ( - repos: string | Readonly | ((...args: any[]) => Promise), -) => { - if (typeof repos === "string") { - return repos - .split(/[\n,; ]/) - .map((repository) => repository.trim()) - .filter(identity); - } - - if (typeof repos === "function") { - return getRepositoriesContext().repositories; - } - - return flattenDeep( - repos.map((repository) => - repository.split(/[\n, ;]/).map((repository) => repository.trim()), - ), - ).filter(identity); -}; - -export const parseMultistring = ( - repos: string | readonly string[], - splitWith = /[\n,; ]/, -) => { - if (typeof repos === "string") { - return repos - .split(splitWith) - .map((repository) => repository.trim()) - .filter(identity); - } - - return flattenDeep( - repos.map((repository) => - repository.split(splitWith).map((repository) => repository.trim()), - ), - ).filter(identity); -}; - -export type MapChildren any>> = - { - [Property in keyof Type]: ReturnType; - }; - -export const noContextFn = ReturnType>(cb: T) => - cb(); -export const wrapHelpers = (helpers: H, context: C): H => - mapValues( - // @ts-ignore - helpers, - (value: any) => - (...args: any[]) => - // @ts-ignore - parentContextLegacy.run(context, () => value(...args)), - ) as any; diff --git a/tooling/workflow/src/index.ts b/tooling/workflow/src/index.ts deleted file mode 100644 index 9109cca5..00000000 --- a/tooling/workflow/src/index.ts +++ /dev/null @@ -1,61 +0,0 @@ -import * as contexts from "./contexts.js"; - -export * from "./contexts.js"; - -import { git } from "./git/git.js"; - -import { SgNode, astGrep } from "./astGrep/astGrep.js"; - -import { jsFiles } from "./jsFiles.js"; - -import { dirs } from "./fs/dirs.js"; - -import { codemod } from "./codemod.js"; - -import { getTree } from "./engineHelpers.js"; - -import { files } from "./files.js"; - -import { exec } from "./exec.js"; - -import { question } from "./question.js"; - -import { github } from "./github/github.js"; - -import { AuthServiceInterface, setAuthService } from "./authService.js"; - -export { - git, - astGrep, - jsFiles, - contexts, - dirs, - codemod, - getTree, - files, - exec, - question, - github, - setAuthService, - AuthServiceInterface, - SgNode, -}; - -export const api = { - git, - astGrep, - jsFiles, - contexts, - dirs, - codemod, - getTree, - files, - exec, - question, - github, - setAuthService, -}; - -export { isWorkflowEngineFile } from "./isWorkflowEngineFile.js"; - -export type Api = typeof api; diff --git a/tooling/workflow/src/isWorkflowEngineFile.ts b/tooling/workflow/src/isWorkflowEngineFile.ts deleted file mode 100644 index f26a6619..00000000 --- a/tooling/workflow/src/isWorkflowEngineFile.ts +++ /dev/null @@ -1,16 +0,0 @@ -import { files } from "./files.js"; - -export async function isWorkflowEngineFile(filename: string) { - const maybeWorkflowFiles = files(filename); - return ( - (await maybeWorkflowFiles.astGrep`module.exports={workflow}`.exists()) || - (await maybeWorkflowFiles.astGrep`rule: - pattern: - context: "{ workflow: () => $_ }" -`.exists()) || - (await maybeWorkflowFiles.astGrep`rule: - pattern: - context: "export async function workflow($$$_) { $$$_ }" -`.exists()) - ); -} diff --git a/tooling/workflow/src/jsFam.ts b/tooling/workflow/src/jsFam.ts deleted file mode 100644 index 6bd58285..00000000 --- a/tooling/workflow/src/jsFam.ts +++ /dev/null @@ -1,144 +0,0 @@ -import { type NapiConfig, type SgNode, ts as astGrepTsx } from "@ast-grep/napi"; -import type { PLazy } from "./PLazy.js"; -import { astGrep } from "./astGrep/astGrep.js"; -import { getImports } from "./astGrep/getImports.js"; -import { getFileContext } from "./contexts.js"; -import { FunctionExecutor, fnWrapper } from "./engineHelpers.js"; -import { jscodeshift } from "./jsFam/jscodeshift.js"; - -export type JsFamReturn = PLazy & Helpers; - -/** - * @description Adds javascript/typescript context to get specific helpers (jscodeshift, work with imports). Also, it will change glob pattern for `files()` search function. - * @example - * ```ts - * await files() - * .jsFam() - * .jscodeshift((file, api) => { - * const j = api.jscodeshift; - * return j(file.source) - * .find(j.Identifier) - * .forEach((path) => { - * j(path).replaceWith(j.identifier("Hello")); - * }) - * }) - * ``` - */ -export function jsFamLogic(): JsFamReturn; -/** - * @description Adds javascript/typescript context to get specific helpers (jscodeshift, work with imports). Also, it will change glob pattern for `files()` search function. - * @param callback - A function that will be executed in the context of the javascript/typescript helpers. - * @example - * ```ts - * await files() - * .jsFam(({ jscodeshift }) => { - * jscodeshift((file, api) => { - * const j = api.jscodeshift; - * return j(file.source) - * .find(j.Identifier) - * .forEach((path) => { - * j(path).replaceWith(j.identifier("Hello")); - * }) - * }) - * }) - * ``` - * @see {@link astGrep} - * @see {@link jscodeshift} - * @see {@link addImport} - * @see {@link removeImport} - */ -export function jsFamLogic( - callback: (helpers: Helpers) => void | Promise, -): JsFamReturn; -export function jsFamLogic( - callback?: (helpers: Helpers) => void | Promise, -): JsFamReturn { - return new FunctionExecutor("jsFam") - .arguments(() => { - return { callback }; - }) - .helpers(helpers) - .setParentArgs({ defaultGlob: "**/*.{js,jsx,ts,tsx,cjs,mjs,cts,mts,d.ts}" }) - .return((self) => self.wrappedHelpers()) - .executor(async (next, self) => { - const { callback } = self.getArguments(); - - if (callback) { - await callback(helpers); - } - - await next(); - - const { importsUpdates } = getFileContext(); - const getImportInfo = (node: SgNode) => ({ - from: node.getMatch("FROM")?.text(), - imports: node - .getMultipleMatches("IMPORTS") - .filter((n) => n.kind() !== ",") - .map((n) => n.text()), - }); - const importRule: NapiConfig = { - rule: { - any: [ - { pattern: "import { $$$IMPORTS } from '$FROM'" }, - { pattern: 'import { $$$IMPORTS } from "$FROM"' }, - ], - }, - }; - if (importsUpdates.length) { - for (const { type, import: line } of importsUpdates) { - const namedImportsToChange = astGrepTsx - .parse(line) - .root() - .findAll(importRule); - for (const node of namedImportsToChange) { - const importChange = getImportInfo(node); - await astGrep(importRule).replace(({ getNode }) => { - const currentImports = getImportInfo(getNode()); - let modified = false; - if (currentImports.from === importChange.from) { - for (const namedImport of importChange.imports) { - if (type === "add") { - if (!currentImports.imports.includes(namedImport)) { - modified = true; - currentImports.imports.push(namedImport); - } - } else if (type === "remove") { - if (currentImports.imports.includes(namedImport)) { - modified = true; - currentImports.imports = currentImports.imports.filter( - (imp) => imp !== namedImport, - ); - } - } - } - } - if (modified) { - return `import { ${currentImports.imports.join(", ")} } from "${ - currentImports.from - }"`; - } - return undefined; - }); - } - } - } - }) - .run() as any; -} - -export const jsFam = fnWrapper("jsFam", jsFamLogic); - -const helpers = { - astGrep, - getImports, - addImport: (line: string) => { - getFileContext().importsUpdates.push({ type: "add", import: line }); - }, - removeImport: (line: string) => { - getFileContext().importsUpdates.push({ type: "remove", import: line }); - }, - jscodeshift, -}; - -export type Helpers = typeof helpers; diff --git a/tooling/workflow/src/jsFam/jscodeshift.ts b/tooling/workflow/src/jsFam/jscodeshift.ts deleted file mode 100644 index a74f5dd3..00000000 --- a/tooling/workflow/src/jsFam/jscodeshift.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { buildApi } from "@codemod-com/utilities"; -import type { API, FileInfo, Options } from "jscodeshift"; -import type { PLazy } from "../PLazy.js"; -import { getFileContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; - -export type JscodeshiftReturn = PLazy & Helpers; - -/** - * Run jscodeshift codemod for files in context - * @param callback - */ -export function jscodeshiftLogic( - callback: ( - file: FileInfo, - api: API, - options: Options, - ) => void | Promise | Promise | string, -): JscodeshiftReturn { - const api = buildApi("tsx"); - return new FunctionExecutor("jscodeshift") - .arguments(() => ({ callback })) - .helpers(() => helpers) - .return((self) => self.wrappedHelpers()) - .executor(async (next, self) => { - const { callback } = self.getArguments(); - const fileContext = getFileContext(); - const source = await fileContext.contents(); - - try { - const newData = await callback( - { path: fileContext.file, source }, - api, - {}, - ); - if (typeof newData === "string" && source !== newData) { - fileContext.setContents(newData); - await fileContext.save(); - } - } catch (e) { - console.error(`jscodeshift error: ${e} in ${fileContext.file}`); - } - - await next(); - }) - .run(); -} - -export const jscodeshift = fnWrapper("jscodeshift", jscodeshiftLogic); - -const helpers = {}; - -type Helpers = typeof helpers; diff --git a/tooling/workflow/src/jsFiles.ts b/tooling/workflow/src/jsFiles.ts deleted file mode 100644 index 17a5c253..00000000 --- a/tooling/workflow/src/jsFiles.ts +++ /dev/null @@ -1,165 +0,0 @@ -import * as path from "node:path"; -import { type NapiConfig, type SgNode, ts as astGrepTsx } from "@ast-grep/napi"; -import * as glob from "glob"; -import type { PLazy } from "./PLazy.js"; -import { astGrep } from "./astGrep/astGrep.js"; -import { getImports } from "./astGrep/getImports.js"; -import { fileContext, getCwdContext, getFileContext } from "./contexts.js"; -import { FileContext } from "./contexts/FileContext.js"; -import { FunctionExecutor, fnWrapper } from "./engineHelpers.js"; -import { parseMultistring } from "./helpers.js"; - -export type JsFilesReturn = PLazy & Helpers; - -/** - * @description Filter all js/ts files in current directory - * @deprecated Use `files().jsFam()` instead - */ -export function jsFilesLogic(): JsFilesReturn; -/** - * @description Filter file by glob pattern - * @deprecated Use `files(glob).jsFam()` instead - * @param globs string or array of globs to search for a files, could be comma/space separated string - * @example - * ```ts - * await jsFiles('src/app.ts,src/**∕*.tsx').astGrep`import React from 'react'`; - * ``` - */ -export function jsFilesLogic(globs: string | readonly string[]): JsFilesReturn; -/** - * @description Filter file by glob pattern and apply callback - * @deprecated Use `files(glob).jsFam(callback)` instead - */ -export function jsFilesLogic( - globs: string | readonly string[], - callback: (helpers: Helpers) => void | Promise, -): JsFilesReturn; -/** - * @description Filter all js/ts files in current directory and apply callback - * @deprecated Use `files().jsFam(callback)` instead - */ -export function jsFilesLogic( - callback: (helpers: Helpers) => void | Promise, -): JsFilesReturn; -export function jsFilesLogic( - rawGlobs?: - | string - | readonly string[] - | ((helpers: Helpers) => void | Promise), - maybeCallback?: (helpers: Helpers) => void | Promise, -): JsFilesReturn { - return new FunctionExecutor("jsFiles") - .arguments(() => { - const globs = parseMultistring( - !rawGlobs || typeof rawGlobs === "function" - ? "**/*.{js,jsx,ts,tsx,cjs,mjs}" - : rawGlobs, - /[\n; ]/, - ); - - const callback = - typeof rawGlobs === "function" ? rawGlobs : maybeCallback; - return { globs, callback }; - }) - .helpers(helpers) - .executor(async (next, self) => { - const { globs, callback } = self.getArguments(); - const { cwd } = getCwdContext(); - const files = await glob.glob(globs, { - cwd, - nodir: true, - ignore: [ - "**/node_modules/**", - "**/.git/**", - "**/dist/**", - "**/build/**", - ], - }); - - for (const file of files) { - await fileContext.run( - new FileContext({ file: path.join(cwd, file) }), - async () => { - if (callback) { - await callback(helpers); - } - - await next(); - - const { importsUpdates } = getFileContext(); - const getImportInfo = (node: SgNode) => ({ - from: node.getMatch("FROM")?.text(), - imports: node - .getMultipleMatches("IMPORTS") - .filter((n) => n.kind() !== ",") - .map((n) => n.text()), - }); - const importRule: NapiConfig = { - rule: { - any: [ - { pattern: "import { $$$IMPORTS } from '$FROM'" }, - { pattern: 'import { $$$IMPORTS } from "$FROM"' }, - ], - }, - }; - if (importsUpdates.length) { - for (const { type, import: line } of importsUpdates) { - const namedImportsToChange = astGrepTsx - .parse(line) - .root() - .findAll(importRule); - for (const node of namedImportsToChange) { - const importChange = getImportInfo(node); - await astGrep(importRule).replace(({ getNode }) => { - const currentImports = getImportInfo(getNode()); - let modified = false; - if (currentImports.from === importChange.from) { - for (const namedImport of importChange.imports) { - if (type === "add") { - if (!currentImports.imports.includes(namedImport)) { - modified = true; - currentImports.imports.push(namedImport); - } - } else if (type === "remove") { - if (currentImports.imports.includes(namedImport)) { - modified = true; - currentImports.imports = - currentImports.imports.filter( - (imp) => imp !== namedImport, - ); - } - } - } - } - if (modified) { - return `import { ${currentImports.imports.join( - ", ", - )} } from "${currentImports.from}"`; - } - return undefined; - }); - } - } - } - }, - ); - } - }) - .return((self) => self.wrappedHelpers()) - .run() as any; -} - -export const jsFiles = fnWrapper("jsFiles", jsFilesLogic); - -const helpers = { - astGrep, - getImports, - addImport: (line: string) => { - getFileContext().importsUpdates.push({ type: "add", import: line }); - }, - removeImport: (line: string) => { - getFileContext().importsUpdates.push({ type: "remove", import: line }); - }, -}; - -type Helpers = typeof helpers; diff --git a/tooling/workflow/src/json/json.ts b/tooling/workflow/src/json/json.ts deleted file mode 100644 index 7cd32e2a..00000000 --- a/tooling/workflow/src/json/json.ts +++ /dev/null @@ -1,41 +0,0 @@ -import type { PLazy } from "../PLazy.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { map } from "./map.js"; -import { update } from "./update.js"; - -export type JsonReturn = PLazy & Helpers; - -/** - * @description Filter all json files - */ -export function jsonLogic(): PLazy & Helpers; -export function jsonLogic( - callback: (helpers: Helpers) => void | Promise, -): JsonReturn; -export function jsonLogic( - callback?: (helpers: Helpers) => void | Promise, -): JsonReturn { - return new FunctionExecutor("json") - .arguments(() => { - return { callback }; - }) - .helpers(helpers) - .setParentArgs({ defaultGlob: "**/*.json" }) - .return((self) => self.wrappedHelpers()) - .executor(async (next, self) => { - const { callback } = self.getArguments(); - - if (callback) { - await callback(helpers); - } - - await next(); - }) - .run() as any; -} - -export const json = fnWrapper("json", jsonLogic); - -const helpers = { map, update }; - -export type Helpers = typeof helpers; diff --git a/tooling/workflow/src/json/map.ts b/tooling/workflow/src/json/map.ts deleted file mode 100644 index 37592830..00000000 --- a/tooling/workflow/src/json/map.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { getFileContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; - -/** - * Map json file contents - */ -export function mapLogic< - CALLBACK extends (helpers: Helpers) => ReturnType, - RETURN extends ReturnType, ->(callback: CALLBACK): Promise[]> { - const response = [] as Awaited[]; - return new FunctionExecutor("map") - .helpers(helpers) - .arguments(() => ({ callback })) - .executor(async (next, self) => { - const { callback } = self.getArguments(); - const result = await callback(helpers); - response.push(result as Awaited); - await next?.(); - }) - .return(() => response) - .run(); -} - -export const map = fnWrapper("map", mapLogic); - -const helpers = { - getContents: async () => - JSON.parse(await getFileContext().contents()) as T, -}; - -type Helpers = typeof helpers; diff --git a/tooling/workflow/src/json/update.ts b/tooling/workflow/src/json/update.ts deleted file mode 100644 index a4b69e27..00000000 --- a/tooling/workflow/src/json/update.ts +++ /dev/null @@ -1,42 +0,0 @@ -import detectIndent from "detect-indent"; -import { detectNewline } from "detect-newline"; -import type { PLazy } from "../PLazy.js"; -import { getFileContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; - -export type UpdateReturn = PLazy & Helpers; - -/** - * Update the contents of a json file - */ -export function updateLogic( - callback: (before: T) => T | Promise, -): UpdateReturn { - return new FunctionExecutor("update") - .helpers(helpers) - .arguments(() => ({ callback })) - .executor(async (next, self) => { - const { callback } = self.getArguments(); - const file = getFileContext(); - const beforeContents = await file.contents(); - const indent = detectIndent(beforeContents).indent || " "; - const newline = detectNewline(beforeContents) || "\n"; - const possibleNewline = beforeContents.slice(-newline.length); - const newlineToInsert = - newline.localeCompare(possibleNewline) === 0 ? newline : ""; - const afterContents = await callback(JSON.parse(beforeContents)); - file.setContents( - JSON.stringify(afterContents, null, indent).concat(newlineToInsert), - ); - await file.save(); - await next?.(); - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const update = fnWrapper("update", updateLogic); - -const helpers = {}; - -type Helpers = typeof helpers; diff --git a/tooling/workflow/src/question.ts b/tooling/workflow/src/question.ts deleted file mode 100644 index aa749125..00000000 --- a/tooling/workflow/src/question.ts +++ /dev/null @@ -1,26 +0,0 @@ -import inquirer, { type Answers } from "inquirer"; -import { FunctionExecutor, fnWrapper } from "./engineHelpers.js"; - -type Arguments = Parameters; - -/** - * Ask a question using [inquirer](https://www.npmjs.com/package/inquirer) - * @param args [questions, answers] - * @returns Promise - */ -export function questionLogic( - ...args: Arguments -): Promise { - let response: Return; - return new FunctionExecutor("question") - .arguments(() => ({ questions: args[0], answers: args[1] })) - .executor(async (next, self) => { - const { questions, answers } = self.getArguments(); - response = (await inquirer.prompt(questions, answers)) as any; - await next?.(); - }) - .return(() => response) - .run(); -} - -export const question = fnWrapper("question", questionLogic); diff --git a/tooling/workflow/src/spawn.ts b/tooling/workflow/src/spawn.ts deleted file mode 100644 index 4fc580d2..00000000 --- a/tooling/workflow/src/spawn.ts +++ /dev/null @@ -1,158 +0,0 @@ -import * as childProcess from "node:child_process"; -import * as fs from "node:fs"; - -import { noop, pickBy } from "lodash-es"; -import treeKill from "tree-kill"; - -export const spawn = ( - cmd: string, - args: string[], - miscOptions: childProcess.SpawnOptionsWithoutStdio & { - doNotThrowError?: boolean; - printOutput?: boolean; - printNewline?: boolean; - watch?: string; - doNotKill?: boolean; - filterEnv?: (key: string, value: any) => boolean; - } = {}, -): Promise<{ - stdout: string[]; - stderr: string[]; - error: Error; - kill: () => void; -}> => { - const cwd = miscOptions.cwd ?? process.cwd(); - - if (!fs.existsSync(cwd)) { - return Promise.reject( - new Error(`Provided directory: ${cwd} does not exist`), - ); - } - - return new Promise((resolve, reject) => { - const { - doNotThrowError, - printOutput, - printNewline, - watch, - doNotKill, - filterEnv, - ...execOptions - } = miscOptions; - - const env = pickBy( - { ...process.env, ...execOptions?.env, FORCE_COLOR: "" }, - (value, key) => filterEnv?.(key, value) ?? true, - ); - - const proc = childProcess.spawn(cmd, args, { - ...execOptions, - cwd, - env, - }); - - const pid = proc.pid as number; - const stderr = [] as string[]; - const stdout = [] as string[]; - - let caughtError: Error; - let killed = false; - - const kill = doNotKill - ? () => { - killed = true; - treeKill(pid, "SIGKILL"); - proc.stdin.end(); - proc.stdout.destroy(); - proc.stderr.destroy(); - } - : noop; - - proc.stdout.on("data", (data) => { - const chunk = data.toString(); - stdout.push(chunk); - if (chunk.includes("Proceed")) { - proc.stdin.write("y\n"); - } - if (watch && chunk.includes(watch)) { - if (!doNotKill) { - killed = true; - treeKill(pid, "SIGKILL"); - proc.stdin.end(); - proc.stdout.destroy(); - proc.stderr.destroy(); - } - resolve({ stdout, stderr, error: caughtError, kill }); - return; - } - - if (!killed) { - if (printOutput) { - process.stdout.write(chunk); - } - if (printNewline) { - proc.stdin.write("\n"); - } - } - }); - - proc.stderr.on("data", (data) => { - const chunk = data.toString(); - stderr.push(chunk); - if (watch && chunk.includes(watch)) { - if (!doNotKill) { - killed = true; - treeKill(pid, "SIGKILL"); - proc.stdin.end(); - proc.stdout.destroy(); - proc.stderr.destroy(); - } - resolve({ stdout, stderr, error: caughtError, kill }); - return; - } - - if (!killed) { - if (printOutput) { - process.stdout.write(chunk); - } - if (printNewline) { - proc.stdin.write("\n"); - } - } - }); - - proc.on("error", (error) => { - // console.log(error); - caughtError = error; - }); - - proc.on("close", (code) => { - if (!doNotThrowError) { - if (caughtError) { - reject( - new Error( - `Failed to execute command "${cmd} ${args.join( - " ", - )}" with error ${caughtError.toString()}`, - ), - ); - return; - } - - if (code) { - console.error(stdout.join("\n")); - console.error(stderr.join("\n")); - reject( - new Error( - `Failed to execute command "${cmd} ${args.join( - " ", - )}" with code ${code}`, - ), - ); - return; - } - } - resolve({ stdout, stderr, error: caughtError, kill }); - }); - }); -}; diff --git a/tooling/workflow/src/yaml/map.ts b/tooling/workflow/src/yaml/map.ts deleted file mode 100644 index ff2f64b1..00000000 --- a/tooling/workflow/src/yaml/map.ts +++ /dev/null @@ -1,35 +0,0 @@ -import * as YAML from "yaml"; -import { getFileContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; - -/** - * Map yaml file contents - */ -export function mapLogic< - CALLBACK extends ( - helpers: Helpers, - ) => ReturnType | Promise>, - RETURN extends ReturnType, ->(callback: CALLBACK): Promise[]> { - const response = [] as Awaited[]; - return new FunctionExecutor("map") - .helpers(helpers) - .arguments(() => ({ callback })) - .executor(async (next, self) => { - const { callback } = self.getArguments(); - const result = await callback(helpers); - response.push(result as Awaited); - await next?.(); - }) - .return(() => response) - .run(); -} - -export const map = fnWrapper("map", mapLogic); - -const helpers = { - getContents: async () => - YAML.parse(await getFileContext().contents()) as T, -}; - -type Helpers = typeof helpers; diff --git a/tooling/workflow/src/yaml/update.ts b/tooling/workflow/src/yaml/update.ts deleted file mode 100644 index 6e446053..00000000 --- a/tooling/workflow/src/yaml/update.ts +++ /dev/null @@ -1,36 +0,0 @@ -import detectIndent from "detect-indent"; -import * as YAML from "yaml"; -import type { PLazy } from "../PLazy.js"; -import { getFileContext } from "../contexts.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; - -export type UpdateReturn = PLazy & Helpers; - -/** - * Update the contents of a yaml file - */ -export function updateLogic( - callback: (before: T) => T | Promise, -): UpdateReturn { - return new FunctionExecutor("update") - .helpers(helpers) - .arguments(() => ({ callback })) - .executor(async (next, self) => { - const { callback } = self.getArguments(); - const file = getFileContext(); - const beforeContents = await file.contents(); - const indent = detectIndent(beforeContents).amount || 2; - const afterContents = await callback(YAML.parse(beforeContents)); - file.setContents(YAML.stringify(afterContents, { indent })); - await file.save(); - await next?.(); - }) - .return((self) => self.wrappedHelpers()) - .run(); -} - -export const update = fnWrapper("update", updateLogic); - -const helpers = {}; - -type Helpers = typeof helpers; diff --git a/tooling/workflow/src/yaml/yaml.ts b/tooling/workflow/src/yaml/yaml.ts deleted file mode 100644 index 258a7071..00000000 --- a/tooling/workflow/src/yaml/yaml.ts +++ /dev/null @@ -1,41 +0,0 @@ -import type { PLazy } from "../PLazy.js"; -import { FunctionExecutor, fnWrapper } from "../engineHelpers.js"; -import { map } from "./map.js"; -import { update } from "./update.js"; - -export type YamlReturn = PLazy & Helpers; - -/** - * Filter all yaml files - */ -export function yamlLogic(): PLazy & Helpers; -export function yamlLogic( - callback: (helpers: Helpers) => void | Promise, -): YamlReturn; -export function yamlLogic( - callback?: (helpers: Helpers) => void | Promise, -): YamlReturn { - return new FunctionExecutor("yaml") - .arguments(() => { - return { callback }; - }) - .helpers(helpers) - .setParentArgs({ defaultGlob: "**/*.yaml" }) - .return((self) => self.wrappedHelpers()) - .executor(async (next, self) => { - const { callback } = self.getArguments(); - - if (callback) { - await callback(helpers); - } - - await next(); - }) - .run() as any; -} - -export const yaml = fnWrapper("yaml", yamlLogic); - -const helpers = { map, update }; - -export type Helpers = typeof helpers; diff --git a/tooling/workflow/tsconfig.json b/tooling/workflow/tsconfig.json deleted file mode 100644 index bc6b5943..00000000 --- a/tooling/workflow/tsconfig.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "compilerOptions": { - "baseUrl": ".", - "rootDir": "./src", - "outDir": "./dist", - - "allowJs": true, - "checkJs": false, - "declaration": true, - "emitDeclarationOnly": true, - "isolatedModules": false - }, - "include": ["src/**/*"], - "exclude": ["dist/**/*", "node_modules/**/*"], - "extends": "@codemod-com/tsconfig/base.json" -} diff --git a/turbo.json b/turbo.json deleted file mode 100644 index 8d2b095c..00000000 --- a/turbo.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - "$schema": "https://turbo.build/schema.json", - "pipeline": { - "clean": { - "cache": false - }, - "build": { - "dependsOn": ["^build"], - "outputs": ["build/**", "dist/**"] - } - } - } - \ No newline at end of file diff --git a/vitest.config.ts b/vitest.config.ts deleted file mode 100644 index 185730f9..00000000 --- a/vitest.config.ts +++ /dev/null @@ -1,7 +0,0 @@ -import { configDefaults, defineConfig } from "vitest/config"; - -export default defineConfig({ - test: { - include: [...configDefaults.include, "**/test/*.ts", "**/test/*.js"], - }, -});