Last commit july 5th

This commit is contained in:
2024-07-05 13:46:23 +02:00
parent dad0d86e8c
commit b0e4dfbb76
24982 changed files with 2621219 additions and 413 deletions

14
spa/node_modules/read-cmd-shim/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,14 @@
Copyright (c) 2015, Rebecca Turner <me@re-becca.org>
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.

36
spa/node_modules/read-cmd-shim/README.md generated vendored Normal file
View File

@@ -0,0 +1,36 @@
# read-cmd-shim
Figure out what a [`cmd-shim`](https://github.com/ForbesLindesay/cmd-shim)
is pointing at. This acts as the equivalent of
[`fs.readlink`](https://nodejs.org/api/fs.html#fs_fs_readlink_path_callback).
### Usage
```
const readCmdShim = require('read-cmd-shim')
readCmdShim('/path/to/shim.cmd').then(destination => {
})
const destination = readCmdShim.sync('/path/to/shim.cmd')
```
### readCmdShim(path) -> Promise
Reads the `cmd-shim` located at `path` and resolves with the _relative_
path that the shim points at. Consider this as roughly the equivalent of
`fs.readlink`.
This can read both `.cmd` style that are run by the Windows Command Prompt
and Powershell, and the kind without any extension that are used by Cygwin.
This can return errors that `fs.readFile` returns, except that they'll
include a stack trace from where `readCmdShim` was called. Plus it can
return a special `ENOTASHIM` exception, when it can't find a cmd-shim in the
file referenced by `path`. This should only happen if you pass in a
non-command shim.
### readCmdShim.sync(path)
Same as above but synchronous. Errors are thrown.

75
spa/node_modules/read-cmd-shim/lib/index.js generated vendored Normal file
View File

@@ -0,0 +1,75 @@
const fs = require('fs')
const { promisify } = require('util')
const { readFileSync } = fs
const readFile = promisify(fs.readFile)
const extractPath = (path, cmdshimContents) => {
if (/[.]cmd$/.test(path)) {
return extractPathFromCmd(cmdshimContents)
} else if (/[.]ps1$/.test(path)) {
return extractPathFromPowershell(cmdshimContents)
} else {
return extractPathFromCygwin(cmdshimContents)
}
}
const extractPathFromPowershell = cmdshimContents => {
const matches = cmdshimContents.match(/"[$]basedir[/]([^"]+?)"\s+[$]args/)
return matches && matches[1]
}
const extractPathFromCmd = cmdshimContents => {
const matches = cmdshimContents.match(/"%(?:~dp0|dp0%)\\([^"]+?)"\s+%[*]/)
return matches && matches[1]
}
const extractPathFromCygwin = cmdshimContents => {
const matches = cmdshimContents.match(/"[$]basedir[/]([^"]+?)"\s+"[$]@"/)
return matches && matches[1]
}
const wrapError = (thrown, newError) => {
newError.message = thrown.message
newError.code = thrown.code
newError.path = thrown.path
return newError
}
const notaShim = (path, er) => {
if (!er) {
er = new Error()
Error.captureStackTrace(er, notaShim)
}
er.code = 'ENOTASHIM'
er.message = `Can't read shim path from '${path}', ` +
`it doesn't appear to be a cmd-shim`
return er
}
const readCmdShim = path => {
// create a new error to capture the stack trace from this point,
// instead of getting some opaque stack into node's internals
const er = new Error()
Error.captureStackTrace(er, readCmdShim)
return readFile(path).then(contents => {
const destination = extractPath(path, contents.toString())
if (destination) {
return destination
}
throw notaShim(path, er)
}, readFileEr => {
throw wrapError(readFileEr, er)
})
}
const readCmdShimSync = path => {
const contents = readFileSync(path)
const destination = extractPath(path, contents.toString())
if (!destination) {
throw notaShim(path)
}
return destination
}
readCmdShim.sync = readCmdShimSync
module.exports = readCmdShim

47
spa/node_modules/read-cmd-shim/package.json generated vendored Normal file
View File

@@ -0,0 +1,47 @@
{
"name": "read-cmd-shim",
"version": "4.0.0",
"description": "Figure out what a cmd-shim is pointing at. This acts as the equivalent of fs.readlink.",
"main": "lib/index.js",
"devDependencies": {
"@npmcli/eslint-config": "^3.0.1",
"@npmcli/template-oss": "4.5.1",
"cmd-shim": "^5.0.0",
"rimraf": "^3.0.0",
"tap": "^16.0.1"
},
"scripts": {
"test": "tap",
"lint": "eslint \"**/*.js\"",
"postlint": "template-oss-check",
"template-oss-apply": "template-oss-apply --force",
"lintfix": "npm run lint -- --fix",
"snap": "tap",
"posttest": "npm run lint"
},
"tap": {
"check-coverage": true,
"nyc-arg": [
"--exclude",
"tap-snapshots/**"
]
},
"repository": {
"type": "git",
"url": "https://github.com/npm/read-cmd-shim.git"
},
"license": "ISC",
"homepage": "https://github.com/npm/read-cmd-shim#readme",
"files": [
"bin/",
"lib/"
],
"author": "GitHub Inc.",
"engines": {
"node": "^14.17.0 || ^16.13.0 || >=18.0.0"
},
"templateOSS": {
"//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
"version": "4.5.1"
}
}