-
-
Notifications
You must be signed in to change notification settings - Fork 267
Fix create-package to handle JSONC files #7631
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
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 |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
| import * as commentJson from 'comment-json'; | ||
| import execa from 'execa'; | ||
| import { promises as fs } from 'fs'; | ||
| import path from 'path'; | ||
|
|
@@ -75,8 +76,8 @@ export async function readMonorepoFiles(): Promise<MonorepoFileData> { | |
| ]); | ||
|
|
||
| return { | ||
| tsConfig: JSON.parse(tsConfig) as Tsconfig, | ||
| tsConfigBuild: JSON.parse(tsConfigBuild) as Tsconfig, | ||
| tsConfig: commentJson.parse(tsConfig) as unknown as Tsconfig, | ||
| tsConfigBuild: commentJson.parse(tsConfigBuild) as unknown as Tsconfig, | ||
| nodeVersions: (JSON.parse(packageJson) as PackageJson).engines.node, | ||
| }; | ||
| } | ||
|
|
@@ -111,11 +112,11 @@ export async function finalizeAndWriteData( | |
| updateTsConfigs(packageData, monorepoFileData); | ||
| await writeJsonFile( | ||
| REPO_TS_CONFIG, | ||
| JSON.stringify(monorepoFileData.tsConfig), | ||
| commentJson.stringify(monorepoFileData.tsConfig, null, 2), | ||
| ); | ||
| await writeJsonFile( | ||
| REPO_TS_CONFIG_BUILD, | ||
| JSON.stringify(monorepoFileData.tsConfigBuild), | ||
| commentJson.stringify(monorepoFileData.tsConfigBuild, null, 2), | ||
|
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. Prettier JSON parser incompatible with JSONC commentsMedium Severity The
Contributor
Author
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. Hmm I didn't know about this. Well, if this is a problem we can try this out. |
||
| ); | ||
|
|
||
| // Postprocess | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.