UNPKG

3.34 kBJSONView Raw
1{
2 "$schema": "http://json-schema.org/schema",
3 "$id": "NxTypescriptLibrary",
4 "cli": "nx",
5 "title": "Create a TypeScript Library",
6 "description": "Create a TypeScript Library.",
7 "type": "object",
8 "examples": [
9 {
10 "command": "nx g lib mylib --directory=myapp",
11 "description": "Generate `libs/myapp/mylib`"
12 }
13 ],
14 "properties": {
15 "name": {
16 "type": "string",
17 "description": "Library name.",
18 "$default": {
19 "$source": "argv",
20 "index": 0
21 },
22 "x-prompt": "What name would you like to use for the library?",
23 "pattern": "^[a-zA-Z].*$"
24 },
25 "directory": {
26 "type": "string",
27 "description": "A directory where the lib is placed.",
28 "x-priority": "important"
29 },
30 "linter": {
31 "description": "The tool to use for running lint checks.",
32 "type": "string",
33 "enum": ["eslint"],
34 "default": "eslint"
35 },
36 "unitTestRunner": {
37 "type": "string",
38 "enum": ["jest", "none"],
39 "description": "Test runner to use for unit tests.",
40 "default": "jest"
41 },
42 "tags": {
43 "type": "string",
44 "description": "Add tags to the library (used for linting)."
45 },
46 "skipFormat": {
47 "description": "Skip formatting files.",
48 "type": "boolean",
49 "default": false,
50 "x-priority": "internal"
51 },
52 "skipTsConfig": {
53 "type": "boolean",
54 "description": "Do not update `tsconfig.json` for development experience.",
55 "default": false
56 },
57 "testEnvironment": {
58 "type": "string",
59 "enum": ["jsdom", "node"],
60 "description": "The test environment to use if `unitTestRunner` is set to `jest`.",
61 "default": "jsdom"
62 },
63 "importPath": {
64 "type": "string",
65 "description": "The library name used to import it, like `@myorg/my-awesome-lib`.",
66 "x-priority": "important"
67 },
68 "babelJest": {
69 "type": "boolean",
70 "description": "Use `babel` instead `ts-jest`.",
71 "default": false
72 },
73 "pascalCaseFiles": {
74 "type": "boolean",
75 "description": "Use pascal case file names.",
76 "alias": "P",
77 "default": false
78 },
79 "js": {
80 "type": "boolean",
81 "description": "Generate JavaScript files rather than TypeScript files.",
82 "default": false
83 },
84 "strict": {
85 "type": "boolean",
86 "description": "Whether to enable `tsconfig` strict mode or not.",
87 "default": true
88 },
89 "skipBabelrc": {
90 "type": "boolean",
91 "description": "Do not generate `.babelrc` file. Useful for Node libraries that are not compiled by Babel.",
92 "default": false
93 },
94 "buildable": {
95 "type": "boolean",
96 "default": false,
97 "description": "Generate a buildable library."
98 },
99 "setParserOptionsProject": {
100 "type": "boolean",
101 "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
102 "default": false
103 },
104 "standaloneConfig": {
105 "description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
106 "type": "boolean",
107 "default": true,
108 "x-deprecated": "Nx only supports standaloneConfig"
109 }
110 },
111 "required": ["name"]
112}