Skip to content

Commit

Permalink
isolate original setup code
Browse files Browse the repository at this point in the history
  • Loading branch information
BioPhoton committed Sep 15, 2024
1 parent 7173504 commit df86ee2
Show file tree
Hide file tree
Showing 18 changed files with 12 additions and 208 deletions.
22 changes: 11 additions & 11 deletions e2e-examples/cli-e2e-original/setup/global-setup.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
import { rm } from 'node:fs/promises';
import { executeProcess, objectToCliArgs } from '@org/test-utils';
import {
configureRegistry,
RegistryResult,
startVerdaccioServer,
} from '../tooling/utils/verdaccio-registry';
import {
configureRegistry,
unconfigureRegistry,
} from '@org/tools-utils';
} from '../tooling/utils/verdaccio-npm-env';

const isVerbose = process.env['NX_VERBOSE_LOGGING'] === 'true' ?? false;
const projectName = process.env['NX_TASK_TARGET_PROJECT'];
let stopFn: () => void
let stopFn: () => void;

export async function setup() {
if (projectName == null) {
Expand All @@ -32,9 +34,9 @@ export async function setup() {
targets: 'original-npm-publish',
exclude: 'tag:type:testing',
skipNxCache: true,
verbose: isVerbose
verbose: isVerbose,
}),
verbose: isVerbose
verbose: isVerbose,
});

// package install all projects
Expand All @@ -46,20 +48,18 @@ export async function setup() {
exclude: 'tag:type:testing',
skipNxCache: true,
parallel: 1,
verbose: isVerbose
verbose: isVerbose,
}),
verbose: isVerbose
verbose: isVerbose,
});

// @TODO figure out why named exports don't work https://vitest.dev/config/#globalsetup
stopFn = () => teardownSetup(registryResult)
stopFn = () => teardownSetup(registryResult);
return () => stopFn();
}



export async function teardown() {
stopFn()
stopFn();
}
export async function teardownSetup({ registry, stop }: RegistryResult) {
console.info(`Teardown ${projectName}`);
Expand Down
2 changes: 1 addition & 1 deletion e2e-examples/cli-e2e-original/tooling/original.plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
} from '@nx/devkit';
import { dirname, join } from 'node:path';
import type { ProjectConfiguration } from 'nx/src/config/workspace-json-project-json';
import { getBuildOutputPathFromBuildTarget } from '@org/tools-utils';
import { getBuildOutputPathFromBuildTarget } from './utils/build-target-helper';

export const createNodes: CreateNodes = [
'**/project.json',
Expand Down
File renamed without changes.
File renamed without changes.
30 changes: 0 additions & 30 deletions tooling/tools-utils/.eslintrc.json

This file was deleted.

3 changes: 0 additions & 3 deletions tooling/tools-utils/README.md

This file was deleted.

10 changes: 0 additions & 10 deletions tooling/tools-utils/package.json

This file was deleted.

37 changes: 0 additions & 37 deletions tooling/tools-utils/project.json

This file was deleted.

24 changes: 0 additions & 24 deletions tooling/tools-utils/src/index.ts

This file was deleted.

22 changes: 0 additions & 22 deletions tooling/tools-utils/tsconfig.json

This file was deleted.

10 changes: 0 additions & 10 deletions tooling/tools-utils/tsconfig.lib.json

This file was deleted.

27 changes: 0 additions & 27 deletions tooling/tools-utils/tsconfig.spec.json

This file was deleted.

32 changes: 0 additions & 32 deletions tooling/tools-utils/vite.config.ts

This file was deleted.

1 change: 0 additions & 1 deletion tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"@org/models": ["projects/models/src/index.ts"],
"@org/test-setup": ["testing/test-setup/src/index.ts"],
"@org/test-utils": ["testing/test-utils/src/index.ts"],
"@org/tools-utils": ["tooling/tools-utils/src/index.ts"],
"@org/utils": ["projects/utils/src/index.ts"]
}
},
Expand Down

0 comments on commit df86ee2

Please sign in to comment.