-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
189 changed files
with
766 additions
and
392 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,22 @@ | ||
# Shared env vars, used by all apps and api client | ||
# The hash visible in the subject store's URL when signed in to the store control panel. | ||
# The control panel URL is of the form `https://store-{hash}.mybigcommerce.com`. | ||
BIGCOMMERCE_STORE_HASH= | ||
|
||
# The access token from a store-level API account. The only scope required to run Catalyst is Carts `read-only`. | ||
# See https://developer.bigcommerce.com/api-docs/getting-started/api-accounts#store-level-api-accounts | ||
BIGCOMMERCE_ACCESS_TOKEN= | ||
|
||
# A bearer token that authorizes server-to-server requests to the GraphQL Storefront API | ||
# See https://developer.bigcommerce.com/docs/rest-authentication/tokens/customer-impersonation-token | ||
BIGCOMMERCE_CUSTOMER_IMPERSONATION_TOKEN= | ||
|
||
# The channel ID for the Catalyst storefront's dedicated channel. | ||
BIGCOMMERCE_CHANNEL_ID=1 | ||
|
||
# Set to true to allow the /admin route to redirect to the BigCommerce control panel. | ||
# `false` is recommended for production. Defaults to false when not specified. | ||
# You may also delete /admin/route.ts if you wish. | ||
ENABLE_ADMIN_ROUTE=true | ||
|
||
AUTH_SECRET= # Generate one typing `openssl rand -hex 32` in your terminal | ||
# Used by NextAuth, can be generated by running `openssl rand -hex 32` in your terminal. | ||
AUTH_SECRET= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: Basic workflow | ||
name: Lint, Typecheck, GraphQL Codegen | ||
|
||
on: | ||
push: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,8 @@ dist | |
.turbo | ||
.vscode/**/* | ||
!.vscode/settings.example.json | ||
.idea | ||
.vercel | ||
.env | ||
.env*.local | ||
test-results/ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
apps/core/app/(default)/(faceted)/brand/[slug]/static/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { getBrands } from '~/client/queries/getBrands'; | ||
|
||
import BrandPage from '../page'; | ||
|
||
export default BrandPage; | ||
|
||
export async function generateStaticParams() { | ||
const brands = await getBrands(); | ||
|
||
return brands.map((brand) => ({ | ||
slug: brand.entityId.toString(), | ||
})); | ||
} | ||
|
||
export const dynamic = 'force-static'; | ||
export const revalidate = 600; |
28 changes: 28 additions & 0 deletions
28
apps/core/app/(default)/(faceted)/category/[slug]/static/page.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { getCategoryTree } from '~/client/queries/getCategoryTree'; | ||
import { ExistingResultType } from '~/client/util'; | ||
|
||
import CategoryPage from '../page'; | ||
|
||
export default CategoryPage; | ||
|
||
type Categories = ExistingResultType<typeof getCategoryTree>; | ||
type Category = Omit<Categories[number], 'children'> & { children?: Category[] }; | ||
|
||
const getEntityIdsOfChildren = (categories: Category[] = []): number[] => | ||
categories.reduce<number[]>( | ||
(acc, category) => acc.concat(category.entityId, getEntityIdsOfChildren(category.children)), | ||
[], | ||
); | ||
|
||
export async function generateStaticParams() { | ||
const categories = await getCategoryTree(); | ||
|
||
const entityIds = getEntityIdsOfChildren(categories); | ||
|
||
return entityIds.map((entityId) => ({ | ||
slug: entityId.toString(), | ||
})); | ||
} | ||
|
||
export const dynamic = 'force-static'; | ||
export const revalidate = 600; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
apps/core/app/(default)/product/[slug]/_components/ReviewSummary.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.