Skip to content

Commit

Permalink
Merge pull request #2487 from graphcommerce-org/fix/no-magento
Browse files Browse the repository at this point in the history
Solve dependency issues when no Magento packages are used
  • Loading branch information
paales authored Jan 23, 2025
2 parents 8649bf3 + 4e5d525 commit c513f58
Show file tree
Hide file tree
Showing 98 changed files with 4,979 additions and 5,575 deletions.
5 changes: 5 additions & 0 deletions .changeset/beige-suns-know.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/react-hook-form': patch
---

Remove dependency on Magento for @graphcommerec/react-hook-form
5 changes: 5 additions & 0 deletions .changeset/cold-eggs-visit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/next-config': patch
---

When a dependency is optional or has peerDependenciesMeta set to optional, make sure it doesn't crash when it is not found when calling resolveDependenciesSync
5 changes: 5 additions & 0 deletions .changeset/eighty-pianos-protect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/next-config': patch
---

Remove redirects for `/product/$type/[url]` routes, those haven't been used for years anymore.
5 changes: 5 additions & 0 deletions .changeset/gold-eels-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/hygraph-ui': patch
---

Prepare the RichTex for embed and code-block
5 changes: 5 additions & 0 deletions .changeset/green-guests-kick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/hygraph-ui': patch
---

Forward `<Asset unoptimized />` component to `<Image />`
5 changes: 5 additions & 0 deletions .changeset/late-paws-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/next-config': patch
---

Solve issue where withGraphCommerce had a hard dependency on Magento specific configurations
5 changes: 5 additions & 0 deletions .changeset/serious-glasses-call.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/hygraph-cli': patch
---

Migrated `@graphcommerce/hygraph-cli` package to `"type": "module"`
5 changes: 5 additions & 0 deletions .changeset/shaggy-ligers-obey.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/misc': patch
---

Added missing WebWorker tsconfig for magento-open-source example
6 changes: 6 additions & 0 deletions .changeset/shiny-pillows-love.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@graphcommerce/googletagmanager': patch
'@graphcommerce/googleanalytics': patch
---

Remove dependencies from `@graphcommerce/googletagmanager` and `@graphcommerce/googleanalytics` on Magento packages and make the datalayer optional
5 changes: 5 additions & 0 deletions .changeset/spicy-shrimps-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/next-config': patch
---

Remove rewriteLegacyEnv as that hasn't been used for years
5 changes: 5 additions & 0 deletions .changeset/wicked-stingrays-buy.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@graphcommerce/next-config': patch
---

Migrated `@graphcommerce/next-config` package to `"type": "module"`
2 changes: 1 addition & 1 deletion examples/magento-open-source/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"compilerOptions": {
"target": "ESNext",
"lib": ["DOM", "DOM.Iterable", "ESNext"],
"lib": ["DOM", "DOM.Iterable", "ESNext", "WebWorker"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
Expand Down
6 changes: 3 additions & 3 deletions packages/cli/dist/bin/codegen.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env node
import fs from 'node:fs/promises';
import path from 'node:path';
import { resolveDependenciesSync, packageRoots } from '@graphcommerce/next-config';
import { cliError, loadCodegenConfig, runCli } from '@graphql-codegen/cli';
import dotenv from 'dotenv';
import fs from 'node:fs/promises';
import path from 'node:path';
import { rimraf } from 'rimraf';
import yaml from 'yaml';

Expand All @@ -19,7 +19,7 @@ async function cleanup() {
});
} catch (e) {
}
return void 0;
return undefined;
}
function appendDocumentLocations(conf, packages) {
const documents = Array.isArray(conf.documents) ? conf.documents : [conf.documents];
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/dist/bin/mesh.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ async function cleanup() {
});
} catch (e) {
}
return void 0;
return undefined;
}
const main = async () => {
const baseConf = await findConfig({});
Expand Down
1 change: 1 addition & 0 deletions packages/cli/dist/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

12 changes: 9 additions & 3 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@
"repository": "github:graphcommerce-org/graphcommerce",
"version": "9.0.4-canary.9",
"scripts": {
"dev": "pkgroll --watch",
"build": "pkgroll",
"prepack": "pkgroll"
"dev": "pkgroll --clean-dist --watch",
"build": "pkgroll --clean-dist",
"prepack": "pkgroll --clean-dist"
},
"type": "module",
"types": "./src/index.ts",
"exports": {
".": {
"default": "./dist/index.js"
}
},
"bin": {
"gc-gql-codegen": "dist/bin/codegen.js",
"gc-mesh": "dist/bin/mesh.js",
Expand Down
15 changes: 1 addition & 14 deletions packages/googleanalytics/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,6 @@
"@graphcommerce/eslint-config-pwa": "^9.0.4-canary.9",
"@graphcommerce/google-datalayer": "9.0.4-canary.9",
"@graphcommerce/graphql-mesh": "^9.0.4-canary.9",
"@graphcommerce/magento-cart": "^9.0.4-canary.9",
"@graphcommerce/magento-cart-payment-method": "^9.0.4-canary.9",
"@graphcommerce/magento-cart-shipping-method": "^9.0.4-canary.9",
"@graphcommerce/magento-product": "^9.0.4-canary.9",
"@graphcommerce/next-config": "^9.0.4-canary.9",
"@graphcommerce/next-ui": "^9.0.4-canary.9",
"@graphcommerce/prettier-config-pwa": "^9.0.4-canary.9",
Expand All @@ -29,16 +25,7 @@
"react-dom": "^18.2.0"
},
"peerDependenciesMeta": {
"@graphcommerce/magento-cart": {
"optional": true
},
"@graphcommerce/magento-cart-payment-method": {
"optional": true
},
"@graphcommerce/magento-cart-shipping-method": {
"optional": true
},
"@graphcommerce/magento-product": {
"@graphcommerce/google-datalayer": {
"optional": true
}
}
Expand Down
5 changes: 5 additions & 0 deletions packages/googletagmanager/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,10 @@
"next": "*",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"peerDependenciesMeta": {
"@graphcommerce/google-datalayer": {
"optional": true
}
}
}
80 changes: 0 additions & 80 deletions packages/hygraph-cli/dist/UpsertClient.js

This file was deleted.

Loading

0 comments on commit c513f58

Please sign in to comment.