Leosvel Pérez Espinosa cbf80c18d1
feat(misc): add useProjectJson flag to project generators (#30319)
Add a `useProjectJson` option to project generators to allow users to
opt in/out of generating the Nx configuration in a `project.json` file.

## Current Behavior

## Expected Behavior

## Related Issue(s)

Fixes #
2025-03-11 12:12:03 -04:00

100 lines
3.3 KiB
JSON

{
"name": "library",
"implementation": "/packages/remix/src/generators/library/library.impl#remixLibraryGeneratorInternal.ts",
"schema": {
"$schema": "https://json-schema.org/schema",
"$id": "NxRemixLibrary",
"title": "Create a Library",
"description": "Generate a Remix library to help structure workspace and application.",
"type": "object",
"examples": [
{
"command": "g lib mylib --directory=myapp",
"description": "Generate libs/myapp/mylib"
}
],
"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-Z].*$",
"x-priority": "important"
},
"tags": {
"type": "string",
"description": "Add tags to the library (used for linting)"
},
"style": {
"type": "string",
"description": "Generate a stylesheet",
"enum": ["none", "css"],
"default": "css"
},
"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",
"x-prompt": "What test runner should be used?",
"default": "none",
"x-priority": "important"
},
"importPath": {
"type": "string",
"description": "The library name used to import it, like @myorg/my-awesome-lib"
},
"js": {
"type": "boolean",
"description": "Generate JavaScript files rather than TypeScript files",
"default": false
},
"skipFormat": {
"type": "boolean",
"description": "Skip formatting files after generator runs",
"default": false,
"x-priority": "internal"
},
"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)."
},
"useProjectJson": {
"type": "boolean",
"description": "Use a `project.json` configuration file instead of inlining the Nx configuration in the `package.json` file."
}
},
"required": ["directory"],
"presets": []
},
"description": "Generate a new library",
"aliases": ["lib"],
"x-type": "library",
"hidden": false,
"path": "/packages/remix/src/generators/library/schema.json",
"type": "generator"
}