Skip to content

Commit a4e5bec

Browse files
bc-victorgithub-actions[bot]bookernathmatthewvolkjorgemoya
authored
Merge @bigcommerce/catalyst-core@1.1.0 into integrations/b2b-buyer-portal (#2504)
* Version Packages (`canary`) (#2452) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Bump next to latest canary (#2465) * docs: how to verify new merge base established when syncing (#2451) Improve explanation around the importance of establishing a new merge base every time `canary` is merged into `integrations/makeswift` * chore(core): remove runtime edge declarations (#2464) * Update translations (#2468) * feat(other): LOCAL-1444 delivery translation * chore(core): create translations patch --------- Co-authored-by: bc-svc-local <bc-svc-local@users.noreply.github.com> Co-authored-by: Jorge Moya <jorge.moya@bigcommerce.com> * Use min and max purchase quantity to set bounds of quantity number input (#2474) * chore: update ci to include @bigcommerce/catalyst (#2463) * chore: update deps mostly related to packages/cli (#2461) * chore: use @commander-js/extra-typings as devDep (#2462) * feat: render scripts from Script Manager (#2477) * chore: hoist eslint plugins for ide support (#2460) * feat: recursively copy cwd into temp folder (#2479) * feat(cli): scaffold deploy command and generate bundle zip (#2481) * feat(cli): scaffold deploy command and generate bundle zip * feat: remove archiver and only use adm-zip * feat: add extra checks for build files * refactor: move checks around * fix: use .bigcommerce/dist as build path * refactor: split mkTempDir to own lib file and update tests * fix: remove file * fix: set default value for prefix * fix: remove extra-typings * feat: install and build all deps required to bundle catalyst (#2486) * chore: bump opennextjs-cloudflare version (#2487) * feat(cli): generate upload signature and upload bundle.zip (#2484) * feat(cli): generate upload signature and upload bundle.zip * feat: read from env variables * feat: use zod to validate response * refactor: parse * feat: read api host from env * refactor: infer option types in deploy command action (#2490) * feat: copy templates from cli to catalyst build tmpdir (#2489) * Version Packages (`canary`) (#2466) Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Nathan Booker <bookernath@users.noreply.github.com> Co-authored-by: Matthew Volk <matt.volk@bigcommerce.com> Co-authored-by: Jorge Moya <jorge.moya@bigcommerce.com> Co-authored-by: bc-svc-local <102379007+bc-svc-local@users.noreply.github.com> Co-authored-by: bc-svc-local <bc-svc-local@users.noreply.github.com>
1 parent e6034f4 commit a4e5bec

78 files changed

Lines changed: 2050 additions & 1085 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/ninety-flowers-retire.md

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/basic.yml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ jobs:
3333
- name: Use Node.js
3434
uses: actions/setup-node@v4
3535
with:
36-
node-version-file: '.nvmrc'
37-
cache: 'pnpm'
36+
node-version-file: ".nvmrc"
37+
cache: "pnpm"
3838

3939
- name: Install dependencies
4040
run: pnpm install --frozen-lockfile
@@ -48,10 +48,13 @@ jobs:
4848
- name: Typecheck
4949
run: pnpm run typecheck
5050

51-
unit-tests:
52-
name: CLI Unit Tests
51+
cli-tests:
52+
name: CLI Tests
5353

54-
runs-on: ubuntu-latest
54+
strategy:
55+
matrix:
56+
os: [ubuntu-latest, windows-latest, macos-latest]
57+
runs-on: ${{ matrix.os }}
5558

5659
steps:
5760
- name: Checkout code
@@ -71,5 +74,4 @@ jobs:
7174
run: pnpm install --frozen-lockfile
7275

7376
- name: Run Tests
74-
run: pnpm test
75-
working-directory: packages/create-catalyst
77+
run: pnpm run test

CONTRIBUTING.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,9 @@ To pull the latest code from `canary` into `integrations/makeswift`, follow the
8484
```
8585

8686
> [!IMPORTANT]
87-
> It is very important that you do not use the merge button in the GitHub UI to merge your PR. The problem with the "Squash and merge" or "Rebase and merge" button in GitHub is that it **rewrites history and throws away your local merge commit**. Instead, locally rebasing your `integrations/makeswift` branch onto your `{new-branch-name}` branch preserves the merge commit from step 4, which will properly set the new merge base for future merges from `canary` into `integrations/makeswift`.
87+
> We have added a GitHub Ruleset to protect against this, but it's worth explicitly documenting here for posterity: It is very important that we do not "Squash and merge" or "Rebase and merge" our changes onto `integrations/makeswift`. Instead, we should either merge the PR with a traditional merge commit (the button in the GitHub PR UI should say "Merge pull request"), or locally rebase the `integrations/makeswift` branch onto the `{new-branch-name}` branch (as illustrated in the step above). Either of these options will correctly preserve the merge commit from step 4 in the history of the `integrations/makeswift` branch, which will then set the new merge base for future merges from `canary` into `integrations/makeswift`.
88+
>
89+
> If you are unsure whether or not you've done this correctly, you can run `git merge canary` from `integrations/makeswift` after rebasing in the step above; if you see "Already up to date.", you followed the steps correctly (with one caveat: in the case that new commits have been pushed to `canary` since the last time you merged, then you may see a new merge commit/potential conflicts for only those new commits).
8890
8991
7. Push the changes up to GitHub, which will automatically close the open PR from step 5.
9092

core/.eslintrc.cjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
require('@bigcommerce/eslint-config/patch');
44

5-
/** @type {import('eslint').Linter.Config} */
5+
/** @type {import('eslint').Linter.LegacyConfig} */
66
const config = {
77
root: true,
88
extends: [

core/CHANGELOG.md

Lines changed: 22 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# Changelog
22

3+
## 1.1.0
4+
5+
### Minor Changes
6+
7+
- [#2477](https://github.com/bigcommerce/catalyst/pull/2477) [`02af32c`](https://github.com/bigcommerce/catalyst/commit/02af32c459719f97e8973a19b6889e5fa73d0c38) Thanks [@bookernath](https://github.com/bookernath)! - Add support for Scripts API/Script Manager scripts rendering via next/script
8+
9+
### Patch Changes
10+
11+
- [#2465](https://github.com/bigcommerce/catalyst/pull/2465) [`a438bb6`](https://github.com/bigcommerce/catalyst/commit/a438bb660bc3bd11adacd125769ba99ba2e1c38d) Thanks [@bookernath](https://github.com/bookernath)! - Bump next to 15.4.0-canary.114 to fix issue with PDPs 500ing on Docker builds
12+
13+
- [#2474](https://github.com/bigcommerce/catalyst/pull/2474) [`989bf97`](https://github.com/bigcommerce/catalyst/commit/989bf974c534a7201782ace9a4bf3fe745e8af01) Thanks [@bookernath](https://github.com/bookernath)! - Respect min/max purchase quantity from API in quantity selector
14+
15+
- [#2464](https://github.com/bigcommerce/catalyst/pull/2464) [`474f960`](https://github.com/bigcommerce/catalyst/commit/474f960c4c428e28874022b36ae2b03e0b301e20) Thanks [@jorgemoya](https://github.com/jorgemoya)! - Remove edge runtime declarations to be able to run Catalyst with OpenNext.
16+
17+
- [#2468](https://github.com/bigcommerce/catalyst/pull/2468) [`8b64931`](https://github.com/bigcommerce/catalyst/commit/8b6493156a70490c0c35c35d45ebd9ad8f23615c) Thanks [@bc-svc-local](https://github.com/bc-svc-local)! - Update translations.
18+
19+
## 1.0.1
20+
21+
### Patch Changes
22+
23+
- [#2448](https://github.com/bigcommerce/catalyst/pull/2448) [`e4444a2`](https://github.com/bigcommerce/catalyst/commit/e4444a2ca83b5b73776c842feff56e47f57344dc) Thanks [@chanceaclark](https://github.com/chanceaclark)! - Fixes an issue where the anonymous session wasn't getting cleared after an actual session was established.
24+
325
## 1.0.0
426

527
### Major Changes
@@ -93,7 +115,6 @@ This is a add-only change, so migration should be as simple as pulling in the ne
93115

94116
- Updated `/app/[locale]/(default)/compare/page.tsx` to use `Streamable.from` pattern.
95117
- Renamed `getCompareData` query to `getComparedProducts`.
96-
97118
- Updated query
98119
- Returns empty `[]` if no product ids are passed
99120

@@ -134,7 +155,6 @@ This is a add-only change, so migration should be as simple as pulling in the ne
134155
- Update`/(facted)/category/[slug]/fetch-compare-products.ts`
135156
- Request now accept `customerAccessToken` as a prop instead of calling internally.
136157
- Update `/(faceted)/fetch-faceted-search.ts`
137-
138158
- Request now accept `customerAccessToken` and `currencyCode` as a prop instead of calling internally.
139159

140160
- [`537db2c`](https://github.com/bigcommerce/catalyst/commit/537db2c) Thanks [@chancellorclark](https://github.com/chancellorclark)! - Add the ability to redirect from the login page. Developers can now append a relative path to the `?redirectTo=` query param on the `/login` page. When a shopper successfully logs in, it'll redirect them to the given relative path. Defaults to `/account/orders` to prevent a breaking change.
@@ -185,7 +205,6 @@ Any import statements that import `expect` and `test` from `@playwright/test` sh
185205
**Migration instructions:**
186206

187207
- Update `/(facted)/search/page.tsx`
188-
189208
- For this page we are now doing a blocking request for brand page data. Instead of having functions that each would read from props, we share streamable functions that can be passed to our UI components. We still stream in filter and product data.
190209

191210
- [`da2a462`](https://github.com/bigcommerce/catalyst/commit/da2a462) Thanks [@bookernath](https://github.com/bookernath)! - Adds the ability to redirect after logout.
@@ -554,7 +573,6 @@ Previously, the pages would 404 which is misleading.
554573
- Update`/product/[slug]/_components`.
555574
- Similar to `page.tsx` and `page.data`, expect changes in the fragments defined and how we pass streamable functions to UI components.
556575
- Update `/vibes/soul/product-detail/index.tsx` & `/vibes/soul/product-detail/product-detail-form.tsx`
557-
558576
- Minor changes to allow streaming in data.
559577
560578
- [`8a25424`](https://github.com/bigcommerce/catalyst/commit/8a25424) Thanks [@chancellorclark](https://github.com/chancellorclark)! - Refactors the sign in functionality to use two separate providers instead of one. This is some work needed to be done in order to provide a better API for session syncing so it shouldn't effect any existing functionality.
@@ -665,7 +683,6 @@ git mv core/app/[locale]/(default)/product/[slug]/_components/product-analytics-
665683
666684
- Update `ProductDetailForm` to prevent reset on submit, by removing `requestFormReset` in the `onSubmit`.
667685
- Remove `router.refresh()` call and instead call new `revalidateCart` action.
668-
669686
- `revalidateCart` is an action that `revalidateTag(TAGS.cart)`
670687
- This prevents the form from fully refreshing on success.
671688
@@ -1061,7 +1078,6 @@ dark:
10611078
### Minor Changes
10621079
10631080
- [#1491](https://github.com/bigcommerce/catalyst/pull/1491) [`313a591`](https://github.com/bigcommerce/catalyst/commit/313a5913181a144b53cb12208132f4a9924e2256) Thanks [@jorgemoya](https://github.com/jorgemoya)! - Bump `next-intl` which includes [some minor changes and updated APIs](<(https://next-intl-docs.vercel.app/blog/next-intl-3-22)>):
1064-
10651081
- Use new `createNavigation` api.
10661082
- Pass `locale` to redirects.
10671083
- `setRequestLocale` is no longer unstable.
@@ -1157,7 +1173,6 @@ dark:
11571173
- [#1362](https://github.com/bigcommerce/catalyst/pull/1362) [`0814afe`](https://github.com/bigcommerce/catalyst/commit/0814afefca00b2497dddb0622df45f4d50865882) Thanks [@deini](https://github.com/deini)! - If app is not running on Vercel's infra, `<Analytics />` and `<SpeedInsights />` are not rendered.
11581174
11591175
Opt-out of vercel analytics and speed insights by setting the following env vars to `true`
1160-
11611176
- `DISABLE_VERCEL_ANALYTICS`
11621177
- `DISABLE_VERCEL_SPEED_INSIGHTS`
11631178
@@ -1246,7 +1261,6 @@ dark:
12461261
- [#1278](https://github.com/bigcommerce/catalyst/pull/1278) [`f8553c6`](https://github.com/bigcommerce/catalyst/commit/f8553c6c9fb35ab7a143fabd60719c8156269448) Thanks [@jorgemoya](https://github.com/jorgemoya)! - Fix wrapping author text in BlogPostCard.
12471262
12481263
- [#1322](https://github.com/bigcommerce/catalyst/pull/1322) [`77ecb4b`](https://github.com/bigcommerce/catalyst/commit/77ecb4bb4f527e079788b0f9dff2468e92d0bc1a) Thanks [@jorgemoya](https://github.com/jorgemoya)! - Split auth forms to four different pages:
1249-
12501264
- /login
12511265
- /register
12521266
- /reset
@@ -1296,7 +1310,6 @@ dark:
12961310
- [#1194](https://github.com/bigcommerce/catalyst/pull/1194) [`b455b05`](https://github.com/bigcommerce/catalyst/commit/b455b05a6121b005bd5147a25c964b9554b1b350) Thanks [@BC-krasnoshapka](https://github.com/BC-krasnoshapka)! - Add basic support for Google Analytics via [Big Open Data Layer](https://developer.bigcommerce.com/docs/integrations/hosted-analytics). BODL and GA4 integration is encapsulated in `bodl` library which hides current complexity and limitations that will be improved in future. It can be extended with more events and integrations with other analytics providers later. Data transformation from Catalyst data models to BODL and firing events is done in client components, as only frontend events are supported by BODL for now.
12971311
12981312
List of currently supported events:
1299-
13001313
- View product category
13011314
- View product page
13021315
- Add product to cart

core/app/[locale]/(default)/(auth)/login/token/[token]/route.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,4 @@ export async function GET(_: Request, { params }: { params: Promise<{ token: str
3333
}
3434
}
3535

36-
export const runtime = 'edge';
3736
export const dynamic = 'force-dynamic';

core/app/[locale]/(default)/product/[slug]/page-data.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ const StreamableProductQuery = graphql(
242242
}
243243
}
244244
}
245+
minPurchaseQuantity
246+
maxPurchaseQuantity
245247
warranty
246248
inventory {
247249
isInStock

core/app/[locale]/(default)/product/[slug]/page.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,18 @@ export default async function Product({ params, searchParams }: Props) {
267267
return productCardTransformer(relatedProducts, format);
268268
});
269269

270+
const streamableMinQuantity = Streamable.from(async () => {
271+
const product = await streamableProduct;
272+
273+
return product.minPurchaseQuantity;
274+
});
275+
276+
const streamableMaxQuantity = Streamable.from(async () => {
277+
const product = await streamableProduct;
278+
279+
return product.maxPurchaseQuantity;
280+
});
281+
270282
const streamableAnalyticsData = Streamable.from(async () => {
271283
const [extendedProduct, pricingProduct] = await Streamable.all([
272284
streamableProduct,
@@ -313,6 +325,8 @@ export default async function Product({ params, searchParams }: Props) {
313325
subtitle: baseProduct.brand?.name,
314326
rating: baseProduct.reviewSummary.averageRating,
315327
accordions: streameableAccordions,
328+
minQuantity: streamableMinQuantity,
329+
maxQuantity: streamableMaxQuantity,
316330
}}
317331
quantityLabel={t('ProductDetails.quantity')}
318332
thumbnailLabel={t('ProductDetails.thumbnail')}

core/app/[locale]/layout.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { revalidate } from '~/client/revalidate-target';
2020
import { WebAnalyticsFragment } from '~/components/analytics/fragment';
2121
import { AnalyticsProvider } from '~/components/analytics/provider';
2222
import { ContainerQueryPolyfill } from '~/components/polyfills/container-query';
23+
import { ScriptManagerScripts, ScriptsFragment } from '~/components/scripts';
2324
import { routing } from '~/i18n/routing';
2425
import { getToastNotification } from '~/lib/server-toast';
2526

@@ -36,13 +37,16 @@ const RootLayoutMetadataQuery = graphql(
3637
}
3738
...WebAnalyticsFragment
3839
}
40+
content {
41+
...ScriptsFragment
42+
}
3943
}
4044
channel {
4145
entityId
4246
}
4347
}
4448
`,
45-
[WebAnalyticsFragment],
49+
[WebAnalyticsFragment, ScriptsFragment],
4650
);
4751

4852
const fetchRootLayoutMetadata = cache(async () => {
@@ -110,6 +114,12 @@ export default async function RootLayout({ params, children }: Props) {
110114

111115
return (
112116
<html className={clsx(fonts.map((f) => f.variable))} lang={locale}>
117+
<head>
118+
<ScriptManagerScripts
119+
scripts={data.site.content.headerScripts}
120+
strategy="afterInteractive"
121+
/>
122+
</head>
113123
<body className="flex min-h-screen flex-col">
114124
<NextIntlClientProvider>
115125
<NuqsAdapter>
@@ -126,6 +136,7 @@ export default async function RootLayout({ params, children }: Props) {
126136
</NextIntlClientProvider>
127137
<VercelComponents />
128138
<ContainerQueryPolyfill />
139+
<ScriptManagerScripts scripts={data.site.content.footerScripts} strategy="lazyOnload" />
129140
</body>
130141
</html>
131142
);

core/app/admin/route.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,3 @@ export const GET = () => {
1818
locale: defaultLocale,
1919
});
2020
};
21-
22-
export const runtime = 'edge';

0 commit comments

Comments
 (0)