Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GCOM-1315] fix cli tool + fix migration 6to7 #2165

Closed
wants to merge 74 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
42bc572
Add an extra store to example config, for easier testing of locale-re…
hnsr Dec 1, 2023
4be1d56
Fix incorrect canonicalization when i18n domain routing is used
hnsr Dec 1, 2023
7b017f5
Add changeset
hnsr Dec 1, 2023
2905aae
Remove redundant localeDomain check
hnsr Dec 1, 2023
56b13e2
chore(GCOM-1164): Wrap the logo in a div on the homepage to prevent r…
carlocarels90 Dec 5, 2023
a057d62
chore: add changeset
carlocarels90 Dec 5, 2023
516bfae
refactor: simplify code
carlocarels90 Dec 5, 2023
cc172fb
refactor: use Box instead of Typography component
carlocarels90 Dec 5, 2023
63e420c
GCOM-1288 Fix incorrect redirect when locale has its own domain
hnsr Dec 6, 2023
b34d85c
Add changeset
hnsr Dec 6, 2023
6edcf27
refactor: always apply the commonLogoStyles
carlocarels90 Dec 8, 2023
367fd03
[GCOM-1066]: Added telephone to address overview
mikekeehnen Dec 14, 2023
345a78d
Wrapped RecentlyViewedProducts in AddProductsToCartForm
Jessevdpoel Jan 3, 2024
56b1beb
Removed z-Index inherit from scroller button because it caused the sc…
Jessevdpoel Jan 3, 2024
b1afcd0
Added changeset
Jessevdpoel Jan 3, 2024
60d87ce
Removed top on size md
Jessevdpoel Jan 5, 2024
f559b13
Added AddProductsToCartForm to DemoRecentlyViewedProducts
Jessevdpoel Jan 5, 2024
6a34c4a
added changeset
Jessevdpoel Jan 5, 2024
cc5c636
added changeset
Jessevdpoel Jan 5, 2024
bc02d42
revert whitespace removal
Jessevdpoel Jan 5, 2024
84b5503
Show filters even when no items are found with the selected filters.
Jessevdpoel Jan 9, 2024
5224755
added changeset
Jessevdpoel Jan 10, 2024
cf6607e
[GCOM-1315] fix cli tool + fix migration 6to7
Jessevdpoel Jan 10, 2024
4c57003
added changeset
Jessevdpoel Jan 10, 2024
2274b6a
Merge pull request #2135 from graphcommerce-org/feature/GCOM-1217-fix…
paales Jan 15, 2024
7e8556e
chore(release): update prerelease versions
github-actions[bot] Jan 15, 2024
000a9db
GCOM-1304 Ensure use of normalized locale in html lang attribute
hnsr Dec 4, 2023
ed96c97
GCOM-1304 Use normalizeLocale with Intl
hnsr Dec 5, 2023
df507b1
GCOM-1304 Add changeset
hnsr Dec 5, 2023
f952fc2
GCOM-1304 Whoops, move from head to html tag
hnsr Dec 5, 2023
6227343
Merge branch 'canary' into feature/GCOM-1304-normalize-locale-html-lang
paales Jan 15, 2024
2315ab7
Merge pull request #2137 from graphcommerce-org/feature/GCOM-1304-nor…
paales Jan 15, 2024
4b299dd
chore(release): update prerelease versions
github-actions[bot] Jan 15, 2024
e9324c1
Merge pull request #2138 from graphcommerce-org/fix/GCOM-1164
paales Jan 15, 2024
71a5baa
[GCOM-1307] add migration for edited DR schema
JoshuaS98 Dec 5, 2023
40272b9
[GCOM-1307] enable multiple rows per DR
JoshuaS98 Dec 5, 2023
2ad7180
[GCOM-1307] cleanup
JoshuaS98 Dec 5, 2023
70bda70
[GCOM-1307] deprecate row field
JoshuaS98 Dec 6, 2023
f8296ae
[GCOM-1307] prevent breaking changes
JoshuaS98 Dec 6, 2023
8c543e6
[GCOM-1307] optimize Dyn Row
JoshuaS98 Dec 6, 2023
a5e47df
[GCOM-1307] optimize Dyn Row
JoshuaS98 Dec 6, 2023
6487ed4
chore(release): update prerelease versions
github-actions[bot] Jan 15, 2024
50d90a2
Renamed upgrades to reflect the new major version 8
paales Jan 15, 2024
7f5e53b
Merge pull request #2139 from graphcommerce-org/feature/GCOM-1307
paales Jan 15, 2024
2521ecd
Added experimental usev2 to addProductsToCartForm
Jessevdpoel Dec 13, 2023
59844cd
Added changeset
Jessevdpoel Dec 13, 2023
d857f4d
Merge pull request #2140 from graphcommerce-org/feature/GCOM-1288-fix…
paales Jan 15, 2024
a4a1e2e
chore(release): update prerelease versions
github-actions[bot] Jan 15, 2024
68e869a
Merge pull request #2150 from graphcommerce-org/bug/GCOM-1292-cant-ad…
paales Jan 15, 2024
db5918e
chore(release): update prerelease versions
github-actions[bot] Jan 15, 2024
9b2ce4d
Merge branch 'canary' into bug/related-products-crashes-application-G…
paales Jan 15, 2024
63fe912
Change formatting of .vscode settings
paales Jan 15, 2024
1b95bc6
Recently viewed didn’t became visible at all
paales Jan 15, 2024
39cd68b
Merge pull request #2164 from graphcommerce-org/bug/GCOM-1306-filters…
paales Jan 15, 2024
535ab05
chore(release): update prerelease versions
github-actions[bot] Jan 15, 2024
d3e9601
Merge pull request #2161 from graphcommerce-org/bug/sidebar-gallery-t…
paales Jan 15, 2024
9b5cbaf
chore(release): update prerelease versions
github-actions[bot] Jan 15, 2024
ba3573d
Merge pull request #2155 from graphcommerce-org/bug/related-products-…
paales Jan 15, 2024
c550a5d
chore(release): update prerelease versions
github-actions[bot] Jan 15, 2024
37cd9a3
Merge pull request #2157 from graphcommerce-org/bug/GCOM-1314-scrolle…
paales Jan 15, 2024
f9e59d6
chore(release): update prerelease versions
github-actions[bot] Jan 15, 2024
f716913
Merge pull request #2151 from graphcommerce-org/feature/GCOM-1066
paales Jan 15, 2024
986dc96
Added schema-dts as a dependency, so it isn't required in the example
paales Jan 15, 2024
62e9de1
Merge pull request #2168 from graphcommerce-org/fix/schema-dts
paales Jan 15, 2024
88a5189
chore(release): update prerelease versions
github-actions[bot] Jan 15, 2024
304b816
Dismiss login page and go back to previous page asap when logging in
paales Jan 15, 2024
710114a
Cleanup
paales Jan 15, 2024
bd7eaaf
Missing dep
paales Jan 15, 2024
967dcdd
Cleanup changeset
paales Jan 15, 2024
1dcf8e7
Merge pull request #2166 from graphcommerce-org/feature/GCOM-1318
paales Jan 15, 2024
2b8791d
chore(release): update prerelease versions
github-actions[bot] Jan 15, 2024
2b52480
[GCOM-1315] fix cli tool + fix migration 6to7
Jessevdpoel Jan 10, 2024
eab3f0b
added changeset
Jessevdpoel Jan 10, 2024
efbbc67
Merge branch 'fix/GCOM-1315-cli-migratoin-6to7' of https://github.com…
Jessevdpoel Jan 16, 2024
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
6 changes: 6 additions & 0 deletions .changeset/twelve-socks-tap.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@graphcommerce/next-config": patch
"@graphcommerce/hygraph-cli": patch
---

Fix hygraph 6to7 cli
4 changes: 4 additions & 0 deletions docs/framework/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ The Google Tagmanager ID to be used on the site.

This value is required even if you are configuring different values for each locale.

#### hygraphManagementApi: string

Hygraph Management API. **Only used for migrations.**

#### hygraphProjectId: string

Hygraph Project ID. **Only used for migrations.**
Expand Down
16 changes: 10 additions & 6 deletions docs/hygraph/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,20 @@ The following steps are needed to utilize this tool:
- Update public content views
- Delete public content views
- Can see schema view
5. Add this new token to your env file: `GC_HYGRAPH_WRITE_ACCESS_TOKEN=""`
5. Add this new token to your env file:
`GC_HYGRAPH_WRITE_ACCESS_TOKEN="{YOUR_WRITE_ACCESS_TOKEN}"`
2. Add the Content API key to your env file like this:
1. Open your Hygraph project. Go to: Project settings -> API Access
2. Copy the Content API URL and add to your env file:
`GC_HYGRAPH_WRITE_ACCESS_ENDPOINT=""`
`GC_HYGRAPH_WRITE_ACCESS_ENDPOINT="{YOUR_WRITE_ACCESS_ENDPOINT}"`
3. Add your hygraphProjectId to your env file like this:
1. Copy the project ID from the URL when logged in
`https://app.hygraph.com/PROJECT_ID_IS_HERE/master`
2. Add the project ID to your env file: `GC_HYGRAPH_PROJECT_ID=””`
4. Run `yarn graphcommerce hygraph-migrate`
5. Select the migration you want to run and press enter.
6. The migrations should now be applied, check your Hygraph Schema if changes
2. Add the project ID to your env file:
`GC_HYGRAPH_PROJECT_ID=”{YOUR_PROJECT_ID}”`
4. Add your hygraphManagementApi to your env file like this:
`GC_HYGRAPH_MANAGEMENT_API="{YOUR_MANAGEMENT_API}"`
5. Run `yarn graphcommerce hygraph-migrate`
6. Select the migration you want to run and press enter.
7. The migrations should now be applied, check your Hygraph Schema if changes
are made.
5 changes: 5 additions & 0 deletions packages/hygraph-cli/Config.graphqls
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,9 @@ extend input GraphCommerceConfig {
Hygraph Project ID. **Only used for migrations.**
"""
hygraphProjectId: String

"""
Hygraph Management API. **Only used for migrations.**
"""
hygraphManagementApi: String
}
7 changes: 7 additions & 0 deletions packages/hygraph-cli/dist/migrations/graphcommerce6to7.js
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,13 @@ const graphcommerce6to7 = async (schema) => {
enumerationApiId: 'RowColumnOneVariants',
parentApiId: 'RowColumnOne',
}, 'RowColumnOne', 'model');
(0, migrationAction_1.migrationAction)(schema, 'componentUnionField', 'create', {
displayName: 'Conditions',
apiId: 'conditions',
parentApiId: 'ConditionOr',
componentApiIds: ['ConditionText', 'ConditionNumber'],
isList: true,
}, 'ConditionOr', 'component');
return migrationAction_1.client.run(true);
};
exports.graphcommerce6to7 = graphcommerce6to7;
2 changes: 1 addition & 1 deletion packages/hygraph-cli/dist/readSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const readSchema = async (config) => {
const projectId = config.hygraphProjectId;
const hygraphClient = new client_1.ApolloClient({
link: new client_1.HttpLink({
uri: 'https://management.hygraph.com/graphql',
uri: config.hygraphManagementApi ?? 'https://management.hygraph.com/graphql',
fetch: fetch_1.fetch,
headers: { Authorization: `Bearer ${config.hygraphWriteAccessToken}` },
}),
Expand Down
15 changes: 15 additions & 0 deletions packages/hygraph-cli/src/migrations/graphcommerce6to7.ts
Original file line number Diff line number Diff line change
Expand Up @@ -303,5 +303,20 @@ export const graphcommerce6to7 = async (schema: Schema) => {
'model',
)

migrationAction(
schema,
'componentUnionField',
'create',
{
displayName: 'Conditions',
apiId: 'conditions',
parentApiId: 'ConditionOr',
componentApiIds: ['ConditionText', 'ConditionNumber'],
isList: true,
},
'ConditionOr',
'component',
)

return client.run(true)
}
2 changes: 1 addition & 1 deletion packages/hygraph-cli/src/readSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export const readSchema = async (config: GraphCommerceConfig) => {

const hygraphClient = new ApolloClient({
link: new HttpLink({
uri: 'https://management.hygraph.com/graphql',
uri: config.hygraphManagementApi ?? 'https://management.hygraph.com/graphql',
fetch,
headers: { Authorization: `Bearer ${config.hygraphWriteAccessToken}` },
}),
Expand Down
186 changes: 72 additions & 114 deletions packagesDev/next-config/dist/generated/config.js
Original file line number Diff line number Diff line change
@@ -1,136 +1,94 @@
/* eslint-disable */ "use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
function _export(target, all) {
for(var name in all)Object.defineProperty(target, name, {
enumerable: true,
get: all[name]
});
}
_export(exports, {
CompareVariantSchema: function() {
return CompareVariantSchema;
},
GraphCommerceConfigSchema: function() {
return GraphCommerceConfigSchema;
},
GraphCommerceDebugConfigSchema: function() {
return GraphCommerceDebugConfigSchema;
},
GraphCommerceStorefrontConfigSchema: function() {
return GraphCommerceStorefrontConfigSchema;
},
MagentoConfigurableVariantValuesSchema: function() {
return MagentoConfigurableVariantValuesSchema;
},
ProductFiltersLayoutSchema: function() {
return ProductFiltersLayoutSchema;
},
RecentlyViewedProductsConfigSchema: function() {
return RecentlyViewedProductsConfigSchema;
},
SidebarGalleryConfigSchema: function() {
return SidebarGalleryConfigSchema;
},
SidebarGalleryPaginationVariantSchema: function() {
return SidebarGalleryPaginationVariantSchema;
},
definedNonNullAnySchema: function() {
return definedNonNullAnySchema;
},
isDefinedNonNullAny: function() {
return isDefinedNonNullAny;
}
});
const _zod = require("zod");
const isDefinedNonNullAny = (v)=>v !== undefined && v !== null;
const definedNonNullAnySchema = _zod.z.any().refine((v)=>isDefinedNonNullAny(v));
const CompareVariantSchema = _zod.z.enum([
"CHECKBOX",
"ICON"
]);
const ProductFiltersLayoutSchema = _zod.z.enum([
"DEFAULT",
"SIDEBAR"
]);
const SidebarGalleryPaginationVariantSchema = _zod.z.enum([
"DOTS",
"THUMBNAILS_BOTTOM"
]);
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SidebarGalleryConfigSchema = exports.RecentlyViewedProductsConfigSchema = exports.MagentoConfigurableVariantValuesSchema = exports.GraphCommerceStorefrontConfigSchema = exports.GraphCommerceDebugConfigSchema = exports.GraphCommerceConfigSchema = exports.SidebarGalleryPaginationVariantSchema = exports.ProductFiltersLayoutSchema = exports.CompareVariantSchema = exports.definedNonNullAnySchema = exports.isDefinedNonNullAny = void 0;
/* eslint-disable */
const zod_1 = require("zod");
const isDefinedNonNullAny = (v) => v !== undefined && v !== null;
exports.isDefinedNonNullAny = isDefinedNonNullAny;
exports.definedNonNullAnySchema = zod_1.z.any().refine((v) => (0, exports.isDefinedNonNullAny)(v));
exports.CompareVariantSchema = zod_1.z.enum(['CHECKBOX', 'ICON']);
exports.ProductFiltersLayoutSchema = zod_1.z.enum(['DEFAULT', 'SIDEBAR']);
exports.SidebarGalleryPaginationVariantSchema = zod_1.z.enum(['DOTS', 'THUMBNAILS_BOTTOM']);
function GraphCommerceConfigSchema() {
return _zod.z.object({
canonicalBaseUrl: _zod.z.string().min(1),
cartDisplayPricesInclTax: _zod.z.boolean().nullish(),
compare: _zod.z.boolean().nullish(),
compareVariant: CompareVariantSchema.nullish(),
configurableVariantForSimple: _zod.z.boolean().nullish(),
return zod_1.z.object({
canonicalBaseUrl: zod_1.z.string().min(1),
cartDisplayPricesInclTax: zod_1.z.boolean().nullish(),
compare: zod_1.z.boolean().nullish(),
compareVariant: exports.CompareVariantSchema.nullish(),
configurableVariantForSimple: zod_1.z.boolean().nullish(),
configurableVariantValues: MagentoConfigurableVariantValuesSchema().nullish(),
crossSellsHideCartItems: _zod.z.boolean().nullish(),
crossSellsRedirectItems: _zod.z.boolean().nullish(),
customerRequireEmailConfirmation: _zod.z.boolean().nullish(),
crossSellsHideCartItems: zod_1.z.boolean().nullish(),
crossSellsRedirectItems: zod_1.z.boolean().nullish(),
customerRequireEmailConfirmation: zod_1.z.boolean().nullish(),
debug: GraphCommerceDebugConfigSchema().nullish(),
demoMode: _zod.z.boolean().nullish(),
enableGuestCheckoutLogin: _zod.z.boolean().nullish(),
googleAnalyticsId: _zod.z.string().nullish(),
googleRecaptchaKey: _zod.z.string().nullish(),
googleTagmanagerId: _zod.z.string().nullish(),
hygraphEndpoint: _zod.z.string().min(1),
hygraphProjectId: _zod.z.string().nullish(),
hygraphWriteAccessEndpoint: _zod.z.string().nullish(),
hygraphWriteAccessToken: _zod.z.string().nullish(),
limitSsg: _zod.z.boolean().nullish(),
magentoEndpoint: _zod.z.string().min(1),
previewSecret: _zod.z.string().nullish(),
productFiltersLayout: ProductFiltersLayoutSchema.nullish(),
productFiltersPro: _zod.z.boolean().nullish(),
productRoute: _zod.z.string().nullish(),
demoMode: zod_1.z.boolean().nullish(),
enableGuestCheckoutLogin: zod_1.z.boolean().nullish(),
googleAnalyticsId: zod_1.z.string().nullish(),
googleRecaptchaKey: zod_1.z.string().nullish(),
googleTagmanagerId: zod_1.z.string().nullish(),
hygraphEndpoint: zod_1.z.string().min(1),
hygraphManagementApi: zod_1.z.string().nullish(),
hygraphProjectId: zod_1.z.string().nullish(),
hygraphWriteAccessEndpoint: zod_1.z.string().nullish(),
hygraphWriteAccessToken: zod_1.z.string().nullish(),
limitSsg: zod_1.z.boolean().nullish(),
magentoEndpoint: zod_1.z.string().min(1),
previewSecret: zod_1.z.string().nullish(),
productFiltersLayout: exports.ProductFiltersLayoutSchema.nullish(),
productFiltersPro: zod_1.z.boolean().nullish(),
productRoute: zod_1.z.string().nullish(),
recentlyViewedProducts: RecentlyViewedProductsConfigSchema().nullish(),
robotsAllow: _zod.z.boolean().nullish(),
robotsAllow: zod_1.z.boolean().nullish(),
sidebarGallery: SidebarGalleryConfigSchema().nullish(),
storefront: _zod.z.array(GraphCommerceStorefrontConfigSchema()),
wishlistHideForGuests: _zod.z.boolean().nullish(),
wishlistShowFeedbackMessage: _zod.z.boolean().nullish()
storefront: zod_1.z.array(GraphCommerceStorefrontConfigSchema()),
wishlistHideForGuests: zod_1.z.boolean().nullish(),
wishlistShowFeedbackMessage: zod_1.z.boolean().nullish()
});
}
exports.GraphCommerceConfigSchema = GraphCommerceConfigSchema;
function GraphCommerceDebugConfigSchema() {
return _zod.z.object({
pluginStatus: _zod.z.boolean().nullish(),
sessions: _zod.z.boolean().nullish(),
webpackCircularDependencyPlugin: _zod.z.boolean().nullish(),
webpackDuplicatesPlugin: _zod.z.boolean().nullish()
return zod_1.z.object({
pluginStatus: zod_1.z.boolean().nullish(),
sessions: zod_1.z.boolean().nullish(),
webpackCircularDependencyPlugin: zod_1.z.boolean().nullish(),
webpackDuplicatesPlugin: zod_1.z.boolean().nullish()
});
}
exports.GraphCommerceDebugConfigSchema = GraphCommerceDebugConfigSchema;
function GraphCommerceStorefrontConfigSchema() {
return _zod.z.object({
canonicalBaseUrl: _zod.z.string().nullish(),
cartDisplayPricesInclTax: _zod.z.boolean().nullish(),
defaultLocale: _zod.z.boolean().nullish(),
domain: _zod.z.string().nullish(),
googleAnalyticsId: _zod.z.string().nullish(),
googleRecaptchaKey: _zod.z.string().nullish(),
googleTagmanagerId: _zod.z.string().nullish(),
hygraphLocales: _zod.z.array(_zod.z.string().min(1)).nullish(),
linguiLocale: _zod.z.string().nullish(),
locale: _zod.z.string().min(1),
magentoStoreCode: _zod.z.string().min(1)
return zod_1.z.object({
canonicalBaseUrl: zod_1.z.string().nullish(),
cartDisplayPricesInclTax: zod_1.z.boolean().nullish(),
defaultLocale: zod_1.z.boolean().nullish(),
domain: zod_1.z.string().nullish(),
googleAnalyticsId: zod_1.z.string().nullish(),
googleRecaptchaKey: zod_1.z.string().nullish(),
googleTagmanagerId: zod_1.z.string().nullish(),
hygraphLocales: zod_1.z.array(zod_1.z.string().min(1)).nullish(),
linguiLocale: zod_1.z.string().nullish(),
locale: zod_1.z.string().min(1),
magentoStoreCode: zod_1.z.string().min(1)
});
}
exports.GraphCommerceStorefrontConfigSchema = GraphCommerceStorefrontConfigSchema;
function MagentoConfigurableVariantValuesSchema() {
return _zod.z.object({
content: _zod.z.boolean().nullish(),
gallery: _zod.z.boolean().nullish(),
url: _zod.z.boolean().nullish()
return zod_1.z.object({
content: zod_1.z.boolean().nullish(),
gallery: zod_1.z.boolean().nullish(),
url: zod_1.z.boolean().nullish()
});
}
exports.MagentoConfigurableVariantValuesSchema = MagentoConfigurableVariantValuesSchema;
function RecentlyViewedProductsConfigSchema() {
return _zod.z.object({
enabled: _zod.z.boolean().nullish(),
maxCount: _zod.z.number().nullish()
return zod_1.z.object({
enabled: zod_1.z.boolean().nullish(),
maxCount: zod_1.z.number().nullish()
});
}
exports.RecentlyViewedProductsConfigSchema = RecentlyViewedProductsConfigSchema;
function SidebarGalleryConfigSchema() {
return _zod.z.object({
paginationVariant: SidebarGalleryPaginationVariantSchema.nullish()
return zod_1.z.object({
paginationVariant: exports.SidebarGalleryPaginationVariantSchema.nullish()
});
}
exports.SidebarGalleryConfigSchema = SidebarGalleryConfigSchema;
24 changes: 11 additions & 13 deletions packagesDev/next-config/dist/withGraphCommerce.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,19 +65,17 @@ function withGraphCommerce(nextConfig, cwd) {
},
redirects: async () => {
const redirects = (await nextConfig.redirects?.()) ?? [];
if (!graphcommerceConfig.legacyProductRoute) {
const destination = `${graphcommerceConfig.productRoute ?? '/p/'}:url*`;
redirects.push(...[
{ source: '/product/bundle/:url*', destination, permanent: true },
{ source: '/product/configurable/:url*', destination, permanent: true },
{ source: '/product/downloadable/:url*', destination, permanent: true },
{ source: '/product/grouped/:url*', destination, permanent: true },
{ source: '/product/virtual/:url*', destination, permanent: true },
{ source: '/customer/account', destination: '/account', permanent: true },
]);
if (destination !== '/product/:url*')
redirects.push({ source: '/product/:url*', destination, permanent: true });
}
const destination = `${graphcommerceConfig.productRoute ?? '/p/'}:url*`;
redirects.push(...[
{ source: '/product/bundle/:url*', destination, permanent: true },
{ source: '/product/configurable/:url*', destination, permanent: true },
{ source: '/product/downloadable/:url*', destination, permanent: true },
{ source: '/product/grouped/:url*', destination, permanent: true },
{ source: '/product/virtual/:url*', destination, permanent: true },
{ source: '/customer/account', destination: '/account', permanent: true },
]);
if (destination !== '/product/:url*')
redirects.push({ source: '/product/:url*', destination, permanent: true });
return redirects;
},
rewrites: async () => {
Expand Down
3 changes: 3 additions & 0 deletions packagesDev/next-config/src/generated/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,8 @@ export type GraphCommerceConfig = {
* Project settings -> API Access -> High Performance Read-only Content API
*/
hygraphEndpoint: Scalars['String']['input'];
/** Hygraph Management API. **Only used for migrations.** */
hygraphManagementApi?: InputMaybe<Scalars['String']['input']>;
/** Hygraph Project ID. **Only used for migrations.** */
hygraphProjectId?: InputMaybe<Scalars['String']['input']>;
/**
Expand Down Expand Up @@ -444,6 +446,7 @@ export function GraphCommerceConfigSchema(): z.ZodObject<Properties<GraphCommerc
googleRecaptchaKey: z.string().nullish(),
googleTagmanagerId: z.string().nullish(),
hygraphEndpoint: z.string().min(1),
hygraphManagementApi: z.string().nullish(),
hygraphProjectId: z.string().nullish(),
hygraphWriteAccessEndpoint: z.string().nullish(),
hygraphWriteAccessToken: z.string().nullish(),
Expand Down
Loading