diff --git a/.changeset/README.md b/.changeset/README.md index 1bd5272..18e52b4 100644 --- a/.changeset/README.md +++ b/.changeset/README.md @@ -1,11 +1,9 @@ # Changesets -This folder is used by [Changesets](https://github.com/changesets/changesets) to manage versioning and changelogs for the codemods in this repository. +This directory contains changesets β€” short Markdown files that describe changes to packages in this repo. -To add a changeset, run: +When you run `pnpm changeset`, a new file is created here. Commit it with your PR. -``` -pnpm changeset -``` +When a PR is merged to `main`, the `release.yml` workflow consumes these files, bumps the relevant `package.json` and `codemod.yaml` versions, and opens a **Version Packages** PR. After that PR is merged, the workflow creates git tags and publishes the affected codemods. -Then follow the prompts to select which codemod(s) changed and the type of version bump. +See [Changesets docs](https://github.com/changesets/changesets) for more detail. diff --git a/.gitattributes b/.gitattributes index dfe0770..4176edc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,9 @@ -# Auto detect text files and perform LF normalization -* text=auto +* text=auto eol=lf + +*.ts diff=javascript +*.tsx diff=javascript +*.js diff=javascript +*.jsx diff=javascript +*.json linguist-language=JSON +*.yaml linguist-language=YAML +*.yml linguist-language=YAML diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9210204..16db62e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,15 +19,15 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 15 steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: pnpm/action-setup@v4 with: - version: 9.14.2 + version: 10.19.0 - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + - uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' cache: pnpm @@ -91,13 +91,13 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 20 steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@v4 - uses: pnpm/action-setup@v4 with: - version: 9.14.2 + version: 10.19.0 - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + - uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' cache: pnpm @@ -112,15 +112,15 @@ jobs: runs-on: ubuntu-latest timeout-minutes: 5 steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - uses: pnpm/action-setup@v4 with: - version: 9.14.2 + version: 10.19.0 - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + - uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' cache: pnpm @@ -146,8 +146,6 @@ jobs: d=$parent done done - # grep exits 1 when it filters down to zero lines; with `bash -e` that would - # abort before we can treat "no codemod dirs" as success (changeset-only PRs). changed_dirs=$(printf '%s\n' "$changed_dirs" | sort -u | grep -v '^$' || true) if [ -z "$changed_dirs" ]; then @@ -177,24 +175,42 @@ jobs: exit 0 fi - # Resolve the whole `.changeset/` tree; a quoted `*.md` pathspec is treated - # literally on many Linux/Git combinations and matches nothing, producing - # false "missing changeset" failures when codemods/ did change. changeset_files=$(git diff --name-only --diff-filter=ACMR origin/main...HEAD -- .changeset \ | grep '\.md$' \ | grep -v 'README.md' \ || true) covered_packages="" + has_empty_changeset=false for f in $changeset_files; do pkgs=$(sed -n '/^---$/,/^---$/{ /^---$/d; s/['\''`]//g; s/:.*//; p; }' "$f") - covered_packages="$covered_packages $pkgs" + pkgs=$(echo "$pkgs" | xargs) + if [ -z "$pkgs" ]; then + has_empty_changeset=true + else + covered_packages="$covered_packages $pkgs" + fi done covered_packages=$(echo "$covered_packages" | xargs) + # Empty changeset: package.json-only edits do not need a named bump. + if [ "$has_empty_changeset" = true ]; then + filtered="" + for dir in $changed_dirs; do + [ -f "$dir/package.json" ] || continue + pkg=$(node -p "require('./$dir/package.json').name") + other=$(git diff --name-only origin/main...HEAD -- "$dir/" | grep -v 'package.json$' || true) + if [ -n "$other" ]; then + filtered="$filtered $pkg" + else + echo "Empty changeset waives changeset for $pkg (package.json only)." + fi + done + changed_packages=$(echo "$filtered" | xargs) + fi + missing="" for pkg in $changed_packages; do - # Exact line match: `grep -w` is unreliable for hyphenated npm-style names on GNU grep. if ! printf '%s\n' $covered_packages | grep -Fxq "$pkg"; then missing="$missing $pkg" fi @@ -206,7 +222,7 @@ jobs: exit 0 fi - echo "::error::Missing changeset for: $missing" + echo "::warning::Missing changeset for: $missing" echo "" echo "The following packages were changed but not covered by a changeset:" for pkg in $missing; do @@ -217,4 +233,6 @@ jobs: echo " 1. Run 'pnpm changeset' to add a changeset covering the missing packages" echo " 2. Add an empty changeset (no packages selected) if no version bump is needed" echo " 3. Add the 'skip-changeset' label to this PR" - exit 1 + echo "" + echo "CI will continue; add a changeset before merge if you plan to release." + exit 0 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d435d34..63d5e4d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,8 +3,8 @@ name: Publish Codemod (Manual) on: workflow_dispatch: inputs: - codemod_path: - description: 'Path under codemods/ (e.g. apm/nodejs/dd-trace-js/v6/add-link-object-argument)' + tag: + description: 'Tag to publish (format: codemod-name@v1.0.0 or @scopename/codemodname@v1.0.0)' required: true type: string @@ -14,23 +14,126 @@ permissions: jobs: publish: + name: Validate and Publish Codemod runs-on: ubuntu-latest timeout-minutes: 10 steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - name: Harden Runner + uses: step-security/harden-runner@v2 + with: + egress-policy: audit + + - uses: actions/checkout@v4 + + - name: Parse tag and extract metadata + id: parse-tag + env: + TAG: ${{ github.event.inputs.tag }} + run: | + # Supports: @scopename/codemodname@v1.0.0 or codemodname@v1.0.0 + if [[ ! "$TAG" =~ ^(@[a-zA-Z0-9_-]+/[a-zA-Z0-9_-]+|[a-zA-Z0-9_-]+)@v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "❌ Invalid tag format: $TAG" + echo "Expected formats:" + echo " - @scopename/codemodname@v1.0.0 (scoped packages)" + echo " - codemodname@v1.0.0 (non-scoped packages)" + exit 1 + fi + + CODEMOD_NAME="${TAG%@v*}" + VERSION="v${TAG#*@v}" + + echo "codemod-name=$CODEMOD_NAME" >> $GITHUB_OUTPUT + echo "version=$VERSION" >> $GITHUB_OUTPUT + echo "βœ“ Parsed tag β€” Codemod: $CODEMOD_NAME, Version: $VERSION" + + - name: Find codemod directory + id: find-codemod + env: + CODEMOD_NAME: ${{ steps.parse-tag.outputs.codemod-name }} + VERSION: ${{ steps.parse-tag.outputs.version }} + run: | + echo "πŸ” Searching for codemod '$CODEMOD_NAME' in all codemod.yaml files..." + + CODEMOD_FILES=$(find codemods -name "codemod.yaml" -type f 2>/dev/null || true) + + if [[ -z "$CODEMOD_FILES" ]]; then + echo "❌ No codemod.yaml files found in codemods directory" + exit 1 + fi + + FOUND_PATH="" + + while IFS= read -r yaml_file; do + [[ ! -f "$yaml_file" ]] && continue + + if command -v yq >/dev/null 2>&1; then + YAML_NAME=$(yq eval '.name' "$yaml_file" 2>/dev/null || echo "") + YAML_VERSION=$(yq eval '.version' "$yaml_file" 2>/dev/null || echo "") + else + YAML_NAME=$(grep -E '^[[:space:]]*name[[:space:]]*:' "$yaml_file" | head -1 \ + | sed 's/^[[:space:]]*name[[:space:]]*:[[:space:]]*//' | sed "s/[[:space:]]*$//;s/^[\"']//;s/[\"']$//" || echo "") + YAML_VERSION=$(grep -E '^[[:space:]]*version[[:space:]]*:' "$yaml_file" | head -1 \ + | sed 's/^[[:space:]]*version[[:space:]]*:[[:space:]]*//' | sed "s/[[:space:]]*$//;s/^[\"']//;s/[\"']$//" || echo "") + fi + + if [[ "$YAML_NAME" == "$CODEMOD_NAME" && "v$YAML_VERSION" == "$VERSION" ]]; then + FOUND_PATH=$(dirname "$yaml_file") + echo "βœ… Found codemod at: $FOUND_PATH" + break + fi + done <<< "$CODEMOD_FILES" + + if [[ -z "$FOUND_PATH" ]]; then + echo "❌ Codemod '$CODEMOD_NAME' not found at version $VERSION" + echo "" + echo "Available codemods:" + while IFS= read -r yaml_file; do + [[ ! -f "$yaml_file" ]] && continue + if command -v yq >/dev/null 2>&1; then + NAME=$(yq eval '.name' "$yaml_file" 2>/dev/null || echo "unknown") + else + NAME=$(grep -E '^[[:space:]]*name[[:space:]]*:' "$yaml_file" | head -1 \ + | sed 's/^[[:space:]]*name[[:space:]]*:[[:space:]]*//' | sed "s/[[:space:]]*$//;s/^[\"']//;s/[\"']$//" || echo "unknown") + fi + echo " - $NAME (in $yaml_file)" + done <<< "$CODEMOD_FILES" + exit 1 + fi + + echo "codemod-path=$FOUND_PATH" >> $GITHUB_OUTPUT - uses: pnpm/action-setup@v4 with: - version: 9.14.2 + version: 10.19.0 - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + - uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' cache: pnpm - run: pnpm install --frozen-lockfile + - name: Run codemod tests + working-directory: ${{ steps.find-codemod.outputs.codemod-path }} + run: pnpm test + - name: Publish codemod - uses: codemod/publish-action@dd6c8dbc5ceb1a6146feba41481d88b43da50024 # v1 + uses: codemod/publish-action@v1 with: - path: codemods/${{ inputs.codemod_path }} + path: ${{ steps.find-codemod.outputs.codemod-path }} + + - name: Release summary + env: + TAG: ${{ github.event.inputs.tag }} + CODEMOD_PATH: ${{ steps.find-codemod.outputs.codemod-path }} + ACTOR: ${{ github.triggering_actor }} + run: | + cat >> $GITHUB_STEP_SUMMARY << EOF + # πŸš€ Codemod Publication Summary + + **Tag:** \`$TAG\` + **Path:** \`$CODEMOD_PATH\` + **Triggered by:** $ACTOR + + βœ… Codemod has been successfully published to the registry! + EOF diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 81c8320..dd10251 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -10,6 +10,7 @@ concurrency: release permissions: id-token: write contents: write + pull-requests: write jobs: release: @@ -19,16 +20,16 @@ jobs: outputs: changed_dirs: ${{ steps.tag.outputs.changed_dirs || '[]' }} steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@v4 with: fetch-depth: 0 fetch-tags: true - uses: pnpm/action-setup@v4 with: - version: 9.14.2 + version: 10.19.0 - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + - uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' cache: pnpm @@ -71,14 +72,34 @@ jobs: git add -A git commit -m "Version Packages" - - name: Push to main + - name: Open Version Packages pull request if: steps.diff.outputs.has_changes == 'true' + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - git pull --rebase origin main - git push origin main + BRANCH="changeset-release/version-packages" + + git push origin HEAD:"refs/heads/${BRANCH}" --force + + if gh pr list --base main --head "${BRANCH}" --state open --json number -q '.[0].number' | grep -q .; then + echo "Updated existing Version Packages pull request on branch ${BRANCH}" + else + gh pr create \ + --base main \ + --head "${BRANCH}" \ + --title "Version Packages" \ + --body "$(cat <<'EOF' + This PR was opened automatically by the Release workflow. + + It applies pending changesets: version bumps in `package.json`, synced `codemod.yaml` versions, and changelog updates. + + **After this PR is merged**, the Release workflow will create git tags and publish the affected codemods to the registry. + EOF + )" + fi - name: Tag released versions - if: steps.diff.outputs.has_changes == 'true' + if: steps.check.outputs.has_changesets != 'true' id: tag run: bash scripts/tag-and-publish.sh @@ -93,15 +114,15 @@ jobs: matrix: dir: ${{ fromJson(needs.release.outputs.changed_dirs) }} steps: - - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: actions/checkout@v4 with: ref: main - uses: pnpm/action-setup@v4 with: - version: 9.14.2 + version: 10.19.0 - - uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0 + - uses: actions/setup-node@v4 with: node-version-file: '.nvmrc' cache: pnpm @@ -109,6 +130,6 @@ jobs: - run: pnpm install --frozen-lockfile - name: Publish codemod - uses: codemod/publish-action@dd6c8dbc5ceb1a6146feba41481d88b43da50024 # v1 + uses: codemod/publish-action@v1 with: path: ${{ matrix.dir }} diff --git a/.gitignore b/.gitignore index 9d22381..112dd87 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,17 @@ +# Dependencies node_modules/ +tmp/ + +# Build outputs .turbo/ dist/ build/ coverage/ + +# System files .DS_Store +**/.DS_Store + +# Agent tooling .agents/ .codex/ diff --git a/.husky/pre-commit b/.husky/pre-commit index 5ee7abd..cb2c84d 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1 @@ -pnpm exec lint-staged +pnpm lint-staged diff --git a/.lintstagedrc.mjs b/.lintstagedrc.mjs index 7a291ec..12399f3 100644 --- a/.lintstagedrc.mjs +++ b/.lintstagedrc.mjs @@ -1,14 +1,16 @@ +const LOCKFILE_SUFFIXES = ['pnpm-lock.yaml', 'package-lock.json', 'npm-shrinkwrap.json'] + /** @param {string[]} files */ -function excludePnpmLockfile(files) { - return files.filter((f) => !f.endsWith('pnpm-lock.yaml')) +function excludeLockfiles(files) { + return files.filter((f) => !LOCKFILE_SUFFIXES.some((suffix) => f.endsWith(suffix))) } export default { - '*.{ts,js,mts,mjs}': ['oxfmt --write', 'oxlint --type-aware --type-check --fix'], + '*.{ts,tsx,js,jsx,mts,mjs}': ['oxfmt --write', 'oxlint --type-aware --type-check --fix'], /** @param {string[]} files */ '*.{json,yaml,yml}': (files) => { - const filtered = excludePnpmLockfile(files) + const filtered = excludeLockfiles(files) return filtered.length ? [`oxfmt --write ${filtered.join(' ')}`] : [] }, - 'codemods/**/scripts/*.ts': 'bash scripts/test-staged.sh', + 'codemods/**/scripts/**/*.ts': ["bash -c 'pnpm run test'"], } diff --git a/.nvmrc b/.nvmrc index 209e3ef..2bd5a0a 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -20 +22 diff --git a/AGENTS.md b/AGENTS.md index 3bf5d8a..2f1c5a9 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -4,8 +4,8 @@ Contributor conventions for this repo live in [`CONTRIBUTING.md`](./CONTRIBUTING Failure modes that most often trip agents here: -- **Forgetting `pnpm changeset`.** Pull requests that touch `codemods/` need a changeset covering each changed package (or the `skip-changeset` label). CI enforces this. See _Adding a changeset_ in `CONTRIBUTING.md`. -- **Editing `version` in `package.json` or `codemod.yaml` by hand to release.** Use Changesets; `pnpm run version-packages` syncs YAML. See _Release workflow_ in `CONTRIBUTING.md`. +- **Forgetting `pnpm changeset`.** Pull requests that touch `codemods/` should include a changeset covering each changed package (or the `skip-changeset` label). CI warns but does not fail when changesets are missing. See _Adding a changeset_ in `CONTRIBUTING.md`. +- **Editing `version` in `codemod.yaml` by hand.** The `version` field in `codemod.yaml` is synced automatically from `package.json` by `scripts/sync-codemod-versions.sh` when `pnpm run version-packages` runs. Only edit `version` in `package.json` (via changesets). See _Release workflow_ in `CONTRIBUTING.md`. - **Skipping local checks.** Run `pnpm run format`, `pnpm run lint`, and `pnpm run ci` before you call the task done. See _Development setup_ and _CI_ in `CONTRIBUTING.md`. Before declaring a task done, confirm layout and naming under _Adding a new codemod_ and _Package shape_ in `CONTRIBUTING.md`, and update fixtures whenever behavior changes. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index dcca2f8..2014b7c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -44,20 +44,23 @@ pnpm --filter test pnpm --filter check-types ``` -Use Node **20** locally (see [`.nvmrc`](./.nvmrc)) to match CI. +Use Node **22** locally (see [`.nvmrc`](./.nvmrc)) to match CI. ## Pre-commit hook -After `pnpm install`, Husky runs **lint-staged** before each commit: oxfmt and oxlint on staged files, plus targeted `pnpm test` when you touch `codemods/**/scripts/*.ts`. If something fails, fix or stage the updates and try again. +After `pnpm install`, Husky runs **lint-staged** before each commit: oxfmt and oxlint on staged files, plus targeted `pnpm test` when you touch `codemods/**/scripts/**/*.ts`. If something fails, fix or stage the updates and try again. The hook only inspects **staged** files. Files you did not touch can still fail a full-repo `pnpm run format:check` / `pnpm run lint` β€” CI focuses on **changed** paths for pull requests. ## CI -- **Pull requests to `main`:** `.github/workflows/ci.yml` installs with `pnpm install --frozen-lockfile`, runs **oxfmt** / **oxlint** on changed files, **`pnpm run docs:links`** on tracked Markdown, runs **test** and **check-types** only for codemod packages touched by the diff, and enforces **changesets** (see below). -- **Pushes to `main`:** the same workflow runs **`pnpm run docs:links`** and full-workspace `pnpm run ci` (all `@codemod/dd-trace-js-v6-*` tests and typechecks). +Three workflows run on every PR and push to `main`: -Match that locally before you push. +- **`ci.yml` β€” Pull request checks:** oxfmt / oxlint and docs-link checks on changed files; `pnpm test` and `pnpm run check-types` only for codemod packages touched by the diff. +- **`ci.yml` β€” Full workspace (main):** on every push to `main`, runs full `pnpm run ci` (all tests + typechecks) and `pnpm run docs:links`. +- **`ci.yml` β€” Changeset check:** warns when a PR touching `codemods/` is missing a changeset for a changed package (or use the `skip-changeset` label to silence the warning). + +Match the local checks (`pnpm run ci`) before you push. ## Making changes @@ -87,10 +90,20 @@ Commit the new markdown file under `.changeset/` with your PR. ## Release workflow +Releases are fully automated via `.github/workflows/release.yml` on every push to `main`: + 1. Merge a PR that includes one or more changesets into `main`. -2. [`.github/workflows/release.yml`](./.github/workflows/release.yml) consumes changesets, commits **Version Packages** to `main`, syncs `codemod.yaml` versions, creates **`name@vversion`** git tags for newly versioned packages, and publishes those packages with [`codemod/publish-action`](https://github.com/codemod/publish-action). +2. The `release` job detects the pending changesets, runs `pnpm run version-packages` which: + - bumps `version` in each affected `package.json` via `changeset version` + - syncs the new version into the matching `codemod.yaml` via `scripts/sync-codemod-versions.sh` +3. The bot opens (or updates) a **Version Packages** pull request on branch `changeset-release/version-packages` β€” it does not push directly to `main`. +4. Merge that PR (required checks apply like any other PR). +5. On the next push to `main`, `scripts/tag-and-publish.sh` creates a `@v` git tag for every bumped package and pushes the tags. +6. The `publish` job fans out a parallel matrix over the changed directories and publishes each codemod via [`codemod/publish-action`](https://github.com/codemod/publish-action). + +For emergencies (re-publish a specific codemod without a full release cycle), use the **Publish Codemod (Manual)** workflow (`.github/workflows/publish.yml`) and supply the tag, e.g. `@codemod/dd-trace-js-v6-add-link-object-argument@v0.3.0`. -Do not hand-edit the `version` field in package `package.json` or `codemod.yaml` to β€œsimulate” a release β€” automation owns bumps. The **Publish Codemod (Manual)** workflow ([`.github/workflows/publish.yml`](./.github/workflows/publish.yml)) is for emergencies: supply the path **under** `codemods/`, e.g. `apm/nodejs/dd-trace-js/v6/add-link-object-argument` or `apm/nodejs/dd-trace-js/v6/dd-trace-js-v6-migration-recipe`. +Do not hand-edit `version` in `package.json` or `codemod.yaml` to simulate a release β€” automation owns bumps. ## Adding a new codemod @@ -128,3 +141,33 @@ Each codemod package should include: - `tests//metrics.json` when the transform records metrics Keep transformations atomic and verifiable with fixtures. + +## Checks + +| Command | What it does | +| ----------------------- | ------------------------------ | +| `pnpm run format` | Auto-format with oxfmt | +| `pnpm run format:check` | Check formatting (no writes) | +| `pnpm run lint` | Lint with oxlint (type-aware) | +| `pnpm run lint:fix` | Lint and auto-fix with oxlint | +| `pnpm run test` | Run all codemod tests | +| `pnpm run check-types` | Typecheck all codemod packages | +| `pnpm run ci` | Full check (test + typecheck) | + +## Pull requests + +- Describe the codemod and its migration use case. +- Follow [Conventional Commits](https://www.conventionalcommits.org/): + +| Type | Usage | +| ---------- | ------------------------------------- | +| `feat` | New codemod or capability | +| `fix` | Bugfix in a transform or test | +| `docs` | Documentation-only changes | +| `refactor` | Non-feature, non-bugfix code changes | +| `test` | Add or update fixtures/tests | +| `chore` | Tooling, CI, formatting, repo hygiene | + +## License + +By contributing, you agree that your work will be licensed under the MIT License. diff --git a/codemods/apm/nodejs/dd-trace-js/v6/add-link-object-argument/package.json b/codemods/apm/nodejs/dd-trace-js/v6/add-link-object-argument/package.json index cd8551e..dfcdc57 100644 --- a/codemods/apm/nodejs/dd-trace-js/v6/add-link-object-argument/package.json +++ b/codemods/apm/nodejs/dd-trace-js/v6/add-link-object-argument/package.json @@ -8,12 +8,11 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@jssg/utils": "^0.0.7" + "@jssg/utils": "catalog:" }, "devDependencies": { - "@codemod.com/jssg-types": "latest", - "@types/node": "latest", - "typescript": "latest" - }, - "packageManager": "pnpm@9.14.2" + "@codemod.com/jssg-types": "catalog:", + "@types/node": "catalog:", + "typescript": "catalog:" + } } diff --git a/codemods/apm/nodejs/dd-trace-js/v6/dd-trace-js-v6-migration-recipe/package.json b/codemods/apm/nodejs/dd-trace-js/v6/dd-trace-js-v6-migration-recipe/package.json index 8755a57..0e0abb2 100644 --- a/codemods/apm/nodejs/dd-trace-js/v6/dd-trace-js-v6-migration-recipe/package.json +++ b/codemods/apm/nodejs/dd-trace-js/v6/dd-trace-js-v6-migration-recipe/package.json @@ -8,12 +8,11 @@ "check-types": "node --check ./scripts/metadata-tests.mjs" }, "dependencies": { - "@jssg/utils": "^0.0.7" + "@jssg/utils": "catalog:" }, "devDependencies": { - "@codemod.com/jssg-types": "latest", - "@types/node": "latest", - "typescript": "latest" - }, - "packageManager": "pnpm@9.14.2" + "@codemod.com/jssg-types": "catalog:", + "@types/node": "catalog:", + "typescript": "catalog:" + } } diff --git a/codemods/apm/nodejs/dd-trace-js/v6/flatten-ingestion-options/package.json b/codemods/apm/nodejs/dd-trace-js/v6/flatten-ingestion-options/package.json index 74884ab..b5faff3 100644 --- a/codemods/apm/nodejs/dd-trace-js/v6/flatten-ingestion-options/package.json +++ b/codemods/apm/nodejs/dd-trace-js/v6/flatten-ingestion-options/package.json @@ -8,12 +8,11 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@jssg/utils": "^0.0.7" + "@jssg/utils": "catalog:" }, "devDependencies": { - "@codemod.com/jssg-types": "latest", - "@types/node": "latest", - "typescript": "latest" - }, - "packageManager": "pnpm@9.14.2" + "@codemod.com/jssg-types": "catalog:", + "@types/node": "catalog:", + "typescript": "catalog:" + } } diff --git a/codemods/apm/nodejs/dd-trace-js/v6/move-exp-appsec-options/package.json b/codemods/apm/nodejs/dd-trace-js/v6/move-exp-appsec-options/package.json index 6524057..f396717 100644 --- a/codemods/apm/nodejs/dd-trace-js/v6/move-exp-appsec-options/package.json +++ b/codemods/apm/nodejs/dd-trace-js/v6/move-exp-appsec-options/package.json @@ -8,12 +8,11 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@jssg/utils": "^0.0.7" + "@jssg/utils": "catalog:" }, "devDependencies": { - "@codemod.com/jssg-types": "latest", - "@types/node": "latest", - "typescript": "latest" - }, - "packageManager": "pnpm@9.14.2" + "@codemod.com/jssg-types": "catalog:", + "@types/node": "catalog:", + "typescript": "catalog:" + } } diff --git a/codemods/apm/nodejs/dd-trace-js/v6/move-exp-iast-options/package.json b/codemods/apm/nodejs/dd-trace-js/v6/move-exp-iast-options/package.json index 257bd64..3a976fa 100644 --- a/codemods/apm/nodejs/dd-trace-js/v6/move-exp-iast-options/package.json +++ b/codemods/apm/nodejs/dd-trace-js/v6/move-exp-iast-options/package.json @@ -8,12 +8,11 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@jssg/utils": "^0.0.7" + "@jssg/utils": "catalog:" }, "devDependencies": { - "@codemod.com/jssg-types": "latest", - "@types/node": "latest", - "typescript": "latest" - }, - "packageManager": "pnpm@9.14.2" + "@codemod.com/jssg-types": "catalog:", + "@types/node": "catalog:", + "typescript": "catalog:" + } } diff --git a/codemods/apm/nodejs/dd-trace-js/v6/rename-b3-single-header-propagation-style/package.json b/codemods/apm/nodejs/dd-trace-js/v6/rename-b3-single-header-propagation-style/package.json index 62f95a2..6a2a609 100644 --- a/codemods/apm/nodejs/dd-trace-js/v6/rename-b3-single-header-propagation-style/package.json +++ b/codemods/apm/nodejs/dd-trace-js/v6/rename-b3-single-header-propagation-style/package.json @@ -8,12 +8,11 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@jssg/utils": "^0.0.7" + "@jssg/utils": "catalog:" }, "devDependencies": { - "@codemod.com/jssg-types": "latest", - "@types/node": "latest", - "typescript": "latest" - }, - "packageManager": "pnpm@9.14.2" + "@codemod.com/jssg-types": "catalog:", + "@types/node": "catalog:", + "typescript": "catalog:" + } } diff --git a/codemods/apm/nodejs/dd-trace-js/v6/rename-plugin-list-options/package.json b/codemods/apm/nodejs/dd-trace-js/v6/rename-plugin-list-options/package.json index a375d67..86406a3 100644 --- a/codemods/apm/nodejs/dd-trace-js/v6/rename-plugin-list-options/package.json +++ b/codemods/apm/nodejs/dd-trace-js/v6/rename-plugin-list-options/package.json @@ -8,12 +8,11 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@jssg/utils": "^0.0.7" + "@jssg/utils": "catalog:" }, "devDependencies": { - "@codemod.com/jssg-types": "latest", - "@types/node": "latest", - "typescript": "latest" - }, - "packageManager": "pnpm@9.14.2" + "@codemod.com/jssg-types": "catalog:", + "@types/node": "catalog:", + "typescript": "catalog:" + } } diff --git a/codemods/apm/nodejs/dd-trace-js/v6/rename-profiling-env-vars/package.json b/codemods/apm/nodejs/dd-trace-js/v6/rename-profiling-env-vars/package.json index 5fa39e3..bb7e743 100644 --- a/codemods/apm/nodejs/dd-trace-js/v6/rename-profiling-env-vars/package.json +++ b/codemods/apm/nodejs/dd-trace-js/v6/rename-profiling-env-vars/package.json @@ -8,12 +8,11 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@jssg/utils": "^0.0.7" + "@jssg/utils": "catalog:" }, "devDependencies": { - "@codemod.com/jssg-types": "latest", - "@types/node": "latest", - "typescript": "latest" - }, - "packageManager": "pnpm@9.14.2" + "@codemod.com/jssg-types": "catalog:", + "@types/node": "catalog:", + "typescript": "catalog:" + } } diff --git a/codemods/apm/nodejs/dd-trace-js/v6/rename-runtime-id-env-var/package.json b/codemods/apm/nodejs/dd-trace-js/v6/rename-runtime-id-env-var/package.json index f4d2c43..dae99c4 100644 --- a/codemods/apm/nodejs/dd-trace-js/v6/rename-runtime-id-env-var/package.json +++ b/codemods/apm/nodejs/dd-trace-js/v6/rename-runtime-id-env-var/package.json @@ -8,12 +8,11 @@ "check-types": "tsc --noEmit" }, "dependencies": { - "@jssg/utils": "^0.0.7" + "@jssg/utils": "catalog:" }, "devDependencies": { - "@codemod.com/jssg-types": "latest", - "@types/node": "latest", - "typescript": "latest" - }, - "packageManager": "pnpm@9.14.2" + "@codemod.com/jssg-types": "catalog:", + "@types/node": "catalog:", + "typescript": "catalog:" + } } diff --git a/package.json b/package.json index 688a574..446f028 100644 --- a/package.json +++ b/package.json @@ -13,31 +13,31 @@ "license": "MIT", "type": "module", "scripts": { - "test": "pnpm -r --filter \"@codemod/dd-trace-js-v6-*\" test", - "check-types": "pnpm -r --filter \"@codemod/dd-trace-js-v6-*\" check-types", - "ci": "pnpm run test && pnpm run check-types", "format": "oxfmt .", "format:check": "oxfmt --check .", "lint": "oxlint --type-aware --type-check --deny-warnings .", "lint:fix": "oxlint --type-aware --type-check --fix .", - "prepare": "husky", + "test": "pnpm --filter \"./codemods/**\" test", + "check-types": "pnpm --filter \"./codemods/**\" run check-types", + "ci": "pnpm run test && pnpm run check-types", + "docs:links": "git ls-files '*.md' | xargs pnpm exec markdown-link-check -q -c .markdown-link-check.json", "changeset": "changeset", "version-packages": "changeset version && bash scripts/sync-codemod-versions.sh", - "docs:links": "git ls-files '*.md' | xargs pnpm exec markdown-link-check -q -c .markdown-link-check.json" - }, - "dependencies": { - "@jssg/utils": "^0.0.7" + "prepare": "husky" }, "devDependencies": { - "@changesets/cli": "^2.31.0", - "@types/node": "latest", + "@changesets/cli": "^2.27.12", + "codemod": "^1.11.0", "husky": "^9.1.7", "lint-staged": "^17.0.4", - "markdown-link-check": "^3.14.2", + "markdown-link-check": "^3.13.6", "oxfmt": "^0.49.0", - "oxlint": "^1.64.0", + "oxlint": "^1.66.0", "oxlint-tsgolint": "^0.22.1", - "typescript": "6.0.3" + "typescript": "^5.8.3" + }, + "engines": { + "node": ">=20" }, - "packageManager": "pnpm@9.14.2" + "packageManager": "pnpm@10.19.0" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 0b7a75f..4493f7e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -4,20 +4,31 @@ settings: autoInstallPeers: true excludeLinksFromLockfile: false +catalogs: + default: + '@codemod.com/jssg-types': + specifier: ^1.5.1 + version: 1.6.1 + '@jssg/utils': + specifier: ^0.0.8 + version: 0.0.8 + '@types/node': + specifier: ^22.15.0 + version: 22.19.19 + typescript: + specifier: ^5.8.3 + version: 5.9.3 + importers: .: - dependencies: - '@jssg/utils': - specifier: ^0.0.7 - version: 0.0.7 devDependencies: '@changesets/cli': - specifier: ^2.31.0 + specifier: ^2.27.12 version: 2.31.0(@types/node@25.7.0) - '@types/node': - specifier: latest - version: 25.7.0 + codemod: + specifier: ^1.11.0 + version: 1.11.1 husky: specifier: ^9.1.7 version: 9.1.7 @@ -25,164 +36,164 @@ importers: specifier: ^17.0.4 version: 17.0.4 markdown-link-check: - specifier: ^3.14.2 + specifier: ^3.13.6 version: 3.14.2 oxfmt: specifier: ^0.49.0 version: 0.49.0 oxlint: - specifier: ^1.64.0 - version: 1.64.0(oxlint-tsgolint@0.22.1) + specifier: ^1.66.0 + version: 1.66.0(oxlint-tsgolint@0.22.1) oxlint-tsgolint: specifier: ^0.22.1 version: 0.22.1 typescript: - specifier: 6.0.3 - version: 6.0.3 + specifier: ^5.8.3 + version: 5.9.3 codemods/apm/nodejs/dd-trace-js/v6/add-link-object-argument: dependencies: '@jssg/utils': - specifier: ^0.0.7 - version: 0.0.7 + specifier: 'catalog:' + version: 0.0.8 devDependencies: '@codemod.com/jssg-types': - specifier: latest - version: 1.6.0 + specifier: 'catalog:' + version: 1.6.1 '@types/node': - specifier: latest - version: 25.7.0 + specifier: 'catalog:' + version: 22.19.19 typescript: - specifier: latest - version: 6.0.3 + specifier: 'catalog:' + version: 5.9.3 codemods/apm/nodejs/dd-trace-js/v6/dd-trace-js-v6-migration-recipe: dependencies: '@jssg/utils': - specifier: ^0.0.7 - version: 0.0.7 + specifier: 'catalog:' + version: 0.0.8 devDependencies: '@codemod.com/jssg-types': - specifier: latest - version: 1.6.0 + specifier: 'catalog:' + version: 1.6.1 '@types/node': - specifier: latest - version: 25.7.0 + specifier: 'catalog:' + version: 22.19.19 typescript: - specifier: latest - version: 6.0.3 + specifier: 'catalog:' + version: 5.9.3 codemods/apm/nodejs/dd-trace-js/v6/flatten-ingestion-options: dependencies: '@jssg/utils': - specifier: ^0.0.7 - version: 0.0.7 + specifier: 'catalog:' + version: 0.0.8 devDependencies: '@codemod.com/jssg-types': - specifier: latest - version: 1.6.0 + specifier: 'catalog:' + version: 1.6.1 '@types/node': - specifier: latest - version: 25.7.0 + specifier: 'catalog:' + version: 22.19.19 typescript: - specifier: latest - version: 6.0.3 + specifier: 'catalog:' + version: 5.9.3 codemods/apm/nodejs/dd-trace-js/v6/move-exp-appsec-options: dependencies: '@jssg/utils': - specifier: ^0.0.7 - version: 0.0.7 + specifier: 'catalog:' + version: 0.0.8 devDependencies: '@codemod.com/jssg-types': - specifier: latest - version: 1.6.0 + specifier: 'catalog:' + version: 1.6.1 '@types/node': - specifier: latest - version: 25.7.0 + specifier: 'catalog:' + version: 22.19.19 typescript: - specifier: latest - version: 6.0.3 + specifier: 'catalog:' + version: 5.9.3 codemods/apm/nodejs/dd-trace-js/v6/move-exp-iast-options: dependencies: '@jssg/utils': - specifier: ^0.0.7 - version: 0.0.7 + specifier: 'catalog:' + version: 0.0.8 devDependencies: '@codemod.com/jssg-types': - specifier: latest - version: 1.6.0 + specifier: 'catalog:' + version: 1.6.1 '@types/node': - specifier: latest - version: 25.7.0 + specifier: 'catalog:' + version: 22.19.19 typescript: - specifier: latest - version: 6.0.3 + specifier: 'catalog:' + version: 5.9.3 codemods/apm/nodejs/dd-trace-js/v6/rename-b3-single-header-propagation-style: dependencies: '@jssg/utils': - specifier: ^0.0.7 - version: 0.0.7 + specifier: 'catalog:' + version: 0.0.8 devDependencies: '@codemod.com/jssg-types': - specifier: latest - version: 1.6.0 + specifier: 'catalog:' + version: 1.6.1 '@types/node': - specifier: latest - version: 25.7.0 + specifier: 'catalog:' + version: 22.19.19 typescript: - specifier: latest - version: 6.0.3 + specifier: 'catalog:' + version: 5.9.3 codemods/apm/nodejs/dd-trace-js/v6/rename-plugin-list-options: dependencies: '@jssg/utils': - specifier: ^0.0.7 - version: 0.0.7 + specifier: 'catalog:' + version: 0.0.8 devDependencies: '@codemod.com/jssg-types': - specifier: latest - version: 1.6.0 + specifier: 'catalog:' + version: 1.6.1 '@types/node': - specifier: latest - version: 25.7.0 + specifier: 'catalog:' + version: 22.19.19 typescript: - specifier: latest - version: 6.0.3 + specifier: 'catalog:' + version: 5.9.3 codemods/apm/nodejs/dd-trace-js/v6/rename-profiling-env-vars: dependencies: '@jssg/utils': - specifier: ^0.0.7 - version: 0.0.7 + specifier: 'catalog:' + version: 0.0.8 devDependencies: '@codemod.com/jssg-types': - specifier: latest - version: 1.6.0 + specifier: 'catalog:' + version: 1.6.1 '@types/node': - specifier: latest - version: 25.7.0 + specifier: 'catalog:' + version: 22.19.19 typescript: - specifier: latest - version: 6.0.3 + specifier: 'catalog:' + version: 5.9.3 codemods/apm/nodejs/dd-trace-js/v6/rename-runtime-id-env-var: dependencies: '@jssg/utils': - specifier: ^0.0.7 - version: 0.0.7 + specifier: 'catalog:' + version: 0.0.8 devDependencies: '@codemod.com/jssg-types': - specifier: latest - version: 1.6.0 + specifier: 'catalog:' + version: 1.6.1 '@types/node': - specifier: latest - version: 25.7.0 + specifier: 'catalog:' + version: 22.19.19 typescript: - specifier: latest - version: 6.0.3 + specifier: 'catalog:' + version: 5.9.3 packages: @@ -245,8 +256,38 @@ packages: '@changesets/write@0.4.0': resolution: {integrity: sha512-CdTLvIOPiCNuH71pyDu3rA+Q0n65cmAbXnwWH84rKGiFumFzkmHNT8KHTMEchcxN+Kl8I54xGUhJ7l3E7X396Q==} - '@codemod.com/jssg-types@1.6.0': - resolution: {integrity: sha512-9b6rsL3RZJvOPJ+gUj1W0041mHF6eYwLt+wsa4zqxJWNsxLha0JvFyaQdcw5XfQ5Ldd+H/kV/yZ4dpN+hC9OXw==} + '@codemod.com/cli-darwin-arm64@1.11.1': + resolution: {integrity: sha512-AzEvJNIN/9wELU6DTQV5ffmb1PJyDNPBwA7xkl6BR3+mO51Swwn/aeuVsPaqIBIQN316b8qKkRBmL8ezYD0O1w==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [darwin] + + '@codemod.com/cli-darwin-x64@1.11.1': + resolution: {integrity: sha512-r/NTUj5iwFLkbzKk5Ut52cHNn24ubopNHtbgVe4kzIsY+FZnEP+5IcReK02Dyepf9riF8kWA3JURYy2Wi2vD/Q==} + engines: {node: '>= 10'} + cpu: [x64] + os: [darwin] + + '@codemod.com/cli-linux-arm64-gnu@1.11.1': + resolution: {integrity: sha512-hj8A+CO8AOJ8GRxNrLtsaXg6zjTKV9izXVFx7msXhq1CNomshGFaatGdpatg+2/4XwTx+d3nDGxz4S+hmaBzjA==} + engines: {node: '>= 10'} + cpu: [arm64] + os: [linux] + + '@codemod.com/cli-linux-x64-gnu@1.11.1': + resolution: {integrity: sha512-xqb2QZmcLnejRlHXUPqNtTWvnVcRpiXYozEbeDRUxBCCjI3t0yulENOS+6rXayoHS/8097OUKKxcm7vOtWmxDA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [linux] + + '@codemod.com/cli-win32-x64-msvc@1.11.1': + resolution: {integrity: sha512-l2bD+S6LEsYT3XN5bxpCG0ShtoP80LBI7rDcNNj42cWcX0NiySRavyIInowuenqXjVv6uwhPtbjFQQAtCUUEXA==} + engines: {node: '>= 10'} + cpu: [x64] + os: [win32] + + '@codemod.com/jssg-types@1.6.1': + resolution: {integrity: sha512-Ru2uSXk6oB48OxQKXidqSdgptxGd2AamUpZgnFoLZCnJCp/FjYEwP24yRKmdn+4Cylcw8LYtSJJSAZBz9DTP+A==} '@inquirer/external-editor@1.0.3': resolution: {integrity: sha512-RWbSrDiYmO4LbejWY7ttpxczuwQyZLBUyygsA9Nsv95hpzUWwnNTVQmAq3xuh7vNwCp07UTmE5i11XAEExx4RA==} @@ -257,8 +298,8 @@ packages: '@types/node': optional: true - '@jssg/utils@0.0.7': - resolution: {integrity: sha512-QNFw5L574aaMGoHL12dwmgN89uSsf6avU+4yf3a7qx2URSSA92lNvKJD/60gfM0OL8jyijjiUFHQVyvVtY5ODQ==} + '@jssg/utils@0.0.8': + resolution: {integrity: sha512-MftaLCW5LsgsxfUcenYlEfie/IojTvRXRiCo61UEsJZCXnod7AStV1dh/IZxIWU+Is0Flh5xegwomLPX9qLwKA==} '@manypkg/find-root@1.1.0': resolution: {integrity: sha512-mki5uBvhHzO8kYYix/WRy2WX8S3B5wdVSc9D6KcU5lQNglP2yt58/VfLuAK49glRXChosY8ap2oJ1qgma3GUVA==} @@ -438,116 +479,116 @@ packages: cpu: [x64] os: [win32] - '@oxlint/binding-android-arm-eabi@1.64.0': - resolution: {integrity: sha512-2r6Nq3XXGLHEXKkSj8JtmJ6N4gDw431DPFOg0ZoJHlNjnG6HVMm/ksQ10m0HJ8WBvwgMe1L50UHPaYZutCRPCw==} + '@oxlint/binding-android-arm-eabi@1.66.0': + resolution: {integrity: sha512-f7kq8N51T4phpzqfBpA2qaVTI/KrkCmNwaj3t/97I/WLTDI+UhlP5GL9eER+zVxBhtlx5rKXWByJU1/zDAvyaw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [android] - '@oxlint/binding-android-arm64@1.64.0': - resolution: {integrity: sha512-ePJMpePgg7fBv+L/hVx1xXRU5/5gd5m0obLA6hPEfLXF3GjpR8idIDbY1dhQYhyz1ms2wdTccSboo6KEd2Oxtg==} + '@oxlint/binding-android-arm64@1.66.0': + resolution: {integrity: sha512-xu6QO71tdDS9mjmLZ3AqhtaVHBvdmsOKkYnReNNDgh+XiwnsipeQOIxbiYOOO0iAXycJ+GK0wdMSZP/2j/AmSg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [android] - '@oxlint/binding-darwin-arm64@1.64.0': - resolution: {integrity: sha512-U4DMLQd10gJLuoSTLSGbfv3bGjTlUNsScm9Dgb8wwBqmCzidf1pE1pXV4doGNxqwH3KtVng1AGTINA0NvkGLvQ==} + '@oxlint/binding-darwin-arm64@1.66.0': + resolution: {integrity: sha512-HZ24VimSOC7mxuEA99e0H2FS0C1yO3+iW13jPRAk+e2njsUs3QeAXsafCDyaIrV/MirdOVez+etQNQsJE43zNQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [darwin] - '@oxlint/binding-darwin-x64@1.64.0': - resolution: {integrity: sha512-GoRIL48QWm4/TAvjN8pB1nAG+1/uqc9EdnWT9zqHeb6wsmjZtywj8VRe5aGW47Fdb64YtLOsdLqVxOvQuz98Wg==} + '@oxlint/binding-darwin-x64@1.66.0': + resolution: {integrity: sha512-awhj8ZvJrrRSnXj7V++rpZvTmnl99L6mi0B7gg7Cp7BN6cKpzuI481bHNLvXGA9GB1/oEgA3ponuyoAc6Md12A==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [darwin] - '@oxlint/binding-freebsd-x64@1.64.0': - resolution: {integrity: sha512-5dFkv4tkg7PxJJGS9/OjrJwjhuHczrd3OQOkRE0wHcLM+ncUnULtzEPWjqGOxTXxZnLWcB91bGiIznx89TVXyQ==} + '@oxlint/binding-freebsd-x64@1.66.0': + resolution: {integrity: sha512-KQF0oVV21/FjIqkRuL8Q1vh8ECsE5+ocdH5tcqTQ4ZnYuDVoYibQUNfqBjQaUsP6UIIda5Y75Wpm5p4RgQWiWw==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [freebsd] - '@oxlint/binding-linux-arm-gnueabihf@1.64.0': - resolution: {integrity: sha512-jsBqMLl/uOL5+Kq/+BtK9FrmiNGUbx8SiyZXv+WlUxA45KuwcLu9BfiSIL3I3DBDgWM3yZizDITnTK9BcqNBQg==} + '@oxlint/binding-linux-arm-gnueabihf@1.66.0': + resolution: {integrity: sha512-9u1rgwZSEXWb30vbFZzQ78HVXBo0WCKNwJ3a2InRUTNMRng+PUDIoSFmA+m4HdUfBaIqftShq8J8qHc+eE/Vig==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] - '@oxlint/binding-linux-arm-musleabihf@1.64.0': - resolution: {integrity: sha512-1lrj8At/Uuc9GhjrVFBQo0NEjfBrTkzpmtHIGAhNnIXqn1CAyGL+qrztUsXb2GIluJrpl9Q7qRLJOb/NqydacQ==} + '@oxlint/binding-linux-arm-musleabihf@1.66.0': + resolution: {integrity: sha512-Ynot2HR1bHxUaNWoC280MVTDfZuaWuP3XfSMRDhyuZrVjhzoaBCVFlw8h8qeZjWKVUBhPWFIxB7AQTlK8Z2WWg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm] os: [linux] - '@oxlint/binding-linux-arm64-gnu@1.64.0': - resolution: {integrity: sha512-HpSQbubwh03mMhAdy2BYtad/fsY8vDFHDAb6bUwuCYg2VD3xCQgn6ArKcO0oZyLCheacKTv4PrF3Mfu5hgoE2g==} + '@oxlint/binding-linux-arm64-gnu@1.66.0': + resolution: {integrity: sha512-xCbgzciGgo+A4aQZEknsNrNiIwY7sU5SfRuMmRjPIvZAgdF34cIHiKvwOsS5XRLjlTVSFwitmq6YclTtHTfU+g==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - '@oxlint/binding-linux-arm64-musl@1.64.0': - resolution: {integrity: sha512-00QQ0h0Y7u0G69BgiH3+ky2aaq/QvkDL6DYok8htIuJHxybiux5aQ8jwmg8qIk9wha6UagUP2BAwAzbemcJbpg==} + '@oxlint/binding-linux-arm64-musl@1.66.0': + resolution: {integrity: sha512-hmo+ZB/lHkR1HdDmnziNpzSLmulnUSu10VEqX2Yex7OwvoBAbjJQLvy4gIBRV3AAwWnCvAxKp5Nv1GE6LU1QMg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [linux] - '@oxlint/binding-linux-ppc64-gnu@1.64.0': - resolution: {integrity: sha512-2GaimTV6EMW+s5HS0An3oGbQme3BgHswvfVdGk3EB57Xe9+/gyT+Qd7lNVzb3rtir52vbIPzXfaYArzs5b5zcw==} + '@oxlint/binding-linux-ppc64-gnu@1.66.0': + resolution: {integrity: sha512-2Invd4Uyy81mVooQC5FBtfxSNrvcX1OxbMlVQ6M2erRrNI2awFYF26YNW2yFxdVFZ4ffNOWKghtMjhnUPsXsVA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ppc64] os: [linux] - '@oxlint/binding-linux-riscv64-gnu@1.64.0': - resolution: {integrity: sha512-H46AtFb9wypjoVwGdlxrm0DsD809NGmtiK9HiyPKTxkSte2YjhC4S+00rOIrwCaxcyPiGid3Y3OMXp5KMAkGZw==} + '@oxlint/binding-linux-riscv64-gnu@1.66.0': + resolution: {integrity: sha512-s0iXPDQVdgayE3RGa/N2DZF7tjgg0TwEtD1sGoDxqPDGrIXgo45H0yHknT0f9A0yteASsweYZtDyTuVlM4aSag==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] - '@oxlint/binding-linux-riscv64-musl@1.64.0': - resolution: {integrity: sha512-HEgsidjjvvyzdg82icYkuFCf7REDV7B9JFwbIMbVwrKLBY0MrXX+bku3POn/hduZ2yW91IyVDUMq0Bf02KwXQw==} + '@oxlint/binding-linux-riscv64-musl@1.66.0': + resolution: {integrity: sha512-OekL4XFiu7RPK0JIZi8VeHgtIXPREf42t8Cy/rKEsC+P3gcqDgNAAGiyuUOpdbG4wwbfue1q4CHcCO7spSve6w==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [riscv64] os: [linux] - '@oxlint/binding-linux-s390x-gnu@1.64.0': - resolution: {integrity: sha512-Axvm8qryotmKN00P5w4JapaSjvP2LOSbdbBJiX+2SuHd3QzhW7TUc8skqgw+ahQZ5DmzEYeHCqauvW8f32Ns6Q==} + '@oxlint/binding-linux-s390x-gnu@1.66.0': + resolution: {integrity: sha512-Ga1D0kj1SFslm34ThA/BdkUlyAYEnTsXyRC4pF0C5agZSwtGdHYWMTQWemUfBGp4RCG4QWXgdO+HmmmKqOtlBg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [s390x] os: [linux] - '@oxlint/binding-linux-x64-gnu@1.64.0': - resolution: {integrity: sha512-cR60vSd7+m+KRZ3GQGfDxWwahW5RMXg0qlGvAluZr0fTUYvw0H9N9AXAF/M/PMqgytyqvVNmBAkJG9l7U30Y1g==} + '@oxlint/binding-linux-x64-gnu@1.66.0': + resolution: {integrity: sha512-p5jfP1wUZe/IC3qpQO84n9DRnf9g3lKRtLBlQq23ykyrDglHcVx7sWmVTlPuU6SBw8mNnPzyOn022G3XZHnlww==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - '@oxlint/binding-linux-x64-musl@1.64.0': - resolution: {integrity: sha512-2u/aPZ9pEg7HnvZPDsHxUGNnrpr4qaHi+mCgLgpt+LYRzPrS4Px4wPfkIdRdr2GvKnaYyt+XSlto0Vm5sbStTg==} + '@oxlint/binding-linux-x64-musl@1.66.0': + resolution: {integrity: sha512-vUB/sYlYZorDL1ZD+o9mRv7zbsykrrFRtmgS6R8musZqLtrPRQn1gc1eGpuX+sfdccz42STl/AqldY6XRb2upQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [linux] - '@oxlint/binding-openharmony-arm64@1.64.0': - resolution: {integrity: sha512-kfhkGfCdoXLSxEkrhDlJrvBYajGmq+ma4EMc53dsOWTq+rIBOlI0vTBmpZNnM5oH2LY/K/w1HAK+UQEgjgpVUg==} + '@oxlint/binding-openharmony-arm64@1.66.0': + resolution: {integrity: sha512-yde+6p/F59xRkGR9H1HfngWRif1QRJjynZK349l+UI0H6w9hL3G8/AVaTHFyTtLVQ56qtNbX2/5Dc77n1ovnOg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [openharmony] - '@oxlint/binding-win32-arm64-msvc@1.64.0': - resolution: {integrity: sha512-r/cNKBFieONoVu2bb1KkVouq9W+edDUgHumXJGphCRRj+U0xaD4nanrw8ZOqo0IsutPkEM4vCcGBpak6x5aXMg==} + '@oxlint/binding-win32-arm64-msvc@1.66.0': + resolution: {integrity: sha512-O9GLucgoTdmOrbBX+EjzNe7o/Ze5TFOvXcib6bzUOtBOmj6cV+zw18NgB+cGKAkDw1Pdqs8vGkfHbbsLuDtXWg==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [arm64] os: [win32] - '@oxlint/binding-win32-ia32-msvc@1.64.0': - resolution: {integrity: sha512-tUw0xUUwEFVZbpJoeCblkv8SJA4Xz3CdXCJbAnBsiNLyxDrk2tLcxEAS6M73Q7hHHDg3OtwI8vZVK3t5RJt4Gw==} + '@oxlint/binding-win32-ia32-msvc@1.66.0': + resolution: {integrity: sha512-m3Pjwc2MfTcom4E4gOv7DyuGyt7OfGNCbmqDHd+N7EzXmP+ppHuudm2NjcA3AjV5TSeGxaguVF4SbTKHe1USYA==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [ia32] os: [win32] - '@oxlint/binding-win32-x64-msvc@1.64.0': - resolution: {integrity: sha512-9CBR+LO0JVST87fNTzzNxS5I29jIUO5gxT9i9+M3SDHHALElj9sY1Prf12tad3vIRC6OD7Ehtvvh+sn13vSwHw==} + '@oxlint/binding-win32-x64-msvc@1.66.0': + resolution: {integrity: sha512-/DbBvw8UFBhja6PqudUjV4UtfsJr0Oa7jUjWVKB0g86lj/VwnPrkngn0sFql3c9RDA0O16dh7ozsXb6GjNAzBQ==} engines: {node: ^20.19.0 || >=22.12.0} cpu: [x64] os: [win32] @@ -558,6 +599,9 @@ packages: '@types/node@12.20.55': resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} + '@types/node@22.19.19': + resolution: {integrity: sha512-dyh/xO2Fh5bYrfWaaqGrRQQGkNdmYw6AmaAUvYeUMNTWQtvb796ikLdmTchRmOlOiIJ1TDXfWgVx1QkUlQ6Hew==} + '@types/node@25.7.0': resolution: {integrity: sha512-z+pdZyxE+RTQE9AcboAZCb4otwcrvgHD+GlBpPgn0emDVt0ohrTMhAwlr2Wd9nZ+nihhYFxO2pThz3C5qSu2Eg==} @@ -639,6 +683,11 @@ packages: resolution: {integrity: sha512-xRwvIOMGrfOAnM1JYtqQImuaNtDEv9v6oIYAs4LIHwTiKee8uwvIi363igssOC0O5U04i4AlENs79LQLu9tEMw==} engines: {node: '>=20'} + codemod@1.11.1: + resolution: {integrity: sha512-9yoik6NpyxhVP9xZdPS16lUxD8xlT35d+COgctzxNve0y8v931FpFCjUDVx9ehH0v/8qnMyotcWBHTKW6EnLiA==} + engines: {node: '>= 16.0.0'} + hasBin: true + commander@14.0.3: resolution: {integrity: sha512-H+y0Jo/T1RZ9qPP4Eh1pkcQcLRglraJaSLoyOtHxu6AapkjWVCy2Sit1QQ4x3Dng8qDlSsZEet7g5Pq06MvTgw==} engines: {node: '>=20'} @@ -675,6 +724,10 @@ packages: resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} engines: {node: '>=8'} + detect-libc@2.1.2: + resolution: {integrity: sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==} + engines: {node: '>=8'} + dir-glob@3.0.1: resolution: {integrity: sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==} engines: {node: '>=8'} @@ -964,8 +1017,8 @@ packages: resolution: {integrity: sha512-YUSGSLUnoolsu8gxISEDio3q1rtsCozwfOzASUn3DT2mR2EeQ93uEEnen7s+6LpF+lyTQFln1pQfqwBh/fsVEg==} hasBin: true - oxlint@1.64.0: - resolution: {integrity: sha512-Star3SNpWPeWFPw7kRXIhXUSn6fdiAl25q15CQzH/9WaOtG6e9CWTc25vNZOCr4PE1yEP1GtKJKIKglhj3OmEQ==} + oxlint@1.66.0: + resolution: {integrity: sha512-N4LLxYLd94KEBqXDMDM5f+2PUpItTjDLreXe2Gn5KhjhCK4Qp2YUXaBi8Yu325ryOgKwt22m45fpD7nPOn69Yw==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: @@ -1186,11 +1239,14 @@ packages: tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} - typescript@6.0.3: - resolution: {integrity: sha512-y2TvuxSZPDyQakkFRPZHKFm+KKVqIisdg9/CZwm9ftvKXLP8NRWj38/ODjNbr43SsoXqNuAisEf1GdCxqWcdBw==} + typescript@5.9.3: + resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} engines: {node: '>=14.17'} hasBin: true + undici-types@6.21.0: + resolution: {integrity: sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==} + undici-types@7.21.0: resolution: {integrity: sha512-w9IMgQrz4O0YN1LtB7K5P63vhlIOvC7opSmouCJ+ZywlPAlO9gIkJ+otk6LvGpAs2wg4econaCz3TvQ9xPoyuQ==} @@ -1384,7 +1440,22 @@ snapshots: human-id: 4.1.3 prettier: 2.8.8 - '@codemod.com/jssg-types@1.6.0': {} + '@codemod.com/cli-darwin-arm64@1.11.1': + optional: true + + '@codemod.com/cli-darwin-x64@1.11.1': + optional: true + + '@codemod.com/cli-linux-arm64-gnu@1.11.1': + optional: true + + '@codemod.com/cli-linux-x64-gnu@1.11.1': + optional: true + + '@codemod.com/cli-win32-x64-msvc@1.11.1': + optional: true + + '@codemod.com/jssg-types@1.6.1': {} '@inquirer/external-editor@1.0.3(@types/node@25.7.0)': dependencies: @@ -1393,7 +1464,7 @@ snapshots: optionalDependencies: '@types/node': 25.7.0 - '@jssg/utils@0.0.7': {} + '@jssg/utils@0.0.8': {} '@manypkg/find-root@1.1.0': dependencies: @@ -1515,70 +1586,75 @@ snapshots: '@oxlint-tsgolint/win32-x64@0.22.1': optional: true - '@oxlint/binding-android-arm-eabi@1.64.0': + '@oxlint/binding-android-arm-eabi@1.66.0': optional: true - '@oxlint/binding-android-arm64@1.64.0': + '@oxlint/binding-android-arm64@1.66.0': optional: true - '@oxlint/binding-darwin-arm64@1.64.0': + '@oxlint/binding-darwin-arm64@1.66.0': optional: true - '@oxlint/binding-darwin-x64@1.64.0': + '@oxlint/binding-darwin-x64@1.66.0': optional: true - '@oxlint/binding-freebsd-x64@1.64.0': + '@oxlint/binding-freebsd-x64@1.66.0': optional: true - '@oxlint/binding-linux-arm-gnueabihf@1.64.0': + '@oxlint/binding-linux-arm-gnueabihf@1.66.0': optional: true - '@oxlint/binding-linux-arm-musleabihf@1.64.0': + '@oxlint/binding-linux-arm-musleabihf@1.66.0': optional: true - '@oxlint/binding-linux-arm64-gnu@1.64.0': + '@oxlint/binding-linux-arm64-gnu@1.66.0': optional: true - '@oxlint/binding-linux-arm64-musl@1.64.0': + '@oxlint/binding-linux-arm64-musl@1.66.0': optional: true - '@oxlint/binding-linux-ppc64-gnu@1.64.0': + '@oxlint/binding-linux-ppc64-gnu@1.66.0': optional: true - '@oxlint/binding-linux-riscv64-gnu@1.64.0': + '@oxlint/binding-linux-riscv64-gnu@1.66.0': optional: true - '@oxlint/binding-linux-riscv64-musl@1.64.0': + '@oxlint/binding-linux-riscv64-musl@1.66.0': optional: true - '@oxlint/binding-linux-s390x-gnu@1.64.0': + '@oxlint/binding-linux-s390x-gnu@1.66.0': optional: true - '@oxlint/binding-linux-x64-gnu@1.64.0': + '@oxlint/binding-linux-x64-gnu@1.66.0': optional: true - '@oxlint/binding-linux-x64-musl@1.64.0': + '@oxlint/binding-linux-x64-musl@1.66.0': optional: true - '@oxlint/binding-openharmony-arm64@1.64.0': + '@oxlint/binding-openharmony-arm64@1.66.0': optional: true - '@oxlint/binding-win32-arm64-msvc@1.64.0': + '@oxlint/binding-win32-arm64-msvc@1.66.0': optional: true - '@oxlint/binding-win32-ia32-msvc@1.64.0': + '@oxlint/binding-win32-ia32-msvc@1.66.0': optional: true - '@oxlint/binding-win32-x64-msvc@1.64.0': + '@oxlint/binding-win32-x64-msvc@1.66.0': optional: true '@tootallnate/quickjs-emscripten@0.23.0': {} '@types/node@12.20.55': {} + '@types/node@22.19.19': + dependencies: + undici-types: 6.21.0 + '@types/node@25.7.0': dependencies: undici-types: 7.21.0 + optional: true agent-base@7.1.4: {} @@ -1656,6 +1732,16 @@ snapshots: slice-ansi: 8.0.0 string-width: 8.2.1 + codemod@1.11.1: + dependencies: + detect-libc: 2.1.2 + optionalDependencies: + '@codemod.com/cli-darwin-arm64': 1.11.1 + '@codemod.com/cli-darwin-x64': 1.11.1 + '@codemod.com/cli-linux-arm64-gnu': 1.11.1 + '@codemod.com/cli-linux-x64-gnu': 1.11.1 + '@codemod.com/cli-win32-x64-msvc': 1.11.1 + commander@14.0.3: {} cross-spawn@7.0.6: @@ -1688,6 +1774,8 @@ snapshots: detect-indent@6.1.0: {} + detect-libc@2.1.2: {} + dir-glob@3.0.1: dependencies: path-type: 4.0.0 @@ -2018,27 +2106,27 @@ snapshots: '@oxlint-tsgolint/win32-arm64': 0.22.1 '@oxlint-tsgolint/win32-x64': 0.22.1 - oxlint@1.64.0(oxlint-tsgolint@0.22.1): + oxlint@1.66.0(oxlint-tsgolint@0.22.1): optionalDependencies: - '@oxlint/binding-android-arm-eabi': 1.64.0 - '@oxlint/binding-android-arm64': 1.64.0 - '@oxlint/binding-darwin-arm64': 1.64.0 - '@oxlint/binding-darwin-x64': 1.64.0 - '@oxlint/binding-freebsd-x64': 1.64.0 - '@oxlint/binding-linux-arm-gnueabihf': 1.64.0 - '@oxlint/binding-linux-arm-musleabihf': 1.64.0 - '@oxlint/binding-linux-arm64-gnu': 1.64.0 - '@oxlint/binding-linux-arm64-musl': 1.64.0 - '@oxlint/binding-linux-ppc64-gnu': 1.64.0 - '@oxlint/binding-linux-riscv64-gnu': 1.64.0 - '@oxlint/binding-linux-riscv64-musl': 1.64.0 - '@oxlint/binding-linux-s390x-gnu': 1.64.0 - '@oxlint/binding-linux-x64-gnu': 1.64.0 - '@oxlint/binding-linux-x64-musl': 1.64.0 - '@oxlint/binding-openharmony-arm64': 1.64.0 - '@oxlint/binding-win32-arm64-msvc': 1.64.0 - '@oxlint/binding-win32-ia32-msvc': 1.64.0 - '@oxlint/binding-win32-x64-msvc': 1.64.0 + '@oxlint/binding-android-arm-eabi': 1.66.0 + '@oxlint/binding-android-arm64': 1.66.0 + '@oxlint/binding-darwin-arm64': 1.66.0 + '@oxlint/binding-darwin-x64': 1.66.0 + '@oxlint/binding-freebsd-x64': 1.66.0 + '@oxlint/binding-linux-arm-gnueabihf': 1.66.0 + '@oxlint/binding-linux-arm-musleabihf': 1.66.0 + '@oxlint/binding-linux-arm64-gnu': 1.66.0 + '@oxlint/binding-linux-arm64-musl': 1.66.0 + '@oxlint/binding-linux-ppc64-gnu': 1.66.0 + '@oxlint/binding-linux-riscv64-gnu': 1.66.0 + '@oxlint/binding-linux-riscv64-musl': 1.66.0 + '@oxlint/binding-linux-s390x-gnu': 1.66.0 + '@oxlint/binding-linux-x64-gnu': 1.66.0 + '@oxlint/binding-linux-x64-musl': 1.66.0 + '@oxlint/binding-openharmony-arm64': 1.66.0 + '@oxlint/binding-win32-arm64-msvc': 1.66.0 + '@oxlint/binding-win32-ia32-msvc': 1.66.0 + '@oxlint/binding-win32-x64-msvc': 1.66.0 oxlint-tsgolint: 0.22.1 p-filter@2.1.0: @@ -2237,9 +2325,12 @@ snapshots: tslib@2.8.1: {} - typescript@6.0.3: {} + typescript@5.9.3: {} + + undici-types@6.21.0: {} - undici-types@7.21.0: {} + undici-types@7.21.0: + optional: true undici@7.25.0: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 76006fa..9f38a8c 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,2 +1,10 @@ packages: - 'codemods/**' + - '!codemods/**/tests/**' + - '!codemods/**/tmp/**' + +catalog: + '@codemod.com/jssg-types': '^1.5.1' + '@jssg/utils': '^0.0.8' + '@types/node': '^22.15.0' + 'typescript': '^5.8.3' diff --git a/scripts/tag-and-publish.sh b/scripts/tag-and-publish.sh index 94da48c..f657105 100755 --- a/scripts/tag-and-publish.sh +++ b/scripts/tag-and-publish.sh @@ -26,9 +26,14 @@ tag_exists_anywhere() { changed_dirs="[]" new_tags=() -while IFS= read -r pkg_json; do - [ -z "$pkg_json" ] && continue - dir="$(dirname "$pkg_json")" +while IFS= read -r codemod_yaml; do + [ -z "$codemod_yaml" ] && continue + dir="$(dirname "$codemod_yaml")" + pkg_json="$dir/package.json" + if [ ! -f "$pkg_json" ]; then + echo "Skipping $dir: package.json not found" >&2 + continue + fi name="$(node -p "require('./$pkg_json').name")" version="$(node -p "require('./$pkg_json').version")" tag="${name}@v${version}" @@ -42,7 +47,7 @@ while IFS= read -r pkg_json; do git tag "$tag" new_tags+=("$tag") changed_dirs="$(echo "$changed_dirs" | node -p "JSON.stringify([...JSON.parse(require('fs').readFileSync('/dev/stdin','utf8')), \"$dir\"])")" -done < <(find codemods -path '*/node_modules/*' -prune -o -name package.json -print | sort) +done < <(find codemods -path '*/node_modules/*' -prune -o -name codemod.yaml -print | sort) for tag in "${new_tags[@]}"; do git push origin "refs/tags/$tag" diff --git a/scripts/test-staged.sh b/scripts/test-staged.sh deleted file mode 100755 index fe2714c..0000000 --- a/scripts/test-staged.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -dirs=() -for file in "$@"; do - dir=$(dirname "$file") - pkg_dir=$(cd "$dir" && cd .. && pwd) - dirs+=("$pkg_dir") -done - -unique_dirs=($(printf '%s\n' "${dirs[@]}" | sort -u)) - -for pkg in "${unique_dirs[@]}"; do - if [ -f "$pkg/package.json" ]; then - (cd "$pkg" && pnpm test) - fi -done diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..cdd8d44 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,27 @@ +{ + "include": ["codemods/**/*.ts"], + "exclude": [ + "**/tests/**/*", + "**/rules/**/*.yml", + "**/scripts/**/*.ts", + "**/node_modules/**/*", + "**/*.test.ts", + "**/*.test.js", + "**/*.spec.ts", + "**/*.spec.js", + "**/dist/**/*", + "**/build/**/*" + ], + "compilerOptions": { + "target": "ES2020", + "module": "ESNext", + "moduleResolution": "Bundler", + "strict": true, + "noEmit": true, + "skipLibCheck": true, + "resolveJsonModule": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "types": [] + } +}