Files
medusa-store/packages/medusa/package.json
Patrick 17c3f34e3d 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
2022-12-13 17:59:48 +00:00

95 lines
2.5 KiB
JSON

{
"name": "@medusajs/medusa",
"version": "1.7.0",
"description": "E-commerce for JAMstack",
"main": "dist/index.js",
"bin": "./cli.js",
"repository": {
"type": "git",
"url": "https://github.com/medusajs/medusa",
"directory": "packages/medusa"
},
"publishConfig": {
"access": "public"
},
"author": "Sebastian Rindom",
"license": "MIT",
"devDependencies": {
"@babel/cli": "^7.14.3",
"@babel/core": "^7.14.3",
"@babel/preset-typescript": "^7.13.0",
"@types/express": "^4.17.13",
"@types/jest": "^27.5.0",
"@types/jsonwebtoken": "^8.5.5",
"@types/multer": "^1.4.7",
"babel-preset-medusa-package": "^1.1.19",
"cross-env": "^5.2.1",
"jest": "^25.5.2",
"medusa-interfaces": "^1.3.3",
"nodemon": "^2.0.1",
"sqlite3": "^5.0.2",
"supertest": "^4.0.2",
"ts-jest": "^25.5.1",
"typescript": "^4.4.4"
},
"scripts": {
"watch": "tsc --build --watch",
"prepare": "cross-env NODE_ENV=production yarn run build",
"build": "tsc --build",
"serve": "node dist/app.js",
"test": "jest",
"test:unit": "jest"
},
"peerDependencies": {
"medusa-interfaces": "1.3.3",
"typeorm": "0.2.x"
},
"dependencies": {
"@medusajs/medusa-cli": "^1.3.5",
"@types/ioredis": "^4.28.10",
"@types/lodash": "^4.14.168",
"awilix": "^8.0.0",
"body-parser": "^1.19.0",
"bull": "^3.12.1",
"chokidar": "^3.4.2",
"class-transformer": "^0.5.1",
"class-validator": "^0.13.1",
"connect-redis": "^5.0.0",
"cookie-parser": "^1.4.4",
"core-js": "^3.6.5",
"cors": "^2.8.5",
"cross-spawn": "^7.0.3",
"express": "^4.17.1",
"express-session": "^1.17.1",
"fs-exists-cached": "^1.0.0",
"glob": "^7.1.6",
"ioredis": "^4.17.3",
"ioredis-mock": "^5.6.0",
"iso8601-duration": "^1.3.0",
"jsonwebtoken": "^8.5.1",
"medusa-core-utils": "^1.1.36",
"medusa-telemetry": "^0.0.15",
"medusa-test-utils": "^1.1.37",
"morgan": "^1.9.1",
"multer": "^1.4.2",
"node-schedule": "^2.1.0",
"papaparse": "^5.3.2",
"passport": "^0.4.0",
"passport-http-bearer": "^1.0.1",
"passport-jwt": "^4.0.0",
"passport-local": "^1.0.0",
"pg": "^8.5.1",
"randomatic": "^3.1.1",
"redis": "^3.0.2",
"reflect-metadata": "^0.1.13",
"request-ip": "^2.1.3",
"resolve-cwd": "^3.0.0",
"scrypt-kdf": "^2.0.1",
"sqlite3": "^5.0.2",
"ulid": "^2.3.0",
"uuid": "^8.3.1",
"winston": "^3.2.1"
},
"gitHead": "cd1f5afa5aa8c0b15ea957008ee19f1d695cbd2e"
}