diff --git a/benchmark/package.json b/benchmark/package.json index 44741825ab..59a1a4de21 100644 --- a/benchmark/package.json +++ b/benchmark/package.json @@ -72,6 +72,6 @@ "suppress-warnings": "^1.0.2", "tstl": "^3.0.0", "uuid": "^9.0.1", - "typia": "../typia-6.10.1-dev.20240913.tgz" + "typia": "../typia-6.10.1-dev.20240914.tgz" } } \ No newline at end of file diff --git a/errors/package.json b/errors/package.json index dc5e46ff19..3807aaa840 100644 --- a/errors/package.json +++ b/errors/package.json @@ -32,6 +32,6 @@ "typescript": "^5.3.2" }, "dependencies": { - "typia": "../typia-6.10.1-dev.20240913.tgz" + "typia": "../typia-6.10.1-dev.20240914.tgz" } } \ No newline at end of file diff --git a/package.json b/package.json index ff033c6486..a26b01123d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "typia", - "version": "6.10.1-dev.20240913", + "version": "6.10.1-dev.20240914", "description": "Superfast runtime validators with only one line", "main": "lib/index.js", "typings": "lib/index.d.ts", @@ -70,6 +70,7 @@ "@samchon/openapi": "^1.0.0", "commander": "^10.0.0", "comment-json": "^4.2.3", + "glob": "^7.2.0", "inquirer": "^8.2.5", "package-manager-detector": "^0.2.0", "randexp": "^0.5.3" @@ -82,6 +83,7 @@ "@rollup/plugin-node-resolve": "^15.2.3", "@rollup/plugin-typescript": "^11.1.6", "@trivago/prettier-plugin-sort-imports": "^4.3.0", + "@types/glob": "^7.2.0", "@types/inquirer": "^8.2.5", "@types/node": "^18.15.12", "@types/ts-expose-internals": "npm:ts-expose-internals@5.5.4", diff --git a/packages/typescript-json/package.json b/packages/typescript-json/package.json index 21e0ff4527..23e7dbe27c 100644 --- a/packages/typescript-json/package.json +++ b/packages/typescript-json/package.json @@ -1,6 +1,6 @@ { "name": "typescript-json", - "version": "6.10.0", + "version": "6.10.1-dev.20240914", "description": "Superfast runtime validators with only one line", "main": "lib/index.js", "typings": "lib/index.d.ts", @@ -63,7 +63,7 @@ }, "homepage": "https://typia.io", "dependencies": { - "typia": "6.10.0" + "typia": "6.10.1-dev.20240914" }, "peerDependencies": { "typescript": ">=4.8.0 <5.7.0" diff --git a/src/executable/TypiaGenerateWizard.ts b/src/executable/TypiaGenerateWizard.ts index f3c5e55ac4..6aae752cfd 100644 --- a/src/executable/TypiaGenerateWizard.ts +++ b/src/executable/TypiaGenerateWizard.ts @@ -24,7 +24,7 @@ export namespace TypiaGenerateWizard { action, ) => { // PREPARE ASSETS - command.option("--input [path]", "input directory"); + command.option("--input [path]", "input directory or pattern"); command.option("--output [directory]", "output directory"); command.option("--project [project]", "tsconfig.json file location"); @@ -68,7 +68,7 @@ export namespace TypiaGenerateWizard { }; return action(async (options) => { - options.input ??= await input("input")("input directory"); + options.input ??= await input("input")("input directory or pattern"); options.output ??= await input("output")("output directory"); options.project ??= await configure(); return options as IArguments; diff --git a/src/executable/setup/SourceFinder.ts b/src/executable/setup/SourceFinder.ts new file mode 100644 index 0000000000..da3846e5f9 --- /dev/null +++ b/src/executable/setup/SourceFinder.ts @@ -0,0 +1,56 @@ +import fs from "fs"; +import glob from "glob"; +import path from "path"; + +export namespace SourceFinder { + export interface IProps { + exclude?: string[]; + include: string[]; + filter: (location: string) => boolean; + } + export const find = async (props: IProps): Promise => { + const dict: Set = new Set(); + + await emplace(props.filter)(props.include)((str) => dict.add(str)); + if (props.exclude?.length) + await emplace(props.filter)(props.exclude)((str) => dict.delete(str)); + + return [...dict]; + }; + + const emplace = + (filter: (file: string) => boolean) => + (input: string[]) => + async (closure: (location: string) => void): Promise => { + for (const pattern of input) { + for (const file of await _Glob(path.resolve(pattern))) { + const stats: fs.Stats = await fs.promises.stat(file); + if (stats.isDirectory() === true) + await iterate(filter)(closure)(file); + else if (stats.isFile() && filter(file)) closure(file); + } + } + }; + + const iterate = + (filter: (location: string) => boolean) => + (closure: (location: string) => void) => + async (location: string): Promise => { + const directory: string[] = await fs.promises.readdir(location); + for (const file of directory) { + const next: string = path.resolve(`${location}/${file}`); + const stats: fs.Stats = await fs.promises.stat(next); + + if (stats.isDirectory() === true) await iterate(filter)(closure)(next); + else if (stats.isFile() && filter(next)) closure(next); + } + }; + + const _Glob = (pattern: string): Promise => + new Promise((resolve, reject) => { + glob(pattern, (err, matches) => { + if (err) reject(err); + else resolve(matches.map((str) => path.resolve(str))); + }); + }); +} diff --git a/src/programmers/TypiaProgrammer.ts b/src/programmers/TypiaProgrammer.ts index 67d9fc1384..e20ed8c326 100644 --- a/src/programmers/TypiaProgrammer.ts +++ b/src/programmers/TypiaProgrammer.ts @@ -4,6 +4,7 @@ import ts from "typescript"; import { ImportTransformer } from "../transformers/ImportTransformer"; +import { SourceFinder } from "../executable/setup/SourceFinder"; import transform from "../transform"; export namespace TypiaProgrammer { @@ -14,25 +15,31 @@ export namespace TypiaProgrammer { } export const build = async (props: TypiaProgrammer.IProps): Promise => { - props.input = path.resolve(props.input); - props.output = path.resolve(props.output); - - if ((await is_directory(props.input)) === false) - throw new URIError( - "Error on TypiaGenerator.generate(): input path is not a directory.", + const files: string[] = await SourceFinder.find({ + include: [props.input], + filter: (location: string) => + (location.endsWith(".ts") && !location.endsWith("d.ts")) || + (location.endsWith(".tsx") && !location.endsWith("d.tsx")), + }); + if (files.length === 0) + throw new Error( + "Error on TypiaGenerator.generate(): no file to generate.", ); else if (fs.existsSync(props.output) === false) await fs.promises.mkdir(props.output, { recursive: true }); - else if ((await is_directory(props.output)) === false) { + else if ((await isDirectory(props.output)) === false) { const parent: string = path.join(props.output, ".."); - if ((await is_directory(parent)) === false) - throw new URIError( + if ((await isDirectory(parent)) === false) + throw new Error( "Error on TypiaGenerator.generate(): output path is not a directory.", ); await fs.promises.mkdir(props.output); } // CREATE PROGRAM + const base: string = (await isDirectory(props.input)) + ? path.resolve(props.input) + : getBaseDirectory(files); const { options: compilerOptions } = ts.parseJsonConfigFileContent( ts.readConfigFile(props.project, ts.sys.readFile).config, { @@ -43,15 +50,7 @@ export namespace TypiaProgrammer { }, path.dirname(props.project), ); - - const program: ts.Program = ts.createProgram( - await (async () => { - const container: string[] = []; - await gather(props)(container)(props.input)(props.output); - return container; - })(), - compilerOptions, - ); + const program: ts.Program = ts.createProgram(files, compilerOptions); // DO TRANSFORM const diagnostics: ts.Diagnostic[] = []; @@ -61,10 +60,10 @@ export namespace TypiaProgrammer { .filter( (file) => !file.isDeclarationFile && - path.resolve(file.fileName).indexOf(props.input) !== -1, + path.resolve(file.fileName).indexOf(base) !== -1, ), [ - ImportTransformer.transform(props.input)(props.output), + ImportTransformer.transform(base)(props.output), transform( program, ((compilerOptions.plugins as any[]) ?? []).find( @@ -111,47 +110,48 @@ export namespace TypiaProgrammer { if (diagnostics.length) process.exit(-1); // ARCHIVE TRANSFORMED FILES + const directories: Set = new Set(); const printer: ts.Printer = ts.createPrinter({ newLine: ts.NewLineKind.LineFeed, }); for (const file of result.transformed) { const to: string = path .resolve(file.fileName) - .replace(props.input, props.output); - + .replace(base, props.output); const content: string = printer.printFile(file); + + const parents: string[] = to.split(path.sep); + for (let i = 1; i < parents.length; i++) { + const parent: string = parents.slice(0, i).join(path.sep); + if (directories.has(parent)) continue; + try { + await fs.promises.mkdir(parent); + } catch {} + } await fs.promises.writeFile(to, content, "utf8"); } }; - const is_directory = async (current: string): Promise => { - const stat: fs.Stats = await fs.promises.stat(current); - return stat.isDirectory(); + const isDirectory = async (current: string): Promise => { + try { + const stat: fs.Stats = await fs.promises.stat(current); + return stat.isDirectory(); + } catch { + return false; + } }; - const gather = - (props: IProps) => - (container: string[]) => - (from: string) => - async (to: string) => { - if (from === props.output) return; - else if (fs.existsSync(to) === false) await fs.promises.mkdir(to); - - for (const file of await fs.promises.readdir(from)) { - const next: string = path.join(from, file); - const stat: fs.Stats = await fs.promises.stat(next); - - if (stat.isDirectory()) { - await gather(props)(container)(next)(path.join(to, file)); - continue; - } else if (is_supported_extension(file)) container.push(next); - } - }; + const getBaseDirectory = (files: string[]): string => { + const splitPaths: string[][] = files.map((p) => p.split(path.sep)); + const minLength: number = Math.min(...splitPaths.map((p) => p.length)); + let commonPath: string[] = []; - const is_supported_extension = (filename: string): boolean => { - return ( - (filename.endsWith(".ts") && !filename.endsWith(".d.ts")) || - (filename.endsWith(".tsx") && !filename.endsWith(".d.tsx")) - ); + for (let i = 0; i < minLength; i++) { + const currentSegment: string = splitPaths[0]![i]!; + if (splitPaths.every((p) => p[i] === currentSegment)) + commonPath.push(currentSegment); + else break; + } + return commonPath.length > 0 ? commonPath.join(path.sep) : ""; }; } diff --git a/test-esm/package.json b/test-esm/package.json index 2717ef5f68..e1bd5fd6c8 100644 --- a/test-esm/package.json +++ b/test-esm/package.json @@ -36,6 +36,6 @@ "typescript": "^5.4.5" }, "dependencies": { - "typia": "../typia-6.10.1-dev.20240913.tgz" + "typia": "../typia-6.10.1-dev.20240914.tgz" } } \ No newline at end of file diff --git a/test-generate/generated/directory/1/1/file11.ts b/test-generate/generated/directory/1/1/file11.ts new file mode 100644 index 0000000000..ae867b2081 --- /dev/null +++ b/test-generate/generated/directory/1/1/file11.ts @@ -0,0 +1,2 @@ +import typia from "typia"; +export const equalsFile = (() => { return (input: any, _exceptionable: boolean = true): input is File => input instanceof File; })(); diff --git a/test-generate/generated/directory/1/file1.ts b/test-generate/generated/directory/1/file1.ts new file mode 100644 index 0000000000..2c1fd77151 --- /dev/null +++ b/test-generate/generated/directory/1/file1.ts @@ -0,0 +1,23 @@ +import typia from "typia"; +export const validateFile = (() => { const __is = (input: any): input is File => input instanceof File; let errors: any; let $report: any; return (input: any): typia.IValidation => { + if (false === __is(input)) { + errors = []; + $report = (typia.createValidate as any).report(errors); + ((input: any, _path: string, _exceptionable: boolean = true) => input instanceof File || $report(true, { + path: _path + "", + expected: "File", + value: input + }))(input, "$input", true); + const success = 0 === errors.length; + return { + success, + errors, + data: success ? input : undefined + } as any; + } + return { + success: true, + errors: [], + data: input + } as any; +}; })(); diff --git a/test-generate/generated/directory/2/file2.ts b/test-generate/generated/directory/2/file2.ts new file mode 100644 index 0000000000..002fbe0dba --- /dev/null +++ b/test-generate/generated/directory/2/file2.ts @@ -0,0 +1,12 @@ +import typia from "typia"; +export const assertFile = (() => { const $guard = (typia.createAssert as any).guard; const __is = (input: any): input is File => input instanceof File; let _errorFactory: any; return (input: any, errorFactory?: (p: import("typia").TypeGuardError.IProps) => Error): File => { + if (false === __is(input)) { + _errorFactory = errorFactory; + ((input: any, _path: string, _exceptionable: boolean = true) => input instanceof File || $guard(true, { + path: _path + "", + expected: "File", + value: input + }, _errorFactory))(input, "$input", true); + } + return input; +}; })(); diff --git a/test-generate/generated/directory/file.ts b/test-generate/generated/directory/file.ts new file mode 100644 index 0000000000..644db7eee9 --- /dev/null +++ b/test-generate/generated/directory/file.ts @@ -0,0 +1,2 @@ +import typia from "typia"; +export const isFile = (() => { return (input: any): input is File => input instanceof File; })(); diff --git a/test-generate/generated/glob/private/private.controller.ts b/test-generate/generated/glob/private/private.controller.ts new file mode 100644 index 0000000000..7c0233d96b --- /dev/null +++ b/test-generate/generated/glob/private/private.controller.ts @@ -0,0 +1,21 @@ +import { createAssert } from "typia"; +import { IPrivate } from "./private.interface"; +export const isPrivate = (() => { const $guard = (createAssert as any).guard; const $io0 = (input: any): boolean => "number" === typeof input.value; const $ao0 = (input: any, _path: string, _exceptionable: boolean = true): boolean => "number" === typeof input.value || $guard(_exceptionable, { + path: _path + ".value", + expected: "number", + value: input.value +}, _errorFactory); const __is = (input: any): input is IPrivate => "object" === typeof input && null !== input && $io0(input); let _errorFactory: any; return (input: any, errorFactory?: (p: import("typia").TypeGuardError.IProps) => Error): IPrivate => { + if (false === __is(input)) { + _errorFactory = errorFactory; + ((input: any, _path: string, _exceptionable: boolean = true) => ("object" === typeof input && null !== input || $guard(true, { + path: _path + "", + expected: "IPrivate", + value: input + }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, { + path: _path + "", + expected: "IPrivate", + value: input + }, _errorFactory))(input, "$input", true); + } + return input; +}; })(); diff --git a/test-generate/generated/glob/private/private.interface.ts b/test-generate/generated/glob/private/private.interface.ts new file mode 100644 index 0000000000..6eeac6bb3b --- /dev/null +++ b/test-generate/generated/glob/private/private.interface.ts @@ -0,0 +1,3 @@ +export interface IPrivate { + value: number; +} diff --git a/test-generate/generated/glob/protected/protected.controller.ts b/test-generate/generated/glob/protected/protected.controller.ts new file mode 100644 index 0000000000..858d95a300 --- /dev/null +++ b/test-generate/generated/glob/protected/protected.controller.ts @@ -0,0 +1,21 @@ +import { createAssert } from "typia"; +import { IProtected } from "./protected.interface"; +export const assertProtected = (() => { const $guard = (createAssert as any).guard; const $io0 = (input: any): boolean => "string" === typeof input.id; const $ao0 = (input: any, _path: string, _exceptionable: boolean = true): boolean => "string" === typeof input.id || $guard(_exceptionable, { + path: _path + ".id", + expected: "string", + value: input.id +}, _errorFactory); const __is = (input: any): input is IProtected => "object" === typeof input && null !== input && $io0(input); let _errorFactory: any; return (input: any, errorFactory?: (p: import("typia").TypeGuardError.IProps) => Error): IProtected => { + if (false === __is(input)) { + _errorFactory = errorFactory; + ((input: any, _path: string, _exceptionable: boolean = true) => ("object" === typeof input && null !== input || $guard(true, { + path: _path + "", + expected: "IProtected", + value: input + }, _errorFactory)) && $ao0(input, _path + "", true) || $guard(true, { + path: _path + "", + expected: "IProtected", + value: input + }, _errorFactory))(input, "$input", true); + } + return input; +}; })(); diff --git a/test-generate/generated/glob/protected/protected.interface.ts b/test-generate/generated/glob/protected/protected.interface.ts new file mode 100644 index 0000000000..8d012c5242 --- /dev/null +++ b/test-generate/generated/glob/protected/protected.interface.ts @@ -0,0 +1,3 @@ +export interface IProtected { + id: string; +} diff --git a/test-generate/package.json b/test-generate/package.json new file mode 100644 index 0000000000..eb83328af0 --- /dev/null +++ b/test-generate/package.json @@ -0,0 +1,33 @@ +{ + "private": true, + "name": "@typia/test-generate", + "version": "0.1.0", + "description": "Test generator program for typia", + "main": "bin/index.js", + "tsp": { + "tscOptions": { + "parseAllJsDoc": true + } + }, + "scripts": {}, + "repository": { + "type": "git", + "url": "https://github.com/samchon/typia" + }, + "keywords": [ + "typia", + "test" + ], + "author": "Jeongho Nam", + "license": "MIT", + "bugs": { + "url": "https://github.com/samchon/typia/issues" + }, + "homepage": "https://github.com/samchon/typia#readme", + "devDependencies": { + "typescript": "^5.6.2" + }, + "dependencies": { + "typia": "../typia-6.10.1-dev.20240914.tgz" + } +} diff --git a/test-generate/src/directory/1/1/file11.ts b/test-generate/src/directory/1/1/file11.ts new file mode 100644 index 0000000000..8d8068dac6 --- /dev/null +++ b/test-generate/src/directory/1/1/file11.ts @@ -0,0 +1,3 @@ +import typia from "typia"; + +export const equalsFile = typia.createEquals(); diff --git a/test-generate/src/directory/1/file1.ts b/test-generate/src/directory/1/file1.ts new file mode 100644 index 0000000000..846a86038e --- /dev/null +++ b/test-generate/src/directory/1/file1.ts @@ -0,0 +1,3 @@ +import typia from "typia"; + +export const validateFile = typia.createValidate(); diff --git a/test-generate/src/directory/2/file2.ts b/test-generate/src/directory/2/file2.ts new file mode 100644 index 0000000000..03a0092431 --- /dev/null +++ b/test-generate/src/directory/2/file2.ts @@ -0,0 +1,3 @@ +import typia from "typia"; + +export const assertFile = typia.createAssert(); diff --git a/test-generate/src/directory/file.ts b/test-generate/src/directory/file.ts new file mode 100644 index 0000000000..7fd783b8eb --- /dev/null +++ b/test-generate/src/directory/file.ts @@ -0,0 +1,3 @@ +import typia from "typia"; + +export const isFile = typia.createIs(); diff --git a/test-generate/src/glob/nested/private/private.controller.ts b/test-generate/src/glob/nested/private/private.controller.ts new file mode 100644 index 0000000000..d5e79b5492 --- /dev/null +++ b/test-generate/src/glob/nested/private/private.controller.ts @@ -0,0 +1,5 @@ +import { createAssert } from "typia"; + +import { IPrivate } from "./private.interface"; + +export const isPrivate = createAssert(); diff --git a/test-generate/src/glob/nested/private/private.interface.ts b/test-generate/src/glob/nested/private/private.interface.ts new file mode 100644 index 0000000000..57eb01fa83 --- /dev/null +++ b/test-generate/src/glob/nested/private/private.interface.ts @@ -0,0 +1,3 @@ +export interface IPrivate { + value: number; +} diff --git a/test-generate/src/glob/nested/protected/protected.controller.ts b/test-generate/src/glob/nested/protected/protected.controller.ts new file mode 100644 index 0000000000..bcdfe45300 --- /dev/null +++ b/test-generate/src/glob/nested/protected/protected.controller.ts @@ -0,0 +1,5 @@ +import { createAssert } from "typia"; + +import { IProtected } from "./protected.interface"; + +export const assertProtected = createAssert(); diff --git a/test-generate/src/glob/nested/protected/protected.interface.ts b/test-generate/src/glob/nested/protected/protected.interface.ts new file mode 100644 index 0000000000..e1f728ff61 --- /dev/null +++ b/test-generate/src/glob/nested/protected/protected.interface.ts @@ -0,0 +1,3 @@ +export interface IProtected { + id: string; +} diff --git a/test-generate/tsconfig.json b/test-generate/tsconfig.json new file mode 100644 index 0000000000..39ced0b706 --- /dev/null +++ b/test-generate/tsconfig.json @@ -0,0 +1,106 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig.json to read more about this file */ + + /* Projects */ + // "incremental": true, /* Enable incremental compilation */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./", /* Specify the folder for .tsbuildinfo incremental compilation files. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "ESNext", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + "lib": [ + "DOM", + "ESNext" + ], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */ + "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h' */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using `jsx: react-jsx*`.` */ + // "reactNamespace": "", /* Specify the object invoked for `createElement`. This only applies when targeting `react` JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + // "rootDir": "./", /* Specify the root folder within your source files. */ + // "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "resolveJsonModule": true, /* Enable importing .json files */ + // "noResolve": true, /* Disallow `import`s, `require`s or ``s from expanding the number of files TypeScript should add to a project. */ + + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the `checkJS` option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from `node_modules`. Only applicable with `allowJs`. */ + + /* Emit */ + // "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + // "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + // "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "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. */ + "outDir": "./bin", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + "newLine": "lf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have `@internal` in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like `__extends` in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing `const enum` declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables `allowSyntheticDefaultImports` for type compatibility. */ + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied `any` type.. */ + // "strictNullChecks": true, /* When type checking, take into account `null` and `undefined`. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for `bind`, `call`, and `apply` methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "noImplicitThis": true, /* Enable error reporting when `this` is given the type `any`. */ + // "useUnknownInCatchVariables": true, /* Type catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when a local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read */ + "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + "noUncheckedIndexedAccess": true, /* Include 'undefined' in index signature results */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true, /* Skip type checking all .d.ts files. */ + // "plugins": [], + }, + "include": ["src"], +} \ No newline at end of file diff --git a/test/package.json b/test/package.json index 134ad01c79..6eb58e52a1 100644 --- a/test/package.json +++ b/test/package.json @@ -52,6 +52,6 @@ "suppress-warnings": "^1.0.2", "tstl": "^3.0.0", "uuid": "^9.0.1", - "typia": "../typia-6.10.1-dev.20240913.tgz" + "typia": "../typia-6.10.1-dev.20240914.tgz" } } \ No newline at end of file diff --git a/tsconfig.test-generate.json b/tsconfig.test-generate.json new file mode 100644 index 0000000000..7c25c30ab1 --- /dev/null +++ b/tsconfig.test-generate.json @@ -0,0 +1,6 @@ +{ + "extends": "./tsconfig.json", + "compilerOptions": { + "outDir": "./test-generate/node_modules/typia/lib" + } +} \ No newline at end of file