Merge branch 'canary'

This commit is contained in:
Labhansh Agrawal 2022-08-22 13:18:10 +05:30
commit 7cc1615cec
21 changed files with 1695 additions and 1215 deletions

View file

@ -9,4 +9,5 @@ assets
website
bin
dist
target
target
cache

View file

@ -39,7 +39,7 @@ jobs:
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
@ -50,10 +50,10 @@ jobs:
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1
uses: github/codeql-action/autobuild@v2
# Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl
# 📚 https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
@ -64,4 +64,4 @@ jobs:
# make release
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
uses: github/codeql-action/analyze@v2

View file

@ -14,14 +14,14 @@ jobs:
WORKFLOW_RUN_INFO: ${{ toJSON(github.event.workflow_run) }}
run: echo "$WORKFLOW_RUN_INFO"
- name: Download Artifacts
uses: dawidd6/action-download-artifact@v2.17.0
uses: dawidd6/action-download-artifact@v2.22.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: nodejs.yml
run_id: ${{ github.event.workflow_run.id }}
name: e2e
- name: Get PR number
uses: dawidd6/action-download-artifact@v2.17.0
uses: dawidd6/action-download-artifact@v2.22.0
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
workflow: nodejs.yml

View file

@ -64,7 +64,7 @@ jobs:
run: yarn run test:e2e
- name: Archive E2E test screenshot
if: runner.os != 'Linux'
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
with:
name: e2e
path: dist/tmp/*.png
@ -74,7 +74,7 @@ jobs:
PR_NUM: ${{ github.event.number }}
run: echo $PR_NUM > pr_num.txt
- name: Upload the pr num
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v3
if: github.event_name == 'pull_request'
with:
name: pr_num

1
.gitignore vendored
View file

@ -3,6 +3,7 @@ dist
app/renderer
target
bin/cli.*
cache
# dependencies
node_modules

View file

@ -99,7 +99,7 @@ make sure its build process is working correctly by running `yarn run rebuild-no
If you are on macOS, this typically is related to Xcode issues (like not having agreed
to the Terms of Service by running `sudo xcodebuild` after a fresh Xcode installation).
##### Error with `c++` on macOS when running `yarn`
##### Error with `C++` on macOS when running `yarn`
If you are getting compiler errors when running `yarn` add the environment variable `export CXX=clang++`

View file

@ -13,30 +13,30 @@
"@electron/remote": "2.0.8",
"async-retry": "1.3.3",
"chokidar": "^3.5.3",
"color": "4.2.1",
"color": "4.2.3",
"default-shell": "1.0.1",
"electron-fetch": "1.7.4",
"electron-is-dev": "2.0.0",
"electron-store": "8.0.1",
"fs-extra": "10.0.1",
"git-describe": "4.1.0",
"electron-store": "8.1.0",
"fs-extra": "10.1.0",
"git-describe": "4.1.1",
"lodash": "4.17.21",
"mkdirp": "1.0.4",
"ms": "2.1.3",
"native-process-working-directory": "^1.0.2",
"node-pty": "0.10.1",
"os-locale": "5.0.0",
"parse-url": "5.0.7",
"parse-url": "7.0.2",
"pify": "5.0.0",
"queue": "6.0.2",
"react": "17.0.2",
"react-dom": "17.0.2",
"semver": "7.3.5",
"semver": "7.3.7",
"shell-env": "3.0.1",
"sudo-prompt": "^9.2.1",
"uuid": "8.3.2"
},
"optionalDependencies": {
"native-reg": "1.0.0"
"native-reg": "1.1.0"
}
}

View file

@ -101,18 +101,18 @@ color-string@^1.9.0:
color-name "^1.0.0"
simple-swizzle "^0.2.2"
color@4.2.1:
version "4.2.1"
resolved "https://registry.npmjs.org/color/-/color-4.2.1.tgz#498aee5fce7fc982606c8875cab080ac0547c884"
integrity sha512-MFJr0uY4RvTQUKvPq7dh9grVOTYSFeXja2mBXioCGjnjJoXrAp9jJ1NQTDR73c9nwBSAQiNKloKl5zq9WB9UPw==
color@4.2.3:
version "4.2.3"
resolved "https://registry.npmjs.org/color/-/color-4.2.3.tgz#d781ecb5e57224ee43ea9627560107c0e0c6463a"
integrity sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==
dependencies:
color-convert "^2.0.1"
color-string "^1.9.0"
conf@^10.0.3:
version "10.0.3"
resolved "https://registry.npmjs.org/conf/-/conf-10.0.3.tgz#af266186cc754daefd2749398861ec538c50da17"
integrity sha512-4gtQ/Q36qVxBzMe6B7gWOAfni1VdhuHkIzxydHkclnwGmgN+eW4bb6jj73vigCfr7d3WlmqawvhZrpCUCTPYxQ==
conf@^10.2.0:
version "10.2.0"
resolved "https://registry.npmjs.org/conf/-/conf-10.2.0.tgz#838e757be963f1a2386dfe048a98f8f69f7b55d6"
integrity sha512-8fLl9F04EJqjSqH+QjITQfJF8BrOVaYr1jewVgSRAEWePfxT0sku4w2hrGQ60BC/TNLGQ2pgxNlTbWQmMPFvXg==
dependencies:
ajv "^8.6.3"
ajv-formats "^2.1.1"
@ -176,13 +176,13 @@ electron-is-dev@2.0.0:
resolved "https://registry.npmjs.org/electron-is-dev/-/electron-is-dev-2.0.0.tgz#833487a069b8dad21425c67a19847d9064ab19bd"
integrity sha512-3X99K852Yoqu9AcW50qz3ibYBWY79/pBhlMCab8ToEWS48R0T9tyxRiQhwylE7zQdXrMnx2JKqUJyMPmt5FBqA==
electron-store@8.0.1:
version "8.0.1"
resolved "https://registry.npmjs.org/electron-store/-/electron-store-8.0.1.tgz#9b598c1d2edeffebee9d8c1cd957ad368c528925"
integrity sha512-ZyLvNywiqSpbwC/pp89O/AycVWY/UJIkmtyzF2Bd0Nm/rLmcFc0NTGuLdg6+LE8mS8qsiK5JMoe4PnrecLHH5w==
electron-store@8.1.0:
version "8.1.0"
resolved "https://registry.npmjs.org/electron-store/-/electron-store-8.1.0.tgz#46a398f2bd9aa83c4a9daaae28380e2b3b9c7597"
integrity sha512-2clHg/juMjOH0GT9cQ6qtmIvK183B39ZXR0bUoPwKwYHJsEF3quqyDzMFUAu+0OP8ijmN2CbPRAelhNbWUbzwA==
dependencies:
conf "^10.0.3"
type-fest "^1.0.2"
conf "^10.2.0"
type-fest "^2.17.0"
encoding@^0.1.13:
version "0.1.13"
@ -250,10 +250,10 @@ find-up@^3.0.0:
dependencies:
locate-path "^3.0.0"
fs-extra@10.0.1:
version "10.0.1"
resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.1.tgz#27de43b4320e833f6867cc044bfce29fdf0ef3b8"
integrity sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==
fs-extra@10.1.0:
version "10.1.0"
resolved "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf"
integrity sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==
dependencies:
graceful-fs "^4.2.0"
jsonfile "^6.0.1"
@ -278,10 +278,10 @@ get-stream@^5.0.0:
dependencies:
pump "^3.0.0"
git-describe@4.1.0:
version "4.1.0"
resolved "https://registry.npmjs.org/git-describe/-/git-describe-4.1.0.tgz#0c50fa1ec5ead55932b6e875b2299b17ce5e07d3"
integrity sha512-NM7JSseVK4Z0r505+2TIrgPQKPvqbOowHP73IY5y69v/t/PmoMleJdij1vTO3qVm1qSvqb6342p1MYSxsnV8QA==
git-describe@4.1.1:
version "4.1.1"
resolved "https://registry.npmjs.org/git-describe/-/git-describe-4.1.1.tgz#a2a2882e442aa68abd0b3cb467459c83ed2f96ef"
integrity sha512-JC8ganO5kO80G8+XE98TDDjnMXQN3Estk3qdJuG2EGRF/l6zuMTMcN+8OSfQZ5FWpqIRLB015anWX4aSRgnxAQ==
dependencies:
"@types/semver" "^7.3.8"
lodash "^4.17.21"
@ -356,12 +356,12 @@ is-obj@^2.0.0:
resolved "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz#473fb05d973705e3fd9620545018ca8e22ef4982"
integrity sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==
is-ssh@^1.3.0:
version "1.3.2"
resolved "https://registry.npmjs.org/is-ssh/-/is-ssh-1.3.2.tgz#a4b82ab63d73976fd8263cceee27f99a88bdae2b"
integrity sha512-elEw0/0c2UscLrNG+OAorbP539E3rhliKPg+hDMWN9VwrDXfYK+4PBEykDPfxlYYtQvl84TascnQyobfQLHEhQ==
is-ssh@^1.4.0:
version "1.4.0"
resolved "https://registry.npmjs.org/is-ssh/-/is-ssh-1.4.0.tgz#4f8220601d2839d8fa624b3106f8e8884f01b8b2"
integrity sha512-x7+VxdxOdlV3CYpjvRLBv5Lo9OJerlYanjwFrPR9fuGPjCiNiCzFgAWpiLAohSbsnH4ZAys3SBh+hq5rJosxUQ==
dependencies:
protocols "^1.1.0"
protocols "^2.0.1"
is-stream@^1.1.0:
version "1.1.0"
@ -489,10 +489,10 @@ native-process-working-directory@^1.0.2:
dependencies:
node-addon-api "^3.1.0"
native-reg@1.0.0:
version "1.0.0"
resolved "https://registry.npmjs.org/native-reg/-/native-reg-1.0.0.tgz#77f9acbf59eda02680c00b0b1b9d1e0078b7820d"
integrity sha512-MxukmqY7jOeiS9+b4TAlfG9cvaQ03oLET35nUGYGHDRcLx0NFk7eeoWqX4wAXaFiMW50ZiFalOA6W8q3fprcsw==
native-reg@1.1.0:
version "1.1.0"
resolved "https://registry.npmjs.org/native-reg/-/native-reg-1.1.0.tgz#caa7a21c8e537c977cf481296d5675edebcbcbe2"
integrity sha512-nykrWHVAp9E6oLUypAVDFj+kq5J4AMd7VA5CVOqMw/k4w7Mhuc6p/1tLTqDLJbQsFs85qT1ElQw8Yn/RayUupg==
dependencies:
node-gyp-build "4"
@ -523,10 +523,10 @@ normalize-path@^3.0.0, normalize-path@~3.0.0:
resolved "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==
normalize-url@4.5.1:
version "4.5.1"
resolved "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a"
integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==
normalize-url@^6.1.0:
version "6.1.0"
resolved "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a"
integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==
npm-run-path@^2.0.0:
version "2.0.2"
@ -604,23 +604,22 @@ p-try@^2.0.0:
resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6"
integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==
parse-path@^4.0.0:
version "4.0.2"
resolved "https://registry.npmjs.org/parse-path/-/parse-path-4.0.2.tgz#ef14f0d3d77bae8dd4bc66563a4c151aac9e65aa"
integrity sha512-HSqVz6iuXSiL8C1ku5Gl1Z5cwDd9Wo0q8CoffdAghP6bz8pJa1tcMC+m4N+z6VAS8QdksnIGq1TB6EgR4vPR6w==
parse-path@^5.0.0:
version "5.0.0"
resolved "https://registry.npmjs.org/parse-path/-/parse-path-5.0.0.tgz#f933152f3c6d34f4cf36cfc3d07b138ac113649d"
integrity sha512-qOpH55/+ZJ4jUu/oLO+ifUKjFPNZGfnPJtzvGzKN/4oLMil5m9OH4VpOj6++9/ytJcfks4kzH2hhi87GL/OU9A==
dependencies:
is-ssh "^1.3.0"
protocols "^1.4.0"
protocols "^2.0.0"
parse-url@5.0.7:
version "5.0.7"
resolved "https://registry.npmjs.org/parse-url/-/parse-url-5.0.7.tgz#2ca3c32816f1a092c35e1f2afe63bb7924dde261"
integrity sha512-CgbjyWT6aOh2oNSUS0cioYQsGysj9hQ2IdbOfeNwq5KOaKM7dOw/yTupiI0cnJhaDHJEIGybPkQz7LF9WNIhyw==
parse-url@7.0.2:
version "7.0.2"
resolved "https://registry.npmjs.org/parse-url/-/parse-url-7.0.2.tgz#d21232417199b8d371c6aec0cedf1406fd6393f0"
integrity sha512-PqO4Z0eCiQ08Wj6QQmrmp5YTTxpYfONdOEamrtvK63AmzXpcavIVQubGHxOEwiIoDZFb8uDOoQFS0NCcjqIYQg==
dependencies:
is-ssh "^1.3.0"
normalize-url "4.5.1"
parse-path "^4.0.0"
protocols "^1.4.0"
is-ssh "^1.4.0"
normalize-url "^6.1.0"
parse-path "^5.0.0"
protocols "^2.0.1"
path-exists@^3.0.0:
version "3.0.0"
@ -654,10 +653,10 @@ pkg-up@^3.1.0:
dependencies:
find-up "^3.0.0"
protocols@^1.1.0, protocols@^1.4.0:
version "1.4.8"
resolved "https://registry.npmjs.org/protocols/-/protocols-1.4.8.tgz#48eea2d8f58d9644a4a32caae5d5db290a075ce8"
integrity sha512-IgjKyaUSjsROSO8/D49Ab7hP8mJgTYcqApOqdPhLoPxAplXmkp+zRvsrSQjFn5by0rhm4VH0GAUELIPpx7B1yg==
protocols@^2.0.0, protocols@^2.0.1:
version "2.0.1"
resolved "https://registry.npmjs.org/protocols/-/protocols-2.0.1.tgz#8f155da3fc0f32644e83c5782c8e8212ccf70a86"
integrity sha512-/XJ368cyBJ7fzLMwLKv1e4vLxOju2MNAIokcr7meSaNcVbWz/CPcW22cP04mwxOErdA5mwjA8Q6w/cdAQxVn7Q==
pump@^3.0.0:
version "3.0.0"
@ -726,10 +725,10 @@ scheduler@^0.20.2:
loose-envify "^1.1.0"
object-assign "^4.1.1"
semver@7.3.5, semver@^7.3.5:
version "7.3.5"
resolved "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7"
integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==
semver@7.3.7, semver@^7.3.5:
version "7.3.7"
resolved "https://registry.npmjs.org/semver/-/semver-7.3.7.tgz#12c5b649afdbf9049707796e22a4028814ce523f"
integrity sha512-QlYTucUYOews+WeEujDoEGziz4K6c47V/Bd+LjSSYcA94p+DmINdf7ncaUinThfvZyu13lN9OY1XDxt8C0Tw0g==
dependencies:
lru-cache "^6.0.0"
@ -817,10 +816,10 @@ to-regex-range@^5.0.1:
dependencies:
is-number "^7.0.0"
type-fest@^1.0.2:
version "1.0.2"
resolved "https://registry.npmjs.org/type-fest/-/type-fest-1.0.2.tgz#3f9c39982859f385c77c38b7e5f1432b8a3661c6"
integrity sha512-a720oz3Kjbp3ll0zkeN9qjRhO7I34MKMhPGQiQJAmaZQZQ1lo+NWThK322f7sXV+kTg9B1Ybt16KgBXWgteT8w==
type-fest@^2.17.0:
version "2.18.0"
resolved "https://registry.npmjs.org/type-fest/-/type-fest-2.18.0.tgz#fdef3a74e0a9e68ebe46054836650fb91ac3881e"
integrity sha512-pRS+/yrW5TjPPHNOvxhbNZexr2bS63WjrMU8a+VzEBhUi9Tz1pZeD+vQz3ut0svZ46P+SRqMEPnJmk2XnvNzTw==
universalify@^2.0.0:
version "2.0.0"

53
bin/cp-snapshot.js vendored Normal file
View file

@ -0,0 +1,53 @@
const path = require('path');
const fs = require('fs');
const {Arch} = require('electron-builder');
function copySnapshot(pathToElectron, archToCopy) {
const snapshotFileName = 'snapshot_blob.bin';
const v8ContextFileName = getV8ContextFileName(archToCopy);
const pathToBlob = path.resolve(__dirname, '..', 'cache', archToCopy, snapshotFileName);
const pathToBlobV8 = path.resolve(__dirname, '..', 'cache', archToCopy, v8ContextFileName);
console.log('Copying v8 snapshots from', pathToBlob, 'to', pathToElectron);
fs.copyFileSync(pathToBlob, path.join(pathToElectron, snapshotFileName));
fs.copyFileSync(pathToBlobV8, path.join(pathToElectron, v8ContextFileName));
}
function getPathToElectron() {
switch (process.platform) {
case 'darwin':
return path.resolve(
__dirname,
'..',
'node_modules/electron/dist/Electron.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources'
);
case 'win32':
case 'linux':
return path.resolve(__dirname, '..', 'node_modules', 'electron', 'dist');
}
}
function getV8ContextFileName(archToCopy) {
if (process.platform === 'darwin') {
return `v8_context_snapshot${archToCopy === 'arm64' ? '.arm64' : '.x86_64'}.bin`;
} else {
return `v8_context_snapshot.bin`;
}
}
exports.default = async (context) => {
const archToCopy = Arch[context.arch];
const pathToElectron =
process.platform === 'darwin'
? `${context.appOutDir}/Hyper.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Resources`
: context.appOutDir;
copySnapshot(pathToElectron, archToCopy);
};
if (require.main === module) {
const archToCopy = process.env.npm_config_arch;
const pathToElectron = getPathToElectron();
if ((process.arch.startsWith('arm') ? 'arm64' : 'x64') === archToCopy) {
copySnapshot(pathToElectron, archToCopy);
}
}

51
bin/mk-snapshot.js vendored Normal file
View file

@ -0,0 +1,51 @@
const childProcess = require('child_process');
const vm = require('vm');
const path = require('path');
const fs = require('fs');
const electronLink = require('electron-link');
const {mkdirp} = require('fs-extra');
const excludedModules = {};
const crossArchDirs = ['clang_x86_v8_arm', 'clang_x64_v8_arm64', 'win_clang_x64'];
async function main() {
const baseDirPath = path.resolve(__dirname, '..');
console.log('Creating a linked script..');
const result = await electronLink({
baseDirPath: baseDirPath,
mainPath: `${__dirname}/snapshot-libs.js`,
cachePath: `${baseDirPath}/cache`,
// eslint-disable-next-line no-prototype-builtins
shouldExcludeModule: (modulePath) => excludedModules.hasOwnProperty(modulePath)
});
const snapshotScriptPath = `${baseDirPath}/cache/snapshot-libs.js`;
fs.writeFileSync(snapshotScriptPath, result.snapshotScript);
// Verify if we will be able to use this in `mksnapshot`
vm.runInNewContext(result.snapshotScript, undefined, {filename: snapshotScriptPath, displayErrors: true});
const outputBlobPath = `${baseDirPath}/cache/${process.env.npm_config_arch}`;
await mkdirp(outputBlobPath);
if (process.platform !== 'darwin') {
const mksnapshotBinPath = `${baseDirPath}/node_modules/electron-mksnapshot/bin`;
const matchingDirs = crossArchDirs.map((dir) => `${mksnapshotBinPath}/${dir}`).filter((dir) => fs.existsSync(dir));
for (const dir of matchingDirs) {
if (fs.existsSync(`${mksnapshotBinPath}/gen/v8/embedded.S`)) {
await mkdirp(`${dir}/gen/v8`);
fs.copyFileSync(`${mksnapshotBinPath}/gen/v8/embedded.S`, `${dir}/gen/v8/embedded.S`);
}
}
}
console.log(`Generating startup blob in "${outputBlobPath}"`);
childProcess.execFileSync(
path.resolve(__dirname, '..', 'node_modules', '.bin', 'mksnapshot' + (process.platform === 'win32' ? '.cmd' : '')),
[snapshotScriptPath, '--output_dir', outputBlobPath]
);
}
main().catch((err) => console.error(err));

31
bin/snapshot-libs.js vendored Normal file
View file

@ -0,0 +1,31 @@
require('color-convert');
require('color-string');
require('columnify');
require('lodash');
require('ms');
require('normalize-url');
require('parse-url');
require('php-escape-shell');
require('plist');
require('react-deep-force-update');
require('react-dom');
require('react-redux');
require('react');
require('redux-thunk');
require('redux');
require('reselect');
require('seamless-immutable');
require('stylis');
require('xterm-addon-unicode11');
// eslint-disable-next-line no-constant-condition
if (false) {
require('args');
require('mousetrap');
require('open');
require('xterm-addon-fit');
require('xterm-addon-ligatures');
require('xterm-addon-search');
require('xterm-addon-web-links');
require('xterm-addon-webgl');
require('xterm');
}

View file

@ -2,6 +2,7 @@
"$schema": "http://json.schemastore.org/electron-builder",
"appId": "co.zeit.hyper",
"afterSign": "./bin/notarize.js",
"afterPack": "./bin/cp-snapshot.js",
"directories": {
"app": "target"
},
@ -136,4 +137,4 @@
"ssh"
]
}
}
}

View file

@ -92,6 +92,7 @@ export default class Terms extends React.Component<TermsProps> {
cursorShape: this.props.cursorShape,
cursorBlink: this.props.cursorBlink,
cursorColor: this.props.cursorColor,
cursorAccentColor: this.props.cursorAccentColor,
fontSize: this.props.fontSize,
fontFamily: this.props.fontFamily,
uiFontFamily: this.props.uiFontFamily,

11
lib/hyper.d.ts vendored
View file

@ -7,6 +7,17 @@ declare global {
rpc: Client;
focusActiveTerm: (uid?: string) => void;
}
const snapshotResult: {
customRequire: {
(module: string): NodeModule;
cache: Record<string, {exports: NodeModule}>;
definitions: Record<string, {exports: any}>;
};
setGlobals(global: any, process: any, window: any, document: any, console: any, require: any): void;
};
const __non_webpack_require__: NodeRequire;
}
export type ITermGroup = Immutable<{

View file

@ -1,3 +1,4 @@
import './v8-snapshot-util';
import {webFrame} from 'electron';
import forceUpdate from 'react-deep-force-update';
import {Provider} from 'react-redux';

View file

@ -17,6 +17,6 @@ export function keys(imm: Record<string, any>) {
return keysCache.get(imm);
}
export const ObjectTypedKeys = <T>(obj: T) => {
export const ObjectTypedKeys = <T extends object>(obj: T) => {
return Object.keys(obj) as (keyof T)[];
};

View file

@ -91,7 +91,10 @@ function exposeDecorated<P extends Record<string, any>>(
};
}
function getDecorated<P>(parent: React.ComponentType<P>, name: string): React.ComponentClass<P> {
function getDecorated<P extends Record<string, any>>(
parent: React.ComponentType<P>,
name: string
): React.ComponentClass<P> {
if (!decorated[name]) {
let class_ = exposeDecorated(parent);
(class_ as any).displayName = `_exposeDecorated(${name})`;
@ -136,7 +139,7 @@ function getDecorated<P>(parent: React.ComponentType<P>, name: string): React.Co
// for each component, we return a higher-order component
// that wraps with the higher-order components
// exposed by plugins
export function decorate<P>(
export function decorate<P extends Record<string, any>>(
Component_: React.ComponentType<P>,
name: string
): React.ComponentClass<P, {hasError: boolean}> {
@ -450,7 +453,7 @@ export function getTabProps<T extends Assignable<TabProps, T>>(tab: any, parentP
// connects + decorates a class
// plugins can override mapToState, dispatchToProps
// and the class gets decorated (proxied)
export function connect<stateProps, dispatchProps>(
export function connect<stateProps extends {}, dispatchProps>(
stateFn: (state: HyperState) => stateProps,
dispatchFn: (dispatch: HyperDispatch) => dispatchProps,
c: any,

21
lib/v8-snapshot-util.ts Normal file
View file

@ -0,0 +1,21 @@
if (typeof snapshotResult !== 'undefined') {
const Module = __non_webpack_require__('module');
const originalLoad: (module: string, ...args: any[]) => any = Module._load;
Module._load = function _load(module: string, ...args: any[]): NodeModule {
let cachedModule = snapshotResult.customRequire.cache[module];
if (cachedModule) return cachedModule.exports;
if (snapshotResult.customRequire.definitions[module]) {
cachedModule = {exports: snapshotResult.customRequire(module)};
} else {
cachedModule = {exports: originalLoad(module, ...args)};
}
snapshotResult.customRequire.cache[module] = cachedModule;
return cachedModule.exports;
};
snapshotResult.setGlobals(global, process, window, document, console, global.require);
}

View file

@ -12,10 +12,14 @@
"test:unit": "ava",
"test:unit:watch": "yarn run test:unit -- --watch",
"test:e2e": "ava --config ava-e2e.config.js",
"postinstall": "webpack --config-name hyper-app && electron-builder install-app-deps && yarn run rebuild-node-pty && cpy --cwd=target --parents \"node_modules/**/*\" \"../app/\" && husky install",
"postinstall": "yarn run v8-snapshot && webpack --config-name hyper-app && electron-builder install-app-deps && yarn run rebuild-node-pty && cpy --cwd=target --parents \"node_modules/**/*\" \"../app/\" && husky install",
"rebuild-node-pty": "electron-rebuild -f -o node-pty -m target",
"dist": "yarn run build && cross-env BABEL_ENV=production babel target/renderer/bundle.js --out-file target/renderer/bundle.js --no-comments --minified && electron-builder",
"clean": "node ./bin/rimraf-standalone.js node_modules && node ./bin/rimraf-standalone.js ./app/node_modules && node ./bin/rimraf-standalone.js ./app/renderer"
"clean": "node ./bin/rimraf-standalone.js node_modules && node ./bin/rimraf-standalone.js ./app/node_modules && node ./bin/rimraf-standalone.js ./app/renderer",
"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: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",
"cp-snapshot": "node bin/cp-snapshot.js"
},
"license": "MIT",
"author": {
@ -24,63 +28,63 @@
},
"dependencies": {
"@electron/remote": "2.0.8",
"args": "5.0.1",
"args": "5.0.3",
"chalk": "5.0.1",
"color": "4.2.1",
"color": "4.2.3",
"columnify": "1.6.0",
"css-loader": "6.7.1",
"got": "12.0.3",
"got": "12.3.1",
"json-loader": "0.5.7",
"mousetrap": "chabou/mousetrap#useCapture",
"ms": "2.1.3",
"open": "8.4.0",
"ora": "5.4.1",
"parse-url": "5.0.7",
"parse-url": "7.0.2",
"php-escape-shell": "1.0.0",
"react": "17.0.2",
"react-deep-force-update": "2.1.3",
"react-dom": "17.0.2",
"react-redux": "7.2.8",
"recast": "0.20.5",
"recast": "0.21.2",
"redux": "4.1.2",
"redux-thunk": "2.4.1",
"reselect": "4.1.5",
"reselect": "4.1.6",
"seamless-immutable": "7.1.4",
"semver": "7.3.5",
"semver": "7.3.7",
"shebang-loader": "0.0.1",
"styled-jsx": "5.0.2",
"styled-jsx": "5.0.4",
"stylis": "3.5.4",
"uuid": "8.3.2",
"webpack-cli": "4.9.2",
"xterm": "4.19.0-beta.21",
"webpack-cli": "4.10.0",
"xterm": "4.19.0",
"xterm-addon-fit": "^0.5.0",
"xterm-addon-ligatures": "0.6.0-beta.14",
"xterm-addon-search": "^0.8.2",
"xterm-addon-ligatures": "0.6.0-beta.19",
"xterm-addon-search": "^0.9.0",
"xterm-addon-unicode11": "^0.3.0",
"xterm-addon-web-links": "^0.5.1",
"xterm-addon-webgl": "0.12.0-beta.27"
"xterm-addon-web-links": "^0.6.0",
"xterm-addon-webgl": "0.12.0"
},
"devDependencies": {
"@ava/babel": "2.0.0",
"@ava/typescript": "^3.0.1",
"@babel/cli": "7.17.6",
"@babel/core": "7.17.8",
"@babel/plugin-proposal-class-properties": "^7.16.7",
"@babel/plugin-proposal-numeric-separator": "^7.16.7",
"@babel/plugin-proposal-object-rest-spread": "^7.17.3",
"@babel/plugin-proposal-optional-chaining": "7.16.7",
"@babel/preset-react": "7.16.7",
"@babel/preset-typescript": "7.16.7",
"@babel/cli": "7.18.10",
"@babel/core": "7.18.10",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-numeric-separator": "^7.18.6",
"@babel/plugin-proposal-object-rest-spread": "^7.18.9",
"@babel/plugin-proposal-optional-chaining": "7.18.9",
"@babel/preset-react": "7.18.6",
"@babel/preset-typescript": "7.18.6",
"@types/args": "5.0.0",
"@types/async-retry": "1.4.3",
"@types/color": "3.0.3",
"@types/columnify": "^1.5.1",
"@types/fs-extra": "9.0.13",
"@types/lodash": "^4.14.181",
"@types/lodash": "^4.14.182",
"@types/mkdirp": "1.0.2",
"@types/mousetrap": "1.6.9",
"@types/ms": "0.7.31",
"@types/node": "16.11.21",
"@types/node": "16.11.48",
"@types/pify": "5.0.1",
"@types/plist": "3.0.2",
"@types/react": "^17.0.43",
@ -92,38 +96,40 @@
"@types/uuid": "8.3.4",
"@typescript-eslint/eslint-plugin": "4.33.0",
"@typescript-eslint/parser": "4.33.0",
"ava": "4.1.0",
"babel-loader": "8.2.4",
"concurrently": "7.1.0",
"copy-webpack-plugin": "10.2.4",
"ava": "4.3.1",
"babel-loader": "8.2.5",
"concurrently": "7.3.0",
"copy-webpack-plugin": "11.0.0",
"cpy-cli": "^3.1.1",
"cross-env": "7.0.3",
"electron": "^17.2.0",
"electron-builder": "^22.14.13",
"electron": "19.0.8",
"electron-builder": "^23.3.3",
"electron-devtools-installer": "3.2.0",
"electron-link": "^0.6.0",
"electron-mksnapshot": "20.0.0",
"electron-notarize": "1.2.1",
"electron-rebuild": "3.2.7",
"electron-rebuild": "3.2.9",
"electronmon": "^2.0.2",
"eslint": "7.32.0",
"eslint-config-prettier": "8.5.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-prettier": "4.0.0",
"eslint-plugin-react": "7.29.4",
"husky": "7.0.4",
"inquirer": "8.2.2",
"node-addon-api": "4.3.0",
"node-gyp": "9.0.0",
"eslint-plugin-prettier": "4.2.1",
"eslint-plugin-react": "7.30.1",
"husky": "8.0.1",
"inquirer": "9.1.0",
"node-addon-api": "5.0.0",
"node-gyp": "9.1.0",
"null-loader": "4.0.1",
"playwright": "1.20.2",
"plist": "3.0.5",
"prettier": "2.6.2",
"playwright": "1.25.0",
"plist": "3.0.6",
"prettier": "2.7.1",
"proxyquire": "2.1.3",
"redux-devtools-extension": "2.13.9",
"style-loader": "3.3.1",
"terser": "5.12.1",
"ts-node": "10.7.0",
"typescript": "4.6.3",
"webpack": "5.71.0"
"terser": "5.14.2",
"ts-node": "10.9.1",
"typescript": "4.7.4",
"webpack": "5.74.0"
},
"electronmon": {
"patterns": [

View file

@ -89,6 +89,36 @@ const config: webpack.Configuration[] = [
}
]
},
externals: {
'color-convert': 'require("./node_modules/color-convert/index.js")',
'color-string': 'require("./node_modules/color-string/index.js")',
columnify: 'require("./node_modules/columnify/columnify.js")',
lodash: 'require("./node_modules/lodash/lodash.js")',
ms: 'require("./node_modules/ms/index.js")',
'normalize-url': 'require("./node_modules/normalize-url/index.js")',
'parse-url': 'require("./node_modules/parse-url/lib/index.js")',
'php-escape-shell': 'require("./node_modules/php-escape-shell/php-escape-shell.js")',
plist: 'require("./node_modules/plist/index.js")',
'react-deep-force-update': 'require("./node_modules/react-deep-force-update/lib/index.js")',
'react-dom': 'require("./node_modules/react-dom/index.js")',
'react-redux': 'require("./node_modules/react-redux/lib/index.js")',
react: 'require("./node_modules/react/index.js")',
'redux-thunk': 'require("./node_modules/redux-thunk/lib/index.js")',
redux: 'require("./node_modules/redux/lib/redux.js")',
reselect: 'require("./node_modules/reselect/lib/index.js")',
'seamless-immutable': 'require("./node_modules/seamless-immutable/src/seamless-immutable.js")',
stylis: 'require("./node_modules/stylis/stylis.js")',
'xterm-addon-unicode11': 'require("./node_modules/xterm-addon-unicode11/lib/xterm-addon-unicode11.js")',
args: 'require("./node_modules/args/lib/index.js")',
mousetrap: 'require("./node_modules/mousetrap/mousetrap.js")',
open: 'require("./node_modules/open/index.js")',
'xterm-addon-fit': 'require("./node_modules/xterm-addon-fit/lib/xterm-addon-fit.js")',
'xterm-addon-ligatures': 'require("./node_modules/xterm-addon-ligatures/lib/xterm-addon-ligatures.js")',
'xterm-addon-search': 'require("./node_modules/xterm-addon-search/lib/xterm-addon-search.js")',
'xterm-addon-web-links': 'require("./node_modules/xterm-addon-web-links/lib/xterm-addon-web-links.js")',
'xterm-addon-webgl': 'require("./node_modules/xterm-addon-webgl/lib/xterm-addon-webgl.js")',
xterm: 'require("./node_modules/xterm/lib/xterm.js")'
},
plugins: [
new webpack.IgnorePlugin({resourceRegExp: /.*\.js.map$/i}),

2442
yarn.lock

File diff suppressed because it is too large Load diff