generated from unplugin/unplugin-starter
-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #60 from ryoppippi/feature/fix-bun-docs
Update dependencies and enhance Bun build support
- Loading branch information
Showing
6 changed files
with
91 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import UnpluginTypia from 'unplugin-typia/bun' | ||
|
||
await Bun.build({ | ||
entrypoints: ["./index.ts"], | ||
entrypoints: ["./index.ts" ,"./index.build.ts"], | ||
outdir: "./out", | ||
plugins: [ | ||
UnpluginTypia() | ||
UnpluginTypia({ cache: false }) | ||
] | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* This is the example of how to use typia with bun | ||
*/ | ||
|
||
import typia, { type tags } from "typia" | ||
|
||
/** define the schema of the member */ | ||
interface IMember { | ||
/** | ||
* email of the member | ||
*/ | ||
email: string & tags.Format<"email">; | ||
|
||
/** | ||
* id of the member | ||
*/ | ||
id: string & tags.Format<"uuid">; | ||
|
||
/** | ||
* age of the member | ||
* age should be greater than 19 | ||
*/ | ||
age: number & tags.ExclusiveMinimum<19> & tags.Maximum<100>; | ||
|
||
/** | ||
* pattern of the member | ||
*/ | ||
pattern: string & tags.Pattern<"^[a-z]+$">; | ||
} | ||
|
||
const random = typia.createRandom<IMember>(); | ||
console.log(random()) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters