mirror of
https://github.com/koush/scrypted.git
synced 2026-07-08 08:10:37 +01:00
core: use npms cdn endpoint to avoid going through server.
This commit is contained in:
@@ -1,15 +1,3 @@
|
||||
# Scrypted Core plugin. Provides the UI, websocket, and engine.io APIs.
|
||||
# Scrypted Web UI Plugin
|
||||
|
||||
## npm commands
|
||||
* npm run scrypted-webpack
|
||||
* npm run scrypted-deploy <ipaddress>
|
||||
* npm run scrypted-debug <ipaddress>
|
||||
|
||||
## scrypted distribution via npm
|
||||
1. Ensure package.json is set up properly for publishing on npm.
|
||||
2. npm publish
|
||||
|
||||
## Visual Studio Code configuration
|
||||
|
||||
* If using a remote server, edit [.vscode/settings.json](blob/master/.vscode/settings.json) to specify the IP Address of the Scrypted server.
|
||||
* Launch Scrypted Debugger from the launch menu.
|
||||
The Core Plugin provides the web UI for Scrypted.
|
||||
|
||||
4
plugins/core/package-lock.json
generated
4
plugins/core/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/core",
|
||||
"version": "0.0.172",
|
||||
"version": "0.0.174",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/core",
|
||||
"version": "0.0.172",
|
||||
"version": "0.0.174",
|
||||
"license": "Apache-2.0",
|
||||
"dependencies": {
|
||||
"@koush/wrtc": "^0.5.0",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@scrypted/core",
|
||||
"version": "0.0.172",
|
||||
"version": "0.0.174",
|
||||
"description": "Scrypted Core plugin. Provides the UI, websocket, and engine.io APIs.",
|
||||
"author": "Scrypted",
|
||||
"license": "Apache-2.0",
|
||||
|
||||
@@ -100,7 +100,7 @@ export default {
|
||||
doSearch: debounce(function () {
|
||||
axios
|
||||
.get(
|
||||
`${getComponentWebPath("script")}/search?text=keywords:scrypted+${
|
||||
`https://registry.npmjs.org/-/v1/search?text=keywords:scrypted+${
|
||||
this.search
|
||||
}`
|
||||
)
|
||||
|
||||
@@ -10,7 +10,12 @@ export interface PluginUpdateCheck {
|
||||
}
|
||||
|
||||
export async function checkUpdate(npmPackage: string, npmPackageVersion: string): Promise<PluginUpdateCheck> {
|
||||
const response = await axios.get(`${componentPath}/npm/${npmPackage}`);
|
||||
// const response = await axios.get(`${componentPath}/npm/${npmPackage}`);
|
||||
// registry.npmjs.org does not support CORS on the package endpoints.
|
||||
// open issue:
|
||||
// https://github.com/npm/feedback/discussions/117
|
||||
// npmjs.cf is an unofficial CDN that provides it
|
||||
const response = await axios.get(`https://registry.npmjs.cf/${npmPackage}`);
|
||||
const { data } = response;
|
||||
const versions = Object.values(data.versions).sort((a: any, b: any) => semver.compare(a.version, b.version)).reverse();
|
||||
let updateAvailable: any;
|
||||
|
||||
Reference in New Issue
Block a user