@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,46 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* This is only a minimal custom server to get started.
|
|
3
|
-
* You may want to consider using Express or another server framework, and enable security features such as CORS.
|
|
4
|
-
*
|
|
5
|
-
* For more examples, see the Next.js repo:
|
|
6
|
-
* - Express: https://github.com/vercel/next.js/tree/canary/examples/custom-server-express
|
|
7
|
-
* - Hapi: https://github.com/vercel/next.js/tree/canary/examples/custom-server-hapi
|
|
8
|
-
*/
|
|
9
|
-
import { createServer } from 'http';
|
|
10
|
-
import { parse } from 'url';
|
|
11
|
-
import * as path from 'path';
|
|
12
|
-
import next from 'next';
|
|
13
|
-
|
|
14
|
-
// Next.js server options:
|
|
15
|
-
// - The environment variable is set by `@nrwl/next:server` when running the dev server.
|
|
16
|
-
// - The fallback `__dirname` is for production builds.
|
|
17
|
-
// - Feel free to change this to suit your needs.
|
|
18
|
-
const dir = process.env.NX_NEXT_DIR || path.join(__dirname, '..');
|
|
19
|
-
const dev = process.env.NODE_ENV === 'development';
|
|
20
|
-
|
|
21
|
-
// HTTP Server options:
|
|
22
|
-
// - Feel free to change this to suit your needs.
|
|
23
|
-
const hostname = process.env.HOST || 'localhost';
|
|
24
|
-
const port = process.env.PORT ? parseInt(process.env.PORT) : 4200;
|
|
25
|
-
|
|
26
|
-
async function main() {
|
|
27
|
-
const nextApp = next({ dev, dir });
|
|
28
|
-
const handle = nextApp.getRequestHandler();
|
|
29
|
-
|
|
30
|
-
await nextApp.prepare();
|
|
31
|
-
|
|
32
|
-
const server = createServer((req, res) => {
|
|
33
|
-
const parsedUrl = parse(req.url, true);
|
|
34
|
-
handle(req, res, parsedUrl);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
server.listen(port, hostname);
|
|
38
|
-
|
|
39
|
-
console.log(`[ ready ] on http://${hostname}:${port}`)
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
main().catch((err) => {
|
|
43
|
-
console.error(err);
|
|
44
|
-
process.exit(1);
|
|
45
|
-
});
|
|
46
|
-
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "./tsconfig.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"module": "commonjs",
|
|
5
|
-
"noEmit": false,
|
|
6
|
-
"incremental": true,
|
|
7
|
-
"tsBuildInfoFile": "<%= offsetFromRoot %>/tmp/buildcache/<%= projectRoot %>/server",
|
|
8
|
-
"types": [
|
|
9
|
-
"node"
|
|
10
|
-
]
|
|
11
|
-
},
|
|
12
|
-
"include": [
|
|
13
|
-
"server/**/*.ts"
|
|
14
|
-
]
|
|
15
|
-
}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"cli": "nx",
|
|
4
|
-
"$id": "NxNextCustomServer",
|
|
5
|
-
"title": "Add custom server",
|
|
6
|
-
"description": "Add a custom server to existing Next.js application.",
|
|
7
|
-
"type": "object",
|
|
8
|
-
"properties": {
|
|
9
|
-
"project": {
|
|
10
|
-
"type": "string",
|
|
11
|
-
"description": "The name of the project.",
|
|
12
|
-
"alias": "p",
|
|
13
|
-
"$default": {
|
|
14
|
-
"$source": "argv",
|
|
15
|
-
"index": 0
|
|
16
|
-
},
|
|
17
|
-
"x-dropdown": "project",
|
|
18
|
-
"x-prompt": "What is the name of the project to set up a custom server for?",
|
|
19
|
-
"x-priority": "important"
|
|
20
|
-
},
|
|
21
|
-
"compiler": {
|
|
22
|
-
"type": "string",
|
|
23
|
-
"enum": ["tsc", "swc"],
|
|
24
|
-
"default": "tsc",
|
|
25
|
-
"description": "The compiler used to build the custom server."
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
"required": ["project"],
|
|
29
|
-
"examplesFile": "../../../docs/custom-server-examples.md"
|
|
30
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { GeneratorCallback, Tree } from '@nrwl/devkit';
|
|
2
|
-
import { InitSchema } from './schema';
|
|
3
|
-
export declare function nextInitGenerator(host: Tree, schema: InitSchema): Promise<GeneratorCallback>;
|
|
4
|
-
export default nextInitGenerator;
|
|
5
|
-
export declare const nextInitSchematic: (generatorOptions: InitSchema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.nextInitSchematic = exports.nextInitGenerator = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
-
const versions_1 = require("@nrwl/react/src/utils/versions");
|
|
7
|
-
const init_1 = require("@nrwl/react/src/generators/init/init");
|
|
8
|
-
const js_1 = require("@nrwl/js");
|
|
9
|
-
const versions_2 = require("../../utils/versions");
|
|
10
|
-
const add_gitignore_entry_1 = require("../../utils/add-gitignore-entry");
|
|
11
|
-
function updateDependencies(host) {
|
|
12
|
-
return (0, devkit_1.addDependenciesToPackageJson)(host, {
|
|
13
|
-
'@nrwl/next': versions_2.nxVersion,
|
|
14
|
-
next: versions_2.nextVersion,
|
|
15
|
-
react: versions_1.reactVersion,
|
|
16
|
-
'react-dom': versions_1.reactDomVersion,
|
|
17
|
-
tslib: versions_2.tsLibVersion,
|
|
18
|
-
}, {
|
|
19
|
-
'eslint-config-next': versions_2.eslintConfigNextVersion,
|
|
20
|
-
});
|
|
21
|
-
}
|
|
22
|
-
function nextInitGenerator(host, schema) {
|
|
23
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
const tasks = [];
|
|
25
|
-
tasks.push(yield (0, js_1.initGenerator)(host, Object.assign(Object.assign({}, schema), { skipFormat: true })));
|
|
26
|
-
if (!schema.unitTestRunner || schema.unitTestRunner === 'jest') {
|
|
27
|
-
const { jestInitGenerator } = (0, devkit_1.ensurePackage)('@nrwl/jest', versions_2.nxVersion);
|
|
28
|
-
const jestTask = yield jestInitGenerator(host, schema);
|
|
29
|
-
tasks.push(jestTask);
|
|
30
|
-
}
|
|
31
|
-
if (!schema.e2eTestRunner || schema.e2eTestRunner === 'cypress') {
|
|
32
|
-
const { cypressInitGenerator } = (0, devkit_1.ensurePackage)('@nrwl/cypress', versions_2.nxVersion);
|
|
33
|
-
const cypressTask = yield cypressInitGenerator(host, {});
|
|
34
|
-
tasks.push(cypressTask);
|
|
35
|
-
}
|
|
36
|
-
const reactTask = yield (0, init_1.default)(host, Object.assign(Object.assign({}, schema), { skipFormat: true }));
|
|
37
|
-
tasks.push(reactTask);
|
|
38
|
-
if (!schema.skipPackageJson) {
|
|
39
|
-
const installTask = updateDependencies(host);
|
|
40
|
-
tasks.push(installTask);
|
|
41
|
-
}
|
|
42
|
-
(0, add_gitignore_entry_1.addGitIgnoreEntry)(host);
|
|
43
|
-
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
exports.nextInitGenerator = nextInitGenerator;
|
|
47
|
-
exports.default = nextInitGenerator;
|
|
48
|
-
exports.nextInitSchematic = (0, devkit_1.convertNxGenerator)(nextInitGenerator);
|
|
49
|
-
//# sourceMappingURL=init.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/init/init.ts"],"names":[],"mappings":";;;;AAAA,yCAOsB;AAEtB,6DAA+E;AAC/E,+DAAsE;AACtE,iCAA4D;AAE5D,mDAK8B;AAE9B,yEAAoE;AAEpE,SAAS,kBAAkB,CAAC,IAAU;IACpC,OAAO,IAAA,qCAA4B,EACjC,IAAI,EACJ;QACE,YAAY,EAAE,oBAAS;QACvB,IAAI,EAAE,sBAAW;QACjB,KAAK,EAAE,uBAAY;QACnB,WAAW,EAAE,0BAAe;QAC5B,KAAK,EAAE,uBAAY;KACpB,EACD;QACE,oBAAoB,EAAE,kCAAuB;KAC9C,CACF,CAAC;AACJ,CAAC;AAED,SAAsB,iBAAiB,CAAC,IAAU,EAAE,MAAkB;;QACpE,MAAM,KAAK,GAAwB,EAAE,CAAC;QAEtC,KAAK,CAAC,IAAI,CACR,MAAM,IAAA,kBAAe,EAAC,IAAI,kCACrB,MAAM,KACT,UAAU,EAAE,IAAI,IAChB,CACH,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,cAAc,IAAI,MAAM,CAAC,cAAc,KAAK,MAAM,EAAE;YAC9D,MAAM,EAAE,iBAAiB,EAAE,GAAG,IAAA,sBAAa,EACzC,YAAY,EACZ,oBAAS,CACV,CAAC;YACF,MAAM,QAAQ,GAAG,MAAM,iBAAiB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;YACvD,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;SACtB;QACD,IAAI,CAAC,MAAM,CAAC,aAAa,IAAI,MAAM,CAAC,aAAa,KAAK,SAAS,EAAE;YAC/D,MAAM,EAAE,oBAAoB,EAAE,GAAG,IAAA,sBAAa,EAE5C,eAAe,EAAE,oBAAS,CAAC,CAAC;YAC9B,MAAM,WAAW,GAAG,MAAM,oBAAoB,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YACzD,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SACzB;QAED,MAAM,SAAS,GAAG,MAAM,IAAA,cAAkB,EAAC,IAAI,kCAC1C,MAAM,KACT,UAAU,EAAE,IAAI,IAChB,CAAC;QACH,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QAEtB,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE;YAC3B,MAAM,WAAW,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAC;YAC7C,KAAK,CAAC,IAAI,CAAC,WAAW,CAAC,CAAC;SACzB;QAED,IAAA,uCAAiB,EAAC,IAAI,CAAC,CAAC;QAExB,OAAO,IAAA,yBAAgB,EAAC,GAAG,KAAK,CAAC,CAAC;IACpC,CAAC;CAAA;AAxCD,8CAwCC;AAED,kBAAe,iBAAiB,CAAC;AACpB,QAAA,iBAAiB,GAAG,IAAA,2BAAkB,EAAC,iBAAiB,CAAC,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"cli": "nx",
|
|
4
|
-
"$id": "NxNextNgInit",
|
|
5
|
-
"title": "Init Next Plugin",
|
|
6
|
-
"description": "Init Next Plugin.",
|
|
7
|
-
"type": "object",
|
|
8
|
-
"properties": {
|
|
9
|
-
"unitTestRunner": {
|
|
10
|
-
"description": "Adds the specified unit test runner.",
|
|
11
|
-
"type": "string",
|
|
12
|
-
"enum": ["jest", "none"],
|
|
13
|
-
"default": "jest"
|
|
14
|
-
},
|
|
15
|
-
"e2eTestRunner": {
|
|
16
|
-
"description": "Adds the specified e2e test runner.",
|
|
17
|
-
"type": "string",
|
|
18
|
-
"enum": ["cypress", "none"],
|
|
19
|
-
"default": "cypress"
|
|
20
|
-
},
|
|
21
|
-
"skipFormat": {
|
|
22
|
-
"description": "Skip formatting files.",
|
|
23
|
-
"type": "boolean",
|
|
24
|
-
"default": false
|
|
25
|
-
},
|
|
26
|
-
"js": {
|
|
27
|
-
"type": "boolean",
|
|
28
|
-
"default": false,
|
|
29
|
-
"description": "Use JavaScript instead of TypeScript"
|
|
30
|
-
},
|
|
31
|
-
"skipPackageJson": {
|
|
32
|
-
"type": "boolean",
|
|
33
|
-
"default": false,
|
|
34
|
-
"description": "Do not add dependencies to `package.json`.",
|
|
35
|
-
"x-priority": "internal"
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
"required": []
|
|
39
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { GeneratorCallback, Tree } from '@nrwl/devkit';
|
|
2
|
-
import { Schema } from './schema';
|
|
3
|
-
export declare function libraryGenerator(host: Tree, options: Schema): Promise<GeneratorCallback>;
|
|
4
|
-
export default libraryGenerator;
|
|
5
|
-
export declare const librarySchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.librarySchematic = exports.libraryGenerator = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
-
const library_1 = require("@nrwl/react/src/generators/library/library");
|
|
7
|
-
const init_1 = require("../init/init");
|
|
8
|
-
function libraryGenerator(host, options) {
|
|
9
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
10
|
-
const name = (0, devkit_1.names)(options.name).fileName;
|
|
11
|
-
const tasks = [];
|
|
12
|
-
const projectDirectory = options.directory
|
|
13
|
-
? `${(0, devkit_1.names)(options.directory).fileName}/${name}`
|
|
14
|
-
: name;
|
|
15
|
-
const { libsDir } = (0, devkit_1.getWorkspaceLayout)(host);
|
|
16
|
-
const projectRoot = (0, devkit_1.joinPathFragments)(libsDir, projectDirectory);
|
|
17
|
-
const initTask = yield (0, init_1.nextInitGenerator)(host, Object.assign(Object.assign({}, options), { skipFormat: true }));
|
|
18
|
-
tasks.push(initTask);
|
|
19
|
-
const libTask = yield (0, library_1.libraryGenerator)(host, Object.assign(Object.assign({}, options), { compiler: 'swc', skipFormat: true }));
|
|
20
|
-
tasks.push(libTask);
|
|
21
|
-
(0, devkit_1.updateJson)(host, (0, devkit_1.joinPathFragments)(projectRoot, '.babelrc'), (json) => {
|
|
22
|
-
if (options.style === '@emotion/styled') {
|
|
23
|
-
json.presets = [
|
|
24
|
-
[
|
|
25
|
-
'@nrwl/next/babel',
|
|
26
|
-
{
|
|
27
|
-
'preset-react': {
|
|
28
|
-
runtime: 'automatic',
|
|
29
|
-
importSource: '@emotion/react',
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
];
|
|
34
|
-
}
|
|
35
|
-
else if (options.style === 'styled-jsx') {
|
|
36
|
-
// next.js doesn't require the `styled-jsx/babel' plugin as it is already
|
|
37
|
-
// built-into the `next/babel` preset
|
|
38
|
-
json.presets = ['@nrwl/next/babel'];
|
|
39
|
-
json.plugins = (json.plugins || []).filter((x) => x !== 'styled-jsx/babel');
|
|
40
|
-
}
|
|
41
|
-
else {
|
|
42
|
-
json.presets = ['@nrwl/next/babel'];
|
|
43
|
-
}
|
|
44
|
-
return json;
|
|
45
|
-
});
|
|
46
|
-
(0, devkit_1.updateJson)(host, (0, devkit_1.joinPathFragments)(projectRoot, 'tsconfig.json'), (json) => {
|
|
47
|
-
if (options.style === '@emotion/styled') {
|
|
48
|
-
json.compilerOptions.jsxImportSource = '@emotion/react';
|
|
49
|
-
}
|
|
50
|
-
return json;
|
|
51
|
-
});
|
|
52
|
-
(0, devkit_1.updateJson)(host, (0, devkit_1.joinPathFragments)(projectRoot, 'tsconfig.lib.json'), (json) => {
|
|
53
|
-
if (!json.files) {
|
|
54
|
-
json.files = [];
|
|
55
|
-
}
|
|
56
|
-
json.files = json.files.map((path) => {
|
|
57
|
-
if (path.endsWith('react/typings/image.d.ts')) {
|
|
58
|
-
return path.replace('@nrwl/react/typings/image.d.ts', '@nrwl/next/typings/image.d.ts');
|
|
59
|
-
}
|
|
60
|
-
return path;
|
|
61
|
-
});
|
|
62
|
-
return json;
|
|
63
|
-
});
|
|
64
|
-
if (!options.skipFormat) {
|
|
65
|
-
yield (0, devkit_1.formatFiles)(host);
|
|
66
|
-
}
|
|
67
|
-
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
68
|
-
});
|
|
69
|
-
}
|
|
70
|
-
exports.libraryGenerator = libraryGenerator;
|
|
71
|
-
exports.default = libraryGenerator;
|
|
72
|
-
exports.librarySchematic = (0, devkit_1.convertNxGenerator)(libraryGenerator);
|
|
73
|
-
//# sourceMappingURL=library.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"library.js","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/library/library.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { Linter } from '@nrwl/linter';
|
|
2
|
-
import type { SupportedStyles } from '@nrwl/react';
|
|
3
|
-
|
|
4
|
-
export interface Schema {
|
|
5
|
-
name: string;
|
|
6
|
-
directory?: string;
|
|
7
|
-
style: SupportedStyles;
|
|
8
|
-
skipTsConfig: boolean;
|
|
9
|
-
skipFormat: boolean;
|
|
10
|
-
tags?: string;
|
|
11
|
-
pascalCaseFiles?: boolean;
|
|
12
|
-
routing?: boolean;
|
|
13
|
-
appProject?: string;
|
|
14
|
-
unitTestRunner: 'jest' | 'none';
|
|
15
|
-
linter: Linter;
|
|
16
|
-
component?: boolean;
|
|
17
|
-
publishable?: boolean;
|
|
18
|
-
buildable?: boolean;
|
|
19
|
-
importPath?: string;
|
|
20
|
-
js?: boolean;
|
|
21
|
-
globalCss?: boolean;
|
|
22
|
-
strict?: boolean;
|
|
23
|
-
setParserOptionsProject?: boolean;
|
|
24
|
-
standaloneConfig?: boolean;
|
|
25
|
-
skipPackageJson?: boolean;
|
|
26
|
-
}
|
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"cli": "nx",
|
|
4
|
-
"$id": "NxReactLibrary",
|
|
5
|
-
"title": "Create a React Library for Nx",
|
|
6
|
-
"description": "Create a React Library for an Nx workspace.",
|
|
7
|
-
"type": "object",
|
|
8
|
-
"properties": {
|
|
9
|
-
"name": {
|
|
10
|
-
"type": "string",
|
|
11
|
-
"description": "Library name",
|
|
12
|
-
"$default": {
|
|
13
|
-
"$source": "argv",
|
|
14
|
-
"index": 0
|
|
15
|
-
},
|
|
16
|
-
"x-prompt": "What name would you like to use for the library?",
|
|
17
|
-
"pattern": "^[a-zA-Z].*$",
|
|
18
|
-
"x-priority": "important"
|
|
19
|
-
},
|
|
20
|
-
"directory": {
|
|
21
|
-
"type": "string",
|
|
22
|
-
"description": "A directory where the lib is placed.",
|
|
23
|
-
"alias": "dir",
|
|
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
|
-
"value": "none",
|
|
62
|
-
"label": "None"
|
|
63
|
-
}
|
|
64
|
-
]
|
|
65
|
-
}
|
|
66
|
-
},
|
|
67
|
-
"linter": {
|
|
68
|
-
"description": "The tool to use for running lint checks.",
|
|
69
|
-
"type": "string",
|
|
70
|
-
"enum": ["eslint"],
|
|
71
|
-
"default": "eslint"
|
|
72
|
-
},
|
|
73
|
-
"unitTestRunner": {
|
|
74
|
-
"type": "string",
|
|
75
|
-
"enum": ["jest", "none"],
|
|
76
|
-
"description": "Test runner to use for unit tests.",
|
|
77
|
-
"default": "jest"
|
|
78
|
-
},
|
|
79
|
-
"tags": {
|
|
80
|
-
"type": "string",
|
|
81
|
-
"description": "Add tags to the library (used for linting).",
|
|
82
|
-
"alias": "t"
|
|
83
|
-
},
|
|
84
|
-
"skipFormat": {
|
|
85
|
-
"description": "Skip formatting files.",
|
|
86
|
-
"type": "boolean",
|
|
87
|
-
"default": false
|
|
88
|
-
},
|
|
89
|
-
"skipTsConfig": {
|
|
90
|
-
"type": "boolean",
|
|
91
|
-
"default": false,
|
|
92
|
-
"description": "Do not update tsconfig.json for development experience."
|
|
93
|
-
},
|
|
94
|
-
"pascalCaseFiles": {
|
|
95
|
-
"type": "boolean",
|
|
96
|
-
"description": "Use pascal case component file name (e.g. `App.tsx`).",
|
|
97
|
-
"alias": "P",
|
|
98
|
-
"default": false
|
|
99
|
-
},
|
|
100
|
-
"routing": {
|
|
101
|
-
"type": "boolean",
|
|
102
|
-
"description": "Generate library with routes."
|
|
103
|
-
},
|
|
104
|
-
"appProject": {
|
|
105
|
-
"type": "string",
|
|
106
|
-
"description": "The application project to add the library route to.",
|
|
107
|
-
"alias": "a"
|
|
108
|
-
},
|
|
109
|
-
"publishable": {
|
|
110
|
-
"type": "boolean",
|
|
111
|
-
"description": "Create a publishable library."
|
|
112
|
-
},
|
|
113
|
-
"buildable": {
|
|
114
|
-
"type": "boolean",
|
|
115
|
-
"default": false,
|
|
116
|
-
"description": "Generate a buildable library."
|
|
117
|
-
},
|
|
118
|
-
"importPath": {
|
|
119
|
-
"type": "string",
|
|
120
|
-
"description": "The library name used to import it, like `@myorg/my-awesome-lib`."
|
|
121
|
-
},
|
|
122
|
-
"component": {
|
|
123
|
-
"type": "boolean",
|
|
124
|
-
"description": "Generate a default component.",
|
|
125
|
-
"default": true
|
|
126
|
-
},
|
|
127
|
-
"js": {
|
|
128
|
-
"type": "boolean",
|
|
129
|
-
"description": "Generate JavaScript files rather than TypeScript files.",
|
|
130
|
-
"default": false
|
|
131
|
-
},
|
|
132
|
-
"globalCss": {
|
|
133
|
-
"type": "boolean",
|
|
134
|
-
"description": "When true, the stylesheet is generated using global CSS instead of CSS modules (e.g. file is `*.css` rather than `*.module.css`).",
|
|
135
|
-
"default": false
|
|
136
|
-
},
|
|
137
|
-
"strict": {
|
|
138
|
-
"type": "boolean",
|
|
139
|
-
"description": "Whether to enable tsconfig strict mode or not.",
|
|
140
|
-
"default": true
|
|
141
|
-
},
|
|
142
|
-
"setParserOptionsProject": {
|
|
143
|
-
"type": "boolean",
|
|
144
|
-
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
|
|
145
|
-
"default": false
|
|
146
|
-
},
|
|
147
|
-
"standaloneConfig": {
|
|
148
|
-
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`",
|
|
149
|
-
"type": "boolean",
|
|
150
|
-
"default": true,
|
|
151
|
-
"x-deprecated": "Nx only supports standaloneConfig"
|
|
152
|
-
},
|
|
153
|
-
"skipPackageJson": {
|
|
154
|
-
"type": "boolean",
|
|
155
|
-
"default": false,
|
|
156
|
-
"description": "Do not add dependencies to `package.json`.",
|
|
157
|
-
"x-priority": "internal"
|
|
158
|
-
}
|
|
159
|
-
},
|
|
160
|
-
"required": ["name"],
|
|
161
|
-
"examplesFile": "../../../docs/library-examples.md"
|
|
162
|
-
}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Tree } from '@nrwl/devkit';
|
|
2
|
-
import { Schema } from './schema';
|
|
3
|
-
export declare function pageGenerator(host: Tree, options: Schema): Promise<import("@nrwl/devkit").GeneratorCallback>;
|
|
4
|
-
export default pageGenerator;
|
|
5
|
-
export declare const pageSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pageSchematic = exports.pageGenerator = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const react_1 = require("@nrwl/react");
|
|
6
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
7
|
-
const styles_1 = require("../../utils/styles");
|
|
8
|
-
/*
|
|
9
|
-
* This schematic is basically the React component one, but for Next we need
|
|
10
|
-
* extra dependencies for css, sass, less, styl style options, and make sure
|
|
11
|
-
* it is under `pages` folder.
|
|
12
|
-
*/
|
|
13
|
-
function pageGenerator(host, options) {
|
|
14
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
15
|
-
const directory = options.directory ? `pages/${options.directory}` : 'pages';
|
|
16
|
-
const componentTask = yield (0, react_1.componentGenerator)(host, Object.assign(Object.assign({}, options), { directory, pascalCaseFiles: false, export: false, classComponent: false, routing: false, skipTests: !options.withTests, flat: !!options.flat, fileName: !options.flat ? 'index' : undefined, skipFormat: true }));
|
|
17
|
-
const styledTask = (0, styles_1.addStyleDependencies)(host, options.style);
|
|
18
|
-
if (!options.skipFormat) {
|
|
19
|
-
yield (0, devkit_1.formatFiles)(host);
|
|
20
|
-
}
|
|
21
|
-
return (0, devkit_1.runTasksInSerial)(componentTask, styledTask);
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
exports.pageGenerator = pageGenerator;
|
|
25
|
-
exports.default = pageGenerator;
|
|
26
|
-
exports.pageSchematic = (0, devkit_1.convertNxGenerator)(pageGenerator);
|
|
27
|
-
//# sourceMappingURL=page.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"page.js","sourceRoot":"","sources":["../../../../../../packages/next/src/generators/page/page.ts"],"names":[],"mappings":";;;;AAAA,uCAA4E;AAC5E,yCAKsB;AAEtB,+CAA0D;AAG1D;;;;GAIG;AACH,SAAsB,aAAa,CAAC,IAAU,EAAE,OAAe;;QAC7D,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC;QAC7E,MAAM,aAAa,GAAG,MAAM,IAAA,0BAAuB,EAAC,IAAI,kCACnD,OAAO,KACV,SAAS,EACT,eAAe,EAAE,KAAK,EACtB,MAAM,EAAE,KAAK,EACb,cAAc,EAAE,KAAK,EACrB,OAAO,EAAE,KAAK,EACd,SAAS,EAAE,CAAC,OAAO,CAAC,SAAS,EAC7B,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EACpB,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,EAC7C,UAAU,EAAE,IAAI,IAChB,CAAC;QAEH,MAAM,UAAU,GAAG,IAAA,6BAAoB,EAAC,IAAI,EAAE,OAAO,CAAC,KAAK,CAAC,CAAC;QAE7D,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;QAED,OAAO,IAAA,yBAAgB,EAAC,aAAa,EAAE,UAAU,CAAC,CAAC;IACrD,CAAC;CAAA;AAtBD,sCAsBC;AAED,kBAAe,aAAa,CAAC;AAChB,QAAA,aAAa,GAAG,IAAA,2BAAkB,EAAC,aAAa,CAAC,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { SupportedStyles } from '@nrwl/react';
|
|
2
|
-
|
|
3
|
-
export interface Schema {
|
|
4
|
-
name: string;
|
|
5
|
-
project: string;
|
|
6
|
-
style: SupportedStyles;
|
|
7
|
-
directory?: string;
|
|
8
|
-
fileName?: string;
|
|
9
|
-
withTests?: boolean;
|
|
10
|
-
js?: boolean;
|
|
11
|
-
flat?: boolean;
|
|
12
|
-
skipFormat?: boolean;
|
|
13
|
-
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"cli": "nx",
|
|
4
|
-
"$id": "NxNextReactPage",
|
|
5
|
-
"title": "Create a Page for Next",
|
|
6
|
-
"description": "Create a Page 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
|
-
"directory": {
|
|
30
|
-
"type": "string",
|
|
31
|
-
"description": "Create the page under this directory (can be nested). Will be created under `pages/`.",
|
|
32
|
-
"alias": "dir",
|
|
33
|
-
"x-priority": "important"
|
|
34
|
-
},
|
|
35
|
-
"style": {
|
|
36
|
-
"description": "The file extension to be used for style files.",
|
|
37
|
-
"type": "string",
|
|
38
|
-
"alias": "s",
|
|
39
|
-
"default": "css",
|
|
40
|
-
"x-prompt": {
|
|
41
|
-
"message": "Which stylesheet format would you like to use?",
|
|
42
|
-
"type": "list",
|
|
43
|
-
"items": [
|
|
44
|
-
{ "value": "css", "label": "CSS" },
|
|
45
|
-
{
|
|
46
|
-
"value": "scss",
|
|
47
|
-
"label": "SASS(.scss) [ http://sass-lang.com ]"
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
"value": "styl",
|
|
51
|
-
"label": "Stylus(.styl) [ http://stylus-lang.com ]"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"value": "less",
|
|
55
|
-
"label": "LESS [ http://lesscss.org ]"
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"value": "styled-components",
|
|
59
|
-
"label": "styled-components [ https://styled-components.com ]"
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"value": "@emotion/styled",
|
|
63
|
-
"label": "emotion [ https://emotion.sh ]"
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"value": "styled-jsx",
|
|
67
|
-
"label": "styled-jsx [ https://www.npmjs.com/package/styled-jsx ]"
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"value": "none",
|
|
71
|
-
"label": "None"
|
|
72
|
-
}
|
|
73
|
-
]
|
|
74
|
-
},
|
|
75
|
-
"x-priority": "important"
|
|
76
|
-
},
|
|
77
|
-
"withTests": {
|
|
78
|
-
"type": "boolean",
|
|
79
|
-
"description": "When true, creates a `spec.ts` test file for the new page.",
|
|
80
|
-
"default": false
|
|
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
|
-
"skipFormat": {
|
|
99
|
-
"description": "Skip formatting files.",
|
|
100
|
-
"type": "boolean",
|
|
101
|
-
"default": false,
|
|
102
|
-
"x-priority": "internal"
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
"required": ["name", "project"],
|
|
106
|
-
"examplesFile": "../../../docs/page-examples.md"
|
|
107
|
-
}
|