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

Skip to content

Commit 2e622c1

Browse files
Chau TranChau Tran
Chau Tran
authored and
Chau Tran
committed
feat: update ng-add generator
1 parent 8cb1e2a commit 2e622c1

File tree

1 file changed

+17
-2
lines changed
  • libs/plugin/src/generators/init

1 file changed

+17
-2
lines changed

libs/plugin/src/generators/init/init.ts

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { addDependenciesToPackageJson, installPackagesTask, logger, readJson, Tree, updateJson } from '@nx/devkit';
22

33
export const ANGULAR_THREE_VERSION = '^1.0.0';
4-
export const THREE_VERSION = '^0.149.0';
5-
export const THREE_TYPE_VERSION = '^0.149.0';
4+
export const THREE_VERSION = '^0.152.0';
5+
export const THREE_TYPE_VERSION = '^0.152.0';
66

77
export default async function (tree: Tree) {
88
logger.log('Initializing Angular Three...');
@@ -34,6 +34,21 @@ export default async function (tree: Tree) {
3434
}
3535
return json;
3636
});
37+
38+
// add metadata.json to vscode settings if exists
39+
const vscodeSettingsPath = '.vscode/settings.json';
40+
if (tree.exists(vscodeSettingsPath)) {
41+
logger.info('Enabling typings support for VSCode...');
42+
updateJson(tree, vscodeSettingsPath, (json) => {
43+
if (json['html.customData'] && Array.isArray(json['html.customData'])) {
44+
json['html.customData'].push('./node_modules/angular-three/metadata.json');
45+
} else {
46+
json['html.customData'] = ['./node_modules/angular-three/metadata.json'];
47+
}
48+
49+
return json;
50+
});
51+
}
3752
return () => {
3853
installPackagesTask(tree);
3954
};

0 commit comments

Comments
 (0)