Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
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: 16 additions & 1 deletion .github/workflows/bundlesize.yml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
68 changes: 68 additions & 0 deletions knip.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import type { KnipConfig } from 'knip'

type WorkspaceEntry = NonNullable<KnipConfig['workspaces']>[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
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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"
},
Expand Down
6 changes: 0 additions & 6 deletions packages/algolia-search/hooks/useSearchRoute.ts

This file was deleted.

15 changes: 0 additions & 15 deletions packages/framer-next-pages/utils/createRouterProxy.ts

This file was deleted.

8 changes: 4 additions & 4 deletions packages/image/config/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Loading