{ "$schema": "https://json-schema.org/schema", "cli": "nx", "$id": "NxNextLibrary", "title": "Create a Next.js Library for Nx", "description": "Create a Next.js library for an Nx workspace. Same output as `@nx/react:library`, plus a `server` entry point for React Server Components and the Next.js type declarations.", "type": "object", "properties": { "directory": { "type": "string", "description": "A directory where the lib is placed.", "alias": "dir", "$default": { "$source": "argv", "index": 0 }, "x-prompt": "Which directory do you want to create the library in?" }, "name": { "type": "string", "description": "Library name", "pattern": "(?:^@[a-zA-Z0-9-*~][a-zA-Z0-9-*._~]*\\/[a-zA-Z0-9-~][a-zA-Z0-9-._~]*|^[a-zA-Z][^:]*)$", "x-priority": "important" }, "style": { "description": "The file extension to be used for style files.", "type": "string", "default": "css", "alias": "s", "enum": ["css", "scss", "none"], "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": "none", "label": "None" } ] } }, "bundler": { "type": "string", "description": "The bundler to use. Choosing 'none' means this library is not buildable.", "enum": ["none", "vite", "rollup"], "default": "none", "x-prompt": "Which bundler would you like to use to build the library? Choose 'none' to skip build setup.", "x-priority": "important" }, "linter": { "description": "The tool to use for running lint checks. Defaults to the linter the workspace already uses.", "type": "string", "enum": ["eslint", "oxlint", "none"], "x-priority": "important" }, "unitTestRunner": { "type": "string", "enum": ["vitest", "jest", "none"], "description": "Test runner to use for unit tests.", "default": "none", "x-prompt": "What unit test runner should be used?", "x-priority": "important" }, "inSourceTests": { "type": "boolean", "default": false, "description": "When using Vitest, separate spec files will not be generated and instead will be included within the source files." }, "tags": { "type": "string", "description": "Add tags to the library (used for linting).", "alias": "t" }, "skipFormat": { "description": "Skip formatting files.", "type": "boolean", "default": false, "x-priority": "internal" }, "skipTsConfig": { "type": "boolean", "default": false, "description": "Do not update `tsconfig.json` for development experience.", "x-priority": "internal" }, "routing": { "type": "boolean", "description": "Generate library with routes." }, "appProject": { "type": "string", "description": "The application project to add the library route to.", "alias": "a" }, "publishable": { "type": "boolean", "description": "Create a publishable library." }, "buildable": { "type": "boolean", "default": false, "description": "Generate a buildable library that uses rollup to bundle.", "x-deprecated": "Use the `bundler` option for greater control (none, vite, rollup)." }, "importPath": { "type": "string", "description": "The library name used to import it, like `@myorg/my-awesome-lib`." }, "component": { "type": "boolean", "description": "Generate a default component.", "default": true }, "js": { "type": "boolean", "description": "Generate JavaScript files rather than TypeScript files.", "default": false }, "globalCss": { "type": "boolean", "description": "When `true`, the stylesheet is generated using global CSS instead of CSS modules (e.g. file is `*.css` rather than `*.module.css`).", "default": false }, "strict": { "type": "boolean", "description": "Whether to enable tsconfig strict mode or not.", "default": true }, "enableTypedLinting": { "type": "boolean", "description": "Whether to enable typed linting. For flat configs, this configures the recommended `parserOptions.projectService` and `tsconfigRootDir`. For legacy `.eslintrc` configs, this configures `parserOptions.project`. We do not enable this by default for lint performance reasons.", "default": false }, "compiler": { "type": "string", "enum": ["babel", "swc"], "default": "babel", "description": "Which compiler to use." }, "skipPackageJson": { "type": "boolean", "default": false, "description": "Do not add dependencies to `package.json`.", "x-priority": "internal" }, "useProjectJson": { "type": "boolean", "description": "Use a `project.json` configuration file instead of inlining the Nx configuration in the `package.json` file." } }, "required": ["directory"], "examplesFile": "../../../docs/library-examples.md" }