-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'refs/remotes/origin/main' into readme
# Conflicts: # README.md
- Loading branch information
Showing
27 changed files
with
4,123 additions
and
1,820 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
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 |
---|---|---|
@@ -0,0 +1,78 @@ | ||
'use strict'; | ||
|
||
/** | ||
* @file Entry point for the library. Exposes the external facing function that | ||
* accepts the input defined in the API documentation. | ||
*/ | ||
|
||
/* eslint-disable */ | ||
|
||
const { OPTIONS } = require('./api-type-definitions.cjs'); | ||
|
||
const validation = require('./src/validation.cjs'); | ||
const getVersionUrl = require('./src/getVersionUrl.cjs'); | ||
const getLatestLocal = require('./src/getLatestLocal.cjs'); | ||
const downloadZip = require('./src/downloadZip.cjs'); | ||
|
||
function stub () {} | ||
|
||
const nwSplasherAutoUpdate = { | ||
/** | ||
* Checks for updates. Downloads zip and extracts it if | ||
* new version is available. Launches a window pointed | ||
* to the latest version. | ||
* | ||
* @param {OPTIONS} options The user's options object | ||
*/ | ||
downloadLatestAppAndOpenWindowInBackground: async function (options) { | ||
// Validate options | ||
options = validation.validateDownloadLatestAppAndOpenWindowInBackgroundOptions(options); | ||
|
||
// Get remote version data | ||
const versionUrlResponse = await getVersionUrl(options); | ||
|
||
// Get latest local | ||
const latestLocal = await getLatestLocal(options); | ||
|
||
// confirm version | ||
const latestRemote = await options.autoUpdate.confirmNewVersion(versionUrlResponse, latestLocal); | ||
|
||
console.log({ latestRemote, latestLocal }); | ||
|
||
// get download path | ||
const downloadPath = await options.autoUpdate.downloadPath(versionUrlResponse); | ||
|
||
// download zip | ||
await downloadZip(options, downloadPath); | ||
|
||
// validate zip | ||
stub(); | ||
|
||
// extract zip | ||
stub(); | ||
|
||
// validate extraction | ||
stub(); | ||
|
||
// Update/Retry/Error/Complete | ||
stub(); | ||
|
||
// close splash | ||
stub(); | ||
|
||
// open app window | ||
stub(); | ||
}, | ||
setCurrentWorkingDirectory: function () {}, | ||
closeSplashAndShowApp: function (options) { | ||
options = { | ||
// Must match the port number used in the splash.html | ||
port: 4443 | ||
}; | ||
}, | ||
deletePastVersions: function () { | ||
console.log('This is a stub'); | ||
} | ||
}; | ||
|
||
module.exports = nwSplasherAutoUpdate; |
This file was deleted.
Oops, something went wrong.
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,50 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Manual test</title> | ||
<style> | ||
body { | ||
background: #333; | ||
color: #CCC; | ||
padding-top: 40px; | ||
text-align: center; | ||
} | ||
button { | ||
background: #888; | ||
border: 0px; | ||
margin-right: 10px; | ||
color: #EEE; | ||
font-size: 40px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<button id="run"> | ||
Run | ||
</button> | ||
<button id="reload"> | ||
Reload | ||
</button> | ||
<script> | ||
nw.Window.get().moveTo(1587, 64); | ||
chrome.developerPrivate.openDevTools({ | ||
renderViewId: -1, | ||
renderProcessId: -1, | ||
extensionId: chrome.runtime.id | ||
}); | ||
|
||
const { manualTesting } = require('./manual-testing.cjs'); | ||
|
||
const runButton = document.getElementById('run'); | ||
const reloadButton = document.getElementById('reload'); | ||
|
||
runButton.addEventListener('click', function () { | ||
manualTesting(); | ||
}); | ||
|
||
reloadButton.addEventListener('click', function () { | ||
nw.Window.get().reloadIgnoringCache(); | ||
}); | ||
</script> | ||
</body> | ||
</html> |
Oops, something went wrong.