@graphcommerce/next-config 3.1.4 → 3.2.0

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/index.js CHANGED
@@ -9,7 +9,7 @@ const crypto_1 = require("crypto");
9
9
  const fs_1 = require("fs");
10
10
  const next_transpile_modules_1 = __importDefault(require("next-transpile-modules"));
11
11
  const webpack_1 = require("webpack");
12
- function extendConfig(nextConfig) {
12
+ function extendConfig(nextConfig, modules) {
13
13
  return {
14
14
  ...nextConfig,
15
15
  webpack: (config, options) => {
@@ -27,13 +27,22 @@ function extendConfig(nextConfig) {
27
27
  };
28
28
  config.snapshot = {
29
29
  ...(config.snapshot ?? {}),
30
- managedPaths: [/^(.+?[\\/]node_modules[\\/])(?!@graphcommerce)/],
30
+ managedPaths: [new RegExp(`^(.+?[\\/]node_modules[\\/])(?!${modules.join('|')})`)],
31
31
  };
32
32
  // `config.watchOptions.ignored = ['**/.git/**', '**/node_modules/**', '**/.next/**']
33
- // Replace the '**/node_modules/**' with a regex that excludes node_modules except @graphcommerce
34
33
  config.watchOptions = {
35
34
  ...(config.watchOptions ?? {}),
36
- ignored: ['**/.git/**', '**/node_modules/!(@graphcommerce)**', '**/.next/**'],
35
+ ignored: ['**/.git/**', `**/node_modules/!(${modules.join('|')})**`, '**/.next/**'],
36
+ };
37
+ if (!config.resolve)
38
+ config.resolve = {};
39
+ config.resolve.alias = {
40
+ ...config.resolve.alias,
41
+ '@mui/base': '@mui/base/modern',
42
+ '@mui/lab': '@mui/lab/modern',
43
+ '@mui/material': '@mui/material/modern',
44
+ '@mui/styled-engine': '@mui/styled-engine/modern',
45
+ '@mui/system': '@mui/system/modern',
37
46
  };
38
47
  return typeof nextConfig.webpack === 'function' ? nextConfig.webpack(config, options) : config;
39
48
  },
@@ -72,7 +81,7 @@ function withYarn1Scopes(scopes = ['@graphcommerce']) {
72
81
  (0, fs_1.mkdirSync)('.next/cache/', { recursive: true });
73
82
  (0, fs_1.writeFileSync)(cacheKey, JSON.stringify(modules));
74
83
  }
75
- return (config) => extendConfig((0, next_transpile_modules_1.default)(modules)(config));
84
+ return (config) => extendConfig((0, next_transpile_modules_1.default)(modules)(config), modules);
76
85
  }
77
86
  exports.withYarn1Scopes = withYarn1Scopes;
78
87
  function withYarn1Workspaces(modules = []) {
@@ -108,6 +117,6 @@ function withYarn1Workspaces(modules = []) {
108
117
  b.workspaceDependencies.forEach((wp) => m.add(wp));
109
118
  }
110
119
  });
111
- return (config) => extendConfig((0, next_transpile_modules_1.default)([...m.values()])(config));
120
+ return (config) => extendConfig((0, next_transpile_modules_1.default)([...m.values()])(config), [...m.values()]);
112
121
  }
113
122
  exports.withYarn1Workspaces = withYarn1Workspaces;
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@graphcommerce/next-config",
3
3
  "homepage": "https://www.graphcommerce.org/",
4
4
  "repository": "github:graphcommerce-org/graphcommerce",
5
- "version": "3.1.4",
5
+ "version": "3.2.0",
6
6
  "type": "commonjs",
7
7
  "main": "dist/index.js",
8
8
  "typings": "dist/index.d.ts",
@@ -13,17 +13,17 @@
13
13
  "prepack": "yarn build"
14
14
  },
15
15
  "dependencies": {
16
- "@lingui/loader": "^3.13.3",
16
+ "@lingui/loader": "^3.14.0",
17
17
  "js-yaml-loader": "^1.2.2",
18
18
  "next-transpile-modules": "^9.0.0",
19
- "webpack": "^5.72.0"
19
+ "webpack": "^5.73.0"
20
20
  },
21
21
  "devDependencies": {
22
22
  "type-fest": "^2.12.2",
23
- "typescript": "4.6.3"
23
+ "typescript": "4.7.4"
24
24
  },
25
25
  "peerDependencies": {
26
- "next": "12.1.2",
26
+ "next": "^12.1.2",
27
27
  "webpack": "^5.70.0"
28
28
  },
29
29
  "files": [
package/src/index.ts CHANGED
@@ -31,7 +31,7 @@ export type ListInfo = {
31
31
  }
32
32
  }
33
33
 
34
- function extendConfig(nextConfig: NextConfig): NextConfig {
34
+ function extendConfig(nextConfig: NextConfig, modules: string[]): NextConfig {
35
35
  return {
36
36
  ...nextConfig,
37
37
  webpack: (config: Configuration, options) => {
@@ -53,14 +53,23 @@ function extendConfig(nextConfig: NextConfig): NextConfig {
53
53
 
54
54
  config.snapshot = {
55
55
  ...(config.snapshot ?? {}),
56
- managedPaths: [/^(.+?[\\/]node_modules[\\/])(?!@graphcommerce)/],
56
+ managedPaths: [new RegExp(`^(.+?[\\/]node_modules[\\/])(?!${modules.join('|')})`)],
57
57
  }
58
58
 
59
59
  // `config.watchOptions.ignored = ['**/.git/**', '**/node_modules/**', '**/.next/**']
60
- // Replace the '**/node_modules/**' with a regex that excludes node_modules except @graphcommerce
61
60
  config.watchOptions = {
62
61
  ...(config.watchOptions ?? {}),
63
- ignored: ['**/.git/**', '**/node_modules/!(@graphcommerce)**', '**/.next/**'],
62
+ ignored: ['**/.git/**', `**/node_modules/!(${modules.join('|')})**`, '**/.next/**'],
63
+ }
64
+
65
+ if (!config.resolve) config.resolve = {}
66
+ config.resolve.alias = {
67
+ ...config.resolve.alias,
68
+ '@mui/base': '@mui/base/modern',
69
+ '@mui/lab': '@mui/lab/modern',
70
+ '@mui/material': '@mui/material/modern',
71
+ '@mui/styled-engine': '@mui/styled-engine/modern',
72
+ '@mui/system': '@mui/system/modern',
64
73
  }
65
74
 
66
75
  return typeof nextConfig.webpack === 'function' ? nextConfig.webpack(config, options) : config
@@ -109,7 +118,7 @@ export function withYarn1Scopes(
109
118
  writeFileSync(cacheKey, JSON.stringify(modules))
110
119
  }
111
120
 
112
- return (config) => extendConfig(withTranspileModules(modules)(config))
121
+ return (config) => extendConfig(withTranspileModules(modules)(config), modules)
113
122
  }
114
123
 
115
124
  export function withYarn1Workspaces(modules: string[] = []): (config: NextConfig) => NextConfig {
@@ -150,5 +159,5 @@ export function withYarn1Workspaces(modules: string[] = []): (config: NextConfig
150
159
  }
151
160
  })
152
161
 
153
- return (config) => extendConfig(withTranspileModules([...m.values()])(config))
162
+ return (config) => extendConfig(withTranspileModules([...m.values()])(config), [...m.values()])
154
163
  }
package/CHANGELOG.md DELETED
@@ -1,210 +0,0 @@
1
- # Change Log
2
-
3
- ## 3.1.4
4
-
5
- ### Patch Changes
6
-
7
- - [#1426](https://github.com/graphcommerce-org/graphcommerce/pull/1426) [`100f4c38c`](https://github.com/graphcommerce-org/graphcommerce/commit/100f4c38c8fcda4bc6e0425e38028b550b60adc2) Thanks [@paales](https://github.com/paales)! - Upgrade packages
8
-
9
- ## 3.1.3
10
-
11
- ### Patch Changes
12
-
13
- - [#1399](https://github.com/graphcommerce-org/graphcommerce/pull/1399) [`fb277d8e1`](https://github.com/graphcommerce-org/graphcommerce/commit/fb277d8e1e3612c5e9cf890a30d19cfd1ff70542) Thanks [@paales](https://github.com/paales)! - Now using [@graphql-yoga](https://github.com/dotansimha/graphql-yoga) for GraphQL which has full support for [envelop](https://www.envelop.dev/) plugins.
14
-
15
- * [#1399](https://github.com/graphcommerce-org/graphcommerce/pull/1399) [`fb277d8e1`](https://github.com/graphcommerce-org/graphcommerce/commit/fb277d8e1e3612c5e9cf890a30d19cfd1ff70542) Thanks [@paales](https://github.com/paales)! - Added a new @graphcommerce/cli package to generate the mesh so it can be generated _inside_ the @graphcommerce/graphql-mesh package to allow for better future extensibility.
16
-
17
- - [#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
18
-
19
- ## 3.1.2
20
-
21
- ### Patch Changes
22
-
23
- - [#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
24
-
25
- ## 3.1.1
26
-
27
- ### Patch Changes
28
-
29
- - [#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
30
-
31
- ## 3.1.0
32
-
33
- ### Minor Changes
34
-
35
- - [#1341](https://github.com/graphcommerce-org/graphcommerce/pull/1341) [`47a03c6c7`](https://github.com/graphcommerce-org/graphcommerce/commit/47a03c6c764cb1f544d3de3af52456608694a9d7) Thanks [@paales](https://github.com/paales)! - Files in node_modules/@graphcommerce will now also be watched and won’t be cached
36
-
37
- ### Patch Changes
38
-
39
- - [#1341](https://github.com/graphcommerce-org/graphcommerce/pull/1341) [`2e29c5852`](https://github.com/graphcommerce-org/graphcommerce/commit/2e29c585247d356e3027be92beb7815f2070c855) Thanks [@paales](https://github.com/paales)! - upgrade dependencies
40
-
41
- ## 3.0.4
42
-
43
- ### Patch Changes
44
-
45
- - [#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.
46
-
47
- * [#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
48
-
49
- ## 3.0.3
50
-
51
- ### Patch Changes
52
-
53
- - [`973ff8645`](https://github.com/ho-nl/m2-pwa/commit/973ff86452a70ade9f4db13fdda6e963d7220e96) Thanks [@paales](https://github.com/paales)! - made packages public
54
-
55
- * [#1278](https://github.com/ho-nl/m2-pwa/pull/1278) [`81ea406d5`](https://github.com/ho-nl/m2-pwa/commit/81ea406d54d6b5c662c030a7fea444abc4117a20) Thanks [@ErwinOtten](https://github.com/ErwinOtten)! - Upgraded dependencies to the latest version
56
-
57
- ## 3.0.2
58
-
59
- ### Patch Changes
60
-
61
- - [#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.
62
-
63
- * [#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.
64
-
65
- 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.
66
-
67
- ## 3.0.1
68
-
69
- ### Patch Changes
70
-
71
- - [`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
72
-
73
- ## 3.0.0
74
-
75
- ### Major Changes
76
-
77
- - [#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
78
-
79
- All notable changes to this project will be documented in this file. See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
80
-
81
- # [2.109.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-config@2.108.0...@graphcommerce/next-config@2.109.0) (2021-11-12)
82
-
83
- ### Features
84
-
85
- - added tons of translations ([9bb0ac7](https://github.com/ho-nl/m2-pwa/commit/9bb0ac709b58df6ea6141e92e4923a5ca9ae2963))
86
-
87
- # [2.108.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-config@2.107.3...@graphcommerce/next-config@2.108.0) (2021-11-09)
88
-
89
- ### Features
90
-
91
- - **next-config:** support for .po files to be imported ([79b64ce](https://github.com/ho-nl/m2-pwa/commit/79b64ce9b444fcf620279d9a8e5d253b8e9cfa84))
92
-
93
- # [2.107.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-config@2.106.1...@graphcommerce/next-config@2.107.0) (2021-10-27)
94
-
95
- ### Features
96
-
97
- - **nextjs:** upgraded to nextjs 12 ([9331bc8](https://github.com/ho-nl/m2-pwa/commit/9331bc801f6419522115cc47d291d49d608d5a90))
98
-
99
- # [2.106.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-config@2.105.1...@graphcommerce/next-config@2.106.0) (2021-10-20)
100
-
101
- ### Features
102
-
103
- - **next-config:** support topLevelAwait ([3cb4f90](https://github.com/ho-nl/m2-pwa/commit/3cb4f90ac3af797f5fcba888dfd28aa2b76480b8))
104
-
105
- ## [2.105.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-config@2.105.0...@graphcommerce/next-config@2.105.1) (2021-10-19)
106
-
107
- ### Bug Fixes
108
-
109
- - **next-config:** make sure webpack is available ([46edb3e](https://github.com/ho-nl/m2-pwa/commit/46edb3e6fd1b716d7d9dbe59cb1530375d24c228))
110
-
111
- # [2.105.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-config@2.104.7...@graphcommerce/next-config@2.105.0) (2021-10-19)
112
-
113
- ### Bug Fixes
114
-
115
- - **next-config:** move the @apollo/client **DEV** env to next-config ([fb1df3f](https://github.com/ho-nl/m2-pwa/commit/fb1df3fe4edbf769afb4149c7beced70bb948be5))
116
-
117
- ### Features
118
-
119
- - **mesh:** move to a default .meshrc.yml format instead of the json file ([d9a30a7](https://github.com/ho-nl/m2-pwa/commit/d9a30a78baed2b85b77bbd80e94a6f047e2255b6))
120
-
121
- ## [2.104.4](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-config@2.104.3...@graphcommerce/next-config@2.104.4) (2021-10-07)
122
-
123
- ### Bug Fixes
124
-
125
- - replace **DEV** with proper variable for optimizing the bundle size ([9b03209](https://github.com/ho-nl/m2-pwa/commit/9b032095f618846d132c00b8dc14fbb1b09c6ed8))
126
-
127
- ## [2.104.3](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-config@2.104.2...@graphcommerce/next-config@2.104.3) (2021-09-30)
128
-
129
- ### Bug Fixes
130
-
131
- - .next folder doesn't always exist on vercel ([5f8f1a7](https://github.com/ho-nl/m2-pwa/commit/5f8f1a7c2c6690be113adfe2fef662c63781e91f))
132
-
133
- ## [2.104.2](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-config@2.104.1...@graphcommerce/next-config@2.104.2) (2021-09-29)
134
-
135
- ### Bug Fixes
136
-
137
- - cache dependencylist ([257da86](https://github.com/ho-nl/m2-pwa/commit/257da860c22a7134896e99e2fcf9f67c0ce99363))
138
-
139
- ## [2.104.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-config@2.104.0...@graphcommerce/next-config@2.104.1) (2021-09-28)
140
-
141
- ### Bug Fixes
142
-
143
- - do not build on install ([254e2a6](https://github.com/ho-nl/m2-pwa/commit/254e2a6f4b2a7e81f46466a0abe06ae2f3a79575))
144
-
145
- # [2.104.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-config@2.103.0...@graphcommerce/next-config@2.104.0) (2021-09-28)
146
-
147
- ### Features
148
-
149
- - created withYarn1Scopes functionality so we don't rely on actual workspaces ([7e491ca](https://github.com/ho-nl/m2-pwa/commit/7e491ca2276028a8587f6cd88b98ee451755c3d0))
150
-
151
- # [2.103.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-config@2.102.3...@graphcommerce/next-config@2.103.0) (2021-09-28)
152
-
153
- ### Bug Fixes
154
-
155
- - withYarn1Workspaces is not a function ([a095bc9](https://github.com/ho-nl/m2-pwa/commit/a095bc9f0011fbe9180d0e1718f1b41e89a5f6d9))
156
-
157
- ### Features
158
-
159
- - add postinstall commands to run properly on deploy ([d512ee3](https://github.com/ho-nl/m2-pwa/commit/d512ee3ba5c3a9573651ec5333595fe2f1aa141c))
160
-
161
- ## [2.102.3](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-config@2.102.2...@graphcommerce/next-config@2.102.3) (2021-09-27)
162
-
163
- ### Bug Fixes
164
-
165
- - build packages before releasing ([c4761cf](https://github.com/ho-nl/m2-pwa/commit/c4761cf6d1810c140fd56f6eac8fca922f8c0edc))
166
-
167
- ## [2.102.2](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-config@2.102.0...@graphcommerce/next-config@2.102.2) (2021-09-27)
168
-
169
- ### Bug Fixes
170
-
171
- - add warnings to next.config.js when .env variables are missing ([d9dffec](https://github.com/ho-nl/m2-pwa/commit/d9dffec8ebc9cb1c70ca5591cad5e42c9bbe30e6))
172
-
173
- ## [2.102.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-config@2.102.0...@graphcommerce/next-config@2.102.1) (2021-09-27)
174
-
175
- **Note:** Version bump only for package @graphcommerce/next-config
176
-
177
- # 2.102.0 (2021-09-27)
178
-
179
- ### Bug Fixes
180
-
181
- - ignore md files from triggering version updates ([4f98392](https://github.com/ho-nl/m2-pwa/commit/4f9839250b3a32d3070da5290e5efcc5e2243fba))
182
- - **next-config:** another shot at fixing next-config ([a4afe11](https://github.com/ho-nl/m2-pwa/commit/a4afe112aa1308c10bb407d5e3eebf1f239d789c))
183
- - **next-config:** automatically resolve the workspace dependencies ([4d739ec](https://github.com/ho-nl/m2-pwa/commit/4d739ec969591f96392f99e476016c6ad1d092cb))
184
- - playwright can't find the place order button ([b1fda5b](https://github.com/ho-nl/m2-pwa/commit/b1fda5b3e403dad621aba8ed895427f2166bc985))
185
-
186
- ### Features
187
-
188
- - **framer-sheet:** created separate package that can be implemented ([69cc8ce](https://github.com/ho-nl/m2-pwa/commit/69cc8ce3237125335524728a70f4dae050032108))
189
- - **next-config:** introduced package to streamline the setup of new examples ([b8a3958](https://github.com/ho-nl/m2-pwa/commit/b8a39584e5b529fcaa22db67d3f986b91ae683ad))
190
- - next.js 11 ([7d61407](https://github.com/ho-nl/m2-pwa/commit/7d614075a778f488045034f74be4f75b93f63c43))
191
- - 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))
192
- - upgraded to nextjs 11 ([0053beb](https://github.com/ho-nl/m2-pwa/commit/0053beb7ef597c190add7264256a0eaec35868da))
193
-
194
- ## [2.101.1](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-config@2.101.0...@graphcommerce/next-config@2.101.1) (2021-09-01)
195
-
196
- ### Bug Fixes
197
-
198
- - playwright can't find the place order button ([b1fda5b](https://github.com/ho-nl/m2-pwa/commit/b1fda5b3e403dad621aba8ed895427f2166bc985))
199
-
200
- # [2.101.0](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-config@2.100.10...@graphcommerce/next-config@2.101.0) (2021-08-12)
201
-
202
- ### Features
203
-
204
- - upgraded to nextjs 11 ([0053beb](https://github.com/ho-nl/m2-pwa/commit/0053beb7ef597c190add7264256a0eaec35868da))
205
-
206
- ## [2.100.10](https://github.com/ho-nl/m2-pwa/compare/@graphcommerce/next-config@2.100.9...@graphcommerce/next-config@2.100.10) (2021-08-09)
207
-
208
- ### Bug Fixes
209
-
210
- - ignore md files from triggering version updates ([4f98392](https://github.com/ho-nl/m2-pwa/commit/4f9839250b3a32d3070da5290e5efcc5e2243fba))