更新前端静态网页获取方式,放弃使用后端获取api

This commit is contained in:
2025-09-09 10:47:51 +08:00
parent 6889ca37e5
commit 44a4f1bae1
25558 changed files with 2463152 additions and 153 deletions

15
frontend/node_modules/foreground-child/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,15 @@
The ISC License
Copyright (c) 2015-2023 Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

128
frontend/node_modules/foreground-child/README.md generated vendored Normal file
View File

@@ -0,0 +1,128 @@
# foreground-child
Run a child as if it's the foreground process. Give it stdio. Exit
when it exits.
Mostly this module is here to support some use cases around
wrapping child processes for test coverage and such. But it's
also generally useful any time you want one program to execute
another as if it's the "main" process, for example, if a program
takes a `--cmd` argument to execute in some way.
## USAGE
```js
import { foregroundChild } from 'foreground-child'
// hybrid module, this also works:
// const { foregroundChild } = require('foreground-child')
// cats out this file
const child = foregroundChild('cat', [__filename])
// At this point, it's best to just do nothing else.
// return or whatever.
// If the child gets a signal, or just exits, then this
// parent process will exit in the same way.
```
You can provide custom spawn options by passing an object after
the program and arguments:
```js
const child = foregroundChild(`cat ${__filename}`, { shell: true })
```
A callback can optionally be provided, if you want to perform an
action before your foreground-child exits:
```js
const child = foregroundChild('cat', [__filename], spawnOptions, () => {
doSomeActions()
})
```
The callback can return a Promise in order to perform
asynchronous actions. If the callback does not return a promise,
then it must complete its actions within a single JavaScript
tick.
```js
const child = foregroundChild('cat', [__filename], async () => {
await doSomeAsyncActions()
})
```
If the callback throws or rejects, then it will be unhandled, and
node will exit in error.
If the callback returns a string value, then that will be used as
the signal to exit the parent process. If it returns a number,
then that number will be used as the parent exit status code. If
it returns boolean `false`, then the parent process will not be
terminated. If it returns `undefined`, then it will exit with the
same signal/code as the child process.
## Caveats
The "normal" standard IO file descriptors (0, 1, and 2 for stdin,
stdout, and stderr respectively) are shared with the child process.
Additionally, if there is an IPC channel set up in the parent, then
messages are proxied to the child on file descriptor 3.
In Node, it's possible to also map arbitrary file descriptors
into a child process. In these cases, foreground-child will not
map the file descriptors into the child. If file descriptors 0,
1, or 2 are used for the IPC channel, then strange behavior may
happen (like printing IPC messages to stderr, for example).
Note that a SIGKILL will always kill the parent process, but
will not proxy the signal to the child process, because SIGKILL
cannot be caught. In order to address this, a special "watchdog"
child process is spawned which will send a SIGKILL to the child
process if it does not terminate within half a second after the
watchdog receives a SIGHUP due to its parent terminating.
On Windows, issuing a `process.kill(process.pid, signal)` with a
fatal termination signal may cause the process to exit with a `1`
status code rather than reporting the signal properly. This
module tries to do the right thing, but on Windows systems, you
may see that incorrect result. There is as far as I'm aware no
workaround for this.
## util: `foreground-child/proxy-signals`
If you just want to proxy the signals to a child process that the
main process receives, you can use the `proxy-signals` export
from this package.
```js
import { proxySignals } from 'foreground-child/proxy-signals'
const childProcess = spawn('command', ['some', 'args'])
proxySignals(childProcess)
```
Now, any fatal signal received by the current process will be
proxied to the child process.
It doesn't go in the other direction; ie, signals sent to the
child process will not affect the parent. For that, listen to the
child `exit` or `close` events, and handle them appropriately.
## util: `foreground-child/watchdog`
If you are spawning a child process, and want to ensure that it
isn't left dangling if the parent process exits, you can use the
watchdog utility exported by this module.
```js
import { watchdog } from 'foreground-child/watchdog'
const childProcess = spawn('command', ['some', 'args'])
const watchdogProcess = watchdog(childProcess)
// watchdogProcess is a reference to the process monitoring the
// parent and child. There's usually no reason to do anything
// with it, as it's silent and will terminate
// automatically when it's no longer needed.
```

View File

@@ -0,0 +1,16 @@
The ISC License
Copyright (c) 2015-2023 Benjamin Coe, Isaac Z. Schlueter, and Contributors
Permission to use, copy, modify, and/or distribute this software
for any purpose with or without fee is hereby granted, provided
that the above copyright notice and this permission notice
appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE
LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View File

@@ -0,0 +1,74 @@
# signal-exit
When you want to fire an event no matter how a process exits:
- reaching the end of execution.
- explicitly having `process.exit(code)` called.
- having `process.kill(pid, sig)` called.
- receiving a fatal signal from outside the process
Use `signal-exit`.
```js
// Hybrid module, either works
import { onExit } from 'signal-exit'
// or:
// const { onExit } = require('signal-exit')
onExit((code, signal) => {
console.log('process exited!', code, signal)
})
```
## API
`remove = onExit((code, signal) => {}, options)`
The return value of the function is a function that will remove
the handler.
Note that the function _only_ fires for signals if the signal
would cause the process to exit. That is, there are no other
listeners, and it is a fatal signal.
If the global `process` object is not suitable for this purpose
(ie, it's unset, or doesn't have an `emit` method, etc.) then the
`onExit` function is a no-op that returns a no-op `remove` method.
### Options
- `alwaysLast`: Run this handler after any other signal or exit
handlers. This causes `process.emit` to be monkeypatched.
### Capturing Signal Exits
If the handler returns an exact boolean `true`, and the exit is a
due to signal, then the signal will be considered handled, and
will _not_ trigger a synthetic `process.kill(process.pid,
signal)` after firing the `onExit` handlers.
In this case, it your responsibility as the caller to exit with a
signal (for example, by calling `process.kill()`) if you wish to
preserve the same exit status that would otherwise have occurred.
If you do not, then the process will likely exit gracefully with
status 0 at some point, assuming that no other terminating signal
or other exit trigger occurs.
Prior to calling handlers, the `onExit` machinery is unloaded, so
any subsequent exits or signals will not be handled, even if the
signal is captured and the exit is thus prevented.
Note that numeric code exits may indicate that the process is
already committed to exiting, for example due to a fatal
exception or unhandled promise rejection, and so there is no way to
prevent it safely.
### Browser Fallback
The `'signal-exit/browser'` module is the same fallback shim that
just doesn't do anything, but presents the same function
interface.
Patches welcome to add something that hooks onto
`window.onbeforeunload` or similar, but it might just not be a
thing that makes sense there.

View File

@@ -0,0 +1,106 @@
{
"name": "signal-exit",
"version": "4.1.0",
"description": "when you want to fire an event no matter how a process exits.",
"main": "./dist/cjs/index.js",
"module": "./dist/mjs/index.js",
"browser": "./dist/mjs/browser.js",
"types": "./dist/mjs/index.d.ts",
"exports": {
".": {
"import": {
"types": "./dist/mjs/index.d.ts",
"default": "./dist/mjs/index.js"
},
"require": {
"types": "./dist/cjs/index.d.ts",
"default": "./dist/cjs/index.js"
}
},
"./signals": {
"import": {
"types": "./dist/mjs/signals.d.ts",
"default": "./dist/mjs/signals.js"
},
"require": {
"types": "./dist/cjs/signals.d.ts",
"default": "./dist/cjs/signals.js"
}
},
"./browser": {
"import": {
"types": "./dist/mjs/browser.d.ts",
"default": "./dist/mjs/browser.js"
},
"require": {
"types": "./dist/cjs/browser.d.ts",
"default": "./dist/cjs/browser.js"
}
}
},
"files": [
"dist"
],
"engines": {
"node": ">=14"
},
"repository": {
"type": "git",
"url": "https://github.com/tapjs/signal-exit.git"
},
"keywords": [
"signal",
"exit"
],
"author": "Ben Coe <ben@npmjs.com>",
"license": "ISC",
"devDependencies": {
"@types/cross-spawn": "^6.0.2",
"@types/node": "^18.15.11",
"@types/signal-exit": "^3.0.1",
"@types/tap": "^15.0.8",
"c8": "^7.13.0",
"prettier": "^2.8.6",
"tap": "^16.3.4",
"ts-node": "^10.9.1",
"typedoc": "^0.23.28",
"typescript": "^5.0.2"
},
"scripts": {
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
"preprepare": "rm -rf dist",
"prepare": "tsc -p tsconfig.json && tsc -p tsconfig-esm.json && bash ./scripts/fixup.sh",
"pretest": "npm run prepare",
"presnap": "npm run prepare",
"test": "c8 tap",
"snap": "c8 tap",
"format": "prettier --write . --loglevel warn",
"typedoc": "typedoc --tsconfig tsconfig-esm.json ./src/*.ts"
},
"prettier": {
"semi": false,
"printWidth": 75,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"jsxSingleQuote": false,
"bracketSameLine": true,
"arrowParens": "avoid",
"endOfLine": "lf"
},
"tap": {
"coverage": false,
"jobs": 1,
"node-arg": [
"--no-warnings",
"--loader",
"ts-node/esm"
],
"ts": false
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
}
}

106
frontend/node_modules/foreground-child/package.json generated vendored Normal file
View File

@@ -0,0 +1,106 @@
{
"name": "foreground-child",
"version": "3.3.1",
"description": "Run a child as if it's the foreground process. Give it stdio. Exit when it exits.",
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"exports": {
"./watchdog": {
"import": {
"types": "./dist/esm/watchdog.d.ts",
"default": "./dist/esm/watchdog.js"
},
"require": {
"types": "./dist/commonjs/watchdog.d.ts",
"default": "./dist/commonjs/watchdog.js"
}
},
"./proxy-signals": {
"import": {
"types": "./dist/esm/proxy-signals.d.ts",
"default": "./dist/esm/proxy-signals.js"
},
"require": {
"types": "./dist/commonjs/proxy-signals.d.ts",
"default": "./dist/commonjs/proxy-signals.js"
}
},
"./package.json": "./package.json",
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
}
},
"files": [
"dist"
],
"engines": {
"node": ">=14"
},
"dependencies": {
"cross-spawn": "^7.0.6",
"signal-exit": "^4.0.1"
},
"scripts": {
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
"prepare": "tshy",
"pretest": "npm run prepare",
"presnap": "npm run prepare",
"test": "tap",
"snap": "tap",
"format": "prettier --write . --log-level warn",
"typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts"
},
"prettier": {
"experimentalTernaries": true,
"semi": false,
"printWidth": 75,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"jsxSingleQuote": false,
"bracketSameLine": true,
"arrowParens": "avoid",
"endOfLine": "lf"
},
"tap": {
"typecheck": true
},
"repository": {
"type": "git",
"url": "git+https://github.com/tapjs/foreground-child.git"
},
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"license": "ISC",
"devDependencies": {
"@types/cross-spawn": "^6.0.2",
"@types/node": "^18.15.11",
"@types/tap": "^15.0.8",
"prettier": "^3.3.2",
"tap": "^21.1.0",
"tshy": "^3.0.2",
"typedoc": "^0.24.2",
"typescript": "^5.0.2"
},
"funding": {
"url": "https://github.com/sponsors/isaacs"
},
"tshy": {
"exports": {
"./watchdog": "./src/watchdog.ts",
"./proxy-signals": "./src/proxy-signals.ts",
"./package.json": "./package.json",
".": "./src/index.ts"
}
},
"type": "module",
"module": "./dist/esm/index.js"
}