Skip to content

Commit 9fba5b7

Browse files
committed
initial commit from create-catalyst
0 parents  commit 9fba5b7

File tree

348 files changed

+32624
-0
lines changed

Some content is hidden

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

348 files changed

+32624
-0
lines changed

.env.example

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# The hash visible in the subject store's URL when signed in to the store control panel.
2+
# The control panel URL is of the form `https://store-{hash}.mybigcommerce.com`.
3+
BIGCOMMERCE_STORE_HASH=
4+
5+
# The access token from a store-level API account. The only scope required to run Catalyst is Carts `manage`.
6+
# See https://developer.bigcommerce.com/docs/start/authentication/api-accounts#store-level-api-accounts
7+
BIGCOMMERCE_ACCESS_TOKEN=
8+
9+
# A bearer token that authorizes server-to-server requests to the GraphQL Storefront API
10+
# See https://developer.bigcommerce.com/docs/rest-authentication/tokens/customer-impersonation-token
11+
BIGCOMMERCE_CUSTOMER_IMPERSONATION_TOKEN=
12+
13+
# The Channel ID for the selling channel being serviced by this Catalyst storefront.
14+
# Channel ID 1 will allow you to load the same data being used on the default Stencil storefront on your store,
15+
# but it is strongly recommended to create a new channel instead for production.
16+
# The CLI can do this for you.
17+
BIGCOMMERCE_CHANNEL_ID=1
18+
19+
# Set to true to allow the /admin route to redirect to the BigCommerce control panel.
20+
# `false` is recommended for production. Defaults to false when not specified.
21+
# You may also delete /admin/route.ts if you wish.
22+
ENABLE_ADMIN_ROUTE=true
23+
24+
# Used by Auth.js, formerly NextAuth. To generate, run `openssl rand -hex 32` in your terminal.
25+
AUTH_SECRET=
26+
27+
# Recommended so that you can use Turborepo's Remote Cache feature with signed artifacts
28+
# https://turbo.build/repo/docs/core-concepts/remote-caching#artifact-integrity-and-authenticity-verification
29+
# This can also be generated with `openssl rand -hex 32`, but do not re-use the value from AUTH_SECRET
30+
TURBO_REMOTE_CACHE_SIGNATURE_KEY=
31+
32+
# NextJS will persists cached queries in Data Cache
33+
# The time persisted is not defined
34+
# https://nextjs.org/docs/app/building-your-application/caching#data-cache
35+
# This sets a sensible revalidation target for cached requests
36+
NEXT_PUBLIC_DEFAULT_REVALIDATE_TARGET=3600

.eslintrc.cjs

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// @ts-check
2+
3+
// eslint-disable-next-line import/no-extraneous-dependencies
4+
require('@bigcommerce/eslint-config/patch');
5+
6+
/** @type {import('eslint').Linter.Config} */
7+
const config = {
8+
root: true,
9+
extends: [
10+
'@bigcommerce/catalyst/base',
11+
'@bigcommerce/catalyst/react',
12+
'@bigcommerce/catalyst/next',
13+
'@bigcommerce/catalyst/prettier',
14+
],
15+
rules: {
16+
'@typescript-eslint/naming-convention': 'off',
17+
'@next/next/no-html-link-for-pages': 'off',
18+
'import/dynamic-import-chunkname': 'off',
19+
'no-underscore-dangle': ['error', { allow: ['__typename'] }],
20+
'@typescript-eslint/prefer-nullish-coalescing': 'off',
21+
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
22+
'@typescript-eslint/no-restricted-imports': [
23+
'error',
24+
{
25+
paths: [
26+
{
27+
name: 'next/link',
28+
message: "Please import 'Link' from '~/components/Link' instead.",
29+
},
30+
],
31+
},
32+
],
33+
'check-file/folder-naming-convention': [
34+
'error',
35+
{
36+
'**': 'NEXT_JS_APP_ROUTER_CASE',
37+
},
38+
],
39+
},
40+
ignorePatterns: ['client/generated/**/*.ts', ],
41+
};
42+
43+
module.exports = config;

.gitignore

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
/test-results/
11+
/playwright-report/
12+
/playwright/.cache/
13+
14+
# next.js
15+
/.next/
16+
/out/
17+
18+
# production
19+
/build
20+
21+
# misc
22+
.DS_Store
23+
*.pem
24+
25+
# debug
26+
npm-debug.log*
27+
yarn-debug.log*
28+
yarn-error.log*
29+
.pnpm-debug.log*
30+
31+
# local env files
32+
.env*.local
33+
34+
# vercel
35+
.vercel
36+
37+
# typescript
38+
*.tsbuildinfo
39+
next-env.d.ts
40+
41+
# generated
42+
client/generated
43+
schema.graphql
44+
45+
# secrets
46+
.catalyst

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib"
3+
}

CHANGELOG.md

Lines changed: 238 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<a href="https://catalyst.dev" target="_blank" rel="noopener norerrer">
2+
<img src="https://storage.googleapis.com/bigcommerce-developers/images/catalyst_readme_banner.png" alt="Catalyst for Composable Commerce Image Banner" title="Catalyst">
3+
</a>
4+
5+
<br />
6+
7+
**Catalyst** is the composable, fully customizable headless ecommerce storefront framework for
8+
[BigCommerce](https://www.bigcommerce.com/). Catalyst is built with [Next.js](https://nextjs.org/), uses
9+
our [React](https://react.dev/) storefront components, and is backed by the
10+
[GraphQL Storefront API](https://developer.bigcommerce.com/docs/storefront/graphql).
11+
12+
By choosing Catalyst, you'll have a fully-functional storefront within a few seconds, and spend zero time on wiring
13+
up APIs or building SEO, Accessibility, and Performance-optimized ecommerce components you've probably written many
14+
times before. You can instead go straight to work building your brand and making this your own.
15+
16+
<div align="center">
17+
18+
![-----------------------------------------------------](https://storage.googleapis.com/bigcommerce-developers/images/catalyst_readme_hr.png)
19+
20+
</div>
21+
22+
<p align="center">
23+
<a href="https://www.catalyst.dev">🚀 catalyst.dev</a> •
24+
<a href="https://developer.bigcommerce.com/community">🤗 BigCommerce Developer Community</a> •
25+
<a href="https://github.com/bigcommerce/catalyst/discussions">💬 GitHub Discussions</a>
26+
</p>
27+
28+
<div align="center">
29+
30+
![-----------------------------------------------------](https://storage.googleapis.com/bigcommerce-developers/images/catalyst_readme_hr.png)
31+
32+
</div>
33+
34+
## Requirements
35+
36+
- Node.js 20+
37+
- `npm` (or `pnpm`/`yarn`)
38+
39+
## Getting started
40+
41+
If this installation of Catalyst was created using the `catalyst` CLI, you should already be connected to a store and can get started immediately by running:
42+
43+
```shell
44+
npm run dev
45+
```
46+
47+
If you want to connect to another store or channel, you can run the setup process again by running:
48+
49+
```shell
50+
npx @bigcommerce/create-catalyst@latest init
51+
```
52+
53+
Learn more about Catalyst at [catalyst.dev](https://catalyst.dev).
54+
55+
## Resources
56+
57+
- [GraphQL Storefront API Playground](https://developer.bigcommerce.com/graphql-storefront/playground)
58+
- [GraphQL Storefront API Explorer](https://developer.bigcommerce.com/graphql-storefront/explorer)
59+
- [BigCommerce DevDocs](https://developer.bigcommerce.com/docs/build)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { useTranslations } from 'next-intl';
2+
import { ComponentPropsWithoutRef, PropsWithChildren } from 'react';
3+
4+
import { Props as FacetProps, Facets } from './facets';
5+
import { RefineBy, Props as RefineByProps } from './refine-by';
6+
7+
interface Props extends FacetProps, RefineByProps, ComponentPropsWithoutRef<'aside'> {
8+
headingId: string;
9+
}
10+
11+
export const FacetedSearch = ({
12+
facets,
13+
headingId,
14+
pageType,
15+
children,
16+
...props
17+
}: PropsWithChildren<Props>) => {
18+
const t = useTranslations('FacetedGroup.FacetedSearch');
19+
20+
return (
21+
<aside aria-labelledby={headingId} {...props}>
22+
<h2 className="sr-only" id={headingId}>
23+
{t('filters')}
24+
</h2>
25+
26+
{children}
27+
28+
<RefineBy facets={facets} pageType={pageType} />
29+
30+
<Facets facets={facets} pageType={pageType} />
31+
</aside>
32+
);
33+
};

0 commit comments

Comments
 (0)