Skip to content

Commit

Permalink
Merge pull request #186 from ryoppippi/feature/185
Browse files Browse the repository at this point in the history
fix: remove `js` from default include option
  • Loading branch information
ryoppippi authored Jul 10, 2024
2 parents 3ebab52 + 7010b4c commit 156a72c
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 12 deletions.
Binary file modified bun.lockb
Binary file not shown.
1 change: 0 additions & 1 deletion packages/unplugin-typia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@
"dependencies": {
"@rollup/pluginutils": "^5.1.0",
"magic-string": "^0.30.10",
"mlly": "^1.7.1",
"pathe": "^1.1.2",
"ts-patch": "^3.2.1",
"typescript": "~5.5.3",
Expand Down
10 changes: 0 additions & 10 deletions packages/unplugin-typia/src/bun.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import type { BunPlugin } from 'bun';
import type { UnpluginContextMeta, UnpluginOptions } from 'unplugin';
import { hasCJSSyntax } from 'mlly';
import { resolveOptions, unplugin } from './api.js';
import { type Options, defaultOptions } from './core/options.js';
import { isBun } from './core/utils.js';
Expand Down Expand Up @@ -122,15 +121,6 @@ function bunTypiaPlugin(

const source = wrap<Source>(await Bun.file(id).text());

/* TODO: delete after [this issue](https://github.com/oven-sh/bun/issues/11783) is resolved. */
if (id.includes('node_modules/typia/lib/index.js') && hasCJSSyntax(source)) {
const mjsFile = Bun.file(id.replace(/\.js$/, '.mjs'));

if (await mjsFile.exists()) {
return { contents: await mjsFile.text() };
}
}

const code = await taggedTransform(
id,
source,
Expand Down
2 changes: 1 addition & 1 deletion packages/unplugin-typia/src/core/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export type ResolvedOptions

/** Default options */
export const defaultOptions = ({
include: [/\.[cm]?[jt]sx?$/],
include: [/\.[cm]?tsx?$/],
exclude: [/node_modules/],
enforce: 'pre',
typia: { },
Expand Down

0 comments on commit 156a72c

Please sign in to comment.