Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(azure-react): updates app insights web version and ts config #106

Merged
merged 1 commit into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
generateFiles,
names,
offsetFromRoot,
readProjectConfiguration,
Tree,
} from '@nrwl/devkit';
import { Linter } from '@nrwl/linter';
Expand All @@ -19,6 +20,7 @@ import {
appInsightsWebVersion,
} from '../../../utils/versions';
import { AppInsightsWebGeneratorSchema } from './schema';
import updateTsConfig from './utils/tsconfig';

type NormalizedSchema = BaseNormalizedSchema<AppInsightsWebGeneratorSchema>;

Expand Down Expand Up @@ -72,6 +74,9 @@ export default async function appInsightsWebGenerator(
// Generate files
addFiles(tree, normalizedOptions);

const project = readProjectConfiguration(tree, options.name);
updateTsConfig(tree, path.join(project.root, 'tsconfig.json'));

// Format files
await formatFiles(tree);

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { updateJson, Tree } from '@nrwl/devkit';

const updateTsConfig = (tree: Tree, filePath: string) => {
updateJson(tree, filePath, tsconfig => {
const update = tsconfig;

const compiler: any = {
composite: true,
declaration: true,
};

update.compilerOptions = {
...update.compilerOptions,
...compiler,
};

update.include = [...new Set([...(update.include || []), '**/*.tsx'])];
return update;
});
};

export default updateTsConfig;
2 changes: 1 addition & 1 deletion packages/azure-react/utils/versions.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export const appInsightsWebVersion = '2.8.9';
export const appInsightsWebVersion = '2.8.10';
export const appInsightsReactVersion = '3.4.0';