Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(esbuild): add verbose log and disable cache in UnpluginTypia #20

Merged
merged 6 commits into from
Jun 5, 2024

Conversation

ryoppippi
Copy link
Owner

The UnpluginTypia plugin configuration in the esbuild build script has been
updated. The log level has been set to 'verbose' and the cache has been
disabled. This change provides more detailed logs and ensures that the
plugin always processes the files without using the cache.

ryoppippi added 6 commits June 5, 2024 22:53
The UnpluginTypia plugin configuration in the esbuild build script has been
updated. The log level has been set to 'verbose' and the cache has been
disabled. This change provides more detailed logs and ensures that the
plugin always processes the files without using the cache.
The transformTypia function now takes an additional parameter 'source'
which is the source code. The LanguageServiceHost class has been removed
and its functionality has been replaced by the getProgramAndSource
function. This function creates a program and source file using the
TypeScript compiler API. The transform function has been updated to use
the new typiaTransform function from the 'typia/lib/transform.js' module.
This commit introduces a caching mechanism to the TypeScript source
file transformation process. If caching is enabled (which is the
default), the transformed source file is stored in a cache and
reused if the same file is requested again. This can significantly
speed up the transformation process for large projects or projects
with many dependencies.
The function transformTypia now parses tsconfig compilerOptions.
This change also renames getTsConfig to getTsCompilerOption for
better clarity. The compilerOptions are now passed as a parameter
to the getProgramAndSource function.
This commit introduces a new parameter `cacheEnable` to the
`getTsCompilerOption` function. This parameter controls whether the
parsed tsconfig compilerOptions should be cached or not. By default,
caching is enabled.
This commit refactors the logic for assigning compiler options in
the getTsCompilerOption function. The new logic uses an if-else
statement to assign the compiler options based on the cacheEnable
flag. This makes the code more readable and easier to understand.
Copy link

vercel bot commented Jun 5, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unplugin-typia-nextjs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 5, 2024 10:24pm

@ryoppippi ryoppippi merged commit fd1657e into main Jun 5, 2024
11 checks passed
@ryoppippi ryoppippi deleted the feature/19 branch June 5, 2024 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant