{ "name": "library", "factory": "./src/generators/library/library#libraryGeneratorInternal", "schema": { "$schema": "https://json-schema.org/schema", "cli": "nx", "$id": "NxReactLibrary", "title": "Create a React Library for Nx", "description": "Create a React Library for an Nx workspace.", "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", "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 ]" }, { "value": "tailwind", "label": "tailwind [ https://tailwindcss.com/ ]" }, { "value": "styled-components", "label": "styled-components [ https://styled-components.com ]" }, { "value": "@emotion/styled", "label": "emotion [ https://emotion.sh ]" }, { "value": "styled-jsx", "label": "styled-jsx [ https://www.npmjs.com/package/styled-jsx ]" }, { "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.", "type": "string", "enum": ["eslint", "none"], "default": "none", "x-prompt": "Which linter would you like to use?", "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" }, "tags": { "type": "string", "description": "Add tags to the library (used for linting).", "alias": "t" }, "skipFormat": { "description": "Skip formatting files.", "type": "boolean", "default": false }, "skipTsConfig": { "type": "boolean", "default": false, "description": "Do not update tsconfig.json for development experience." }, "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 }, "setParserOptionsProject": { "type": "boolean", "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.", "default": false }, "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": "## Examples\n\n{% tabs %}\n{% tab label=\"Create a new lib\" %}\n\n```shell\nnx g lib libs/my-lib\n```\n\n{% /tab %}\n{% tab label=\"Create a new lib under a directory\" %}\n\nThe following will create a library at `libs/shared/my-lib`.\n\n```shell\nnx g lib libs/shared/my-lib\n```\n\n{% /tab %}\n{% /tabs %}\n", "presets": [] }, "aliases": ["lib"], "x-type": "library", "description": "Create a library.", "implementation": "/packages/next/src/generators/library/library#libraryGeneratorInternal.ts", "hidden": false, "path": "/packages/next/src/generators/library/schema.json", "type": "generator" }