@nx/next 19.6.0-beta.4 → 19.6.0-beta.6

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 (2) hide show
  1. package/babel.js +27 -0
  2. package/package.json +9 -9
package/babel.js CHANGED
@@ -3,6 +3,33 @@
3
3
  */
4
4
  module.exports = function (api, options) {
5
5
  api.assertVersion(7);
6
+ // When running from Jest with babel-jest, remove @babel/plugin-syntax-import-assertions since babel-jest-preset
7
+ // comes with @babel/plugin-syntax-import-attributes. These plugins are incompatible. If we don't remove the
8
+ // conflicting plugin from `next/babel`, then an error will be thrown.
9
+ // e.g. "Cannot combine importAssertions and importAttributes plugins"
10
+ // NOTE: We don't want to do this outside of Jest since it may affect `next build`--although the default is SWC anyway.
11
+ if (process.env.JEST_WORKER_ID) {
12
+ const nextBabel = require('next/babel').default;
13
+ const { presets: nextBabelPresets, plugins: nextBabelPlugins, ...rest } = nextBabel(api, options);
14
+ api.assertVersion(7);
15
+ try {
16
+ const conflictingPlugin = require('next/dist/compiled/babel/plugin-syntax-import-assertions').default;
17
+ return {
18
+ ...rest,
19
+ presets: nextBabelPresets,
20
+ plugins: [
21
+ ...nextBabelPlugins.filter((p) => p.default !== conflictingPlugin),
22
+ [
23
+ require.resolve('@babel/plugin-proposal-decorators'),
24
+ { legacy: true },
25
+ ],
26
+ ],
27
+ };
28
+ }
29
+ catch {
30
+ // If this plugin cannot be import, continue as usual. It could be removed in future versions of Next.js.
31
+ }
32
+ }
6
33
  return {
7
34
  presets: [['next/babel', options]],
8
35
  plugins: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/next",
3
- "version": "19.6.0-beta.4",
3
+ "version": "19.6.0-beta.6",
4
4
  "private": false,
5
5
  "description": "The Next.js plugin for Nx contains executors and generators for managing Next.js applications and libraries within an Nx workspace. It provides:\n\n\n- Scaffolding for creating, building, serving, linting, and testing Next.js applications.\n\n- Integration with building, serving, and exporting a Next.js application.\n\n- Integration with React libraries within the workspace. \n\nWhen using Next.js in Nx, you get the out-of-the-box support for TypeScript, Playwright, Cypress, and Jest. No need to configure anything: watch mode, source maps, and typings just work.",
6
6
  "repository": {
@@ -35,7 +35,7 @@
35
35
  "next": ">=14.0.0"
36
36
  },
37
37
  "dependencies": {
38
- "@nx/devkit": "19.6.0-beta.4",
38
+ "@nx/devkit": "19.6.0-beta.6",
39
39
  "@babel/plugin-proposal-decorators": "^7.22.7",
40
40
  "@svgr/webpack": "^8.0.1",
41
41
  "chalk": "^4.1.0",
@@ -46,14 +46,14 @@
46
46
  "semver": "^7.5.3",
47
47
  "tslib": "^2.3.0",
48
48
  "webpack-merge": "^5.8.0",
49
- "@nx/js": "19.6.0-beta.4",
50
- "@nx/eslint": "19.6.0-beta.4",
51
- "@nx/react": "19.6.0-beta.4",
52
- "@nx/web": "19.6.0-beta.4",
53
- "@nx/webpack": "19.6.0-beta.4",
54
- "@nx/workspace": "19.6.0-beta.4",
49
+ "@nx/js": "19.6.0-beta.6",
50
+ "@nx/eslint": "19.6.0-beta.6",
51
+ "@nx/react": "19.6.0-beta.6",
52
+ "@nx/web": "19.6.0-beta.6",
53
+ "@nx/webpack": "19.6.0-beta.6",
54
+ "@nx/workspace": "19.6.0-beta.6",
55
55
  "@phenomnomnominal/tsquery": "~5.0.1",
56
- "@nrwl/next": "19.6.0-beta.4"
56
+ "@nrwl/next": "19.6.0-beta.6"
57
57
  },
58
58
  "publishConfig": {
59
59
  "access": "public"