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

Move sku to a package within the monorepo #754

Merged
merged 14 commits into from
Mar 28, 2023
Merged

Move sku to a package within the monorepo #754

merged 14 commits into from
Mar 28, 2023

Conversation

askoufis
Copy link
Contributor

@askoufis askoufis commented Mar 24, 2023

Currently the sku package is also the monorepo root. This is generally a weird pattern as far as monorepos go. In addition, pnpm's symlinked node_modules causes an infinite glob loop when validating peer dependencies in fixtures (because fixtures link to sku which contains fixtures which link to sku...). This infinite glob loop was the reason we had to set SKU_FORCE_EXIT=true when running tests, because the validation is intentionally not awaited.

This doesn't really cause any issues on an M1 Pro macbook, but the build agents, with their measly 2 cores, don't like it at all. A max depth can be set on this glob, but I'm not sure what a good value for the depth is, as nested node_modules are valid, to a certain extent. Ultimately, fixing the monorepo structure by moving sku to its own package within the repo is a better solution, and that's what this PR does.

Consequently, both local and CI tests have gotten significantly faster (about 33% faster on my macbook, probably more on CI (and even more if we get a jest cache hit!)), both due to the structural change and the fact that we can now set --maxWorkers=2 on CI when running tests.

The primary changes in this PR are:

  • Moving all the sku files to packages/sku (this is the bulk of the changes)
  • Splitting out sku's dependencies into its own package.json
  • Updating references to sku code from tests and test-utils. Arguably these packages could depend on sku, but in practice it doesn't really matter, and it just causes lots of sku's peer dep validation warnings to appear, which is just noise in the case of this repo.
  • Hoist a few dependencies so things work 😢 (this could potentially be fixed in the future)
  • Update snapshots
  • Add a few missing dependencies to some fixtures as they were depending on top-level repo deps (which have moved now that the repo structure has changed)

@askoufis askoufis requested a review from a team as a code owner March 24, 2023 00:12
@changeset-bot
Copy link

changeset-bot bot commented Mar 24, 2023

⚠️ No Changeset found

Latest commit: 1c9a3ec

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

packages/sku/README.md Outdated Show resolved Hide resolved
@@ -4,5 +4,6 @@
"commit": false,
"linked": [],
"access": "public",
"ignore": ["@sku-fixtures/*", "@sku-private/*"],
Copy link
Contributor

Choose a reason for hiding this comment

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

dark side

@askoufis askoufis requested a review from a team March 27, 2023 21:53
@askoufis
Copy link
Contributor Author

To make sure the re-location didn't cause issues with the built package I tested a snapshot in a few SEEK apps and they all worked fine.


## Contributing

Refer to [CONTRIBUTING.md](./CONTRIBUTING.md). If you're planning to change the public API, please [open a new issue](https://github.com/seek-oss/sku/issues/new) and follow the provided RFC template in the [GitHub issue template](.github/ISSUE_TEMPLATE.md).
Copy link
Member

Choose a reason for hiding this comment

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

This relative path likely needs to be changed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Is it worth a snapshot just to make sure it works well on npm?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed to a separate branch to avoid having to clean up a test changeset in this branch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Copy link
Member

@jahredhope jahredhope left a comment

Choose a reason for hiding this comment

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

README links aren't correct. (Please dismiss once changed)

@jahredhope jahredhope dismissed their stale review March 28, 2023 22:25

Paths changed

@askoufis askoufis merged commit 4255556 into master Mar 28, 2023
@askoufis askoufis deleted the sku-package branch March 28, 2023 23:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants