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

Build: Enhance windows support #30148

Merged
merged 4 commits into from
Jan 16, 2025

Conversation

mrginglymus
Copy link
Contributor

@mrginglymus mrginglymus commented Dec 27, 2024

What I did

Type mapping stubs used in the build process were injecting file-system relative paths. This change ensures they are module relative paths by replacing path.sep with /

Checklist for Contributors

Testing

The changes in this PR are covered in the following automated tests:

  • stories
  • unit tests
  • integration tests
  • end-to-end tests

Manual testing

This section is mandatory for all contributions. If you believe no manual test is necessary, please state so explicitly. Thanks!

Documentation

  • Add or update documentation reflecting your changes
  • If you are deprecating/removing a feature, make sure to update
    MIGRATION.MD

Checklist for Maintainers

  • When this PR is ready for testing, make sure to add ci:normal, ci:merged or ci:daily GH label to it to run a specific set of sandboxes. The particular set of sandboxes can be found in code/lib/cli-storybook/src/sandbox-templates.ts

  • Make sure this PR contains one of the labels below:

    Available labels
    • bug: Internal changes that fixes incorrect behavior.
    • maintenance: User-facing maintenance tasks.
    • dependencies: Upgrading (sometimes downgrading) dependencies.
    • build: Internal-facing build tooling & test updates. Will not show up in release changelog.
    • cleanup: Minor cleanup style change. Will not show up in release changelog.
    • documentation: Documentation only changes. Will not show up in release changelog.
    • feature request: Introducing a new feature.
    • BREAKING CHANGE: Changes that break compatibility in some way with current major version.
    • other: Changes that don't fit in the above categories.

🦋 Canary release

This PR does not have a canary release associated. You can request a canary release of this pull request by mentioning the @storybookjs/core team here.

core team members can create a canary release here or locally with gh workflow run --repo storybookjs/storybook canary-release-pr.yml --field pr=<PR_NUMBER>

name before after diff z %
createSize 0 B 0 B 0 B - -
generateSize 77.9 MB 77.9 MB 0 B 1.01 0%
initSize 131 MB 131 MB 0 B 1.07 0%
diffSize 52.9 MB 52.9 MB 0 B 0.03 0%
buildSize 7.19 MB 7.19 MB 0 B 1.04 0%
buildSbAddonsSize 1.85 MB 1.85 MB 0 B -0.58 0%
buildSbCommonSize 195 kB 195 kB 0 B - 0%
buildSbManagerSize 1.87 MB 1.87 MB 0 B 1.11 0%
buildSbPreviewSize 0 B 0 B 0 B - -
buildStaticSize 0 B 0 B 0 B - -
buildPrebuildSize 3.91 MB 3.91 MB 0 B 0.99 0%
buildPreviewSize 3.28 MB 3.28 MB 0 B 1 0%
testBuildSize 0 B 0 B 0 B - -
testBuildSbAddonsSize 0 B 0 B 0 B - -
testBuildSbCommonSize 0 B 0 B 0 B - -
testBuildSbManagerSize 0 B 0 B 0 B - -
testBuildSbPreviewSize 0 B 0 B 0 B - -
testBuildStaticSize 0 B 0 B 0 B - -
testBuildPrebuildSize 0 B 0 B 0 B - -
testBuildPreviewSize 0 B 0 B 0 B - -
name before after diff z %
createTime 7.4s 6.5s -934ms -0.96 -14.3%
generateTime 21.4s 19.5s -1s -965ms -1 -10.1%
initTime 14.8s 13.1s -1s -740ms -0.97 -13.3%
buildTime 11s 8.8s -2s -169ms -0.81 -24.5%
testBuildTime 0ms 0ms 0ms - -
devPreviewResponsive 4.6s 6s 1.3s 1.6 🔺21.9%
devManagerResponsive 3.5s 4.1s 614ms 1.1 14.8%
devManagerHeaderVisible 593ms 705ms 112ms 0.38 15.9%
devManagerIndexVisible 651ms 738ms 87ms 0.34 11.8%
devStoryVisibleUncached 1.9s 1.7s -227ms -0.42 -13.3%
devStoryVisible 652ms 739ms 87ms 0.31 11.8%
devAutodocsVisible 519ms 711ms 192ms 1.2 27%
devMDXVisible 549ms 585ms 36ms 0.01 6.2%
buildManagerHeaderVisible 584ms 768ms 184ms 2.64 🔺24%
buildManagerIndexVisible 676ms 875ms 199ms 3.39 🔺22.7%
buildStoryVisible 567ms 731ms 164ms 2.43 🔺22.4%
buildAutodocsVisible 458ms 477ms 19ms -0.08 4%
buildMDXVisible 446ms 602ms 156ms 2.31 🔺25.9%

Greptile Summary

This PR modifies the type mapper file generation to ensure cross-platform compatibility by normalizing path separators in TypeScript declaration files, particularly important for Windows builds.

  • Modified code/core/scripts/helpers/generateTypesMapperFiles.ts to replace system-specific path separators with forward slashes using replaceAll(sep, '/')
  • Ensures consistent module paths across different operating systems in generated .d.ts files
  • Improves build reliability on Windows systems by standardizing path formats

💡 (2/5) Greptile learns from your feedback when you react with 👍/👎!

Type mapping stubs used in the build process were injecting file-system
relative paths. This change ensures they are module relative paths by
replacing path.sep with /
Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

@mrginglymus
Copy link
Contributor Author

mrginglymus commented Dec 27, 2024

Sigh. This having worked, once, I'm now getting the exceedingly unhelpful error:

> npx nx run-many -t build --parallel=15

 NX   Failed to convert JavaScript value `Null` into rust type `String`


An error occurred while executing: `npx nx run-many -t build --parallel=15`
❌ Failed to bootstrap

Error running task compile for undefined:
{
  "shortMessage": "Command failed with exit code 1: npx nx run-many -t build --parallel=15",
  "command": "npx nx run-many -t build --parallel=15",
  "escapedCommand": "\"npx nx run-many -t build --parallel=15\"",
  "exitCode": 1,
  "failed": true,
  "timedOut": false,
  "isCanceled": false,
  "killed": false
}

edit: ah, good, a known nx issue: nrwl/nx#29429

Updating to 20.3 seemed to fix it

This is a much more portable solution than referencing a shell script
@valentinpalkovic valentinpalkovic changed the title Enhance windows support Build: Enhance windows support Jan 16, 2025
@valentinpalkovic valentinpalkovic added build Internal-facing build tooling & test updates and removed bug labels Jan 16, 2025
@valentinpalkovic valentinpalkovic merged commit c2568ec into storybookjs:next Jan 16, 2025
52 of 54 checks passed
@github-actions github-actions bot mentioned this pull request Jan 16, 2025
16 tasks
@mrginglymus mrginglymus deleted the win-build-support branch January 16, 2025 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build Internal-facing build tooling & test updates ci:normal windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants