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

chore: improve windows compatibility of update-ts-config #3475

Merged
merged 2 commits into from
Dec 7, 2022

Conversation

Flarna
Copy link
Member

@Flarna Flarna commented Dec 7, 2022

Change update-ts-config script to generate posix path also on windows to avoid that tsconfig.json files are wrongly modified.

@Flarna Flarna requested a review from a team December 7, 2022 11:44
Change update-ts-config script to generate posix path also on windows to avoid
that tsconfig.json files are wrongly modified.
@Flarna Flarna force-pushed the update-ts-config-win branch from 2622466 to 1f869bd Compare December 7, 2022 11:45
@codecov
Copy link

codecov bot commented Dec 7, 2022

Codecov Report

Merging #3475 (3dcd440) into main (c24227e) will increase coverage by 0.07%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3475      +/-   ##
==========================================
+ Coverage   93.68%   93.76%   +0.07%     
==========================================
  Files         247      248       +1     
  Lines        7537     7566      +29     
  Branches     1575     1580       +5     
==========================================
+ Hits         7061     7094      +33     
+ Misses        476      472       -4     
Impacted Files Coverage Δ
...porter-metrics-otlp-grpc/src/OTLPMetricExporter.ts 100.00% <0.00%> (ø)
packages/opentelemetry-resources/karma.worker.js 100.00% <0.00%> (+100.00%) ⬆️

@Flarna Flarna changed the title chore: improve windows compatibility update-ts-config chore: improve windows compatibility of update-ts-config Dec 7, 2022
Copy link
Member

@legendecas legendecas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for fixing the windows compatibility!

writeJSON(tsconfigPath, tsconfig, dryRun);

for (const tsconfigName of ['tsconfig.esm.json', 'tsconfig.esnext.json']) {
const tsconfigPath = path.join(pkgRoot, tsconfigName);
const tsconfig = readJSON(tsconfigPath);
const references = Array.from(lernaProjects.values())
.filter(it => it.isTsProject && it.hasMultiTarget)
.map(it => path.relative(pkgRoot, path.join(projectRoot, it.dir))).sort();
.map(it => toPosix(path.relative(pkgRoot, path.join(projectRoot, it.dir)))).sort();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated with line 119.

Suggested change
.map(it => toPosix(path.relative(pkgRoot, path.join(projectRoot, it.dir)))).sort();
.map(it => path.relative(pkgRoot, path.join(projectRoot, it.dir))).sort();

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to late - @dyladan merged already...

@@ -99,23 +100,23 @@ function writeRootTsConfigJson(pkgRoot, projectRoot, lernaProjects) {
const tsconfig = readJSON(tsconfigPath);
const references = Array.from(lernaProjects.values())
.filter(it => it.isTsProject)
.map(it => path.relative(pkgRoot, path.join(projectRoot, it.dir))).sort();
.map(it => toPosix(path.relative(pkgRoot, path.join(projectRoot, it.dir)))).sort();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Duplicated with line 105:

Suggested change
.map(it => toPosix(path.relative(pkgRoot, path.join(projectRoot, it.dir)))).sort();
.map(it => path.relative(pkgRoot, path.join(projectRoot, it.dir))).sort();

@dyladan dyladan merged commit e4927f8 into open-telemetry:main Dec 7, 2022
@Flarna Flarna deleted the update-ts-config-win branch December 10, 2022 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants