Skip to content

Commit

Permalink
Merge pull request #286 from ryoppippi/feature/add-taze
Browse files Browse the repository at this point in the history
chore: update deps
  • Loading branch information
ryoppippi authored Aug 16, 2024
2 parents 0111b3f + 9d976d3 commit 5612a4c
Show file tree
Hide file tree
Showing 19 changed files with 169 additions and 143 deletions.
Binary file modified bun.lockb
Binary file not shown.
2 changes: 1 addition & 1 deletion examples/bun-build/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"devDependencies": {
"@types/bun": "latest",
"std-env": "^3.7.0",
"typia": "^6.7.0"
"typia": "^6.8.0"
},
"peerDependencies": {
"ts-patch": "^3.2.1",
Expand Down
6 changes: 3 additions & 3 deletions examples/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
},
"devDependencies": {
"@ryoppippi/unplugin-typia": "workspace:*",
"@types/node": "^20.14.14",
"@types/node": "^20.14.15",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"ts-patch": "^3.2.1",
"tslib": "^2.6.3",
"type-fest": "^4.23.0",
"type-fest": "^4.24.0",
"typescript": "~5.5.4",
"typia": "^6.7.0"
"typia": "^6.8.0"
}
}
12 changes: 6 additions & 6 deletions examples/sveltekit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@
"prepare": "ts-patch install && typia patch"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.2.2",
"@sveltejs/adapter-cloudflare": "^4.7.0",
"@sveltejs/kit": "^2.5.20",
"@sveltejs/adapter-auto": "^3.2.4",
"@sveltejs/adapter-cloudflare": "^4.7.2",
"@sveltejs/kit": "^2.5.22",
"@sveltejs/vite-plugin-svelte": "^3.1.1",
"svelte": "^5.0.0-next.208",
"svelte": "^5.0.0-next.222",
"svelte-check": "^3.8.5",
"ts-patch": "^3.2.1",
"tslib": "^2.6.3",
"typescript": "~5.5.4",
"typia": "^6.7.0",
"vite": "^5.3.5"
"typia": "^6.8.0",
"vite": "^5.4.1"
},
"type": "module",
"dependencies": {
Expand Down
6 changes: 3 additions & 3 deletions examples/vite-hono/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"prepare": "ts-patch install && typia patch"
},
"dependencies": {
"hono": "^4.5.3",
"hono": "^4.5.5",
"uuid": "^9.0.1"
},
"devDependencies": {
Expand All @@ -20,7 +20,7 @@
"@ryoppippi/unplugin-typia": "workspace:*",
"ts-patch": "^3.2.1",
"typescript": "~5.5.4",
"typia": "^6.7.0",
"vite": "^5.3.5"
"typia": "^6.8.0",
"vite": "^5.4.1"
}
}
4 changes: 2 additions & 2 deletions examples/vite-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@vitejs/plugin-react": "^4.3.1",
"ts-patch": "^3.2.1",
"typescript": "~5.5.4",
"typia": "^6.7.0",
"vite": "^5.3.5"
"typia": "^6.8.0",
"vite": "^5.4.1"
}
}
6 changes: 3 additions & 3 deletions examples/webpack-minimal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"name": "webpack-minimal",
"private": true,
"devDependencies": {
"@types/node": "^20.14.14",
"@types/node": "^20.14.15",
"@webpack-cli/generators": "^3.0.7",
"html-webpack-plugin": "^5.6.0",
"prettier": "^3.3.3",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"ts-patch": "^3.2.1",
"tsx": "^4.16.5",
"tsx": "^4.17.0",
"typescript": "~5.5.4",
"webpack": "^5.93.0",
"webpack-cli": "^5.1.4",
Expand All @@ -28,6 +28,6 @@
"dependencies": {
"@ryoppippi/unplugin-typia": "workspace:*",
"cross-env": "^7.0.3",
"typia": "^6.7.0"
"typia": "^6.8.0"
}
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"format": "bun run --filter '*' format",
"test": "bun run --filter '*' test",
"deploy": "bun run --filter '*' deploy",
"prepare": "npx bunpare"
"prepare": "bun x bunpare",
"taze": "bun x taze -r"
},
"workspaces": [
"examples/*",
Expand All @@ -27,6 +28,6 @@
"vite-vanilla",
"workerd"
],
"packageManager": "bun@1.1.21",
"packageManager": "bun@1.1.24",
"private": true
}
18 changes: 9 additions & 9 deletions packages/unplugin-typia/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"scripts": {
"lint": "nr check && eslint --cache .",
"format": "eslint --cache --fix .",
"test": "vitest --typecheck",
"test": "vitest --typecheck --testTimeout 150000",
"check": "nr tsc --noEmit",
"release": "nr test && bumpp",
"publish": "nr publish:prepare && nr test && nlx jsr publish --allow-dirty",
Expand All @@ -51,25 +51,25 @@
"magic-string": "^0.30.11",
"pathe": "^1.1.2",
"pkg-types": "^1.1.3",
"type-fest": "^4.23.0",
"type-fest": "^4.24.0",
"typescript": "~5.5.4",
"typia": "^6.7.0",
"unplugin": "^1.12.0"
"typia": "^6.8.0",
"unplugin": "^1.12.2"
},
"devDependencies": {
"@antfu/ni": "^0.22.0",
"@antfu/ni": "^0.22.4",
"@ryoppippi/eslint-config": "npm:@jsr/ryoppippi__eslint-config",
"@types/bun": "^1.1.6",
"@types/node": "^20.14.14",
"@types/node": "^20.14.15",
"@vue-macros/test-utils": "^1.6.0",
"bumpp": "^9.4.2",
"bumpp": "^9.5.1",
"dax-sh": "^0.41.0",
"esbuild": "^0.23.0",
"eslint": "^9.8.0",
"eslint": "^9.9.0",
"eslint-plugin-format": "^0.1.2",
"rollup": "^4.20.0",
"ts-patch": "^3.2.1",
"vite": "^5.4.0",
"vite": "^5.4.1",
"vitest": "^2.0.5"
}
}
73 changes: 36 additions & 37 deletions packages/unplugin-typia/tests/fixtures/__snapshots__/alias.ts
Original file line number Diff line number Diff line change
@@ -1,43 +1,42 @@
import type { IMember } from '@/type.js';
import typia from 'typia';
const is = (() => { const $io0 = (input: any): boolean => "string" === typeof input.email && /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) && ("string" === typeof input.id && /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(input.id)) && ("number" === typeof input.age && (Math.floor(input.age) === input.age && 0 <= input.age && input.age <= 4294967295 && 19 < input.age && input.age <= 100)); return (input: any): input is IMember => "object" === typeof input && null !== input && $io0(input); })();
const random = (generator?: Partial<typia.IRandomGenerator>): import("typia").Resolved<IMember> => {
const $generator = (typia.createRandom as any).generator;
const $ro0 = (_recursive: boolean = false, _depth: number = 0): any => ({
email: (generator?.customs ?? $generator.customs)?.string?.([
{
name: "Format<\"email\">",
kind: "format",
value: "email"
}
]) ?? (generator?.email ?? $generator.email)(),
id: (generator?.customs ?? $generator.customs)?.string?.([
{
name: "Format<\"uuid\">",
kind: "format",
value: "uuid"
}
]) ?? (generator?.uuid ?? $generator.uuid)(),
age: (generator?.customs ?? $generator.customs)?.number?.([
{
name: "Type<\"uint32\">",
kind: "type",
value: "uint32"
},
{
name: "ExclusiveMinimum<19>",
kind: "exclusiveMinimum",
value: 19
},
{
name: "Maximum<100>",
kind: "maximum",
value: 100
}
]) ?? (generator?.integer ?? $generator.integer)(19, 100)
});
const random = (() => { const $generator = (typia.createRandom as any).generator; const $ro0 = (_recursive: boolean = false, _depth: number = 0): any => ({
email: (_generator?.customs ?? $generator.customs)?.string?.([
{
name: "Format<\"email\">",
kind: "format",
value: "email"
}
]) ?? (_generator?.email ?? $generator.email)(),
id: (_generator?.customs ?? $generator.customs)?.string?.([
{
name: "Format<\"uuid\">",
kind: "format",
value: "uuid"
}
]) ?? (_generator?.uuid ?? $generator.uuid)(),
age: (_generator?.customs ?? $generator.customs)?.number?.([
{
name: "Type<\"uint32\">",
kind: "type",
value: "uint32"
},
{
name: "ExclusiveMinimum<19>",
kind: "exclusiveMinimum",
value: 19
},
{
name: "Maximum<100>",
kind: "maximum",
value: 100
}
]) ?? (_generator?.integer ?? $generator.integer)(19, 100)
}); let _generator: any; return (generator?: Partial<typia.IRandomGenerator>): import("typia").Resolved<IMember> => {
_generator = generator;
return $ro0();
};
}; })();
const validate = (() => { const $io0 = (input: any): boolean => "string" === typeof input.email && /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) && ("string" === typeof input.id && /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(input.id)) && ("number" === typeof input.age && (Math.floor(input.age) === input.age && 0 <= input.age && input.age <= 4294967295 && 19 < input.age && input.age <= 100)); const $vo0 = (input: any, _path: string, _exceptionable: boolean = true): boolean => ["string" === typeof input.email && (/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i.test(input.email) || $report(_exceptionable, {
path: _path + ".email",
expected: "string & Format<\"email\">",
Expand Down Expand Up @@ -70,7 +69,7 @@ const validate = (() => { const $io0 = (input: any): boolean => "string" === typ
path: _path + ".age",
expected: "(number & Type<\"uint32\"> & ExclusiveMinimum<19> & Maximum<100>)",
value: input.age
})].every((flag: boolean) => flag); const __is = (input: any): input is IMember => "object" === typeof input && null !== input && $io0(input); let errors; let $report; return (input: any): typia.IValidation<IMember> => {
})].every((flag: boolean) => flag); const __is = (input: any): input is IMember => "object" === typeof input && null !== input && $io0(input); let errors: any; let $report: any; return (input: any): typia.IValidation<IMember> => {
if (false === __is(input)) {
errors = [];
$report = (typia.createValidate as any).report(errors);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ import typia from "typia";
const is = /* @__PURE__ */ (() => {
return (input) => true;
})();
const random = (generator) => {
return "any type used...";
};
const random = /* @__PURE__ */ (() => {
let _generator;
return (generator) => {
_generator = generator;
return "any type used...";
};
})();
const validate = /* @__PURE__ */ (() => {
const __is = (input) => true;
let errors;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import typia from "typia";
const random = (generator) => {
const random = (() => {
const $generator = typia.createRandom.generator;
const $ro0 = (_recursive = false, _depth = 0) => ({
email: (generator?.customs ?? $generator.customs)?.string?.([
email: (_generator?.customs ?? $generator.customs)?.string?.([
{
name: 'Format<"email">',
kind: "format",
value: "email"
}
]) ?? (generator?.email ?? $generator.email)(),
id: (generator?.customs ?? $generator.customs)?.string?.([
]) ?? (_generator?.email ?? $generator.email)(),
id: (_generator?.customs ?? $generator.customs)?.string?.([
{
name: 'Format<"uuid">',
kind: "format",
value: "uuid"
}
]) ?? (generator?.uuid ?? $generator.uuid)(),
age: (generator?.customs ?? $generator.customs)?.number?.([
]) ?? (_generator?.uuid ?? $generator.uuid)(),
age: (_generator?.customs ?? $generator.customs)?.number?.([
{
name: 'Type<"uint32">',
kind: "type",
Expand All @@ -32,8 +32,12 @@ const random = (generator) => {
kind: "maximum",
value: 100
}
]) ?? (generator?.integer ?? $generator.integer)(19, 100)
]) ?? (_generator?.integer ?? $generator.integer)(19, 100)
});
return $ro0();
};
let _generator;
return (generator) => {
_generator = generator;
return $ro0();
};
})();
random();
71 changes: 35 additions & 36 deletions packages/unplugin-typia/tests/fixtures/__snapshots__/random.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,39 @@
import typia from 'typia';
import type { IMember } from './type.js';
const random = (generator?: Partial<typia.IRandomGenerator>): import("typia").Resolved<IMember> => {
const $generator = (typia.createRandom as any).generator;
const $ro0 = (_recursive: boolean = false, _depth: number = 0): any => ({
email: (generator?.customs ?? $generator.customs)?.string?.([
{
name: "Format<\"email\">",
kind: "format",
value: "email"
}
]) ?? (generator?.email ?? $generator.email)(),
id: (generator?.customs ?? $generator.customs)?.string?.([
{
name: "Format<\"uuid\">",
kind: "format",
value: "uuid"
}
]) ?? (generator?.uuid ?? $generator.uuid)(),
age: (generator?.customs ?? $generator.customs)?.number?.([
{
name: "Type<\"uint32\">",
kind: "type",
value: "uint32"
},
{
name: "ExclusiveMinimum<19>",
kind: "exclusiveMinimum",
value: 19
},
{
name: "Maximum<100>",
kind: "maximum",
value: 100
}
]) ?? (generator?.integer ?? $generator.integer)(19, 100)
});
const random = (() => { const $generator = (typia.createRandom as any).generator; const $ro0 = (_recursive: boolean = false, _depth: number = 0): any => ({
email: (_generator?.customs ?? $generator.customs)?.string?.([
{
name: "Format<\"email\">",
kind: "format",
value: "email"
}
]) ?? (_generator?.email ?? $generator.email)(),
id: (_generator?.customs ?? $generator.customs)?.string?.([
{
name: "Format<\"uuid\">",
kind: "format",
value: "uuid"
}
]) ?? (_generator?.uuid ?? $generator.uuid)(),
age: (_generator?.customs ?? $generator.customs)?.number?.([
{
name: "Type<\"uint32\">",
kind: "type",
value: "uint32"
},
{
name: "ExclusiveMinimum<19>",
kind: "exclusiveMinimum",
value: 19
},
{
name: "Maximum<100>",
kind: "maximum",
value: 100
}
]) ?? (_generator?.integer ?? $generator.integer)(19, 100)
}); let _generator: any; return (generator?: Partial<typia.IRandomGenerator>): import("typia").Resolved<IMember> => {
_generator = generator;
return $ro0();
};
}; })();
random();
Loading

0 comments on commit 5612a4c

Please sign in to comment.