vls-openapi-generator 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,5 @@
1
+ module.exports = {
2
+ extends: ['@commitlint/config-conventional'],
3
+ plugins: [],
4
+ rules: {}
5
+ };
@@ -0,0 +1,58 @@
1
+ name: CI/CD Pipeline
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - main
7
+ push:
8
+ branches:
9
+ - main
10
+
11
+ jobs:
12
+ release:
13
+ if: github.event_name == 'push'
14
+ runs-on: ubuntu-latest
15
+ steps:
16
+ - name: Checkout code
17
+ uses: actions/checkout@v3
18
+
19
+ - name: Set up Node.js
20
+ uses: actions/setup-node@v3
21
+ with:
22
+ node-version: '20'
23
+ registry-url: 'https://registry.npmjs.org/'
24
+
25
+ - name: Install dependencies
26
+ run: npm install
27
+
28
+ - name: Build project
29
+ run: npm run build
30
+
31
+ - name: Release with Semantic
32
+ run: npx semantic-release
33
+ env:
34
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_FOR_VLS }}
35
+
36
+ build:
37
+ if: github.event_name == 'pull_request'
38
+ runs-on: ubuntu-latest
39
+ steps:
40
+ - name: Checkout code
41
+ uses: actions/checkout@v3
42
+
43
+ - name: Set up Node.js
44
+ uses: actions/setup-node@v3
45
+ with:
46
+ node-version: '20'
47
+
48
+ - name: Install dependencies
49
+ run: npm install
50
+
51
+ - name: Run Prettier check
52
+ run: npx prettier --check .
53
+
54
+ - name: Lint check
55
+ run: npx eslint .
56
+
57
+ - name: Build project
58
+ run: npm run build
@@ -0,0 +1,23 @@
1
+ name: Security AllInOne
2
+ on:
3
+ push:
4
+ branches:
5
+ - feature/*
6
+ pull_request:
7
+ types:
8
+ - opened
9
+ - closed
10
+ - ready_for_review
11
+ jobs:
12
+ build:
13
+ runs-on:
14
+ group: default
15
+ labels: self-hosted
16
+ steps:
17
+ - name: Trigger to Insider Security
18
+ run: |
19
+ curl -X POST -H "Content-Type: application/json" \
20
+ -d '{"type": "security-allinone", "version": "v1", "repository": "${{ github.event.repository.name }}", "ref": "${{ github.head_ref || github.ref_name }}", "event_name": "${{ github.event_name }}", "event_action": "${{ github.event.action }}", "default_branch": "${{ github.event.repository.default_branch }}"}' \
21
+ $INSECPROXY_HOOK
22
+ env:
23
+ INSECPROXY_HOOK: ${{ secrets.INSECPROXY_HOOK }}
@@ -0,0 +1 @@
1
+ npx --no-install commitlint --edit "$1"
@@ -0,0 +1,2 @@
1
+ npm run check-format
2
+ npm run check-lint
@@ -0,0 +1,4 @@
1
+ *.js
2
+ dist
3
+ node_modules
4
+ .eslintcache
@@ -0,0 +1,7 @@
1
+ {
2
+ "semi": true,
3
+ "trailingComma": "none",
4
+ "singleQuote": true,
5
+ "printWidth": 120,
6
+ "tabWidth": 4
7
+ }
package/README.md ADDED
@@ -0,0 +1,18 @@
1
+ ## Technologies
2
+
3
+ - [Node.js](https://nodejs.org/en/)
4
+ - [Typescript](https://www.typescriptlang.org/)
5
+
6
+ ## Dependent Libraries
7
+
8
+ - [Zod](https://www.npmjs.com/package/zod)
9
+
10
+ ## Optional Libraries
11
+
12
+ - [Zod-Openapi](https://www.npmjs.com/package/@anatine/zod-openapi)
13
+
14
+ ## Usage
15
+
16
+ `npm install vls-openapi-generator`
17
+
18
+ npx run vls-openapi-generator
package/SECURITY.MD ADDED
@@ -0,0 +1,7 @@
1
+ # Security Policy
2
+
3
+ ## Reporting a Vulnerability
4
+
5
+ To securely report a vulnerability, please [Contact us!](mailto:security@useinsider.com?subject=[GitHub]_Vulnerability!).
6
+
7
+ <!-- E26CADE3-DF7C-4FF8-A30A-4DD2F28E06BF -->
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import 'module-alias/register.js';
@@ -0,0 +1,137 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
36
+ Object.defineProperty(exports, "__esModule", { value: true });
37
+ const zod_openapi_1 = require("@anatine/zod-openapi");
38
+ const child_process_1 = require("child_process");
39
+ const fs_1 = require("fs");
40
+ require("module-alias/register.js");
41
+ const path = __importStar(require("path"));
42
+ const util_1 = require("util");
43
+ const zod_1 = require("zod");
44
+ const OPENAPI_FILE = path.join(process.cwd(), 'openapi.json');
45
+ const HANDLERS_DIR = path.join(process.cwd(), 'dist', 'src', 'handlers');
46
+ const SCHEMAS_DIR = path.join(process.cwd(), 'dist', 'src', 'schemas');
47
+ const OUTPUT_FILE = path.join(process.cwd(), 'openapi.json');
48
+ const generateTemplate = async () => {
49
+ console.info('Generating Open API documentation...');
50
+ await (0, util_1.promisify)(child_process_1.exec)('npx tsc');
51
+ const handlerFiles = await fs_1.promises.readdir(HANDLERS_DIR);
52
+ const existingOpenAPIFile = JSON.parse(await fs_1.promises.readFile(OPENAPI_FILE, 'utf-8'));
53
+ existingOpenAPIFile.paths = {};
54
+ existingOpenAPIFile.components = {
55
+ parameters: {},
56
+ schemas: {}
57
+ };
58
+ for (const handler of handlerFiles) {
59
+ const fileName = path.parse(handler).name;
60
+ const { bodySchema, queryParametersSchema, eventResponseParametersSchema, eventResponseModulesSchema } = (await Promise.resolve(`${path.join(SCHEMAS_DIR, fileName + '.js')}`).then(s => __importStar(require(s))).catch(() => ({})));
61
+ const { OPENAPI_CONFIG: openAPIConfig } = (await Promise.resolve(`${path.join(HANDLERS_DIR, fileName + '.js')}`).then(s => __importStar(require(s))).catch(() => ({})));
62
+ const bodyComponent = (0, zod_openapi_1.generateSchema)(bodySchema ?? zod_1.z.never(), undefined, '3.0');
63
+ const queryParametersComponent = (0, zod_openapi_1.generateSchema)(queryParametersSchema ?? zod_1.z.never(), undefined, '3.0');
64
+ const eventResponseComponent = (0, zod_openapi_1.generateSchema)(zod_1.z.object({
65
+ ...(eventResponseParametersSchema ? { params: eventResponseParametersSchema } : {}),
66
+ ...(eventResponseModulesSchema ? { modules: eventResponseModulesSchema } : {})
67
+ }), undefined, '3.0');
68
+ if (bodySchema) {
69
+ existingOpenAPIFile.components.schemas[`${fileName}-request-body`] = bodyComponent;
70
+ }
71
+ const queryParameterKeys = [];
72
+ if (queryParametersSchema) {
73
+ for (const key in queryParametersComponent.properties) {
74
+ const properties = queryParametersComponent?.properties;
75
+ if (!properties || !properties[key]) {
76
+ continue;
77
+ }
78
+ const queryParameterKey = `${fileName}-${key}-query-parameter`;
79
+ queryParameterKeys.push(queryParameterKey);
80
+ existingOpenAPIFile.components.parameters[queryParameterKey] = {
81
+ name: key,
82
+ in: 'query',
83
+ required: true,
84
+ schema: properties[key]
85
+ };
86
+ }
87
+ }
88
+ if (eventResponseParametersSchema || eventResponseModulesSchema) {
89
+ existingOpenAPIFile.components.schemas[`${fileName}-response`] = eventResponseComponent;
90
+ }
91
+ existingOpenAPIFile.paths['/' + fileName] = {
92
+ post: {
93
+ tags: openAPIConfig.tags,
94
+ parameters: queryParametersSchema
95
+ ? queryParameterKeys.map((x) => {
96
+ return {
97
+ $ref: `#/components/parameters/${x}`
98
+ };
99
+ })
100
+ : undefined,
101
+ requestBody: bodySchema
102
+ ? {
103
+ required: true,
104
+ content: {
105
+ 'application/json': {
106
+ schema: {
107
+ $ref: `#/components/schemas/${fileName}-request-body`
108
+ }
109
+ }
110
+ }
111
+ }
112
+ : undefined,
113
+ responses: {
114
+ '200': {
115
+ description: `Successful response.`,
116
+ content: eventResponseParametersSchema || eventResponseModulesSchema
117
+ ? {
118
+ 'application/json': {
119
+ schema: {
120
+ $ref: `#/components/schemas/${fileName}-response`
121
+ }
122
+ }
123
+ }
124
+ : undefined
125
+ }
126
+ }
127
+ }
128
+ };
129
+ }
130
+ await fs_1.promises.writeFile(OUTPUT_FILE, JSON.stringify(existingOpenAPIFile, undefined, 4));
131
+ };
132
+ generateTemplate()
133
+ .then(() => console.info('Open API documentation generated successfully'))
134
+ .catch((error) => {
135
+ console.error(error);
136
+ process.exit(1);
137
+ });
@@ -0,0 +1,3 @@
1
+ export type OpenAPIConfig = {
2
+ tags: string[];
3
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,52 @@
1
+ export type OpenAPI = {
2
+ openapi: '3.0.0';
3
+ info: {
4
+ title: string;
5
+ version: string;
6
+ };
7
+ servers: [
8
+ {
9
+ url: string;
10
+ },
11
+ {
12
+ url: string;
13
+ },
14
+ {
15
+ url: string;
16
+ }
17
+ ];
18
+ paths: Record<string, {
19
+ post: {
20
+ parameters: {
21
+ $ref: string;
22
+ }[] | undefined;
23
+ requestBody: {
24
+ required: true;
25
+ content: {
26
+ 'application/json': {
27
+ schema: {
28
+ $ref: `#/components/schemas/${string}-request-body`;
29
+ };
30
+ };
31
+ };
32
+ } | undefined;
33
+ responses: {
34
+ 200: {
35
+ description: string;
36
+ content: {
37
+ 'application/json': {
38
+ schema: {
39
+ $ref: `#/components/schemas/${string}-response`;
40
+ };
41
+ };
42
+ } | undefined;
43
+ };
44
+ };
45
+ tags: string[];
46
+ };
47
+ }>;
48
+ components: {
49
+ parameters: Record<string, object>;
50
+ schemas: Record<string, object>;
51
+ };
52
+ };
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,42 @@
1
+ import eslintJS from '@eslint/js';
2
+ import tseslint from 'typescript-eslint';
3
+
4
+ const ignoreList = ['**/*.js', '**/*.mjs', 'dist/**/*', 'node_modules/**/*', '.eslintcache'];
5
+
6
+ const targetList = ['src/**/*.ts'];
7
+
8
+ export default tseslint.config(
9
+ {
10
+ ...eslintJS.configs.recommended,
11
+ ignores: ignoreList
12
+ },
13
+ ...tseslint.configs.recommendedTypeChecked.map((x) => ({
14
+ ...x,
15
+ files: targetList,
16
+ ignores: ignoreList
17
+ })),
18
+ ...tseslint.configs.stylistic.map((x) => ({
19
+ ...x,
20
+ files: targetList,
21
+ ignores: ignoreList
22
+ })),
23
+ {
24
+ ignores: ignoreList,
25
+ languageOptions: {
26
+ parserOptions: {
27
+ projectService: true,
28
+ tsconfigRootDir: import.meta.dirname
29
+ }
30
+ },
31
+ files: ['src/**/*.ts'],
32
+ rules: {
33
+ '@typescript-eslint/no-unused-vars': [
34
+ 'error',
35
+ { caughtErrors: 'all', caughtErrorsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_' }
36
+ ],
37
+ curly: 'error',
38
+ '@typescript-eslint/consistent-type-definitions': ['error', 'type'],
39
+ 'no-multiple-empty-lines': ['error', { max: 1, maxEOF: 1 }]
40
+ }
41
+ }
42
+ );
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "vls-openapi-generator",
3
+ "version": "1.0.1",
4
+ "main": "dist/generate-template.js",
5
+ "types": "dist/lambda-type.d.ts",
6
+ "scripts": {
7
+ "check-format": "prettier . --check",
8
+ "fix-format": "prettier . --write",
9
+ "build": "tsc",
10
+ "check-lint": "eslint . --cache",
11
+ "fix-lint": "eslint . --fix",
12
+ "prepare": "husky"
13
+ },
14
+ "author": "Volans Team",
15
+ "license": "ISC",
16
+ "description": "VLS Open API Generator",
17
+ "dependencies": {
18
+ "@anatine/zod-openapi": "^2.2.7",
19
+ "module-alias": "^2.2.3"
20
+ },
21
+ "devDependencies": {
22
+ "@commitlint/config-conventional": "^19.5.0",
23
+ "@eslint/js": "^9.12.0",
24
+ "@semantic-release/git": "^10.0.1",
25
+ "@semantic-release/npm": "^12.0.1",
26
+ "@types/node": "^20.14.8",
27
+ "commitlint": "^19.5.0",
28
+ "eslint": "^9.12.0",
29
+ "globals": "^15.11.0",
30
+ "husky": "^9.1.6",
31
+ "prettier": "^2.7.1",
32
+ "semantic-release": "^24.1.2",
33
+ "typescript": "^5.6.3",
34
+ "typescript-eslint": "^8.9.0"
35
+ },
36
+ "bin": {
37
+ "vls-openapi-generator": "dist/generate-template.js"
38
+ }
39
+ }
@@ -0,0 +1,15 @@
1
+ module.exports = {
2
+ branches: ['main'],
3
+ plugins: [
4
+ '@semantic-release/commit-analyzer',
5
+ '@semantic-release/release-notes-generator',
6
+ '@semantic-release/npm',
7
+ [
8
+ '@semantic-release/git',
9
+ {
10
+ assets: ['package.json'],
11
+ message: 'chore(release): ${nextRelease.version} [skip ci]'
12
+ }
13
+ ]
14
+ ]
15
+ };
@@ -0,0 +1,141 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { generateSchema, OpenApiZodAny } from '@anatine/zod-openapi';
4
+ import { exec } from 'child_process';
5
+ import { promises as fs } from 'fs';
6
+ import 'module-alias/register.js';
7
+ import * as path from 'path';
8
+ import { promisify } from 'util';
9
+ import { z } from 'zod';
10
+ import { OpenAPIConfig } from './lambda-type';
11
+ import { OpenAPI } from './openapi-type';
12
+
13
+ const OPENAPI_FILE = path.join(process.cwd(), 'openapi.json');
14
+ const HANDLERS_DIR = path.join(process.cwd(), 'dist', 'src', 'handlers');
15
+ const SCHEMAS_DIR = path.join(process.cwd(), 'dist', 'src', 'schemas');
16
+ const OUTPUT_FILE = path.join(process.cwd(), 'openapi.json');
17
+
18
+ const generateTemplate = async (): Promise<void> => {
19
+ console.info('Generating Open API documentation...');
20
+
21
+ await promisify(exec)('npx tsc');
22
+
23
+ const handlerFiles = await fs.readdir(HANDLERS_DIR);
24
+ const existingOpenAPIFile = JSON.parse(await fs.readFile(OPENAPI_FILE, 'utf-8')) as OpenAPI;
25
+
26
+ existingOpenAPIFile.paths = {};
27
+ existingOpenAPIFile.components = {
28
+ parameters: {},
29
+ schemas: {}
30
+ };
31
+
32
+ for (const handler of handlerFiles) {
33
+ const fileName = path.parse(handler).name;
34
+
35
+ const { bodySchema, queryParametersSchema, eventResponseParametersSchema, eventResponseModulesSchema } =
36
+ (await import(path.join(SCHEMAS_DIR, fileName + '.js')).catch(() => ({}))) as {
37
+ bodySchema?: OpenApiZodAny;
38
+ eventResponseParametersSchema?: OpenApiZodAny;
39
+ eventResponseModulesSchema?: OpenApiZodAny;
40
+ queryParametersSchema?: OpenApiZodAny;
41
+ };
42
+
43
+ const { OPENAPI_CONFIG: openAPIConfig } = (await import(path.join(HANDLERS_DIR, fileName + '.js')).catch(
44
+ () => ({})
45
+ )) as {
46
+ OPENAPI_CONFIG: OpenAPIConfig;
47
+ };
48
+
49
+ const bodyComponent = generateSchema(bodySchema ?? z.never(), undefined, '3.0');
50
+ const queryParametersComponent = generateSchema(queryParametersSchema ?? z.never(), undefined, '3.0');
51
+ const eventResponseComponent = generateSchema(
52
+ z.object({
53
+ ...(eventResponseParametersSchema ? { params: eventResponseParametersSchema } : {}),
54
+ ...(eventResponseModulesSchema ? { modules: eventResponseModulesSchema } : {})
55
+ }),
56
+ undefined,
57
+ '3.0'
58
+ );
59
+
60
+ if (bodySchema) {
61
+ existingOpenAPIFile.components.schemas[`${fileName}-request-body`] = bodyComponent;
62
+ }
63
+
64
+ const queryParameterKeys = [];
65
+
66
+ if (queryParametersSchema) {
67
+ for (const key in queryParametersComponent.properties) {
68
+ const properties = queryParametersComponent?.properties;
69
+
70
+ if (!properties || !properties[key]) {
71
+ continue;
72
+ }
73
+
74
+ const queryParameterKey = `${fileName}-${key}-query-parameter`;
75
+
76
+ queryParameterKeys.push(queryParameterKey);
77
+
78
+ existingOpenAPIFile.components.parameters[queryParameterKey] = {
79
+ name: key,
80
+ in: 'query',
81
+ required: true,
82
+ schema: properties[key]
83
+ };
84
+ }
85
+ }
86
+
87
+ if (eventResponseParametersSchema || eventResponseModulesSchema) {
88
+ existingOpenAPIFile.components.schemas[`${fileName}-response`] = eventResponseComponent;
89
+ }
90
+
91
+ existingOpenAPIFile.paths['/' + fileName] = {
92
+ post: {
93
+ tags: openAPIConfig.tags,
94
+ parameters: queryParametersSchema
95
+ ? queryParameterKeys.map((x) => {
96
+ return {
97
+ $ref: `#/components/parameters/${x}`
98
+ };
99
+ })
100
+ : undefined,
101
+ requestBody: bodySchema
102
+ ? {
103
+ required: true,
104
+ content: {
105
+ 'application/json': {
106
+ schema: {
107
+ $ref: `#/components/schemas/${fileName}-request-body`
108
+ }
109
+ }
110
+ }
111
+ }
112
+ : undefined,
113
+ responses: {
114
+ '200': {
115
+ description: `Successful response.`,
116
+ content:
117
+ eventResponseParametersSchema || eventResponseModulesSchema
118
+ ? {
119
+ 'application/json': {
120
+ schema: {
121
+ $ref: `#/components/schemas/${fileName}-response`
122
+ }
123
+ }
124
+ }
125
+ : undefined
126
+ }
127
+ }
128
+ }
129
+ };
130
+ }
131
+
132
+ await fs.writeFile(OUTPUT_FILE, JSON.stringify(existingOpenAPIFile, undefined, 4));
133
+ };
134
+
135
+ generateTemplate()
136
+ .then(() => console.info('Open API documentation generated successfully'))
137
+ .catch((error) => {
138
+ console.error(error);
139
+
140
+ process.exit(1);
141
+ });
@@ -0,0 +1,3 @@
1
+ export type OpenAPIConfig = {
2
+ tags: string[];
3
+ };
@@ -0,0 +1,53 @@
1
+ export type OpenAPI = {
2
+ openapi: '3.0.0';
3
+ info: { title: string; version: string };
4
+ servers: [
5
+ { url: string },
6
+ {
7
+ url: string;
8
+ },
9
+
10
+ {
11
+ url: string;
12
+ }
13
+ ];
14
+ paths: Record<
15
+ string,
16
+ {
17
+ post: {
18
+ parameters: { $ref: string }[] | undefined;
19
+ requestBody:
20
+ | {
21
+ required: true;
22
+ content: {
23
+ 'application/json': {
24
+ schema: {
25
+ $ref: `#/components/schemas/${string}-request-body`;
26
+ };
27
+ };
28
+ };
29
+ }
30
+ | undefined;
31
+ responses: {
32
+ 200: {
33
+ description: string;
34
+ content:
35
+ | {
36
+ 'application/json': {
37
+ schema: {
38
+ $ref: `#/components/schemas/${string}-response`;
39
+ };
40
+ };
41
+ }
42
+ | undefined;
43
+ };
44
+ };
45
+ tags: string[];
46
+ };
47
+ }
48
+ >;
49
+ components: {
50
+ parameters: Record<string, object>;
51
+ schemas: Record<string, object>;
52
+ };
53
+ };
package/tsconfig.json ADDED
@@ -0,0 +1,110 @@
1
+ {
2
+ "compilerOptions": {
3
+ /* Visit https://aka.ms/tsconfig to read more about this file */
4
+
5
+ /* Projects */
6
+ // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */
7
+ // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */
8
+ // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */
9
+ // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */
10
+ // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */
11
+ // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
12
+
13
+ /* Language and Environment */
14
+ "target": "ES2020" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
15
+ // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
16
+ // "jsx": "preserve", /* Specify what JSX code is generated. */
17
+ "experimentalDecorators": true /* Enable experimental support for legacy experimental decorators. */,
18
+ "emitDecoratorMetadata": true /* Emit design-type metadata for decorated declarations in source files. */,
19
+ // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */
20
+ // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */
21
+ // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */
22
+ // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */
23
+ // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */
24
+ // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */
25
+ // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
26
+
27
+ /* Modules */
28
+ "module": "commonjs" /* Specify what module code is generated. */,
29
+ "rootDir": "src" /* Specify the root folder within your source files. */,
30
+ // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */
31
+ // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
32
+ // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
33
+ // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
34
+ // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */
35
+ // "types": [], /* Specify type package names to be included without being referenced in a source file. */
36
+ // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
37
+ // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */
38
+ // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */
39
+ // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */
40
+ // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */
41
+ // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */
42
+ "resolveJsonModule": true /* Enable importing .json files. */,
43
+ // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */
44
+ // "noResolve": true, /* Disallow 'import's, 'require's or '<reference>'s from expanding the number of files TypeScript should add to a project. */
45
+
46
+ /* JavaScript Support */
47
+ // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */
48
+ // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */
49
+ // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */
50
+
51
+ /* Emit */
52
+ "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */,
53
+ // "declarationMap": true, /* Create sourcemaps for d.ts files. */
54
+ // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
55
+ // "sourceMap": true /* Create source map files for emitted JavaScript files. */,
56
+ // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */
57
+ // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
58
+ "outDir": "dist" /* Specify an output folder for all emitted files. */,
59
+ // "removeComments": true, /* Disable emitting comments. */
60
+ // "noEmit": true, /* Disable emitting files from a compilation. */
61
+ // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
62
+ // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */
63
+ // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */
64
+ // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */
65
+ // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */
66
+ // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */
67
+ // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */
68
+ // "newLine": "crlf", /* Set the newline character for emitting files. */
69
+ // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */
70
+ // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */
71
+ // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */
72
+ "preserveConstEnums": true /* Disable erasing 'const enum' declarations in generated code. */,
73
+ // "declarationDir": "./", /* Specify the output directory for generated declaration files. */
74
+ // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */
75
+
76
+ /* Interop Constraints */
77
+ // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
78
+ // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */
79
+ // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
80
+ "esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
81
+ // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
82
+ "forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
83
+
84
+ /* Type Checking */
85
+ "strict": true /* Enable all strict type-checking options. */,
86
+ "noImplicitAny": true /* Enable error reporting for expressions and declarations with an implied 'any' type. */,
87
+ // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
88
+ // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
89
+ // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */
90
+ // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */
91
+ // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */
92
+ // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */
93
+ // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */
94
+ // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */
95
+ // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */
96
+ // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */
97
+ // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */
98
+ // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */
99
+ // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */
100
+ // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */
101
+ // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */
102
+ // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */
103
+ // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */
104
+
105
+ /* Completeness */
106
+ // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
107
+ "skipLibCheck": true /* Skip type checking all .d.ts files. */
108
+ },
109
+ "exclude": ["node_modules", "dist"]
110
+ }