From 59239b4f9be4f06c01a49e6b0aaba809d00c3ce5 Mon Sep 17 00:00:00 2001 From: Kevin Whitley Date: Thu, 15 Jun 2023 01:53:58 -0500 Subject: [PATCH] released v4.0.10-next.0 - removing specified exports --- example/node-require.js | 20 +++++++++ package.json | 91 ++++------------------------------------- rollup.config.mjs | 2 +- yarn.lock | 8 ++-- 4 files changed, 32 insertions(+), 89 deletions(-) create mode 100644 example/node-require.js diff --git a/example/node-require.js b/example/node-require.js new file mode 100644 index 00000000..19eaa4fb --- /dev/null +++ b/example/node-require.js @@ -0,0 +1,20 @@ +const { createServerAdapter } = require('@whatwg-node/server') +const { createServer } = require('http') +require('isomorphic-fetch') +const { Router, error, json } = require('itty-router') + +const router = Router() + +router.get('/', () => 'Success!').all('*', () => error(404)) + +const ittyServer = createServerAdapter((...args) => + router + .handle(...args) + .then(json) + .catch(error) +) + +// Then use it in any environment +const httpServer = createServer(ittyServer) +httpServer.listen(3001) +console.log('listening at https://localhost:3001') diff --git a/package.json b/package.json index edfa3115..ffc0e859 100644 --- a/package.json +++ b/package.json @@ -1,88 +1,10 @@ { "name": "itty-router", - "version": "4.0.10", + "version": "4.0.10-next.0", "description": "A tiny, zero-dependency router, designed to make beautiful APIs in any environment.", - "type": "module", - "main": "index.js", - "module": "index.js", - "types": "index.d.ts", - "exports": { - ".": { - "import": "./index.js", - "require": "./cjs/index.js", - "types": "./index.d.ts" - }, - "./createCors": { - "import": "./createCors.js", - "require": "./cjs/createCors.js", - "types": "./createCors.d.ts" - }, - "./createResponse": { - "import": "./createResponse.js", - "require": "./cjs/createResponse.js", - "types": "./createResponse.d.ts" - }, - "./error": { - "import": "./error.js", - "require": "./cjs/error.js", - "types": "./error.d.ts" - }, - "./html": { - "import": "./html.js", - "require": "./cjs/html.js", - "types": "./html.d.ts" - }, - "./jpeg": { - "import": "./jpeg.js", - "require": "./cjs/jpeg.js", - "types": "./jpeg.d.ts" - }, - "./png": { - "import": "./png.js", - "require": "./cjs/png.js", - "types": "./png.d.ts" - }, - "./Router": { - "import": "./Router.js", - "require": "./cjs/Router.js", - "types": "./Router.d.ts" - }, - "./status": { - "import": "./status.js", - "require": "./cjs/status.js", - "types": "./status.d.ts" - }, - "./text": { - "import": "./text.js", - "require": "./cjs/text.js", - "types": "./text.d.ts" - }, - "./webp": { - "import": "./webp.js", - "require": "./cjs/webp.js", - "types": "./webp.d.ts" - }, - "./websocket": { - "import": "./websocket.js", - "require": "./cjs/websocket.js", - "types": "./websocket.d.ts" - }, - "./withContent": { - "import": "./withContent.js", - "require": "./cjs/withContent.js", - "types": "./withContent.d.ts" - }, - "./withCookies": { - "import": "./withCookies.js", - "require": "./cjs/withCookies.js", - "types": "./withCookies.d.ts" - }, - "./withParams": { - "import": "./withParams.js", - "require": "./cjs/withParams.js", - "types": "./withParams.d.ts" - } - }, + "main": "./cjs/index.js", + "module": "./index.js", + "types": "./index.d.ts", "keywords": [ "api", "router", @@ -107,9 +29,10 @@ "coveralls": "yarn coverage && cat ./coverage/lcov.info | coveralls", "verify": "echo 'verifying module...' && yarn build && yarn test:once", "prerelease": "yarn verify", - "prebuild": "rimraf dist && mkdir dist && yarn coverage && yarn format", + "prebuild": "rimraf dist && mkdir dist", "build": "rollup -c", "release": "release --tag --push --patch --src=dist", + "release:next": "release --tag --push --type=next --src=dist", "runtime:bun": "bun example/bun.ts", "runtime:node": "node example/node.js" }, @@ -144,7 +67,7 @@ "gzip-size": "^7.0.0", "http": "^0.0.1-security", "isomorphic-fetch": "^3.0.0", - "itty-router": "^4.0.6", + "itty-router": "^4.0.10", "jsdom": "^22.1.0", "npm-run-all": "^4.1.5", "prettier": "^2.8.8", diff --git a/rollup.config.mjs b/rollup.config.mjs index d3b0de94..eefbabab 100644 --- a/rollup.config.mjs +++ b/rollup.config.mjs @@ -33,7 +33,7 @@ export default async () => { ], plugins: [ typescript({ sourceMap: true }), - terser(), + // terser(), bundleSize(), copy({ targets: [ diff --git a/yarn.lock b/yarn.lock index 70ac70a2..fe48131a 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2455,10 +2455,10 @@ istanbul-reports@^3.1.4: html-escaper "^2.0.0" istanbul-lib-report "^3.0.0" -itty-router@^4.0.6: - version "4.0.6" - resolved "https://registry.yarnpkg.com/itty-router/-/itty-router-4.0.6.tgz#6481246d6326c5ad188ef4838c26170151058493" - integrity sha512-bzfBY19gJS/GQK7Wvw/Wj03t6KFRo/JOvtzmlNtEv0UJqqWWbBT/0PIf6j9YbpIUwwA3OpeZHjJN05+YWaAVvQ== +itty-router@^4.0.10: + version "4.0.10" + resolved "https://registry.yarnpkg.com/itty-router/-/itty-router-4.0.10.tgz#d2f6bdd74880539975552a0db5c81bfaa3655e2e" + integrity sha512-2B8nfXlHpzRiCEp1uSULRoy1lyzzOmLvLYEcX+Jg2Io9Q7e6F+Lv/qwYv+qzR2z256PmCzaq6yrA+2dnXysy9g== jackspeak@^2.0.3: version "2.2.1"