Skip to content

Commit

Permalink
🧹 chore: bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
SaltyAom committed Jul 16, 2024
1 parent a2a179a commit 80c85e4
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 258 deletions.
7 changes: 5 additions & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
.git
.gitignore
.github
.gitignore
.prettierrc
.cjs.swcrc
.es.swcrc
bun.lockb
src

node_modules
tsconfig.json
Expand All @@ -20,3 +19,7 @@ CHANGELOG.md
.eslintrc.js
tsconfig.cjs.json
tsconfig.esm.json
tsconfig.dts.json

build.ts
src
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@

# 1.1.0 - 16 Jul 2024
Change:
- Add support for Elysia 1.1

# 1.0.5 - 14 Jul 2024
Bug fix:
- fix content-type on preflight
Expand Down
Binary file modified bun.lockb
Binary file not shown.
Empty file added pac
Empty file.
96 changes: 48 additions & 48 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,49 +1,49 @@
{
"name": "@elysiajs/cors",
"version": "1.0.5",
"description": "Plugin for Elysia that for Cross Origin Requests (CORs)",
"author": {
"name": "saltyAom",
"url": "https://github.com/SaltyAom",
"email": "[email protected]"
},
"repository": {
"type": "git",
"url": "https://github.com/elysiajs/elysia-cors"
},
"main": "./dist/cjs/index.js",
"module": "./dist/index.js",
"types": "./dist/index.d.ts",
"exports": {
"bun": "./dist/index.js",
"node": "./dist/cjs/index.js",
"require": "./dist/cjs/index.js",
"import": "./dist/index.js",
"default": "./dist/cjs/index.js",
"types": "./dist/index.d.ts"
},
"homepage": "https://github.com/elysiajs/elysia-cors",
"keywords": [
"elysia",
"cors"
],
"license": "MIT",
"scripts": {
"dev": "bun run --watch example/index.ts",
"test": "bun test && npm run test:node",
"test:node": "npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js",
"build": "rimraf dist && tsc --project tsconfig.esm.json && tsc --project tsconfig.cjs.json",
"release": "npm run build && npm run test && npm publish --access public"
},
"devDependencies": {
"@types/bun": "^1.0.4",
"@types/node": "^18.11.7",
"elysia": "1.0.27",
"eslint": "^8.26.0",
"rimraf": "^3.0.2",
"typescript": "^5.4.3"
},
"peerDependencies": {
"elysia": ">= 1.0.2"
}
}
"name": "@elysiajs/cors",
"version": "1.1.0",
"description": "Plugin for Elysia that for Cross Origin Requests (CORs)",
"author": {
"name": "saltyAom",
"url": "https://github.com/SaltyAom",
"email": "[email protected]"
},
"repository": {
"type": "git",
"url": "https://github.com/elysiajs/elysia-cors"
},
"main": "./dist/cjs/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"exports": {
"./package.json": "./package.json",
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/cjs/index.js"
}
},
"homepage": "https://github.com/elysiajs/elysia-cors",
"keywords": [
"elysia",
"cors"
],
"license": "MIT",
"scripts": {
"dev": "bun run --watch example/index.ts",
"test": "bun test && npm run test:node",
"test:node": "npm install --prefix ./test/node/cjs/ && npm install --prefix ./test/node/esm/ && node ./test/node/cjs/index.js && node ./test/node/esm/index.js",
"build": "bun build.ts",
"release": "npm run build && npm run test && npm publish --access public"
},
"devDependencies": {
"@types/bun": "^1.1.6",
"@types/node": "^20.14.10",
"elysia": ">= 1.1.0-rc.2",
"eslint": "^8.26.0",
"tsup": "^8.1.0",
"typescript": "^5.5.2"
},
"peerDependencies": {
"elysia": ">= 1.1.0"
}
}
3 changes: 3 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ interface CORSConfig {
preflight?: boolean
}

// @ts-ignore
const isBun = typeof new Headers()?.toJSON === 'function'

/**
Expand Down Expand Up @@ -301,6 +302,7 @@ export const cors = (config?: CORSConfig) => {
defaultHeaders['access-control-expose-headers'] = exposeHeaders

if (typeof allowedHeaders === 'string')
// @ts-ignore
defaultHeaders['access-control-allow-headers'] = allowedHeaders

if (credentials === true)
Expand Down Expand Up @@ -336,6 +338,7 @@ export const cors = (config?: CORSConfig) => {
handleMethod(set, request.method)

if (allowedHeaders === true || exposeHeaders === true) {
// @ts-ignore
const headers = processHeaders(request.headers)

if (allowedHeaders === true)
Expand Down
104 changes: 0 additions & 104 deletions tsconfig.cjs.json

This file was deleted.

Loading

0 comments on commit 80c85e4

Please sign in to comment.