diff --git a/.github/workflows/bundlesize.yml b/.github/workflows/bundlesize.yml index e1d51d016ee..5e04e79c9d7 100644 --- a/.github/workflows/bundlesize.yml +++ b/.github/workflows/bundlesize.yml @@ -1,8 +1,23 @@ -name: bundlesize +name: pr-analysis on: pull_request: types: [opened, synchronize, reopened, ready_for_review] jobs: + knip: + runs-on: ubuntu-latest + if: github.event.pull_request.draft == false + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v3 + with: + cache: yarn + node-version: 18 + - run: yarn install + - run: cd examples/magento-graphcms && yarn codegen && cd ../.. + - uses: codex-/knip-reporter@v1 + with: + token: ${{ secrets.GITHUB_TOKEN }} + ignore_results: true bundlesize: runs-on: ubuntu-latest if: github.event.pull_request.draft == false diff --git a/knip.ts b/knip.ts new file mode 100644 index 00000000000..0633d0a74c2 --- /dev/null +++ b/knip.ts @@ -0,0 +1,68 @@ +import type { KnipConfig } from 'knip' + +type WorkspaceEntry = NonNullable[string] + +const skip: WorkspaceEntry = { + ignore: ['**/*.*'], +} + +const asNextjsDir: WorkspaceEntry = { + ignore: ['.next', 'public'], + entry: [ + 'next.config.js', + 'graphcommerce.config.js', + 'lingui.config.js', + 'next-sitemap.config.js', + 'next.config.{ts,cjs,mjs}', + 'middleware.{ts}', + 'app/**/route.{ts}', + 'app/**/{error,layout,loading,not-found,page,template}.{jsx,ts,tsx}', + 'instrumentation.{ts}', + 'app/{manifest,sitemap,robots}.{ts}', + 'app/**/{icon,apple-icon}.{ts,tsx}', + 'app/**/{opengraph,twitter}-image.{ts,tsx}', + 'pages/**/*.{jsx,ts,tsx}', + 'plugins/**/*.{ts,tsx}', + ], +} + +const config: KnipConfig = { + eslint: false, + playwright: false, + next: false, + include: [ + 'files', + 'exports', + // Enable when files and exports are handled. + // "nsExports", + // "types" + // "nsTypes" + // "duplicates" + ], + workspaces: { + '.': skip, + 'packagesDev/*': { + ignore: ['__tests__', '**/*.interceptor.tsx', 'dist'], + entry: ['index.{js,mjs,cjs,ts,tsx}', 'src/index.{js,mjs,cjs,ts,tsx}'], + }, + 'packagesDev/next-config': { + ignore: ['__tests__', '**/*.interceptor.tsx', 'src/generated/config.ts'], + }, + 'packages/*': { + ignore: ['**/__tests__', 'test', '**/*.interceptor.tsx'], + entry: [ + 'plugins/**/*.{ts,tsx}', + 'src/bin/*.ts', + '**/*.{js,mjs,cjs}', + 'index.ts', + 'src/index.ts', + ], + }, + 'packages/*/example': skip, + 'packages/magento-pagebuilder': skip, + 'examples/magento-graphcms': asNextjsDir, + 'packages/hygraph-dynamic-rows-ui': asNextjsDir, + }, +} + +export default config diff --git a/package.json b/package.json index 3051be9f356..98bf7b0b656 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,8 @@ "packages:5": "yarn workspace @graphcommerce/cli dev", "packages:6": "yarn workspace @graphcommerce/changeset-changelog dev", "packages:7": "yarn workspace @graphcommerce/graphql-codegen-markdown-docs dev", - "create-patch": "patch-package --exclude 'package.json$|gql.ts$|interceptor.tsx$'" + "create-patch": "patch-package --exclude 'package.json$|gql.ts$|interceptor.tsx$'", + "knip": "knip" }, "sideEffects": false, "prettier": "@graphcommerce/prettier-config-pwa", @@ -58,6 +59,7 @@ "@types/event-stream": "^4.0.5", "eslint": "8.56.0", "event-stream": "^4.0.1", + "knip": "^2.43.0", "prettier": "3.2.4", "typescript": "5.3.3" }, diff --git a/packages/algolia-search/hooks/useSearchRoute.ts b/packages/algolia-search/hooks/useSearchRoute.ts deleted file mode 100644 index 45257b28a24..00000000000 --- a/packages/algolia-search/hooks/useSearchRoute.ts +++ /dev/null @@ -1,6 +0,0 @@ -import { useRouter } from 'next/router' - -export function useSearchRoute() { - const router = useRouter() - return router.asPath.includes('/search') -} diff --git a/packages/framer-next-pages/utils/createRouterProxy.ts b/packages/framer-next-pages/utils/createRouterProxy.ts deleted file mode 100644 index a10a0aa4177..00000000000 --- a/packages/framer-next-pages/utils/createRouterProxy.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { NextRouter } from 'next/router' - -export type OverrideProps = Partial> - -export function createRouterProxy(router: NextRouter, override?: OverrideProps): NextRouter { - // We create an object with the current stale properties - const { asPath, pathname, query, locale } = router - - const overrideProps: OverrideProps = { asPath, pathname, query, locale, ...override } - - return new Proxy(router, { - get: (target, prop: string, receiver) => - overrideProps[prop] ?? Reflect.get(target, prop, receiver), - }) -} diff --git a/packages/image/config/config.ts b/packages/image/config/config.ts index eea13d10930..d42211dcc60 100644 --- a/packages/image/config/config.ts +++ b/packages/image/config/config.ts @@ -13,10 +13,10 @@ export type ImageLoaderPropsWithConfig = ImageLoaderProps & { export const { deviceSizes: configDeviceSizes, - imageSizes: configImageSizes, - loader: configLoader, - path: configPath, - domains: configDomains, + // imageSizes: configImageSizes, + // loader: configLoader, + // path: configPath, + // domains: configDomains, // eslint-disable-next-line no-underscore-dangle } = (process.env.__NEXT_IMAGE_OPTS as unknown as ImageConfigComplete) || imageConfigDefault diff --git a/packages/lighthouse/CHANGELOG.md b/packages/lighthouse/CHANGELOG.md deleted file mode 100644 index e28c436b381..00000000000 --- a/packages/lighthouse/CHANGELOG.md +++ /dev/null @@ -1,796 +0,0 @@ -# Change Log - -## 8.0.2 - -## 8.0.2-canary.3 - -## 8.0.2-canary.2 - -## 8.0.2-canary.1 - -## 8.0.2-canary.0 - -## 8.0.1 - -## 8.0.1-canary.4 - -## 8.0.1-canary.3 - -## 8.0.1-canary.2 - -## 8.0.1-canary.1 - -## 8.0.1-canary.0 - -## 8.0.0 - -## 8.0.0-canary.100 - -## 8.0.0-canary.99 - -## 8.0.0-canary.98 - -## 8.0.0-canary.97 - -## 8.0.0-canary.96 - -## 8.0.0-canary.95 - -## 8.0.0-canary.94 - -## 8.0.0-canary.93 - -## 8.0.0-canary.92 - -## 8.0.0-canary.91 - -## 8.0.0-canary.90 - -## 8.0.0-canary.89 - -## 8.0.0-canary.88 - -## 8.0.0-canary.87 - -## 8.0.0-canary.86 - -## 8.0.0-canary.85 - -## 8.0.0-canary.84 - -## 8.0.0-canary.83 - -## 8.0.0-canary.82 - -## 8.0.0-canary.81 - -## 8.0.0-canary.80 - -## 8.0.0-canary.79 - -## 8.0.0-canary.78 - -## 8.0.0-canary.77 - -## 8.0.0-canary.76 - -## 8.0.0-canary.75 - -## 8.0.0-canary.74 - -## 8.0.0-canary.73 - -## 8.0.0-canary.72 - -## 8.0.0-canary.71 - -## 8.0.0-canary.70 - -## 8.0.0-canary.69 - -## 7.1.0-canary.68 - -## 7.1.0-canary.67 - -## 7.1.0-canary.66 - -## 7.1.0-canary.65 - -## 7.1.0-canary.64 - -## 7.1.0-canary.63 - -## 7.1.0-canary.62 - -## 7.1.0-canary.61 - -## 7.1.0-canary.60 - -## 7.1.0-canary.59 - -## 7.1.0-canary.58 - -## 7.1.0-canary.57 - -## 7.1.0-canary.56 - -## 7.1.0-canary.55 - -## 7.1.0-canary.54 - -## 7.1.0-canary.53 - -## 7.1.0-canary.52 - -## 7.1.0-canary.51 - -## 7.1.0-canary.50 - -## 7.1.0-canary.49 - -## 7.1.0-canary.48 - -## 7.1.0-canary.47 - -## 7.1.0-canary.46 - -## 7.1.0-canary.45 - -## 7.1.0-canary.38 - -## 7.1.0-canary.37 - -## 7.1.0-canary.36 - -## 7.1.0-canary.35 - -## 7.1.0-canary.34 - -## 7.1.0-canary.33 - -## 7.1.0-canary.32 - -## 7.1.0-canary.31 - -## 7.1.0-canary.30 - -## 7.1.0-canary.29 - -## 7.1.0-canary.28 - -## 7.1.0-canary.27 - -## 7.1.0-canary.26 - -## 7.1.0-canary.25 - -## 7.1.0-canary.24 - -## 7.1.0-canary.23 - -## 7.1.0-canary.22 - -## 7.1.0-canary.21 - -## 7.1.0-canary.20 - -## 7.1.0-canary.19 - -## 7.1.0-canary.18 - -## 7.1.0-canary.17 - -## 7.1.0-canary.16 - -## 7.1.0-canary.15 - -## 7.1.0-canary.14 - -## 7.1.0-canary.13 - -## 7.1.0-canary.12 - -## 7.1.0-canary.11 - -## 7.1.0-canary.10 - -## 7.1.0-canary.9 - -## 7.1.0-canary.8 - -## 7.0.2-canary.7 - -## 7.0.2-canary.6 - -## 7.0.2-canary.5 - -## 7.0.1 - -## 7.0.1-canary.15 - -## 7.0.1-canary.14 - -## 7.0.1-canary.13 - -## 7.0.1-canary.12 - -## 7.0.1-canary.11 - -## 7.0.1-canary.10 - -## 7.0.1-canary.9 - -## 7.0.1-canary.8 - -## 7.0.1-canary.7 - -## 7.0.1-canary.6 - -## 7.0.1-canary.5 - -## 7.0.1-canary.4 - -## 7.0.1-canary.3 - -## 7.0.1-canary.2 - -## 7.0.1-canary.1 - -## 7.0.1-canary.0 - -## 7.0.0 - -## 6.2.0-canary.98 - -## 6.2.0-canary.97 - -## 6.2.0-canary.96 - -## 6.2.0-canary.95 - -## 6.2.0-canary.94 - -## 6.2.0-canary.93 - -## 6.2.0-canary.92 - -## 6.2.0-canary.91 - -## 6.2.0-canary.90 - -## 6.2.0-canary.89 - -## 6.2.0-canary.88 - -## 6.2.0-canary.87 - -## 6.2.0-canary.86 - -## 6.2.0-canary.85 - -## 6.2.0-canary.84 - -## 6.2.0-canary.83 - -## 6.2.0-canary.82 - -## 6.2.0-canary.81 - -## 6.2.0-canary.80 - -## 6.2.0-canary.79 - -## 6.2.0-canary.78 - -## 6.2.0-canary.77 - -## 6.2.0-canary.76 - -## 6.2.0-canary.75 - -## 6.2.0-canary.74 - -## 6.2.0-canary.73 - -## 6.2.0-canary.72 - -## 6.2.0-canary.71 - -## 6.2.0-canary.70 - -## 6.2.0-canary.69 - -## 6.2.0-canary.68 - -## 6.2.0-canary.67 - -## 6.2.0-canary.66 - -## 6.2.0-canary.65 - -## 6.2.0-canary.64 - -## 6.2.0-canary.63 - -## 6.2.0-canary.62 - -## 6.2.0-canary.61 - -## 6.2.0-canary.60 - -## 6.2.0-canary.59 - -## 6.2.0-canary.58 - -## 6.2.0-canary.57 - -## 6.2.0-canary.56 - -## 6.2.0-canary.55 - -## 6.2.0-canary.54 - -## 6.2.0-canary.53 - -## 6.2.0-canary.52 - -## 6.2.0-canary.51 - -## 6.2.0-canary.50 - -## 6.2.0-canary.49 - -## 6.2.0-canary.48 - -## 6.2.0-canary.47 - -## 6.2.0-canary.46 - -## 6.2.0-canary.45 - -## 6.2.0-canary.44 - -## 6.2.0-canary.43 - -## 6.2.0-canary.42 - -## 6.2.0-canary.41 - -## 6.2.0-canary.40 - -## 6.2.0-canary.39 - -## 6.2.0-canary.38 - -## 6.2.0-canary.37 - -## 6.2.0-canary.36 - -## 6.2.0-canary.35 - -## 6.2.0-canary.34 - -## 6.2.0-canary.33 - -## 6.2.0-canary.32 - -## 6.2.0-canary.31 - -## 6.2.0-canary.30 - -## 6.2.0-canary.29 - -## 6.2.0-canary.28 - -## 6.2.0-canary.27 - -## 6.2.0-canary.26 - -## 6.2.0-canary.25 - -## 6.2.0-canary.24 - -## 6.2.0-canary.23 - -## 6.2.0-canary.22 - -## 6.2.0-canary.21 - -## 6.2.0-canary.20 - -## 6.2.0-canary.19 - -## 6.2.0-canary.18 - -## 6.2.0-canary.17 - -## 6.2.0-canary.16 - -## 6.2.0-canary.15 - -## 6.2.0-canary.14 - -## 6.2.0-canary.13 - -## 6.2.0-canary.12 - -## 6.2.0-canary.11 - -## 6.2.0-canary.10 - -## 6.2.0-canary.9 - -## 6.2.0-canary.8 - -## 6.2.0-canary.7 - -## 6.2.0-canary.6 - -## 6.1.1-canary.5 - -## 6.1.1-canary.4 - -## 6.1.1-canary.3 - -## 6.1.1-canary.2 - -## 6.1.1-canary.1 - -## 6.1.1-canary.0 - -## 6.1.0 - -## 6.0.2-canary.22 - -## 6.0.2-canary.21 - -## 6.0.2-canary.20 - -## 6.0.2-canary.19 - -## 6.0.2-canary.18 - -## 6.0.2-canary.17 - -## 6.0.2-canary.16 - -## 6.0.2-canary.15 - -## 6.0.2-canary.14 - -## 6.0.2-canary.13 - -## 6.0.2-canary.12 - -## 6.0.2-canary.11 - -## 6.0.2-canary.10 - -## 6.0.2-canary.9 - -## 6.0.2-canary.8 - -## 6.0.2-canary.7 - -## 6.0.2-canary.6 - -## 6.0.2-canary.5 - -## 6.0.2-canary.4 - -## 6.0.2-canary.3 - -## 6.0.2-canary.2 - -## 6.0.2-canary.1 - -## 6.0.2-canary.0 - -## 6.0.1 - -## 6.0.1-canary.7 - -## 6.0.1-canary.6 - -## 6.0.1-canary.5 - -## 6.0.1-canary.4 - -## 6.0.1-canary.3 - -## 6.0.1-canary.2 - -## 6.0.1-canary.1 - -## 6.0.1-canary.0 - -## 6.0.0 - -### Patch Changes - -- [#1821](https://github.com/graphcommerce-org/graphcommerce/pull/1821) [`1abc50a21`](https://github.com/graphcommerce-org/graphcommerce/commit/1abc50a21103270fad04e4a9ea892ee1e75233e9) - Upgrade packages to latest version ([@paales](https://github.com/paales)) - -## 6.0.0-canary.54 - -## 6.0.0-canary.53 - -## 6.0.0-canary.52 - -## 6.0.0-canary.51 - -## 6.0.0-canary.50 - -## 6.0.0-canary.49 - -## 6.0.0-canary.48 - -## 6.0.0-canary.47 - -## 6.0.0-canary.46 - -## 6.0.0-canary.45 - -## 6.0.0-canary.44 - -## 6.0.0-canary.43 - -## 6.0.0-canary.42 - -## 6.0.0-canary.41 - -## 6.0.0-canary.40 - -## 6.0.0-canary.39 - -## 6.0.0-canary.38 - -## 6.0.0-canary.37 - -## 6.0.0-canary.36 - -## 6.0.0-canary.35 - -## 6.0.0-canary.34 - -## 6.0.0-canary.33 - -## 6.0.0-canary.32 - -## 6.0.0-canary.31 - -## 6.0.0-canary.30 - -## 6.0.0-canary.29 - -## 6.0.0-canary.28 - -## 6.0.0-canary.27 - -### Patch Changes - -- [#1821](https://github.com/graphcommerce-org/graphcommerce/pull/1821) [`1abc50a21`](https://github.com/graphcommerce-org/graphcommerce/commit/1abc50a21103270fad04e4a9ea892ee1e75233e9) - Fix regression bugs and upgrade packages to latest versions ([@paales](https://github.com/paales)) - -## 6.0.0-canary.26 - -## 6.0.0-canary.25 - -## 6.0.0-canary.24 - -## 6.0.0-canary.23 - -## 6.0.0-canary.22 - -## 6.0.0-canary.21 - -## 6.0.0-canary.20 - -## 5.2.0-canary.19 - -## 5.2.0-canary.18 - -## 5.2.0-canary.17 - -## 5.2.0-canary.16 - -## 5.2.0-canary.15 - -## 5.2.0-canary.14 - -## 5.2.0-canary.13 - -## 5.2.0-canary.12 - -## 5.2.0-canary.11 - -## 5.2.0-canary.10 - -## 5.2.0-canary.9 - -## 5.2.0-canary.8 - -## 5.2.0-canary.7 - -## 5.2.0-canary.6 - -## 5.2.0-canary.5 - -## 5.2.0-canary.4 - -## 5.2.0-canary.3 - -## 5.2.0-canary.2 - -## 5.2.0-canary.1 - -## 5.2.0-canary.0 - -## 5.1.1 - -## 5.1.1-canary.1 - -## 5.1.1-canary.0 - -## 5.1.0 - -### Patch Changes - -- [#1752](https://github.com/graphcommerce-org/graphcommerce/pull/1752) [`2a6a4d9ec`](https://github.com/graphcommerce-org/graphcommerce/commit/2a6a4d9ecfa1b58a66ba9b9d00016d6feda9aa95) - Updated dependencies to latest versions, except for nextjs; Solve tons of peer dependency issues. - - - Updated the @mui/material package - - Removed dependencies on react-hook-form-mui and @playwright/test - - Upgraded dependencies including type-fest and graphql-mesh - - Solved peer dependency issues ([@paales](https://github.com/paales)) - -## 5.1.0-canary.11 - -## 5.1.0-canary.10 - -## 5.1.0-canary.9 - -## 5.1.0-canary.8 - -## 5.1.0-canary.7 - -## 5.1.0-canary.6 - -## 5.1.0-canary.5 - -## 5.1.0-canary.4 - -## 5.1.0-canary.3 - -### Patch Changes - -- [#1752](https://github.com/graphcommerce-org/graphcommerce/pull/1752) [`2a6a4d9ec`](https://github.com/graphcommerce-org/graphcommerce/commit/2a6a4d9ecfa1b58a66ba9b9d00016d6feda9aa95) - Updated dependencies to latest versions, except for nextjs; Solve tons of peer dependency issues. - - - Updated the @mui/material package - - Removed dependencies on react-hook-form-mui and @playwright/test - - Upgraded dependencies including type-fest and graphql-mesh - - Solved peer dependency issues ([@paales](https://github.com/paales)) - -## 5.1.0-canary.2 - -## 5.1.0-canary.1 - -## 5.1.0-canary.0 - -## 5.0.0 - -### Major Changes - -- [`7592d161c`](https://github.com/graphcommerce-org/graphcommerce/commit/7592d161cef7b42838855f8d9dfe5ecc1063c384) - Bump major version of all packages ([@paales](https://github.com/paales)) - -## 5.0.0-canary.14 - -### Major Changes - -- [`7592d161c`](https://github.com/graphcommerce-org/graphcommerce/commit/7592d161cef7b42838855f8d9dfe5ecc1063c384) - Bump major version of all packages ([@paales](https://github.com/paales)) - -## 4.0.9 - -### Patch Changes - -- [#1702](https://github.com/graphcommerce-org/graphcommerce/pull/1702) [`abb15ef4a`](https://github.com/graphcommerce-org/graphcommerce/commit/abb15ef4a79b12eddb32cc006e5d1d31dd06ac2d) Thanks [@paales](https://github.com/paales)! - Added canary releases to GraphCommerce - -## 4.0.9-canary.0 - -### Patch Changes - -- [`abb15ef4a`](https://github.com/graphcommerce-org/graphcommerce/commit/abb15ef4a79b12eddb32cc006e5d1d31dd06ac2d) Thanks [@paales](https://github.com/paales)! - Added canary releases to GraphCommerce - -## 4.0.8 - -### Patch Changes - -- [#1490](https://github.com/graphcommerce-org/graphcommerce/pull/1490) [`d311ef48b`](https://github.com/graphcommerce-org/graphcommerce/commit/d311ef48bb3e97806d992af5516d6b7f183ec9cb) Thanks [@paales](https://github.com/paales)! - upgraded packages - -## 4.0.7 - -### Patch Changes - -- [#1399](https://github.com/graphcommerce-org/graphcommerce/pull/1399) [`da0ae7d02`](https://github.com/graphcommerce-org/graphcommerce/commit/da0ae7d0236e4908ba0bf0fa16656be516e841d4) Thanks [@paales](https://github.com/paales)! - Updated dependencies - -## 4.0.6 - -### Patch Changes - -- [#1378](https://github.com/graphcommerce-org/graphcommerce/pull/1378) [`b610a6e40`](https://github.com/graphcommerce-org/graphcommerce/commit/b610a6e4049e8c9e8b5d2aeff31b8e1bfc24abe5) Thanks [@paales](https://github.com/paales)! - Pin all versions internally so we can’t end up in an unfixable state for the user - -## 4.0.5 - -### Patch Changes - -- [#1369](https://github.com/graphcommerce-org/graphcommerce/pull/1369) [`ae6449502`](https://github.com/graphcommerce-org/graphcommerce/commit/ae64495024a455bbe5188588604368c1542840c9) Thanks [@paales](https://github.com/paales)! - Upgraded dependencies - -## 4.0.4 - -### Patch Changes - -- [#1307](https://github.com/ho-nl/m2-pwa/pull/1307) [`bd10506d3`](https://github.com/ho-nl/m2-pwa/commit/bd10506d32fdbc91d01dadc29a12ebd1e0943655) Thanks [@paales](https://github.com/paales)! - All default exports are now named exports internally and all `index.tsx` are renamed to the component name. - -* [#1307](https://github.com/ho-nl/m2-pwa/pull/1307) [`27cb1f2d8`](https://github.com/ho-nl/m2-pwa/commit/27cb1f2d8dbfb8f1b301ce56fb6a2b6c1fc6a5ef) Thanks [@paales](https://github.com/paales)! - upgrade dependencies - -## 4.0.3 - -### Patch Changes - -- [`973ff8645`](https://github.com/ho-nl/m2-pwa/commit/973ff86452a70ade9f4db13fdda6e963d7220e96) Thanks [@paales](https://github.com/paales)! - made packages public - -## 4.0.2 - -### Patch Changes - -- [#1276](https://github.com/ho-nl/m2-pwa/pull/1276) [`ce09388e0`](https://github.com/ho-nl/m2-pwa/commit/ce09388e0d7ef33aee660612340f6fbae15ceec2) Thanks [@paales](https://github.com/paales)! - We've moved lots of internal packages from `dependencies` to `peerDependencies`. The result of this is that there will be significantly less duplicate packages in the node_modules folders. - -* [#1276](https://github.com/ho-nl/m2-pwa/pull/1276) [`52a45bba4`](https://github.com/ho-nl/m2-pwa/commit/52a45bba4dc6dd6df3c81f5023df7d23ed8a534d) Thanks [@paales](https://github.com/paales)! - Upgraded to [NextJS 12.1](https://nextjs.org/blog/next-12-1)! This is just for compatibility, but we'll be implementing [On-demand Incremental Static Regeneration](https://nextjs.org/blog/next-12-1#on-demand-incremental-static-regeneration-beta) soon. - - This will greatly reduce the requirement to rebuid stuff and we'll add a management UI on the frontend to be able to revalidate pages manually. - -## 4.0.1 - -### Patch Changes - -- [`0cbaa878b`](https://github.com/ho-nl/m2-pwa/commit/0cbaa878b8a844d5abbeb1797b625a33130e6514) Thanks [@paales](https://github.com/paales)! - Added homepage and repository package.json files, so that the packages link to back to the website and repository - -## 4.0.0 - -### Major Changes - -- [#1258](https://github.com/ho-nl/m2-pwa/pull/1258) [`ad36382a4`](https://github.com/ho-nl/m2-pwa/commit/ad36382a4d55d83d9e47b7eb6a02671a2a631a05) Thanks [@paales](https://github.com/paales)! - Upgraded to Material UI 5 - -All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -## [3.0.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/lighthouse@3.0.0...@graphcommerce/lighthouse@3.0.1) (2021-09-27) - -**Note:** Version bump only for package @graphcommerce/lighthouse - -# 3.0.0 (2021-09-27) - -### Bug Fixes - -- ignore md files from triggering version updates ([4f98392](https://github.com/ho-nl/m2-pwa/commit/4f9839250b3a32d3070da5290e5efcc5e2243fba)) - -### Features - -- **playwright:** added new playwright package to enable browser testing ([6f49ec7](https://github.com/ho-nl/m2-pwa/commit/6f49ec7595563775b96ebf21c27e39da1282e8d9)) -- renamed all packages to use [@graphcommerce](https://github.com/graphcommerce) instead of [@reachdigital](https://github.com/reachdigital) ([491e4ce](https://github.com/ho-nl/m2-pwa/commit/491e4cec9a2686472dac36b79f999257c0811ffe)) -- split into packages ([2ee7fd6](https://github.com/ho-nl/m2-pwa/commit/2ee7fd6c0056f467d114f04d92c6c0ddf622d151)) -- upgrade to node 14 ([d079a75](https://github.com/ho-nl/m2-pwa/commit/d079a751e9bfd8dc7f5009d2c9f31c336a0c96ab)) - -### BREAKING CHANGES - -- huge folder structure refactor, please read README to reinstall - -# Change Log - -All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines. - -# [2.101.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/lighthouse@2.100.10...@graphcommerce/lighthouse@2.101.0) (2021-07-26) - -### Bug Fixes - -- ignore md files from triggering version updates ([4f98392](https://github.com/ho-nl/m2-pwa/commit/4f9839250b3a32d3070da5290e5efcc5e2243fba)) - -### Features - -- **playwright:** added new playwright package to enable browser testing ([6f49ec7](https://github.com/ho-nl/m2-pwa/commit/6f49ec7595563775b96ebf21c27e39da1282e8d9)) diff --git a/packages/lighthouse/lighthouse.ts b/packages/lighthouse/lighthouse.ts deleted file mode 100644 index 7b78643ee55..00000000000 --- a/packages/lighthouse/lighthouse.ts +++ /dev/null @@ -1,21 +0,0 @@ -import { promises as fs } from 'fs' -import { PrerenderManifest } from 'next/dist/build' -import lighthouse from './lighthouserc.json' - -async function main() { - const file: PrerenderManifest = JSON.parse( - await fs.readFile('.next/prerender-manifest.json', 'utf-8'), - ) - - const urls = {} - Object.entries(file.routes).forEach(([path, ssgRoute]) => { - if (!urls[ssgRoute.srcRoute || path]) urls[ssgRoute.srcRoute || path] = path - }) - - const newUrls = Object.values(urls).map((url) => `__LHCI_BASE_URL__${url}`) - lighthouse.ci.collect.url = newUrls.sort() - - await fs.writeFile('./lighthouserc.json', `${JSON.stringify(lighthouse, null, ' ')}\n`) -} - -main().catch(console.error) diff --git a/packages/lighthouse/lighthouserc.json b/packages/lighthouse/lighthouserc.json deleted file mode 100644 index e6b5c9fabf3..00000000000 --- a/packages/lighthouse/lighthouserc.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "ci": { - "collect": { - "numberOfRuns": 3, - "url": ["__LHCI_BASE_URL__/", "__LHCI_BASE_URL__/account/signin"] - }, - "assert": { - "preset": "lighthouse:recommended", - "assertions": { - "html-has-lang": "off", - "color-contrast": "off", - "is-crawlable": "off", - "tap-targets": "off", - "mainthread-work-breakdown": "off", - "max-potential-fid": "off", - "uses-long-cache-ttl": "off", - "canonical": "off", - "image-size-responsive": "off", - "meta-description": "off" - } - }, - "upload": { - "target": "temporary-public-storage" - }, - "server": {}, - "wizard": {} - } -} diff --git a/packages/lighthouse/package.json b/packages/lighthouse/package.json deleted file mode 100644 index 228886b6ec6..00000000000 --- a/packages/lighthouse/package.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "@graphcommerce/lighthouse", - "homepage": "https://www.graphcommerce.org/", - "repository": "github:graphcommerce-org/graphcommerce", - "version": "8.0.2", - "private": true, - "sideEffects": false, - "prettier": "@graphcommerce/prettier-config-pwa", - "eslintConfig": { - "extends": "@graphcommerce/eslint-config-pwa", - "parserOptions": { - "project": "./tsconfig.json" - } - }, - "peerDependencies": { - "@graphcommerce/eslint-config-pwa": "^8.0.2", - "@graphcommerce/prettier-config-pwa": "^8.0.2", - "@graphcommerce/typescript-config-pwa": "^8.0.2", - "next": "*" - } -} diff --git a/packages/lighthouse/tsconfig.json b/packages/lighthouse/tsconfig.json deleted file mode 100644 index 7398153dd62..00000000000 --- a/packages/lighthouse/tsconfig.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "exclude": ["**/node_modules", "**/.*/"], - "include": ["**/*.ts", "**/*.tsx"], - "extends": "@graphcommerce/typescript-config-pwa/nextjs.json" -} diff --git a/packages/lingui-next/document/index.ts b/packages/lingui-next/document/index.ts deleted file mode 100644 index 814f1ffcf73..00000000000 --- a/packages/lingui-next/document/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './withLingui' diff --git a/packages/magento-cart-items/components/CartItems/CartItems.tsx b/packages/magento-cart-items/components/CartItems/CartItems.tsx index 09e6e36d698..7937d8af824 100644 --- a/packages/magento-cart-items/components/CartItems/CartItems.tsx +++ b/packages/magento-cart-items/components/CartItems/CartItems.tsx @@ -6,7 +6,10 @@ export type CartItemRenderer = TypeRenderer & - Omit - -type OwnerProps = { - free?: boolean - error?: boolean -} -const name = 'AvailableShippingMethod' as const -const parts = ['root', 'title', 'additional', 'error', 'amount'] as const -const { withState } = extendableComponent(name, parts) - -export const AvailableShippingMethod = React.forwardRef( - (props: AvailableShippingMethodProps, ref) => { - const { - price_excl_tax, - price_incl_tax, - available, - disabled, - carrier_code, - carrier_title, - error_message, - method_code, - method_title, - children, - sx = [], - ...toggleProps - } = props - - const amount = useDisplayInclTax() ? price_incl_tax : price_excl_tax - - const classes = withState({ - free: amount?.value === 0, - error: !!error_message, - }) - - return ( - ({ - typography: 'body2', - textAlign: 'left', - justifyContent: 'space-between', - alignItems: 'normal', - display: 'grid', - gridTemplate: ` - "title amount" - "additional additional" - "error error" - `, - gridTemplateColumns: 'auto min-content', - columnGap: theme.spacings.xxs, - }), - ...(Array.isArray(sx) ? sx : [sx]), - ]} - > - - {carrier_title} {method_title} - - - - {amount?.value === 0 ? : } - - - {error_message ? ( - - {error_message} - - ) : ( - children && ( - - {children} - - ) - )} - - ) - }, -) diff --git a/packages/magento-cms/CmsPageMeta.tsx b/packages/magento-cms/CmsPageMeta.tsx index 4e66c409143..9d12239ad17 100644 --- a/packages/magento-cms/CmsPageMeta.tsx +++ b/packages/magento-cms/CmsPageMeta.tsx @@ -1,5 +1,4 @@ import { PageMeta } from '@graphcommerce/magento-store' -import React from 'react' import { CmsPageMetaFragment } from './CmsPageMeta.gql' export function CmsPageMeta(props: CmsPageMetaFragment) { diff --git a/packages/magento-cms/index.ts b/packages/magento-cms/index.ts index c873d08bf50..b9e40d2078d 100644 --- a/packages/magento-cms/index.ts +++ b/packages/magento-cms/index.ts @@ -1 +1,2 @@ export * from './CmsPageContent' +export * from './CmsPageMeta' diff --git a/packages/magento-customer/components/index.ts b/packages/magento-customer/components/index.ts index 82bc6cce2c7..a377ef545e6 100644 --- a/packages/magento-customer/components/index.ts +++ b/packages/magento-customer/components/index.ts @@ -42,3 +42,4 @@ export * from './SignUpForm/SignUpFormInline' export * from './UpdateCustomerEmailForm/UpdateCustomerEmailForm' export * from './UpdateDefaultAddressForm/UpdateDefaultAddressForm' export * from './WaitForCustomer/WaitForCustomer' +export * from './SessionDebugger/SessionDebugger' diff --git a/packages/magento-payment-adyen/hooks/adyenHppExpandMethods.ts b/packages/magento-payment-adyen/hooks/adyenHppExpandMethods.ts index 671d093b533..73abe921449 100644 --- a/packages/magento-payment-adyen/hooks/adyenHppExpandMethods.ts +++ b/packages/magento-payment-adyen/hooks/adyenHppExpandMethods.ts @@ -1,8 +1,6 @@ import { ExpandPaymentMethods } from '@graphcommerce/magento-cart-payment-method' import { UseAdyenPaymentMethodsDocument } from './UseAdyenPaymentMethods.gql' - -export const nonNullable = (value: T): value is NonNullable => - value !== null && value !== undefined +import { nonNullable } from '@graphcommerce/next-ui' export const adyenHppExpandMethods: ExpandPaymentMethods = async (available, context) => { if (!context.id) return [] diff --git a/packages/magento-payment-adyen/hooks/useAdyenHandlePaymentResponse.ts b/packages/magento-payment-adyen/hooks/useAdyenHandlePaymentResponse.ts index cf5bc2c9c73..c7a2a37a2d2 100644 --- a/packages/magento-payment-adyen/hooks/useAdyenHandlePaymentResponse.ts +++ b/packages/magento-payment-adyen/hooks/useAdyenHandlePaymentResponse.ts @@ -31,9 +31,7 @@ export type AdyenPaymentResponse = { additionalData?: Types.checkout.PaymentResponse['additionalData'] } -export function parsePaymentResponse( - status?: AdyenPaymentResponseFragment | null, -): AdyenPaymentResponse { +function parsePaymentResponse(status?: AdyenPaymentResponseFragment | null): AdyenPaymentResponse { if (!status?.resultCode) return { isFinal: false, resultCode: ResultCodeEnum.Error } const { isFinal, resultCode, action, additionalData } = status diff --git a/packages/magento-payment-braintree/utils/isBraintreeError.ts b/packages/magento-payment-braintree/utils/isBraintreeError.ts index 58a5a41ba12..1fa6fcc46ea 100644 --- a/packages/magento-payment-braintree/utils/isBraintreeError.ts +++ b/packages/magento-payment-braintree/utils/isBraintreeError.ts @@ -6,6 +6,6 @@ export function isBraintreeError(e: unknown): e is BraintreeError { return errorTypes.includes((e as BraintreeError).type) && e instanceof Error } -export function isBraintreeCustomerError(e: unknown): e is BraintreeError { - return isBraintreeError(e) && e.type === 'CUSTOMER' -} +// export function isBraintreeCustomerError(e: unknown): e is BraintreeError { +// return isBraintreeError(e) && e.type === 'CUSTOMER' +// } diff --git a/packages/magento-product/components/ProductPageGallery/ProductImage.tsx b/packages/magento-product/components/ProductPageGallery/ProductImage.tsx deleted file mode 100644 index 0f8828da176..00000000000 --- a/packages/magento-product/components/ProductPageGallery/ProductImage.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { Image } from '@graphcommerce/image' -import { ProductImageFragment } from './ProductImage.gql' - -export function ProductImage(props: ProductImageFragment) { - const { url, label } = props - - if (!url) return null - - return {label -} diff --git a/packages/magento-product/components/ProductPageGallery/ProductVideo.tsx b/packages/magento-product/components/ProductPageGallery/ProductVideo.tsx deleted file mode 100644 index c7b03baffc1..00000000000 --- a/packages/magento-product/components/ProductPageGallery/ProductVideo.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import { ProductVideoFragment } from './ProductVideo.gql' - -export function ProductVideo(props: ProductVideoFragment) { - const { video_content } = props - - if (!video_content?.video_url) return null - - // eslint-disable-next-line jsx-a11y/media-has-caption - return