Skip to content

Commit

Permalink
rspack and hono
Browse files Browse the repository at this point in the history
  • Loading branch information
elliotBraem committed Feb 1, 2025
1 parent 54e7fe0 commit 0cc1553
Show file tree
Hide file tree
Showing 12 changed files with 302 additions and 281 deletions.
61 changes: 25 additions & 36 deletions backend/package.json
Original file line number Diff line number Diff line change
@@ -1,57 +1,46 @@
{
"name": "@curatedotfun/backend",
"version": "0.0.1",
"packageManager": "[email protected]",
"type": "module",
"scripts": {
"build": "bun build ./src/index.ts --target=bun --outdir=dist --format=esm --external './src/external' && cp -r src/external dist/external/",
"start": "bun run dist/index.js",
"dev": "bun run --watch src/index.ts",
"test": "bun test",
"test:watch": "bun test --watch",
"db:generate": "bun drizzle-kit generate",
"db:migrate": "bun drizzle-kit migrate",
"db:push": "bun drizzle-kit push",
"db:pull": "bun drizzle-kit pull",
"db:check": "bun drizzle-kit check",
"db:up": "bun drizzle-kit up",
"db:studio": "bun drizzle-kit studio"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
"build": "rspack build",
"start": "node dist/main.js",
"dev": "rspack serve --hot",
"test": "jest",
"test:watch": "jest --watch",
"db:generate": "drizzle-kit generate",
"db:migrate": "drizzle-kit migrate",
"db:push": "drizzle-kit push",
"db:pull": "drizzle-kit pull",
"db:check": "drizzle-kit check",
"db:up": "drizzle-kit up",
"db:studio": "drizzle-kit studio"
},
"devDependencies": {
"@module-federation/enhanced": "^0.8.9",
"@module-federation/node": "^2.6.22",
"@module-federation/runtime": "0.8.9",
"@module-federation/dts-plugin": "^0.8.9",
"@rspack/cli": "^1.2.2",
"@rspack/core": "^1.2.2",
"@types/better-sqlite3": "^7.6.9",
"@types/jest": "^29.5.12",
"@types/ora": "^3.2.0",
"bun-types": "^1.1.43",
"drizzle-kit": "^0.30.1",
"jest": "^29.7.0",
"jest-mock-extended": "^4.0.0-beta1",
"ts-jest": "^29.2.5",
"ts-node": "^10.9.1",
"typescript": "^5.3.3"
},
"dependencies": {
"@elysiajs/cors": "^1.2.0",
"@elysiajs/static": "^1.2.0",
"@elysiajs/swagger": "^1.2.0",
"@hono/node-server": "^1.13.8",
"@hono/swagger-ui": "^0.5.0",
"@hono/zod-validator": "^0.4.2",
"@libsql/client": "^0.14.0",
"@types/cors": "^2.8.17",
"agent-twitter-client": "^0.0.16",
"cors": "^2.8.5",
"better-sqlite3": "^9.4.0",
"dotenv": "^16.0.3",
"drizzle-orm": "^0.38.3",
"elysia": "^1.2.10",
"elysia-helmet": "^2.0.0",
"express": "^4.18.2",
"hono": "^4.6.20",
"ora": "^8.1.1",
"winston": "^3.17.0",
"winston-console-format": "^1.0.8"
Expand Down
43 changes: 43 additions & 0 deletions backend/rspack.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
const { UniversalFederationPlugin } = require('@module-federation/node');

/** @type {import('@rspack/core').Configuration} */
const config = {
target: 'async-node',
entry: {
main: './src/index.ts',
},
output: {
publicPath: 'http://localhost:3001/',
library: { type: 'commonjs-module' },
},
module: {
rules: [
{
test: /\.ts$/,
exclude: [/node_modules/],
loader: 'builtin:swc-loader',
options: {
jsc: {
parser: {
syntax: 'typescript',
},
},
},
type: 'javascript/auto',
},
],
},
plugins: [
new UniversalFederationPlugin({
remoteType: 'script',
isServer: true,
name: 'host',
useRuntimePlugin: true,
})
],
resolve: {
extensions: ['.ts', '.js'],
}
};

module.exports = config;
Loading

0 comments on commit 0cc1553

Please sign in to comment.