-
Notifications
You must be signed in to change notification settings - Fork 41
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: build builder and schematics for o3r lib #2727
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,15 +18,23 @@ import { | |
TYPES_DEFAULT_FOLDER, | ||
} from '@o3r/schematics'; | ||
import generateEnvironments from '@schematics/angular/environments/index'; | ||
import type { | ||
TsConfigJson, | ||
} from 'type-fest'; | ||
import * as ts from 'typescript'; | ||
|
||
const editTsConfigJson = (tree: Tree) => { | ||
if (tree.exists('/tsconfig.json')) { | ||
const tsConfig = ts.parseConfigFileTextToJson('/tsconfig.json', tree.readText('/tsconfig.json')).config; | ||
if (tsConfig.compilerOptions?.noPropertyAccessFromIndexSignature) { | ||
delete tsConfig.compilerOptions.noPropertyAccessFromIndexSignature; | ||
const tsConfigPath = '/tsconfig.json'; | ||
if (tree.exists(tsConfigPath)) { | ||
const tsConfig = ts.parseConfigFileTextToJson(tsConfigPath, tree.readText(tsConfigPath)).config as TsConfigJson; | ||
if (tsConfig.compilerOptions) { | ||
if (tsConfig.compilerOptions.noPropertyAccessFromIndexSignature) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why do we need to update their tsconfig? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because this is where the In this particular case, we are removing |
||
delete tsConfig.compilerOptions.noPropertyAccessFromIndexSignature; | ||
} | ||
tsConfig.compilerOptions.moduleResolution = 'node'; | ||
tsConfig.compilerOptions.declaration = true; | ||
} | ||
tree.overwrite('/tsconfig.json', JSON.stringify(tsConfig, null, 2)); | ||
tree.overwrite(tsConfigPath, JSON.stringify(tsConfig, null, 2)); | ||
} | ||
return tree; | ||
}; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should not be instead something like:
and run on all the file found?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is only about the root
tsconfig
file so there won't be app/lib onesThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
waiting for #2648 to be merged and to adapt this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as discussed offline, we would want to target the root
tsconfig.json