From a938041a037e297d9f99d311d9198ebc9c0fca6a Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 22 Oct 2024 15:13:08 +0200 Subject: [PATCH] fix lint --- package-lock.json | 16 +++++++++++++++- package.json | 3 ++- projects/nx-verdaccio/.eslintrc.json | 7 ++++++- projects/nx-verdaccio/package.json | 4 +--- .../env-bootstrap/executor.unit-test.ts | 2 +- .../src/executors/env-bootstrap/npm.unit-test.ts | 3 +-- .../src/executors/env-bootstrap/schema.ts | 2 +- .../src/executors/env-setup/executor.ts | 1 - .../src/executors/env-setup/schema.ts | 2 +- .../src/executors/env-teardown/teardown-env.ts | 3 +-- .../executors/kill-process/executor.unit-test.ts | 2 -- .../src/internal/environment-root.ts | 8 ++++---- 12 files changed, 33 insertions(+), 20 deletions(-) diff --git a/package-lock.json b/package-lock.json index 966d59e3..8fc9a85f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.0.0", "license": "MIT", "dependencies": { + "@rollup/rollup-linux-x64-gnu": "*", "memfs": "^4.11.1", "simple-git": "^3.27.0", "tslib": "^2.3.0", @@ -59,7 +60,8 @@ "optionalDependencies": { "@nx/nx-darwin-arm64": "^19.6.6", "@nx/nx-darwin-x64": "^19.6.6", - "@nx/nx-linux-x64-gnu": "^19.6.6" + "@nx/nx-linux-x64-gnu": "^19.6.6", + "@rollup/rollup-linux-x64-gnu": "^4.24.0" } }, "node_modules/@ampproject/remapping": { @@ -3714,6 +3716,18 @@ "darwin" ] }, + "node_modules/@rollup/rollup-linux-x64-gnu": { + "version": "4.24.0", + "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.24.0.tgz", + "integrity": "sha512-ZXFk7M72R0YYFN5q13niV0B7G8/5dcQ9JDp8keJSfr3GoZeXEoMHP/HlvqROA3OMbMdfr19IjCeNAnPUG93b6A==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ] + }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "dev": true, diff --git a/package.json b/package.json index 14efab1f..841f05ec 100644 --- a/package.json +++ b/package.json @@ -55,7 +55,8 @@ "optionalDependencies": { "@nx/nx-darwin-arm64": "^19.6.6", "@nx/nx-darwin-x64": "^19.6.6", - "@nx/nx-linux-x64-gnu": "^19.6.6" + "@nx/nx-linux-x64-gnu": "^19.6.6", + "@rollup/rollup-linux-x64-gnu": "^4.24.0" }, "nx": { "includedScripts": [] diff --git a/projects/nx-verdaccio/.eslintrc.json b/projects/nx-verdaccio/.eslintrc.json index ab72edb1..35abf250 100644 --- a/projects/nx-verdaccio/.eslintrc.json +++ b/projects/nx-verdaccio/.eslintrc.json @@ -40,7 +40,12 @@ "error", { "buildTargets": ["build"], - "ignoredDependencies": ["verdaccio"], + "ignoredDependencies": [ + "verdaccio", + "nx", + "@code-pushup/models", + "@nx/plugin" + ], "checkMissingDependencies": true, "checkObsoleteDependencies": true, "checkVersionMismatches": true, diff --git a/projects/nx-verdaccio/package.json b/projects/nx-verdaccio/package.json index e3b9bc7e..73eff258 100644 --- a/projects/nx-verdaccio/package.json +++ b/projects/nx-verdaccio/package.json @@ -8,9 +8,7 @@ "@nx/devkit": "19.8.0", "ansis": "^3.3.2", "simple-git": "^3.27.0", - "nx": "19.8.0", - "tslib": "^2.3.0", - "verdaccio": "*" + "tslib": "^2.3.0" }, "type": "commonjs", "main": "./src/index.js", diff --git a/projects/nx-verdaccio/src/executors/env-bootstrap/executor.unit-test.ts b/projects/nx-verdaccio/src/executors/env-bootstrap/executor.unit-test.ts index bf25290d..67a03b5b 100644 --- a/projects/nx-verdaccio/src/executors/env-bootstrap/executor.unit-test.ts +++ b/projects/nx-verdaccio/src/executors/env-bootstrap/executor.unit-test.ts @@ -5,7 +5,7 @@ import * as bootstrapExecutorModule from './bootstrap-env'; import { PACKAGE_NAME } from '../../plugin/constants'; import { TARGET_ENVIRONMENT_VERDACCIO_STOP } from '../../plugin/targets/environment.targets'; import { MockAsyncIterableIterator } from '@push-based/test-utils'; -import { ExecutorContext } from '@nx/devkit'; +import { type ExecutorContext } from '@nx/devkit'; describe('runBootstrapExecutor', () => { const e2eProjectName = 'my-lib-e2e'; diff --git a/projects/nx-verdaccio/src/executors/env-bootstrap/npm.unit-test.ts b/projects/nx-verdaccio/src/executors/env-bootstrap/npm.unit-test.ts index 1c1ea9d1..eed5dcd2 100644 --- a/projects/nx-verdaccio/src/executors/env-bootstrap/npm.unit-test.ts +++ b/projects/nx-verdaccio/src/executors/env-bootstrap/npm.unit-test.ts @@ -3,12 +3,11 @@ import { bold, red } from 'ansis'; import { MEMFS_VOLUME } from '@push-based/test-utils'; import { configureRegistry, - ConfigureRegistryOptions, + type ConfigureRegistryOptions, setupNpmWorkspace, unconfigureRegistry, VERDACCIO_ENV_TOKEN, } from './npm'; -import { exec } from 'node:child_process'; import { logger } from '@nx/devkit'; import { formatInfo } from '../../internal/logging'; diff --git a/projects/nx-verdaccio/src/executors/env-bootstrap/schema.ts b/projects/nx-verdaccio/src/executors/env-bootstrap/schema.ts index e5b57a01..f3ec1c41 100644 --- a/projects/nx-verdaccio/src/executors/env-bootstrap/schema.ts +++ b/projects/nx-verdaccio/src/executors/env-bootstrap/schema.ts @@ -1,4 +1,4 @@ -import { Environment } from './npm'; +import { type Environment } from './npm'; export type BootstrapExecutorOptions = Partial< { diff --git a/projects/nx-verdaccio/src/executors/env-setup/executor.ts b/projects/nx-verdaccio/src/executors/env-setup/executor.ts index 0d558448..9b57f9cf 100644 --- a/projects/nx-verdaccio/src/executors/env-setup/executor.ts +++ b/projects/nx-verdaccio/src/executors/env-setup/executor.ts @@ -15,7 +15,6 @@ import { } from '../../plugin/targets/environment.targets'; import { runSingleExecutor } from '../../internal/run-executor'; import { rm } from 'node:fs/promises'; -import { options } from 'yargs'; import { getEnvironmentRoot } from '../../internal/environment-root'; export type ExecutorOutput = { diff --git a/projects/nx-verdaccio/src/executors/env-setup/schema.ts b/projects/nx-verdaccio/src/executors/env-setup/schema.ts index 9688789c..672a8c7a 100644 --- a/projects/nx-verdaccio/src/executors/env-setup/schema.ts +++ b/projects/nx-verdaccio/src/executors/env-setup/schema.ts @@ -1,4 +1,4 @@ -import { Environment } from '../env-bootstrap/npm'; +import { type Environment } from '../env-bootstrap/npm'; export type SetupEnvironmentExecutorOptions = Partial< Environment & { diff --git a/projects/nx-verdaccio/src/executors/env-teardown/teardown-env.ts b/projects/nx-verdaccio/src/executors/env-teardown/teardown-env.ts index 9256b149..2dfe9b0a 100644 --- a/projects/nx-verdaccio/src/executors/env-teardown/teardown-env.ts +++ b/projects/nx-verdaccio/src/executors/env-teardown/teardown-env.ts @@ -14,8 +14,7 @@ export type TeardownEnvironmentOptions = Environment & { verbose?: boolean }; export async function teardownEnvironment( context: ExecutorContext, - options: TeardownEnvironmentOptions, - git: SimpleGit = gitClient + options: TeardownEnvironmentOptions ): Promise { const environmentRoot = getEnvironmentRoot(context, options); // kill verdaccio process if running diff --git a/projects/nx-verdaccio/src/executors/kill-process/executor.unit-test.ts b/projects/nx-verdaccio/src/executors/kill-process/executor.unit-test.ts index 6536fd7c..68f04beb 100644 --- a/projects/nx-verdaccio/src/executors/kill-process/executor.unit-test.ts +++ b/projects/nx-verdaccio/src/executors/kill-process/executor.unit-test.ts @@ -3,8 +3,6 @@ import runKillProcessExecutor from './executor'; import * as killProcessModule from './kill-process'; import { MEMFS_VOLUME } from '@push-based/test-utils'; import { logger } from '@nx/devkit'; -import { PACKAGE_NAME } from '../../plugin/constants'; -import { EXECUTOR_ENVIRONMENT_KILL_PROCESS } from './constant'; vi.mock('@nx/devkit', async () => { const actual = await vi.importActual('@nx/devkit'); diff --git a/projects/nx-verdaccio/src/internal/environment-root.ts b/projects/nx-verdaccio/src/internal/environment-root.ts index a779e66e..aedc8622 100644 --- a/projects/nx-verdaccio/src/internal/environment-root.ts +++ b/projects/nx-verdaccio/src/internal/environment-root.ts @@ -1,9 +1,9 @@ import { join } from 'node:path'; -import { ExecutorContext } from '@nx/devkit'; -import { ExpandedPluginConfiguration } from 'nx/src/config/nx-json'; -import { NxVerdaccioCreateNodeOptions } from '../plugin/schema'; +import { type ExecutorContext } from '@nx/devkit'; +import { type ExpandedPluginConfiguration } from 'nx/src/config/nx-json'; +import { type NxVerdaccioCreateNodeOptions } from '../plugin/schema'; import { DEFAULT_ENVIRONMENTS_OUTPUT_DIR } from '../plugin/constants'; -import { Environment } from '../executors/env-bootstrap/npm'; +import { type Environment } from '../executors/env-bootstrap/npm'; export function getEnvironmentDir(context: ExecutorContext) { const plugin = context.nxJsonConfiguration?.plugins?.find((pCfg) => {