Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7c5b54a

Browse files
committed
fix: adjust version of ngxtension
1 parent 3a12518 commit 7c5b54a

File tree

4 files changed

+27
-6
lines changed

4 files changed

+27
-6
lines changed

libs/plugin/migrations.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
}
1515
},
1616
"packageJsonUpdates": {
17-
"2.0.0-beta.30": {
17+
"2.0.0": {
1818
"version": "2.0.0-beta.30",
1919
"packages": {
2020
"ngxtension": {

libs/plugin/src/generators/versions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,4 @@ export const CANNON_WORKER_API_VERSION = '^2.0.0';
1414
export const CANNON_ES_VERSION = '^0.20.0';
1515
export const CANNON_ES_DEBUGGER_VERSION = '^1.0.0';
1616

17-
export const NGXTENSION_VERSION = '^0.1.0';
17+
export const NGXTENSION_VERSION = '^0.3.0';

libs/plugin/src/migrations/migrate-to-ngxtension/migrate-to-ngxtension.spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,7 @@ ${content}`,
4141
].forEach(([api, entry, alias]) => {
4242
it(`should migrate ${api} successfully`, async () => {
4343
await setup(api);
44-
45-
update(tree);
44+
await update(tree);
4645

4746
const content = tree.read('libs/lib-one/src/lib/lib-one.component.ts', 'utf8');
4847
const finalImport = alias ? `${alias} as ${api}` : api;

libs/plugin/src/migrations/migrate-to-ngxtension/migrate-to-ngxtension.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
1-
import { Tree, getProjects, visitNotIgnoredFiles } from '@nx/devkit';
1+
import {
2+
Tree,
3+
addDependenciesToPackageJson,
4+
formatFiles,
5+
getProjects,
6+
installPackagesTask,
7+
readJson,
8+
visitNotIgnoredFiles,
9+
} from '@nx/devkit';
210
import { tsquery } from '@phenomnomnominal/tsquery';
311
import { ImportDeclaration } from 'typescript';
12+
import { NGXTENSION_VERSION } from '../../generators/versions';
413

5-
export default function update(host: Tree) {
14+
export default async function update(host: Tree) {
615
const projects = getProjects(host);
716

817
for (const [, projectConfiguration] of projects.entries()) {
@@ -14,6 +23,19 @@ export default function update(host: Tree) {
1423
}
1524
});
1625
}
26+
27+
// add ngxtension
28+
const packageJson = readJson(host, 'package.json');
29+
30+
if (!packageJson.dependencies['ngxtension'] || !packageJson.devDependencies['ngxtension']) {
31+
addDependenciesToPackageJson(host, { ngxtension: NGXTENSION_VERSION }, {});
32+
}
33+
34+
await formatFiles(host);
35+
36+
return () => {
37+
installPackagesTask(host);
38+
};
1739
}
1840

1941
function migrateApi(host: Tree, path: string, apiName: string, apiImport: string, alias?: string) {

0 commit comments

Comments
 (0)