From b1fa24a539b685d6f4308e20374133acefb3de31 Mon Sep 17 00:00:00 2001 From: Patrick Kerschbaum Date: Sun, 15 Sep 2024 16:28:26 +0200 Subject: [PATCH] chore: rename things --- .../.eslintrc.cjs | 5 +++++ .../project-1/src/globals.d.ts | 0 .../project-1/src/index.ts | 0 .../project-1/src/lib/some-js.d.ts | 0 .../project-1/src/lib/some-js.js | 0 .../project-1/src/some-directory/index.ts | 0 .../project-1/src/some-module.ts | 0 .../project-1/tsconfig.json | 0 .../project-2/src/index.ts | 0 .../project-2/src/some-module.ts | 0 .../project-2/tsconfig.json | 0 .../project-1/src/globals.d.ts | 0 .../project-1/src/index.ts | 0 .../project-1/src/some-directory/index.ts | 0 .../project-1/src/some-module.ts | 0 .../project-1/tsconfig.json | 0 .../project-2/src/index.ts | 0 .../project-2/src/some-module.ts | 0 .../test/{transformer.spec.mts => codemod.spec.mts} | 11 ++++++----- packages/runtime-extensions-node/package.json | 1 - platform/config-eslint/eslint-ecma.cjs | 9 +-------- pnpm-lock.yaml | 3 --- 22 files changed, 12 insertions(+), 17 deletions(-) rename packages/codemod-rewrite-module-specifiers-to-full-paths/test/{transformer-inputs => codemod-inputs}/project-1/src/globals.d.ts (100%) rename packages/codemod-rewrite-module-specifiers-to-full-paths/test/{transformer-inputs => codemod-inputs}/project-1/src/index.ts (100%) rename packages/codemod-rewrite-module-specifiers-to-full-paths/test/{transformer-inputs => codemod-inputs}/project-1/src/lib/some-js.d.ts (100%) rename packages/codemod-rewrite-module-specifiers-to-full-paths/test/{transformer-inputs => codemod-inputs}/project-1/src/lib/some-js.js (100%) rename packages/codemod-rewrite-module-specifiers-to-full-paths/test/{transformer-inputs => codemod-inputs}/project-1/src/some-directory/index.ts (100%) rename packages/codemod-rewrite-module-specifiers-to-full-paths/test/{transformer-inputs => codemod-inputs}/project-1/src/some-module.ts (100%) rename packages/codemod-rewrite-module-specifiers-to-full-paths/test/{transformer-inputs => codemod-inputs}/project-1/tsconfig.json (100%) rename packages/codemod-rewrite-module-specifiers-to-full-paths/test/{transformer-inputs => codemod-inputs}/project-2/src/index.ts (100%) rename packages/codemod-rewrite-module-specifiers-to-full-paths/test/{transformer-inputs => codemod-inputs}/project-2/src/some-module.ts (100%) rename packages/codemod-rewrite-module-specifiers-to-full-paths/test/{transformer-inputs => codemod-inputs}/project-2/tsconfig.json (100%) rename packages/codemod-rewrite-module-specifiers-to-full-paths/test/{transformer-outputs => codemod-outputs}/project-1/src/globals.d.ts (100%) rename packages/codemod-rewrite-module-specifiers-to-full-paths/test/{transformer-outputs => codemod-outputs}/project-1/src/index.ts (100%) rename packages/codemod-rewrite-module-specifiers-to-full-paths/test/{transformer-outputs => codemod-outputs}/project-1/src/some-directory/index.ts (100%) rename packages/codemod-rewrite-module-specifiers-to-full-paths/test/{transformer-outputs => codemod-outputs}/project-1/src/some-module.ts (100%) rename packages/codemod-rewrite-module-specifiers-to-full-paths/test/{transformer-outputs => codemod-outputs}/project-1/tsconfig.json (100%) rename packages/codemod-rewrite-module-specifiers-to-full-paths/test/{transformer-outputs => codemod-outputs}/project-2/src/index.ts (100%) rename packages/codemod-rewrite-module-specifiers-to-full-paths/test/{transformer-outputs => codemod-outputs}/project-2/src/some-module.ts (100%) rename packages/codemod-rewrite-module-specifiers-to-full-paths/test/{transformer.spec.mts => codemod.spec.mts} (76%) diff --git a/packages/codemod-rewrite-module-specifiers-to-full-paths/.eslintrc.cjs b/packages/codemod-rewrite-module-specifiers-to-full-paths/.eslintrc.cjs index 40ccf1c..967736a 100644 --- a/packages/codemod-rewrite-module-specifiers-to-full-paths/.eslintrc.cjs +++ b/packages/codemod-rewrite-module-specifiers-to-full-paths/.eslintrc.cjs @@ -6,6 +6,11 @@ module.exports = { ...baseEslintConfig.parserOptions, tsconfigRootDir: __dirname, }, + ignorePatterns: [ + ...(baseEslintConfig.ignorePatterns || []), + '**/codemod-inputs/**', + '**/codemod-outputs/**', + ], rules: { ...baseEslintConfig.rules, 'no-console': 'off', diff --git a/packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-inputs/project-1/src/globals.d.ts b/packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-inputs/project-1/src/globals.d.ts similarity index 100% rename from packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-inputs/project-1/src/globals.d.ts rename to packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-inputs/project-1/src/globals.d.ts diff --git a/packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-inputs/project-1/src/index.ts b/packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-inputs/project-1/src/index.ts similarity index 100% rename from packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-inputs/project-1/src/index.ts rename to packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-inputs/project-1/src/index.ts diff --git a/packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-inputs/project-1/src/lib/some-js.d.ts b/packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-inputs/project-1/src/lib/some-js.d.ts similarity index 100% rename from packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-inputs/project-1/src/lib/some-js.d.ts rename to packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-inputs/project-1/src/lib/some-js.d.ts diff --git a/packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-inputs/project-1/src/lib/some-js.js b/packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-inputs/project-1/src/lib/some-js.js similarity index 100% rename from packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-inputs/project-1/src/lib/some-js.js rename to packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-inputs/project-1/src/lib/some-js.js diff --git a/packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-inputs/project-1/src/some-directory/index.ts b/packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-inputs/project-1/src/some-directory/index.ts similarity index 100% rename from packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-inputs/project-1/src/some-directory/index.ts rename to packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-inputs/project-1/src/some-directory/index.ts diff --git a/packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-inputs/project-1/src/some-module.ts b/packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-inputs/project-1/src/some-module.ts similarity index 100% rename from packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-inputs/project-1/src/some-module.ts rename to packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-inputs/project-1/src/some-module.ts diff --git a/packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-inputs/project-1/tsconfig.json b/packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-inputs/project-1/tsconfig.json similarity index 100% rename from packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-inputs/project-1/tsconfig.json rename to packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-inputs/project-1/tsconfig.json diff --git a/packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-inputs/project-2/src/index.ts b/packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-inputs/project-2/src/index.ts similarity index 100% rename from packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-inputs/project-2/src/index.ts rename to packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-inputs/project-2/src/index.ts diff --git a/packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-inputs/project-2/src/some-module.ts b/packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-inputs/project-2/src/some-module.ts similarity index 100% rename from packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-inputs/project-2/src/some-module.ts rename to packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-inputs/project-2/src/some-module.ts diff --git a/packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-inputs/project-2/tsconfig.json b/packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-inputs/project-2/tsconfig.json similarity index 100% rename from packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-inputs/project-2/tsconfig.json rename to packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-inputs/project-2/tsconfig.json diff --git a/packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-outputs/project-1/src/globals.d.ts b/packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-outputs/project-1/src/globals.d.ts similarity index 100% rename from packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-outputs/project-1/src/globals.d.ts rename to packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-outputs/project-1/src/globals.d.ts diff --git a/packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-outputs/project-1/src/index.ts b/packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-outputs/project-1/src/index.ts similarity index 100% rename from packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-outputs/project-1/src/index.ts rename to packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-outputs/project-1/src/index.ts diff --git a/packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-outputs/project-1/src/some-directory/index.ts b/packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-outputs/project-1/src/some-directory/index.ts similarity index 100% rename from packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-outputs/project-1/src/some-directory/index.ts rename to packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-outputs/project-1/src/some-directory/index.ts diff --git a/packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-outputs/project-1/src/some-module.ts b/packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-outputs/project-1/src/some-module.ts similarity index 100% rename from packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-outputs/project-1/src/some-module.ts rename to packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-outputs/project-1/src/some-module.ts diff --git a/packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-outputs/project-1/tsconfig.json b/packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-outputs/project-1/tsconfig.json similarity index 100% rename from packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-outputs/project-1/tsconfig.json rename to packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-outputs/project-1/tsconfig.json diff --git a/packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-outputs/project-2/src/index.ts b/packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-outputs/project-2/src/index.ts similarity index 100% rename from packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-outputs/project-2/src/index.ts rename to packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-outputs/project-2/src/index.ts diff --git a/packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-outputs/project-2/src/some-module.ts b/packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-outputs/project-2/src/some-module.ts similarity index 100% rename from packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer-outputs/project-2/src/some-module.ts rename to packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod-outputs/project-2/src/some-module.ts diff --git a/packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer.spec.mts b/packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod.spec.mts similarity index 76% rename from packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer.spec.mts rename to packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod.spec.mts index 5ed2c14..c557cc7 100644 --- a/packages/codemod-rewrite-module-specifiers-to-full-paths/test/transformer.spec.mts +++ b/packages/codemod-rewrite-module-specifiers-to-full-paths/test/codemod.spec.mts @@ -5,10 +5,11 @@ import { test, expect } from 'vitest'; import { loadTypeScriptProgram } from '#pkg/load-typescript-program.js'; import { rewriteModuleSpecifiersOfTypeScriptProject } from '#pkg/transform/index.js'; -const PATH_TO_TRANSFORMER_INPUTS = path.join(__dirname, 'transformer-inputs'); +const PATH_TO_CODEMOD_INPUTS = path.join(__dirname, 'codemod-inputs'); +const PATH_TO_CODEMOD_OUTPUTS = path.join(__dirname, 'codemod-outputs'); test('project-1', async () => { - const projectAbsolutePath = path.join(PATH_TO_TRANSFORMER_INPUTS, 'project-1', 'tsconfig.json'); + const projectAbsolutePath = path.join(PATH_TO_CODEMOD_INPUTS, 'project-1', 'tsconfig.json'); const basepath = path.dirname(projectAbsolutePath); const typeScriptProgram = await loadTypeScriptProgram({ project: projectAbsolutePath, basepath }); @@ -23,14 +24,14 @@ test('project-1', async () => { ); const relativePathFromRootDir = path.relative(basepath, absolutePathSourceFile); await expect(newText).toMatchFileSnapshot( - `./transformer-outputs/project-1/${relativePathFromRootDir}`, + path.join(PATH_TO_CODEMOD_OUTPUTS, 'project-1', relativePathFromRootDir), ); }), ); }); test('project-2', async () => { - const projectAbsolutePath = path.join(PATH_TO_TRANSFORMER_INPUTS, 'project-2', 'tsconfig.json'); + const projectAbsolutePath = path.join(PATH_TO_CODEMOD_INPUTS, 'project-2', 'tsconfig.json'); const basepath = path.dirname(projectAbsolutePath); const typeScriptProgram = await loadTypeScriptProgram({ project: projectAbsolutePath, basepath }); @@ -45,7 +46,7 @@ test('project-2', async () => { ); const relativePathFromRootDir = path.relative(basepath, absolutePathSourceFile); await expect(newText).toMatchFileSnapshot( - `./transformer-outputs/project-2/${relativePathFromRootDir}`, + path.join(PATH_TO_CODEMOD_OUTPUTS, 'project-2', relativePathFromRootDir), ); }), ); diff --git a/packages/runtime-extensions-node/package.json b/packages/runtime-extensions-node/package.json index 4285d5a..36d512b 100644 --- a/packages/runtime-extensions-node/package.json +++ b/packages/runtime-extensions-node/package.json @@ -38,7 +38,6 @@ "nuke:artifacts": "del-cli dist \"*.tsbuildinfo\"" }, "dependencies": { - "@pkerschbaum/commons-node": "workspace:^", "source-map-support": "^0.5.21" }, "devDependencies": { diff --git a/platform/config-eslint/eslint-ecma.cjs b/platform/config-eslint/eslint-ecma.cjs index 6721c4f..458a58f 100644 --- a/platform/config-eslint/eslint-ecma.cjs +++ b/platform/config-eslint/eslint-ecma.cjs @@ -32,14 +32,7 @@ module.exports = { 'plugin:eslint-comments/recommended', 'prettier', ], - ignorePatterns: [ - '.eslintrc.cjs', - 'babel.config.mjs', - 'dist/**/*', - 'nyc.config.cjs', - '**/transformer-inputs/**', - '**/transformer-outputs/**', - ], + ignorePatterns: ['.eslintrc.cjs', 'babel.config.mjs', 'dist/**/*'], rules: { curly: 'error', 'multiline-comment-style': ['error', 'starred-block'], diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a2e342a..149eda6 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -296,9 +296,6 @@ importers: packages/runtime-extensions-node: dependencies: - '@pkerschbaum/commons-node': - specifier: workspace:^ - version: link:../commons-node source-map-support: specifier: ^0.5.21 version: 0.5.21