Implement esbuild

This commit is contained in:
dangered wolf 2023-09-10 01:06:01 -04:00
parent 8a8bdd6b9c
commit c2fc1721de
No known key found for this signature in database
GPG key ID: 41E4D37680ED8B58
5 changed files with 269 additions and 150 deletions

95
esbuild.config.mjs Normal file
View file

@ -0,0 +1,95 @@
import { sentryEsbuildPlugin } from "@sentry/esbuild-plugin";
import { config } from 'dotenv';
import { execSync } from 'child_process';
import * as esbuild from 'esbuild'
import fs from 'fs';
config();
const gitCommit = execSync('git rev-parse --short HEAD')
.toString()
.trim();
const gitCommitFull = execSync('git rev-parse HEAD')
.toString()
.trim();
const gitUrl = execSync('git remote get-url origin')
.toString()
.trim();
const gitBranch = execSync('git rev-parse --abbrev-ref HEAD')
.toString()
.trim();
let workerName = 'fixtweet';
// Get worker name from wrangler.toml
try {
workerName = fs
.readFileSync('wrangler.toml')
.toString()
.match(/name ?= ?"(.+?)"/)[1];
} catch(e) {
console.error(`Error reading wrangler.toml to find worker name, using 'fixtweet' instead.`)
}
const releaseName = `${workerName}-${gitBranch}-${gitCommit}-${new Date()
.toISOString()
.substring(0, 19)}`;
let envVariables = [
'BRANDING_NAME',
'STANDARD_DOMAIN_LIST',
'DIRECT_MEDIA_DOMAINS',
'TEXT_ONLY_DOMAINS',
'INSTANT_VIEW_DOMAINS',
'HOST_URL',
'REDIRECT_URL',
'EMBED_URL',
'MOSAIC_DOMAIN_LIST',
'API_HOST_LIST',
'SENTRY_DSN',
'DEPRECATED_DOMAIN_LIST',
'DEPRECATED_DOMAIN_EPOCH'
];
// Create defines for all environment variables
let defines = {};
for (let envVar of envVariables) {
defines[envVar] = `"${process.env[envVar]}"`;
}
defines['RELEASE_NAME'] = `"${releaseName}"`;
await esbuild.build({
entryPoints: ["src/worker.ts"],
sourcemap: 'external',
outdir: 'dist',
minify: true,
bundle: true,
plugins: [
sentryEsbuildPlugin({
org: process.env.SENTRY_ORG,
project: process.env.SENTRY_PROJECT,
telemetry: false,
release: {
name: releaseName,
create: true,
vcsRemote: gitUrl,
setCommits: {
auto: true,
ignoreMissing: true
}
},
// Auth tokens can be obtained from
// https://sentry.io/orgredirect/organizations/:orgslug/settings/auth-tokens/
authToken: process.env.SENTRY_AUTH_TOKEN,
}),
],
define: defines
});

308
package-lock.json generated
View file

@ -15,6 +15,7 @@
"devDependencies": {
"@cloudflare/workers-types": "^4.20230904.0",
"@microsoft/eslint-formatter-sarif": "^3.0.0",
"@sentry/esbuild-plugin": "^2.7.1",
"@sentry/integrations": "^7.65.0",
"@sentry/webpack-plugin": "^2.7.1",
"@types/jest": "^29.5.4",
@ -34,7 +35,7 @@
"typescript": "^5.2.2",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"wrangler": "^3.6.0"
"wrangler": "^3.7.0"
}
},
"node_modules/@aashutoshrathi/word-wrap": {
@ -724,9 +725,9 @@
}
},
"node_modules/@cloudflare/workerd-darwin-64": {
"version": "1.20230814.1",
"resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20230814.1.tgz",
"integrity": "sha512-aQUO7q7qXl+SVtOiMMlVKLNOSeL6GX43RKeflwzsD74dGgyHPiSfw5KCvXhkVbyN7u+yYF6HyFdaIvHLfn5jyA==",
"version": "1.20230904.0",
"resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20230904.0.tgz",
"integrity": "sha512-/GDlmxAFbDtrQwP4zOXFbqOfaPvkDxdsCoEa+KEBcAl5uR98+7WW5/b8naBHX+t26uS7p4bLlImM8J5F1ienRQ==",
"cpu": [
"x64"
],
@ -740,9 +741,9 @@
}
},
"node_modules/@cloudflare/workerd-darwin-arm64": {
"version": "1.20230814.1",
"resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20230814.1.tgz",
"integrity": "sha512-U2mcgi+AiuI/4EY5Wk/GmygiNoCNw/V2mcHmxESqe4r6XbJYOzBdEsjnqJ05rqd0JlEM8m64jRtE6/qBnQHygg==",
"version": "1.20230904.0",
"resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20230904.0.tgz",
"integrity": "sha512-x8WXNc2xnDqr5y1iirnNdyx8GZY3rL5xiF7ebK3mKQeB+jFjkhO71yuPTkDCzUWtOvw1Wfd4jbwy4wxacMX4mQ==",
"cpu": [
"arm64"
],
@ -756,9 +757,9 @@
}
},
"node_modules/@cloudflare/workerd-linux-64": {
"version": "1.20230814.1",
"resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20230814.1.tgz",
"integrity": "sha512-Q4kITXLTCuG2i2Z01fbb5AjVRRIf3+lS4ZVsFbTbIwtcOOG4Ozcw7ee7tKsFES7hFqR4Eg9gMG4/aS0mmi+L2g==",
"version": "1.20230904.0",
"resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20230904.0.tgz",
"integrity": "sha512-V58xyMS3oDpKO8Dpdh0r0BXm99OzoGgvWe9ufttVraj/1NTMGELwb6i9ySb8k3F1J9m/sO26+TV7pQc/bGC1VQ==",
"cpu": [
"x64"
],
@ -772,9 +773,9 @@
}
},
"node_modules/@cloudflare/workerd-linux-arm64": {
"version": "1.20230814.1",
"resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20230814.1.tgz",
"integrity": "sha512-BX5SaksXw+pkREVw3Rw2eSNXplqZw+14CcwW/5x/4oq/C6yn5qCvKxJfM7pukJGMI4wkJPOYops7B3g27FB/HA==",
"version": "1.20230904.0",
"resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20230904.0.tgz",
"integrity": "sha512-VrDaW+pjb5IAKEnNWtEaFiG377kXKmk5Fu0Era4W+jKzPON2BW/qRb/4LNHXQ4yxg/2HLm7RiUTn7JZtt1qO6A==",
"cpu": [
"arm64"
],
@ -788,9 +789,9 @@
}
},
"node_modules/@cloudflare/workerd-windows-64": {
"version": "1.20230814.1",
"resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20230814.1.tgz",
"integrity": "sha512-GWHqfyhsG/1wm2W8afkYX3q3fWXUWWD8NGtHfAs6ZVTHdW3mmYyMhKR0lc6ptBwz5i5aXRlP2S+CxxxwwDbKpw==",
"version": "1.20230904.0",
"resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20230904.0.tgz",
"integrity": "sha512-/R/dE8uy+8J2YeXfDhI8/Bg7YUirdbbjH5/l/Vv00ZRE0lC3nPLcYeyBXSwXIQ6/Xht3gN+lksLQgKd0ZWRd+Q==",
"cpu": [
"x64"
],
@ -819,18 +820,18 @@
}
},
"node_modules/@esbuild-plugins/node-globals-polyfill": {
"version": "0.1.1",
"resolved": "https://registry.npmjs.org/@esbuild-plugins/node-globals-polyfill/-/node-globals-polyfill-0.1.1.tgz",
"integrity": "sha512-MR0oAA+mlnJWrt1RQVQ+4VYuRJW/P2YmRTv1AsplObyvuBMnPHiizUF95HHYiSsMGLhyGtWufaq2XQg6+iurBg==",
"version": "0.2.3",
"resolved": "https://registry.npmjs.org/@esbuild-plugins/node-globals-polyfill/-/node-globals-polyfill-0.2.3.tgz",
"integrity": "sha512-r3MIryXDeXDOZh7ih1l/yE9ZLORCd5e8vWg02azWRGj5SPTuoh69A2AIyn0Z31V/kHBfZ4HgWJ+OK3GTTwLmnw==",
"dev": true,
"peerDependencies": {
"esbuild": "*"
}
},
"node_modules/@esbuild-plugins/node-modules-polyfill": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/@esbuild-plugins/node-modules-polyfill/-/node-modules-polyfill-0.1.4.tgz",
"integrity": "sha512-uZbcXi0zbmKC/050p3gJnne5Qdzw8vkXIv+c2BW0Lsc1ji1SkrxbKPUy5Efr0blbTu1SL8w4eyfpnSdPg3G0Qg==",
"version": "0.2.2",
"resolved": "https://registry.npmjs.org/@esbuild-plugins/node-modules-polyfill/-/node-modules-polyfill-0.2.2.tgz",
"integrity": "sha512-LXV7QsWJxRuMYvKbiznh+U1ilIop3g2TeKRzUxOG5X3YITc8JyyTa90BmLwqqv0YnX4v32CSlG+vsziZp9dMvA==",
"dev": true,
"dependencies": {
"escape-string-regexp": "^4.0.0",
@ -841,9 +842,9 @@
}
},
"node_modules/@esbuild/android-arm": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.16.3.tgz",
"integrity": "sha512-mueuEoh+s1eRbSJqq9KNBQwI4QhQV6sRXIfTyLXSHGMpyew61rOK4qY21uKbXl1iBoMb0AdL1deWFCQVlN2qHA==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.17.19.tgz",
"integrity": "sha512-rIKddzqhmav7MSmoFCmDIb6e2W57geRsM94gV2l38fzhXMwq7hZoClug9USI2pFRGL06f4IOPHHpFNOkWieR8A==",
"cpu": [
"arm"
],
@ -857,9 +858,9 @@
}
},
"node_modules/@esbuild/android-arm64": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.16.3.tgz",
"integrity": "sha512-RolFVeinkeraDvN/OoRf1F/lP0KUfGNb5jxy/vkIMeRRChkrX/HTYN6TYZosRJs3a1+8wqpxAo5PI5hFmxyPRg==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.17.19.tgz",
"integrity": "sha512-KBMWvEZooR7+kzY0BtbTQn0OAYY7CsiydT63pVEaPtVYF0hXbUaOyZog37DKxK7NF3XacBJOpYT4adIJh+avxA==",
"cpu": [
"arm64"
],
@ -873,9 +874,9 @@
}
},
"node_modules/@esbuild/android-x64": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.16.3.tgz",
"integrity": "sha512-SFpTUcIT1bIJuCCBMCQWq1bL2gPTjWoLZdjmIhjdcQHaUfV41OQfho6Ici5uvvkMmZRXIUGpM3GxysP/EU7ifQ==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.17.19.tgz",
"integrity": "sha512-uUTTc4xGNDT7YSArp/zbtmbhO0uEEK9/ETW29Wk1thYUJBz3IVnvgEiEwEa9IeLyvnpKrWK64Utw2bgUmDveww==",
"cpu": [
"x64"
],
@ -889,9 +890,9 @@
}
},
"node_modules/@esbuild/darwin-arm64": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.16.3.tgz",
"integrity": "sha512-DO8WykMyB+N9mIDfI/Hug70Dk1KipavlGAecxS3jDUwAbTpDXj0Lcwzw9svkhxfpCagDmpaTMgxWK8/C/XcXvw==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.17.19.tgz",
"integrity": "sha512-80wEoCfF/hFKM6WE1FyBHc9SfUblloAWx6FJkFWTWiCoht9Mc0ARGEM47e67W9rI09YoUxJL68WHfDRYEAvOhg==",
"cpu": [
"arm64"
],
@ -905,9 +906,9 @@
}
},
"node_modules/@esbuild/darwin-x64": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.16.3.tgz",
"integrity": "sha512-uEqZQ2omc6BvWqdCiyZ5+XmxuHEi1SPzpVxXCSSV2+Sh7sbXbpeNhHIeFrIpRjAs0lI1FmA1iIOxFozKBhKgRQ==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.17.19.tgz",
"integrity": "sha512-IJM4JJsLhRYr9xdtLytPLSH9k/oxR3boaUIYiHkAawtwNOXKE8KoU8tMvryogdcT8AU+Bflmh81Xn6Q0vTZbQw==",
"cpu": [
"x64"
],
@ -921,9 +922,9 @@
}
},
"node_modules/@esbuild/freebsd-arm64": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.16.3.tgz",
"integrity": "sha512-nJansp3sSXakNkOD5i5mIz2Is/HjzIhFs49b1tjrPrpCmwgBmH9SSzhC/Z1UqlkivqMYkhfPwMw1dGFUuwmXhw==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.17.19.tgz",
"integrity": "sha512-pBwbc7DufluUeGdjSU5Si+P3SoMF5DQ/F/UmTSb8HXO80ZEAJmrykPyzo1IfNbAoaqw48YRpv8shwd1NoI0jcQ==",
"cpu": [
"arm64"
],
@ -937,9 +938,9 @@
}
},
"node_modules/@esbuild/freebsd-x64": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.16.3.tgz",
"integrity": "sha512-TfoDzLw+QHfc4a8aKtGSQ96Wa+6eimljjkq9HKR0rHlU83vw8aldMOUSJTUDxbcUdcgnJzPaX8/vGWm7vyV7ug==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.17.19.tgz",
"integrity": "sha512-4lu+n8Wk0XlajEhbEffdy2xy53dpR06SlzvhGByyg36qJw6Kpfk7cp45DR/62aPH9mtJRmIyrXAS5UWBrJT6TQ==",
"cpu": [
"x64"
],
@ -953,9 +954,9 @@
}
},
"node_modules/@esbuild/linux-arm": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.16.3.tgz",
"integrity": "sha512-VwswmSYwVAAq6LysV59Fyqk3UIjbhuc6wb3vEcJ7HEJUtFuLK9uXWuFoH1lulEbE4+5GjtHi3MHX+w1gNHdOWQ==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.17.19.tgz",
"integrity": "sha512-cdmT3KxjlOQ/gZ2cjfrQOtmhG4HJs6hhvm3mWSRDPtZ/lP5oe8FWceS10JaSJC13GBd4eH/haHnqf7hhGNLerA==",
"cpu": [
"arm"
],
@ -969,9 +970,9 @@
}
},
"node_modules/@esbuild/linux-arm64": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.16.3.tgz",
"integrity": "sha512-7I3RlsnxEFCHVZNBLb2w7unamgZ5sVwO0/ikE2GaYvYuUQs9Qte/w7TqWcXHtCwxvZx/2+F97ndiUQAWs47ZfQ==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.17.19.tgz",
"integrity": "sha512-ct1Tg3WGwd3P+oZYqic+YZF4snNl2bsnMKRkb3ozHmnM0dGWuxcPTTntAF6bOP0Sp4x0PjSF+4uHQ1xvxfRKqg==",
"cpu": [
"arm64"
],
@ -985,9 +986,9 @@
}
},
"node_modules/@esbuild/linux-ia32": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.16.3.tgz",
"integrity": "sha512-X8FDDxM9cqda2rJE+iblQhIMYY49LfvW4kaEjoFbTTQ4Go8G96Smj2w3BRTwA8IHGoi9dPOPGAX63dhuv19UqA==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.17.19.tgz",
"integrity": "sha512-w4IRhSy1VbsNxHRQpeGCHEmibqdTUx61Vc38APcsRbuVgK0OPEnQ0YD39Brymn96mOx48Y2laBQGqgZ0j9w6SQ==",
"cpu": [
"ia32"
],
@ -1001,9 +1002,9 @@
}
},
"node_modules/@esbuild/linux-loong64": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.16.3.tgz",
"integrity": "sha512-hIbeejCOyO0X9ujfIIOKjBjNAs9XD/YdJ9JXAy1lHA+8UXuOqbFe4ErMCqMr8dhlMGBuvcQYGF7+kO7waj2KHw==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.17.19.tgz",
"integrity": "sha512-2iAngUbBPMq439a+z//gE+9WBldoMp1s5GWsUSgqHLzLJ9WoZLZhpwWuym0u0u/4XmZ3gpHmzV84PonE+9IIdQ==",
"cpu": [
"loong64"
],
@ -1017,9 +1018,9 @@
}
},
"node_modules/@esbuild/linux-mips64el": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.16.3.tgz",
"integrity": "sha512-znFRzICT/V8VZQMt6rjb21MtAVJv/3dmKRMlohlShrbVXdBuOdDrGb+C2cZGQAR8RFyRe7HS6klmHq103WpmVw==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.17.19.tgz",
"integrity": "sha512-LKJltc4LVdMKHsrFe4MGNPp0hqDFA1Wpt3jE1gEyM3nKUvOiO//9PheZZHfYRfYl6AwdTH4aTcXSqBerX0ml4A==",
"cpu": [
"mips64el"
],
@ -1033,9 +1034,9 @@
}
},
"node_modules/@esbuild/linux-ppc64": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.16.3.tgz",
"integrity": "sha512-EV7LuEybxhXrVTDpbqWF2yehYRNz5e5p+u3oQUS2+ZFpknyi1NXxr8URk4ykR8Efm7iu04//4sBg249yNOwy5Q==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.17.19.tgz",
"integrity": "sha512-/c/DGybs95WXNS8y3Ti/ytqETiW7EU44MEKuCAcpPto3YjQbyK3IQVKfF6nbghD7EcLUGl0NbiL5Rt5DMhn5tg==",
"cpu": [
"ppc64"
],
@ -1049,9 +1050,9 @@
}
},
"node_modules/@esbuild/linux-riscv64": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.16.3.tgz",
"integrity": "sha512-uDxqFOcLzFIJ+r/pkTTSE9lsCEaV/Y6rMlQjUI9BkzASEChYL/aSQjZjchtEmdnVxDKETnUAmsaZ4pqK1eE5BQ==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.17.19.tgz",
"integrity": "sha512-FC3nUAWhvFoutlhAkgHf8f5HwFWUL6bYdvLc/TTuxKlvLi3+pPzdZiFKSWz/PF30TB1K19SuCxDTI5KcqASJqA==",
"cpu": [
"riscv64"
],
@ -1065,9 +1066,9 @@
}
},
"node_modules/@esbuild/linux-s390x": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.16.3.tgz",
"integrity": "sha512-NbeREhzSxYwFhnCAQOQZmajsPYtX71Ufej3IQ8W2Gxskfz9DK58ENEju4SbpIj48VenktRASC52N5Fhyf/aliQ==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.17.19.tgz",
"integrity": "sha512-IbFsFbxMWLuKEbH+7sTkKzL6NJmG2vRyy6K7JJo55w+8xDk7RElYn6xvXtDW8HCfoKBFK69f3pgBJSUSQPr+4Q==",
"cpu": [
"s390x"
],
@ -1081,9 +1082,9 @@
}
},
"node_modules/@esbuild/linux-x64": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.16.3.tgz",
"integrity": "sha512-SDiG0nCixYO9JgpehoKgScwic7vXXndfasjnD5DLbp1xltANzqZ425l7LSdHynt19UWOcDjG9wJJzSElsPvk0w==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.17.19.tgz",
"integrity": "sha512-68ngA9lg2H6zkZcyp22tsVt38mlhWde8l3eJLWkyLrp4HwMUr3c1s/M2t7+kHIhvMjglIBrFpncX1SzMckomGw==",
"cpu": [
"x64"
],
@ -1097,9 +1098,9 @@
}
},
"node_modules/@esbuild/netbsd-x64": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.16.3.tgz",
"integrity": "sha512-AzbsJqiHEq1I/tUvOfAzCY15h4/7Ivp3ff/o1GpP16n48JMNAtbW0qui2WCgoIZArEHD0SUQ95gvR0oSO7ZbdA==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.17.19.tgz",
"integrity": "sha512-CwFq42rXCR8TYIjIfpXCbRX0rp1jo6cPIUPSaWwzbVI4aOfX96OXY8M6KNmtPcg7QjYeDmN+DD0Wp3LaBOLf4Q==",
"cpu": [
"x64"
],
@ -1113,9 +1114,9 @@
}
},
"node_modules/@esbuild/openbsd-x64": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.16.3.tgz",
"integrity": "sha512-gSABi8qHl8k3Cbi/4toAzHiykuBuWLZs43JomTcXkjMZVkp0gj3gg9mO+9HJW/8GB5H89RX/V0QP4JGL7YEEVg==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.17.19.tgz",
"integrity": "sha512-cnq5brJYrSZ2CF6c35eCmviIN3k3RczmHz8eYaVlNasVqsNY+JKohZU5MKmaOI+KkllCdzOKKdPs762VCPC20g==",
"cpu": [
"x64"
],
@ -1129,9 +1130,9 @@
}
},
"node_modules/@esbuild/sunos-x64": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.16.3.tgz",
"integrity": "sha512-SF9Kch5Ete4reovvRO6yNjMxrvlfT0F0Flm+NPoUw5Z4Q3r1d23LFTgaLwm3Cp0iGbrU/MoUI+ZqwCv5XJijCw==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.17.19.tgz",
"integrity": "sha512-vCRT7yP3zX+bKWFeP/zdS6SqdWB8OIpaRq/mbXQxTGHnIxspRtigpkUcDMlSCOejlHowLqII7K2JKevwyRP2rg==",
"cpu": [
"x64"
],
@ -1145,9 +1146,9 @@
}
},
"node_modules/@esbuild/win32-arm64": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.16.3.tgz",
"integrity": "sha512-u5aBonZIyGopAZyOnoPAA6fGsDeHByZ9CnEzyML9NqntK6D/xl5jteZUKm/p6nD09+v3pTM6TuUIqSPcChk5gg==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.17.19.tgz",
"integrity": "sha512-yYx+8jwowUstVdorcMdNlzklLYhPxjniHWFKgRqH7IFlUEa0Umu3KuYplf1HUZZ422e3NU9F4LGb+4O0Kdcaag==",
"cpu": [
"arm64"
],
@ -1161,9 +1162,9 @@
}
},
"node_modules/@esbuild/win32-ia32": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.16.3.tgz",
"integrity": "sha512-GlgVq1WpvOEhNioh74TKelwla9KDuAaLZrdxuuUgsP2vayxeLgVc+rbpIv0IYF4+tlIzq2vRhofV+KGLD+37EQ==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.17.19.tgz",
"integrity": "sha512-eggDKanJszUtCdlVs0RB+h35wNlb5v4TWEkq4vZcmVt5u/HiDZrTXe2bWFQUez3RgNHwx/x4sk5++4NSSicKkw==",
"cpu": [
"ia32"
],
@ -1177,9 +1178,9 @@
}
},
"node_modules/@esbuild/win32-x64": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.16.3.tgz",
"integrity": "sha512-5/JuTd8OWW8UzEtyf19fbrtMJENza+C9JoPIkvItgTBQ1FO2ZLvjbPO6Xs54vk0s5JB5QsfieUEshRQfu7ZHow==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.17.19.tgz",
"integrity": "sha512-lAhycmKnVOuRYNtRtatQR1LPQf2oYCkRGkSFnseDAKPl8lu5SOsK/e1sXe5a0Pc5kHIHe6P2I/ilntNv2xf3cA==",
"cpu": [
"x64"
],
@ -2112,6 +2113,20 @@
"node": ">=8"
}
},
"node_modules/@sentry/esbuild-plugin": {
"version": "2.7.1",
"resolved": "https://registry.npmjs.org/@sentry/esbuild-plugin/-/esbuild-plugin-2.7.1.tgz",
"integrity": "sha512-D1aOSq2mGoXLWq/g2tFRY+Aqc2e+IJWuBJgyhM3i+fimCv+tf/EKBuW/Hknf3IRJ8pGxNlgonOu9fDXknOpSLg==",
"dev": true,
"dependencies": {
"@sentry/bundler-plugin-core": "2.7.1",
"unplugin": "1.0.1",
"uuid": "^9.0.0"
},
"engines": {
"node": ">= 14"
}
},
"node_modules/@sentry/integrations": {
"version": "7.65.0",
"resolved": "https://registry.npmjs.org/@sentry/integrations/-/integrations-7.65.0.tgz",
@ -3084,14 +3099,14 @@
]
},
"node_modules/better-sqlite3": {
"version": "8.5.2",
"resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-8.5.2.tgz",
"integrity": "sha512-w/EZ/jwuZF+/47mAVC2+rhR2X/gwkZ+fd1pbX7Y90D5NRaRzDQcxrHY10t6ijGiYIonCVsBSF5v1cay07bP5sg==",
"version": "8.6.0",
"resolved": "https://registry.npmjs.org/better-sqlite3/-/better-sqlite3-8.6.0.tgz",
"integrity": "sha512-jwAudeiTMTSyby+/SfbHDebShbmC2MCH8mU2+DXi0WJfv13ypEJm47cd3kljmy/H130CazEvkf2Li//ewcMJ1g==",
"dev": true,
"hasInstallScript": true,
"dependencies": {
"bindings": "^1.5.0",
"prebuild-install": "^7.1.0"
"prebuild-install": "^7.1.1"
}
},
"node_modules/binary-extensions": {
@ -3725,9 +3740,9 @@
"dev": true
},
"node_modules/esbuild": {
"version": "0.16.3",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.16.3.tgz",
"integrity": "sha512-71f7EjPWTiSguen8X/kxEpkAS7BFHwtQKisCDDV3Y4GLGWBaoSCyD5uXkaUew6JDzA9FEN1W23mdnSwW9kqCeg==",
"version": "0.17.19",
"resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.17.19.tgz",
"integrity": "sha512-XQ0jAPFkK/u3LcVRcvVHQcTIqD6E2H1fvZMA5dQPSOWb3suUbWbfbRf94pjc0bNzRYLfIrDRQXr7X+LHIm5oHw==",
"dev": true,
"hasInstallScript": true,
"bin": {
@ -3737,28 +3752,28 @@
"node": ">=12"
},
"optionalDependencies": {
"@esbuild/android-arm": "0.16.3",
"@esbuild/android-arm64": "0.16.3",
"@esbuild/android-x64": "0.16.3",
"@esbuild/darwin-arm64": "0.16.3",
"@esbuild/darwin-x64": "0.16.3",
"@esbuild/freebsd-arm64": "0.16.3",
"@esbuild/freebsd-x64": "0.16.3",
"@esbuild/linux-arm": "0.16.3",
"@esbuild/linux-arm64": "0.16.3",
"@esbuild/linux-ia32": "0.16.3",
"@esbuild/linux-loong64": "0.16.3",
"@esbuild/linux-mips64el": "0.16.3",
"@esbuild/linux-ppc64": "0.16.3",
"@esbuild/linux-riscv64": "0.16.3",
"@esbuild/linux-s390x": "0.16.3",
"@esbuild/linux-x64": "0.16.3",
"@esbuild/netbsd-x64": "0.16.3",
"@esbuild/openbsd-x64": "0.16.3",
"@esbuild/sunos-x64": "0.16.3",
"@esbuild/win32-arm64": "0.16.3",
"@esbuild/win32-ia32": "0.16.3",
"@esbuild/win32-x64": "0.16.3"
"@esbuild/android-arm": "0.17.19",
"@esbuild/android-arm64": "0.17.19",
"@esbuild/android-x64": "0.17.19",
"@esbuild/darwin-arm64": "0.17.19",
"@esbuild/darwin-x64": "0.17.19",
"@esbuild/freebsd-arm64": "0.17.19",
"@esbuild/freebsd-x64": "0.17.19",
"@esbuild/linux-arm": "0.17.19",
"@esbuild/linux-arm64": "0.17.19",
"@esbuild/linux-ia32": "0.17.19",
"@esbuild/linux-loong64": "0.17.19",
"@esbuild/linux-mips64el": "0.17.19",
"@esbuild/linux-ppc64": "0.17.19",
"@esbuild/linux-riscv64": "0.17.19",
"@esbuild/linux-s390x": "0.17.19",
"@esbuild/linux-x64": "0.17.19",
"@esbuild/netbsd-x64": "0.17.19",
"@esbuild/openbsd-x64": "0.17.19",
"@esbuild/sunos-x64": "0.17.19",
"@esbuild/win32-arm64": "0.17.19",
"@esbuild/win32-ia32": "0.17.19",
"@esbuild/win32-x64": "0.17.19"
}
},
"node_modules/escalade": {
@ -5715,9 +5730,9 @@
}
},
"node_modules/miniflare": {
"version": "3.20230814.1",
"resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20230814.1.tgz",
"integrity": "sha512-LMgqd1Ut0+fnlvQepVbbBYQczQnyuuap8bgUwOyPETka0S9NR9NxMQSNaBgVZ0uOaG7xMJ/OVTRlz+TGB86PWA==",
"version": "3.20230904.0",
"resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20230904.0.tgz",
"integrity": "sha512-+OWQqEk8hV7vZaPCoj5dk1lZr4YUy56OiyNZ45/3ITYf+ZxgQOBPWhQhpw1jCahkRKGPa9Aykz01sc+GhPZYDA==",
"dev": true,
"dependencies": {
"acorn": "^8.8.0",
@ -5728,11 +5743,10 @@
"glob-to-regexp": "^0.4.1",
"http-cache-semantics": "^4.1.0",
"kleur": "^4.1.5",
"set-cookie-parser": "^2.6.0",
"source-map-support": "0.5.21",
"stoppable": "^1.1.0",
"undici": "^5.13.0",
"workerd": "1.20230814.1",
"undici": "^5.22.1",
"workerd": "1.20230904.0",
"ws": "^8.11.0",
"youch": "^3.2.2",
"zod": "^3.20.6"
@ -5751,6 +5765,18 @@
"source-map": "^0.6.0"
}
},
"node_modules/miniflare/node_modules/undici": {
"version": "5.24.0",
"resolved": "https://registry.npmjs.org/undici/-/undici-5.24.0.tgz",
"integrity": "sha512-OKlckxBjFl0oXxcj9FU6oB8fDAaiRUq+D8jrFWGmOfI/gIyjk/IeS75LMzgYKUaeHzLUcYvf9bbJGSrUwTfwwQ==",
"dev": true,
"dependencies": {
"busboy": "^1.6.0"
},
"engines": {
"node": ">=14.0"
}
},
"node_modules/minimatch": {
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
@ -7851,9 +7877,9 @@
"dev": true
},
"node_modules/workerd": {
"version": "1.20230814.1",
"resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20230814.1.tgz",
"integrity": "sha512-zJeSEteXuAD+bpYJT8WvzTAHvIAkKPVxOV+Jy6zCLKz5e08N3OUbAF+wrvGWc8b2aB1sj+IYsdXfkv4puH+qXQ==",
"version": "1.20230904.0",
"resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20230904.0.tgz",
"integrity": "sha512-t9znszH0rQGK4mJGvF9L3nN0qKEaObAGx0JkywFtAwH8OkSn+YfQbHNZE+YsJ4qa1hOz1DCNEk08UDFRBaYq4g==",
"dev": true,
"hasInstallScript": true,
"bin": {
@ -7863,26 +7889,26 @@
"node": ">=16"
},
"optionalDependencies": {
"@cloudflare/workerd-darwin-64": "1.20230814.1",
"@cloudflare/workerd-darwin-arm64": "1.20230814.1",
"@cloudflare/workerd-linux-64": "1.20230814.1",
"@cloudflare/workerd-linux-arm64": "1.20230814.1",
"@cloudflare/workerd-windows-64": "1.20230814.1"
"@cloudflare/workerd-darwin-64": "1.20230904.0",
"@cloudflare/workerd-darwin-arm64": "1.20230904.0",
"@cloudflare/workerd-linux-64": "1.20230904.0",
"@cloudflare/workerd-linux-arm64": "1.20230904.0",
"@cloudflare/workerd-windows-64": "1.20230904.0"
}
},
"node_modules/wrangler": {
"version": "3.6.0",
"resolved": "https://registry.npmjs.org/wrangler/-/wrangler-3.6.0.tgz",
"integrity": "sha512-GWs4+gIUK+086svW/TgFhhxxrl/hdW2L7WASbdc10dJT7yFmCXse0SnHiqWUxbFu3ScP2t3a3LszJ08wwolWHg==",
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/wrangler/-/wrangler-3.7.0.tgz",
"integrity": "sha512-7823G5U7WwDIkqaZrxSh/BQ/pxA4WIX3R9GwYfh+MYJj+k5s56KGQ+K/NmY/JbgZsxVEHDjhoYzqDqJebQMZeg==",
"dev": true,
"dependencies": {
"@cloudflare/kv-asset-handler": "^0.2.0",
"@esbuild-plugins/node-globals-polyfill": "^0.1.1",
"@esbuild-plugins/node-modules-polyfill": "^0.1.4",
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
"@esbuild-plugins/node-modules-polyfill": "^0.2.2",
"blake3-wasm": "^2.1.5",
"chokidar": "^3.5.3",
"esbuild": "0.16.3",
"miniflare": "3.20230814.1",
"esbuild": "0.17.19",
"miniflare": "3.20230904.0",
"nanoid": "^3.3.3",
"path-to-regexp": "^6.2.0",
"selfsigned": "^2.0.1",
@ -8027,9 +8053,9 @@
}
},
"node_modules/youch": {
"version": "3.2.3",
"resolved": "https://registry.npmjs.org/youch/-/youch-3.2.3.tgz",
"integrity": "sha512-ZBcWz/uzZaQVdCvfV4uk616Bbpf2ee+F/AvuKDR5EwX/Y4v06xWdtMluqTD7+KlZdM93lLm9gMZYo0sKBS0pgw==",
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/youch/-/youch-3.3.1.tgz",
"integrity": "sha512-Rg9ioi+AkKyje2Hk4qILSVvayaFW98KTsOJ4aIkjDf97LZX5WJVIHZmFLnM4ThcVofHo/fbbwtYajfBPHFOVtg==",
"dev": true,
"dependencies": {
"cookie": "^0.5.0",

View file

@ -4,11 +4,11 @@
"description": "Embed Twitter videos, polls, and more on Discord and Telegram",
"main": "dist/worker.js",
"scripts": {
"build": "webpack",
"publish": "wrangler deploy",
"deploy": "wrangler deploy",
"build": "node esbuild.config.mjs",
"publish": "wrangler deploy --no-bundle",
"deploy": "wrangler deploy --no-bundle",
"log": "wrangler tail",
"reload": "wrangler deploy && wrangler tail",
"reload": "wrangler deploy --no-bundle && wrangler tail",
"prettier": "prettier --write .",
"lint:eslint": "eslint --max-warnings=0 src",
"test": "jest --config jestconfig.json --verbose"
@ -18,6 +18,7 @@
"devDependencies": {
"@cloudflare/workers-types": "^4.20230904.0",
"@microsoft/eslint-formatter-sarif": "^3.0.0",
"@sentry/esbuild-plugin": "^2.7.1",
"@sentry/integrations": "^7.65.0",
"@sentry/webpack-plugin": "^2.7.1",
"@types/jest": "^29.5.4",
@ -37,7 +38,7 @@
"typescript": "^5.2.2",
"webpack": "^5.88.2",
"webpack-cli": "^5.1.4",
"wrangler": "^3.6.0"
"wrangler": "^3.7.0"
},
"dependencies": {
"itty-router": "^3.0.12",

View file

@ -14,7 +14,4 @@ analytics_engine_datasets = [
command = "npm run build"
[miniflare.globals]
TEST = "true" # Will have unicode character errors in headers if not set to true
[placement]
mode = "smart"
TEST = "true" # Will have unicode character errors in headers if not set to true and running unit tests