@graphcommerce/next-config 9.0.4-canary.0 → 9.0.4-canary.10

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.
Files changed (61) hide show
  1. package/CHANGELOG.md +28 -8
  2. package/__tests__/commands/copyFiles.ts +8 -5
  3. package/__tests__/config/utils/__snapshots__/mergeEnvIntoConfig.ts.snap +0 -905
  4. package/__tests__/config/utils/mergeEnvIntoConfig.ts +21 -3
  5. package/__tests__/config/utils/replaceConfigInString.ts +0 -1
  6. package/__tests__/interceptors/findPlugins.ts +270 -272
  7. package/__tests__/interceptors/generateInterceptors.ts +1 -0
  8. package/__tests__/utils/resolveDependenciesSync.ts +45 -44
  9. package/dist/generated/config.js +110 -116
  10. package/dist/index.js +3359 -26
  11. package/package.json +34 -8
  12. package/src/commands/codegen.ts +3 -3
  13. package/src/commands/copyFiles.ts +14 -7
  14. package/src/config/commands/generateConfig.ts +17 -6
  15. package/src/config/demoConfig.ts +0 -1
  16. package/src/config/loadConfig.ts +3 -9
  17. package/src/config/utils/mergeEnvIntoConfig.ts +9 -9
  18. package/src/generated/config.ts +305 -245
  19. package/src/interceptors/Visitor.ts +1 -1
  20. package/src/interceptors/findOriginalSource.ts +1 -1
  21. package/src/interceptors/generateInterceptor.ts +0 -2
  22. package/src/interceptors/parseStructure.ts +3 -3
  23. package/src/interceptors/writeInterceptors.ts +1 -1
  24. package/src/utils/resolveDependenciesSync.ts +44 -7
  25. package/src/withGraphCommerce.ts +30 -42
  26. package/tsconfig.json +1 -1
  27. package/__tests__/config/utils/rewriteLegancyEnv.ts +0 -78
  28. package/dist/commands/codegen.js +0 -18
  29. package/dist/commands/copyFiles.js +0 -292
  30. package/dist/config/commands/exportConfig.js +0 -16
  31. package/dist/config/commands/generateConfig.js +0 -57
  32. package/dist/config/demoConfig.js +0 -52
  33. package/dist/config/index.js +0 -19
  34. package/dist/config/loadConfig.js +0 -62
  35. package/dist/config/utils/configToImportMeta.js +0 -39
  36. package/dist/config/utils/diff.js +0 -33
  37. package/dist/config/utils/exportConfigToEnv.js +0 -31
  38. package/dist/config/utils/mergeEnvIntoConfig.js +0 -184
  39. package/dist/config/utils/replaceConfigInString.js +0 -12
  40. package/dist/config/utils/rewriteLegacyEnv.js +0 -115
  41. package/dist/interceptors/InterceptorPlugin.js +0 -108
  42. package/dist/interceptors/RenameVisitor.js +0 -19
  43. package/dist/interceptors/Visitor.js +0 -1414
  44. package/dist/interceptors/commands/codegenInterceptors.js +0 -22
  45. package/dist/interceptors/extractExports.js +0 -159
  46. package/dist/interceptors/findOriginalSource.js +0 -103
  47. package/dist/interceptors/findPlugins.js +0 -68
  48. package/dist/interceptors/generateInterceptor.js +0 -219
  49. package/dist/interceptors/generateInterceptors.js +0 -56
  50. package/dist/interceptors/parseStructure.js +0 -84
  51. package/dist/interceptors/swc.js +0 -15
  52. package/dist/interceptors/writeInterceptors.js +0 -44
  53. package/dist/utils/PackagesSort.js +0 -7
  54. package/dist/utils/TopologicalSort.js +0 -87
  55. package/dist/utils/isMonorepo.js +0 -47
  56. package/dist/utils/packageRoots.js +0 -31
  57. package/dist/utils/resolveDependenciesSync.js +0 -78
  58. package/dist/utils/resolveDependency.js +0 -70
  59. package/dist/utils/sig.js +0 -34
  60. package/dist/withGraphCommerce.js +0 -162
  61. package/src/config/utils/rewriteLegacyEnv.ts +0 -125
package/CHANGELOG.md CHANGED
@@ -1,22 +1,42 @@
1
1
  # Change Log
2
2
 
3
- ## 9.0.4-canary.0
3
+ ## 9.0.4-canary.10
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - [#2472](https://github.com/graphcommerce-org/graphcommerce/pull/2472) [`905157b`](https://github.com/graphcommerce-org/graphcommerce/commit/905157bec2c9e1dcf51b6e6f7b6913aa9be7b609) - Solve issue with chalk compilation because we’re not migrated to esm modules. ([@paales](https://github.com/paales))
7
+ - [#2487](https://github.com/graphcommerce-org/graphcommerce/pull/2487) [`8b25322`](https://github.com/graphcommerce-org/graphcommerce/commit/8b253224997b59ac74d72813214dfc224f526c0a) - 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 ([@paales](https://github.com/paales))
8
+
9
+ - [#2487](https://github.com/graphcommerce-org/graphcommerce/pull/2487) [`2c79a4c`](https://github.com/graphcommerce-org/graphcommerce/commit/2c79a4cba2779bc367104ebb13e6c0d6feb6574f) - Remove redirects for `/product/$type/[url]` routes, those haven't been used for years anymore. ([@paales](https://github.com/paales))
10
+
11
+ - [#2487](https://github.com/graphcommerce-org/graphcommerce/pull/2487) [`30b7356`](https://github.com/graphcommerce-org/graphcommerce/commit/30b7356790efbac0f0017ef61cb1619b920100ab) - Solve issue where withGraphCommerce had a hard dependency on Magento specific configurations ([@paales](https://github.com/paales))
12
+
13
+ - [#2487](https://github.com/graphcommerce-org/graphcommerce/pull/2487) [`9825f59`](https://github.com/graphcommerce-org/graphcommerce/commit/9825f59b8626c315e6092950faceeab4311a5424) - Remove rewriteLegacyEnv as that hasn't been used for years ([@paales](https://github.com/paales))
14
+
15
+ - [#2487](https://github.com/graphcommerce-org/graphcommerce/pull/2487) [`5ffa0ee`](https://github.com/graphcommerce-org/graphcommerce/commit/5ffa0ee1d620f4f1c38bc5df36cbd527bcc43cf9) - Migrated `@graphcommerce/next-config` package to `"type": "module"` ([@paales](https://github.com/paales))
16
+
17
+ ## 9.0.4-canary.9
18
+
19
+ ## 9.0.4-canary.8
8
20
 
9
- ## 9.0.3
21
+ ## 9.0.4-canary.7
10
22
 
11
- ## 9.0.3-canary.0
23
+ ## 9.0.4-canary.6
12
24
 
13
- ## 9.0.2
25
+ ## 9.0.4-canary.5
14
26
 
15
- ## 9.0.2-canary.0
27
+ ## 9.0.4-canary.4
16
28
 
17
- ## 9.0.1
29
+ ## 9.0.4-canary.3
18
30
 
19
- ## 9.0.1-canary.1
31
+ ## 9.0.4-canary.2
32
+
33
+ ## 9.0.4-canary.1
34
+
35
+ ## 9.0.4-canary.0
36
+
37
+ ### Patch Changes
38
+
39
+ - [#2472](https://github.com/graphcommerce-org/graphcommerce/pull/2472) [`905157b`](https://github.com/graphcommerce-org/graphcommerce/commit/905157bec2c9e1dcf51b6e6f7b6913aa9be7b609) - Solve issue with chalk compilation because we’re not migrated to esm modules. ([@paales](https://github.com/paales))
20
40
 
21
41
  ## 9.0.0
22
42
 
@@ -31,6 +31,7 @@ global.performance = { now: mockPerformanceNow } as unknown as typeof performanc
31
31
 
32
32
  // Mock process.cwd
33
33
  const mockCwd = '/mock/cwd'
34
+ // eslint-disable-next-line @typescript-eslint/unbound-method
34
35
  const originalCwd = process.cwd
35
36
  beforeAll(() => {
36
37
  process.cwd = jest.fn().mockReturnValue(mockCwd)
@@ -42,6 +43,7 @@ afterAll(() => {
42
43
 
43
44
  describe('copyFiles', () => {
44
45
  let consoleLog: jest.SpyInstance
46
+ let consoleInfo: jest.SpyInstance
45
47
  let consoleError: jest.SpyInstance
46
48
  let processExit: jest.SpyInstance
47
49
  let originalDebug: string | undefined
@@ -57,6 +59,7 @@ describe('copyFiles', () => {
57
59
  ]),
58
60
  )
59
61
  consoleLog = jest.spyOn(console, 'log').mockImplementation(() => {})
62
+ consoleInfo = jest.spyOn(console, 'info').mockImplementation(() => {})
60
63
  consoleError = jest.spyOn(console, 'error').mockImplementation(() => {})
61
64
  processExit = jest.spyOn(process, 'exit').mockImplementation(() => undefined as never)
62
65
 
@@ -205,7 +208,7 @@ describe('copyFiles', () => {
205
208
  expect(writeCall).toBeTruthy()
206
209
  const content = writeCall[1].toString()
207
210
  expect(content).toContain('new content')
208
- expect(consoleLog).toHaveBeenCalledWith('Updated managed file: file.ts')
211
+ expect(consoleInfo).toHaveBeenCalledWith('Updated managed file: file.ts')
209
212
  })
210
213
 
211
214
  it('should create new files with management comments', async () => {
@@ -227,7 +230,7 @@ describe('copyFiles', () => {
227
230
 
228
231
  await copyFiles()
229
232
 
230
- expect(consoleLog).toHaveBeenCalledWith(
233
+ expect(consoleInfo).toHaveBeenCalledWith(
231
234
  'Creating new file: new-file.ts\nSource: packages/package1/copy/new-file.ts',
232
235
  )
233
236
  expect(fs.writeFile).toHaveBeenCalledWith(path.join(mockCwd, 'new-file.ts'), expect.any(Buffer))
@@ -374,8 +377,8 @@ describe('copyFiles', () => {
374
377
 
375
378
  await copyFiles()
376
379
 
377
- expect(consoleLog).toHaveBeenCalledWith('[copy-files]', 'Starting copyFiles')
378
- expect(consoleLog).toHaveBeenCalledWith('[copy-files]', expect.stringContaining('Found'))
380
+ expect(consoleInfo).toHaveBeenCalledWith('[copy-files]', 'Starting copyFiles')
381
+ expect(consoleInfo).toHaveBeenCalledWith('[copy-files]', expect.stringContaining('Found'))
379
382
  })
380
383
 
381
384
  it('should handle unmanaged files', async () => {
@@ -397,7 +400,7 @@ describe('copyFiles', () => {
397
400
 
398
401
  await copyFiles()
399
402
 
400
- expect(consoleLog).toHaveBeenCalledWith(
403
+ expect(consoleInfo).toHaveBeenCalledWith(
401
404
  expect.stringContaining('Note: File file.ts has been modified'),
402
405
  )
403
406
  })