Colum Ferry a468d72c7f
feat(react): add support for React 19 for new Workspaces (#29286)
## Current Behavior
We currently have no support for React 19, generating only React 18
applications.

## Expected Behavior
Add utils to determine what version of React is installed in the
workspace.
If React 18 is the main version of react installed, continue to generate
React 18 projects.
If React 19 is the main version of react installed, generate React 19
projects.
If no React version is installed or can be determined, generate React 19
projects.
2025-01-17 15:14:48 +00:00

131 lines
4.3 KiB
JSON

{
"name": "preset",
"factory": "./src/generators/preset/preset#presetGenerator",
"schema": {
"$schema": "https://json-schema.org/schema",
"$id": "NxWorkspacePreset",
"cli": "nx",
"title": "Creates applications in a new workspace",
"description": "Creates applications in a new workspace.",
"type": "object",
"properties": {
"preset": { "description": "The name of the preset.", "type": "string" },
"name": {
"description": "The name of the application.",
"type": "string"
},
"linter": {
"description": "The tool to use for running lint checks.",
"type": "string",
"enum": ["eslint", "none"],
"default": "eslint"
},
"routing": {
"description": "Add routing to the generated application.",
"type": "boolean",
"default": true
},
"style": {
"description": "The file extension to be used for style files.",
"type": "string",
"default": "css",
"x-prompt": {
"message": "Which stylesheet format would you like to use?",
"type": "list",
"items": [
{ "value": "css", "label": "CSS" },
{
"value": "scss",
"label": "SASS(.scss) [ https://sass-lang.com ]"
},
{
"value": "less",
"label": "LESS [ https://lesscss.org ]"
}
]
}
},
"standaloneApi": {
"description": "Use Standalone Components if generating an Angular application.",
"type": "boolean",
"default": false
},
"standaloneConfig": {
"description": "Split the project configurations into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
"type": "boolean",
"default": true,
"x-deprecated": "Nx only supports standaloneConfig"
},
"packageManager": {
"description": "The package manager used to install dependencies.",
"type": "string",
"enum": ["npm", "yarn", "pnpm", "bun"]
},
"framework": {
"description": "The framework which the application is using",
"type": "string",
"enum": ["express", "koa", "fastify", "nest", "none"]
},
"bundler": {
"description": "The bundler to use for building the application.",
"type": "string",
"enum": ["vite", "rspack", "rsbuild", "esbuild", "webpack"],
"default": "vite"
},
"docker": {
"description": "Generate a Dockerfile",
"type": "boolean",
"default": false
},
"nextAppDir": {
"description": "Enable the App Router for this project.",
"type": "boolean",
"default": true
},
"nextSrcDir": {
"description": "Generate a `src` directory for this project.",
"type": "boolean",
"default": true
},
"e2eTestRunner": {
"description": "The tool to use for running e2e tests.",
"type": "string",
"enum": ["playwright", "cypress", "jest", "detox", "none"]
},
"ssr": {
"description": "Enable Server-Side Rendering (SSR) and Static Site Generation (SSG/Prerendering) for the Angular application.",
"type": "boolean",
"default": false
},
"serverRouting": {
"description": "Use the Angular Server Routing and App Engine APIs (Developer Preview).",
"type": "boolean"
},
"prefix": {
"description": "The prefix to use for Angular component and directive selectors.",
"type": "string"
},
"formatter": {
"description": "The tool to use for code formatting.",
"type": "string",
"enum": ["none", "prettier"],
"default": "none"
},
"workspaces": {
"description": "Whether to use package manager workspaces.",
"type": "boolean",
"default": false
}
},
"required": ["preset", "name"],
"presets": []
},
"description": "Create application in an empty workspace.",
"x-use-standalone-layout": true,
"hidden": true,
"implementation": "/packages/workspace/src/generators/preset/preset#presetGenerator.ts",
"aliases": [],
"path": "/packages/workspace/src/generators/preset/schema.json",
"type": "generator"
}