chore(turbo): flip turbo caching glob from allow-list to deny-list (#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
* 5093b82f3a/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
This commit is contained in:
141
yarn.lock
141
yarn.lock
@@ -4431,6 +4431,7 @@ __metadata:
|
||||
jsonwebtoken: ^8.5.1
|
||||
medusa-core-utils: ^1.1.36
|
||||
medusa-interfaces: ^1.3.3
|
||||
medusa-telemetry: ^0.0.15
|
||||
medusa-test-utils: ^1.1.37
|
||||
morgan: ^1.9.1
|
||||
multer: ^1.4.2
|
||||
@@ -24450,7 +24451,7 @@ __metadata:
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
"medusa-telemetry@0.0.15, medusa-telemetry@workspace:packages/medusa-telemetry":
|
||||
"medusa-telemetry@0.0.15, medusa-telemetry@^0.0.15, medusa-telemetry@workspace:packages/medusa-telemetry":
|
||||
version: 0.0.0-use.local
|
||||
resolution: "medusa-telemetry@workspace:packages/medusa-telemetry"
|
||||
dependencies:
|
||||
@@ -30158,7 +30159,7 @@ __metadata:
|
||||
swagger-inline: ^3.2.2
|
||||
ts-jest: ^26.5.6
|
||||
ts-node: ^10.9.1
|
||||
turbo: ^1.3.1
|
||||
turbo: ^1.6.3
|
||||
typedoc: 0.23.10
|
||||
typedoc-frontmatter-plugin: "link:docs-util/typedoc-plugins/typedoc-frontmatter-plugin"
|
||||
typedoc-monorepo-link-types: ^0.0.2
|
||||
@@ -33201,154 +33202,74 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"turbo-android-arm64@npm:1.3.1":
|
||||
version: 1.3.1
|
||||
resolution: "turbo-android-arm64@npm:1.3.1"
|
||||
conditions: os=android & cpu=arm64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"turbo-darwin-64@npm:1.3.1":
|
||||
version: 1.3.1
|
||||
resolution: "turbo-darwin-64@npm:1.3.1"
|
||||
"turbo-darwin-64@npm:1.6.3":
|
||||
version: 1.6.3
|
||||
resolution: "turbo-darwin-64@npm:1.6.3"
|
||||
conditions: os=darwin & cpu=x64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"turbo-darwin-arm64@npm:1.3.1":
|
||||
version: 1.3.1
|
||||
resolution: "turbo-darwin-arm64@npm:1.3.1"
|
||||
"turbo-darwin-arm64@npm:1.6.3":
|
||||
version: 1.6.3
|
||||
resolution: "turbo-darwin-arm64@npm:1.6.3"
|
||||
conditions: os=darwin & cpu=arm64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"turbo-freebsd-64@npm:1.3.1":
|
||||
version: 1.3.1
|
||||
resolution: "turbo-freebsd-64@npm:1.3.1"
|
||||
conditions: os=freebsd & cpu=x64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"turbo-freebsd-arm64@npm:1.3.1":
|
||||
version: 1.3.1
|
||||
resolution: "turbo-freebsd-arm64@npm:1.3.1"
|
||||
conditions: os=freebsd & cpu=arm64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"turbo-linux-32@npm:1.3.1":
|
||||
version: 1.3.1
|
||||
resolution: "turbo-linux-32@npm:1.3.1"
|
||||
conditions: os=linux & cpu=ia32
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"turbo-linux-64@npm:1.3.1":
|
||||
version: 1.3.1
|
||||
resolution: "turbo-linux-64@npm:1.3.1"
|
||||
"turbo-linux-64@npm:1.6.3":
|
||||
version: 1.6.3
|
||||
resolution: "turbo-linux-64@npm:1.6.3"
|
||||
conditions: os=linux & cpu=x64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"turbo-linux-arm64@npm:1.3.1":
|
||||
version: 1.3.1
|
||||
resolution: "turbo-linux-arm64@npm:1.3.1"
|
||||
"turbo-linux-arm64@npm:1.6.3":
|
||||
version: 1.6.3
|
||||
resolution: "turbo-linux-arm64@npm:1.6.3"
|
||||
conditions: os=linux & cpu=arm64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"turbo-linux-arm@npm:1.3.1":
|
||||
version: 1.3.1
|
||||
resolution: "turbo-linux-arm@npm:1.3.1"
|
||||
conditions: os=linux & cpu=arm
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"turbo-linux-mips64le@npm:1.3.1":
|
||||
version: 1.3.1
|
||||
resolution: "turbo-linux-mips64le@npm:1.3.1"
|
||||
conditions: os=linux & cpu=mips64el
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"turbo-linux-ppc64le@npm:1.3.1":
|
||||
version: 1.3.1
|
||||
resolution: "turbo-linux-ppc64le@npm:1.3.1"
|
||||
conditions: os=linux & cpu=ppc64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"turbo-windows-32@npm:1.3.1":
|
||||
version: 1.3.1
|
||||
resolution: "turbo-windows-32@npm:1.3.1"
|
||||
conditions: os=win32 & cpu=ia32
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"turbo-windows-64@npm:1.3.1":
|
||||
version: 1.3.1
|
||||
resolution: "turbo-windows-64@npm:1.3.1"
|
||||
"turbo-windows-64@npm:1.6.3":
|
||||
version: 1.6.3
|
||||
resolution: "turbo-windows-64@npm:1.6.3"
|
||||
conditions: os=win32 & cpu=x64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"turbo-windows-arm64@npm:1.3.1":
|
||||
version: 1.3.1
|
||||
resolution: "turbo-windows-arm64@npm:1.3.1"
|
||||
"turbo-windows-arm64@npm:1.6.3":
|
||||
version: 1.6.3
|
||||
resolution: "turbo-windows-arm64@npm:1.6.3"
|
||||
conditions: os=win32 & cpu=arm64
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"turbo@npm:^1.3.1":
|
||||
version: 1.3.1
|
||||
resolution: "turbo@npm:1.3.1"
|
||||
"turbo@npm:^1.6.3":
|
||||
version: 1.6.3
|
||||
resolution: "turbo@npm:1.6.3"
|
||||
dependencies:
|
||||
turbo-android-arm64: 1.3.1
|
||||
turbo-darwin-64: 1.3.1
|
||||
turbo-darwin-arm64: 1.3.1
|
||||
turbo-freebsd-64: 1.3.1
|
||||
turbo-freebsd-arm64: 1.3.1
|
||||
turbo-linux-32: 1.3.1
|
||||
turbo-linux-64: 1.3.1
|
||||
turbo-linux-arm: 1.3.1
|
||||
turbo-linux-arm64: 1.3.1
|
||||
turbo-linux-mips64le: 1.3.1
|
||||
turbo-linux-ppc64le: 1.3.1
|
||||
turbo-windows-32: 1.3.1
|
||||
turbo-windows-64: 1.3.1
|
||||
turbo-windows-arm64: 1.3.1
|
||||
turbo-darwin-64: 1.6.3
|
||||
turbo-darwin-arm64: 1.6.3
|
||||
turbo-linux-64: 1.6.3
|
||||
turbo-linux-arm64: 1.6.3
|
||||
turbo-windows-64: 1.6.3
|
||||
turbo-windows-arm64: 1.6.3
|
||||
dependenciesMeta:
|
||||
turbo-android-arm64:
|
||||
optional: true
|
||||
turbo-darwin-64:
|
||||
optional: true
|
||||
turbo-darwin-arm64:
|
||||
optional: true
|
||||
turbo-freebsd-64:
|
||||
optional: true
|
||||
turbo-freebsd-arm64:
|
||||
optional: true
|
||||
turbo-linux-32:
|
||||
optional: true
|
||||
turbo-linux-64:
|
||||
optional: true
|
||||
turbo-linux-arm:
|
||||
optional: true
|
||||
turbo-linux-arm64:
|
||||
optional: true
|
||||
turbo-linux-mips64le:
|
||||
optional: true
|
||||
turbo-linux-ppc64le:
|
||||
optional: true
|
||||
turbo-windows-32:
|
||||
optional: true
|
||||
turbo-windows-64:
|
||||
optional: true
|
||||
turbo-windows-arm64:
|
||||
optional: true
|
||||
bin:
|
||||
turbo: bin/turbo
|
||||
checksum: 62093ccfb8cce6d8e6c7161f50660e8d5d1fbdbcf2e2f8514a001fdef7cdc9fa0f21013c4507b7020f2d66b4ab313a436b9d4a5aa10358ebe11b98acd7a939ea
|
||||
checksum: 9335cd7f676b4e439ac1f66eba496fe31f3f9a7d09346824f94c26d7b8602ff2231056441a448b739ec2d68c3e4ae43f07c9cd79a73d94275a89fc1f9a19475a
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Reference in New Issue
Block a user