forked from vercel/hyper
-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'canary' into built-in-webview
- Loading branch information
Showing
22 changed files
with
2,113 additions
and
1,738 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,5 @@ assets | |
website | ||
bin | ||
dist | ||
target | ||
target | ||
cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ dist | |
app/renderer | ||
target | ||
bin/cli.* | ||
cache | ||
|
||
# dependencies | ||
node_modules | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,18 +101,18 @@ color-string@^1.9.0: | |
color-name "^1.0.0" | ||
simple-swizzle "^0.2.2" | ||
|
||
[email protected].1: | ||
version "4.2.1" | ||
resolved "https://registry.npmjs.org/color/-/color-4.2.1.tgz#498aee5fce7fc982606c8875cab080ac0547c884" | ||
integrity sha512-MFJr0uY4RvTQUKvPq7dh9grVOTYSFeXja2mBXioCGjnjJoXrAp9jJ1NQTDR73c9nwBSAQiNKloKl5zq9WB9UPw== | ||
[email protected].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 @@ [email protected]: | |
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" | ||
|
||
[email protected].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== | ||
[email protected].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" | ||
|
||
[email protected].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== | ||
[email protected].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" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
Oops, something went wrong.