Skip to content

Commit

Permalink
➕ add esbuild for bundling
Browse files Browse the repository at this point in the history
  • Loading branch information
TheAfroOfDoom committed Oct 31, 2024
1 parent 8f587ac commit b90f18f
Show file tree
Hide file tree
Showing 6 changed files with 271 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Ignore datapack/resourcepack
datapacks
resourcepack

dist
1 change: 1 addition & 0 deletions telemetry/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dist
3 changes: 2 additions & 1 deletion telemetry/main.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
const { app, BrowserWindow } = require('electron');
const { resolve } = require('path');

const createWindow = () => {
const win = new BrowserWindow({
width: 800,
height: 600,
});

win.loadFile('index.html');
win.loadFile(resolve('./index.html'));
};

app.whenReady().then(() => {
Expand Down
6 changes: 4 additions & 2 deletions telemetry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@
"author": "TheAfroOfDoom",
"license": "MIT",
"scripts": {
"start": "NODE_OPTIONS='--require ./.pnp.cjs' electron ."
"build": "node scripts/esbuild.cjs",
"start": "NODE_OPTIONS='--require ./.pnp.cjs' electron ./dist/main.js"
},
"devDependencies": {
"electron": "33.0.2"
"electron": "33.0.2",
"esbuild": "0.24.0"
}
}
10 changes: 10 additions & 0 deletions telemetry/scripts/esbuild.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
const { build } = require("esbuild");
build({
entryPoints: ["main.js"],
outfile: "dist/main.js",
bundle: true,
platform: "node",
packages: "external",
}).then(() => {
console.log("done building");
});
252 changes: 252 additions & 0 deletions telemetry/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,174 @@ __metadata:
languageName: node
linkType: hard

"@esbuild/aix-ppc64@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/aix-ppc64@npm:0.24.0"
conditions: os=aix & cpu=ppc64
languageName: node
linkType: hard

"@esbuild/android-arm64@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/android-arm64@npm:0.24.0"
conditions: os=android & cpu=arm64
languageName: node
linkType: hard

"@esbuild/android-arm@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/android-arm@npm:0.24.0"
conditions: os=android & cpu=arm
languageName: node
linkType: hard

"@esbuild/android-x64@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/android-x64@npm:0.24.0"
conditions: os=android & cpu=x64
languageName: node
linkType: hard

"@esbuild/darwin-arm64@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/darwin-arm64@npm:0.24.0"
conditions: os=darwin & cpu=arm64
languageName: node
linkType: hard

"@esbuild/darwin-x64@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/darwin-x64@npm:0.24.0"
conditions: os=darwin & cpu=x64
languageName: node
linkType: hard

"@esbuild/freebsd-arm64@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/freebsd-arm64@npm:0.24.0"
conditions: os=freebsd & cpu=arm64
languageName: node
linkType: hard

"@esbuild/freebsd-x64@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/freebsd-x64@npm:0.24.0"
conditions: os=freebsd & cpu=x64
languageName: node
linkType: hard

"@esbuild/linux-arm64@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/linux-arm64@npm:0.24.0"
conditions: os=linux & cpu=arm64
languageName: node
linkType: hard

"@esbuild/linux-arm@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/linux-arm@npm:0.24.0"
conditions: os=linux & cpu=arm
languageName: node
linkType: hard

"@esbuild/linux-ia32@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/linux-ia32@npm:0.24.0"
conditions: os=linux & cpu=ia32
languageName: node
linkType: hard

"@esbuild/linux-loong64@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/linux-loong64@npm:0.24.0"
conditions: os=linux & cpu=loong64
languageName: node
linkType: hard

"@esbuild/linux-mips64el@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/linux-mips64el@npm:0.24.0"
conditions: os=linux & cpu=mips64el
languageName: node
linkType: hard

"@esbuild/linux-ppc64@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/linux-ppc64@npm:0.24.0"
conditions: os=linux & cpu=ppc64
languageName: node
linkType: hard

"@esbuild/linux-riscv64@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/linux-riscv64@npm:0.24.0"
conditions: os=linux & cpu=riscv64
languageName: node
linkType: hard

"@esbuild/linux-s390x@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/linux-s390x@npm:0.24.0"
conditions: os=linux & cpu=s390x
languageName: node
linkType: hard

"@esbuild/linux-x64@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/linux-x64@npm:0.24.0"
conditions: os=linux & cpu=x64
languageName: node
linkType: hard

"@esbuild/netbsd-x64@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/netbsd-x64@npm:0.24.0"
conditions: os=netbsd & cpu=x64
languageName: node
linkType: hard

"@esbuild/openbsd-arm64@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/openbsd-arm64@npm:0.24.0"
conditions: os=openbsd & cpu=arm64
languageName: node
linkType: hard

"@esbuild/openbsd-x64@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/openbsd-x64@npm:0.24.0"
conditions: os=openbsd & cpu=x64
languageName: node
linkType: hard

"@esbuild/sunos-x64@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/sunos-x64@npm:0.24.0"
conditions: os=sunos & cpu=x64
languageName: node
linkType: hard

"@esbuild/win32-arm64@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/win32-arm64@npm:0.24.0"
conditions: os=win32 & cpu=arm64
languageName: node
linkType: hard

"@esbuild/win32-ia32@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/win32-ia32@npm:0.24.0"
conditions: os=win32 & cpu=ia32
languageName: node
linkType: hard

"@esbuild/win32-x64@npm:0.24.0":
version: 0.24.0
resolution: "@esbuild/win32-x64@npm:0.24.0"
conditions: os=win32 & cpu=x64
languageName: node
linkType: hard

"@sindresorhus/is@npm:^4.0.0":
version: 4.6.0
resolution: "@sindresorhus/is@npm:4.6.0"
Expand Down Expand Up @@ -258,6 +426,89 @@ __metadata:
languageName: node
linkType: hard

"esbuild@npm:0.24.0":
version: 0.24.0
resolution: "esbuild@npm:0.24.0"
dependencies:
"@esbuild/aix-ppc64": 0.24.0
"@esbuild/android-arm": 0.24.0
"@esbuild/android-arm64": 0.24.0
"@esbuild/android-x64": 0.24.0
"@esbuild/darwin-arm64": 0.24.0
"@esbuild/darwin-x64": 0.24.0
"@esbuild/freebsd-arm64": 0.24.0
"@esbuild/freebsd-x64": 0.24.0
"@esbuild/linux-arm": 0.24.0
"@esbuild/linux-arm64": 0.24.0
"@esbuild/linux-ia32": 0.24.0
"@esbuild/linux-loong64": 0.24.0
"@esbuild/linux-mips64el": 0.24.0
"@esbuild/linux-ppc64": 0.24.0
"@esbuild/linux-riscv64": 0.24.0
"@esbuild/linux-s390x": 0.24.0
"@esbuild/linux-x64": 0.24.0
"@esbuild/netbsd-x64": 0.24.0
"@esbuild/openbsd-arm64": 0.24.0
"@esbuild/openbsd-x64": 0.24.0
"@esbuild/sunos-x64": 0.24.0
"@esbuild/win32-arm64": 0.24.0
"@esbuild/win32-ia32": 0.24.0
"@esbuild/win32-x64": 0.24.0
dependenciesMeta:
"@esbuild/aix-ppc64":
optional: true
"@esbuild/android-arm":
optional: true
"@esbuild/android-arm64":
optional: true
"@esbuild/android-x64":
optional: true
"@esbuild/darwin-arm64":
optional: true
"@esbuild/darwin-x64":
optional: true
"@esbuild/freebsd-arm64":
optional: true
"@esbuild/freebsd-x64":
optional: true
"@esbuild/linux-arm":
optional: true
"@esbuild/linux-arm64":
optional: true
"@esbuild/linux-ia32":
optional: true
"@esbuild/linux-loong64":
optional: true
"@esbuild/linux-mips64el":
optional: true
"@esbuild/linux-ppc64":
optional: true
"@esbuild/linux-riscv64":
optional: true
"@esbuild/linux-s390x":
optional: true
"@esbuild/linux-x64":
optional: true
"@esbuild/netbsd-x64":
optional: true
"@esbuild/openbsd-arm64":
optional: true
"@esbuild/openbsd-x64":
optional: true
"@esbuild/sunos-x64":
optional: true
"@esbuild/win32-arm64":
optional: true
"@esbuild/win32-ia32":
optional: true
"@esbuild/win32-x64":
optional: true
bin:
esbuild: bin/esbuild
checksum: dd386d92a05c7eb03078480522cdd8b40c434777b5f08487c27971d30933ecaae3f08bd221958dd8f9c66214915cdc85f844283ca9bdbf8ee703d889ae526edd
languageName: node
linkType: hard

"escape-string-regexp@npm:^4.0.0":
version: 4.0.0
resolution: "escape-string-regexp@npm:4.0.0"
Expand Down Expand Up @@ -530,6 +781,7 @@ __metadata:
resolution: "omegaflowey-telemetry@workspace:."
dependencies:
electron: 33.0.2
esbuild: 0.24.0
languageName: unknown
linkType: soft

Expand Down

0 comments on commit b90f18f

Please sign in to comment.