mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-18 06:28:40 -09:00
Merge 9ec3eb9ed4 into d65dfba445
This commit is contained in:
commit
50566416eb
23 changed files with 41233 additions and 158469 deletions
20
.github/actions/build/action.yml
vendored
20
.github/actions/build/action.yml
vendored
|
|
@ -39,14 +39,10 @@ runs:
|
||||||
python3 -m pip install $EXTRA_ARGS packaging setuptools
|
python3 -m pip install $EXTRA_ARGS packaging setuptools
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Get yarn cache directory path
|
- uses: actions/cache@v4
|
||||||
shell: bash
|
if: github.event_name == 'push'
|
||||||
id: yarn-cache-dir-path
|
|
||||||
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- uses: actions/cache/restore@v4
|
|
||||||
with:
|
with:
|
||||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
path: .yarn/cache
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock', 'app/yarn.lock') }}
|
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock', 'app/yarn.lock') }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-yarn-
|
${{ runner.os }}-yarn-
|
||||||
|
|
@ -59,9 +55,7 @@ runs:
|
||||||
|
|
||||||
- name: Install
|
- name: Install
|
||||||
shell: bash
|
shell: bash
|
||||||
run: yarn install
|
run: yarn install --immutable
|
||||||
env:
|
|
||||||
npm_config_node_gyp: ${{ github.workspace }}${{ runner.os == 'Windows' && '\node_modules\node-gyp\bin\node-gyp.js' || '/node_modules/node-gyp/bin/node-gyp.js' }}
|
|
||||||
|
|
||||||
- name: Install libarchive-tools
|
- name: Install libarchive-tools
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
@ -152,12 +146,6 @@ runs:
|
||||||
name: pr_num
|
name: pr_num
|
||||||
path: ./pr_num.txt
|
path: ./pr_num.txt
|
||||||
|
|
||||||
- uses: actions/cache/save@v4
|
|
||||||
if: github.event_name == 'push'
|
|
||||||
with:
|
|
||||||
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
|
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock', 'app/yarn.lock') }}
|
|
||||||
|
|
||||||
# - name: Run E2E Tests (non-Linux)
|
# - name: Run E2E Tests (non-Linux)
|
||||||
# if: runner.os != 'Linux'
|
# if: runner.os != 'Linux'
|
||||||
# shell: bash
|
# shell: bash
|
||||||
|
|
|
||||||
5
.gitignore
vendored
5
.gitignore
vendored
|
|
@ -21,3 +21,8 @@ plugins
|
||||||
.vscode/*
|
.vscode/*
|
||||||
!.vscode/launch.json
|
!.vscode/launch.json
|
||||||
.idea
|
.idea
|
||||||
|
|
||||||
|
# yarn berry
|
||||||
|
.yarn/unplugged/
|
||||||
|
.yarn/build-state.yml
|
||||||
|
.yarn/install-state.gz
|
||||||
|
|
|
||||||
22912
.pnp.cjs
generated
Executable file
22912
.pnp.cjs
generated
Executable file
File diff suppressed because one or more lines are too long
2126
.pnp.loader.mjs
generated
Normal file
2126
.pnp.loader.mjs
generated
Normal file
File diff suppressed because it is too large
Load diff
BIN
.yarn/install-state.gz
Normal file
BIN
.yarn/install-state.gz
Normal file
Binary file not shown.
948
.yarn/releases/yarn-4.9.1.cjs
vendored
Executable file
948
.yarn/releases/yarn-4.9.1.cjs
vendored
Executable file
File diff suppressed because one or more lines are too long
148049
.yarn/releases/yarn-classic.cjs
vendored
148049
.yarn/releases/yarn-classic.cjs
vendored
File diff suppressed because one or more lines are too long
1
.yarnrc
1
.yarnrc
|
|
@ -1 +0,0 @@
|
||||||
registry "https://registry.npmjs.org/"
|
|
||||||
22
.yarnrc.yml
22
.yarnrc.yml
|
|
@ -1 +1,21 @@
|
||||||
yarnPath: .yarn/releases/yarn-classic.cjs
|
cacheFolder: .yarn/cache
|
||||||
|
|
||||||
|
compressionLevel: 0
|
||||||
|
|
||||||
|
checksumBehavior: ignore # necessary on Windows because of https://github.com/yarnpkg/berry/issues/5795
|
||||||
|
|
||||||
|
enableGlobalCache: false
|
||||||
|
|
||||||
|
nodeLinker: pnp
|
||||||
|
|
||||||
|
npmRegistryServer: "https://registry.yarnpkg.com"
|
||||||
|
|
||||||
|
yarnPath: .yarn/releases/yarn-4.9.1.cjs
|
||||||
|
|
||||||
|
packageExtensions:
|
||||||
|
react@*:
|
||||||
|
peerDependencies:
|
||||||
|
react: "*"
|
||||||
|
react-dom@*:
|
||||||
|
peerDependencies:
|
||||||
|
react-dom: "*"
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,11 @@ 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++
|
||||||
|
- Under individual components: MSVC Spectre-mitigated libraries for your architecture
|
||||||
|
- 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.)
|
||||||
|
|
|
||||||
BIN
app/.yarn/install-state.gz
Normal file
BIN
app/.yarn/install-state.gz
Normal file
Binary file not shown.
|
|
@ -1 +0,0 @@
|
||||||
registry "https://registry.npmjs.org/"
|
|
||||||
|
|
@ -21,7 +21,6 @@
|
||||||
"color": "4.2.3",
|
"color": "4.2.3",
|
||||||
"default-shell": "1.0.1",
|
"default-shell": "1.0.1",
|
||||||
"electron-devtools-installer": "3.2.0",
|
"electron-devtools-installer": "3.2.0",
|
||||||
"quine-electron-drag-click": "1.0.6d",
|
|
||||||
"electron-fetch": "1.9.1",
|
"electron-fetch": "1.9.1",
|
||||||
"electron-is-dev": "2.0.0",
|
"electron-is-dev": "2.0.0",
|
||||||
"electron-store": "8.2.0",
|
"electron-store": "8.2.0",
|
||||||
|
|
@ -34,6 +33,7 @@
|
||||||
"os-locale": "5.0.0",
|
"os-locale": "5.0.0",
|
||||||
"parse-url": "9.2.0",
|
"parse-url": "9.2.0",
|
||||||
"queue": "6.0.2",
|
"queue": "6.0.2",
|
||||||
|
"quine-electron-drag-click": "1.0.6-d",
|
||||||
"react": "18.3.1",
|
"react": "18.3.1",
|
||||||
"react-dom": "18.3.1",
|
"react-dom": "18.3.1",
|
||||||
"recast": "0.23.11",
|
"recast": "0.23.11",
|
||||||
|
|
@ -47,5 +47,10 @@
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"node-gyp": "^10.2.0"
|
"node-gyp": "^10.2.0"
|
||||||
|
},
|
||||||
|
"dependenciesMeta": {
|
||||||
|
"node-pty@1.1.0-beta33": {
|
||||||
|
"unplugged": true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
2378
app/pnpm-lock.yaml
Normal file
2378
app/pnpm-lock.yaml
Normal file
File diff suppressed because it is too large
Load diff
1620
app/yarn.lock
1620
app/yarn.lock
File diff suppressed because it is too large
Load diff
13
bin/cp-snapshot.js
vendored
13
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');
|
||||||
|
|
@ -10,24 +11,30 @@ function copySnapshot(pathToElectron, archToCopy) {
|
||||||
const pathToBlobV8 = path.resolve(__dirname, '..', 'cache', archToCopy, v8ContextFileName);
|
const pathToBlobV8 = path.resolve(__dirname, '..', 'cache', archToCopy, v8ContextFileName);
|
||||||
|
|
||||||
console.log('Copying v8 snapshots from', pathToBlob, 'to', pathToElectron);
|
console.log('Copying v8 snapshots from', pathToBlob, 'to', pathToElectron);
|
||||||
|
fs.mkdirSync(pathToElectron, { recursive: true });
|
||||||
fs.copyFileSync(pathToBlob, path.join(pathToElectron, snapshotFileName));
|
fs.copyFileSync(pathToBlob, path.join(pathToElectron, snapshotFileName));
|
||||||
fs.copyFileSync(pathToBlobV8, path.join(pathToElectron, v8ContextFileName));
|
fs.copyFileSync(pathToBlobV8, path.join(pathToElectron, v8ContextFileName));
|
||||||
}
|
}
|
||||||
|
|
||||||
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`;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
16
bin/mk-snapshot.js
vendored
16
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,11 +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') {
|
||||||
const mksnapshotBinPath = `${baseDirPath}/node_modules/electron-mksnapshot/bin`;
|
// TODO non-darwin
|
||||||
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`)) {
|
||||||
|
|
@ -50,7 +60,7 @@ async function main() {
|
||||||
|
|
||||||
console.log(`Generating startup blob in "${outputBlobPath}"`);
|
console.log(`Generating startup blob in "${outputBlobPath}"`);
|
||||||
const res = childProcess.execFileSync(
|
const res = childProcess.execFileSync(
|
||||||
path.resolve(__dirname, '..', 'node_modules', 'electron-mksnapshot', 'bin', 'mksnapshot' + (process.platform === 'win32' ? '.exe' : '')),
|
require.resolve(`electron-mksnapshot/bin/mksnapshot${process.platform === 'win32' ? '.exe' : ''}`),
|
||||||
[
|
[
|
||||||
'--startup-src=' + snapshotScriptPath,
|
'--startup-src=' + snapshotScriptPath,
|
||||||
'--startup-blob=' + startupBlobPath,
|
'--startup-blob=' + startupBlobPath,
|
||||||
|
|
|
||||||
5
bin/notarize.js
vendored
5
bin/notarize.js
vendored
|
|
@ -1,11 +1,12 @@
|
||||||
const { notarize } = require("@electron/notarize");
|
|
||||||
|
|
||||||
exports.default = async function notarizing(context) {
|
exports.default = async function notarizing(context) {
|
||||||
|
|
||||||
const { electronPlatformName, appOutDir } = context;
|
const { electronPlatformName, appOutDir } = context;
|
||||||
if (electronPlatformName !== "darwin" || !process.env.APPLE_ID || !process.env.APPLE_PASSWORD) {
|
if (electronPlatformName !== "darwin" || !process.env.APPLE_ID || !process.env.APPLE_PASSWORD) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const { notarize } = await import('@electron/notarize');
|
||||||
|
|
||||||
const appName = context.packager.appInfo.productFilename;
|
const appName = context.packager.appInfo.productFilename;
|
||||||
return await notarize({
|
return await notarize({
|
||||||
appBundleId: "com.quineglobal.hyper",
|
appBundleId: "com.quineglobal.hyper",
|
||||||
|
|
|
||||||
53
package.json
53
package.json
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"name": "hyper",
|
"name": "hyper-root",
|
||||||
"version": "4.0.0-q-canary.8",
|
"version": "4.0.0-q-canary.8",
|
||||||
"repository": "quine-global/hyper",
|
"repository": "quine-global/hyper",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|
@ -16,15 +16,15 @@
|
||||||
"test:unit": "cross-env DEBUG=ava:watcher ava",
|
"test:unit": "cross-env DEBUG=ava:watcher ava",
|
||||||
"test:unit:watch": "yarn run test:unit -- --watch",
|
"test:unit:watch": "yarn run test:unit -- --watch",
|
||||||
"test:e2e": "cross-env DEBUG=ava:watcher ava --config ava-e2e.config.js",
|
"test:e2e": "cross-env DEBUG=ava:watcher ava --config ava-e2e.config.js",
|
||||||
"postinstall": "yarn run v8-snapshot && webpack --config-name hyper-app && yarn run install-app-deps-with-retry && yarn run rebuild-node-pty && cpy --cwd=target node_modules \"../../app/\" && husky && yarn run generate-schema",
|
"postinstall": "yarn run v8-snapshot && webpack --config-name hyper-app && yarn run install-app-deps-with-retry && yarn run rebuild-node-pty && husky && yarn run generate-schema",
|
||||||
"install-app-deps-with-retry": "electron-builder install-app-deps || electron-builder install-app-deps || electron-builder install-app-deps",
|
"install-app-deps-with-retry": "electron-builder install-app-deps || electron-builder install-app-deps || electron-builder install-app-deps",
|
||||||
"rebuild-node-pty": "electron-rebuild -f -o node-pty -m target",
|
"rebuild-node-pty": "electron-rebuild -f -o node-pty -m target",
|
||||||
"dist": "yarn run build && yarn run electron-builder-with-retry",
|
"dist": "yarn run build && yarn run electron-builder-with-retry",
|
||||||
"electron-builder-with-retry": "electron-builder -p never || electron-builder -p never || electron-builder -p never",
|
"electron-builder-with-retry": "electron-builder -p never || electron-builder -p never || electron-builder -p never",
|
||||||
"clean": "node ./bin/rimraf-standalone.js node_modules && node ./bin/rimraf-standalone.js ./app/node_modules && node ./bin/rimraf-standalone.js ./app/renderer && node ./bin/rimraf-standalone.js ./target && node ./bin/rimraf-standalone.js ./dist",
|
"clean": "node ./bin/rimraf-standalone.js node_modules && node ./bin/rimraf-standalone.js ./app/node_modules && node ./bin/rimraf-standalone.js ./app/renderer && node ./bin/rimraf-standalone.js ./target && node ./bin/rimraf-standalone.js ./dist",
|
||||||
"v8-snapshot": "cross-env npm_config_arch=x64 yarn run v8-snapshot:arch && cross-env npm_config_arch=arm64 yarn run v8-snapshot:arch",
|
"v8-snapshot": "node scripts/v8-snapshot.js",
|
||||||
"v8-snapshot:arch": "yarn run mk-snapshot && yarn run cp-snapshot",
|
"v8-snapshot:arch": "yarn run mk-snapshot && yarn run cp-snapshot",
|
||||||
"mk-snapshot": "cross-env ELECTRON_CUSTOM_VERSION=$npm_package_devDependencies_electron node node_modules/electron-mksnapshot/download-mksnapshot.js && node bin/mk-snapshot.js",
|
"mk-snapshot": "node scripts/mk-snapshot.js",
|
||||||
"cp-snapshot": "node bin/cp-snapshot.js",
|
"cp-snapshot": "node bin/cp-snapshot.js",
|
||||||
"generate-schema": "typescript-json-schema ./typings/config.d.ts rawConfig -o ./app/config/schema.json --required",
|
"generate-schema": "typescript-json-schema ./typings/config.d.ts rawConfig -o ./app/config/schema.json --required",
|
||||||
"uuaw": "uuaw"
|
"uuaw": "uuaw"
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
"email": "team@zeit.co"
|
"email": "team@zeit.co"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@electron/remote": "2.1.2",
|
"@electron/notarize": "^3.0.1",
|
||||||
"@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",
|
||||||
|
|
@ -63,6 +63,7 @@
|
||||||
"open": "8.4.2",
|
"open": "8.4.2",
|
||||||
"ora": "8.1.1",
|
"ora": "8.1.1",
|
||||||
"php-escape-shell": "1.0.0",
|
"php-escape-shell": "1.0.0",
|
||||||
|
"quine-electron-drag-click": "1.0.6-d",
|
||||||
"react": "18.3.1",
|
"react": "18.3.1",
|
||||||
"react-dom": "18.3.1",
|
"react-dom": "18.3.1",
|
||||||
"react-redux": "8.1.3",
|
"react-redux": "8.1.3",
|
||||||
|
|
@ -85,13 +86,16 @@
|
||||||
"@ava/typescript": "^4.1.0",
|
"@ava/typescript": "^4.1.0",
|
||||||
"@babel/cli": "7.25.9",
|
"@babel/cli": "7.25.9",
|
||||||
"@babel/core": "7.26.0",
|
"@babel/core": "7.26.0",
|
||||||
|
"@babel/parser": "7.27.0",
|
||||||
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
||||||
"@babel/plugin-proposal-numeric-separator": "^7.18.6",
|
"@babel/plugin-proposal-numeric-separator": "^7.18.6",
|
||||||
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
|
"@babel/plugin-proposal-object-rest-spread": "^7.20.7",
|
||||||
"@babel/plugin-proposal-optional-chaining": "7.21.0",
|
"@babel/plugin-proposal-optional-chaining": "7.21.0",
|
||||||
"@babel/preset-react": "7.25.9",
|
"@babel/preset-react": "7.25.9",
|
||||||
"@babel/preset-typescript": "7.26.0",
|
"@babel/preset-typescript": "7.26.0",
|
||||||
|
"@babel/types": "^7.27.6",
|
||||||
"@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",
|
||||||
|
|
@ -105,15 +109,20 @@
|
||||||
"@types/react": "18.3.12",
|
"@types/react": "18.3.12",
|
||||||
"@types/react-dom": "18.3.1",
|
"@types/react-dom": "18.3.1",
|
||||||
"@types/seamless-immutable": "7.1.19",
|
"@types/seamless-immutable": "7.1.19",
|
||||||
|
"@types/shell-escape": "^0",
|
||||||
"@types/styled-jsx": "2.2.9",
|
"@types/styled-jsx": "2.2.9",
|
||||||
"@types/uuid": "10.0.0",
|
"@types/uuid": "10.0.0",
|
||||||
"@typescript-eslint/eslint-plugin": "7.0.0",
|
"@typescript-eslint/eslint-plugin": "7.0.0",
|
||||||
"@typescript-eslint/parser": "6.21.0",
|
"@typescript-eslint/parser": "6.21.0",
|
||||||
|
"acorn": "^8.14.1",
|
||||||
"babel-loader": "9.2.1",
|
"babel-loader": "9.2.1",
|
||||||
|
"color-convert": "2.0.1",
|
||||||
|
"color-string": "1.9.0",
|
||||||
"concurrently": "9.1.0",
|
"concurrently": "9.1.0",
|
||||||
"copy-webpack-plugin": "12.0.2",
|
"copy-webpack-plugin": "12.0.2",
|
||||||
"cpy-cli": "^5.0.0",
|
"cpy-cli": "^5.0.0",
|
||||||
"cross-env": "7.0.3",
|
"cross-env": "7.0.3",
|
||||||
|
"dmg-builder": "26.0.13",
|
||||||
"electron": "34.5.1",
|
"electron": "34.5.1",
|
||||||
"electron-builder": "26.0.13",
|
"electron-builder": "26.0.13",
|
||||||
"electron-link": "^0.6.0",
|
"electron-link": "^0.6.0",
|
||||||
|
|
@ -129,22 +138,26 @@
|
||||||
"eslint-plugin-lodash": "^7.4.0",
|
"eslint-plugin-lodash": "^7.4.0",
|
||||||
"eslint-plugin-prettier": "^5.2.1",
|
"eslint-plugin-prettier": "^5.2.1",
|
||||||
"eslint-plugin-react": "7.37.2",
|
"eslint-plugin-react": "7.37.2",
|
||||||
|
"fs-extra": "^11.3.0",
|
||||||
"husky": "^9.1.7",
|
"husky": "^9.1.7",
|
||||||
"husky-init": "^8.0.0",
|
"husky-init": "^8.0.0",
|
||||||
"inquirer": "10.1.8",
|
"inquirer": "10.1.8",
|
||||||
"node-addon-api": "8.2.2",
|
"node-addon-api": "8.2.2",
|
||||||
"node-gyp": "^10.2.0",
|
"node-gyp": "^10.2.0",
|
||||||
|
"normalize-url": "6.0.1",
|
||||||
"null-loader": "4.0.1",
|
"null-loader": "4.0.1",
|
||||||
"parse-url": "9.2.0",
|
"parse-url": "9.2.0",
|
||||||
"playwright": "1.49.0",
|
"playwright": "1.49.0",
|
||||||
"plist": "3.1.0",
|
"plist": "3.1.0",
|
||||||
|
"pnp-webpack-plugin": "^1.7.0",
|
||||||
"prettier": "3.3.3",
|
"prettier": "3.3.3",
|
||||||
"proxyquire": "2.1.3",
|
"proxyquire": "2.1.3",
|
||||||
|
"shell-escape": "^0.2.0",
|
||||||
"style-loader": "4.0.0",
|
"style-loader": "4.0.0",
|
||||||
"terser": "5.36.0",
|
"terser": "5.36.0",
|
||||||
"terser-webpack-plugin": "^5.3.10",
|
"terser-webpack-plugin": "^5.3.10",
|
||||||
"ts-node": "10.9.2",
|
"ts-node": "10.9.2",
|
||||||
"typescript": "5.7.2",
|
"typescript": "^5.8.3",
|
||||||
"uuaw": "^1.2.2",
|
"uuaw": "^1.2.2",
|
||||||
"webpack": "5.96.1"
|
"webpack": "5.96.1"
|
||||||
},
|
},
|
||||||
|
|
@ -157,7 +170,31 @@
|
||||||
},
|
},
|
||||||
"resolutions": {
|
"resolutions": {
|
||||||
"@types/retry": "0.12.5",
|
"@types/retry": "0.12.5",
|
||||||
"node-abi": "^3.67.0"
|
"node-abi": "^3.67.0",
|
||||||
|
"@types/node": "22.15.30"
|
||||||
},
|
},
|
||||||
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
|
"packageManager": "yarn@4.9.1",
|
||||||
|
"dependenciesMeta": {
|
||||||
|
"@react-icons/all-files@4.1.0": {
|
||||||
|
"unplugged": true
|
||||||
|
},
|
||||||
|
"color@4.2.3": {
|
||||||
|
"unplugged": true
|
||||||
|
},
|
||||||
|
"dmg-builder@26.0.13": {
|
||||||
|
"unplugged": true
|
||||||
|
},
|
||||||
|
"electron-mksnapshot@34.5.1": {
|
||||||
|
"unplugged": true
|
||||||
|
},
|
||||||
|
"react@18.3.1": {
|
||||||
|
"unplugged": true
|
||||||
|
},
|
||||||
|
"react-dom@18.3.1": {
|
||||||
|
"unplugged": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"workspaces": [
|
||||||
|
"app"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
23
scripts/mk-snapshot.js
Normal file
23
scripts/mk-snapshot.js
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
const { execSync } = require("child_process");
|
||||||
|
const pkg = require("../package.json");
|
||||||
|
const path = require("path");
|
||||||
|
const pnp = require("pnpapi");
|
||||||
|
const shellescape = require('shell-escape');
|
||||||
|
|
||||||
|
|
||||||
|
const version = pkg.devDependencies.electron;
|
||||||
|
if (!version) {
|
||||||
|
console.error("Electron not found in devDependencies.");
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
|
process.env.ELECTRON_CUSTOM_VERSION = version;
|
||||||
|
|
||||||
|
|
||||||
|
const downloadScript = pnp.resolveToUnqualified("electron-mksnapshot/download-mksnapshot.js", __filename);
|
||||||
|
const mkSnapshotScript = path.resolve(__dirname, "../bin/mk-snapshot.js");
|
||||||
|
|
||||||
|
execSync(`node ${downloadScript}`, {
|
||||||
|
stdio: "inherit",
|
||||||
|
});
|
||||||
|
execSync(`node ${mkSnapshotScript}`, { stdio: "inherit" });
|
||||||
10
scripts/v8-snapshot.js
Normal file
10
scripts/v8-snapshot.js
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
const { execSync } = require("child_process");
|
||||||
|
const arch = process.arch;
|
||||||
|
|
||||||
|
if (arch === "arm64") {
|
||||||
|
console.log("Running snapshot for x64 (Rosetta build)...");
|
||||||
|
execSync("cross-env npm_config_arch=x64 yarn run v8-snapshot:arch", { stdio: "inherit" });
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(`Running snapshot for native arch: ${arch}...`);
|
||||||
|
execSync("cross-env npm_config_arch=" + arch + " yarn run v8-snapshot:arch", { stdio: "inherit" });
|
||||||
|
|
@ -4,16 +4,35 @@ import Copy from 'copy-webpack-plugin';
|
||||||
import TerserPlugin from 'terser-webpack-plugin';
|
import TerserPlugin from 'terser-webpack-plugin';
|
||||||
import webpack from 'webpack';
|
import webpack from 'webpack';
|
||||||
|
|
||||||
|
// @ts-ignore
|
||||||
|
import PnpWebpackPlugin from 'pnp-webpack-plugin';
|
||||||
|
|
||||||
|
import { createRequire } from 'module';
|
||||||
|
|
||||||
const nodeEnv = process.env.NODE_ENV || 'development';
|
const nodeEnv = process.env.NODE_ENV || 'development';
|
||||||
const isProd = nodeEnv === 'production';
|
const isProd = nodeEnv === 'production';
|
||||||
|
|
||||||
|
const { resolveRequest } = require('pnpapi');
|
||||||
|
const pathToReact = resolveRequest('react', __filename);
|
||||||
|
console.log('Resolved react via pnpapi:', pathToReact);
|
||||||
|
|
||||||
|
|
||||||
const config: webpack.Configuration[] = [
|
const config: webpack.Configuration[] = [
|
||||||
{
|
{
|
||||||
mode: 'none',
|
mode: 'none',
|
||||||
name: 'hyper-app',
|
name: 'hyper-app',
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json']
|
extensions: ['.js', '.jsx', '.ts', '.tsx', '.json'],
|
||||||
|
plugins: [PnpWebpackPlugin],
|
||||||
|
alias: {
|
||||||
|
react: require.resolve('react'),
|
||||||
|
//'react-dom': require.resolve('react-dom'),
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
resolveLoader: {
|
||||||
|
plugins: [PnpWebpackPlugin.moduleLoader(module)],
|
||||||
|
},
|
||||||
|
|
||||||
entry: './app/index.ts',
|
entry: './app/index.ts',
|
||||||
output: {
|
output: {
|
||||||
path: path.join(__dirname, 'target'),
|
path: path.join(__dirname, 'target'),
|
||||||
|
|
@ -46,10 +65,6 @@ const config: webpack.Configuration[] = [
|
||||||
globOptions: {ignore: ['**/node_modules/**']},
|
globOptions: {ignore: ['**/node_modules/**']},
|
||||||
to: './config/[name][ext]'
|
to: './config/[name][ext]'
|
||||||
},
|
},
|
||||||
{
|
|
||||||
from: './app/yarn.lock',
|
|
||||||
to: 'yarn.lock'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
from: './app/keymaps/*.json',
|
from: './app/keymaps/*.json',
|
||||||
globOptions: {ignore: ['**/node_modules/**']},
|
globOptions: {ignore: ['**/node_modules/**']},
|
||||||
|
|
@ -68,13 +83,21 @@ const config: webpack.Configuration[] = [
|
||||||
{
|
{
|
||||||
mode: 'none',
|
mode: 'none',
|
||||||
name: 'hyper',
|
name: 'hyper',
|
||||||
|
infrastructureLogging: {
|
||||||
|
level: 'verbose',
|
||||||
|
debug: true
|
||||||
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
|
plugins: [PnpWebpackPlugin],
|
||||||
alias: {
|
alias: {
|
||||||
react: path.resolve(__dirname, 'node_modules/react'),
|
react: require.resolve('react'),
|
||||||
'react-dom': path.resolve(__dirname, 'node_modules/react-dom')
|
//'react-dom': require.resolve('react-dom')
|
||||||
},
|
},
|
||||||
extensions: ['.js', '.jsx', '.ts', '.tsx', '.d.ts']
|
extensions: ['.js', '.jsx', '.ts', '.tsx', '.d.ts']
|
||||||
},
|
},
|
||||||
|
resolveLoader: {
|
||||||
|
plugins: [PnpWebpackPlugin.moduleLoader(module)]
|
||||||
|
},
|
||||||
devtool: isProd ? 'hidden-source-map' : 'cheap-module-source-map',
|
devtool: isProd ? 'hidden-source-map' : 'cheap-module-source-map',
|
||||||
entry: './lib/index.tsx',
|
entry: './lib/index.tsx',
|
||||||
output: {
|
output: {
|
||||||
|
|
@ -86,7 +109,7 @@ const config: webpack.Configuration[] = [
|
||||||
{
|
{
|
||||||
test: /\.(js|jsx|ts|tsx)$/,
|
test: /\.(js|jsx|ts|tsx)$/,
|
||||||
exclude: /node_modules/,
|
exclude: /node_modules/,
|
||||||
loader: 'babel-loader'
|
loader: require.resolve('babel-loader')
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
test: /\.json/,
|
test: /\.json/,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue