UNPKG

3.16 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 },
29 "linter": {
30 "description": "The tool to use for running lint checks.",
31 "type": "string",
32 "enum": ["eslint"],
33 "default": "eslint"
34 },
35 "unitTestRunner": {
36 "type": "string",
37 "enum": ["jest", "none"],
38 "description": "Test runner to use for unit tests.",
39 "default": "jest"
40 },
41 "tags": {
42 "type": "string",
43 "description": "Add tags to the library (used for linting)."
44 },
45 "skipFormat": {
46 "description": "Skip formatting files.",
47 "type": "boolean",
48 "default": false
49 },
50 "skipTsConfig": {
51 "type": "boolean",
52 "description": "Do not update `tsconfig.json` for development experience.",
53 "default": false
54 },
55 "testEnvironment": {
56 "type": "string",
57 "enum": ["jsdom", "node"],
58 "description": "The test environment to use if `unitTestRunner` is set to `jest`.",
59 "default": "jsdom"
60 },
61 "importPath": {
62 "type": "string",
63 "description": "The library name used to import it, like `@myorg/my-awesome-lib`."
64 },
65 "babelJest": {
66 "type": "boolean",
67 "description": "Use `babel` instead `ts-jest`.",
68 "default": false
69 },
70 "pascalCaseFiles": {
71 "type": "boolean",
72 "description": "Use pascal case file names.",
73 "alias": "P",
74 "default": false
75 },
76 "js": {
77 "type": "boolean",
78 "description": "Generate JavaScript files rather than TypeScript files.",
79 "default": false
80 },
81 "strict": {
82 "type": "boolean",
83 "description": "Whether to enable `tsconfig` strict mode or not.",
84 "default": true
85 },
86 "skipBabelrc": {
87 "type": "boolean",
88 "description": "Do not generate `.babelrc` file. Useful for Node libraries that are not compiled by Babel.",
89 "default": false
90 },
91 "buildable": {
92 "type": "boolean",
93 "default": false,
94 "description": "Generate a buildable library."
95 },
96 "setParserOptionsProject": {
97 "type": "boolean",
98 "description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
99 "default": false
100 },
101 "standaloneConfig": {
102 "description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
103 "type": "boolean"
104 }
105 },
106 "required": ["name"]
107}