Skip to content

Commit

Permalink
fix(plugins): change locally published packages version from 1.0.0
Browse files Browse the repository at this point in the history
…-> `0.0.0-e2e… (#20023)
  • Loading branch information
tinesoft authored Nov 2, 2023
1 parent b0d1799 commit 00248aa
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
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

0 comments on commit 00248aa

Please sign in to comment.