forked from medusajs/medusa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(turbo): flip turbo caching glob from allow-list to deny-list (m…
…edusajs#2772) ### What Flip Turborepo cache glob pattern from an allow-list to deny-list pattern. ### Why Packages within medusa's monorepo will output their build to a `dist` directory. This convention does not apply to plugins since the core plugin loader expects the content of plugin packages `src` directory to be outputted at the root of the package. i.e. `packages/foobar-plugin/src/utils/index.ts` -> `packages/foobar-plugin/utils/index.js` Manually maintaining an allow-list of known plugin output directories is not scalable. When a directory exists in a plugin package but is not know to the allow-list, the directory will not be re-built on subsequent builds. Troubleshooting the issue requires intimate knowledge of Turborepo caching strategies. ### How By using a deny-list glob pattern, plugin packages can now declare any not-known directory within their `src` folder without facing any potential omission issues during the build process. We declare `src` and its content as the only directory for turbo cache to ignore. ### Additional scope * Use `turbo.json` file content in cache hashing algorithm in order to break CI cache when changes are made to the Turborepo config. * Upgraded turbo minor verion. * Added missing dependency to medusa package. ### Test * Delete previously built output in packages. Run `yarn build --force` (replace any existing cache) * Expect all src content to be outputted * Run `yarn build` right after * Expect a fast build time since cache will be fresh * Add a new directory with an index.ts file in a plugin package src folder. Run `yarn build` * Expect a fast build time, except for the modified plugin package. * Expect the newly added directory to be outputted. * Delete the newly outputted directory. Run `yarn build` * Expect the outputted directory to reappear. ### References * https://github.com/medusajs/medusa/blob/5093b82f3a28323e99b6b133ae87c76fac01a298/packages/medusa/src/loaders/plugins.ts * https://turbo.build/repo/docs/reference/configuration#outputs * https://turbo.build/repo/docs/reference/configuration#globaldependencies Resolves CORE-891
- Loading branch information
1 parent
29135c0
commit 17c3f34
Showing
5 changed files
with
52 additions
and
130 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@medusajs/medusa": patch | ||
--- | ||
|
||
fix: add missing medusa-telemetry dependency to package.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters