Commit Graph

106 Commits

Author SHA1 Message Date
olivermrbl 360ae16c2d chore(release): v1.7.14 2023-03-15 18:16:23 +01:00
olivermrbl 77fd361ce8 chore(release): v1.7.13 2023-03-13 19:09:08 +01:00
olivermrbl e5f0a60090 chore: Update yarn.lock 2023-03-09 10:37:27 +01:00
olivermrbl 3718f88c69 chore(release): v1.7.11 2023-03-02 12:02:35 +01:00
olivermrbl 6e3b339b22 chore(release): v1.7.10 2023-03-01 18:55:21 +01:00
olivermrbl 83d70f7965 chore(release): v1.7.9 2023-02-28 08:57:57 +01:00
olivermrbl fefc248a41 chore(release): v1.7.8 2023-02-22 13:13:48 +01:00
olivermrbl 1bfbe27b9b chore(release): Publish 2023-02-14 17:30:40 +01:00
olivermrbl 3b474ec35c chore(release): Publish 2023-02-08 19:35:44 +01:00
Patrick 53532df8d5 feat(OAS): sanitize circular reference for Redocly (#3198)
### What

Add OAS build step to patch known circular references that prevent Redocly from rendering the API documentation.

### Why

We've encountered crashing and loading issues with Redocly when the OAS contained circular references. We have been working around the limitation by omitting some known problematic $ref in our source OAS. We wish to move away from this strategy in order to always explicitly include $ref in our OAS.

### How

We are introducing a custom Redocly CLI plugin that will replace `$ref` by `type: object` base on a configurable set of instructions. These instructions can be modified in `docs-util/redocly/config.yaml`

We are adding a `redocly bundle` step in the current OAS build process in order to sanitize problematic circular references.

We updated the redocly-cli package version in order to ensure that plugins are supported.

### Test

We will use [Cart.payment](https://github.com/medusajs/medusa/blob/fd5c18515931aca7cb5d29530f5dd03ebaf7e07e/packages/medusa/src/models/cart.ts#L72-L74) to ensure that the new process is properly sanitizing.

* Run `yarn openapi:generate`
* Open `docs/api/store/components/schemas/Cart.yaml`
  * Expect the `payment` property to have been sanitized to `type: object`
* Run `yarn redocly preview-docs docs/api/store/openapi.yaml --config=docs-util/redocly/config.yaml`
* Visit http://127.0.0.1:8080/#tag/Cart/operation/GetCartsCart
  * In the response, expect cart.payment to not list the properties of the Payment schema.
2023-02-08 13:01:03 +00:00
Oliver Windall Juhl 08324355a4 chore: Patch bump all dependencies + minor bumps winston (#3185) 2023-02-07 19:15:29 +01:00
Kasper Fabricius Kristensen 4fbf6b7ad3 fix(medusa-react): Fix production.min.js causing invalid hook usage error in CJS environments (#3144) 2023-02-01 14:07:02 +01:00
olivermrbl a48c533bec chore(release): Publish 2023-01-19 18:29:07 +01:00
olivermrbl 6481b0c357 chore(release): Publish 2023-01-18 18:48:57 +01:00
olivermrbl ab580066ae fix: Merge conflicts with master 2023-01-18 10:17:39 +01:00
Kasper Fabricius Kristensen cb25244007 hotfix(medusa-js, medusa-react): Fix issue with JS client bundle (#3038) 2023-01-16 17:44:24 +01:00
Kasper Fabricius Kristensen 8d1275c942 feat(medusa-react): Upgrade react-query and clean up dependencies (#2969) 2023-01-11 19:19:34 +01:00
olivermrbl a8bde8ba74 chore(release): Publish 2023-01-11 16:27:54 +01:00
Carlos R. L. Rodrigues 93ee248493 feat(medusa, inventory): Inventory Management module (#2956)
* feat: inventory module
2023-01-10 14:38:30 -03:00
Kasper Fabricius Kristensen f6c81dab9e feat(medusa-js): Bundle package using Rollup (#2964) 2023-01-10 14:44:25 +01:00
Riqwan Thamir b280e53bd3 refactor(medusa): move repository specs into its own folder (#2952)
**What:**

Introduces a new folder under which repository specs will be placed. 

Why:

We don't currently have a good place to test ORM logic or custom queries against the database. The repository folder tests are a place for just exactly that. 

How:

Creates an internal package similar to other integration tests - api and plugins. 

CORE-965
2023-01-09 08:19:01 +00:00
Carlos R. L. Rodrigues c07ffb6165 feat(medusa): Stock location module (#2907)
* feat: stock location module
2023-01-04 13:11:59 -03:00
Shahed Nasser d1b4b11ff6 chore(docs): added eslint to lint documentation code blocks (#2920)
* docs: added rule for code length

* chore: fixes based on vale errors

* changed to use eslint

* fixes using eslint

* added github action for documentation eslint

* changed allowed max-length

* fixed incorrect heading level

* removed comment
2022-12-30 18:44:46 +02:00
olivermrbl 233d6904f8 chore(release): Publish 2022-12-22 15:54:20 +01:00
Patrick 0a9c891853 chore: explicitly add devDependencies for monorepo peerDependencies (#2808) 2022-12-15 08:46:52 +01:00
Patrick 7bb9cd6aff fix(medusa-js): missing devDependency was failing repo build task (#2804)
### What

Explicitly declare `@medusajs/medusa` as a devDependency for `@medusajs/medusa-js` client package.

### Why

With our latest version upgrade of `turbo`, peerDependencies aren't taken into account in the build graph. The recommendation is to also explicitly declare them in devDependencies.

### Test

* Run `yarn build --graph`
* Expect to see medusa-js having a dependency on medusa
```
"[root] @medusajs/medusa-js#build" -> "[root] @medusajs/medusa#build"
```
2022-12-14 16:46:08 +00:00
olivermrbl 8edf6a06ee Merge branch 'master' into develop 2022-12-14 14:47:23 +01:00
olivermrbl 01d521ed40 chore(medusa-js): Version package + add missing changeset 2022-12-14 09:37:20 +01:00
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
* 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
2022-12-13 17:59:48 +00:00
olivermrbl 29135c0519 chore(release): Publish 2022-12-13 10:34:07 +01:00
Patrick 86f9455d00 test: allow integration-tests to leverage workspaces optimizations (#2727)
### What
Leverage yarn workspaces and Turborepo for integration-tests in order to accelerate development and reduce DevX complexity.

### Why
The current solution for running integration tests requires using `medusa-dev-cli` in order to publish packages to a local npm repository. The package where the command is executed will have its package.json altered for any known medusa dependency in order to install from the local npm. The process is taxing on the host machine resources and prevents rapid iterations when working with integration tests.

For more information, see documentation: https://github.com/medusajs/medusa/blob/f0cc1b324c964680c26e0d5c1d45769cbd750176/docs/content/usage/local-development.md#run-api-integration-tests

### How
By declaring `integeration-tests/**/*` as a workspace, Turborepo can now be leveraged to build and run integration test as if there were packages. The build process will take care of interdependency between package in order to ensure local dependency are met.

In addition, within each integration-tests "packages", we can declare local dependencies as "*" which will translate to using the one that is part of the current build, regardless of the dependency's version number. No more fiddling with version numbers.

Github actions pertaining to integration-tests have been streamlined to use the new behavior.

The integration-tests packages have been marked as `private:true` in order to avoid publishing them to the public npm registry.

### Testing
```
cd root-of-medusajs-medusa-repo/
yarn install
yarn build
yarn test:integration:api
yarn test:integration:plugins
```

After a code change, `yarn build` must be run before re-running an integration test, which is the same procedure as for unit tests.

Resolves: CORE-845
2022-12-08 14:57:16 +00:00
Adrien de Peretti 1b21af87ab chore(medusa-core-utils): Migrate to TS (#2670) 2022-12-05 10:21:04 +01:00
Adrien de Peretti e18b59de66 chore: Update Awilix to v8 (#2668) 2022-11-25 13:56:22 +01:00
olivermrbl 105c689298 chore(release): Publish 2022-11-24 11:42:04 +01:00
olivermrbl a4d75f4a40 fix: merge conflicts with develop 2022-11-22 13:39:27 +01:00
olivermrbl ade898d434 chore(release): Publish 2022-11-22 13:35:50 +01:00
Philip Korsholm 5332081972 fix(medusa, medusa-plugin-discount-generator, medusa-plugin-restock-notification): Bump Medusa package versions (#2623) 2022-11-18 10:50:13 +01:00
olivermrbl a4dd26e137 chore(release): Publish 2022-11-09 19:34:59 +01:00
olivermrbl a68af8a474 chore: Update lockfile 2022-11-04 13:32:23 +01:00
olivermrbl ee8a71c692 chore(release): Publish 2022-11-02 16:44:54 +01:00
Carlos R. L. Rodrigues b88cef2b1f feat: Development server for core + plugins (#2448) 2022-10-21 15:53:06 +02:00
Shahed Nasser 479ae1e257 docs: Added automated freshness check (#2428)
* docs: created freshness check script

* added github action
2022-10-17 10:01:45 +03:00
olivermrbl 35df4962f8 chore(release): Publish 2022-10-10 18:02:50 +02:00
Shahed Nasser 31fb4c3d3f docs: automated announcement bar (#2231) 2022-09-20 10:21:24 +03:00
olivermrbl 3efeb6b84f chore(release): Publish 2022-09-14 11:36:53 +02:00
Carlos R. L. Rodrigues a94d9816fe chore: Centralise ESLint rules (#2162)
* chore: centrilize eslint rules
2022-09-13 07:42:33 -03:00
olivermrbl 70139d0bbb chore(release): Publish 2022-09-06 09:50:00 +02:00
Oliver Windall Juhl e707b46499 fix(medusa-plugin-meilisearch): Update meilisearch dependency (#2140) 2022-09-05 18:15:09 +02:00
Oliver Windall Juhl ad717b9533 chore(medusa): Remove deprecated dependency @hapi/joi (#2069) 2022-09-05 16:03:06 +02:00
Oliver Windall Juhl 6a62a8f1ed chore: Remove lerna (#2116)
**What**
- Removes `lerna` as we are now using `changesets` + Turborepo to handle builds and releases
2022-08-29 13:26:58 +00:00