mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-16 21:58:39 -09:00
wip
This commit is contained in:
parent
45461301d0
commit
67a1056042
8 changed files with 29 additions and 9 deletions
Binary file not shown.
|
|
@ -2,6 +2,8 @@ cacheFolder: .yarn/cache
|
||||||
|
|
||||||
compressionLevel: 0
|
compressionLevel: 0
|
||||||
|
|
||||||
|
checksumBehavior: ignore # necessary on Windows because of https://github.com/yarnpkg/berry/issues/5795
|
||||||
|
|
||||||
enableGlobalCache: false
|
enableGlobalCache: false
|
||||||
|
|
||||||
nodeLinker: pnp
|
nodeLinker: pnp
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,9 @@ Regardless of the platform you are working on, you will need to have Yarn instal
|
||||||
|
|
||||||
1. Install necessary packages:
|
1. Install necessary packages:
|
||||||
* Windows
|
* Windows
|
||||||
- Be sure to run `yarn global add windows-build-tools` from an elevated prompt (as an administrator) to install `windows-build-tools`.
|
- Install Visual Studio Build Tools manually. Download: https://aka.ms/vs/17/release/vs_BuildTools.exe
|
||||||
|
- Open it and choose Desktop development with C++.
|
||||||
|
- maybe? at command prompt: setx GYP_MSVS_VERSION 2022
|
||||||
* macOS
|
* macOS
|
||||||
- Once you have installed Yarn, you can skip this section!
|
- Once you have installed Yarn, you can skip this section!
|
||||||
* Linux (You can see [here](https://en.wikipedia.org/wiki/List_of_Linux_distributions) what your Linux is based on.)
|
* Linux (You can see [here](https://en.wikipedia.org/wiki/List_of_Linux_distributions) what your Linux is based on.)
|
||||||
|
|
|
||||||
|
|
@ -1 +0,0 @@
|
||||||
registry "https://registry.npmjs.org/"
|
|
||||||
12
bin/cp-snapshot.js
vendored
12
bin/cp-snapshot.js
vendored
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const fsPromises = require('fs/promises');
|
const fsPromises = require('fs/promises');
|
||||||
|
|
@ -15,19 +16,24 @@ function copySnapshot(pathToElectron, archToCopy) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function getPathToElectron() {
|
function getPathToElectron() {
|
||||||
|
const electronPath = require.resolve('electron');
|
||||||
|
|
||||||
switch (process.platform) {
|
switch (process.platform) {
|
||||||
case 'darwin':
|
case 'darwin':
|
||||||
return path.resolve(
|
return path.resolve(
|
||||||
__dirname,
|
electronPath,
|
||||||
'..',
|
'..',
|
||||||
'node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources'
|
'..',
|
||||||
|
'..',
|
||||||
|
'dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources'
|
||||||
);
|
);
|
||||||
case 'win32':
|
case 'win32':
|
||||||
case 'linux':
|
case 'linux':
|
||||||
return path.resolve(__dirname, '..', 'node_modules', 'electron', 'dist');
|
return path.resolve(electronPath, '..', '..', '..', 'dist');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getV8ContextFileName(archToCopy) {
|
function getV8ContextFileName(archToCopy) {
|
||||||
return `snapshot_blob.bin`;
|
return `snapshot_blob.bin`;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
13
bin/mk-snapshot.js
vendored
13
bin/mk-snapshot.js
vendored
|
|
@ -4,6 +4,7 @@ const path = require('path');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const electronLink = require('electron-link');
|
const electronLink = require('electron-link');
|
||||||
const {mkdirp} = require('fs-extra');
|
const {mkdirp} = require('fs-extra');
|
||||||
|
const pnp = require("pnpapi");
|
||||||
|
|
||||||
const excludedModules = {};
|
const excludedModules = {};
|
||||||
|
|
||||||
|
|
@ -15,6 +16,12 @@ const archMap = {
|
||||||
};
|
};
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
const npmConfigArch = process.env.npm_config_arch;
|
||||||
|
if (!npmConfigArch) {
|
||||||
|
throw new Error('env var npm_config_arch is not specified')
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const baseDirPath = path.resolve(__dirname, '..');
|
const baseDirPath = path.resolve(__dirname, '..');
|
||||||
|
|
||||||
console.log('Creating a linked script..');
|
console.log('Creating a linked script..');
|
||||||
|
|
@ -32,12 +39,14 @@ async function main() {
|
||||||
// Verify if we will be able to use this in `mksnapshot`
|
// Verify if we will be able to use this in `mksnapshot`
|
||||||
vm.runInNewContext(result.snapshotScript, undefined, {filename: snapshotScriptPath, displayErrors: true});
|
vm.runInNewContext(result.snapshotScript, undefined, {filename: snapshotScriptPath, displayErrors: true});
|
||||||
|
|
||||||
const outputBlobPath = `${baseDirPath}/cache/${process.env.npm_config_arch}`;
|
const outputBlobPath = `${baseDirPath}/cache/${npmConfigArch}`;
|
||||||
await mkdirp(outputBlobPath);
|
await mkdirp(outputBlobPath);
|
||||||
|
|
||||||
|
const baseDir = pnp.resolveToUnqualified("electron-mksnapshot", __filename);
|
||||||
|
const mksnapshotBinPath = path.resolve(baseDir, "bin", "mksnapshot" + (process.platform === "win32" ? ".exe" : ""));
|
||||||
|
|
||||||
if (process.platform !== 'darwin') {
|
if (process.platform !== 'darwin') {
|
||||||
// TODO non-darwin
|
// TODO non-darwin
|
||||||
const mksnapshotBinPath = path.dirname(require.resolve('electron-mksnapshot/bin/mksnapshot'));
|
|
||||||
const matchingDirs = crossArchDirs.map((dir) => `${mksnapshotBinPath}/${dir}`).filter((dir) => fs.existsSync(dir));
|
const matchingDirs = crossArchDirs.map((dir) => `${mksnapshotBinPath}/${dir}`).filter((dir) => fs.existsSync(dir));
|
||||||
for (const dir of matchingDirs) {
|
for (const dir of matchingDirs) {
|
||||||
if (fs.existsSync(`${mksnapshotBinPath}/gen/v8/embedded.S`)) {
|
if (fs.existsSync(`${mksnapshotBinPath}/gen/v8/embedded.S`)) {
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,6 @@
|
||||||
"email": "team@zeit.co"
|
"email": "team@zeit.co"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@electron/remote": "2.1.2",
|
|
||||||
"@react-icons/all-files": "4.1.0",
|
"@react-icons/all-files": "4.1.0",
|
||||||
"@redux-devtools/extension": "^3.3.0",
|
"@redux-devtools/extension": "^3.3.0",
|
||||||
"@xterm/addon-canvas": "0.7.0",
|
"@xterm/addon-canvas": "0.7.0",
|
||||||
|
|
@ -93,6 +92,7 @@
|
||||||
"@babel/preset-react": "7.25.9",
|
"@babel/preset-react": "7.25.9",
|
||||||
"@babel/preset-typescript": "7.26.0",
|
"@babel/preset-typescript": "7.26.0",
|
||||||
"@electron/rebuild": "^3.7.1",
|
"@electron/rebuild": "^3.7.1",
|
||||||
|
"@electron/remote": "2.1.2",
|
||||||
"@types/args": "5.0.3",
|
"@types/args": "5.0.3",
|
||||||
"@types/async-retry": "1.4.9",
|
"@types/async-retry": "1.4.9",
|
||||||
"@types/color": "3.0.6",
|
"@types/color": "3.0.6",
|
||||||
|
|
|
||||||
|
|
@ -15,5 +15,7 @@ process.env.ELECTRON_CUSTOM_VERSION = version;
|
||||||
const downloadScript = pnp.resolveToUnqualified("electron-mksnapshot/download-mksnapshot.js", __filename);
|
const downloadScript = pnp.resolveToUnqualified("electron-mksnapshot/download-mksnapshot.js", __filename);
|
||||||
const mkSnapshotScript = path.resolve(__dirname, "../bin/mk-snapshot.js");
|
const mkSnapshotScript = path.resolve(__dirname, "../bin/mk-snapshot.js");
|
||||||
|
|
||||||
execSync(`node ${downloadScript}`, { stdio: "inherit" });
|
execSync(`node ${downloadScript}`, {
|
||||||
|
stdio: "inherit",
|
||||||
|
});
|
||||||
execSync(`node ${mkSnapshotScript}`, { stdio: "inherit" });
|
execSync(`node ${mkSnapshotScript}`, { stdio: "inherit" });
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue