Skip to content

Commit e0a504b

Browse files
Merge pull request #123 from commercelayer/update-dependencies
Update all dependencies to the latest
2 parents f1cbc16 + 9847bd2 commit e0a504b

File tree

15 files changed

+872
-759
lines changed

15 files changed

+872
-759
lines changed

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ pnpm test
1717
If you get the error "_Browser was not found at the configured executablePath_", run the following:
1818

1919
```sh
20+
node packages/drop-in/node_modules/puppeteer/install.mjs
21+
22+
# or
23+
2024
node node_modules/puppeteer/install.mjs
2125
```
2226

biome.jsonc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.2.4/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.3.1/schema.json",
33
"vcs": {
44
"enabled": false,
55
"clientKind": "git",

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@
3333
},
3434
"packageManager": "pnpm@10.4.0",
3535
"devDependencies": {
36-
"@biomejs/biome": "2.2.4",
36+
"@biomejs/biome": "2.3.1",
3737
"concurrently": "^9.2.1",
3838
"husky": "^9.1.7",
3939
"lerna": "^9.0.0",
40-
"lint-staged": "^16.2.3",
40+
"lint-staged": "^16.2.6",
4141
"replace-in-file": "^8.3.0",
42-
"typescript": "^5.9.2"
42+
"typescript": "^5.9.3"
4343
},
4444
"resolutions": {
4545
"prismjs": "^1.30.0"

packages/docs/.storybook/preview-head.html

Lines changed: 12 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
}
55

66
.sbdocs-h3:first-of-type {
7+
/* biome-ignore lint/complexity/noImportantStyles : we need to override the default styles */
78
margin: 20px 0 8px !important;
89
padding: 0;
910
}
@@ -24,6 +25,7 @@
2425
}
2526
}
2627

28+
/* biome-ignore lint/correctness/noUnknownMediaFeatureName : we need to override the default styles */
2729
@media all and (-ms-high-contrast:none) {
2830
.link-list {
2931
display: -ms-grid;
@@ -38,7 +40,6 @@
3840

3941
.link-list > button {
4042
cursor: pointer;
41-
display: block;
4243
text-align: left;
4344
padding: 20px 30px 20px 15px;
4445
border: 1px solid #00000010;
@@ -136,11 +137,7 @@
136137
.drop-in-js--organization-settings button,
137138
.drop-in-js--organization-settings input[type="submit"] {
138139
border: 0;
139-
border-radius: 3em;
140140
cursor: pointer;
141-
display: inline-block;
142-
overflow: hidden;
143-
padding: 8px 16px;
144141
position: relative;
145142
text-align: center;
146143
-webkit-text-decoration: none;
@@ -153,13 +150,8 @@
153150
transform: translate3d(0,0,0);
154151
vertical-align: top;
155152
white-space: nowrap;
156-
-webkit-user-select: none;
157-
-moz-user-select: none;
158-
-ms-user-select: none;
159-
user-select: none;
160153
opacity: 1;
161154
margin: 0;
162-
background: transparent;
163155
font-size: 12px;
164156
font-weight: 700;
165157
line-height: 1;
@@ -202,42 +194,42 @@
202194

203195
/* Weird Storybook issue on firefox */
204196
[scale="1"] {
205-
transform: none !important;
206-
transform-origin: initial !important;
207-
height: auto !important;
197+
transform: none;
198+
transform-origin: initial;
199+
height: auto;
208200
}
209201
</style>
210202

211203
<style>
212204
ol {
213-
list-style: decimal !important;
205+
list-style: decimal;
214206
}
215207
h2 {
216-
margin: 40px 0 8px !important;
208+
margin: 40px 0 8px;
217209
}
218210
h3 {
219-
margin: 20px 0 8px !important;
211+
margin: 20px 0 8px;
220212
}
221213
a:link, a:link:hover, a:link:active, a:visited {
222-
color: #029CFD !important;
214+
color: #029CFD;
223215
text-decoration: underline;
224216
}
225217
</style>
226218

227219
<style>
228220
.language-diff .token.deleted {
229-
color: #E57373 !important;
221+
color: #E57373;
230222
}
231223
.language-diff .token.inserted {
232-
color: #AED581 !important;
224+
color: #AED581;
233225
}
234226
</style>
235227

236228
<!-- used for the demo story -->
237229
<script src="https://cdn.tailwindcss.com"></script>
238230

239231
<script>
240-
(function() {
232+
(() => {
241233
// This hack is to remove the access token from the URL after the user has been redirected back to the docs (only for storybook use-case).
242234
setTimeout(() => {
243235
const url = new URL(window.parent.location.href)

packages/docs/package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,16 @@
1717
"email": "marco.montalbano@commercelayer.io"
1818
},
1919
"devDependencies": {
20-
"@babel/core": "^7.28.4",
21-
"@babel/preset-env": "^7.28.3",
22-
"@babel/preset-react": "^7.27.1",
23-
"@babel/preset-typescript": "^7.27.1",
24-
"@storybook/addon-docs": "^9.1.9",
25-
"@storybook/addon-links": "^9.1.9",
26-
"@storybook/html-vite": "^9.1.9",
20+
"@babel/core": "^7.28.5",
21+
"@babel/preset-env": "^7.28.5",
22+
"@babel/preset-react": "^7.28.5",
23+
"@babel/preset-typescript": "^7.28.5",
24+
"@storybook/addon-docs": "^9.1.15",
25+
"@storybook/addon-links": "^9.1.15",
26+
"@storybook/html-vite": "^9.1.15",
2727
"@storybook/icons": "^1.6.0",
2828
"@types/common-tags": "^1.8.4",
29-
"@types/node": "^20.19.18",
29+
"@types/node": "^20.19.23",
3030
"@types/react": "^19",
3131
"@types/react-syntax-highlighter": "^15.5.13",
3232
"babel-loader": "^10.0.0",
@@ -38,9 +38,9 @@
3838
"react-syntax-highlighter": "^15.6.6",
3939
"remark-gfm": "^4.0.1",
4040
"sass": "^1.93.2",
41-
"storybook": "^9.1.9",
42-
"typescript": "^5.9.2",
43-
"vite": "^7.1.7"
41+
"storybook": "^9.1.15",
42+
"typescript": "^5.9.3",
43+
"vite": "^7.1.12"
4444
},
4545
"dependencies": {
4646
"@commercelayer/drop-in.js": "workspace:^2.19.0",

packages/drop-in/package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -45,33 +45,33 @@
4545
"email": "marco.montalbano@commercelayer.io"
4646
},
4747
"dependencies": {
48-
"@commercelayer/js-auth": "^7.0.0",
48+
"@commercelayer/js-auth": "^7.1.0",
4949
"@commercelayer/organization-config": "^2.4.0",
50-
"@commercelayer/sdk": "^6.47.0",
50+
"@commercelayer/sdk": "^7.3.0",
5151
"@types/lodash-es": "^4.17.12",
5252
"iframe-resizer": "4.3.11",
5353
"js-cookie": "^3.0.5",
5454
"lodash-es": "^4.17.21",
55-
"type-fest": "^5.0.1"
55+
"type-fest": "^5.1.0"
5656
},
5757
"peerDependencies": {
5858
"@stencil/core": "^4.0.0"
5959
},
6060
"devDependencies": {
61-
"@stencil/core": "4.37.1",
61+
"@stencil/core": "4.38.2",
6262
"@stencil/sass": "^3.2.2",
6363
"@types/iframe-resizer": "^4.0.0",
6464
"@types/jest": "^29.5.14",
6565
"@types/js-cookie": "^3.0.6",
66-
"@types/node": "^20.19.18",
66+
"@types/node": "^20.19.23",
6767
"jest": "^29.7.0",
6868
"jest-cli": "^29.7.0",
6969
"lodash": "^4.17.21",
7070
"nodemon": "^3.1.10",
71-
"puppeteer": "24.22.3",
71+
"puppeteer": "24.26.1",
7272
"sass": "^1.93.2",
73-
"ts-jest": "^29.4.4",
74-
"typescript": "^5.9.2"
73+
"ts-jest": "^29.4.5",
74+
"typescript": "5.9.3"
7575
},
7676
"license": "MIT",
7777
"engines": {

packages/drop-in/src/apis/commercelayer/client.ts

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
import { makeSalesChannel } from "@commercelayer/js-auth"
22
import CommerceLayer, {
3-
type CommerceLayerClient,
3+
bundles,
44
type Customer,
5+
customers,
6+
line_items,
7+
orders,
8+
organization,
9+
prices,
10+
skus,
511
} from "@commercelayer/sdk"
612
import Cookies from "js-cookie"
713
import { memoize } from "lodash-es"
@@ -93,15 +99,23 @@ export const getAccessToken = memoize(
9399
(clientCredentials) => JSON.stringify(clientCredentials),
94100
)
95101

96-
export async function createClient(
97-
config: Config,
98-
): Promise<CommerceLayerClient> {
102+
export async function createClient(config: Config) {
99103
const token = await getAccessToken(config)
100104

101-
return CommerceLayer({
105+
CommerceLayer({
102106
accessToken: token.accessToken,
103107
domain: config.domain,
104108
})
109+
110+
return {
111+
bundles,
112+
customers,
113+
line_items,
114+
orders,
115+
organization,
116+
prices,
117+
skus,
118+
}
105119
}
106120

107121
export const customerFields = [

packages/drop-in/src/cart.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@
132132
const addToCart = document.getElementById('vs--add-to-cart')
133133
const availability = document.getElementById('vs--availability')
134134

135-
select.addEventListener('change', function (event) {
135+
select.addEventListener('change', (event) => {
136136
const sku = event.currentTarget.value
137137
title.innerText = sku
138138
price.code = sku

packages/drop-in/src/components.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ export namespace Components {
8181
* Open the minicart and set the opener so that the minicart can be closed by focusing on the opener. (available _only_ when the `cl-cart` component is used as _minicart_).
8282
* @param opener The opener of the minicart.
8383
*/
84-
"openMinicart": (opener: HTMLElement) => Promise<void>;
84+
"openMinicart": (opener: Pick<HTMLElement, "focus">) => Promise<void>;
8585
/**
8686
* If `true` the minicart automatically opens as soon as an item is added to the shopping cart (available _only_ when the `cl-cart` component is used as _minicart_).
8787
* @default false

packages/drop-in/src/components/cl-cart-link/cl-cart-link.spec.tsx

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
import type { CommerceLayerClient } from "@commercelayer/sdk"
1+
import type {
2+
orders as sdkOrders,
3+
organization as sdkOrganization,
4+
} from "@commercelayer/sdk"
25
import { newSpecPage } from "@stencil/core/testing"
36
import { waitFor } from "jest.spec.helpers"
47
import * as cart from "@/apis/commercelayer/cart"
@@ -20,7 +23,7 @@ describe("cl-cart-link.spec", () => {
2023
jest.spyOn(client, "createClient").mockResolvedValue({
2124
orders,
2225
organization,
23-
} as unknown as CommerceLayerClient)
26+
} as unknown as ReturnType<(typeof client)["createClient"]>)
2427

2528
const { root, waitForChanges } = await newSpecPage({
2629
components: [ClCartLink],
@@ -53,7 +56,7 @@ describe("cl-cart-link.spec", () => {
5356
jest.spyOn(client, "createClient").mockResolvedValue({
5457
orders,
5558
organization,
56-
} as unknown as CommerceLayerClient)
59+
} as unknown as ReturnType<(typeof client)["createClient"]>)
5760
jest.spyOn(cart, "getCart").mockResolvedValue({
5861
type: "orders",
5962
id: "order-123",
@@ -90,7 +93,7 @@ describe("cl-cart-link.spec", () => {
9093
jest.spyOn(client, "createClient").mockResolvedValue({
9194
orders,
9295
organization,
93-
} as unknown as CommerceLayerClient)
96+
} as unknown as ReturnType<(typeof client)["createClient"]>)
9497

9598
const { root, waitForChanges } = await newSpecPage({
9699
components: [ClCartLink],
@@ -129,7 +132,7 @@ describe("cl-cart-link.spec", () => {
129132
const accessToken =
130133
"eyJhbGciOiJSUzUxMiIsInR5cCI6IkpXVCIsImtpZCI6IjliN2JiZmVlMzQzZDVkNDQ5ZGFkODhmMjg0MGEyZTM3YzhkZWFlZTg5NjM4MGQ1ODA2YTc4NWVkMWQ1OTc5ZjAifQ.eyJvcmdhbml6YXRpb24iOnsiaWQiOiJPblZOcUZPTUpuIiwic2x1ZyI6ImRyb3AtaW4tanMiLCJlbnRlcnByaXNlIjp0cnVlLCJyZWdpb24iOiJldS13ZXN0LTEifSwiYXBwbGljYXRpb24iOnsiaWQiOiJkTm5XbWl4eEtHIiwiY2xpZW50X2lkIjoia3VTS1BiZUtiVTlMRzlMam5kemllS1dSY2ZpWEZ1RWZPME9ZSFhLSDlKOCIsImtpbmQiOiJzYWxlc19jaGFubmVsIiwicHVibGljIjp0cnVlfSwibWFya2V0Ijp7ImlkIjpbIkJvd2RHaHdYZGoiXSwic3RvY2tfbG9jYXRpb25faWRzIjpbIkRuZ2VwdU5tT2siLCJLR3lPanV5S1hNIl0sImdlb2NvZGVyX2lkIjpudWxsLCJhbGxvd3NfZXh0ZXJuYWxfcHJpY2VzIjpmYWxzZX0sInNjb3BlIjoibWFya2V0OmNvZGU6dXNhIiwiZXhwIjoxNzMwOTEzNjkxLCJ0ZXN0Ijp0cnVlLCJyYW5kIjowLjQ2MjA0OTI5MDY1NTczNTIsImlhdCI6MTczMDkwNjQ5MSwiaXNzIjoiaHR0cHM6Ly9hdXRoLmNvbW1lcmNlbGF5ZXIuaW8ifQ.OJerreNcfS_QKQ691iKyJqgAemIouRTBHfqmy2mlAt4_GnqtqjEFRW_hE9SNW8h80eUnSDMc4ocOSsHL5nqKZQeXkwlycwtYzNMralEM03jgLDIMvRzfFznZNOXNrySSFPQ9zrIHlbyfW3Wxc8hMEz-SvZ7t0cSlrvSqSEoLBAoMQqsBJkiIVYMWlUmgq_d0dznU4U8MJiPvC-rb32lRinLl3M0TGGApnDTijuQALywGbPkNZzMs3rrK8pz1Gf7ZYVgu9aXUCDEVEac99kTLJj2DJdHMNHYjzupoKu8xSutSAShN8MHaM_9ijuJHmlCdgAfQtEKoGOKpGp7JH8Zl7zeYDkmsdVAqvGAIGNBzHnxb7SdPXmPViq_9u5K9Bq1IBr9K1TwcCyjMTFghnJm6CfDQ60AEPB4dxWHSXNTyGCAcrSwDqni7dgcD3G1Asqb5TmlxOtcmC0jXrZE4TQQZqBUFBiWTXiMhFhq8tGE6PlW0fIZzV9xlKPkaLPKO6rGdmiutmofAB8CVz1ZkmyIaHNR4KbIfWZUVQDEOkCPHzy_yXB7LinYlpDtVlJxZ9n_aetuxmJweLT94LQml56kcmXRPJbNH208ermGKpipQkqM6GoknqtEG3ouVgahjVwD2bSqFGPtZyrYgIzhunupkIhEz1dSLDrk0wXJS9GY4W50"
131134

132-
const orders: Partial<CommerceLayerClient["orders"]> = {
135+
const orders: Partial<typeof sdkOrders> = {
133136
create: jest.fn().mockResolvedValue({
134137
type: "orders",
135138
id: "order-123",
@@ -138,7 +141,7 @@ const orders: Partial<CommerceLayerClient["orders"]> = {
138141
}),
139142
}
140143

141-
const organization: Partial<CommerceLayerClient["organization"]> = {
144+
const organization: Partial<typeof sdkOrganization> = {
142145
retrieve: jest.fn().mockResolvedValue({
143146
type: "organizations",
144147
id: "organization-123",

0 commit comments

Comments
 (0)