UNPKG

@stonx/elysia

Version:

[![npm version](https://img.shields.io/npm/v/@stonx/elysia.svg)](https://www.npmjs.com/package/@stonx/elysia) [![license: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![Nx compatibility](https://img.shie

36 lines (35 loc) 1.64 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.updateTsConfig = updateTsConfig; const devkit_1 = require("@nx/devkit"); const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup"); function updateTsConfig(tree, options) { (0, devkit_1.updateJson)(tree, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.app.json'), (json) => { json.compilerOptions.experimentalDecorators = true; json.compilerOptions.emitDecoratorMetadata = true; json.compilerOptions.target = 'es2021'; if (options.strict) { json.compilerOptions = { ...json.compilerOptions, strictNullChecks: true, noImplicitAny: true, strictBindCallApply: true, forceConsistentCasingInFileNames: true, noFallthroughCasesInSwitch: true }; } return json; }); // For TS solution, we don't extend from shared tsconfig.json, so we need to make sure decorators are also turned on for spec tsconfig. if ((0, ts_solution_setup_1.isUsingTsSolutionSetup)(tree)) { const tsconfigSpecPath = (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.spec.json'); if (tree.exists(tsconfigSpecPath)) { (0, devkit_1.updateJson)(tree, tsconfigSpecPath, (json) => { json.compilerOptions ??= {}; json.compilerOptions.experimentalDecorators = true; json.compilerOptions.emitDecoratorMetadata = true; return json; }); } } }