Commit Graph

102 Commits

Author SHA1 Message Date
olivermrbl
348f866ffe chore: Version packages 2024-12-20 11:25:36 +01:00
olivermrbl
a391a29aa8 chore: Version packages 2024-12-17 14:41:05 +01:00
olivermrbl
0e342b491d chore: Version packages 2024-12-10 14:01:50 +01:00
Carlos R. L. Rodrigues
b0448a7c35 chore: locking-postgres provider dml (#10478) 2024-12-06 10:14:14 -03:00
olivermrbl
4723acd949 chore: Version packages 2024-12-04 18:36:57 +01:00
olivermrbl
e9c1b1127e chore: Version packages 2024-11-27 15:40:07 +01:00
olivermrbl
ccf4e801f3 chore: Version packages 2024-11-25 12:14:36 +01:00
olivermrbl
4245312d8d chore: Version packages 2024-11-25 09:57:00 +01:00
olivermrbl
d5605656ae chore: Version packages 2024-11-12 10:10:07 +01:00
olivermrbl
ecece05b72 chore: Version packages 2024-11-11 10:58:20 +01:00
olivermrbl
8feb589659 chore: Release 2024-11-06 21:47:01 +01:00
olivermrbl
4ccab16336 chore: Version packages 2024-10-25 17:19:36 +02:00
olivermrbl
2fbebb60e3 chore: Release 2024-10-22 20:43:47 +02:00
Oli Juhl
c3418a2b93 chore: Prepare versions + changeset (#9707)
* chore: Prepare version + changeset

* chore: Bump dependencies

* chore: Update lock-file
2024-10-22 20:31:33 +02:00
Harminder Virk
1e0f6188ec fix: resolve paths using require.resolve (#9665) 2024-10-18 13:30:29 +00:00
Adrien de Peretti
876d8072e7 chore: Update modules providers configuration with 'identifier' and 'PROVIDER' (#9636)
* chore: Update modules providers configuration with 'identifier' and 'PROVIDER'

* update check

* fix tests

* type

* normalize auth provider

* emailpass

* providers

---------

Co-authored-by: Carlos R. L. Rodrigues <rodrigolr@gmail.com>
Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2024-10-18 09:24:15 +02:00
Carlos R. L. Rodrigues
902ac12f73 chore: remove internal module resources option (#9582)
What:
* removes resouces type "shared" or "isolated" from internal modules.
* modules can have an isolated database connection by providing a database config as part of their options on `medusa-config`

CLOSES: FRMW-2593
2024-10-17 21:31:46 +00:00
Adrien de Peretti
e911c6aebf fix(modules-sdk): Add missing paths to require.resolve in load resources (#9608)
FIXES FRMW-2747

**What**

Add missing `paths` options
2024-10-16 17:20:56 +00:00
Harminder Virk
20428dac71 fix: resolve provider path before requiring it (#9601) 2024-10-16 14:17:55 +05:30
Carlos R. L. Rodrigues
4a03bdbb86 feat(providers): locking redis (#9544) 2024-10-15 12:40:24 -03:00
Adrien de Peretti
827b32cffd chore: Remove Query Filter (#9403)
**What**
Cleanup old QueryFilter
2024-10-15 10:41:53 +00:00
Carlos R. L. Rodrigues
c8b375ae2d feat(locking): Locking module (#9524)
**What**
- Locking Module to manage concurrency
- Default `in-memory` provider
2024-10-11 16:30:06 +00:00
Adrien de Peretti
1d8939df3a chore(): Allow to register modules through array (#9522) 2024-10-11 15:17:00 +02:00
Harminder Virk
1560d7ed5f breaking: Standalone builds (#9496)
Fixes: FRMW-2742

In this PR, we fix the build output of the backend source code, which eliminates a lot of magic between the development and production environments.

Right now, we only compile the source files from the `src` directory and write them within the `dist` directory.

**Here's how the `src` directory with a custom module looks like**

```
src
├── modules
│   └── hello
│       ├── index.ts
```

**Here's the build output**

```
dist
├── modules
│   └── hello
│       ├── index.js
```

Let's imagine a file at the root of your project (maybe the `medusa-config.js` file) that wants to import the `modules/hello/index` file. How can we ensure that the import will work in both the development and production environments?

If we write the import targeting the `src` directory, it will break in production because it should target the `dist` directory.

## Solution
The solution is to compile everything within the project and mimic the file structure in the build output, not just the `src` directory.

**Here's how the fixed output should look like**

```
dist
├── src
│  ├── modules
│  │   └── hello
│  │       ├── index.js
├── medusa-config.js
├── yarn.lock
├── package.json
```

If you notice carefully, we also have `medusa-config.js`, `yarn.lock`, and `package.json` within the `dist` directory. We do so to create a standalone built application, something you can copy/paste to your server and run without relying on the original source code.

- This results in small containers since you are not copying unnecessary files.
- Clear distinction between the development and the production code. If you want to run the production server, then `cd` into the `dist` directory and run it from there.

## Changes in the PR

- Breaking: Remove the `dist` and `build` folders. Instead, write them production artefacts within the `.medusa` directory as `.medusa/admin` and `.medusa/server`.
- Breaking: Change the output of the `.medusa/server` folder to mimic the root project structure.
- Refactor: Remove `Symbol.for("ts-node.register.instance")]` check to find from where to load the source code.
- Refactor: Use `tsc` for creating the production build. This ensures we respect `tsconfig` settings when creating the build and also perform type-checking.

Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
2024-10-09 15:59:08 +00:00
Carlos R. L. Rodrigues
cc77ca1413 chore(types): index module type (#9473) 2024-10-04 16:54:43 +00:00
Carlos R. L. Rodrigues
d06ea6985d fix: add order to pagination types (#9471) 2024-10-04 12:57:44 +00:00
Harminder Virk
d98f22c7d6 Feat: Move container bindings declaration merging within the framework (#9467) 2024-10-04 15:47:06 +05:30
Harminder Virk
48e00169d2 breaking: move shared HTTP utils to the framework (#9402)
Fixes: FRMW-2728, FRMW-2729

After this PR gets merged the following middleware will be exported from the `@medusajs/framework/http` import path.

- applyParamsAsFilters
- clearFiltersByKey
- applyDefaultFilters
- setContext
- getQueryConfig
- httpCompression
- maybeApplyLinkFilter
- refetchEntities
- unlessPath
- validateBody
- validateQuery

Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
2024-10-03 09:42:00 +00:00
Adrien de Peretti
8753b178da chore: Processing filters deeply looking at the current joiner first (#9428)
* chore: Processing filters deeply looking at the current joiner first

* fix

* fix
2024-10-02 14:17:12 +02:00
Harminder Virk
a578313db9 feature: bundle all modules (#9324) 2024-09-30 09:04:03 +02:00
Carlos R. L. Rodrigues
ef15c60386 chore(modules-sdk): load modules in sequence (#9327)
What:
- The time taken to load in sequence is the same as in parallel, and it doesn't create multiple db queries simultaneously when starting each module.
- Rework modules bootstrap (now all dependencies are available from the constructor and cross deps are allowed without any topological sort needed. It also allow improvements in the future)
  - First load all modules
  - then resolve and register instances


Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
2024-09-26 16:33:35 +00:00
Harminder Virk
48bea267dc chore: perform dependencies scan and fix all dependencies (#9296) 2024-09-26 14:14:38 +05:30
Adrien de Peretti
fba78c0fb1 chore: remove direct usage from graphql (#9316)
**What**
Remove direct usage of graphql toold and instead consume it from utils to have a single entry point to graphql tooling
2024-09-26 08:18:26 +00:00
Carlos R. L. Rodrigues
11d8264062 fix(modules-sdk): default db options (#9313) 2024-09-25 19:44:12 -03:00
Adrien de Peretti
74cdb9d4b6 fix(modules-sdk): Fix dynamic import usage (#9304)
* fix(modules-sdk): Fix dynamic import usage

* missing new line
2024-09-25 13:29:00 +02:00
Adrien de Peretti
358435d715 chore: Move graphl to a single place (#9303)
* chore: Move graphl to a single place

* add new line
2024-09-25 12:04:25 +02:00
Harminder Virk
9e711720dd chore: upgrade moduleResolution to Node16 (#9269) 2024-09-24 17:19:20 +05:30
Adrien de Peretti
919d19095a refactor(modules-sdk): Align configuration and fixes (#9239)
* refactor(modules-sdk): Align configuration and fixes

* typo

* fix configuration
2024-09-23 12:12:26 +02:00
Adrien de Peretti
3084008fc9 feat(index): Provide a similar API to Query (#9193)
**What**
Align the index engine API to be similar to the Query API

## Example

```ts
        // Benefit from the same level of typing like the remote query

        const { data, metadata } = await indexEngine.query<'product'>({
          fields: [
            "product.*",
            "product.variants.*",
            "product.variants.prices.*",
          ],
          filters: {
            product: {
              variants: {
                prices: {
                  amount: { $gt: 50 },
                },
              },
            },
          },
          pagination: {
            order: {
              product: {
                variants: {
                  prices: {
                    amount: "DESC",
                  },
                },
              },
            },
          },
        })
```
2024-09-20 10:02:42 +00:00
Carlos R. L. Rodrigues
1215a7c094 chore(orchestrator): remote joiner using entitymap (#9205) 2024-09-20 05:30:08 -03:00
Adrien de Peretti
58167b5dfa feat(index): Index module foundation (#9095)
**What**
Index module foundation

Co-authored-by: Carlos R. L. Rodrigues <37986729+carlos-r-l-rodrigues@users.noreply.github.com>
2024-09-18 19:04:04 +00:00
Adrien de Peretti
c6795dfc47 feat(modules-sdk): Parse filters based on loaded modules graph (#9158) 2024-09-17 14:20:04 -03:00
Carlos R. L. Rodrigues
8829f89402 chore: query graph api (#9125)
CLOSES: FRMW-2704

**What**
Re-structure the Query graph API as well as introduce dynamic typing from schemas on the filters and better handling of relation treatment for fields/filters inference

Co-authored-by: Adrien de Peretti <25098370+adrien2p@users.noreply.github.com>
2024-09-16 11:32:44 +00:00
Carlos R. L. Rodrigues
950cf9af79 chore: remove container registration name (#9137) 2024-09-16 06:22:24 -03:00
Adrien de Peretti
03d6b64a20 fix(): Query Missing bindings (#9131) 2024-09-13 18:22:38 +02:00
Harminder Virk
c97ea9546d feature: add tracing to remote query (#9128) 2024-09-13 14:09:59 +05:30
Adrien de Peretti
a01e7e4ffe chore: Register Query in container (#9103)
* chore(framework): Register the query

* chore(framework): Register the query
2024-09-11 15:08:46 +02:00
Carlos R. L. Rodrigues
fdd0543011 chore: joiner config entity property (#9084) 2024-09-11 06:25:25 -03:00
Adrien de Peretti
423bae1d73 chore(modules-sdk): Move Query and cleanup (#9054)
* chore(modules-sdk): Move Query and cleanup

* cleanup

* fix memoization
2024-09-09 12:42:17 +02:00
Harminder Virk
32ebfa619f feature: introduce types for query.graph method (#9031) 2024-09-09 13:26:40 +05:30