Commit Graph

362 Commits

Author SHA1 Message Date
Adrien de Peretti
8db62827ac chore: remove generated client types (#7259)
* chores: rm generated client types

* chores: rm generated client types

* update lock file

* fix yarn
2024-05-07 15:36:29 +02:00
Adrien de Peretti
71f4f46cb9 chore(medusa): cleanup medusa package (#7206) 2024-05-07 12:48:49 +02:00
Oli Juhl
309c04afe8 chore: Remove remaining V1 plugins (#7255) 2024-05-06 17:31:24 +02:00
Shahed Nasser
651b953db7 fix(medusa-oas-cli, oas-github-ci): updated paths to docs directories following monorepo reorganization (#7245)
* fix(medusa-oas-cli, oas-github-ci): updated paths to docs directories following monorepo reorganization

* revert change to workspaces

* change oas in workspaces

* revert change in test script
2024-05-06 16:15:38 +03:00
Adrien de Peretti
93f6e60c17 chore(): Modules providers reorganization (#7234)
Co-authored-by: Riqwan Thamir <rmthamir@gmail.com>
2024-05-05 10:08:07 +02:00
Adrien de Peretti
224ebb2154 chore: remove legacy plugins (#7224)
* chore(): remove more legacy plugins

* chore(): remove more legacy plugins

* rm plugins
2024-05-03 14:47:16 +02:00
Adrien de Peretti
bbccd6481d chore(): start moving some packages to the core directory (#7215) 2024-05-03 13:37:41 +02:00
Kasper Fabricius Kristensen
fdee748eed feat(dashboard): Product create from - details (#7121)
**What**
- First part of the product creation form.
- New components:
  - ChipInput - Allows users to input chips into a input field. Chips are created by hitting the `,` or `Enter / Return` keys. Deleting a chip is done by hitting `Backspace` when the cursor is next to chip, or clicking the `X` button in the chip. Used for inputting option values.
  - SortableList - A sortable drag-n-drop list that allows the user to re-arrange the order of items. Used for re-arranging the ranking of variants.
  - ChipGroup - New re-usable component that is used to render a group of values as Chips. This should be used for SplitView form items.
  - CategoryCombobox - (WIP) Nested Combobox component for selecting multiple categories a product should be associated with.
- New hooks:
  - useComboboxData - Hook for easily managing the state of comboboxes.
  - useDebouncedSearch - Hook for managing debounced search queries.
2024-05-03 10:37:36 +00:00
Oli Juhl
c41e90fa36 chore: Remove Admin v1 (#7214)
* chore: Remove v1 admin

* update eslint
2024-05-03 10:56:38 +02:00
Adrien de Peretti
46ded00c08 chore: Remove legacy files plugins (#7216)
**What**
rm legacy file plugins
2024-05-03 08:01:40 +00:00
Adrien de Peretti
0140fd63ab chore(): rm payment plugins (#7217) 2024-05-03 08:42:03 +02:00
Oli Juhl
e78362c000 chore: Remove legacy MWH modules (#7213)
* chore: Remove legacy MWH modules

* chore: Add stock-location deps
2024-05-02 20:07:42 +02:00
Adrien de Peretti
4eae25e1ef chore(): Reorganize modules (#7210)
**What**
Move all modules to the modules directory
2024-05-02 15:33:34 +00:00
Oli Juhl
f430ed7040 chore: Remove deprecated plugins (#7199) 2024-05-02 09:55:50 +02:00
olivermrbl
3bf6e50744 chore: Release 2024-05-01 10:06:23 +02:00
Stevche Radevski
f341265f42 feat: Add s3-compatible plugin for the file module (#7143) 2024-04-25 09:06:47 +02:00
Stevche Radevski
614d659a59 feat: Add local file provider and wire everything up in the file module (#7134) 2024-04-24 10:59:58 +02:00
Oli Juhl
0eb68541b8 fix: Resume workflow execution (#7103)
Supercedes #7051 – if OK, I'll move the base of this PR to `develop` and we can run reviews only of this one.

**What**
- Gracefully close BullMQ Worker in Redis Event Bus and Redis Workflow Engine (by @edast, @sradevski)
- Register workflows before MedusaApp is loaded*
- Introduce `onApplicationPrepareShutdown`**
- Refactor plugin resolving for reusability purposes

*We now register workflows before modules are loaded to ensure modules can run workflows as part of bootstrapping. E.g. the Redis Workflow Engine resumes workflows when it starts, which has until this change failed, because the workflows were not registered yet.

**We introduce a new hook to prepare resources for an application shutdown. E.g. closing the BullMQ worker as a preparatory step to closing the BullMQ queue. The worker will continue to process jobs while the queue is still open to receive new jobs (without processing them). 

Co-authored-by: Stevche Radevski <4820812+sradevski@users.noreply.github.com>
Co-authored-by: Darius <618221+edast@users.noreply.github.com>
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2024-04-22 12:32:50 +00:00
Kasper Fabricius Kristensen
c3260a2c5a feat(ui, dashboard): Toast rework (#7076)
**What**
- Re-works how toasts work in Medusa UI. API is now built on top of `sonner` instead of `@radix-ui/react-toast`. This is a breaking change, and we will need to update the documentation once this has been merged and released (cc: @shahednasser).
- Adds an example of usage in the products list table in the new admin dashboard. As part of the coming weeks cleanup we will add toasts everywhere that they are currently missing.

CLOSES CORE-1977
2024-04-16 13:14:58 +00:00
Shahed Nasser
c3efac5a0d fix(medusa-core-utils): add missing awilix dependency (#7003)
`medusa-core-utils` has a missing dependency `awilix` which sometimes result in errors as reported in issue #6884

This PR adds the missing dependency
2024-04-15 07:56:40 +00:00
Kasper Fabricius Kristensen
0f05790ae4 feat(dashboard): Initial pricing domain (#6996)
**What**
- Sets up the initial work for Pricing domain
- Fixes Store domain

**Todo in follow up PR**
- Translations
- Add status when creating the Price List and allow updating it
- Improve DataGrid component
- Add missing functionality once backend support is added (customer_groups, region prices and update prices)

CLOSES CORE-1931
2024-04-08 18:22:53 +00:00
Adrien de Peretti
65794f4bb5 feat: Create shipping options workflow (#6962)
**What**

- Create main workflow
- Update create pricing rule types step to be idempotent
- update remote joiner to support granular isList confguration on field aliases
- Add full workflow integration tests
2024-04-06 11:51:48 +00:00
Kasper Fabricius Kristensen
8a5c6928f7 feat(dashboard): Migrate to new hooks and API client (#6963) 2024-04-05 18:27:08 +02:00
Oli Juhl
5ba74ec5fc feat: Add zod middleware (#6961) 2024-04-05 16:24:31 +02:00
Stevche Radevski
9ccd88d025 feat: Add boilerplate for the file module (#6956) 2024-04-05 14:46:02 +02:00
Shahed Nasser
0bf0bf819b fix(admin-ui): Resolve node-gyp error during installation with npm (#6952)
Fix `node-gyp` error that occurs during installation when using NPM and 20+ versions of Node.js. The error results from the package `@stdlib/number-float64-base-normalize` which is a dependency of `@segment/analytics-next`. Installing v0.0.8 resolves the error.

More details in PR #6485

## Testing

To test out the fix:

1. In a Medusa backend, remove the installation of `@stdlib/number-float64-base-normalize` (if available) and add instead the following override:

```json
  "overrides": {
    "@medusajs/admin": {
      "@medusajs/admin-ui": "2.1.14-snapshot-20240405070935"
    }
  }
```

2. Remove node_modules + any previous package-lock.json
3. Change to node v20+ and use npm to install dependencies -> no error occurs during installation.
2024-04-05 07:56:39 +00:00
Adrien de Peretti
82a176e30e chore(medusa-test-utils):Handle errors gracefully (#6901)
**What**
- Better error handling and error message
- update deps management and dynamic import/require
- Pass a new flag to the modules loaders for the module loaders to be able to act depending on it. In that case, the module can determine what should be run or not. e.g in the workflow engine redis, when we are only partially loading the module, we do not want to set the Distributed transaction storage
2024-04-02 14:10:17 +00:00
olivermrbl
b5bc33a9d7 chore: Release 2024-03-26 18:08:07 +01:00
Riqwan Thamir
509ddf9a56 feat(medusa): migrate medusa unit tests / plugins integration tests to swc jest (#6820)
what:

- migrates medusa package to swc/jest
- migrates plugins integration tests to swc/jest
- parallelises a few of the heavy test packages
- fixes typeorm circular dependencies

**Unit Tests**

Before: 1 job => ~30 mins
After: 2 jobs => ~5 mins


<img width="260" alt="Screenshot 2024-03-25 at 15 11 49" src="https://github.com/medusajs/medusa/assets/5105988/e1df6985-5bd6-48d0-b87b-336d3c77d0cf">

**Plugins**

Before: 1 job => ~10 mins
After: 1 job => ~5 mins

<img width="254" alt="Screenshot 2024-03-25 at 15 26 03" src="https://github.com/medusajs/medusa/assets/5105988/c1cec0e2-a1c3-41d1-9372-46d114d804c6">



Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
2024-03-25 17:55:34 +00:00
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
Riqwan Thamir
4c98545ab3 feat: shard modules and API integration tests (#6775)
what:

- runs module and api integration tests in matrix strategy
  - v28 of jest comes with sharding support, which we can utilize when we upgrade
- splits the tests by number of matrix jobs and run them in parallel
  - This introduced some flakiness in some specs, but couldn't reproduce locally. Those have been skipped for now.
- uses swc/jest for added performance
  - Locally, a chunk took 90 seconds with babel and 30 seconds with swc. 
  - This translated to 2 mins saved per shard in CI, but haven't tested this enough.
2024-03-22 11:15:01 +00:00
olivermrbl
95738804cd chore: Release 2024-03-20 10:35:07 +01:00
Sebastian Rindom
873c21355c feat: make it possible to use subscribers in v2 (#6731) 2024-03-19 18:31:58 +00:00
Philip Korsholm
84b8836cbf Feat(core-flows, inventory-next, medusa, types): Add create location level endpoint (#6695)
* initialize create location levels

* add enough from pr to make code build and test

* fix integration tests

* pr feedback

* fix errors

* rm dto

* Update packages/core-flows/src/inventory/steps/validate-inventory-locations.ts

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

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-03-18 10:28:57 +01:00
Kasper Fabricius Kristensen
ee4ea796f6 chore: align version of dotenv (#6657) 2024-03-11 12:34:17 +01:00
Kasper Fabricius Kristensen
2d00625729 feat(dashboard): Workflow executions (#6564)
**What**
- v1 of executions domain

**TODO in follow up PR**
I think it might be a good idea for Carlos or Adrien to go over the design with Ludvig, and make sure we are displaying what is relevant to developers, and how things should be displayed. So this PR is just the initial implementation, and does not handle displaying things like compensation steps (not part of the current design), step input (not supported by the API but part of the design), etc.

Closes CORE-1751, CORE-1755
2024-03-09 18:46:10 +00:00
Sebastian Rindom
a838ebae1b fix: make v2 with modules run (#6636) 2024-03-09 15:09:06 +00:00
Oli Juhl
4136b9da5f feat: Add Sales Channel Stock Location link (#6634) 2024-03-08 15:26:26 +01:00
Philip Korsholm
c19d276458 feat(inventory-next, types): inventory module conversion (#6596)
* init

* create new interface

* prep integration tests

* update denpencies

* inventory service partial tests

* finalize integration tests

* add events

* align events

* adjust inventory level reservation levels

* add test validating reserved quantity after reseration item update

* fix nits

* rename to inventory-next

* update yarn.lock

* remove changelog

* remove fixtures

* remove unused files

* ready for review

* Update packages/inventory-next/package.json

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

* pr feedback

* add tests and docs for partition-array util

* remote decorators from private method

* fix unit tests

* add migrations

* add foreign keys

* fix build

---------

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-03-08 14:09:05 +01:00
Philip Korsholm
8406eb5a35 feat(stock-location): Convert module to use mikro-orm (#6616)
* convert module

* fix migration

* cleanup module service

* fix pr feedback
2024-03-08 13:15:15 +01:00
Oli Juhl
3d0da980cf feat: Capture payment (#6601)
* feat: Capture payment

* add amount to workflow input
2024-03-07 11:02:26 +01:00
Stevche Radevski
12b035cb18 chore(tests): Try to use the api integration tests for v2 (#6588)
Few things to keep in mind:
1. You need to set MEDUSA_FF_MEDUSA_V2 to true before running the tests to run with the v2 API
2. You can use the `breaking` function to differentiate between v1 and v2 differences. This can help us identify what was breaking pretty quickly afterwards
3. You will need to run specific tests for now instead of all if you want to target v2. I think that's fine though, as we don't really need these to run on every PR until we have feature parity (and by then, all tests would be both v1 and v2 compatible)


**note: Adrien** 
- add a new way to load modules only to run their loaders comparable to the way to run the migrations only
- improve tests runner to cleanup the data properly as well as re running all loaders and core defaults

Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
2024-03-07 08:05:43 +00:00
Adrien de Peretti
51bb6f1e89 Chore/integration tests modules utils (#6581)
new wrapper for medusa integration tests.
for now it is only applied to the modules directory, but it could be used in the api integration tests or any other integrations that requires a db and a server up and running. 

It is not perfect, but I wanted to have something working and centralised before improving it, also avoiding too many conflicts with other prs
2024-03-06 10:03:07 +00:00
Kasper Fabricius Kristensen
e5dc918be5 feat(dashboard): Order details page (#6538)
**What**
- Adds the different display cards to the order details page. This does not include any of the different forms for editing various aspects of an order.
2024-03-05 13:06:50 +00:00
Adrien de Peretti
62a7bcc30c Feat(fulfillment): service provider registration + fulfillment management (#6524)
**What**
- Create the fulfillment manual package with a first iteration API 
- Create a new `AbstractFulfillmentProviderService` and `IFulfillmentProvider`
- Modify the module service interface to add new methods to manipulate the fulfillment and the communication with the external provider
  - create (no bulk)
  - cancel (no bulk)
  - update (no bulk)
  - list
  - listAndCount
  - retrieve
- Add new methods to the service provider service to include communication with the third party provider
  - get options
  - create
  - cancel
  - validate data
  - validate option
- Update/create interfaces and DTO's
- fix repository serializer to allow non entity to be passed without throwing
- split module tests into multiple files to simplify navigation
- Add integration tests to validate fulfillments manipulation and external provider loading + communication

FIXES CORE-1729
FIXES CORE-1785
FIXES CORE-1784
FIXES CORE-1766
2024-03-05 11:11:14 +00:00
Oli Juhl
84208aafc1 feat: Create payment sessions (#6549)
~~Opening a draft PR to discuss a couple of implementation details that we should align on~~

**What**

Add workflow and API endpoint for creating payment sessions for a payment collection. Endpoint is currently `POST /store/payment-collection/:id/payment-sessions`. I suggested an alternative in a comment below.

Please note, we intentionally do not want to support creating payment sessions in bulk, as this would become a mess when having to manage multiple calls to third-party providers.
2024-03-05 08:40:47 +00:00
Riqwan Thamir
8dad2b51a2 feat(medusa-react,medusa,utils): add users/me endpoint + add missing specs (#6441)
**what:**

- adds /me endpoint
- adds fixes to routes
- adds specs for auth endpoint
- updates dotenv package versions


Co-authored-by: Philip Korsholm <88927411+pKorsholm@users.noreply.github.com>
2024-03-04 09:07:47 +00:00
Oli Juhl
296d7faad4 chore: V2 core loader + modules integration-tests (#6544) 2024-02-29 16:46:30 +01:00
Stevche Radevski
dc025302a1 feat: Add currency module and remove currency models from region and pricing modules (#6536)
What:
- Creates a new currency module
- Removes currency model from the pricing module
- Removes currency model from region module
2024-02-29 15:09:59 +00:00
Kasper Fabricius Kristensen
44a5567d0d feat(dashboard): Regions domain (#6534)
**What**
- Implements new Region domain design
- Adds new SplitView component for managing adding nested relations in FocusModals, eg. adding countries to a region.
- Adds new Combobox component for multi select fields in forms

**medusajs/ui**
- Fix styling of RadioGroup.Choicebox component

CLOSES CORE-1650, CORE-1671
2024-02-29 13:16:14 +00:00