Skip to content

Commit bc5f4e0

Browse files
committed
Merge branch 'canary' into sync-integrations-makeswift
2 parents 4a71feb + cbaf146 commit bc5f4e0

79 files changed

Lines changed: 2137 additions & 1902 deletions

Some content is hidden

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

.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/.env.test.example

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# For example, if BIGCOMMERCE_CHANNEL_ID=1 in .env.local, but BIGCOMMERCE_CHANNEL_ID=5 in this file, the test environment will use BIGCOMMERCE_CHANNEL_ID=5
44

55
# Access token client ID and client secret are required for JWT login tests. If not provided, tests that require these will be skipped.
6+
# If provided, ensure the API account associated with this client ID/secret pair has the following scope:
7+
# - Customers login: login
68
BIGCOMMERCE_CLIENT_ID=
79
BIGCOMMERCE_CLIENT_SECRET=
810

@@ -28,7 +30,23 @@ TEST_CUSTOMER_ID=1
2830
TEST_CUSTOMER_EMAIL=example@test.com
2931
TEST_CUSTOMER_PASSWORD=Password1
3032

31-
# Used to create customer accounts for testing purposes if no existing customer account is provided
33+
# Used to create/update/delete store data for testing purposes
34+
# Some tests will not pass without a BIGCOMMERCE_ACCESS_TOKEN, even with TESTS_READ_ONLY set to true
35+
# This is due to the test API client sending GET (read-only) API requests
36+
# Create a token with the following scopes:
37+
# - Content: read-only
38+
# - Products: read-only
39+
# - Channel listings: read-only
40+
# - Channel settings: read-only
41+
# - Information & settings: read-only
42+
# - Customers: read-only
43+
# - Orders: read-only
44+
# When TESTS_READ_ONLY is false, you'll need additional scopes:
45+
# - Products: modify
46+
# - Content: modify
47+
# - Customers: modify
48+
# - Marketing: modify
49+
# - Orders: modify
3250
BIGCOMMERCE_ACCESS_TOKEN=
3351

3452
# The default product ID to use for tests. This needs to be a product without variants (simple)

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: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,6 @@
189189
### Minor Changes
190190

191191
- [#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)>):
192-
193192
- Use new `createNavigation` api.
194193
- Pass `locale` to redirects.
195194
- `setRequestLocale` is no longer unstable.
@@ -285,7 +284,6 @@
285284
- [#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.
286285

287286
Opt-out of vercel analytics and speed insights by setting the following env vars to `true`
288-
289287
- `DISABLE_VERCEL_ANALYTICS`
290288
- `DISABLE_VERCEL_SPEED_INSIGHTS`
291289

@@ -374,7 +372,6 @@
374372
- [#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.
375373

376374
- [#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:
377-
378375
- /login
379376
- /register
380377
- /reset
@@ -424,7 +421,6 @@
424421
- [#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.
425422

426423
List of currently supported events:
427-
428424
- View product category
429425
- View product page
430426
- 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
productId={baseProduct.entityId}
318332
quantityLabel={t('ProductDetails.quantity')}

core/app/[locale]/layout.tsx

Lines changed: 10 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 { SiteTheme } from '~/lib/makeswift/components/site-theme';
2526
import { MakeswiftProvider } from '~/lib/makeswift/provider';
@@ -41,13 +42,16 @@ const RootLayoutMetadataQuery = graphql(
4142
}
4243
...WebAnalyticsFragment
4344
}
45+
content {
46+
...ScriptsFragment
47+
}
4448
}
4549
channel {
4650
entityId
4751
}
4852
}
4953
`,
50-
[WebAnalyticsFragment],
54+
[WebAnalyticsFragment, ScriptsFragment],
5155
);
5256

5357
const fetchRootLayoutMetadata = cache(async () => {
@@ -118,6 +122,10 @@ export default async function RootLayout({ params, children }: Props) {
118122
<html className={clsx(fonts.map((f) => f.variable))} lang={locale}>
119123
<head>
120124
<SiteTheme />
125+
<ScriptManagerScripts
126+
scripts={data.site.content.headerScripts}
127+
strategy="afterInteractive"
128+
/>
121129
</head>
122130
<body className="flex min-h-screen flex-col">
123131
<NextIntlClientProvider>
@@ -134,6 +142,7 @@ export default async function RootLayout({ params, children }: Props) {
134142
</NextIntlClientProvider>
135143
<VercelComponents />
136144
<ContainerQueryPolyfill />
145+
<ScriptManagerScripts scripts={data.site.content.footerScripts} strategy="lazyOnload" />
137146
</body>
138147
</html>
139148
</MakeswiftProvider>

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)