diff --git a/tooling/build-env/src/executors/setup/executor.ts b/tooling/build-env/src/executors/setup/executor.ts index a3f9dc4a..700f6c01 100644 --- a/tooling/build-env/src/executors/setup/executor.ts +++ b/tooling/build-env/src/executors/setup/executor.ts @@ -7,6 +7,7 @@ import { objectToCliArgs } from '../../internal/utils/terminal-command'; import type { VerdaccioProcessResult } from '../../internal/verdaccio/verdaccio-registry'; import type { SetupEnvironmentExecutorOptions } from './schema'; import { normalizeOptions } from '../internal/normalize-options'; +import { VERDACCIO_REGISTRY_JSON } from '../../internal/verdaccio/verdaccio-npm-env'; export type ExecutorOutput = { success: boolean; @@ -50,14 +51,14 @@ export default async function runSetupEnvironmentExecutor( ...normalizedOptions, filePath: join( normalizedOptions.environmentRoot, - 'verdaccio-registry.json' + VERDACCIO_REGISTRY_JSON ), }, context ); } else { const { url } = readJsonFile( - join(normalizedOptions.environmentRoot, 'verdaccio-registry.json') + join(normalizedOptions.environmentRoot, VERDACCIO_REGISTRY_JSON) ); logger.info(`Verdaccio server kept running under : ${url}`); } diff --git a/tooling/build-env/src/internal/verdaccio/verdaccio-npm-env.ts b/tooling/build-env/src/internal/verdaccio/verdaccio-npm-env.ts index a805b126..78adaba5 100644 --- a/tooling/build-env/src/internal/verdaccio/verdaccio-npm-env.ts +++ b/tooling/build-env/src/internal/verdaccio/verdaccio-npm-env.ts @@ -19,6 +19,8 @@ function errorLog(msg: string) { error(msg, 'Verdaccio Env: '); } +export const VERDACCIO_REGISTRY_JSON = 'verdaccio-registry.json'; + export const verdaccioEnvLogger = { info: logInfo, error: errorLog, @@ -66,7 +68,7 @@ export async function bootstrapEnvironment({ `Save active verdaccio registry data to file: ${activeRegistry.root}` ); await writeFile( - join(activeRegistry.root, 'verdaccio-registry.json'), + join(activeRegistry.root, VERDACCIO_REGISTRY_JSON), JSON.stringify(activeRegistry.registry, null, 2) ); diff --git a/tooling/build-env/src/plugin/plugin.ts b/tooling/build-env/src/plugin/plugin.ts index 26f2f1e9..7ea7de72 100644 --- a/tooling/build-env/src/plugin/plugin.ts +++ b/tooling/build-env/src/plugin/plugin.ts @@ -7,6 +7,7 @@ import { import { dirname, join } from 'node:path'; import { DEFAULT_ENVIRONMENTS_OUTPUT_DIR } from '../internal/constants'; import type { StarVerdaccioOptions } from '../internal/verdaccio/verdaccio-registry'; +import { VERDACCIO_REGISTRY_JSON } from '../internal/verdaccio/verdaccio-npm-env'; export function isPublishable(tags: string[]): boolean { return tags.some((target) => target === 'publishable'); @@ -78,7 +79,7 @@ function verdaccioTargets({ 'stop-verdaccio': { executor: '@org/build-env:kill-process', options: { - filePath: join(environmentRoot, 'verdaccio-registry.json'), + filePath: join(environmentRoot, VERDACCIO_REGISTRY_JSON), ...options, }, },