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: huge monorepo refactor! #7063

Merged
merged 20 commits into from
Sep 3, 2024
Merged

chore: huge monorepo refactor! #7063

merged 20 commits into from
Sep 3, 2024

Conversation

Chriscbr
Copy link
Contributor

@Chriscbr Chriscbr commented Aug 30, 2024

This is a big change!

To improve the contributing experience, this PR refactors the structure of our monorepo so that individual packages from libs/ and apps/ are now all filed into packages/ according to their npm package name.

The main goal here is to make it easier to find and discover packages when you get build errors. Today, we use turborepo to orchestrate build commands across these separate packages, and it's helpful in that even if you run a command that compiles several packages, errors that are raised will always be prefixed with the package's name. However, the monorepo has over two dozen packages, and their folder names are often separate from their package names. This makes it hard to locate a package based on its name in the build log.

To date, there also hasn't been any major benefits to splitting the packages into libraries and apps -- the distinction is a bit murky since it's possible for a package to function as both an entrypoint and as a library. It's a lot more convenient to be able to navigate to a package without needing to know whether it's in "examples" or "libs" or "apps".

Test fixtures have also been moved into the packages/ which should make them easier to find, and examples/tests/ has been moved to tests/.

All console packages are now in the wing-console/ directory (separated since it has a source-available license).

The tools/ packages are still in their own directory, but it could make sense to move them to packages/ in the future as well.

Closes #5992

Checklist

  • Title matches Winglang's style guide
  • Description explains motivation and solution
  • Tests added (always)
  • Docs updated (only required for features)
  • Added pr/e2e-full label if this feature requires end-to-end testing

By submitting this pull request, I confirm that my contribution is made under the terms of the Wing Cloud Contribution License.

Copy link

Thanks for opening this pull request! 🎉
Please consult the contributing guidelines for details on how to contribute to this project.
If you need any assistance, don't hesitate to ping the relevant owner over Discord.

Topic Owner
Wing SDK and standard library @chriscbr
Wing Console @skyrpex
Wing compiler and language design @chriscbr
VSCode extension and language server @chriscbr
Wing CLI @chriscbr
Documentation @boyney123
Examples @boyney123
Wing Playground @skyrpex

@Chriscbr Chriscbr self-assigned this Aug 30, 2024
@Chriscbr Chriscbr marked this pull request as ready for review August 30, 2024 23:16
@Chriscbr Chriscbr requested review from skyrpex and a team as code owners August 30, 2024 23:16
@monadabot
Copy link
Contributor

monadabot commented Aug 30, 2024

Console preview environment is available at https://wing-console-pr-7063.fly.dev 🚀

Last Updated (UTC) 2024-09-03 18:28

eladb
eladb previously approved these changes Sep 1, 2024
Copy link
Contributor

@eladb eladb left a comment

Choose a reason for hiding this comment

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

Ship it!

@MarkMcCulloh
Copy link
Contributor

Something external to update after this change: https://github.com/winglang/tree-sitter-wing/blob/main/sync.sh

That repo is effectively a read-only clone of the tree-sitter-wing package, so the directory in this sync script needs to be updated

@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Sep 1, 2024
@monadabot
Copy link
Contributor

monadabot commented Sep 2, 2024

Benchmarks

Comparison to Baseline ⬜🟥⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜⬜
Benchmark Before After Change
version 58ms±0.82 56ms±0.47 -2ms (-2.98%)⬜
hello_world.test.w -t sim 413ms±9.7 427ms±25.37 +14ms (+3.27%)🟥
hello_world.test.w -t tf-aws 1498ms±18.56 1509ms±14.64 +10ms (+0.69%)⬜
jsii_big.test.w -t sim 2958ms±10.96 2945ms±16.2 -13ms (-0.43%)⬜
jsii_big.test.w -t tf-aws 3164ms±8.03 3162ms±12.23 -1ms (-0.05%)⬜
functions_1.test.w -t sim 403ms±3.15 408ms±5.23 +5ms (+1.28%)⬜
functions_1.test.w -t tf-aws 840ms±6.65 853ms±4.22 +13ms (+1.55%)⬜
empty.test.w -t sim 376ms±4.86 372ms±5.17 -5ms (-1.26%)⬜
empty.test.w -t tf-aws 599ms±3.83 612ms±4.09 +13ms (+2.22%)⬜
functions_10.test.w -t sim 496ms±12.05 500ms±12.22 +4ms (+0.84%)⬜
functions_10.test.w -t tf-aws 2174ms±15.5 2189ms±7.6 +15ms (+0.67%)⬜
jsii_small.test.w -t sim 379ms±2.69 380ms±3.47 +1ms (+0.35%)⬜
jsii_small.test.w -t tf-aws 607ms±3.42 621ms±3.76 +14ms (+2.36%)⬜

⬜ Within 1.5 standard deviations
🟩 Faster, Above 1.5 standard deviations
🟥 Slower, Above 1.5 standard deviations

Benchmarks may vary outside of normal expectations, especially when running in GitHub Actions CI.

Results
name mean min max moe sd
version 56ms 56ms 57ms 0ms 1ms
hello_world.test.w -t sim 427ms 402ms 522ms 25ms 35ms
hello_world.test.w -t tf-aws 1509ms 1481ms 1545ms 15ms 20ms
jsii_big.test.w -t sim 2945ms 2917ms 2993ms 16ms 23ms
jsii_big.test.w -t tf-aws 3162ms 3134ms 3183ms 12ms 17ms
functions_1.test.w -t sim 408ms 394ms 420ms 5ms 7ms
functions_1.test.w -t tf-aws 853ms 847ms 860ms 4ms 6ms
empty.test.w -t sim 372ms 360ms 381ms 5ms 7ms
empty.test.w -t tf-aws 612ms 603ms 621ms 4ms 6ms
functions_10.test.w -t sim 500ms 463ms 522ms 12ms 17ms
functions_10.test.w -t tf-aws 2189ms 2173ms 2207ms 8ms 11ms
jsii_small.test.w -t sim 380ms 372ms 388ms 3ms 5ms
jsii_small.test.w -t tf-aws 621ms 613ms 629ms 4ms 5ms
Last Updated (UTC) 2024-09-03 18:34

@boyney123
Copy link
Contributor

image

🚀!

@Chriscbr Chriscbr removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Sep 3, 2024
Signed-off-by: monada-bot[bot] <monabot@monada.co>
@monadabot monadabot added the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Sep 3, 2024
@Chriscbr Chriscbr removed the ⚠️ pr/review-mutation PR has been mutated and will not auto-merge. Clear this label if the changes look good! label Sep 3, 2024
@Chriscbr Chriscbr merged commit 1cf6e9f into main Sep 3, 2024
22 of 23 checks passed
@Chriscbr Chriscbr deleted the rybickic/monorepo-packages branch September 3, 2024 19:15
@monadabot
Copy link
Contributor

Congrats! 🚀 This was released in Wing 0.83.11.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Repo organization: move tests out of examples
5 participants