@nrwl/next 14.7.13 → 14.7.14
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/CHANGELOG.md +1 -1
- package/package.json +10 -9
- package/plugins/with-nx.d.ts +16 -3
- package/plugins/with-nx.js +15 -5
- package/plugins/with-nx.js.map +1 -1
- package/src/executors/build/lib/create-next-config-file.d.ts +2 -2
- package/src/executors/build/lib/create-next-config-file.js +35 -1
- package/src/executors/build/lib/create-next-config-file.js.map +1 -1
- package/src/executors/build/lib/create-package-json.js +4 -8
- package/src/executors/build/lib/create-package-json.js.map +1 -1
- package/src/executors/build/schema.json +5 -0
- package/src/utils/types.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## [14.7.
|
|
6
|
+
## [14.7.14](https://github.com/nrwl/nx/compare/14.7.13...14.7.14) (2022-09-27)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @nrwl/next
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nrwl/next",
|
|
3
|
-
"version": "14.7.
|
|
3
|
+
"version": "14.7.14",
|
|
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, Cypress, and Jest. No need to configure anything: watch mode, source maps, and typings just work.",
|
|
6
6
|
"repository": {
|
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@babel/plugin-proposal-decorators": "^7.14.5",
|
|
38
|
-
"@nrwl/cypress": "14.7.
|
|
39
|
-
"@nrwl/devkit": "14.7.
|
|
40
|
-
"@nrwl/jest": "14.7.
|
|
41
|
-
"@nrwl/linter": "14.7.
|
|
42
|
-
"@nrwl/react": "14.7.
|
|
43
|
-
"@nrwl/webpack": "14.7.
|
|
44
|
-
"@nrwl/workspace": "14.7.
|
|
38
|
+
"@nrwl/cypress": "14.7.14",
|
|
39
|
+
"@nrwl/devkit": "14.7.14",
|
|
40
|
+
"@nrwl/jest": "14.7.14",
|
|
41
|
+
"@nrwl/linter": "14.7.14",
|
|
42
|
+
"@nrwl/react": "14.7.14",
|
|
43
|
+
"@nrwl/webpack": "14.7.14",
|
|
44
|
+
"@nrwl/workspace": "14.7.14",
|
|
45
45
|
"@svgr/webpack": "^6.1.2",
|
|
46
46
|
"chalk": "4.1.0",
|
|
47
47
|
"dotenv": "~10.0.0",
|
|
@@ -56,5 +56,6 @@
|
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
|
-
"
|
|
59
|
+
"types": "./index.d.ts",
|
|
60
|
+
"gitHead": "c3ed287452858f8ed3d00ee673dfca8835adca2b"
|
|
60
61
|
}
|
package/plugins/with-nx.d.ts
CHANGED
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
import type { NextConfig } from 'next';
|
|
2
|
-
import type { WebpackConfigOptions } from '../src/utils/types';
|
|
3
2
|
export interface WithNxOptions extends NextConfig {
|
|
4
|
-
nx?:
|
|
3
|
+
nx?: {
|
|
4
|
+
svgr?: boolean;
|
|
5
|
+
};
|
|
6
|
+
}
|
|
7
|
+
export interface WithNxContext {
|
|
8
|
+
workspaceRoot: string;
|
|
9
|
+
libsDir: string;
|
|
5
10
|
}
|
|
6
|
-
export declare function withNx(nextConfig?: WithNxOptions): {
|
|
11
|
+
export declare function withNx(nextConfig?: WithNxOptions, context?: WithNxContext): {
|
|
7
12
|
webpack: (config: any, options: any) => any;
|
|
13
|
+
exportPathMap?: (defaultMap: import("next/dist/server/config-shared").ExportPathMap, ctx: {
|
|
14
|
+
dev: boolean;
|
|
15
|
+
dir: string;
|
|
16
|
+
outDir: string;
|
|
17
|
+
distDir: string;
|
|
18
|
+
buildId: string;
|
|
19
|
+
}) => import("next/dist/server/config-shared").ExportPathMap | Promise<import("next/dist/server/config-shared").ExportPathMap>;
|
|
8
20
|
i18n?: import("next/dist/server/config-shared").I18NConfig;
|
|
9
21
|
eslint: import("next/dist/server/config-shared").ESLintConfig;
|
|
10
22
|
typescript?: import("next/dist/server/config-shared").TypeScriptConfig;
|
|
@@ -27,6 +39,7 @@ export declare function withNx(nextConfig?: WithNxOptions): {
|
|
|
27
39
|
generateEtags?: boolean;
|
|
28
40
|
pageExtensions?: string[];
|
|
29
41
|
compress?: boolean;
|
|
42
|
+
analyticsId?: string;
|
|
30
43
|
poweredByHeader?: boolean;
|
|
31
44
|
images?: Partial<import("next/dist/shared/lib/image-config").ImageConfigComplete>;
|
|
32
45
|
devIndicators?: {
|
package/plugins/with-nx.js
CHANGED
|
@@ -2,9 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.withNx = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const { join } = require('path');
|
|
6
|
-
const { workspaceRoot } = require('@nrwl/devkit');
|
|
7
|
-
const { workspaceLayout } = require('@nrwl/devkit');
|
|
8
5
|
function regexEqual(x, y) {
|
|
9
6
|
return (x instanceof RegExp &&
|
|
10
7
|
y instanceof RegExp &&
|
|
@@ -13,7 +10,18 @@ function regexEqual(x, y) {
|
|
|
13
10
|
x.ignoreCase === y.ignoreCase &&
|
|
14
11
|
x.multiline === y.multiline);
|
|
15
12
|
}
|
|
16
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Do not remove or rename this function. Production builds inline `with-nx.js` file with a replacement
|
|
15
|
+
* To this function that hard-codes the libsDir.
|
|
16
|
+
*/
|
|
17
|
+
function getWithNxContext() {
|
|
18
|
+
const { workspaceRoot, workspaceLayout } = require('@nrwl/devkit');
|
|
19
|
+
return {
|
|
20
|
+
workspaceRoot,
|
|
21
|
+
libsDir: workspaceLayout().libsDir,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function withNx(nextConfig = {}, context = getWithNxContext()) {
|
|
17
25
|
var _a;
|
|
18
26
|
const userWebpack = nextConfig.webpack || ((x) => x);
|
|
19
27
|
const { nx } = nextConfig, validNextConfig = tslib_1.__rest(nextConfig, ["nx"]);
|
|
@@ -29,7 +37,9 @@ function withNx(nextConfig = {}) {
|
|
|
29
37
|
* Note: This would be easier if Next.js exposes css-loader and sass-loader on `defaultLoaders`.
|
|
30
38
|
*/
|
|
31
39
|
// Include workspace libs in css/sass loaders
|
|
32
|
-
const includes = [
|
|
40
|
+
const includes = [
|
|
41
|
+
require('path').join(context.workspaceRoot, context.libsDir),
|
|
42
|
+
];
|
|
33
43
|
const nextCssLoaders = config.module.rules.find((rule) => typeof rule.oneOf === 'object');
|
|
34
44
|
// webpack config is not as expected
|
|
35
45
|
if (!nextCssLoaders)
|
package/plugins/with-nx.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"with-nx.js","sourceRoot":"","sources":["../../../../packages/next/plugins/with-nx.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"with-nx.js","sourceRoot":"","sources":["../../../../packages/next/plugins/with-nx.ts"],"names":[],"mappings":";;;;AAaA,SAAS,UAAU,CAAC,CAAC,EAAE,CAAC;IACtB,OAAO,CACL,CAAC,YAAY,MAAM;QACnB,CAAC,YAAY,MAAM;QACnB,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QACrB,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC,MAAM;QACrB,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU;QAC7B,CAAC,CAAC,SAAS,KAAK,CAAC,CAAC,SAAS,CAC5B,CAAC;A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,IAAI,KAAK,GAAG,CAAC,CAAC;aAC7D,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC,iBAAiB,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;aACxD,OAAO,CACN,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,CAAC,iBAAiB,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CACjE,CAAC;KACL;AACH,CAAC;AAED,4FAA4F;AAC5F,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC;AACxB,uEAAuE;AACvE,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { ExecutorContext } from '@nrwl/devkit';
|
|
2
|
-
import { NextBuildBuilderOptions } from '../../../utils/types';
|
|
1
|
+
import type { ExecutorContext } from '@nrwl/devkit';
|
|
2
|
+
import type { NextBuildBuilderOptions } from '../../../utils/types';
|
|
3
3
|
export declare function createNextConfigFile(options: NextBuildBuilderOptions, context: ExecutorContext): void;
|
|
@@ -1,15 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createNextConfigFile = void 0;
|
|
4
|
+
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
+
const ts = require("typescript");
|
|
4
6
|
const fs_1 = require("fs");
|
|
5
7
|
const path_1 = require("path");
|
|
8
|
+
const typescript_1 = require("@nrwl/workspace/src/utilities/typescript");
|
|
6
9
|
function createNextConfigFile(options, context) {
|
|
7
10
|
const nextConfigPath = options.nextConfig
|
|
8
11
|
? (0, path_1.join)(context.root, options.nextConfig)
|
|
9
12
|
: (0, path_1.join)(context.root, options.root, 'next.config.js');
|
|
13
|
+
// Copy config file and our `with-nx.js` file to remove dependency on @nrwl/next for production build.
|
|
10
14
|
if ((0, fs_1.existsSync)(nextConfigPath)) {
|
|
11
|
-
(0, fs_1.
|
|
15
|
+
(0, fs_1.writeFileSync)((0, path_1.join)(options.outputPath, 'with-nx.js'), getWithNxContent());
|
|
16
|
+
(0, fs_1.writeFileSync)((0, path_1.join)(options.outputPath, 'next.config.js'), (0, fs_1.readFileSync)(nextConfigPath)
|
|
17
|
+
.toString()
|
|
18
|
+
.replace('@nrwl/next/plugins/with-nx', './with-nx.js'));
|
|
12
19
|
}
|
|
13
20
|
}
|
|
14
21
|
exports.createNextConfigFile = createNextConfigFile;
|
|
22
|
+
function getWithNxContent() {
|
|
23
|
+
var _a;
|
|
24
|
+
const withNxFile = (0, path_1.join)(__dirname, '../../../../plugins/with-nx.js');
|
|
25
|
+
let withNxContent = (0, fs_1.readFileSync)(withNxFile).toString();
|
|
26
|
+
const withNxSource = ts.createSourceFile(withNxFile, withNxContent, ts.ScriptTarget.Latest, true);
|
|
27
|
+
const getWithNxContextDeclaration = (_a = (0, typescript_1.findNodes)(withNxSource, ts.SyntaxKind.FunctionDeclaration)) === null || _a === void 0 ? void 0 : _a.find((node) => { var _a; return ((_a = node.name) === null || _a === void 0 ? void 0 : _a.text) === 'getWithNxContext'; });
|
|
28
|
+
if (getWithNxContextDeclaration) {
|
|
29
|
+
withNxContent = (0, devkit_1.applyChangesToString)(withNxContent, [
|
|
30
|
+
{
|
|
31
|
+
type: devkit_1.ChangeType.Delete,
|
|
32
|
+
start: getWithNxContextDeclaration.getStart(withNxSource),
|
|
33
|
+
length: getWithNxContextDeclaration.getWidth(withNxSource),
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
type: devkit_1.ChangeType.Insert,
|
|
37
|
+
index: getWithNxContextDeclaration.getStart(withNxSource),
|
|
38
|
+
text: (0, devkit_1.stripIndents) `function getWithNxContext() {
|
|
39
|
+
return {
|
|
40
|
+
workspaceRoot: '${devkit_1.workspaceRoot}',
|
|
41
|
+
libsDir: '${(0, devkit_1.workspaceLayout)().libsDir}'
|
|
42
|
+
}
|
|
43
|
+
}`,
|
|
44
|
+
},
|
|
45
|
+
]);
|
|
46
|
+
}
|
|
47
|
+
return withNxContent;
|
|
48
|
+
}
|
|
15
49
|
//# sourceMappingURL=create-next-config-file.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-next-config-file.js","sourceRoot":"","sources":["../../../../../../../packages/next/src/executors/build/lib/create-next-config-file.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"create-next-config-file.js","sourceRoot":"","sources":["../../../../../../../packages/next/src/executors/build/lib/create-next-config-file.ts"],"names":[],"mappings":";;;AACA,yCAMsB;AACtB,iCAAiC;AACjC,2BAA6D;AAC7D,+BAA4B;AAG5B,yEAAqE;AAErE,SAAgB,oBAAoB,CAClC,OAAgC,EAChC,OAAwB;IAExB,MAAM,cAAc,GAAG,OAAO,CAAC,UAAU;QACvC,CAAC,CAAC,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC;QACxC,CAAC,CAAC,IAAA,WAAI,EAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,gBAAgB,CAAC,CAAC;IAEvD,sGAAsG;IACtG,IAAI,IAAA,eAAU,EAAC,cAAc,CAAC,EAAE;QAC9B,IAAA,kBAAa,EAAC,IAAA,WAAI,EAAC,OAAO,CAAC,UAAU,EAAE,YAAY,CAAC,EAAE,gBAAgB,EAAE,CAAC,CAAC;QAC1E,IAAA,kBAAa,EACX,IAAA,WAAI,EAAC,OAAO,CAAC,UAAU,EAAE,gBAAgB,CAAC,EAC1C,IAAA,iBAAY,EAAC,cAAc,CAAC;aACzB,QAAQ,EAAE;aACV,OAAO,CAAC,4BAA4B,EAAE,cAAc,CAAC,CACzD,CAAC;KACH;AACH,CAAC;AAlBD,oDAkBC;AAED,SAAS,gBAAgB;;IACvB,MAAM,UAAU,GAAG,IAAA,WAAI,EAAC,SAAS,EAAE,gCAAgC,CAAC,CAAC;IACrE,IAAI,aAAa,GAAG,IAAA,iBAAY,EAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC;IACxD,MAAM,YAAY,GAAG,EAAE,CAAC,gBAAgB,CACtC,UAAU,EACV,aAAa,EACb,EAAE,CAAC,YAAY,CAAC,MAAM,EACtB,IAAI,CACL,CAAC;IACF,MAAM,2BAA2B,GAAG,MAAA,IAAA,sBAAS,EAC3C,YAAY,EACZ,EAAE,CAAC,UAAU,CAAC,mBAAmB,CAClC,0CAAE,IAAI,CACL,CAAC,IAA4B,EAAE,EAAE,WAAC,OAAA,CAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,IAAI,MAAK,kBAAkB,CAAA,EAAA,CACzE,CAAC;IAEF,IAAI,2BAA2B,EAAE;QAC/B,aAAa,GAAG,IAAA,6BAAoB,EAAC,aAAa,EAAE;YAClD;gBACE,IAAI,EAAE,mBAAU,CAAC,MAAM;gBACvB,KAAK,EAAE,2BAA2B,CAAC,QAAQ,CAAC,YAAY,CAAC;gBACzD,MAAM,EAAE,2BAA2B,CAAC,QAAQ,CAAC,YAAY,CAAC;aAC3D;YACD;gBACE,IAAI,EAAE,mBAAU,CAAC,MAAM;gBACvB,KAAK,EAAE,2BAA2B,CAAC,QAAQ,CAAC,YAAY,CAAC;gBACzD,IAAI,EAAE,IAAA,qBAAY,EAAA;;8BAEI,sBAAa;wBACnB,IAAA,wBAAe,GAAE,CAAC,OAAO;;UAEvC;aACH;SACF,CAAC,CAAC;KACJ;IAED,OAAO,aAAa,CAAC;AACvB,CAAC"}
|
|
@@ -10,18 +10,14 @@ function createPackageJson(options, context) {
|
|
|
10
10
|
root: context.root,
|
|
11
11
|
projectRoot: context.workspace.projects[context.projectName].sourceRoot,
|
|
12
12
|
});
|
|
13
|
+
// By default we remove devDependencies since this is a production build.
|
|
14
|
+
if (!options.includeDevDependenciesInPackageJson) {
|
|
15
|
+
delete packageJson.devDependencies;
|
|
16
|
+
}
|
|
13
17
|
if (!packageJson.scripts) {
|
|
14
18
|
packageJson.scripts = {};
|
|
15
19
|
}
|
|
16
20
|
packageJson.scripts.start = 'next start';
|
|
17
|
-
if (!packageJson.devDependencies) {
|
|
18
|
-
packageJson.devDependencies = {};
|
|
19
|
-
}
|
|
20
|
-
const nrwlWorkspaceNode = context.projectGraph.externalNodes['npm:@nrwl/workspace'];
|
|
21
|
-
if (nrwlWorkspaceNode) {
|
|
22
|
-
packageJson.dependencies['@nrwl/workspace'] =
|
|
23
|
-
nrwlWorkspaceNode.data.version;
|
|
24
|
-
}
|
|
25
21
|
const typescriptNode = context.projectGraph.externalNodes['npm:typescript'];
|
|
26
22
|
if (typescriptNode) {
|
|
27
23
|
packageJson.dependencies['typescript'] = typescriptNode.data.version;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-package-json.js","sourceRoot":"","sources":["../../../../../../../packages/next/src/executors/build/lib/create-package-json.ts"],"names":[],"mappings":";;;;AACA,yCAA6C;AAC7C,2FAA6G;AAG7G,SAAsB,iBAAiB,CACrC,OAAgC,EAChC,OAAwB;;QAExB,MAAM,WAAW,GAAG,IAAA,uCAAmB,EACrC,OAAO,CAAC,WAAW,EACnB,OAAO,CAAC,YAAY,EACpB;YACE,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,WAAW,EAAE,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,UAAU;SACxE,CACF,CAAC;
|
|
1
|
+
{"version":3,"file":"create-package-json.js","sourceRoot":"","sources":["../../../../../../../packages/next/src/executors/build/lib/create-package-json.ts"],"names":[],"mappings":";;;;AACA,yCAA6C;AAC7C,2FAA6G;AAG7G,SAAsB,iBAAiB,CACrC,OAAgC,EAChC,OAAwB;;QAExB,MAAM,WAAW,GAAG,IAAA,uCAAmB,EACrC,OAAO,CAAC,WAAW,EACnB,OAAO,CAAC,YAAY,EACpB;YACE,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,WAAW,EAAE,OAAO,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC,UAAU;SACxE,CACF,CAAC;QAEF,yEAAyE;QACzE,IAAI,CAAC,OAAO,CAAC,mCAAmC,EAAE;YAChD,OAAO,WAAW,CAAC,eAAe,CAAC;SACpC;QAED,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE;YACxB,WAAW,CAAC,OAAO,GAAG,EAAE,CAAC;SAC1B;QACD,WAAW,CAAC,OAAO,CAAC,KAAK,GAAG,YAAY,CAAC;QAEzC,MAAM,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,aAAa,CAAC,gBAAgB,CAAC,CAAC;QAC5E,IAAI,cAAc,EAAE;YAClB,WAAW,CAAC,YAAY,CAAC,YAAY,CAAC,GAAG,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC;SACtE;QAED,IAAA,sBAAa,EAAC,GAAG,OAAO,CAAC,UAAU,eAAe,EAAE,WAAW,CAAC,CAAC;IACnE,CAAC;CAAA;AA7BD,8CA6BC"}
|
|
@@ -47,6 +47,11 @@
|
|
|
47
47
|
"type": "boolean",
|
|
48
48
|
"description": "Read buildable libraries from source instead of building them separately.",
|
|
49
49
|
"default": true
|
|
50
|
+
},
|
|
51
|
+
"includeDevDependenciesInPackageJson": {
|
|
52
|
+
"type": "boolean",
|
|
53
|
+
"description": "Include `devDependencies` in the generated package.json file. By default only production `dependencies` are included.",
|
|
54
|
+
"default": false
|
|
50
55
|
}
|
|
51
56
|
},
|
|
52
57
|
"required": ["root", "outputPath"]
|
package/src/utils/types.d.ts
CHANGED