diff --git a/.gitignore b/.gitignore index 6eb319d..9d41293 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,5 @@ node_modules/ -*.exe +its-node.exe its-node .idea/ .next/ diff --git a/.gitmodules b/.gitmodules index 78bdd27..e3f8631 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,7 @@ [submodule "exe-src/electron"] path = exe-src/electron url = https://github.com/electron/electron.git +[submodule "vendor/node"] + path = vendor/node + url = https://github.com/crutchcorn/node.git + branch = v20.2.0-always-expose-internals diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b90d2dd..e4a492b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -11,6 +11,8 @@ npm install -g node-gyp - Visual Studio 2022 w/ ClickOnce enabled (CodeSign.exe) - Add CodeSign.exe to `PATH` - Visual Studio 2022 w/ latest "Desktop development with C++" installed +- `winget install NASM.NASM` (to build Node on Windows) +- `winget install Python.Python.3.10` (to build Node on Windows) ## Git Submodules @@ -25,3 +27,21 @@ We submodule'd `src/electron` to avoid issues with retaining the FS replacement ```shell pnpm make ``` + +## Making Node + +We need a custom build of Node currently to support accessing `internal/fs/utils` from the `asar` module. + +On Windows, with pre-req installed: + +```shell +cd vendor/node && .\vcbuild +``` + +Then: + +``` +cp out/Release/node.exe ../../.. +``` + +A pre-built Node binary is included in the repo, but you can build it yourself if you want to. diff --git a/package.json b/package.json index 318ee82..7b83524 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "make": "pnpm next:build && pnpm next:bundle && pnpm esbuild:build && pnpm generate-blob && pnpm copy-node && pnpm remove-signature && pnpm inject-blob && pnpm sign-binary", "generate-blob": "node --experimental-sea-config sea-config.json", "copy-node": "run-script-os", - "copy-node:win32": "node -e \"require('fs').copyFileSync(process.execPath, 'its-node.exe')\"", + "copy-node:win32": "cp ./vendor/node.exe its-node.exe", "copy-node:default": "cp $(command -v node) its-node", "remove-signature": "run-script-os", "remove-signature:win32": "signtool remove /c /u /s its-node.exe", diff --git a/vendor/.gitattributes b/vendor/.gitattributes new file mode 100644 index 0000000..ff6b7a7 --- /dev/null +++ b/vendor/.gitattributes @@ -0,0 +1 @@ +node.exe filter=lfs diff=lfs merge=lfs -text diff --git a/vendor/node b/vendor/node new file mode 160000 index 0000000..78857ea --- /dev/null +++ b/vendor/node @@ -0,0 +1 @@ +Subproject commit 78857ea0c6dc2fccd2ce097d71b49ef8faa33166 diff --git a/vendor/node.exe b/vendor/node.exe new file mode 100644 index 0000000..f11a3d9 --- /dev/null +++ b/vendor/node.exe @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:ec3eb5f8bf83113556ff1cd3473680070a3c2ca4580b29537c492732d585c79c +size 92995072