mirror of
https://github.com/MercuryWorkshop/scramjet.git
synced 2025-05-14 06:50:01 -04:00
change build system to rollup
This commit is contained in:
parent
5122438c96
commit
c3db610837
39 changed files with 2225 additions and 2451 deletions
|
@ -1,97 +0,0 @@
|
|||
// import { createServer } from "esbuild-server";
|
||||
import copy from "esbuild-plugin-copy";
|
||||
import time from "esbuild-plugin-time";
|
||||
import { createBareServer } from "@tomphttp/bare-server-node";
|
||||
import Fastify from "fastify";
|
||||
import { context } from "esbuild";
|
||||
import { createServer } from "http";
|
||||
import fastifyStatic from "@fastify/static";
|
||||
import { join } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import "dotenv/config";
|
||||
|
||||
const bare = createBareServer("/bare/", {
|
||||
logErrors: true
|
||||
});
|
||||
|
||||
const fastify = Fastify({
|
||||
serverFactory: (handler) => {
|
||||
return createServer()
|
||||
.on("request", (req, res) => {
|
||||
if (bare.shouldRoute(req)) {
|
||||
bare.routeRequest(req, res);
|
||||
} else {
|
||||
handler(req, res);
|
||||
}
|
||||
}).on("upgrade", (req, socket, head) => {
|
||||
if (bare.shouldRoute(req)) {
|
||||
bare.routeUpgrade(req, socket, head);
|
||||
} else {
|
||||
socket.end();
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
fastify.register(fastifyStatic, {
|
||||
root: join(fileURLToPath(new URL(".", import.meta.url)), "./static"),
|
||||
decorateReply: false
|
||||
});
|
||||
|
||||
//fastify.get("/", {
|
||||
|
||||
// })
|
||||
|
||||
fastify.listen({
|
||||
port: 1337
|
||||
});
|
||||
|
||||
const devServer = await context({
|
||||
entryPoints: {
|
||||
client: "./src/client/index.ts",
|
||||
bundle: "./src/bundle/index.ts",
|
||||
worker: "./src/worker/index.ts",
|
||||
codecs: "./src/codecs/index.ts",
|
||||
config: "./src/scramjet.config.ts",
|
||||
},
|
||||
entryNames: "scramjet.[name]",
|
||||
outdir: "./dist",
|
||||
bundle: true,
|
||||
sourcemap: true,
|
||||
logLevel: "info",
|
||||
format: "esm",
|
||||
plugins: [
|
||||
copy({
|
||||
resolveFrom: "cwd",
|
||||
assets: [
|
||||
{
|
||||
from: ["./node_modules/@mercuryworkshop/bare-mux/dist/index.js"],
|
||||
to: ["./static/bare-mux.js"],
|
||||
},
|
||||
{
|
||||
from: ["./node_modules/@mercuryworkshop/bare-as-module3/dist/index.mjs"],
|
||||
to: ["./static/bare-client.js"],
|
||||
},
|
||||
{
|
||||
from: ["./node_modules/@mercuryworkshop/libcurl-transport/dist/index.mjs"],
|
||||
to: ["./static/curl-client.js"],
|
||||
},
|
||||
{
|
||||
from: ["./node_modules/@mercuryworkshop/epoxy-transport/dist/index.mjs"],
|
||||
to: ["./static/epoxy-client.js"],
|
||||
},
|
||||
{
|
||||
from: ["./node_modules/@mercuryworkshop/bare-mux/dist/worker.js"],
|
||||
to: ["./static/bare-mux-worker.js"],
|
||||
},
|
||||
{
|
||||
from: ["./dist/*"],
|
||||
to: ["./static"]
|
||||
},
|
||||
],
|
||||
}),
|
||||
time()
|
||||
],
|
||||
});
|
||||
|
||||
await devServer.watch();
|
26
esbuild.js
26
esbuild.js
|
@ -1,26 +0,0 @@
|
|||
import { build } from "esbuild";
|
||||
import time from "esbuild-plugin-time";
|
||||
import { writeFileSync } from "fs"
|
||||
|
||||
const scramjetBuild = await build({
|
||||
entryPoints: {
|
||||
client: "./src/client/index.ts",
|
||||
bundle: "./src/bundle/index.ts",
|
||||
worker: "./src/worker/index.ts",
|
||||
codecs: "./src/codecs/index.ts",
|
||||
config: "./src/scramjet.config.ts",
|
||||
},
|
||||
entryNames: "scramjet.[name]",
|
||||
outdir: "./dist",
|
||||
bundle: true,
|
||||
plugins: [
|
||||
time()
|
||||
],
|
||||
logLevel: "info",
|
||||
metafile: true,
|
||||
treeShaking: true,
|
||||
minify: true,
|
||||
format: "esm"
|
||||
});
|
||||
|
||||
writeFileSync("./meta.json", JSON.stringify(scramjetBuild.metafile));
|
16
package.json
16
package.json
|
@ -9,8 +9,8 @@
|
|||
"url": "https://github.com/MercuryWorkshop/scramjet"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "node esbuild.js",
|
||||
"dev": "node esbuild.dev.js",
|
||||
"build": "rollup -c",
|
||||
"dev": "node server.js",
|
||||
"prepublish": "pnpm build",
|
||||
"pub": "pnpm publish --no-git-checks --access public"
|
||||
},
|
||||
|
@ -26,18 +26,20 @@
|
|||
"@mercuryworkshop/bare-as-module3": "^2.2.2",
|
||||
"@mercuryworkshop/epoxy-transport": "^2.1.3",
|
||||
"@mercuryworkshop/libcurl-transport": "^1.3.6",
|
||||
"@rollup/plugin-inject": "^5.0.5",
|
||||
"@rollup/plugin-replace": "^5.0.5",
|
||||
"@tomphttp/bare-server-node": "^2.0.3",
|
||||
"@types/eslint": "^8.56.10",
|
||||
"@types/estraverse": "^5.1.7",
|
||||
"@types/estree": "^1.0.5",
|
||||
"@types/node": "^20.14.10",
|
||||
"@types/serviceworker": "^0.0.85",
|
||||
"@typescript-eslint/eslint-plugin": "^6.21.0",
|
||||
"@typescript-eslint/parser": "^6.21.0",
|
||||
"dotenv": "^16.4.5",
|
||||
"esbuild": "^0.20.2",
|
||||
"esbuild-plugin-copy": "^2.1.1",
|
||||
"esbuild-plugin-time": "^1.0.0",
|
||||
"eslint": "^8.57.0",
|
||||
"fastify": "^4.26.2",
|
||||
"rollup": "^4.17.2",
|
||||
"rollup-plugin-typescript2": "^0.36.0",
|
||||
"tslib": "^2.6.2",
|
||||
"typescript": "^5.4.5"
|
||||
},
|
||||
|
@ -45,11 +47,11 @@
|
|||
"dependencies": {
|
||||
"@mercuryworkshop/bare-mux": "^2.0.2",
|
||||
"@webreflection/idb-map": "^0.3.1",
|
||||
"astravel": "^0.6.1",
|
||||
"astring": "^1.8.6",
|
||||
"dom-serializer": "^2.0.0",
|
||||
"domhandler": "^5.0.3",
|
||||
"domutils": "^3.1.0",
|
||||
"estraverse": "^5.3.0",
|
||||
"htmlparser2": "^9.1.0",
|
||||
"meriyah": "^4.4.2"
|
||||
}
|
||||
|
|
429
pnpm-lock.yaml
generated
429
pnpm-lock.yaml
generated
|
@ -14,6 +14,9 @@ importers:
|
|||
'@webreflection/idb-map':
|
||||
specifier: ^0.3.1
|
||||
version: 0.3.1
|
||||
astravel:
|
||||
specifier: ^0.6.1
|
||||
version: 0.6.1
|
||||
astring:
|
||||
specifier: ^1.8.6
|
||||
version: 1.8.6
|
||||
|
@ -26,9 +29,6 @@ importers:
|
|||
domutils:
|
||||
specifier: ^3.1.0
|
||||
version: 3.1.0
|
||||
estraverse:
|
||||
specifier: ^5.3.0
|
||||
version: 5.3.0
|
||||
htmlparser2:
|
||||
specifier: ^9.1.0
|
||||
version: 9.1.0
|
||||
|
@ -48,15 +48,24 @@ importers:
|
|||
'@mercuryworkshop/libcurl-transport':
|
||||
specifier: ^1.3.6
|
||||
version: 1.3.6(typescript@5.4.5)
|
||||
'@rollup/plugin-inject':
|
||||
specifier: ^5.0.5
|
||||
version: 5.0.5(rollup@4.17.2)
|
||||
'@rollup/plugin-replace':
|
||||
specifier: ^5.0.5
|
||||
version: 5.0.7(rollup@4.17.2)
|
||||
'@tomphttp/bare-server-node':
|
||||
specifier: ^2.0.3
|
||||
version: 2.0.3
|
||||
'@types/eslint':
|
||||
specifier: ^8.56.10
|
||||
version: 8.56.10
|
||||
'@types/estraverse':
|
||||
specifier: ^5.1.7
|
||||
version: 5.1.7
|
||||
'@types/estree':
|
||||
specifier: ^1.0.5
|
||||
version: 1.0.5
|
||||
'@types/node':
|
||||
specifier: ^20.14.10
|
||||
version: 20.14.10
|
||||
'@types/serviceworker':
|
||||
specifier: ^0.0.85
|
||||
version: 0.0.85
|
||||
|
@ -69,21 +78,18 @@ importers:
|
|||
dotenv:
|
||||
specifier: ^16.4.5
|
||||
version: 16.4.5
|
||||
esbuild:
|
||||
specifier: ^0.20.2
|
||||
version: 0.20.2
|
||||
esbuild-plugin-copy:
|
||||
specifier: ^2.1.1
|
||||
version: 2.1.1(esbuild@0.20.2)
|
||||
esbuild-plugin-time:
|
||||
specifier: ^1.0.0
|
||||
version: 1.0.0
|
||||
eslint:
|
||||
specifier: ^8.57.0
|
||||
version: 8.57.0
|
||||
fastify:
|
||||
specifier: ^4.26.2
|
||||
version: 4.26.2
|
||||
rollup:
|
||||
specifier: ^4.17.2
|
||||
version: 4.17.2
|
||||
rollup-plugin-typescript2:
|
||||
specifier: ^0.36.0
|
||||
version: 0.36.0(rollup@4.17.2)(typescript@5.4.5)
|
||||
tslib:
|
||||
specifier: ^2.6.2
|
||||
version: 2.6.2
|
||||
|
@ -93,144 +99,6 @@ importers:
|
|||
|
||||
packages:
|
||||
|
||||
'@esbuild/aix-ppc64@0.20.2':
|
||||
resolution: {integrity: sha512-D+EBOJHXdNZcLJRBkhENNG8Wji2kgc9AZ9KiPr1JuZjsNtyHzrsfLRrY0tk2H2aoFu6RANO1y1iPPUCDYWkb5g==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [ppc64]
|
||||
os: [aix]
|
||||
|
||||
'@esbuild/android-arm64@0.20.2':
|
||||
resolution: {integrity: sha512-mRzjLacRtl/tWU0SvD8lUEwb61yP9cqQo6noDZP/O8VkwafSYwZ4yWy24kan8jE/IMERpYncRt2dw438LP3Xmg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [android]
|
||||
|
||||
'@esbuild/android-arm@0.20.2':
|
||||
resolution: {integrity: sha512-t98Ra6pw2VaDhqNWO2Oph2LXbz/EJcnLmKLGBJwEwXX/JAN83Fym1rU8l0JUWK6HkIbWONCSSatf4sf2NBRx/w==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm]
|
||||
os: [android]
|
||||
|
||||
'@esbuild/android-x64@0.20.2':
|
||||
resolution: {integrity: sha512-btzExgV+/lMGDDa194CcUQm53ncxzeBrWJcncOBxuC6ndBkKxnHdFJn86mCIgTELsooUmwUm9FkhSp5HYu00Rg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [android]
|
||||
|
||||
'@esbuild/darwin-arm64@0.20.2':
|
||||
resolution: {integrity: sha512-4J6IRT+10J3aJH3l1yzEg9y3wkTDgDk7TSDFX+wKFiWjqWp/iCfLIYzGyasx9l0SAFPT1HwSCR+0w/h1ES/MjA==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [darwin]
|
||||
|
||||
'@esbuild/darwin-x64@0.20.2':
|
||||
resolution: {integrity: sha512-tBcXp9KNphnNH0dfhv8KYkZhjc+H3XBkF5DKtswJblV7KlT9EI2+jeA8DgBjp908WEuYll6pF+UStUCfEpdysA==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [darwin]
|
||||
|
||||
'@esbuild/freebsd-arm64@0.20.2':
|
||||
resolution: {integrity: sha512-d3qI41G4SuLiCGCFGUrKsSeTXyWG6yem1KcGZVS+3FYlYhtNoNgYrWcvkOoaqMhwXSMrZRl69ArHsGJ9mYdbbw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [freebsd]
|
||||
|
||||
'@esbuild/freebsd-x64@0.20.2':
|
||||
resolution: {integrity: sha512-d+DipyvHRuqEeM5zDivKV1KuXn9WeRX6vqSqIDgwIfPQtwMP4jaDsQsDncjTDDsExT4lR/91OLjRo8bmC1e+Cw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [freebsd]
|
||||
|
||||
'@esbuild/linux-arm64@0.20.2':
|
||||
resolution: {integrity: sha512-9pb6rBjGvTFNira2FLIWqDk/uaf42sSyLE8j1rnUpuzsODBq7FvpwHYZxQ/It/8b+QOS1RYfqgGFNLRI+qlq2A==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-arm@0.20.2':
|
||||
resolution: {integrity: sha512-VhLPeR8HTMPccbuWWcEUD1Az68TqaTYyj6nfE4QByZIQEQVWBB8vup8PpR7y1QHL3CpcF6xd5WVBU/+SBEvGTg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-ia32@0.20.2':
|
||||
resolution: {integrity: sha512-o10utieEkNPFDZFQm9CoP7Tvb33UutoJqg3qKf1PWVeeJhJw0Q347PxMvBgVVFgouYLGIhFYG0UGdBumROyiig==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [ia32]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-loong64@0.20.2':
|
||||
resolution: {integrity: sha512-PR7sp6R/UC4CFVomVINKJ80pMFlfDfMQMYynX7t1tNTeivQ6XdX5r2XovMmha/VjR1YN/HgHWsVcTRIMkymrgQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [loong64]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-mips64el@0.20.2':
|
||||
resolution: {integrity: sha512-4BlTqeutE/KnOiTG5Y6Sb/Hw6hsBOZapOVF6njAESHInhlQAghVVZL1ZpIctBOoTFbQyGW+LsVYZ8lSSB3wkjA==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [mips64el]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-ppc64@0.20.2':
|
||||
resolution: {integrity: sha512-rD3KsaDprDcfajSKdn25ooz5J5/fWBylaaXkuotBDGnMnDP1Uv5DLAN/45qfnf3JDYyJv/ytGHQaziHUdyzaAg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [ppc64]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-riscv64@0.20.2':
|
||||
resolution: {integrity: sha512-snwmBKacKmwTMmhLlz/3aH1Q9T8v45bKYGE3j26TsaOVtjIag4wLfWSiZykXzXuE1kbCE+zJRmwp+ZbIHinnVg==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [riscv64]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-s390x@0.20.2':
|
||||
resolution: {integrity: sha512-wcWISOobRWNm3cezm5HOZcYz1sKoHLd8VL1dl309DiixxVFoFe/o8HnwuIwn6sXre88Nwj+VwZUvJf4AFxkyrQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [s390x]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/linux-x64@0.20.2':
|
||||
resolution: {integrity: sha512-1MdwI6OOTsfQfek8sLwgyjOXAu+wKhLEoaOLTjbijk6E2WONYpH9ZU2mNtR+lZ2B4uwr+usqGuVfFT9tMtGvGw==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [linux]
|
||||
|
||||
'@esbuild/netbsd-x64@0.20.2':
|
||||
resolution: {integrity: sha512-K8/DhBxcVQkzYc43yJXDSyjlFeHQJBiowJ0uVL6Tor3jGQfSGHNNJcWxNbOI8v5k82prYqzPuwkzHt3J1T1iZQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [netbsd]
|
||||
|
||||
'@esbuild/openbsd-x64@0.20.2':
|
||||
resolution: {integrity: sha512-eMpKlV0SThJmmJgiVyN9jTPJ2VBPquf6Kt/nAoo6DgHAoN57K15ZghiHaMvqjCye/uU4X5u3YSMgVBI1h3vKrQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [openbsd]
|
||||
|
||||
'@esbuild/sunos-x64@0.20.2':
|
||||
resolution: {integrity: sha512-2UyFtRC6cXLyejf/YEld4Hajo7UHILetzE1vsRcGL3earZEW77JxrFjH4Ez2qaTiEfMgAXxfAZCm1fvM/G/o8w==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [sunos]
|
||||
|
||||
'@esbuild/win32-arm64@0.20.2':
|
||||
resolution: {integrity: sha512-GRibxoawM9ZCnDxnP3usoUDO9vUkpAxIIZ6GQI+IlVmr5kP3zUq+l17xELTHMWTWzjxa2guPNyrpq1GWmPvcGQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [arm64]
|
||||
os: [win32]
|
||||
|
||||
'@esbuild/win32-ia32@0.20.2':
|
||||
resolution: {integrity: sha512-HfLOfn9YWmkSKRQqovpnITazdtquEW8/SoHW7pWpuEeguaZI4QnCRW6b+oZTztdBnZOS2hqJ6im/D5cPzBTTlQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [ia32]
|
||||
os: [win32]
|
||||
|
||||
'@esbuild/win32-x64@0.20.2':
|
||||
resolution: {integrity: sha512-N49X4lJX27+l9jbLKSqZ6bKNjzQvHaT8IIFUy+YIqmXQdjYCToGWwOItDrfby14c78aDd5NHQl29xingXfCdLQ==}
|
||||
engines: {node: '>=12'}
|
||||
cpu: [x64]
|
||||
os: [win32]
|
||||
|
||||
'@eslint-community/eslint-utils@4.4.0':
|
||||
resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
|
@ -286,6 +154,9 @@ packages:
|
|||
resolution: {integrity: sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
'@jridgewell/sourcemap-codec@1.5.0':
|
||||
resolution: {integrity: sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ==}
|
||||
|
||||
'@lukeed/ms@2.0.2':
|
||||
resolution: {integrity: sha512-9I2Zn6+NJLfaGoz9jN3lpwDgAYvfGeNYdbAIjJOqzs4Tpc+VU3Jqq4IofSUBKajiDS8k9fZIg18/z13mpk1bsA==}
|
||||
engines: {node: '>=8'}
|
||||
|
@ -321,10 +192,37 @@ packages:
|
|||
resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==}
|
||||
engines: {node: '>=14'}
|
||||
|
||||
'@rollup/plugin-inject@5.0.5':
|
||||
resolution: {integrity: sha512-2+DEJbNBoPROPkgTDNe8/1YXWcqxbN5DTjASVIOx8HS+pITXushyNiBV56RB08zuptzz8gT3YfkqriTBVycepg==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
peerDependencies:
|
||||
rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0
|
||||
peerDependenciesMeta:
|
||||
rollup:
|
||||
optional: true
|
||||
|
||||
'@rollup/plugin-replace@5.0.7':
|
||||
resolution: {integrity: sha512-PqxSfuorkHz/SPpyngLyg5GCEkOcee9M1bkxiVDr41Pd61mqP1PLOoDPbpl44SB2mQGKwV/In74gqQmGITOhEQ==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
peerDependencies:
|
||||
rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0
|
||||
peerDependenciesMeta:
|
||||
rollup:
|
||||
optional: true
|
||||
|
||||
'@rollup/pluginutils@4.2.1':
|
||||
resolution: {integrity: sha512-iKnFXr7NkdZAIHiIWE+BX5ULi/ucVFYWD6TbAV+rZctiRTY2PL6tsIKhoIOaoskiWAkgu+VsbXgUVDNLHf+InQ==}
|
||||
engines: {node: '>= 8.0.0'}
|
||||
|
||||
'@rollup/pluginutils@5.1.0':
|
||||
resolution: {integrity: sha512-XTIWOPPcpvyKI6L1NHo0lFlCyznUEyPmPY1mc3KpPVDYulHSTvyeLNVW00QTLIAFNhR3kYnJTQHeGqU4M3n09g==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
peerDependencies:
|
||||
rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0
|
||||
peerDependenciesMeta:
|
||||
rollup:
|
||||
optional: true
|
||||
|
||||
'@rollup/rollup-android-arm-eabi@4.17.2':
|
||||
resolution: {integrity: sha512-NM0jFxY8bB8QLkoKxIQeObCaDlJKewVlIEkuyYKm5An1tdVZ966w2+MPQ2l8LBZLjR+SgyV+nRkTIunzOYBMLQ==}
|
||||
cpu: [arm]
|
||||
|
@ -413,17 +311,14 @@ packages:
|
|||
'@types/eslint@8.56.10':
|
||||
resolution: {integrity: sha512-Shavhk87gCtY2fhXDctcfS3e6FdxWkCx1iUZ9eEUbh7rTqlZT0/IzOkCOVt0fCjcFuZ9FPYfuezTBImfHCDBGQ==}
|
||||
|
||||
'@types/estraverse@5.1.7':
|
||||
resolution: {integrity: sha512-JRVtdKYZz7VkNp7hMC/WKoiZ8DS3byw20ZGoMZ1R8eBrBPIY7iBaDAS1zcrnXQCwK44G4vbXkimeU7R0VLG8UQ==}
|
||||
|
||||
'@types/estree@1.0.5':
|
||||
resolution: {integrity: sha512-/kYRxGDLWzHOB7q+wtSUQlFrtcdUccpfy+X+9iMBpHK8QLLhx2wIPYuS5DYtR9Wa/YlZAbIovy7qVdB1Aq6Lyw==}
|
||||
|
||||
'@types/json-schema@7.0.15':
|
||||
resolution: {integrity: sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==}
|
||||
|
||||
'@types/node@20.12.11':
|
||||
resolution: {integrity: sha512-vDg9PZ/zi+Nqp6boSOT7plNuthRugEKixDv5sFTIpkE89MmNtEArAShI4mxuX2+UrLEe9pxC1vm2cjm9YlWbJw==}
|
||||
'@types/node@20.14.10':
|
||||
resolution: {integrity: sha512-MdiXf+nDuMvY0gJKxyfZ7/6UFsETO7mGKF54MVD/ekJS6HdFtpZFBgrh6Pseu64XTb2MLyFPlbW6hj8HYRQNOQ==}
|
||||
|
||||
'@types/resolve@0.0.8':
|
||||
resolution: {integrity: sha512-auApPaJf3NPfe18hSoJkp8EbZzer2ISk7o8mCC3M9he/a04+gbMF97NkpD2S8riMGvm4BMRI59/SZQSaLTKpsQ==}
|
||||
|
@ -553,10 +448,6 @@ packages:
|
|||
resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==}
|
||||
engines: {node: '>=12'}
|
||||
|
||||
anymatch@3.1.3:
|
||||
resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==}
|
||||
engines: {node: '>= 8'}
|
||||
|
||||
archy@1.0.0:
|
||||
resolution: {integrity: sha512-Xg+9RwCg/0p32teKdGMPTPnVXKD0w3DfHnFTficozsAgsvq2XenPJq/MYpzzQ/v8zrOyJn6Ds39VA4JIDwFfqw==}
|
||||
|
||||
|
@ -567,6 +458,9 @@ packages:
|
|||
resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
astravel@0.6.1:
|
||||
resolution: {integrity: sha512-ZIkgWFIV0Yo423Vqalz7VcF+BAiISvSgplnkV2abPGACPFKofsWTcvr9SFyYM/t/vMZWqmdP/Eze6ATX7r84Dg==}
|
||||
|
||||
astring@1.8.6:
|
||||
resolution: {integrity: sha512-ISvCdHdlTDlH5IpxQJIex7BWBywFWgjJSVdwst+/iQCoEYnyOaQ95+X1JGshuBjGp6nxKUy1jMgE3zPqN7fQdg==}
|
||||
hasBin: true
|
||||
|
@ -588,10 +482,6 @@ packages:
|
|||
base64-js@1.5.1:
|
||||
resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==}
|
||||
|
||||
binary-extensions@2.3.0:
|
||||
resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
brace-expansion@1.1.11:
|
||||
resolution: {integrity: sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==}
|
||||
|
||||
|
@ -620,10 +510,6 @@ packages:
|
|||
resolution: {integrity: sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
chokidar@3.6.0:
|
||||
resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==}
|
||||
engines: {node: '>= 8.10.0'}
|
||||
|
||||
color-convert@2.0.1:
|
||||
resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}
|
||||
engines: {node: '>=7.0.0'}
|
||||
|
@ -707,22 +593,9 @@ packages:
|
|||
resolution: {integrity: sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==}
|
||||
engines: {node: '>=0.12'}
|
||||
|
||||
esbuild-plugin-copy@2.1.1:
|
||||
resolution: {integrity: sha512-Bk66jpevTcV8KMFzZI1P7MZKZ+uDcrZm2G2egZ2jNIvVnivDpodZI+/KnpL3Jnap0PBdIHU7HwFGB8r+vV5CVw==}
|
||||
peerDependencies:
|
||||
esbuild: '>= 0.14.0'
|
||||
|
||||
esbuild-plugin-time@1.0.0:
|
||||
resolution: {integrity: sha512-I4Shhi0fpgXxSoc34djTHIuhbEzkcBbKKiNtb3LhZe2JEE1vSxXilW+KE0M/KZ4kqORLGgdGCKuJh9CNUL55yw==}
|
||||
|
||||
esbuild-plugin-umd-wrapper@2.0.0:
|
||||
resolution: {integrity: sha512-pcu2/lcm29S85VCnSJuValrQ8FqeFJs5VWEwfp7vBRsOHjxZypcxgwXjxDIxDRo17uOcENZIbgz2szjln029eQ==}
|
||||
|
||||
esbuild@0.20.2:
|
||||
resolution: {integrity: sha512-WdOOppmUNU+IbZ0PaDiTst80zjnrOkyJNHoKupIcVyU8Lvla3Ugx94VzkQ32Ijqd7UhHJy75gNWDMUekcrSJ6g==}
|
||||
engines: {node: '>=12'}
|
||||
hasBin: true
|
||||
|
||||
escape-html@1.0.3:
|
||||
resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==}
|
||||
|
||||
|
@ -946,10 +819,6 @@ packages:
|
|||
resolution: {integrity: sha512-Ag3wB2o37wslZS19hZqorUnrnzSkpOVy+IiiDEiTqNubEYpYuHWIf6K4psgN2ZWKExS4xhVCrRVfb/wfW8fWJA==}
|
||||
engines: {node: '>= 10'}
|
||||
|
||||
is-binary-path@2.1.0:
|
||||
resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==}
|
||||
engines: {node: '>=8'}
|
||||
|
||||
is-core-module@2.13.1:
|
||||
resolution: {integrity: sha512-hHrIjvZsftOsvKSn2TRYl63zvxsgE0K+0mYMoH6gD4omR5IWB2KynivBQczo3+wF1cCkjzvptnI9Q0sPU66ilw==}
|
||||
|
||||
|
@ -1037,6 +906,9 @@ packages:
|
|||
resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
magic-string@0.30.10:
|
||||
resolution: {integrity: sha512-iIRwTIf0QKV3UAnYK4PU8uiEc4SRh5jX0mwpIwETPpHdhVM4f53RSwS/vXvN1JhGX+Cs7B8qIq3d6AH49O5fAQ==}
|
||||
|
||||
make-dir@3.1.0:
|
||||
resolution: {integrity: sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==}
|
||||
engines: {node: '>=8'}
|
||||
|
@ -1075,10 +947,6 @@ packages:
|
|||
natural-compare@1.4.0:
|
||||
resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==}
|
||||
|
||||
normalize-path@3.0.0:
|
||||
resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==}
|
||||
engines: {node: '>=0.10.0'}
|
||||
|
||||
on-exit-leak-free@2.1.2:
|
||||
resolution: {integrity: sha512-0eJJY6hXLGf1udHwfNftBqH+g73EU4B504nZeKpz1sYRKafAghwxEJunB2O7rDZkL4PGfsMVnTXZ2EjibbqcsA==}
|
||||
engines: {node: '>=14.0.0'}
|
||||
|
@ -1184,10 +1052,6 @@ packages:
|
|||
resolution: {integrity: sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==}
|
||||
engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0}
|
||||
|
||||
readdirp@3.6.0:
|
||||
resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}
|
||||
engines: {node: '>=8.10.0'}
|
||||
|
||||
real-require@0.2.0:
|
||||
resolution: {integrity: sha512-57frrGM/OCTLqLOAh0mhVA9VBMHd+9U7Zb2THMGdBUoZVOtGbJzjxsYGDJ3A9AYYCP4hn6y1TVbaOfzWtm5GFg==}
|
||||
engines: {node: '>= 12.13.0'}
|
||||
|
@ -1431,75 +1295,6 @@ packages:
|
|||
|
||||
snapshots:
|
||||
|
||||
'@esbuild/aix-ppc64@0.20.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/android-arm64@0.20.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/android-arm@0.20.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/android-x64@0.20.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/darwin-arm64@0.20.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/darwin-x64@0.20.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/freebsd-arm64@0.20.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/freebsd-x64@0.20.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-arm64@0.20.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-arm@0.20.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-ia32@0.20.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-loong64@0.20.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-mips64el@0.20.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-ppc64@0.20.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-riscv64@0.20.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-s390x@0.20.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/linux-x64@0.20.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/netbsd-x64@0.20.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/openbsd-x64@0.20.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/sunos-x64@0.20.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/win32-arm64@0.20.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/win32-ia32@0.20.2':
|
||||
optional: true
|
||||
|
||||
'@esbuild/win32-x64@0.20.2':
|
||||
optional: true
|
||||
|
||||
'@eslint-community/eslint-utils@4.4.0(eslint@8.57.0)':
|
||||
dependencies:
|
||||
eslint: 8.57.0
|
||||
|
@ -1579,6 +1374,8 @@ snapshots:
|
|||
wrap-ansi: 8.1.0
|
||||
wrap-ansi-cjs: wrap-ansi@7.0.0
|
||||
|
||||
'@jridgewell/sourcemap-codec@1.5.0': {}
|
||||
|
||||
'@lukeed/ms@2.0.2': {}
|
||||
|
||||
'@mercuryworkshop/bare-as-module3@2.2.2':
|
||||
|
@ -1624,11 +1421,34 @@ snapshots:
|
|||
'@pkgjs/parseargs@0.11.0':
|
||||
optional: true
|
||||
|
||||
'@rollup/plugin-inject@5.0.5(rollup@4.17.2)':
|
||||
dependencies:
|
||||
'@rollup/pluginutils': 5.1.0(rollup@4.17.2)
|
||||
estree-walker: 2.0.2
|
||||
magic-string: 0.30.10
|
||||
optionalDependencies:
|
||||
rollup: 4.17.2
|
||||
|
||||
'@rollup/plugin-replace@5.0.7(rollup@4.17.2)':
|
||||
dependencies:
|
||||
'@rollup/pluginutils': 5.1.0(rollup@4.17.2)
|
||||
magic-string: 0.30.10
|
||||
optionalDependencies:
|
||||
rollup: 4.17.2
|
||||
|
||||
'@rollup/pluginutils@4.2.1':
|
||||
dependencies:
|
||||
estree-walker: 2.0.2
|
||||
picomatch: 2.3.1
|
||||
|
||||
'@rollup/pluginutils@5.1.0(rollup@4.17.2)':
|
||||
dependencies:
|
||||
'@types/estree': 1.0.5
|
||||
estree-walker: 2.0.2
|
||||
picomatch: 2.3.1
|
||||
optionalDependencies:
|
||||
rollup: 4.17.2
|
||||
|
||||
'@rollup/rollup-android-arm-eabi@4.17.2':
|
||||
optional: true
|
||||
|
||||
|
@ -1695,21 +1515,17 @@ snapshots:
|
|||
'@types/estree': 1.0.5
|
||||
'@types/json-schema': 7.0.15
|
||||
|
||||
'@types/estraverse@5.1.7':
|
||||
dependencies:
|
||||
'@types/estree': 1.0.5
|
||||
|
||||
'@types/estree@1.0.5': {}
|
||||
|
||||
'@types/json-schema@7.0.15': {}
|
||||
|
||||
'@types/node@20.12.11':
|
||||
'@types/node@20.14.10':
|
||||
dependencies:
|
||||
undici-types: 5.26.5
|
||||
|
||||
'@types/resolve@0.0.8':
|
||||
dependencies:
|
||||
'@types/node': 20.12.11
|
||||
'@types/node': 20.14.10
|
||||
|
||||
'@types/semver@7.5.8': {}
|
||||
|
||||
|
@ -1849,17 +1665,14 @@ snapshots:
|
|||
|
||||
ansi-styles@6.2.1: {}
|
||||
|
||||
anymatch@3.1.3:
|
||||
dependencies:
|
||||
normalize-path: 3.0.0
|
||||
picomatch: 2.3.1
|
||||
|
||||
archy@1.0.0: {}
|
||||
|
||||
argparse@2.0.1: {}
|
||||
|
||||
array-union@2.1.0: {}
|
||||
|
||||
astravel@0.6.1: {}
|
||||
|
||||
astring@1.8.6: {}
|
||||
|
||||
async-exit-hook@2.0.1: {}
|
||||
|
@ -1879,8 +1692,6 @@ snapshots:
|
|||
|
||||
base64-js@1.5.1: {}
|
||||
|
||||
binary-extensions@2.3.0: {}
|
||||
|
||||
brace-expansion@1.1.11:
|
||||
dependencies:
|
||||
balanced-match: 1.0.2
|
||||
|
@ -1910,18 +1721,6 @@ snapshots:
|
|||
ansi-styles: 4.3.0
|
||||
supports-color: 7.2.0
|
||||
|
||||
chokidar@3.6.0:
|
||||
dependencies:
|
||||
anymatch: 3.1.3
|
||||
braces: 3.0.2
|
||||
glob-parent: 5.1.2
|
||||
is-binary-path: 2.1.0
|
||||
is-glob: 4.0.3
|
||||
normalize-path: 3.0.0
|
||||
readdirp: 3.6.0
|
||||
optionalDependencies:
|
||||
fsevents: 2.3.3
|
||||
|
||||
color-convert@2.0.1:
|
||||
dependencies:
|
||||
color-name: 1.1.4
|
||||
|
@ -1990,46 +1789,8 @@ snapshots:
|
|||
|
||||
entities@4.5.0: {}
|
||||
|
||||
esbuild-plugin-copy@2.1.1(esbuild@0.20.2):
|
||||
dependencies:
|
||||
chalk: 4.1.2
|
||||
chokidar: 3.6.0
|
||||
esbuild: 0.20.2
|
||||
fs-extra: 10.1.0
|
||||
globby: 11.1.0
|
||||
|
||||
esbuild-plugin-time@1.0.0:
|
||||
dependencies:
|
||||
chalk: 4.1.2
|
||||
|
||||
esbuild-plugin-umd-wrapper@2.0.0: {}
|
||||
|
||||
esbuild@0.20.2:
|
||||
optionalDependencies:
|
||||
'@esbuild/aix-ppc64': 0.20.2
|
||||
'@esbuild/android-arm': 0.20.2
|
||||
'@esbuild/android-arm64': 0.20.2
|
||||
'@esbuild/android-x64': 0.20.2
|
||||
'@esbuild/darwin-arm64': 0.20.2
|
||||
'@esbuild/darwin-x64': 0.20.2
|
||||
'@esbuild/freebsd-arm64': 0.20.2
|
||||
'@esbuild/freebsd-x64': 0.20.2
|
||||
'@esbuild/linux-arm': 0.20.2
|
||||
'@esbuild/linux-arm64': 0.20.2
|
||||
'@esbuild/linux-ia32': 0.20.2
|
||||
'@esbuild/linux-loong64': 0.20.2
|
||||
'@esbuild/linux-mips64el': 0.20.2
|
||||
'@esbuild/linux-ppc64': 0.20.2
|
||||
'@esbuild/linux-riscv64': 0.20.2
|
||||
'@esbuild/linux-s390x': 0.20.2
|
||||
'@esbuild/linux-x64': 0.20.2
|
||||
'@esbuild/netbsd-x64': 0.20.2
|
||||
'@esbuild/openbsd-x64': 0.20.2
|
||||
'@esbuild/sunos-x64': 0.20.2
|
||||
'@esbuild/win32-arm64': 0.20.2
|
||||
'@esbuild/win32-ia32': 0.20.2
|
||||
'@esbuild/win32-x64': 0.20.2
|
||||
|
||||
escape-html@1.0.3: {}
|
||||
|
||||
escape-string-regexp@4.0.0: {}
|
||||
|
@ -2316,10 +2077,6 @@ snapshots:
|
|||
|
||||
ipaddr.js@2.2.0: {}
|
||||
|
||||
is-binary-path@2.1.0:
|
||||
dependencies:
|
||||
binary-extensions: 2.3.0
|
||||
|
||||
is-core-module@2.13.1:
|
||||
dependencies:
|
||||
hasown: 2.0.2
|
||||
|
@ -2401,6 +2158,10 @@ snapshots:
|
|||
dependencies:
|
||||
yallist: 4.0.0
|
||||
|
||||
magic-string@0.30.10:
|
||||
dependencies:
|
||||
'@jridgewell/sourcemap-codec': 1.5.0
|
||||
|
||||
make-dir@3.1.0:
|
||||
dependencies:
|
||||
semver: 6.3.1
|
||||
|
@ -2430,8 +2191,6 @@ snapshots:
|
|||
|
||||
natural-compare@1.4.0: {}
|
||||
|
||||
normalize-path@3.0.0: {}
|
||||
|
||||
on-exit-leak-free@2.1.2: {}
|
||||
|
||||
once@1.4.0:
|
||||
|
@ -2536,10 +2295,6 @@ snapshots:
|
|||
process: 0.11.10
|
||||
string_decoder: 1.3.0
|
||||
|
||||
readdirp@3.6.0:
|
||||
dependencies:
|
||||
picomatch: 2.3.1
|
||||
|
||||
real-require@0.2.0: {}
|
||||
|
||||
require-from-string@2.0.2: {}
|
||||
|
|
35
rollup.config.js
Normal file
35
rollup.config.js
Normal file
|
@ -0,0 +1,35 @@
|
|||
import typescript from "rollup-plugin-typescript2";
|
||||
import { join } from "node:path";
|
||||
import fs from "node:fs"
|
||||
import { fileURLToPath } from "node:url";
|
||||
|
||||
// check if its
|
||||
const production = !process.env.ROLLUP_WATCH;
|
||||
console.log(production)
|
||||
fs.rmSync(join(fileURLToPath(new URL(".", import.meta.url)), "./dist"), { recursive: true, force: true })
|
||||
|
||||
const commonPlugins = () => [
|
||||
typescript({
|
||||
tsconfig: "tsconfig.json",
|
||||
}),
|
||||
]
|
||||
|
||||
export default {
|
||||
plugins: commonPlugins(),
|
||||
input: {
|
||||
client: "./src/client/index.ts",
|
||||
bundle: "./src/bundle/index.ts",
|
||||
worker: "./src/worker/index.ts",
|
||||
codecs: "./src/codecs/index.ts",
|
||||
config: "./src/scramjet.config.ts"
|
||||
},
|
||||
output: {
|
||||
entryFileNames: "scramjet.[name].js",
|
||||
dir: "./dist",
|
||||
format: "esm",
|
||||
bundle: true,
|
||||
minify: production,
|
||||
sourcemap: true,
|
||||
treeshake: "recommended",
|
||||
},
|
||||
};
|
74
server.js
Normal file
74
server.js
Normal file
|
@ -0,0 +1,74 @@
|
|||
// Dev server imports
|
||||
import { createBareServer } from "@tomphttp/bare-server-node";
|
||||
import { createServer } from "http";
|
||||
import Fastify from "fastify";
|
||||
import fastifyStatic from "@fastify/static";
|
||||
import { join } from "node:path";
|
||||
import fs from "node:fs"
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { watch } from "rollup"
|
||||
import { loadConfigFile } from "rollup/loadConfigFile"
|
||||
|
||||
//transports
|
||||
import { baremuxPath } from "@mercuryworkshop/bare-mux/node"
|
||||
import { epoxyPath } from "@mercuryworkshop/epoxy-transport"
|
||||
import { libcurlPath } from "@mercuryworkshop/libcurl-transport"
|
||||
import { bareModulePath } from "@mercuryworkshop/bare-as-module3"
|
||||
|
||||
let watcher = watch()
|
||||
|
||||
const bare = createBareServer("/bare/", {
|
||||
logErrors: true
|
||||
});
|
||||
|
||||
const fastify = Fastify({
|
||||
serverFactory: (handler) => {
|
||||
return createServer()
|
||||
.on("request", (req, res) => {
|
||||
if (bare.shouldRoute(req)) {
|
||||
bare.routeRequest(req, res);
|
||||
} else {
|
||||
handler(req, res);
|
||||
}
|
||||
}).on("upgrade", (req, socket, head) => {
|
||||
if (bare.shouldRoute(req)) {
|
||||
bare.routeUpgrade(req, socket, head);
|
||||
} else {
|
||||
socket.end();
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
fastify.register(fastifyStatic, {
|
||||
root: join(fileURLToPath(new URL(".", import.meta.url)), "./static"),
|
||||
decorateReply: false
|
||||
});
|
||||
fastify.register(fastifyStatic, {
|
||||
root: join(fileURLToPath(new URL(".", import.meta.url)), "./dist"),
|
||||
prefix: "/dist/",
|
||||
decorateReply: false
|
||||
})
|
||||
fastify.register(fastifyStatic, {
|
||||
root: baremuxPath,
|
||||
prefix: "/baremux/",
|
||||
decorateReply: false
|
||||
})
|
||||
fastify.register(fastifyStatic, {
|
||||
root: epoxyPath,
|
||||
prefix: "/epoxy/",
|
||||
decorateReply: false
|
||||
})
|
||||
fastify.register(fastifyStatic, {
|
||||
root: libcurlPath,
|
||||
prefix: "/libcurl/",
|
||||
decorateReply: false
|
||||
})
|
||||
fastify.register(fastifyStatic, {
|
||||
root: bareModulePath,
|
||||
prefix: "/baremod/",
|
||||
decorateReply: false
|
||||
})
|
||||
fastify.listen({
|
||||
port: process.env.PORT || 1337
|
||||
});
|
|
@ -1,7 +1,8 @@
|
|||
import { parseModule } from "meriyah";
|
||||
import { generate } from "astring";
|
||||
import { makeTraveler } from "astravel";
|
||||
import { encodeUrl } from "./url";
|
||||
import { replace } from "estraverse";
|
||||
import * as ESTree from "estree";
|
||||
|
||||
// i am a cat. i like to be petted. i like to be fed. i like to be
|
||||
|
||||
|
@ -18,32 +19,60 @@ import { replace } from "estraverse";
|
|||
|
||||
export function rewriteJs(js: string, origin?: URL) {
|
||||
try {
|
||||
const ast = parseModule(js);
|
||||
const ast = parseModule(js, {
|
||||
module: true,
|
||||
webcompat: true
|
||||
});
|
||||
|
||||
// const identifierList = [
|
||||
// "window",
|
||||
// "self",
|
||||
// "globalThis",
|
||||
// "parent",
|
||||
// "top",
|
||||
// "location",
|
||||
// ""
|
||||
// ]
|
||||
const identifierList = [
|
||||
"window",
|
||||
"self",
|
||||
"globalThis",
|
||||
"this",
|
||||
"parent",
|
||||
"top",
|
||||
"location"
|
||||
]
|
||||
|
||||
replace(ast, {
|
||||
enter: (node, parent) => {
|
||||
if (["ImportDeclaration", "ImportExpression", "ExportAllDeclaration", "ExportNamedDeclaration"].includes(node.type) && node.source) {
|
||||
node.source.value = encodeUrl(node.source.value, origin);
|
||||
}
|
||||
|
||||
return node;
|
||||
const customTraveler = makeTraveler({
|
||||
ImportDeclaration: (node: ESTree.ImportDeclaration) => {
|
||||
node.source.value = encodeUrl(node.source.value as string, origin);
|
||||
},
|
||||
|
||||
fallback: "iteration"
|
||||
})
|
||||
ImportExpression: (node: ESTree.ImportExpression) => {
|
||||
if (node.source.type === "Literal") {
|
||||
node.source.value = encodeUrl(node.source.value as string, origin);
|
||||
} else if (node.source.type === "Identifier") {
|
||||
// this is for things that import something like
|
||||
// const moduleName = "name";
|
||||
// await import(moduleName);
|
||||
node.source.name = `__wrapImport(${node.source.name})`;
|
||||
}
|
||||
},
|
||||
|
||||
ExportAllDeclaration: (node: ESTree.ExportAllDeclaration) => {
|
||||
node.source.value = encodeUrl(node.source.value as string, origin);
|
||||
},
|
||||
|
||||
ExportNamedDeclaration: (node: ESTree.ExportNamedDeclaration) => {
|
||||
// strings are Literals in ESTree syntax but these will always be strings
|
||||
if (node.source) node.source.value = encodeUrl(node.source.value as string, origin);
|
||||
},
|
||||
|
||||
// js rweriting notrdone
|
||||
MemberExpression: (node: ESTree.MemberExpression) => {
|
||||
if (node.object.type === "Identifier" && identifierList.includes(node.object.name)) {
|
||||
node.object.name = "__" + node.object.name;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
customTraveler.go(ast);
|
||||
|
||||
return generate(ast);
|
||||
} catch (err) {
|
||||
throw new Error(err);
|
||||
} catch {
|
||||
console.log(js);
|
||||
|
||||
return js;
|
||||
}
|
||||
}
|
1
src/client/history.ts
Normal file
1
src/client/history.ts
Normal file
|
@ -0,0 +1 @@
|
|||
// forgot aobut this api
|
|
@ -10,7 +10,6 @@ WebSocket = new Proxy(WebSocket, {
|
|||
{
|
||||
"User-Agent": navigator.userAgent
|
||||
},
|
||||
// @ts-expect-error
|
||||
ArrayBuffer.prototype
|
||||
)
|
||||
}
|
||||
|
|
|
@ -45,6 +45,7 @@ function storageProxy(scope: Storage): Storage {
|
|||
}
|
||||
},
|
||||
|
||||
//@ts-ignore
|
||||
set(target, prop, value) {
|
||||
store.set(prop, value);
|
||||
store.sync();
|
||||
|
|
1
src/client/window.ts
Normal file
1
src/client/window.ts
Normal file
|
@ -0,0 +1 @@
|
|||
// the DAMN WINDOW PROXY
|
|
@ -1,4 +1,4 @@
|
|||
import { enc, dec } from "./aes.ts";
|
||||
import { enc, dec } from "./aes";
|
||||
|
||||
// for some reason eslint was parsing the type inside of the function params as a variable
|
||||
export interface Codec {
|
||||
|
@ -34,6 +34,7 @@ const plain = {
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
const aes = {
|
||||
encode: (str: string | undefined) => {
|
||||
if (!str) return str;
|
||||
|
@ -46,6 +47,7 @@ const aes = {
|
|||
return dec("U2FsdGVkX1" + decodeURIComponent(str), "dynamic");
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
const none = {
|
||||
encode: (str: string | undefined) => str,
|
||||
|
@ -72,11 +74,10 @@ declare global {
|
|||
plain: Codec;
|
||||
base64: Codec;
|
||||
xor: Codec;
|
||||
aes: Codec;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self.__scramjet$codecs = {
|
||||
none, plain, base64, xor, aes
|
||||
none, plain, base64, xor
|
||||
}
|
|
@ -4,8 +4,8 @@
|
|||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>Document</title>
|
||||
<link rel="prefetch" href="./scramjet.worker.js">
|
||||
<link rel="prefetch" href="./scramjet.bundle.js">
|
||||
<link rel="prefetch" href="/scramjet/scramjet.worker.js">
|
||||
<link rel="prefetch" href="/scramjet/scramjet.bundle.js">
|
||||
<link href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;1,100;1,200;1,300;1,400;1,500;1,600;1,700&family=Inter+Tight:ital,wght@0,100..900;1,100..900&family=Inter:wght@100..900&display=swap&" rel="stylesheet">
|
||||
<style>
|
||||
body, html, #app {
|
||||
|
@ -21,9 +21,9 @@
|
|||
</head>
|
||||
<body>
|
||||
<script src="https://unpkg.com/dreamland"></script>
|
||||
<script src="./bare-mux.js" defer></script>
|
||||
<script src="./ui.js" defer></script>
|
||||
<script src="./scramjet.codecs.js"></script>
|
||||
<script src="./scramjet.config.js"></script>
|
||||
<script src="/baremux/index.js" defer></script>
|
||||
<script src="ui.js" defer></script>
|
||||
<script src="/scramjet/scramjet.codecs.js"></script>
|
||||
<script src="/scramjet/scramjet.config.js"></script>
|
||||
</body>
|
||||
</html>
|
|
@ -10,7 +10,7 @@ const store = $store({
|
|||
wispurl: "wss://wisp.mercurywork.shop/",
|
||||
bareurl: (location.protocol === "https:" ? "https" : "http") + "://" + location.host + "/bare/",
|
||||
}, { ident: "settings", backing: "localstorage", autosave: "auto" });
|
||||
connection.setTransport("/bare-client.js", [store.bareurl])
|
||||
connection.setTransport("/baremod/index.mjs", [store.bareurl])
|
||||
function App() {
|
||||
this.urlencoded = "";
|
||||
this.css = `
|
||||
|
@ -83,9 +83,9 @@ function App() {
|
|||
|
||||
|
||||
<div class=${`${flex} buttons`}>
|
||||
<button on:click=${() => connection.setTransport("/bare-client.js", [store.bareurl])}>use bare server 3</button>
|
||||
<button on:click=${() => connection.setTransport("/curl-client.js", [{ wisp: store.wispurl }])}>use libcurl.js</button>
|
||||
<button on:click=${() => connection.setTransport("/epoxy-client.js", [{ wisp: store.wispurl }])}>use epoxy</button>
|
||||
<button on:click=${() => connection.setTransport("/baremod/index.mjs", [store.bareurl])}>use bare server 3</button>
|
||||
<button on:click=${() => connection.setTransport("/libcurl/index.mjs", [{ wisp: store.wispurl }])}>use libcurl.js</button>
|
||||
<button on:click=${() => connection.setTransport("/epoxy/index.mjs", [{ wisp: store.wispurl }])}>use epoxy</button>
|
||||
<button on:click=${() => window.open(this.urlencoded)}>open in fullscreen</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -1,11 +1,10 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
// "allowJs": true,
|
||||
"allowImportingTsExtensions": true,
|
||||
"rootDir": "./src",
|
||||
"target": "ES2022",
|
||||
"moduleResolution": "Bundler",
|
||||
"module": "ES2022",
|
||||
"noEmit": true
|
||||
}
|
||||
},
|
||||
"include": ["src"],
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue