Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions solutions/giftcard-tutorial/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# ----- Commerce Layer ------

# The client ID of your Commerce Layer application.
# Must be a *sales channel* application: this value is exposed to the browser
# (NEXT_PUBLIC_ prefix) and is used for the client_credentials flow.
# Create one in the CL dashboard under Settings > Applications.
NEXT_PUBLIC_CL_CLIENT_ID=your-sales-channel-client-id

# Your Commerce Layer organization slug — the subdomain of your organization
# (e.g. "acme" for acme.commercelayer.io). Also used to build the hosted
# checkout URL: https://<slug>.commercelayer.app/checkout/<order-id>
NEXT_PUBLIC_CL_ORG_SLUG=your-organization-slug

# Optional — the code of the market to scope the access token to.
# Defaults to "us" when unset. The app requests the "market:code:<code>" scope,
# so set this to the code of a market that exists in your organization.
# NEXT_PUBLIC_CL_MARKET_CODE=us
9 changes: 9 additions & 0 deletions solutions/giftcard-tutorial/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- BEGIN:nextjs-agent-rules -->

# This is NOT the Next.js you know

This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices.

This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean.

<!-- END:nextjs-agent-rules -->
1 change: 1 addition & 0 deletions solutions/giftcard-tutorial/CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@AGENTS.md
19 changes: 8 additions & 11 deletions solutions/giftcard-tutorial/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
import { dirname } from "path";
import { fileURLToPath } from "url";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

const compat = new FlatCompat({
baseDirectory: __dirname,
});
import nextCoreWebVitals from "eslint-config-next/core-web-vitals";
import nextTypeScript from "eslint-config-next/typescript";

/** @type {import('eslint').Linter.Config[]} */
const eslintConfig = [
...compat.extends("next/core-web-vitals", "next/typescript"),
{
ignores: [".next/**", "node_modules/**", "out/**", "public/**"],
},
...nextCoreWebVitals,
...nextTypeScript,
];

export default eslintConfig;
2 changes: 2 additions & 0 deletions solutions/giftcard-tutorial/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />
import "./.next/types/routes.d.ts";
import "./.next/types/root-params.d.ts";

// NOTE: This file should not be edited
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.
2 changes: 1 addition & 1 deletion solutions/giftcard-tutorial/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { NextConfig } from "next";
const nextConfig: NextConfig = {
/* config options here */
images: {
domains: ["res.cloudinary.com"],
remotePatterns: [{ protocol: "https", hostname: "res.cloudinary.com" }],
},
};

Expand Down
14 changes: 8 additions & 6 deletions solutions/giftcard-tutorial/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,26 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "eslint .",
"clean": "pnpx rimraf --glob **/node_modules **/pnpm-lock.yaml",
"dep:major": "pnpm dlx npm-check-updates --packageFile '**/package.json' -u",
"dep:semver": "pnpm dlx npm-check-updates -t semver --packageFile '**/package.json' -u"
},
"dependencies": {
"@commercelayer/js-auth": "^6.7.2",
"@commercelayer/react-components": "^4.29.7",
"@commercelayer/sdk": "^6.58.0",
"next": "15.3.4",
"react": "^19.2.8",
"react-dom": "^19.2.8"
"next": "^16.3.4",
"react": "^19.3.0",
"react-dom": "^19.3.0"
},
"devDependencies": {
"@eslint/eslintrc": "^3",
"@tailwindcss/postcss": "^4",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"eslint": "^9",
"eslint-config-next": "15.3.4",
"eslint-config-next": "^16.3.4",
"tailwindcss": "^4",
"typescript": "^5"
}
Expand Down
Loading