bogeychan
bogeychan
DDeno
Created by bogeychan on 11/24/2023 in #help
Help with npm peerDependencies
this dependency resolution should work if deno wanna be fully compatible with node.js. in case you wanna try it out for yourself:
// main.js
import '@bogeychan/elysia-polyfills/node/index.js';

import { cors } from '@elysiajs/cors';
import { html } from '@elysiajs/html';
import { bearer } from '@elysiajs/bearer';
import { swagger } from '@elysiajs/swagger';

import { Elysia } from 'elysia';

const app = new Elysia()
.use(cors())
.use(html())
.use(bearer())
.use(swagger())
.get('/', () => ({ hello: 'Node.js👋' }))
.listen(8080);

console.log('Listening on http://localhost:8080');
// main.js
import '@bogeychan/elysia-polyfills/node/index.js';

import { cors } from '@elysiajs/cors';
import { html } from '@elysiajs/html';
import { bearer } from '@elysiajs/bearer';
import { swagger } from '@elysiajs/swagger';

import { Elysia } from 'elysia';

const app = new Elysia()
.use(cors())
.use(html())
.use(bearer())
.use(swagger())
.get('/', () => ({ hello: 'Node.js👋' }))
.listen(8080);

console.log('Listening on http://localhost:8080');
// package.json
{
"private": true,
"type": "module",
"main": "main.js",
"dependencies": {
"@bogeychan/elysia-polyfills": "0.6.1",
"@elysiajs/cors": "0.7.2",
"@elysiajs/html": "0.7.3",
"@elysiajs/bearer": "0.7.0",
"@elysiajs/swagger": "0.7.4",
"elysia": "0.7.29"
}
}
// package.json
{
"private": true,
"type": "module",
"main": "main.js",
"dependencies": {
"@bogeychan/elysia-polyfills": "0.6.1",
"@elysiajs/cors": "0.7.2",
"@elysiajs/html": "0.7.3",
"@elysiajs/bearer": "0.7.0",
"@elysiajs/swagger": "0.7.4",
"elysia": "0.7.29"
}
}
npm i && node . # v18.16.0
npm i && node . # v18.16.0
I'm fine with the workaround, since the polyfills are experimental anyway
12 replies
DDeno
Created by bogeychan on 11/24/2023 in #help
Help with npm peerDependencies
ooh, that makes sense, it works! thanks everyone <:hooray_deno:1035517542200004688> <:chun_happy:1076036980334415882>
12 replies
DDeno
Created by bogeychan on 11/24/2023 in #help
Help with npm peerDependencies
No description
12 replies