Skip to content

Commit

Permalink
Merge branch 'develop' into docs/typo-correction
Browse files Browse the repository at this point in the history
  • Loading branch information
shahednasser authored Jul 10, 2023
2 parents df47cc2 + a6c0825 commit b38478c
Show file tree
Hide file tree
Showing 145 changed files with 3,552 additions and 940 deletions.
7 changes: 7 additions & 0 deletions .changeset/afraid-otters-train.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@medusajs/orchestration": patch
"@medusajs/types": patch
"@medusajs/utils": patch
---

feat: Remote Joiner
5 changes: 5 additions & 0 deletions .changeset/fair-kids-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/medusa": patch
---

feat(medusa): Improve error messaging in plugin loader
5 changes: 5 additions & 0 deletions .changeset/gentle-cups-crash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gatsby-source-medusa": patch
---

chore(gatsby-source-medusa): Cleanup plugin setup
6 changes: 6 additions & 0 deletions .changeset/gentle-teachers-greet.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@medusajs/medusa-js": patch
"medusa-react": patch
---

feat(medusa-react,medusa-js): Allow custom headers
12 changes: 12 additions & 0 deletions .changeset/great-panthers-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"@medusajs/medusa": patch
"@medusajs/admin-ui": patch
"@medusajs/admin": patch
"medusa-plugin-brightpearl": patch
"medusa-plugin-segment": patch
"medusa-plugin-sendgrid": patch
"medusa-plugin-slack-notification": patch
"@medusajs/utils": patch
---

fix(medusa, utils): fix the way selects are consumed alongside the relations
12 changes: 12 additions & 0 deletions .changeset/late-dragons-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
"@medusajs/medusa": patch
"@medusajs/event-bus-local": patch
"@medusajs/event-bus-redis": patch
"@medusajs/medusa-cli": patch
"medusa-plugin-algolia": patch
"medusa-plugin-meilisearch": patch
"@medusajs/product": patch
"@medusajs/types": patch
---

chore(medusa-cli): Cleanup plugin setup + include Logger type update which is used across multiple packages
5 changes: 5 additions & 0 deletions .changeset/late-insects-punch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@medusajs/medusa": patch
---

fix(medusa): model loader with customizations
6 changes: 6 additions & 0 deletions .changeset/proud-ghosts-speak.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@medusajs/medusa": patch
"@medusajs/utils": patch
---

feat(medusa, utils): improve devx for core entity customizations
5 changes: 5 additions & 0 deletions .changeset/quiet-gifts-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"medusa-react": patch
---

fix(medusa-react): fix wrong admin reservations query key
5 changes: 5 additions & 0 deletions .changeset/twelve-mugs-arrive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"medusa-dev-cli": patch
---

chore(medusa-dev-cli): Cleanup plugin setup
2 changes: 1 addition & 1 deletion .github/actions/setup-server/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputs:
node-version:
description: "Node version"
required: false
default: "14"
default: "16"
cache-extension:
description: "Extension for fetching cached dependencies"
required: true
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: "14"
node-version: "16"
cache: "yarn"

- name: Assert changed
Expand Down Expand Up @@ -48,7 +48,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: "14"
node-version: "16"
cache: "yarn"

- name: Assert changed
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: "14"
node-version: "16"
cache: "yarn"

- name: Install dependencies
Expand Down Expand Up @@ -161,7 +161,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: "14"
node-version: "16"
cache: "yarn"

- name: Install dependencies
Expand Down Expand Up @@ -212,7 +212,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: "14"
node-version: "16"
cache: "yarn"

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codegen-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: "14"
node-version: "16"
cache: "yarn"

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-freshness-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: "14"
node-version: "16"
cache: "yarn"

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-new-announcement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: "14"
node-version: "16"
cache: "yarn"

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docs-remove-announcement.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: "14"
node-version: "16"
cache: "yarn"

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate-api-reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: "14"
node-version: "16"
cache: "yarn"

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate-entity-reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: "14"
node-version: "16"
cache: "yarn"

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate-js-reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: "14"
node-version: "16"
cache: "yarn"

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate-reference.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: "14"
node-version: "16"
cache: "yarn"

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/oas-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Setup Node.js environment
uses: actions/[email protected]
with:
node-version: "14"
node-version: "16"
cache: "yarn"

- name: Install dependencies
Expand Down
2 changes: 0 additions & 2 deletions integration-tests/api/__tests__/batch-jobs/order/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ describe("Batchjob with type order-export", () => {

expect(batchJob.status).toBe("completed")

expect(batchJob.status).toBe("completed")

exportFilePath = path.resolve(__dirname, batchJob.result.file_key)
const isFileExists = (await fs.stat(exportFilePath)).isFile()

Expand Down
5 changes: 3 additions & 2 deletions integration-tests/api/__tests__/batch-jobs/product/export.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ describe("Batch job of product-export type", () => {
const db = useDb()
await db.teardown()

// @ts-ignore
try {
const isFileExists = (await fs.stat(exportFilePath))?.isFile()

Expand All @@ -74,8 +75,8 @@ describe("Batch job of product-export type", () => {

await fs.unlink(exportFilePath)
}
} catch (e) {
console.log(e)
} catch (err) {
// noop
}
})

Expand Down
2 changes: 1 addition & 1 deletion integration-tests/api/__tests__/database/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ describe("Database options", () => {

// Idle time is 1000 ms so this should timeout
await new Promise((resolve) =>
setTimeout(() => resolve(console.log("")), 2000)
setTimeout(() => resolve(undefined), 2000)
)

// This query should fail with a QueryRunnerAlreadyReleasedError
Expand Down
23 changes: 13 additions & 10 deletions integration-tests/api/__tests__/store/customer.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,16 +293,19 @@ describe("/store/customers", () => {
})

expect(response.status).toEqual(200)
expect(response.data.orders).toEqual([
expect.objectContaining({
display_id: 3,
status: "canceled",
}),
expect.objectContaining({
display_id: 1,
status: "completed",
}),
])
expect(response.data.orders.length).toEqual(2)
expect(response.data.orders).toEqual(
expect.arrayContaining([
expect.objectContaining({
display_id: 3,
status: "canceled",
}),
expect.objectContaining({
display_id: 1,
status: "completed",
}),
])
)
expect(response.data.orders.length).toEqual(2)
})
})
Expand Down
33 changes: 21 additions & 12 deletions integration-tests/api/__tests__/store/products.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ const {

const productSeeder = require("../../helpers/store-product-seeder")
const adminSeeder = require("../../helpers/admin-seeder")
const {
allowedStoreProductsFields,
defaultStoreProductsRelations,
} = require("@medusajs/medusa/dist")

jest.setTimeout(30000)

Expand Down Expand Up @@ -988,23 +992,28 @@ describe("/store/products", () => {
it("response contains only fields defined with `fields` param", async () => {
const api = useApi()

const fields = allowedStoreProductsFields

const response = await api.get(
"/store/products/test-product?fields=handle"
`/store/products/test-product?fields=${fields.join(",")}`
)

expect(response.status).toEqual(200)

expect(Object.keys(response.data.product)).toEqual([
// fields
"handle",
// relations
"variants",
"options",
"images",
"tags",
"collection",
"type",
])
const expectedProperties = [...fields, ...defaultStoreProductsRelations]
const actualProperties = [
...Object.keys(response.data.product),
...Object.keys(response.data.product.variants[0]).map(
(key) => `variants.${key}`
),
"variants.prices.amount",
"options.values",
]

expect(Object.keys(response.data.product).length).toEqual(31)
expect(actualProperties).toEqual(
expect.arrayContaining(expectedProperties)
)
})
})
})
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const { initDb, useDb } = require("../../../../helpers/use-db")
const { setPort, useApi } = require("../../../../helpers/use-api")

const adminSeeder = require("../../../helpers/admin-seeder")
const cartSeeder = require("../../../helpers/cart-seeder")
const {
simpleProductFactory,
simpleCustomerFactory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const orderRelations = [
"discounts",
"discounts.rule",
"shipping_methods",
"shipping_methods.shipping_option",
"payments",
"items",
"fulfillments",
Expand Down
4 changes: 2 additions & 2 deletions packages/event-bus-local/src/services/event-bus-local.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Logger, MedusaContainer } from "@medusajs/modules-sdk"
import { EmitData, EventBusTypes, Subscriber } from "@medusajs/types"
import { MedusaContainer } from "@medusajs/modules-sdk"
import { EmitData, EventBusTypes, Logger, Subscriber } from "@medusajs/types"
import { AbstractEventBusModuleService } from "@medusajs/utils"
import { EventEmitter } from "events"
import { ulid } from "ulid"
Expand Down
4 changes: 2 additions & 2 deletions packages/event-bus-redis/src/services/event-bus-redis.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { InternalModuleDeclaration, Logger } from "@medusajs/modules-sdk"
import { EmitData } from "@medusajs/types"
import { InternalModuleDeclaration } from "@medusajs/modules-sdk"
import { EmitData, Logger } from "@medusajs/types"
import { AbstractEventBusModuleService } from "@medusajs/utils"
import { BulkJobOptions, JobsOptions, Queue, Worker } from "bullmq"
import { Redis } from "ioredis"
Expand Down
11 changes: 0 additions & 11 deletions packages/gatsby-source-medusa/.babelrc

This file was deleted.

17 changes: 5 additions & 12 deletions packages/gatsby-source-medusa/.gitignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
/dist
node_modules

.DS_Store

utils


*.js
*.js.map
*.d.ts
!/types/*.d.ts

!jest.config.js
.DS_store
.env*
.env
*.sql
Loading

0 comments on commit b38478c

Please sign in to comment.