Commit Graph

110 Commits

Author SHA1 Message Date
Shahed Nasser
761c6c80d6 docs: enable querystring option for operating systems tabs (#4542)
* docs: enable querystring option for operating systems tabs

* fix node.js version
2023-07-17 15:09:24 +03:00
Adrien de Peretti
befc2f1c80 feat(product): Create (+ workflow), delete, restore (#4459)
* Feat: create product with product module

* feat: create product wip

* feat: create product wip

* feat: update product relation and generate image migration

* lint

* conitnue implementation

* continue implementation and add integration tests for produceService.create

* Add integration tests for product creation at the module level for the complete flow

* only use persist since write operations are always wrapped in a transaction which will be committed and flushed

* simplify the transaction wrapper to make future changes easier

* feat: move some utils to the utils package to simplify its usage

* tests: fix unit tests

* feat: create variants along side the product

* Add more integration tests an update migrations

* chore: Update actions workflow to include packages integration tests

* small types and utils cleanup

* chore: Add support for database debug option

* chore: Add missing types in package.json from types and util, validate that all the models are sync with medusa

* expose retrieve method

* fix types issues

* fix unit tests and move integration tests workflow with the plugins integration tests

* chore: remove migration function export from the definition to prevent them to be ran by the medusa cli just in case

* fix package.json script

* chore: workflows

* feat: start creating the create product workflow

* feat: add empty step for prices and sales channel

* tests: update scripts and action envs

* fix imports

* feat: Add proper soft deleted support + add product deletion service public api

* chore: update migrations

* chore: update migrations

* chore: update todo

* feat: Add product deletion to the create-product workflow as compensation

* chore: cleanup product utils

* feat: Add support for cascade soft-remove

* feat: refactor repository to take into account withDeleted

* fix integration tests

* Add support for force delete -> delete, cleanup repositories and improvements

* Add support for restoring a product and add integration tests

* cleaup + tests

* types

* fix integration tests

* remove unnecessary comments

* move specific mikro orm usage to the DAL

* Cleanup workflow functions

* Make deleted_at optional at the property level and add url index for the images

* address feedback + cleanup

* fix export

* merge migrations into one

* feat(product, types): added missing product variant methods (#4475)

* chore: added missing product variant methods

* chore: address PR feedback

* chore: catch undefined case for retrieve + specs for variant service

* chore: align TEntity + add changeset

* chore: revert changeset, TEntity to ProductVariant

* chore: write tests for pagination, unskip the test

* Create chilled-mice-deliver.md

* update integration fixtuers

* update pipeline node version

* rename github action

* fix pipeline

* feat(medusa, types): added missing category tests and service methods (#4499)

* chore: added missing category tests and service methods

* chore: added type changes to module service

* chore: address pr feedback

* update repositories manager usage and serialisation from the write public API

* move serializisation to the DAL

* rename template args

* chore: added collection methods for module and collection service (#4505)

* chore: added collection methods for module and collection service

* Create fresh-islands-teach.md

* chore: move retrieve entity to utils package

* chore: make products optional in DTO type

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>

* feat(product): Apply transaction decorators to the services (#4512)

---------

Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2023-07-16 20:19:23 +02:00
Oliver Windall Juhl
cfd3e396cf chore(workflows): Force Node v16.10 version in CI (#4523) 2023-07-13 08:42:43 +02:00
Adrien de Peretti
a6c0825722 chore: Update node version in the pipeline to 16 (#4485)
* chore: Update node version in the pipeline to 16

* upgrade to node 16 (setup-server)
2023-07-10 12:17:30 +02:00
Oliver Windall Juhl
579fcb8cd6 chore: Update issue template 2023-06-26 10:41:36 +02:00
Nicklas Gellner
854022daa8 Create FUNDING.yml (#4225)
Following the guidelines on GitHub to include a "sponsor" button within our repo.

https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository
2023-06-07 11:48:08 +02:00
Oliver Windall Juhl
260dc55b6f chore(medusa,medusa-cli): Clean up new command + fix CI (#4214)
* chore(workflows): Use default starter template in action

* Use postgres by default in new

* Add skip DB flag

* Create thirty-tomatoes-hug.md

* address PR comments
2023-05-31 12:38:44 +02:00
Shahed Nasser
94907730d2 docs: refactor to use TypeScript, ESLint, and Tailwind CSS (#4136)
* docs(refactoring): configured eslint and typescript (#3511)

* docs: configured eslint and typescript

* fixed yarn.lock

* docs(refactoring): migrate components directory to typescript (#3517)

* docs: migrate components directory to typescript

* removed vscode settings

* fix following merge

* docs: refactored QueryNote component (#3576)

* docs: refactored first batch of theme components (#3579)

* docs: refactored second batch of theme components (#3580)

* added missing badge styles

* fix after merge

* docs(refactoring): migrated remaining component to TypeScript (#3770)

* docs(refactoring): configured eslint and typescript (#3511)

* docs: configured eslint and typescript

* fixed yarn.lock

* docs(refactoring): migrate components directory to typescript (#3517)

* docs: migrate components directory to typescript

* removed vscode settings

* fix following merge

* docs: refactored QueryNote component (#3576)

* docs: refactored first batch of theme components (#3579)

* docs: refactored second batch of theme components (#3580)

* added missing badge styles

* docs: refactoring second batch of theme components

* fix after merge

* refactored icons and other components

* docs: refactored all components

* docs(refactoring): set up and configured Tailwind Css (#3841)

* docs: added tailwind config

* docs: added more tailwind configurations

* add includes option

* added more tailwind configurations

* fix to configurations

* docs(refactoring): use tailwind css (#4134)

* docs: added tailwind config

* docs: added more tailwind configurations

* add includes option

* added more tailwind configurations

* fix to configurations

* docs(refactoring): refactored all styles to use tailwind css (#4132)

* refactored Badge component to use tailwind css

* refactored Bordered component to use tailwind css

* updated to latest docusaurus

* refactored BorderedIcon component to use tailwind css

* refactored Feedback component to use tailwind css

* refactored icons and footersociallinks to tailwind css

* start refactoring of large card

* refactored large card styling

* refactored until admonitions

* refactored until codeblock

* refactored until Tabs

* refactored Tabs (without testing

* finished refactoring styles to tailwind css

* upgraded to version 2.4.1

* general fixes

* adjusted eslint configurations

* fixed ignore files

* fixes to large card

* fix search styling

* fix npx command

* updated tabs to use isCodeTabs prop

* fixed os tabs

* removed os-tabs class in favor of general styling

* improvements to buttons

* fix for searchbar

* fixed redocly download button

* chore: added eslint code action (#4135)

* small change in commerce modules page
2023-05-19 14:56:48 +03:00
Oliver Windall Juhl
a91987fab3 feat(medusa): Remove sqlite support (#4026) 2023-05-17 12:13:36 +02:00
Oliver Windall Juhl
ebfc8777f0 fix(workflows): Script name 2023-05-09 15:59:16 +02:00
Oliver Windall Juhl
1e404b43dc chore(workflows): Automate Discord message (#4047) 2023-05-09 11:16:38 +02:00
Oliver Windall Juhl
440110493e chore(workflows): Temporarily disable automated releases 2023-05-04 10:12:28 +02:00
Oliver Windall Juhl
d539c6feeb chore: Bump Typeorm to Medusa fork (#3981)
* chore: Bump typeorm to medusa fork

* Update types + utils

* Bump integration test suites

* Create good-parents-prove.md
2023-05-02 14:37:19 +02:00
Shahed Nasser
6046323f42 chore: changed PR branch for docs workflows (#3781) 2023-04-10 11:31:39 +03:00
Oliver Windall Juhl
5280e1bdad chore: Automate releases (#3736)
* chore: Automate releases

* Update release.yml
2023-04-10 09:51:14 +02:00
Oliver Windall Juhl
8277a74257 chore(ci): Don't ignore docs for required checks (#3749) 2023-04-06 15:22:21 +02:00
Oliver Windall Juhl
8761ec59c7 chore(workflows): Use our default starter in CI (#3730) 2023-04-05 14:47:53 +02:00
Oliver Windall Juhl
a1ed1b6a7f chore(workflows): Add release notification (#3629) 2023-03-30 17:18:31 +02:00
Oliver Windall Juhl
e892816307 chore(workflows): Enable manual workflow in pre-release mode (#3566) 2023-03-24 09:55:06 +01:00
Carlos R. L. Rodrigues
4e9d257d3b Chore(medusa,utils,types,inventory,stock-location): remove core dependency modules (#3531) 2023-03-23 08:07:32 -03: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
olivermrbl
85640475e5 chore: Remove from ignores in test pipeline 2023-03-13 15:44:03 +01:00
Oliver Windall Juhl
aadc1e19e9 chore: Ignore admin-ui in core pipeline (#3381) 2023-03-07 11:27:55 +01: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
olivermrbl
e1b92e9b04 fix: Merge conflicts with master 2023-02-22 17:38:49 +01:00
Shahed Nasser
3084de0c02 chore: changed trigger for docs generation actions (#3304) 2023-02-21 18:11:32 +02: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
Riqwan Thamir
121b42acfe chore(medusa): Typeorm upgrade to 0.3.11 (#3041) 2023-02-15 16:25:30 +01: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
Oliver Windall Juhl
f0ab7fda80 chore: Update bug issue template 2023-02-10 10:13:48 +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
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
Philip Korsholm
d8893d6b9f chore: Update release tag from staging to next (#2858) 2022-12-20 12:21:48 +01:00
Shahed Nasser
0d788e73c4 chore: fix API ref generator to run on push to master (#2787) 2022-12-13 13:22:05 +02:00
olivermrbl
bde50ade40 Merge branch 'master' into develop 2022-12-12 19:26:00 +01:00
Sebastian Rindom
ae290a395a chore: move to GitHub Discussions for feature requests (#2765) 2022-12-12 13:20:16 +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: f0cc1b324c/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
olivermrbl
2b2ea157a6 chore(workflows): Fix merge conflicts with master 2022-12-07 20:28:32 +01:00
Philip Korsholm
406354c97e chore(workflows): Update trigger-staging-release.yml (#2718) 2022-12-04 15:42:27 +01:00
Philip Korsholm
761ea8383d chore(workflow): Ignore changes in ./github folder in staging release trigger 2022-11-30 13:59:27 +01:00
Philip Korsholm
b023d846c3 Feat(Medusa): Trigger staging deployment (#2695)
* initial implementation of trigger action

* rename access token

* update paths ignore
2022-11-30 13:59:26 +01:00
Philip Korsholm
0764c6f994 chore(workflow): Ignore changes in ./github folder in staging release trigger 2022-11-30 09:39:12 +01:00
Philip Korsholm
ea193b6830 Feat(Medusa): Trigger staging deployment (#2695)
* initial implementation of trigger action

* rename access token

* update paths ignore
2022-11-29 16:46:28 +01:00
Philip Korsholm
c6c5667cdd Fix/staging release install and versioning (#2621) 2022-11-17 16:38:14 +00:00
Philip Korsholm
f60267a494 feat(medusa): Release staging version on push to develop (#2594)
* initial

* working config

* update name and add snapshot to release

* add changeset

* use correct command for action

* pr feedback
2022-11-16 20:08:18 +01:00
Shahed Nasser
8f39ee26d9 docs: temporary fix for memory error that occurs during build (#2584)
* docs: temporary fixes for build error

* docs: added env variable to the build step

* docs: undo unnecessary updates
2022-11-10 14:04:34 +02:00
Carlos R. L. Rodrigues
b88cef2b1f feat: Development server for core + plugins (#2448) 2022-10-21 15:53:06 +02:00
olivermrbl
f83c238a26 Merge branch 'master' into develop 2022-10-21 14:22:30 +02:00
Sebastian Rindom
7fdced0225 chore: Update snapshot this action (#2484) 2022-10-21 14:22:15 +02:00
olivermrbl
8b44618e7c fix: Merge conflicts with master 2022-10-21 14:21:06 +02:00