Commit Graph

39 Commits

Author SHA1 Message Date
Riqwan Thamir
bacfa3e17b feat(medusa-payment-paypal,medusa-payment-stripe): speed up unit tests in CI (#6806)
* chore: shard unit tests

* chore: move paypal and stripe to swc

* chore: update actions

* chore: refactor http paypal client

* chore: added changeset

* chore: remove medusa changes
2024-03-25 15:27:40 +01:00
Shahed Nasser
0350eeb0a1 docs: create typedoc theme and plugins for references (#5297)
* update typedoc and its plugins

* refactor existing typedoc configurations

* added new typedoc plugin and themes

* added more customization options

* added more customization options

* refactored doc-utils to a workspace

* fix tsconfig

* update README files

* remove comments

* revert type changes

* remove dependencies no longer needed

* removed modules action
2023-10-05 12:09:42 +03:00
Shahed Nasser
fa7c94b4cc docs: create docs workspace (#5174)
* docs: migrate ui docs to docs universe

* created yarn workspace

* added eslint and tsconfig configurations

* fix eslint configurations

* fixed eslint configurations

* shared tailwind configurations

* added shared ui package

* added more shared components

* migrating more components

* made details components shared

* move InlineCode component

* moved InputText

* moved Loading component

* Moved Modal component

* moved Select components

* Moved Tooltip component

* moved Search components

* moved ColorMode provider

* Moved Notification components and providers

* used icons package

* use UI colors in api-reference

* moved Navbar component

* used Navbar and Search in UI docs

* added Feedback to UI docs

* general enhancements

* fix color mode

* added copy colors file from ui-preset

* added features and enhancements to UI docs

* move Sidebar component and provider

* general fixes and preparations for deployment

* update docusaurus version

* adjusted versions

* fix output directory

* remove rootDirectory property

* fix yarn.lock

* moved code component

* added vale for all docs MD and MDX

* fix tests

* fix vale error

* fix deployment errors

* change ignore commands

* add output directory

* fix docs test

* general fixes

* content fixes

* fix announcement script

* added changeset

* fix vale checks

* added nofilter option

* fix vale error
2023-09-21 20:57:15 +03:00
Oliver Windall Juhl
1e404b43dc chore(workflows): Automate Discord message (#4047) 2023-05-09 11:16:38 +02:00
Patrick
e6e5291527 feat(codegen): commit generated client types to codebase (#3492)
## What

Commit generated client types to codebase.

## Why

As a developer, we will provides better visibility on the impact of OAS changes to the generated type. Also allow for browser the types on GitHub.

## How

* Remove `/lib` from .gitignore
* Add a non-blocking github action check validating if the latest generated build has been committed.
  * Runs `yarn build --force --no-cache` on GitHub. Caching was creating false positives.
  * Use `git status` and filter the output to target only `packages/generated` directory. 

## Test

Proof of a failing check:
https://github.com/medusajs/medusa/actions/runs/4432323763/jobs/7776235128

UPDATE: Failing check after updating branch with latest develop
https://github.com/medusajs/medusa/actions/runs/4436707954/jobs/7785472045
2023-03-16 15:30:40 +00:00
Patrick
240d0ea7b8 fix(ci,oas) move oas ci script to a package under the oas workspace (#3391)
* feat(ci,oas) run oas ci on all PRs

* fix(ci,oas) move oas ci script to a package under the oas workspace

* chore(changeset): patch
2023-03-07 10:33:12 +01:00
Patrick
3e274edb9e feat(docs): OAS circular reference check shall fail openapi:generate (#3269)
### What

Unhandled OAS circular references shall fail `openapi:generate` until they have been patched in `docs-util/redocly/config.yaml`

### Why

Prevent developers to commit new OAS changes that would cause to API documentation to crash.

Our API documentation rendering library will crash and not load if our OAS contains circular references. We have an automated mechanism to patch offending references but they must be identified and configured by hand.

### How

Let the `openapi:generate --dry-run` command reach OAS sanitization and circular reference check operations. 

Fail the build script if unhandled circular references are detected. 

Output the offending references to the stdout in order to help the developers identify and configure the required patch.

Since some the tooling involved only work with files, use the host system's temporary directory mechanism when using the `--dry-run` flag.

### Test

* Introduce a bug by removing an entry in `docs-util/redocly/config.yaml`
* Run `yarn openapi:generate --dry-run`
* Expect the script to exit before completing
* Expect the logs to contain `🔴 Unhandled circular references.`
* Expect the logs to contain an array of the offending references
2023-02-17 12:11:27 +00:00
Patrick
8137061908 feat(oas): medusa-oas-cli as OAS build tool (#3213)
## What

Introduce a CLI for extracting OAS from the core `medusa` package.

## Why

We need to decouple OAS tooling from documentation tooling in order to allow packages and external systems to leverage our OAS has a dependency.

## How

Introduce a new OAS workspace within packages in order to organize current and future OAS related package. Only 1 OAS package for now.

Introduce a new CLI only package to act as the main gateway for all upcoming OAS tooling. Only 1 command for now.

Update documentation tooling pertaining to OAS to use the CLI instead.

## Test

### Prerequisite
From the monorepo root:
* `yarn install`
* `yarn build`

### Documentation

#### Case - validation only - success
* Run `yarn openapi:generate --dry-run`
* Expect console output `🟢 Valid OAS` but no mention of `🔵 Exported OAS`

#### Case - validation only - invalid
* Introduce a bug by renaming `@schema Cart` to `@schema Kart` in [models/cart.ts](0adb0d9ff9/packages/medusa/src/models/cart.ts (L2))
* Run `yarn build` to update `@medusajs/medusa` package with the bug.
* Run `yarn openapi:generate --dry-run`
* Expect console output `🔴 Invalid OAS` with a stack trace of the issue.

#### Case - docs generation
* Run `yarn openapi:generate`
* Expect `docs/api/` directory to contain:
  * `admin.oas.json` (raw OAS)
  * `store.oas.json` (raw OAS)
  * `admin.oas.yaml` (sanitized OAS)
  * `store.oas.yaml` (sanitized OAS)
  * `admin/` (updated redocly split output)
  * `store/` (updated redocly split output)

### CLI

#### Case - crawl additional paths
* From a local medusa server (`medusa-starter-default`), add an `index.ts` file in `src/models/`
* In the `index.ts`, add dummy OAS JSDoc like `/** @schema Foobar */`
* From the root of the monorepo, run `yarn medusa-oas --type store --paths path-to-medusa-server/src`
* Expect a `store.oas.json` to be created at the root of the monorepo.
* The `store.oas.json` should contain an additional `Foobar` entry in `components.schemas`.
2023-02-15 14:55:58 +00: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](fd5c185159/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
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
bbf4039147 docs: redesigned announcement bar (#2559) 2022-11-07 14:13:54 +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
Shahed Nasser
78e7361f7e docs: added missing date typecast in release script (#2409) 2022-10-11 10:43:40 +03:00
Shahed Nasser
64ebece3b4 fix: fixed remove announcement bar action (#2281) 2022-09-30 13:06:56 +03:00
Shahed Nasser
31fb4c3d3f docs: automated announcement bar (#2231) 2022-09-20 10:21:24 +03:00
Shahed Nasser
7c6521101e docs: fixed errors in OAS comments (#2215) 2022-09-15 16:01:34 +03:00
Carlos R. L. Rodrigues
a94d9816fe chore: Centralise ESLint rules (#2162)
* chore: centrilize eslint rules
2022-09-13 07:42:33 -03:00
olivermrbl
5ea1d98aa7 Merge branch 'master' into develop 2022-09-06 09:44:11 +02:00
Shahed Nasser
4961aece1c docs: Add request and error examples (#2109) 2022-09-04 20:08:05 +02:00
olivermrbl
b1e2830fb2 Merge branch 'master' into develop 2022-08-29 15:47:17 +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
Shahed Nasser
076b41bb89 fix(docs): API reference bugs (#2119)
* fixed shipping method tax line schema name

* added dry run option to build openapi script

* fixed summary of endpoints

* fixed title of endpoint
2022-08-29 14:25:17 +03:00
Shahed Nasser
501bda6aae fix: incorrect exit status of OAS comments test (#2099)
* fix exit status

* fix oas comments
2022-08-25 18:04:15 +03:00
Shahed Nasser
73383cc466 chore(docs): Refactor API Reference (#1883) 2022-08-05 14:06:12 +02:00
Zakaria El Asri
55e200bf68 add: upgrade oas-normalize and use promise-based api (#806) 2021-11-16 18:12:15 +01:00
Philip Korsholm
9d175ca332 Update assert-changed-files.sh 2021-10-21 21:13:32 +02:00
Philip Korsholm
1b0dd60a33 Feat/new actions (#586)
* test

* test

* create integration testing workflow

* Create unit-testing.yml

* Rename integration-testing to integration-testing.yml

* initial testing

* Update assert-changed-files.sh

* Update integration-testing.yml

* Update unit-testing.yml

* Update assert-changed-files.sh

* Delete integration-testing.yml

* Update assert-changed-files.sh

* Update assert-changed-files.sh

* Update assert-changed-files.sh

* Update order.js

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Update unit-testing.yml

* Create cache-bootstrap.yml

* Update cache-bootstrap.yml

* Update cache-bootstrap.yml

* Update cache-bootstrap.yml

* Update unit-testing.yml

* extracted action

* corrected ext. name for int. tests

* checked out actions

* added fetching of actions

* updated

* updated

* moved package

* updated

* Update action.yml

* Update action.yml

* ended if statement

* updated

* updated

* removed error

* updated cache version

* update

* updated to more strict cache policy

* update

* updated

* updated

* update

* update

* update

* update

* update

* update

* update

* update

* updated to also include on PR

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* update

* removed current branch from diff

* updated comment

* Update action.yml

* Update action.yml

* Update action.yml

* save before merge

* Update action.yml

* Update product.js

* Update product.js

* Update action.yml

* Update action.yml

* Update action.yml

* Update action.yml

* Update assert-changed-files-actions.sh

* Update assert-changed-files-actions.sh

* Update product-variant.js

* Update product.js

* Update product.js

* cleanup

Co-authored-by: Sebastian Mateos Nicolajsen <80953876+sebastiannicolajsen@users.noreply.github.com>
Co-authored-by: Sebastian M. Nicolajsen <sebastian.m.nicolajsen@gmail.com>
2021-10-21 17:15:29 +02:00
Philip Korsholm
0f88293100 recover assert-changed-files.sh 2021-10-21 08:42:42 +02:00
Philip Korsholm
c977eb7e6b exit code 2021-10-20 16:21:29 +02:00
Philip Korsholm
241aef6e6c make script executable 2021-10-20 16:16:07 +02:00
Philip Korsholm
b32c6f15ec rename script 2021-10-20 16:12:44 +02:00
Philip Korsholm
6537e30251 update scripts to handle github actions 2021-10-20 16:04:36 +02:00
Sebastian Rindom
30b6a793f1 chore: add lint-staged + husky 2021-10-12 22:09:46 +02:00
Sebastian Rindom
9467f7ecbd fix: build openapi (#338) 2021-08-16 15:45:50 +02:00
Sebastian Rindom
dd7b306333 feat(medusa): cart context (#201)
- Adds a context field to Cart
- context is automatically populated with ip + user agent
- context can be updated via POST /store/cart/:id or set when creating via POST /store/cart
2021-03-12 11:48:51 +01:00
Sebastian Rindom
1e5a1398d8 hotfix: docs build (#198)
* fix: build

* fix: build

* fix: build

* fix: build
2021-03-10 16:15:06 +01:00
Sebastian Rindom
8edb32c742 docs: oas (#197)
Adds OpenAPI specification of Storefront and Admin APIs.
Updates docs project.
2021-03-10 11:51:54 +01:00
Sebastian Rindom
7308946e56 feat: notifications (#172)
The Notifications API allows plugins to register Notification Providers which have `sendNotification` and `resendNotification`.

Each plugin can listen to any events transmittet over the event bus and the result of the notification send will be persisted in the database to allow for clear communications timeline + ability to resend notifications.
2021-02-15 11:59:37 +01:00
Sebastian Rindom
c6996dd530 CircleCI project setup (#138) 2020-11-21 15:50:42 +01:00