diff --git a/.github/workflows/ci-typia-validator.yml b/.github/workflows/ci-typia-validator.yml index 5a40ecc4..9146a07b 100644 --- a/.github/workflows/ci-typia-validator.yml +++ b/.github/workflows/ci-typia-validator.yml @@ -19,6 +19,7 @@ jobs: node-version: 18.x - run: yarn workspaces focus hono-middleware @hono/typia-validator - run: yarn workspace @hono/typia-validator build + - run: yarn workspace @hono/typia-validator publint - run: yarn test --coverage --project @hono/typia-validator - uses: codecov/codecov-action@v5 with: diff --git a/packages/typia-validator/package.json b/packages/typia-validator/package.json index 0aec36e4..6d68e004 100644 --- a/packages/typia-validator/package.json +++ b/packages/typia-validator/package.json @@ -3,33 +3,38 @@ "version": "0.1.2", "description": "Validator middleware using Typia", "type": "module", - "main": "dist/cjs/index.js", - "module": "dist/esm/index.js", - "types": "dist/esm/index.d.ts", + "module": "dist/index.js", + "types": "dist/index.d.ts", "exports": { ".": { - "require": "./dist/cjs/index.js", - "import": "./dist/esm/index.js", - "types": "./dist/esm/index.d.ts", - "default": "./dist/cjs/index.js" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.cts", + "default": "./dist/index.cjs" + } }, "./http": { - "require": "./dist/cjs/http.js", - "import": "./dist/esm/http.js", - "types": "./dist/esm/http.d.ts", - "default": "./dist/cjs/http.js" + "import": { + "types": "./dist/http.d.ts", + "default": "./dist/http.js" + }, + "require": { + "types": "./dist/http.d.cts", + "default": "./dist/http.cjs" + } } }, "files": [ "dist" ], "scripts": { - "test": "vitest", - "build:cjs": "tsc -p tsconfig.cjs.json", - "build:esm": "tsc -p tsconfig.esm.json", - "build": "rimraf dist && yarn build:cjs && yarn build:esm", - "prerelease": "yarn build && yarn test", - "release": "yarn publish" + "build": "tsup ./src/index.ts ./src/http.ts", + "prepack": "yarn build", + "publint": "attw --pack --profile node16 && publint", + "test": "vitest" }, "license": "MIT", "publishConfig": { @@ -38,7 +43,8 @@ }, "repository": { "type": "git", - "url": "https://github.com/honojs/middleware.git" + "url": "git+https://github.com/honojs/middleware.git", + "directory": "packages/typia-validator" }, "homepage": "https://github.com/honojs/middleware", "peerDependencies": { @@ -46,9 +52,10 @@ "typia": "^7.0.0 || ^8.0.0" }, "devDependencies": { + "@arethetypeswrong/cli": "^0.17.4", "hono": "^3.11.7", - "rimraf": "^5.0.5", - "typescript": "^5.4.0", + "publint": "^0.3.9", + "tsup": "^8.4.0", "typia": "^8.0.3", "vitest": "^3.0.8" } diff --git a/packages/typia-validator/tsconfig.cjs.json b/packages/typia-validator/tsconfig.cjs.json deleted file mode 100644 index b8bf50ee..00000000 --- a/packages/typia-validator/tsconfig.cjs.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "module": "CommonJS", - "declaration": false, - "outDir": "./dist/cjs" - } -} \ No newline at end of file diff --git a/packages/typia-validator/tsconfig.esm.json b/packages/typia-validator/tsconfig.esm.json deleted file mode 100644 index 8130f1a5..00000000 --- a/packages/typia-validator/tsconfig.esm.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "./tsconfig.json", - "compilerOptions": { - "module": "ESNext", - "declaration": true, - "outDir": "./dist/esm" - } -} \ No newline at end of file diff --git a/packages/typia-validator/tsconfig.json b/packages/typia-validator/tsconfig.json index df14967d..6409810a 100644 --- a/packages/typia-validator/tsconfig.json +++ b/packages/typia-validator/tsconfig.json @@ -1,10 +1,8 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "rootDir": "./src", "types": ["vitest/globals"] }, - "include": ["src/**/*.ts"], "plugins": [ { "transform": "typia/lib/transform" diff --git a/yarn.lock b/yarn.lock index 57050a29..031b0c24 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2941,9 +2941,10 @@ __metadata: version: 0.0.0-use.local resolution: "@hono/typia-validator@workspace:packages/typia-validator" dependencies: + "@arethetypeswrong/cli": "npm:^0.17.4" hono: "npm:^3.11.7" - rimraf: "npm:^5.0.5" - typescript: "npm:^5.4.0" + publint: "npm:^0.3.9" + tsup: "npm:^8.4.0" typia: "npm:^8.0.3" vitest: "npm:^3.0.8" peerDependencies: @@ -17001,16 +17002,6 @@ __metadata: languageName: node linkType: hard -"typescript@npm:^5.4.0": - version: 5.7.2 - resolution: "typescript@npm:5.7.2" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: a873118b5201b2ef332127ef5c63fb9d9c155e6fdbe211cbd9d8e65877283797cca76546bad742eea36ed7efbe3424a30376818f79c7318512064e8625d61622 - languageName: node - linkType: hard - "typescript@npm:^5.7.3": version: 5.7.3 resolution: "typescript@npm:5.7.3" @@ -17071,16 +17062,6 @@ __metadata: languageName: node linkType: hard -"typescript@patch:typescript@npm%3A^5.4.0#optional!builtin": - version: 5.7.2 - resolution: "typescript@patch:typescript@npm%3A5.7.2#optional!builtin::version=5.7.2&hash=e012d7" - bin: - tsc: bin/tsc - tsserver: bin/tsserver - checksum: c891ccf04008bc1305ba34053db951f8a4584b4a1bf2f68fd972c4a354df3dc5e62c8bfed4f6ac2d12e5b3b1c49af312c83a651048f818cd5b4949d17baacd79 - languageName: node - linkType: hard - "typescript@patch:typescript@npm%3A^5.7.3#optional!builtin": version: 5.7.3 resolution: "typescript@patch:typescript@npm%3A5.7.3#optional!builtin::version=5.7.3&hash=e012d7"