Skip to content

Commit

Permalink
Merge branch 'master' into next-component-testing-compiler
Browse files Browse the repository at this point in the history
  • Loading branch information
erenken authored Nov 3, 2023
2 parents f1f56dc + 9c0e6a1 commit 643fa2a
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
33 changes: 33 additions & 0 deletions packages/js/src/utils/add-local-registry-scripts.spec.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import { addLocalRegistryScripts } from './add-local-registry-scripts';
import { Tree, writeJson } from '@nx/devkit';
import { createTree } from '@nx/devkit/testing';

describe('addLocalRegistryScripts', () => {
let tree: Tree;
const startLocalRegistryPath = 'tools/scripts/start-local-registry.ts';
const stopLocalRegistryPath = 'tools/scripts/stop-local-registry.ts';

beforeEach(() => {
tree = createTree();
writeJson(tree, 'project.json', {
name: 'mylib',
});
});

it('should add "start-local-registry.ts" and "stop-local-registry.ts" in workspace\'s "tools/scripts" folder', () => {
expect(addLocalRegistryScripts(tree)).toEqual({
startLocalRegistryPath,
stopLocalRegistryPath,
});

expect(tree.exists(startLocalRegistryPath)).toBe(true);
expect(tree.exists(stopLocalRegistryPath)).toBe(true);
});

it('should set published version to "0.0.0-e2e"', () => {
addLocalRegistryScripts(tree);

const startLocalRegistry = tree.read(startLocalRegistryPath, 'utf-8');
expect(/'0\.0\.0-e2e'/.test(startLocalRegistry)).toBe(true);
});
});
2 changes: 1 addition & 1 deletion packages/js/src/utils/add-local-registry-scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export default async () => {
const nx = require.resolve('nx');
execFileSync(
nx,
['run-many', '--targets', 'publish', '--ver', '1.0.0', '--tag', 'e2e'],
['run-many', '--targets', 'publish', '--ver', '0.0.0-e2e', '--tag', 'e2e'],
{ env: process.env, stdio: 'inherit' }
);
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,9 @@ function buildAllWorkspaceFiles(
): FileData[] {
performance.mark('get-all-workspace-files:start');
let fileData: FileData[] = Object.values(projectFileMap).flat();
fileData = fileData.concat(globalFiles).sort();
fileData = fileData
.concat(globalFiles)
.sort((a, b) => a.file.localeCompare(b.file));
performance.mark('get-all-workspace-files:end');
performance.measure(
'get-all-workspace-files',
Expand Down

0 comments on commit 643fa2a

Please sign in to comment.