@nrwl/next 15.9.2 → 16.0.0-beta.1
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/babel.js +1 -12
- package/babel.js.map +1 -1
- package/executors.json +12 -12
- package/generators.json +2 -70
- package/index.d.ts +1 -6
- package/index.js +1 -12
- package/index.js.map +1 -1
- package/package.json +7 -30
- package/plugins/with-less.d.ts +1 -2
- package/plugins/with-less.js +1 -75
- package/plugins/with-less.js.map +1 -1
- package/plugins/with-nx.d.ts +1 -15
- package/plugins/with-nx.js +1 -274
- package/plugins/with-nx.js.map +1 -1
- package/plugins/with-stylus.d.ts +1 -2
- package/plugins/with-stylus.js +1 -75
- package/plugins/with-stylus.js.map +1 -1
- package/tailwind.d.ts +1 -2
- package/tailwind.js +2 -4
- package/tailwind.js.map +1 -1
- package/README.md +0 -63
- package/migrations.json +0 -306
- package/src/executors/build/build.impl.d.ts +0 -6
- package/src/executors/build/build.impl.js +0 -62
- package/src/executors/build/build.impl.js.map +0 -1
- package/src/executors/build/compat.d.ts +0 -2
- package/src/executors/build/compat.js +0 -6
- package/src/executors/build/compat.js.map +0 -1
- package/src/executors/build/lib/check-project.d.ts +0 -1
- package/src/executors/build/lib/check-project.js +0 -13
- package/src/executors/build/lib/check-project.js.map +0 -1
- package/src/executors/build/lib/create-next-config-file.d.ts +0 -3
- package/src/executors/build/lib/create-next-config-file.js +0 -15
- package/src/executors/build/lib/create-next-config-file.js.map +0 -1
- package/src/executors/build/lib/update-package-json.d.ts +0 -3
- package/src/executors/build/lib/update-package-json.js +0 -24
- package/src/executors/build/lib/update-package-json.js.map +0 -1
- package/src/executors/build/schema.json +0 -68
- package/src/executors/export/compat.d.ts +0 -2
- package/src/executors/export/compat.js +0 -6
- package/src/executors/export/compat.js.map +0 -1
- package/src/executors/export/export.impl.d.ts +0 -6
- package/src/executors/export/export.impl.js +0 -53
- package/src/executors/export/export.impl.js.map +0 -1
- package/src/executors/export/schema.json +0 -30
- package/src/executors/server/compat.d.ts +0 -2
- package/src/executors/server/compat.js +0 -6
- package/src/executors/server/compat.js.map +0 -1
- package/src/executors/server/lib/custom-server.d.ts +0 -2
- package/src/executors/server/lib/custom-server.js +0 -15
- package/src/executors/server/lib/custom-server.js.map +0 -1
- package/src/executors/server/lib/default-server.d.ts +0 -6
- package/src/executors/server/lib/default-server.js +0 -34
- package/src/executors/server/lib/default-server.js.map +0 -1
- package/src/executors/server/lib/tsnode-register.d.ts +0 -1
- package/src/executors/server/lib/tsnode-register.js +0 -23
- package/src/executors/server/lib/tsnode-register.js.map +0 -1
- package/src/executors/server/schema.json +0 -61
- package/src/executors/server/server.impl.d.ts +0 -7
- package/src/executors/server/server.impl.js +0 -120
- package/src/executors/server/server.impl.js.map +0 -1
- package/src/generators/application/application.d.ts +0 -4
- package/src/generators/application/application.js +0 -45
- package/src/generators/application/application.js.map +0 -1
- package/src/generators/application/files/.babelrc__tmpl__ +0 -21
- package/src/generators/application/files/index.d.ts__tmpl__ +0 -18
- package/src/generators/application/files/next-env.d.ts__tmpl__ +0 -5
- package/src/generators/application/files/next.config.js__tmpl__ +0 -70
- package/src/generators/application/files/pages/__fileName__.module.__style__ +0 -1
- package/src/generators/application/files/pages/__fileName__.tsx__tmpl__ +0 -28
- package/src/generators/application/files/pages/_app.tsx__tmpl__ +0 -18
- package/src/generators/application/files/pages/_document.tsx__tmpl__ +0 -33
- package/src/generators/application/files/pages/styles.__stylesExt____tmpl__ +0 -1
- package/src/generators/application/files/public/.gitkeep +0 -0
- package/src/generators/application/files/specs/__fileName__.spec.tsx__tmpl__ +0 -11
- package/src/generators/application/files/tsconfig.json__tmpl__ +0 -18
- package/src/generators/application/lib/add-cypress.d.ts +0 -3
- package/src/generators/application/lib/add-cypress.js +0 -18
- package/src/generators/application/lib/add-cypress.js.map +0 -1
- package/src/generators/application/lib/add-jest.d.ts +0 -3
- package/src/generators/application/lib/add-jest.js +0 -36
- package/src/generators/application/lib/add-jest.js.map +0 -1
- package/src/generators/application/lib/add-linting.d.ts +0 -3
- package/src/generators/application/lib/add-linting.js +0 -66
- package/src/generators/application/lib/add-linting.js.map +0 -1
- package/src/generators/application/lib/add-project.d.ts +0 -3
- package/src/generators/application/lib/add-project.js +0 -59
- package/src/generators/application/lib/add-project.js.map +0 -1
- package/src/generators/application/lib/create-application-files.d.ts +0 -3
- package/src/generators/application/lib/create-application-files.helpers.d.ts +0 -2
- package/src/generators/application/lib/create-application-files.helpers.js +0 -785
- package/src/generators/application/lib/create-application-files.helpers.js.map +0 -1
- package/src/generators/application/lib/create-application-files.js +0 -34
- package/src/generators/application/lib/create-application-files.js.map +0 -1
- package/src/generators/application/lib/create-next-server-files.d.ts +0 -3
- package/src/generators/application/lib/create-next-server-files.js +0 -57
- package/src/generators/application/lib/create-next-server-files.js.map +0 -1
- package/src/generators/application/lib/normalize-options.d.ts +0 -13
- package/src/generators/application/lib/normalize-options.js +0 -33
- package/src/generators/application/lib/normalize-options.js.map +0 -1
- package/src/generators/application/lib/set-defaults.d.ts +0 -3
- package/src/generators/application/lib/set-defaults.js +0 -14
- package/src/generators/application/lib/set-defaults.js.map +0 -1
- package/src/generators/application/lib/update-jest-config.d.ts +0 -3
- package/src/generators/application/lib/update-jest-config.js +0 -16
- package/src/generators/application/lib/update-jest-config.js.map +0 -1
- package/src/generators/application/schema.d.ts +0 -20
- package/src/generators/application/schema.json +0 -131
- package/src/generators/component/component.d.ts +0 -15
- package/src/generators/component/component.js +0 -34
- package/src/generators/component/component.js.map +0 -1
- package/src/generators/component/schema.json +0 -119
- package/src/generators/custom-server/custom-server.d.ts +0 -4
- package/src/generators/custom-server/custom-server.js +0 -79
- package/src/generators/custom-server/custom-server.js.map +0 -1
- package/src/generators/custom-server/files/server/main.ts__tmpl__ +0 -46
- package/src/generators/custom-server/files/tsconfig.server.json__tmpl__ +0 -15
- package/src/generators/custom-server/schema.d.ts +0 -4
- package/src/generators/custom-server/schema.json +0 -30
- package/src/generators/init/init.d.ts +0 -5
- package/src/generators/init/init.js +0 -49
- package/src/generators/init/init.js.map +0 -1
- package/src/generators/init/schema.d.ts +0 -7
- package/src/generators/init/schema.json +0 -39
- package/src/generators/library/library.d.ts +0 -5
- package/src/generators/library/library.js +0 -73
- package/src/generators/library/library.js.map +0 -1
- package/src/generators/library/schema.d.ts +0 -26
- package/src/generators/library/schema.json +0 -162
- package/src/generators/page/page.d.ts +0 -5
- package/src/generators/page/page.js +0 -27
- package/src/generators/page/page.js.map +0 -1
- package/src/generators/page/schema.d.ts +0 -13
- package/src/generators/page/schema.json +0 -107
- package/src/migrations/update-12-10-0/fix-page-dir-for-eslint.d.ts +0 -3
- package/src/migrations/update-12-10-0/fix-page-dir-for-eslint.js +0 -34
- package/src/migrations/update-12-10-0/fix-page-dir-for-eslint.js.map +0 -1
- package/src/migrations/update-12-8-0/remove-styled-jsx-babel-plugin.d.ts +0 -3
- package/src/migrations/update-12-8-0/remove-styled-jsx-babel-plugin.js +0 -26
- package/src/migrations/update-12-8-0/remove-styled-jsx-babel-plugin.js.map +0 -1
- package/src/migrations/update-13-0-0/update-emotion-setup.d.ts +0 -3
- package/src/migrations/update-13-0-0/update-emotion-setup.js +0 -39
- package/src/migrations/update-13-0-0/update-emotion-setup.js.map +0 -1
- package/src/migrations/update-13-0-0/update-to-webpack-5.d.ts +0 -3
- package/src/migrations/update-13-0-0/update-to-webpack-5.js +0 -32
- package/src/migrations/update-13-0-0/update-to-webpack-5.js.map +0 -1
- package/src/migrations/update-13-0-3/fix-less.d.ts +0 -3
- package/src/migrations/update-13-0-3/fix-less.js +0 -27
- package/src/migrations/update-13-0-3/fix-less.js.map +0 -1
- package/src/migrations/update-13-1-1/enable-swc.d.ts +0 -3
- package/src/migrations/update-13-1-1/enable-swc.js +0 -46
- package/src/migrations/update-13-1-1/enable-swc.js.map +0 -1
- package/src/migrations/update-14-0-0/add-default-development-configurations.d.ts +0 -3
- package/src/migrations/update-14-0-0/add-default-development-configurations.js +0 -36
- package/src/migrations/update-14-0-0/add-default-development-configurations.js.map +0 -1
- package/src/migrations/update-14-4-3/add-dev-output-path.d.ts +0 -3
- package/src/migrations/update-14-4-3/add-dev-output-path.js +0 -24
- package/src/migrations/update-14-4-3/add-dev-output-path.js.map +0 -1
- package/src/migrations/update-14-5-3/add-gitignore-entry.d.ts +0 -3
- package/src/migrations/update-14-5-3/add-gitignore-entry.js +0 -15
- package/src/migrations/update-14-5-3/add-gitignore-entry.js.map +0 -1
- package/src/migrations/update-14-5-3/update-dev-output-path.d.ts +0 -3
- package/src/migrations/update-14-5-3/update-dev-output-path.js +0 -29
- package/src/migrations/update-14-5-3/update-dev-output-path.js.map +0 -1
- package/src/migrations/update-14-5-7/update-next-eslint.d.ts +0 -3
- package/src/migrations/update-14-5-7/update-next-eslint.js +0 -32
- package/src/migrations/update-14-5-7/update-next-eslint.js.map +0 -1
- package/src/migrations/update-15-8-8/add-style-packages.d.ts +0 -3
- package/src/migrations/update-15-8-8/add-style-packages.js +0 -28
- package/src/migrations/update-15-8-8/add-style-packages.js.map +0 -1
- package/src/utils/add-gitignore-entry.d.ts +0 -2
- package/src/utils/add-gitignore-entry.js +0 -18
- package/src/utils/add-gitignore-entry.js.map +0 -1
- package/src/utils/config-invalid-function.fixture.d.ts +0 -0
- package/src/utils/config-invalid-function.fixture.js +0 -2
- package/src/utils/config-invalid-function.fixture.js.map +0 -1
- package/src/utils/config-not-a-function.fixture.d.ts +0 -0
- package/src/utils/config-not-a-function.fixture.js +0 -2
- package/src/utils/config-not-a-function.fixture.js.map +0 -1
- package/src/utils/config.d.ts +0 -4
- package/src/utils/config.fixture.d.ts +0 -0
- package/src/utils/config.fixture.js +0 -4
- package/src/utils/config.fixture.js.map +0 -1
- package/src/utils/config.js +0 -65
- package/src/utils/config.js.map +0 -1
- package/src/utils/constants.d.ts +0 -1
- package/src/utils/constants.js +0 -5
- package/src/utils/constants.js.map +0 -1
- package/src/utils/create-copy-plugin.d.ts +0 -2
- package/src/utils/create-copy-plugin.js +0 -63
- package/src/utils/create-copy-plugin.js.map +0 -1
- package/src/utils/generate-globs.d.ts +0 -5
- package/src/utils/generate-globs.js +0 -30
- package/src/utils/generate-globs.js.map +0 -1
- package/src/utils/styles.d.ts +0 -40
- package/src/utils/styles.js +0 -56
- package/src/utils/styles.js.map +0 -1
- package/src/utils/types.d.ts +0 -57
- package/src/utils/types.js +0 -3
- package/src/utils/types.js.map +0 -1
- package/src/utils/versions.d.ts +0 -9
- package/src/utils/versions.js +0 -13
- package/src/utils/versions.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-application-files.helpers.js","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/application/lib/create-application-files.helpers.ts"],"names":[],"mappings":";;;AAAA,SAAgB,YAAY,CAAC,IAAY;IACvC,OAAO;;;;;;sBAMa,IAAI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmYvB,CAAC;AACJ,CAAC;AA3YD,oCA2YC;AAED,SAAgB,gBAAgB;IAC9B,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4XN,CAAC;AACJ,CAAC;AA9XD,4CA8XC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createApplicationFiles = void 0;
|
|
4
|
-
const path_1 = require("path");
|
|
5
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
-
const js_1 = require("@nrwl/js");
|
|
7
|
-
const create_application_files_helpers_1 = require("./create-application-files.helpers");
|
|
8
|
-
function createApplicationFiles(host, options) {
|
|
9
|
-
const templateVariables = Object.assign(Object.assign(Object.assign({}, (0, devkit_1.names)(options.name)), options), { tmpl: '', rootTsConfigPath: (0, js_1.getRelativePathToRootTsConfig)(host, options.appProjectRoot), appContent: (0, create_application_files_helpers_1.createAppJsx)(options.name), styleContent: (0, create_application_files_helpers_1.createStyleRules)(), pageStyleContent: `.page {}`, stylesExt: options.style === 'less' || options.style === 'styl'
|
|
10
|
-
? options.style
|
|
11
|
-
: 'css' });
|
|
12
|
-
(0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, '../files'), options.appProjectRoot, templateVariables);
|
|
13
|
-
if (options.unitTestRunner === 'none') {
|
|
14
|
-
host.delete(`${options.appProjectRoot}/specs/${options.fileName}.spec.tsx`);
|
|
15
|
-
}
|
|
16
|
-
// SWC will be disabled if custom babelrc is provided.
|
|
17
|
-
// Check for `!== false` because `create-nx-workspace` is not passing default values.
|
|
18
|
-
if (options.swc !== false) {
|
|
19
|
-
host.delete(`${options.appProjectRoot}/.babelrc`);
|
|
20
|
-
}
|
|
21
|
-
if (options.styledModule) {
|
|
22
|
-
host.delete(`${options.appProjectRoot}/pages/${options.fileName}.module.${options.style}`);
|
|
23
|
-
}
|
|
24
|
-
if (options.style !== 'styled-components') {
|
|
25
|
-
host.delete(`${options.appProjectRoot}/pages/_document.tsx`);
|
|
26
|
-
}
|
|
27
|
-
if (options.js) {
|
|
28
|
-
host.delete(`${options.appProjectRoot}/index.d.ts`);
|
|
29
|
-
(0, devkit_1.toJS)(host);
|
|
30
|
-
host.delete(`${options.appProjectRoot}/next-env.d.js`);
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
exports.createApplicationFiles = createApplicationFiles;
|
|
34
|
-
//# sourceMappingURL=create-application-files.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-application-files.js","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/application/lib/create-application-files.ts"],"names":[],"mappings":";;;AAAA,+BAA4B;AAC5B,yCAAgE;AAChE,iCAAyD;AAGzD,yFAG4C;AAE5C,SAAgB,sBAAsB,CAAC,IAAU,EAAE,OAAyB;IAC1E,MAAM,iBAAiB,iDAClB,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,GACnB,OAAO,KACV,IAAI,EAAE,EAAE,EACR,gBAAgB,EAAE,IAAA,kCAA6B,EAC7C,IAAI,EACJ,OAAO,CAAC,cAAc,CACvB,EACD,UAAU,EAAE,IAAA,+CAAY,EAAC,OAAO,CAAC,IAAI,CAAC,EACtC,YAAY,EAAE,IAAA,mDAAgB,GAAE,EAChC,gBAAgB,EAAE,UAAU,EAC5B,SAAS,EACP,OAAO,CAAC,KAAK,KAAK,MAAM,IAAI,OAAO,CAAC,KAAK,KAAK,MAAM;YAClD,CAAC,CAAC,OAAO,CAAC,KAAK;YACf,CAAC,CAAC,KAAK,GACZ,CAAC;IAEF,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,WAAI,EAAC,SAAS,EAAE,UAAU,CAAC,EAC3B,OAAO,CAAC,cAAc,EACtB,iBAAiB,CAClB,CAAC;IAEF,IAAI,OAAO,CAAC,cAAc,KAAK,MAAM,EAAE;QACrC,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,UAAU,OAAO,CAAC,QAAQ,WAAW,CAAC,CAAC;KAC7E;IAED,sDAAsD;IACtD,qFAAqF;IACrF,IAAI,OAAO,CAAC,GAAG,KAAK,KAAK,EAAE;QACzB,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,WAAW,CAAC,CAAC;KACnD;IAED,IAAI,OAAO,CAAC,YAAY,EAAE;QACxB,IAAI,CAAC,MAAM,CACT,GAAG,OAAO,CAAC,cAAc,UAAU,OAAO,CAAC,QAAQ,WAAW,OAAO,CAAC,KAAK,EAAE,CAC9E,CAAC;KACH;IAED,IAAI,OAAO,CAAC,KAAK,KAAK,mBAAmB,EAAE;QACzC,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,sBAAsB,CAAC,CAAC;KAC9D;IAED,IAAI,OAAO,CAAC,EAAE,EAAE;QACd,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,aAAa,CAAC,CAAC;QACpD,IAAA,aAAI,EAAC,IAAI,CAAC,CAAC;QACX,IAAI,CAAC,MAAM,CAAC,GAAG,OAAO,CAAC,cAAc,gBAAgB,CAAC,CAAC;KACxD;AACH,CAAC;AAlDD,wDAkDC"}
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.createNextServerFiles = void 0;
|
|
4
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
-
const path_1 = require("path");
|
|
6
|
-
let isOldNext;
|
|
7
|
-
try {
|
|
8
|
-
require('next/dist/next-server/server/next-server');
|
|
9
|
-
isOldNext = true;
|
|
10
|
-
}
|
|
11
|
-
catch (_a) {
|
|
12
|
-
isOldNext = false;
|
|
13
|
-
}
|
|
14
|
-
function createNextServerFiles(host, options) {
|
|
15
|
-
if (options.server) {
|
|
16
|
-
const directory = (0, path_1.dirname)((0, devkit_1.joinPathFragments)(options.appProjectRoot, options.server));
|
|
17
|
-
host.write((0, devkit_1.joinPathFragments)(options.appProjectRoot, options.server), `
|
|
18
|
-
// @ts-check
|
|
19
|
-
'use strict';
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* @typedef {import('http').Server} Server
|
|
23
|
-
* @typedef {import('next/dist/server/next-server').default} DevServer
|
|
24
|
-
*/
|
|
25
|
-
|
|
26
|
-
const express = require('express');
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* @param {DevServer} app
|
|
30
|
-
* @param {{dev: string; dir: string; staticMarkup: boolean; quiet: boolean; conf: any; port: number;}} options
|
|
31
|
-
* @returns {Promise<Server>}
|
|
32
|
-
*/
|
|
33
|
-
module.exports = async function nextServer(app, options) {
|
|
34
|
-
const handle = app.getRequestHandler();
|
|
35
|
-
const expressApp = express();
|
|
36
|
-
|
|
37
|
-
await app.prepare();
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* @returns {Promise<Server>}
|
|
41
|
-
*/
|
|
42
|
-
return new Promise((resolve, reject) => {
|
|
43
|
-
|
|
44
|
-
expressApp.all('*', (req, res) => {
|
|
45
|
-
return handle(req, res);
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
const server = expressApp.listen(options.port, (err) => {
|
|
49
|
-
err ? reject(err) : resolve(server);
|
|
50
|
-
});
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
`);
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
exports.createNextServerFiles = createNextServerFiles;
|
|
57
|
-
//# sourceMappingURL=create-next-server-files.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-next-server-files.js","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/application/lib/create-next-server-files.ts"],"names":[],"mappings":";;;AACA,yCAA2E;AAC3E,+BAA+B;AAE/B,IAAI,SAAkB,CAAC;AAEvB,IAAI;IACF,OAAO,CAAC,0CAA0C,CAAC,CAAC;IACpD,SAAS,GAAG,IAAI,CAAC;CAClB;AAAC,WAAM;IACN,SAAS,GAAG,KAAK,CAAC;CACnB;AAED,SAAgB,qBAAqB,CAAC,IAAU,EAAE,OAAyB;IACzE,IAAI,OAAO,CAAC,MAAM,EAAE;QAClB,MAAM,SAAS,GAAG,IAAA,cAAO,EACvB,IAAA,0BAAiB,EAAC,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,CAC1D,CAAC;QAEF,IAAI,CAAC,KAAK,CACR,IAAA,0BAAiB,EAAC,OAAO,CAAC,cAAc,EAAE,OAAO,CAAC,MAAM,CAAC,EACzD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAoCC,CACF,CAAC;KACH;AACH,CAAC;AA/CD,sDA+CC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Tree } from '@nrwl/devkit';
|
|
2
|
-
import { Schema } from '../schema';
|
|
3
|
-
export interface NormalizedSchema extends Schema {
|
|
4
|
-
projectName: string;
|
|
5
|
-
appProjectRoot: string;
|
|
6
|
-
e2eProjectName: string;
|
|
7
|
-
e2eProjectRoot: string;
|
|
8
|
-
parsedTags: string[];
|
|
9
|
-
fileName: string;
|
|
10
|
-
styledModule: null | string;
|
|
11
|
-
js?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare function normalizeOptions(host: Tree, options: Schema): NormalizedSchema;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeOptions = void 0;
|
|
4
|
-
const assertion_1 = require("@nrwl/react/src/utils/assertion");
|
|
5
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
-
const linter_1 = require("@nrwl/linter");
|
|
7
|
-
function normalizeOptions(host, options) {
|
|
8
|
-
const { layoutDirectory, projectDirectory } = (0, devkit_1.extractLayoutDirectory)(options.directory);
|
|
9
|
-
const appDirectory = projectDirectory
|
|
10
|
-
? `${(0, devkit_1.names)(projectDirectory).fileName}/${(0, devkit_1.names)(options.name).fileName}`
|
|
11
|
-
: (0, devkit_1.names)(options.name).fileName;
|
|
12
|
-
const appsDir = layoutDirectory !== null && layoutDirectory !== void 0 ? layoutDirectory : (0, devkit_1.getWorkspaceLayout)(host).appsDir;
|
|
13
|
-
const appProjectName = appDirectory.replace(new RegExp('/', 'g'), '-');
|
|
14
|
-
const e2eProjectName = `${appProjectName}-e2e`;
|
|
15
|
-
const appProjectRoot = (0, devkit_1.joinPathFragments)(appsDir, appDirectory);
|
|
16
|
-
const e2eProjectRoot = (0, devkit_1.joinPathFragments)(appsDir, `${appDirectory}-e2e`);
|
|
17
|
-
const parsedTags = options.tags
|
|
18
|
-
? options.tags.split(',').map((s) => s.trim())
|
|
19
|
-
: [];
|
|
20
|
-
const fileName = 'index';
|
|
21
|
-
const styledModule = /^(css|scss|less|styl)$/.test(options.style)
|
|
22
|
-
? null
|
|
23
|
-
: options.style;
|
|
24
|
-
(0, assertion_1.assertValidStyle)(options.style);
|
|
25
|
-
return Object.assign(Object.assign({}, options), { name: (0, devkit_1.names)(options.name).fileName, projectName: appProjectName, linter: options.linter || linter_1.Linter.EsLint, unitTestRunner: options.unitTestRunner || 'jest', e2eTestRunner: options.e2eTestRunner || 'cypress', style: options.style || 'css', appProjectRoot,
|
|
26
|
-
e2eProjectRoot,
|
|
27
|
-
e2eProjectName,
|
|
28
|
-
parsedTags,
|
|
29
|
-
fileName,
|
|
30
|
-
styledModule });
|
|
31
|
-
}
|
|
32
|
-
exports.normalizeOptions = normalizeOptions;
|
|
33
|
-
//# sourceMappingURL=normalize-options.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../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OAAO,CAAC,KAAK,CAAC;QAC/D,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IAElB,IAAA,4BAAgB,EAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAEhC,uCACK,OAAO,KACV,IAAI,EAAE,IAAA,cAAK,EAAC,OAAO,CAAC,IAAI,CAAC,CAAC,QAAQ,EAClC,WAAW,EAAE,cAAc,EAC3B,MAAM,EAAE,OAAO,CAAC,MAAM,IAAI,eAAM,CAAC,MAAM,EACvC,cAAc,EAAE,OAAO,CAAC,cAAc,IAAI,MAAM,EAChD,aAAa,EAAE,OAAO,CAAC,aAAa,IAAI,SAAS,EACjD,KAAK,EAAE,OAAO,CAAC,KAAK,IAAI,KAAK,EAC7B,cAAc;QACd,cAAc;QACd,cAAc;QACd,UAAU;QACV,QAAQ;QACR,YAAY,IACZ;AACJ,CAAC;AA/CD,4CA+CC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setDefaults = void 0;
|
|
4
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
5
|
-
function setDefaults(host, options) {
|
|
6
|
-
const nxJson = (0, devkit_1.readNxJson)(host);
|
|
7
|
-
nxJson.generators = nxJson.generators || {};
|
|
8
|
-
nxJson.generators['@nrwl/next'] = nxJson.generators['@nrwl/next'] || {};
|
|
9
|
-
const prev = nxJson.generators['@nrwl/next'];
|
|
10
|
-
nxJson.generators = Object.assign(Object.assign({}, nxJson.generators), { '@nrwl/next': Object.assign(Object.assign({}, prev), { application: Object.assign({ style: options.style, linter: options.linter }, prev.application) }) });
|
|
11
|
-
(0, devkit_1.updateNxJson)(host, nxJson);
|
|
12
|
-
}
|
|
13
|
-
exports.setDefaults = setDefaults;
|
|
14
|
-
//# sourceMappingURL=set-defaults.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"set-defaults.js","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/application/lib/set-defaults.ts"],"names":[],"mappings":";;;AAAA,yCAA8D;AAI9D,SAAgB,WAAW,CAAC,IAAU,EAAE,OAAyB;IAC/D,MAAM,MAAM,GAAG,IAAA,mBAAU,EAAC,IAAI,CAAC,CAAC;IAEhC,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,IAAI,EAAE,CAAC;IAC5C,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,IAAI,EAAE,CAAC;IACxE,MAAM,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IAE7C,MAAM,CAAC,UAAU,mCACZ,MAAM,CAAC,UAAU,KACpB,YAAY,kCACP,IAAI,KACP,WAAW,kBACT,KAAK,EAAE,OAAO,CAAC,KAAK,EACpB,MAAM,EAAE,OAAO,CAAC,MAAM,IACnB,IAAI,CAAC,WAAW,OAGxB,CAAC;IACF,IAAA,qBAAY,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAC7B,CAAC;AAnBD,kCAmBC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateJestConfig = void 0;
|
|
4
|
-
function updateJestConfig(host, options) {
|
|
5
|
-
if (options.unitTestRunner !== 'jest') {
|
|
6
|
-
return;
|
|
7
|
-
}
|
|
8
|
-
const configPath = `${options.appProjectRoot}/jest.config.${options.js ? 'js' : 'ts'}`;
|
|
9
|
-
const originalContent = host.read(configPath, 'utf-8');
|
|
10
|
-
const content = originalContent
|
|
11
|
-
.replace('transform: {', "transform: {\n '^(?!.*\\\\.(js|jsx|ts|tsx|css|json)$)': '@nrwl/react/plugins/jest',")
|
|
12
|
-
.replace(`'babel-jest'`, `['babel-jest', { presets: ['@nrwl/next/babel'] }]`);
|
|
13
|
-
host.write(configPath, content);
|
|
14
|
-
}
|
|
15
|
-
exports.updateJestConfig = updateJestConfig;
|
|
16
|
-
//# sourceMappingURL=update-jest-config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-jest-config.js","sourceRoot":"","sources":["../../../../../../../packages/next/src/generators/application/lib/update-jest-config.ts"],"names":[],"mappings":";;;AAGA,SAAgB,gBAAgB,CAAC,IAAU,EAAE,OAAyB;IACpE,IAAI,OAAO,CAAC,cAAc,KAAK,MAAM,EAAE;QACrC,OAAO;KACR;IAED,MAAM,UAAU,GAAG,GAAG,OAAO,CAAC,cAAc,gBAC1C,OAAO,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IACtB,EAAE,CAAC;IACH,MAAM,eAAe,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,eAAe;SAC5B,OAAO,CACN,cAAc,EACd,wFAAwF,CACzF;SACA,OAAO,CACN,cAAc,EACd,mDAAmD,CACpD,CAAC;IACJ,IAAI,CAAC,KAAK,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;AAClC,CAAC;AAnBD,4CAmBC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Linter } from '@nrwl/linter';
|
|
2
|
-
import { SupportedStyles } from '@nrwl/react';
|
|
3
|
-
|
|
4
|
-
export interface Schema {
|
|
5
|
-
name: string;
|
|
6
|
-
style?: SupportedStyles;
|
|
7
|
-
server?: string;
|
|
8
|
-
skipFormat?: boolean;
|
|
9
|
-
directory?: string;
|
|
10
|
-
tags?: string;
|
|
11
|
-
unitTestRunner?: 'jest' | 'none';
|
|
12
|
-
e2eTestRunner?: 'cypress' | 'none';
|
|
13
|
-
linter?: Linter;
|
|
14
|
-
js?: boolean;
|
|
15
|
-
setParserOptionsProject?: boolean;
|
|
16
|
-
standaloneConfig?: boolean;
|
|
17
|
-
swc?: boolean;
|
|
18
|
-
customServer?: boolean;
|
|
19
|
-
skipPackageJson?: boolean;
|
|
20
|
-
}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"cli": "nx",
|
|
4
|
-
"$id": "NxNextApp",
|
|
5
|
-
"title": "Create a Next.js Application for Nx",
|
|
6
|
-
"description": "Create a Next.js Application for Nx.",
|
|
7
|
-
"type": "object",
|
|
8
|
-
"properties": {
|
|
9
|
-
"name": {
|
|
10
|
-
"description": "The name of the application.",
|
|
11
|
-
"type": "string",
|
|
12
|
-
"$default": {
|
|
13
|
-
"$source": "argv",
|
|
14
|
-
"index": 0
|
|
15
|
-
},
|
|
16
|
-
"x-prompt": "What name would you like to use for the application?",
|
|
17
|
-
"pattern": "^[a-zA-Z].*$",
|
|
18
|
-
"x-priority": "important"
|
|
19
|
-
},
|
|
20
|
-
"directory": {
|
|
21
|
-
"description": "The directory of the new application.",
|
|
22
|
-
"type": "string",
|
|
23
|
-
"alias": "d",
|
|
24
|
-
"x-priority": "important"
|
|
25
|
-
},
|
|
26
|
-
"style": {
|
|
27
|
-
"description": "The file extension to be used for style files.",
|
|
28
|
-
"type": "string",
|
|
29
|
-
"default": "css",
|
|
30
|
-
"alias": "s",
|
|
31
|
-
"x-prompt": {
|
|
32
|
-
"message": "Which stylesheet format would you like to use?",
|
|
33
|
-
"type": "list",
|
|
34
|
-
"items": [
|
|
35
|
-
{ "value": "css", "label": "CSS" },
|
|
36
|
-
{
|
|
37
|
-
"value": "scss",
|
|
38
|
-
"label": "SASS(.scss) [ http://sass-lang.com ]"
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"value": "styl",
|
|
42
|
-
"label": "Stylus(.styl) [ http://stylus-lang.com ]"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"value": "less",
|
|
46
|
-
"label": "LESS [ http://lesscss.org ]"
|
|
47
|
-
},
|
|
48
|
-
{
|
|
49
|
-
"value": "styled-components",
|
|
50
|
-
"label": "styled-components [ https://styled-components.com ]"
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"value": "@emotion/styled",
|
|
54
|
-
"label": "emotion [ https://emotion.sh ]"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
"value": "styled-jsx",
|
|
58
|
-
"label": "styled-jsx [ https://www.npmjs.com/package/styled-jsx ]"
|
|
59
|
-
}
|
|
60
|
-
]
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
"server": {
|
|
64
|
-
"description": "The server script path to be used with next.",
|
|
65
|
-
"type": "string"
|
|
66
|
-
},
|
|
67
|
-
"linter": {
|
|
68
|
-
"description": "The tool to use for running lint checks.",
|
|
69
|
-
"type": "string",
|
|
70
|
-
"enum": ["eslint"],
|
|
71
|
-
"default": "eslint"
|
|
72
|
-
},
|
|
73
|
-
"skipFormat": {
|
|
74
|
-
"description": "Skip formatting files.",
|
|
75
|
-
"type": "boolean",
|
|
76
|
-
"default": false,
|
|
77
|
-
"x-priority": "internal"
|
|
78
|
-
},
|
|
79
|
-
"unitTestRunner": {
|
|
80
|
-
"type": "string",
|
|
81
|
-
"enum": ["jest", "none"],
|
|
82
|
-
"description": "Test runner to use for unit tests.",
|
|
83
|
-
"default": "jest"
|
|
84
|
-
},
|
|
85
|
-
"e2eTestRunner": {
|
|
86
|
-
"type": "string",
|
|
87
|
-
"enum": ["cypress", "none"],
|
|
88
|
-
"description": "Test runner to use for end to end (E2E) tests.",
|
|
89
|
-
"default": "cypress"
|
|
90
|
-
},
|
|
91
|
-
"tags": {
|
|
92
|
-
"type": "string",
|
|
93
|
-
"description": "Add tags to the application (used for linting).",
|
|
94
|
-
"alias": "t"
|
|
95
|
-
},
|
|
96
|
-
"js": {
|
|
97
|
-
"type": "boolean",
|
|
98
|
-
"description": "Generate JavaScript files rather than TypeScript files.",
|
|
99
|
-
"default": false
|
|
100
|
-
},
|
|
101
|
-
"setParserOptionsProject": {
|
|
102
|
-
"type": "boolean",
|
|
103
|
-
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
|
|
104
|
-
"default": false
|
|
105
|
-
},
|
|
106
|
-
"standaloneConfig": {
|
|
107
|
-
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`",
|
|
108
|
-
"type": "boolean",
|
|
109
|
-
"default": true,
|
|
110
|
-
"x-deprecated": "Nx only supports standaloneConfig"
|
|
111
|
-
},
|
|
112
|
-
"swc": {
|
|
113
|
-
"description": "Enable the Rust-based compiler SWC to compile JS/TS files.",
|
|
114
|
-
"type": "boolean",
|
|
115
|
-
"default": true
|
|
116
|
-
},
|
|
117
|
-
"customServer": {
|
|
118
|
-
"description": "Use a custom Express server for the Next.js application.",
|
|
119
|
-
"type": "boolean",
|
|
120
|
-
"default": false
|
|
121
|
-
},
|
|
122
|
-
"skipPackageJson": {
|
|
123
|
-
"type": "boolean",
|
|
124
|
-
"default": false,
|
|
125
|
-
"description": "Do not add dependencies to `package.json`.",
|
|
126
|
-
"x-priority": "internal"
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
"required": [],
|
|
130
|
-
"examplesFile": "../../../docs/application-examples.md"
|
|
131
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Tree } from '@nrwl/devkit';
|
|
2
|
-
import type { SupportedStyles } from '@nrwl/react';
|
|
3
|
-
interface Schema {
|
|
4
|
-
name: string;
|
|
5
|
-
project: string;
|
|
6
|
-
style: SupportedStyles;
|
|
7
|
-
directory?: string;
|
|
8
|
-
flat?: boolean;
|
|
9
|
-
pascalCaseFiles?: boolean;
|
|
10
|
-
pascalCaseDirectory?: boolean;
|
|
11
|
-
skipFormat?: boolean;
|
|
12
|
-
}
|
|
13
|
-
export declare function componentGenerator(host: Tree, options: Schema): Promise<import("@nrwl/devkit").GeneratorCallback>;
|
|
14
|
-
export default componentGenerator;
|
|
15
|
-
export declare const componentSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.componentSchematic = exports.componentGenerator = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
-
const react_1 = require("@nrwl/react");
|
|
7
|
-
const styles_1 = require("../../utils/styles");
|
|
8
|
-
function getDirectory(host, options) {
|
|
9
|
-
const workspace = (0, devkit_1.getProjects)(host);
|
|
10
|
-
const projectType = workspace.get(options.project).projectType;
|
|
11
|
-
return options.directory
|
|
12
|
-
? options.directory
|
|
13
|
-
: projectType === 'application'
|
|
14
|
-
? 'components'
|
|
15
|
-
: undefined;
|
|
16
|
-
}
|
|
17
|
-
/*
|
|
18
|
-
* This schematic is basically the React one, but for Next we need
|
|
19
|
-
* extra dependencies for css, sass, less, styl style options.
|
|
20
|
-
*/
|
|
21
|
-
function componentGenerator(host, options) {
|
|
22
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
23
|
-
const componentInstall = yield (0, react_1.componentGenerator)(host, Object.assign(Object.assign({}, options), { directory: getDirectory(host, options), classComponent: false, routing: false, skipFormat: true }));
|
|
24
|
-
const styledInstall = (0, styles_1.addStyleDependencies)(host, options.style);
|
|
25
|
-
if (!options.skipFormat) {
|
|
26
|
-
yield (0, devkit_1.formatFiles)(host);
|
|
27
|
-
}
|
|
28
|
-
return (0, devkit_1.runTasksInSerial)(styledInstall, componentInstall);
|
|
29
|
-
});
|
|
30
|
-
}
|
|
31
|
-
exports.componentGenerator = componentGenerator;
|
|
32
|
-
exports.default = componentGenerator;
|
|
33
|
-
exports.componentSchematic = (0, devkit_1.convertNxGenerator)(componentGenerator);
|
|
34
|
-
//# sourceMappingURL=component.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"component.js","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/component/component.ts"],"names":[],"mappings":";;;;AAAA,yCAMsB;AAEtB,uCAA4E;AAE5E,+CAA0D;AAa1D,SAAS,YAAY,CAAC,IAAU,EAAE,OAAe;IAC/C,MAAM,SAAS,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IACpC,MAAM,WAAW,GAAG,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,WAAW,CAAC;IAE/D,OAAO,OAAO,CAAC,SAAS;QACtB,CAAC,CAAC,OAAO,CAAC,SAAS;QACnB,CAAC,CAAC,WAAW,KAAK,aAAa;YAC/B,CAAC,CAAC,YAAY;YACd,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED;;;GAGG;AACH,SAAsB,kBAAkB,CAAC,IAAU,EAAE,OAAe;;QAClE,MAAM,gBAAgB,GAAG,MAAM,IAAA,0BAAuB,EAAC,IAAI,kCACtD,OAAO,KACV,SAAS,EAAE,YAAY,CAAC,IAAI,EAAE,OAAO,CAAC,EACtC,cAAc,EAAE,KAAK,EACrB,OAAO,EAAE,KAAK,EACd,UAAU,EAAE,IAAI,IAChB,CAAC;QAEH,MAAM,aAAa,GAAG,IAAA,6BAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAEhE,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;QAED,OAAO,IAAA,yBAAgB,EAAC,aAAa,EAAE,gBAAgB,CAAC,CAAC;IAC3D,CAAC;CAAA;AAhBD,gDAgBC;AAED,kBAAe,kBAAkB,CAAC;AACrB,QAAA,kBAAkB,GAAG,IAAA,2BAAkB,EAAC,kBAAkB,CAAC,CAAC"}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"cli": "nx",
|
|
4
|
-
"$id": "NxNextReactComponent",
|
|
5
|
-
"title": "Create a React Component for Next",
|
|
6
|
-
"description": "Create a React Component for Next.",
|
|
7
|
-
"type": "object",
|
|
8
|
-
"properties": {
|
|
9
|
-
"project": {
|
|
10
|
-
"type": "string",
|
|
11
|
-
"description": "The name of the project.",
|
|
12
|
-
"alias": "p",
|
|
13
|
-
"$default": {
|
|
14
|
-
"$source": "projectName"
|
|
15
|
-
},
|
|
16
|
-
"x-prompt": "What is the name of the project for this component?",
|
|
17
|
-
"x-priority": "important"
|
|
18
|
-
},
|
|
19
|
-
"name": {
|
|
20
|
-
"type": "string",
|
|
21
|
-
"description": "The name of the component.",
|
|
22
|
-
"$default": {
|
|
23
|
-
"$source": "argv",
|
|
24
|
-
"index": 0
|
|
25
|
-
},
|
|
26
|
-
"x-prompt": "What name would you like to use for the component?",
|
|
27
|
-
"x-priority": "important"
|
|
28
|
-
},
|
|
29
|
-
"style": {
|
|
30
|
-
"description": "The file extension to be used for style files.",
|
|
31
|
-
"type": "string",
|
|
32
|
-
"alias": "s",
|
|
33
|
-
"default": "css",
|
|
34
|
-
"x-prompt": {
|
|
35
|
-
"message": "Which stylesheet format would you like to use?",
|
|
36
|
-
"type": "list",
|
|
37
|
-
"items": [
|
|
38
|
-
{ "value": "css", "label": "CSS" },
|
|
39
|
-
{
|
|
40
|
-
"value": "scss",
|
|
41
|
-
"label": "SASS(.scss) [ http://sass-lang.com ]"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"value": "styl",
|
|
45
|
-
"label": "Stylus(.styl) [ http://stylus-lang.com ]"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"value": "less",
|
|
49
|
-
"label": "LESS [ http://lesscss.org ]"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
"value": "styled-components",
|
|
53
|
-
"label": "styled-components [ https://styled-components.com ]"
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
"value": "@emotion/styled",
|
|
57
|
-
"label": "emotion [ https://emotion.sh ]"
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"value": "styled-jsx",
|
|
61
|
-
"label": "styled-jsx [ https://www.npmjs.com/package/styled-jsx ]"
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
"value": "none",
|
|
65
|
-
"label": "None"
|
|
66
|
-
}
|
|
67
|
-
]
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
"skipTests": {
|
|
71
|
-
"type": "boolean",
|
|
72
|
-
"description": "When true, does not create `spec.ts` test files for the new component.",
|
|
73
|
-
"default": false,
|
|
74
|
-
"x-priority": "internal"
|
|
75
|
-
},
|
|
76
|
-
"directory": {
|
|
77
|
-
"type": "string",
|
|
78
|
-
"description": "Create the component under this directory (can be nested).",
|
|
79
|
-
"alias": "dir",
|
|
80
|
-
"x-priority": "important"
|
|
81
|
-
},
|
|
82
|
-
"export": {
|
|
83
|
-
"type": "boolean",
|
|
84
|
-
"description": "When true, the component is exported from the project index.ts (if it exists).",
|
|
85
|
-
"alias": "e",
|
|
86
|
-
"default": false
|
|
87
|
-
},
|
|
88
|
-
"js": {
|
|
89
|
-
"type": "boolean",
|
|
90
|
-
"description": "Generate JavaScript files rather than TypeScript files.",
|
|
91
|
-
"default": false
|
|
92
|
-
},
|
|
93
|
-
"flat": {
|
|
94
|
-
"type": "boolean",
|
|
95
|
-
"description": "Create component at the source root rather than its own directory.",
|
|
96
|
-
"default": false
|
|
97
|
-
},
|
|
98
|
-
"pascalCaseFiles": {
|
|
99
|
-
"type": "boolean",
|
|
100
|
-
"description": "Use pascal case component file name (e.g. `App.tsx`).",
|
|
101
|
-
"alias": "P",
|
|
102
|
-
"default": false
|
|
103
|
-
},
|
|
104
|
-
"pascalCaseDirectory": {
|
|
105
|
-
"type": "boolean",
|
|
106
|
-
"description": "Use pascal case directory name (e.g. `App/App.tsx`).",
|
|
107
|
-
"alias": "R",
|
|
108
|
-
"default": false
|
|
109
|
-
},
|
|
110
|
-
"skipFormat": {
|
|
111
|
-
"description": "Skip formatting files.",
|
|
112
|
-
"type": "boolean",
|
|
113
|
-
"default": false,
|
|
114
|
-
"x-priority": "internal"
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
"required": ["name", "project"],
|
|
118
|
-
"examplesFile": "../../../docs/component-examples.md"
|
|
119
|
-
}
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Tree } from '@nrwl/devkit';
|
|
2
|
-
import { CustomServerSchema } from './schema';
|
|
3
|
-
export declare function customServerGenerator(host: Tree, options: CustomServerSchema): Promise<void>;
|
|
4
|
-
export declare const customServerSchematic: (generatorOptions: CustomServerSchema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.customServerSchematic = exports.customServerGenerator = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
-
function customServerGenerator(host, options) {
|
|
7
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r;
|
|
8
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
9
|
-
const project = (0, devkit_1.readProjectConfiguration)(host, options.project);
|
|
10
|
-
if (((_b = (_a = project.targets) === null || _a === void 0 ? void 0 : _a.build) === null || _b === void 0 ? void 0 : _b.executor) !== '@nrwl/next:build') {
|
|
11
|
-
devkit_1.logger.error(`Project ${options.project} is not a Next.js project. Did you generate it with "nx g @nrwl/next:app"?`);
|
|
12
|
-
return;
|
|
13
|
-
}
|
|
14
|
-
const outputPath = (_e = (_d = (_c = project.targets) === null || _c === void 0 ? void 0 : _c.build) === null || _d === void 0 ? void 0 : _d.options) === null || _e === void 0 ? void 0 : _e.outputPath;
|
|
15
|
-
const root = (_h = (_g = (_f = project.targets) === null || _f === void 0 ? void 0 : _f.build) === null || _g === void 0 ? void 0 : _g.options) === null || _h === void 0 ? void 0 : _h.root;
|
|
16
|
-
if (!root ||
|
|
17
|
-
!outputPath ||
|
|
18
|
-
!((_l = (_k = (_j = project.targets) === null || _j === void 0 ? void 0 : _j.build) === null || _k === void 0 ? void 0 : _k.configurations) === null || _l === void 0 ? void 0 : _l.development) ||
|
|
19
|
-
!((_p = (_o = (_m = project.targets) === null || _m === void 0 ? void 0 : _m.build) === null || _o === void 0 ? void 0 : _o.configurations) === null || _p === void 0 ? void 0 : _p.production)) {
|
|
20
|
-
devkit_1.logger.error(`Project ${options.project} has invalid config. Did you generate it with "nx g @nrwl/next:app"?`);
|
|
21
|
-
return;
|
|
22
|
-
}
|
|
23
|
-
if (((_q = project.targets) === null || _q === void 0 ? void 0 : _q['build-custom-server']) ||
|
|
24
|
-
((_r = project.targets) === null || _r === void 0 ? void 0 : _r['serve-custom-server'])) {
|
|
25
|
-
devkit_1.logger.warn(`Project ${options.project} has custom server targets already: build-custom-server, serve-custom-server. Remove these targets from project and try again.`);
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
(0, devkit_1.generateFiles)(host, (0, devkit_1.joinPathFragments)(__dirname, 'files'), project.root, Object.assign(Object.assign({}, options), { offsetFromRoot: (0, devkit_1.offsetFromRoot)(project.root), projectRoot: project.root, tmpl: '' }));
|
|
29
|
-
project.targets.build.dependsOn = ['build-custom-server'];
|
|
30
|
-
project.targets.serve.options.customServerTarget = `${options.project}:serve-custom-server`;
|
|
31
|
-
project.targets.serve.configurations.development.customServerTarget = `${options.project}:serve-custom-server:development`;
|
|
32
|
-
project.targets.serve.configurations.production.customServerTarget = `${options.project}:serve-custom-server:production`;
|
|
33
|
-
project.targets['build-custom-server'] = {
|
|
34
|
-
executor: '@nrwl/js:tsc',
|
|
35
|
-
defaultConfiguration: 'production',
|
|
36
|
-
options: {
|
|
37
|
-
outputPath,
|
|
38
|
-
main: `${root}/server/main.ts`,
|
|
39
|
-
tsConfig: `${root}/tsconfig.server.json`,
|
|
40
|
-
clean: false,
|
|
41
|
-
assets: [],
|
|
42
|
-
},
|
|
43
|
-
configurations: {
|
|
44
|
-
development: {},
|
|
45
|
-
production: {},
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
project.targets['serve-custom-server'] = {
|
|
49
|
-
executor: '@nrwl/js:node',
|
|
50
|
-
defaultConfiguration: 'development',
|
|
51
|
-
options: {
|
|
52
|
-
buildTarget: `${options.project}:build-custom-server`,
|
|
53
|
-
},
|
|
54
|
-
configurations: {
|
|
55
|
-
development: {
|
|
56
|
-
buildTarget: `${options.project}:build-custom-server:development`,
|
|
57
|
-
},
|
|
58
|
-
production: {
|
|
59
|
-
buildTarget: `${options.project}:build-custom-server:production`,
|
|
60
|
-
},
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
(0, devkit_1.updateProjectConfiguration)(host, options.project, project);
|
|
64
|
-
(0, devkit_1.updateJson)(host, 'nx.json', (json) => {
|
|
65
|
-
var _a, _b;
|
|
66
|
-
var _c;
|
|
67
|
-
(_a = json.tasksRunnerOptions) !== null && _a !== void 0 ? _a : (json.tasksRunnerOptions = {});
|
|
68
|
-
(_b = (_c = json.tasksRunnerOptions).default) !== null && _b !== void 0 ? _b : (_c.default = { options: {} });
|
|
69
|
-
json.tasksRunnerOptions.default.options.cacheableOperations = [
|
|
70
|
-
...json.tasksRunnerOptions.default.options.cacheableOperations,
|
|
71
|
-
'build-custom-server',
|
|
72
|
-
];
|
|
73
|
-
return json;
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
exports.customServerGenerator = customServerGenerator;
|
|
78
|
-
exports.customServerSchematic = (0, devkit_1.convertNxGenerator)(customServerGenerator);
|
|
79
|
-
//# sourceMappingURL=custom-server.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"custom-server.js","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/custom-server/custom-server.ts"],"names":[],"mappings":";;;;AACA,yCASsB;AAGtB,SAAsB,qBAAqB,CACzC,IAAU,EACV,OAA2B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