@cimplify/cli 0.6.4 → 0.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{add-NWGER62A.mjs → add-U4S5DBPN.mjs} +1 -1
- package/dist/{chunk-MGP2FUAK.mjs → chunk-AS2SIMRN.mjs} +1 -1
- package/dist/{chunk-TFEUFCEH.mjs → chunk-EALN6SAN.mjs} +21 -21
- package/dist/{chunk-76TJ56KE.mjs → chunk-KPEMFKKN.mjs} +1 -1
- package/dist/dispatcher.mjs +9 -9
- package/dist/{doctor-ZGW3VZOG.mjs → doctor-Y6XJWZVX.mjs} +2 -2
- package/dist/{explain-4ITTI4FM.mjs → explain-WDIQSCUY.mjs} +1 -1
- package/dist/{introspect-DL2HE7DG.mjs → introspect-3EMAYETR.mjs} +2 -2
- package/dist/{list-WNNKVK7V.mjs → list-KO2QX42Q.mjs} +1 -1
- package/dist/{update-EPRLX6FL.mjs → update-J6ZDMCOB.mjs} +1 -1
- package/package.json +1 -1
- package/templates/storefront-auto/.env.example +4 -2
- package/templates/storefront-auto/next.config.ts +9 -3
- package/templates/storefront-auto/package.json +1 -1
- package/templates/storefront-bakery/.env.example +4 -2
- package/templates/storefront-bakery/next.config.ts +9 -3
- package/templates/storefront-bakery/package.json +1 -1
- package/templates/storefront-fashion/.env.example +4 -2
- package/templates/storefront-fashion/next.config.ts +9 -3
- package/templates/storefront-fashion/package.json +1 -1
- package/templates/storefront-grocery/.env.example +4 -2
- package/templates/storefront-grocery/next.config.ts +9 -3
- package/templates/storefront-grocery/package.json +1 -1
- package/templates/storefront-pharmacy/.env.example +4 -2
- package/templates/storefront-pharmacy/next.config.ts +9 -3
- package/templates/storefront-pharmacy/package.json +1 -1
- package/templates/storefront-restaurant/.env.example +4 -2
- package/templates/storefront-restaurant/next.config.ts +9 -3
- package/templates/storefront-restaurant/package.json +1 -1
- package/templates/storefront-retail/.env.example +4 -2
- package/templates/storefront-retail/next.config.ts +9 -3
- package/templates/storefront-retail/package.json +1 -1
- package/templates/storefront-services/.env.example +4 -2
- package/templates/storefront-services/next.config.ts +9 -3
- package/templates/storefront-services/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { gitDetectRoot, gitCurrentBranch, gitCurrentSha, gitStatusPorcelain } from './chunk-K5464A3L.mjs';
|
|
3
3
|
import { parseEnvFile } from './chunk-DBZ3UOQ2.mjs';
|
|
4
|
-
import { package_default } from './chunk-
|
|
4
|
+
import { package_default } from './chunk-AS2SIMRN.mjs';
|
|
5
5
|
import { parseArgs } from './chunk-C4M3DXKC.mjs';
|
|
6
6
|
import { readAuthOrNull, readProjectLinkOrNull, readProjectState } from './chunk-UBAI443T.mjs';
|
|
7
7
|
import { bold, dim, yellow, green, info, result, red } from './chunk-E2T2SBP5.mjs';
|
package/dist/dispatcher.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { TEMPLATES } from './chunk-
|
|
3
|
-
import { package_default } from './chunk-
|
|
2
|
+
import { TEMPLATES } from './chunk-EALN6SAN.mjs';
|
|
3
|
+
import { package_default } from './chunk-AS2SIMRN.mjs';
|
|
4
4
|
|
|
5
5
|
// src/dispatcher.ts
|
|
6
6
|
var VERSION = package_default.version ?? "unknown";
|
|
@@ -137,15 +137,15 @@ var COMMANDS = {
|
|
|
137
137
|
logs: () => import('./logs-YNN2PQ24.mjs'),
|
|
138
138
|
status: () => import('./status-JSYXM5RT.mjs'),
|
|
139
139
|
dev: () => import('./dev-ONW2S77K.mjs'),
|
|
140
|
-
introspect: () => import('./introspect-
|
|
141
|
-
doctor: () => import('./doctor-
|
|
142
|
-
explain: () => import('./explain-
|
|
140
|
+
introspect: () => import('./introspect-3EMAYETR.mjs'),
|
|
141
|
+
doctor: () => import('./doctor-Y6XJWZVX.mjs'),
|
|
142
|
+
explain: () => import('./explain-WDIQSCUY.mjs'),
|
|
143
143
|
assets: () => import('./assets-EBEMMENZ.mjs'),
|
|
144
144
|
repo: () => import('./repo-WOBWKEAO.mjs'),
|
|
145
|
-
list: () => import('./list-
|
|
146
|
-
add: () => import('./add-
|
|
147
|
-
update: () => import('./update-
|
|
148
|
-
upgrade: () => import('./update-
|
|
145
|
+
list: () => import('./list-KO2QX42Q.mjs'),
|
|
146
|
+
add: () => import('./add-U4S5DBPN.mjs'),
|
|
147
|
+
update: () => import('./update-J6ZDMCOB.mjs'),
|
|
148
|
+
upgrade: () => import('./update-J6ZDMCOB.mjs'),
|
|
149
149
|
"auth-step-up": () => import('./auth-step-up-BIUYQJP6.mjs')
|
|
150
150
|
};
|
|
151
151
|
var COMMAND_PREFIXES = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { gatherIntrospection } from './chunk-
|
|
2
|
+
import { gatherIntrospection } from './chunk-KPEMFKKN.mjs';
|
|
3
3
|
import './chunk-K5464A3L.mjs';
|
|
4
4
|
import './chunk-DBZ3UOQ2.mjs';
|
|
5
|
-
import './chunk-
|
|
5
|
+
import './chunk-AS2SIMRN.mjs';
|
|
6
6
|
import { parseArgs, flagBool } from './chunk-C4M3DXKC.mjs';
|
|
7
7
|
import { ApiClient } from './chunk-MAOO6ZZ5.mjs';
|
|
8
8
|
import { readAuthOrNull } from './chunk-UBAI443T.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { package_default } from './chunk-
|
|
2
|
+
import { package_default } from './chunk-AS2SIMRN.mjs';
|
|
3
3
|
import { parseArgs } from './chunk-C4M3DXKC.mjs';
|
|
4
4
|
import { bold, dim, info, result, CliError, CLI_ERROR_CODE } from './chunk-E2T2SBP5.mjs';
|
|
5
5
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
export { run as default, extractMockSeed, gatherIntrospection, renderIntrospection } from './chunk-
|
|
2
|
+
export { run as default, extractMockSeed, gatherIntrospection, renderIntrospection } from './chunk-KPEMFKKN.mjs';
|
|
3
3
|
import './chunk-K5464A3L.mjs';
|
|
4
4
|
import './chunk-DBZ3UOQ2.mjs';
|
|
5
|
-
import './chunk-
|
|
5
|
+
import './chunk-AS2SIMRN.mjs';
|
|
6
6
|
import './chunk-C4M3DXKC.mjs';
|
|
7
7
|
import './chunk-UBAI443T.mjs';
|
|
8
8
|
import './chunk-E2T2SBP5.mjs';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { REGISTRY_INDEX } from './chunk-
|
|
2
|
+
import { REGISTRY_INDEX } from './chunk-EALN6SAN.mjs';
|
|
3
3
|
import { parseArgs, flagBool } from './chunk-C4M3DXKC.mjs';
|
|
4
4
|
import { CliError, CLI_ERROR_CODE, info, bold, dim, green, result } from './chunk-E2T2SBP5.mjs';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { package_default } from './chunk-
|
|
2
|
+
import { package_default } from './chunk-AS2SIMRN.mjs';
|
|
3
3
|
import { promptYesNo } from './chunk-ITAFAORS.mjs';
|
|
4
4
|
import { parseArgs, flagBool, flagString } from './chunk-C4M3DXKC.mjs';
|
|
5
5
|
import { success, bold, info, dim, result, failure, CliError, CLI_ERROR_CODE, step, isJsonMode } from './chunk-E2T2SBP5.mjs';
|
package/package.json
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
# Your tenant public key. Get it from the desk's Developers tab
|
|
2
|
-
#
|
|
1
|
+
# Your tenant public key. Get it from the desk's Developers tab.
|
|
2
|
+
# `cpk_live_*` / `cpk_test_*` keys auto-route same-origin requests
|
|
3
|
+
# to hosted Cimplify in both dev and prod. Anything else (`mock-dev`,
|
|
4
|
+
# empty) falls back to the local `cimplify dev` mock.
|
|
3
5
|
NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
|
|
4
6
|
|
|
5
7
|
# Optional. Forces a fixed canonical URL for sitemap.xml, robots.txt,
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { NextConfig } from "next";
|
|
2
2
|
|
|
3
|
-
// Same-origin proxy target for the storefront API.
|
|
4
|
-
//
|
|
3
|
+
// Same-origin proxy target for the storefront API. The public key
|
|
4
|
+
// decides: a real `cpk_live_…` / `cpk_test_…` only resolves against
|
|
5
|
+
// hosted Cimplify, so browser cart writes go to the same place the
|
|
6
|
+
// server catalogue reads come from. Anything else (`mock-dev`, empty)
|
|
7
|
+
// falls back to the local `cimplify dev` mock in dev.
|
|
8
|
+
const publicKey = process.env.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY?.trim() ?? "";
|
|
9
|
+
const keyTargetsHostedCimplify =
|
|
10
|
+
publicKey.startsWith("cpk_live_") || publicKey.startsWith("cpk_test_");
|
|
5
11
|
const STOREFRONT_URL =
|
|
6
|
-
process.env.NODE_ENV === "production"
|
|
12
|
+
process.env.NODE_ENV === "production" || keyTargetsHostedCimplify
|
|
7
13
|
? "https://storefronts.cimplify.io"
|
|
8
14
|
: "http://127.0.0.1:8787";
|
|
9
15
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
# Your tenant public key. Get it from the desk's Developers tab
|
|
2
|
-
#
|
|
1
|
+
# Your tenant public key. Get it from the desk's Developers tab.
|
|
2
|
+
# `cpk_live_*` / `cpk_test_*` keys auto-route same-origin requests
|
|
3
|
+
# to hosted Cimplify in both dev and prod. Anything else (`mock-dev`,
|
|
4
|
+
# empty) falls back to the local `cimplify dev` mock.
|
|
3
5
|
NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
|
|
4
6
|
|
|
5
7
|
# Optional. Forces a fixed canonical URL for sitemap.xml, robots.txt,
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { NextConfig } from "next";
|
|
2
2
|
|
|
3
|
-
// Same-origin proxy target for the storefront API.
|
|
4
|
-
//
|
|
3
|
+
// Same-origin proxy target for the storefront API. The public key
|
|
4
|
+
// decides: a real `cpk_live_…` / `cpk_test_…` only resolves against
|
|
5
|
+
// hosted Cimplify, so browser cart writes go to the same place the
|
|
6
|
+
// server catalogue reads come from. Anything else (`mock-dev`, empty)
|
|
7
|
+
// falls back to the local `cimplify dev` mock in dev.
|
|
8
|
+
const publicKey = process.env.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY?.trim() ?? "";
|
|
9
|
+
const keyTargetsHostedCimplify =
|
|
10
|
+
publicKey.startsWith("cpk_live_") || publicKey.startsWith("cpk_test_");
|
|
5
11
|
const STOREFRONT_URL =
|
|
6
|
-
process.env.NODE_ENV === "production"
|
|
12
|
+
process.env.NODE_ENV === "production" || keyTargetsHostedCimplify
|
|
7
13
|
? "https://storefronts.cimplify.io"
|
|
8
14
|
: "http://127.0.0.1:8787";
|
|
9
15
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
# Your tenant public key. Get it from the desk's Developers tab
|
|
2
|
-
#
|
|
1
|
+
# Your tenant public key. Get it from the desk's Developers tab.
|
|
2
|
+
# `cpk_live_*` / `cpk_test_*` keys auto-route same-origin requests
|
|
3
|
+
# to hosted Cimplify in both dev and prod. Anything else (`mock-dev`,
|
|
4
|
+
# empty) falls back to the local `cimplify dev` mock.
|
|
3
5
|
NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
|
|
4
6
|
|
|
5
7
|
# Optional. Forces a fixed canonical URL for sitemap.xml, robots.txt,
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { NextConfig } from "next";
|
|
2
2
|
|
|
3
|
-
// Same-origin proxy target for the storefront API.
|
|
4
|
-
//
|
|
3
|
+
// Same-origin proxy target for the storefront API. The public key
|
|
4
|
+
// decides: a real `cpk_live_…` / `cpk_test_…` only resolves against
|
|
5
|
+
// hosted Cimplify, so browser cart writes go to the same place the
|
|
6
|
+
// server catalogue reads come from. Anything else (`mock-dev`, empty)
|
|
7
|
+
// falls back to the local `cimplify dev` mock in dev.
|
|
8
|
+
const publicKey = process.env.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY?.trim() ?? "";
|
|
9
|
+
const keyTargetsHostedCimplify =
|
|
10
|
+
publicKey.startsWith("cpk_live_") || publicKey.startsWith("cpk_test_");
|
|
5
11
|
const STOREFRONT_URL =
|
|
6
|
-
process.env.NODE_ENV === "production"
|
|
12
|
+
process.env.NODE_ENV === "production" || keyTargetsHostedCimplify
|
|
7
13
|
? "https://storefronts.cimplify.io"
|
|
8
14
|
: "http://127.0.0.1:8787";
|
|
9
15
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
# Your tenant public key. Get it from the desk's Developers tab
|
|
2
|
-
#
|
|
1
|
+
# Your tenant public key. Get it from the desk's Developers tab.
|
|
2
|
+
# `cpk_live_*` / `cpk_test_*` keys auto-route same-origin requests
|
|
3
|
+
# to hosted Cimplify in both dev and prod. Anything else (`mock-dev`,
|
|
4
|
+
# empty) falls back to the local `cimplify dev` mock.
|
|
3
5
|
NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
|
|
4
6
|
|
|
5
7
|
# Optional. Forces a fixed canonical URL for sitemap.xml, robots.txt,
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { NextConfig } from "next";
|
|
2
2
|
|
|
3
|
-
// Same-origin proxy target for the storefront API.
|
|
4
|
-
//
|
|
3
|
+
// Same-origin proxy target for the storefront API. The public key
|
|
4
|
+
// decides: a real `cpk_live_…` / `cpk_test_…` only resolves against
|
|
5
|
+
// hosted Cimplify, so browser cart writes go to the same place the
|
|
6
|
+
// server catalogue reads come from. Anything else (`mock-dev`, empty)
|
|
7
|
+
// falls back to the local `cimplify dev` mock in dev.
|
|
8
|
+
const publicKey = process.env.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY?.trim() ?? "";
|
|
9
|
+
const keyTargetsHostedCimplify =
|
|
10
|
+
publicKey.startsWith("cpk_live_") || publicKey.startsWith("cpk_test_");
|
|
5
11
|
const STOREFRONT_URL =
|
|
6
|
-
process.env.NODE_ENV === "production"
|
|
12
|
+
process.env.NODE_ENV === "production" || keyTargetsHostedCimplify
|
|
7
13
|
? "https://storefronts.cimplify.io"
|
|
8
14
|
: "http://127.0.0.1:8787";
|
|
9
15
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
# Your tenant public key. Get it from the desk's Developers tab
|
|
2
|
-
#
|
|
1
|
+
# Your tenant public key. Get it from the desk's Developers tab.
|
|
2
|
+
# `cpk_live_*` / `cpk_test_*` keys auto-route same-origin requests
|
|
3
|
+
# to hosted Cimplify in both dev and prod. Anything else (`mock-dev`,
|
|
4
|
+
# empty) falls back to the local `cimplify dev` mock.
|
|
3
5
|
NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
|
|
4
6
|
|
|
5
7
|
# Optional. Forces a fixed canonical URL for sitemap.xml, robots.txt,
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { NextConfig } from "next";
|
|
2
2
|
|
|
3
|
-
// Same-origin proxy target for the storefront API.
|
|
4
|
-
//
|
|
3
|
+
// Same-origin proxy target for the storefront API. The public key
|
|
4
|
+
// decides: a real `cpk_live_…` / `cpk_test_…` only resolves against
|
|
5
|
+
// hosted Cimplify, so browser cart writes go to the same place the
|
|
6
|
+
// server catalogue reads come from. Anything else (`mock-dev`, empty)
|
|
7
|
+
// falls back to the local `cimplify dev` mock in dev.
|
|
8
|
+
const publicKey = process.env.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY?.trim() ?? "";
|
|
9
|
+
const keyTargetsHostedCimplify =
|
|
10
|
+
publicKey.startsWith("cpk_live_") || publicKey.startsWith("cpk_test_");
|
|
5
11
|
const STOREFRONT_URL =
|
|
6
|
-
process.env.NODE_ENV === "production"
|
|
12
|
+
process.env.NODE_ENV === "production" || keyTargetsHostedCimplify
|
|
7
13
|
? "https://storefronts.cimplify.io"
|
|
8
14
|
: "http://127.0.0.1:8787";
|
|
9
15
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
# Your tenant public key. Get it from the desk's Developers tab
|
|
2
|
-
#
|
|
1
|
+
# Your tenant public key. Get it from the desk's Developers tab.
|
|
2
|
+
# `cpk_live_*` / `cpk_test_*` keys auto-route same-origin requests
|
|
3
|
+
# to hosted Cimplify in both dev and prod. Anything else (`mock-dev`,
|
|
4
|
+
# empty) falls back to the local `cimplify dev` mock.
|
|
3
5
|
NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
|
|
4
6
|
|
|
5
7
|
# Optional. Forces a fixed canonical URL for sitemap.xml, robots.txt,
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { NextConfig } from "next";
|
|
2
2
|
|
|
3
|
-
// Same-origin proxy target for the storefront API.
|
|
4
|
-
//
|
|
3
|
+
// Same-origin proxy target for the storefront API. The public key
|
|
4
|
+
// decides: a real `cpk_live_…` / `cpk_test_…` only resolves against
|
|
5
|
+
// hosted Cimplify, so browser cart writes go to the same place the
|
|
6
|
+
// server catalogue reads come from. Anything else (`mock-dev`, empty)
|
|
7
|
+
// falls back to the local `cimplify dev` mock in dev.
|
|
8
|
+
const publicKey = process.env.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY?.trim() ?? "";
|
|
9
|
+
const keyTargetsHostedCimplify =
|
|
10
|
+
publicKey.startsWith("cpk_live_") || publicKey.startsWith("cpk_test_");
|
|
5
11
|
const STOREFRONT_URL =
|
|
6
|
-
process.env.NODE_ENV === "production"
|
|
12
|
+
process.env.NODE_ENV === "production" || keyTargetsHostedCimplify
|
|
7
13
|
? "https://storefronts.cimplify.io"
|
|
8
14
|
: "http://127.0.0.1:8787";
|
|
9
15
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
# Your tenant public key. Get it from the desk's Developers tab
|
|
2
|
-
#
|
|
1
|
+
# Your tenant public key. Get it from the desk's Developers tab.
|
|
2
|
+
# `cpk_live_*` / `cpk_test_*` keys auto-route same-origin requests
|
|
3
|
+
# to hosted Cimplify in both dev and prod. Anything else (`mock-dev`,
|
|
4
|
+
# empty) falls back to the local `cimplify dev` mock.
|
|
3
5
|
NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
|
|
4
6
|
|
|
5
7
|
# Optional. Forces a fixed canonical URL for sitemap.xml, robots.txt,
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { NextConfig } from "next";
|
|
2
2
|
|
|
3
|
-
// Same-origin proxy target for the storefront API.
|
|
4
|
-
//
|
|
3
|
+
// Same-origin proxy target for the storefront API. The public key
|
|
4
|
+
// decides: a real `cpk_live_…` / `cpk_test_…` only resolves against
|
|
5
|
+
// hosted Cimplify, so browser cart writes go to the same place the
|
|
6
|
+
// server catalogue reads come from. Anything else (`mock-dev`, empty)
|
|
7
|
+
// falls back to the local `cimplify dev` mock in dev.
|
|
8
|
+
const publicKey = process.env.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY?.trim() ?? "";
|
|
9
|
+
const keyTargetsHostedCimplify =
|
|
10
|
+
publicKey.startsWith("cpk_live_") || publicKey.startsWith("cpk_test_");
|
|
5
11
|
const STOREFRONT_URL =
|
|
6
|
-
process.env.NODE_ENV === "production"
|
|
12
|
+
process.env.NODE_ENV === "production" || keyTargetsHostedCimplify
|
|
7
13
|
? "https://storefronts.cimplify.io"
|
|
8
14
|
: "http://127.0.0.1:8787";
|
|
9
15
|
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
# Your tenant public key. Get it from the desk's Developers tab
|
|
2
|
-
#
|
|
1
|
+
# Your tenant public key. Get it from the desk's Developers tab.
|
|
2
|
+
# `cpk_live_*` / `cpk_test_*` keys auto-route same-origin requests
|
|
3
|
+
# to hosted Cimplify in both dev and prod. Anything else (`mock-dev`,
|
|
4
|
+
# empty) falls back to the local `cimplify dev` mock.
|
|
3
5
|
NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY=mock-dev
|
|
4
6
|
|
|
5
7
|
# Optional. Forces a fixed canonical URL for sitemap.xml, robots.txt,
|
|
@@ -1,9 +1,15 @@
|
|
|
1
1
|
import type { NextConfig } from "next";
|
|
2
2
|
|
|
3
|
-
// Same-origin proxy target for the storefront API.
|
|
4
|
-
//
|
|
3
|
+
// Same-origin proxy target for the storefront API. The public key
|
|
4
|
+
// decides: a real `cpk_live_…` / `cpk_test_…` only resolves against
|
|
5
|
+
// hosted Cimplify, so browser cart writes go to the same place the
|
|
6
|
+
// server catalogue reads come from. Anything else (`mock-dev`, empty)
|
|
7
|
+
// falls back to the local `cimplify dev` mock in dev.
|
|
8
|
+
const publicKey = process.env.NEXT_PUBLIC_CIMPLIFY_PUBLIC_KEY?.trim() ?? "";
|
|
9
|
+
const keyTargetsHostedCimplify =
|
|
10
|
+
publicKey.startsWith("cpk_live_") || publicKey.startsWith("cpk_test_");
|
|
5
11
|
const STOREFRONT_URL =
|
|
6
|
-
process.env.NODE_ENV === "production"
|
|
12
|
+
process.env.NODE_ENV === "production" || keyTargetsHostedCimplify
|
|
7
13
|
? "https://storefronts.cimplify.io"
|
|
8
14
|
: "http://127.0.0.1:8787";
|
|
9
15
|
|