Website Structure
This commit is contained in:
parent
62812f2090
commit
71f0676a62
22365 changed files with 4265753 additions and 791 deletions
68
Frontend-Learner/node_modules/listhen/LICENSE
generated
vendored
Normal file
68
Frontend-Learner/node_modules/listhen/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Pooya Parsa <pooya@pi0.io>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
---
|
||||
|
||||
src/lib/open forked from https://github.com/sindresorhus/open
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
---
|
||||
|
||||
src/lib/xdg-open
|
||||
|
||||
Utility script to open a URL in the registered default application.
|
||||
|
||||
Refer to the usage() function below for usage.
|
||||
|
||||
Copyright 2009-2010, Fathi Boudra <fabo@freedesktop.org>
|
||||
Copyright 2009-2010, Rex Dieter <rdieter@fedoraproject.org>
|
||||
Copyright 2006, Kevin Krammer <kevin.krammer@gmx.at>
|
||||
Copyright 2006, Jeremy White <jwhite@codeweavers.com>
|
||||
|
||||
LICENSE:
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the "Software"),
|
||||
to deal in the Software without restriction, including without limitation
|
||||
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
and/or sell copies of the Software, and to permit persons to whom the
|
||||
Software is furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
231
Frontend-Learner/node_modules/listhen/README.md
generated
vendored
Normal file
231
Frontend-Learner/node_modules/listhen/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,231 @@
|
|||
# 👂 listhen
|
||||
|
||||
<!-- automd:badges -->
|
||||
|
||||
[](https://npmjs.com/package/listhen)
|
||||
[](https://npmjs.com/package/listhen)
|
||||
|
||||
<!-- /automd -->
|
||||
|
||||
Elegant HTTP listener!
|
||||
|
||||
[👉 Online Playground](https://stackblitz.com/github/unjs/listhen/tree/main/playground?startScript=dev)
|
||||
|
||||
## Features
|
||||
|
||||
✅ Dev server with HMR, static, WebSockets and TypeScript support with <a href="https://github.com/unjs/jiti">unjs/jiti</a><br>
|
||||
|
||||
✅ Works with Node.js, Express, and <a href="https://github.com/unjs/h3">unjs/h3</a> out of the box <br>
|
||||
|
||||
✅ Show the QR code of the public URL with <a href="https://github.com/unjs/uqr">unjs/uqr</a><br>
|
||||
|
||||
✅ Tunnel your local server to the world with <a href="https://github.com/unjs/untun">unjs/untun</a><br>
|
||||
|
||||
✅ Assign a port or fallback to a nicer alternative with <a href="https://github.com/unjs/get-port-please">unjs/get-port-please</a>
|
||||
|
||||
✅ Gracefully shutdown Server with <a href="https://github.com/thedillonb/http-shutdown">http-shutdown</a><br>
|
||||
|
||||
✅ Zero Config WebSockets with <a href="https://github.com/unjs/crossws">unjs/crossws</a>
|
||||
|
||||
✅ Copy the URL to the clipboard<br>
|
||||
|
||||
✅ HTTPS support with self-signed certificates<br>
|
||||
|
||||
✅ Open URL in browser<br>
|
||||
|
||||
✅ Detect test and production environments to auto-adjust behavior<br>
|
||||
|
||||
✅ Close on the exit signal<br>
|
||||
|
||||
<div align="center">
|
||||
<img width="100%" src="./.assets/screenshot.png">
|
||||
</div>
|
||||
|
||||
## Quick Usage (CLI)
|
||||
|
||||
You can run your applications in localhost with TypeScript support and watch mode using `listhen` CLI:
|
||||
|
||||
Create `index.ts`:
|
||||
|
||||
```ts
|
||||
export default (req, res) => {
|
||||
res.end("Hello World!");
|
||||
};
|
||||
```
|
||||
|
||||
or using [unjs/h3](https://github.com/unjs/h3):
|
||||
|
||||
```ts
|
||||
import { createApp, eventHandler } from "h3";
|
||||
|
||||
export const app = createApp();
|
||||
|
||||
app.use(
|
||||
"/",
|
||||
eventHandler(() => "Hello world!"),
|
||||
);
|
||||
```
|
||||
|
||||
or use npx to invoke `listhen` command:
|
||||
|
||||
```sh
|
||||
npx listhen -w ./index.ts
|
||||
```
|
||||
|
||||
## Usage (API)
|
||||
|
||||
Install package:
|
||||
|
||||
```bash
|
||||
# pnpm
|
||||
pnpm i listhen
|
||||
|
||||
# npm
|
||||
npm i listhen
|
||||
|
||||
# yarn
|
||||
yarn add listhen
|
||||
|
||||
```
|
||||
|
||||
Import into your Node.js project:
|
||||
|
||||
```js
|
||||
// CommonJS
|
||||
const { listen, listenAndWatch } = require("listhen");
|
||||
|
||||
// ESM
|
||||
import { listen, listenAndWatch } from "listhen";
|
||||
```
|
||||
|
||||
```ts
|
||||
const handler = (req, res) => {
|
||||
res.end("Hi!")
|
||||
}
|
||||
|
||||
// listener: { url, getURL, server, close, ... }
|
||||
const listener = await listen(handler, options)
|
||||
```
|
||||
|
||||
## Options
|
||||
|
||||
### `port`
|
||||
|
||||
- Default: `process.env.PORT` or 3000 or memorized random (see [get-port-please](https://github.com/unjs/get-port-please))
|
||||
|
||||
Port to listen.
|
||||
|
||||
### `hostname`
|
||||
|
||||
- Default: `process.env.HOST || '0.0.0.0'`
|
||||
|
||||
Default hostname to listen.
|
||||
|
||||
### `https`
|
||||
|
||||
- Type: Boolean | Object
|
||||
- Default: `false`
|
||||
|
||||
Listen on HTTPS with SSL enabled.
|
||||
|
||||
#### Self-Signed Certificate
|
||||
|
||||
By setting `https: true`, listhen will use an auto-generated self-signed certificate.
|
||||
|
||||
You can set https to an object for custom options. Possible options:
|
||||
|
||||
- `domains`: (Array) Default is `['localhost', '127.0.0.1', '::1']`.
|
||||
- `validityDays`: (Number) Default is `1`.
|
||||
|
||||
#### User-Provided Certificate
|
||||
|
||||
Set `https: { cert, key }` where the cert and key are paths to the SSL certificates.
|
||||
With an encrypted private key, you also need to set `passphrase` on the `https` object.
|
||||
|
||||
To provide a certificate stored in a keystore set `https: { pfx }` with a path to the keystore.
|
||||
When the keystore is password protected also set `passphrase`.
|
||||
|
||||
You can also provide an inline cert and key instead of reading from the filesystem. In this case, they should start with `--`.
|
||||
|
||||
### `showURL`
|
||||
|
||||
- Default: `true` (force disabled on a test environment)
|
||||
|
||||
Show a CLI message for the listening URL.
|
||||
|
||||
### `baseURL`
|
||||
|
||||
- Default: `/`
|
||||
|
||||
### `open`
|
||||
|
||||
- Default: `false` (force disabled on test and production environments)
|
||||
|
||||
Open the URL in the browser. Silently ignores errors.
|
||||
|
||||
### `clipboard`
|
||||
|
||||
- Default: `false` (force disabled on test and production environments)
|
||||
|
||||
Copy the URL to the clipboard. Silently ignores errors.
|
||||
|
||||
### `isTest`
|
||||
|
||||
- Default: `process.env.NODE_ENV === 'test'`
|
||||
|
||||
Detect if running in a test environment to disable some features.
|
||||
|
||||
### `autoClose`
|
||||
|
||||
- Default: `true`
|
||||
|
||||
Automatically close when an `exit` event, `SIGTERM`, `SIGINT` or `SIGHUP` signal is received in the process.
|
||||
|
||||
### `publicURL`
|
||||
|
||||
- Default: (the first public URL listening)
|
||||
|
||||
The public URL to show in the CLI output
|
||||
|
||||
### `qr`
|
||||
|
||||
- Default: `true`
|
||||
|
||||
Print QR Code for public address.
|
||||
|
||||
### `public`
|
||||
|
||||
- Default: `false` for development or when `hostname` is `localhost` and `true` for production
|
||||
|
||||
When enabled, listhen tries to listen to all network interfaces. You can also enable this option using `--host` CLI flag.
|
||||
|
||||
### `ws`
|
||||
|
||||
- Default: `false`
|
||||
|
||||
Enable experimental WebSocket support using [unjs/crossws](https://crossws.unjs.io/) or node upgrade handler.
|
||||
|
||||
Option can be a function for Node.js `upgrade` handler (`(req, head) => void`) or an Object to use [CrossWS Hooks](https://crossws.unjs.io/guide/api).
|
||||
|
||||
When using dev server CLI, you can easily use `--ws` and a named export called `websocket` to define [CrossWS Hooks](https://github.com/unjs/crossws) with HMR support!
|
||||
|
||||
## License
|
||||
|
||||
<!-- automd:contributors license=MIT author="pi0" -->
|
||||
|
||||
Published under the [MIT](https://github.com/unjs/listhen/blob/main/LICENSE) license.
|
||||
Made by [@pi0](https://github.com/pi0) and [community](https://github.com/unjs/listhen/graphs/contributors) 💛
|
||||
<br><br>
|
||||
<a href="https://github.com/unjs/listhen/graphs/contributors">
|
||||
<img src="https://contrib.rocks/image?repo=unjs/listhen" />
|
||||
</a>
|
||||
|
||||
<!-- /automd -->
|
||||
|
||||
<!-- automd:with-automd -->
|
||||
|
||||
---
|
||||
|
||||
_🤖 auto updated with [automd](https://automd.unjs.io)_
|
||||
|
||||
<!-- /automd -->
|
||||
5
Frontend-Learner/node_modules/listhen/bin/listhen.mjs
generated
vendored
Normal file
5
Frontend-Learner/node_modules/listhen/bin/listhen.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
import { runMain } from "../dist/cli.mjs";
|
||||
|
||||
runMain();
|
||||
1
Frontend-Learner/node_modules/listhen/cli.d.ts
generated
vendored
Normal file
1
Frontend-Learner/node_modules/listhen/cli.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export * from './dist/cli'
|
||||
1071
Frontend-Learner/node_modules/listhen/dist/chunks/xdg-open.cjs
generated
vendored
Normal file
1071
Frontend-Learner/node_modules/listhen/dist/chunks/xdg-open.cjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
1069
Frontend-Learner/node_modules/listhen/dist/chunks/xdg-open.mjs
generated
vendored
Normal file
1069
Frontend-Learner/node_modules/listhen/dist/chunks/xdg-open.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
177
Frontend-Learner/node_modules/listhen/dist/cli.cjs
generated
vendored
Normal file
177
Frontend-Learner/node_modules/listhen/dist/cli.cjs
generated
vendored
Normal file
|
|
@ -0,0 +1,177 @@
|
|||
'use strict';
|
||||
|
||||
const citty = require('citty');
|
||||
const pathe = require('pathe');
|
||||
const index = require('./index.cjs');
|
||||
require('node:http');
|
||||
require('node:https');
|
||||
require('node:util');
|
||||
require('get-port-please');
|
||||
require('http-shutdown');
|
||||
require('consola');
|
||||
require('defu');
|
||||
require('consola/utils');
|
||||
require('uqr');
|
||||
require('node:child_process');
|
||||
require('node:fs');
|
||||
require('node:os');
|
||||
require('node:path');
|
||||
require('std-env');
|
||||
require('node-forge');
|
||||
require('node:fs/promises');
|
||||
require('mlly');
|
||||
|
||||
const name = "listhen";
|
||||
const version = "1.8.0";
|
||||
const description = "👂 Elegant HTTP Listener";
|
||||
|
||||
const main = citty.defineCommand({
|
||||
meta: {
|
||||
name,
|
||||
description,
|
||||
version
|
||||
},
|
||||
args: {
|
||||
cwd: {
|
||||
type: "string",
|
||||
description: "Current working directory"
|
||||
},
|
||||
entry: {
|
||||
type: "positional",
|
||||
description: "Listener entry file (./app.ts)",
|
||||
required: true
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
description: "Name to use in the banner"
|
||||
},
|
||||
baseURL: {
|
||||
type: "string",
|
||||
description: "Base URL to use"
|
||||
},
|
||||
watch: {
|
||||
type: "boolean",
|
||||
description: "Watch for changes",
|
||||
alias: "w"
|
||||
},
|
||||
ws: {
|
||||
type: "boolean",
|
||||
description: "Enable Experimental WebSocket support"
|
||||
},
|
||||
...getArgs()
|
||||
},
|
||||
async run({ args }) {
|
||||
const opts = {
|
||||
...args,
|
||||
...parseArgs(args),
|
||||
baseURL: args.baseURL,
|
||||
name: args.name
|
||||
};
|
||||
const entry = pathe.isAbsolute(args.entry) || args.entry.startsWith(".") ? args.entry : `./${args.entry}`;
|
||||
if (args.watch) {
|
||||
await index.listenAndWatch(entry, opts);
|
||||
} else {
|
||||
const devServer = await index.createDevServer(entry, opts);
|
||||
await index.listen(devServer.nodeListener, {
|
||||
...opts,
|
||||
_entry: devServer._entry,
|
||||
ws: opts.ws ? devServer._ws : void 0
|
||||
});
|
||||
await devServer.reload(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
const runMain = () => citty.runMain(main);
|
||||
function getArgs() {
|
||||
return {
|
||||
port: {
|
||||
type: "string",
|
||||
description: "Port to listen on (use `PORT` environment variable to override)"
|
||||
},
|
||||
host: {
|
||||
description: "Host to listen on. If no value or an empty string provided, will listen on all available interfaces (use `HOST` environment variable to override)"
|
||||
},
|
||||
clipboard: {
|
||||
type: "boolean",
|
||||
description: "Copy the URL to the clipboard"
|
||||
},
|
||||
open: {
|
||||
type: "boolean",
|
||||
description: "Open the URL in the browser"
|
||||
},
|
||||
https: {
|
||||
type: "boolean",
|
||||
description: "Enable HTTPS"
|
||||
},
|
||||
"https.cert": {
|
||||
type: "string",
|
||||
description: "Path to TLS certificate used with HTTPS in PEM format"
|
||||
},
|
||||
"https.key": {
|
||||
type: "string",
|
||||
description: "Path to TLS key used with HTTPS in PEM format"
|
||||
},
|
||||
"https.pfx": {
|
||||
type: "string",
|
||||
description: "Path to PKCS#12 (.p12/.pfx) keystore containing a TLS certificate and Key"
|
||||
},
|
||||
"https.passphrase": {
|
||||
type: "string",
|
||||
description: "Passphrase used for TLS key or keystore"
|
||||
},
|
||||
"https.validityDays": {
|
||||
type: "string",
|
||||
description: "Validity in days of the autogenerated TLS certificate (https: true)"
|
||||
},
|
||||
"https.domains": {
|
||||
type: "string",
|
||||
description: "Comma seperated list of domains and IPs, the autogenerated certificate should be valid for (https: true)"
|
||||
},
|
||||
publicURL: {
|
||||
type: "string",
|
||||
description: "Displayed public URL (used for QR code)",
|
||||
required: false
|
||||
},
|
||||
qr: {
|
||||
type: "boolean",
|
||||
description: "Display The QR code of public URL when available",
|
||||
required: false
|
||||
},
|
||||
public: {
|
||||
type: "boolean",
|
||||
description: "Listen to all network interfaces",
|
||||
required: false
|
||||
},
|
||||
tunnel: {
|
||||
type: "boolean",
|
||||
description: "Open a tunnel using https://github.com/unjs/untun",
|
||||
required: false
|
||||
}
|
||||
};
|
||||
}
|
||||
function parseArgs(args) {
|
||||
return {
|
||||
port: args.port,
|
||||
// prettier-ignore
|
||||
hostname: typeof args.host === "string" ? args.host : args.host === true ? "" : void 0,
|
||||
clipboard: args.clipboard,
|
||||
open: args.open,
|
||||
qr: args.qr,
|
||||
publicURL: args.publicURL,
|
||||
public: args.public,
|
||||
tunnel: args.tunnel,
|
||||
https: args.https ? {
|
||||
cert: args["https.cert"],
|
||||
key: args["https.key"],
|
||||
pfx: args["https.pfx"],
|
||||
passphrase: args["https.passphrase"],
|
||||
validityDays: args["https.validityDays"] ? +args["https.validityDays"] : void 0,
|
||||
domains: args["https.domains"] ? args["https.domains"].split(",") : void 0
|
||||
} : false
|
||||
};
|
||||
}
|
||||
|
||||
exports.getArgs = getArgs;
|
||||
exports.main = main;
|
||||
exports.parseArgs = parseArgs;
|
||||
exports.runMain = runMain;
|
||||
172
Frontend-Learner/node_modules/listhen/dist/cli.d.cts
generated
vendored
Normal file
172
Frontend-Learner/node_modules/listhen/dist/cli.d.cts
generated
vendored
Normal file
|
|
@ -0,0 +1,172 @@
|
|||
import * as citty from 'citty';
|
||||
import { ParsedArgs } from 'citty';
|
||||
import { L as ListenOptions } from './shared/listhen.1c46e31d.cjs';
|
||||
import 'node:http';
|
||||
import 'node:https';
|
||||
import 'node:net';
|
||||
import 'get-port-please';
|
||||
import 'crossws/adapters/node';
|
||||
|
||||
declare const main: citty.CommandDef<{
|
||||
port: {
|
||||
readonly type: "string";
|
||||
readonly description: "Port to listen on (use `PORT` environment variable to override)";
|
||||
};
|
||||
host: {
|
||||
readonly description: "Host to listen on. If no value or an empty string provided, will listen on all available interfaces (use `HOST` environment variable to override)";
|
||||
};
|
||||
clipboard: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Copy the URL to the clipboard";
|
||||
};
|
||||
open: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Open the URL in the browser";
|
||||
};
|
||||
https: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Enable HTTPS";
|
||||
};
|
||||
"https.cert": {
|
||||
readonly type: "string";
|
||||
readonly description: "Path to TLS certificate used with HTTPS in PEM format";
|
||||
};
|
||||
"https.key": {
|
||||
readonly type: "string";
|
||||
readonly description: "Path to TLS key used with HTTPS in PEM format";
|
||||
};
|
||||
"https.pfx": {
|
||||
readonly type: "string";
|
||||
readonly description: "Path to PKCS#12 (.p12/.pfx) keystore containing a TLS certificate and Key";
|
||||
};
|
||||
"https.passphrase": {
|
||||
readonly type: "string";
|
||||
readonly description: "Passphrase used for TLS key or keystore";
|
||||
};
|
||||
"https.validityDays": {
|
||||
readonly type: "string";
|
||||
readonly description: "Validity in days of the autogenerated TLS certificate (https: true)";
|
||||
};
|
||||
"https.domains": {
|
||||
readonly type: "string";
|
||||
readonly description: "Comma seperated list of domains and IPs, the autogenerated certificate should be valid for (https: true)";
|
||||
};
|
||||
publicURL: {
|
||||
readonly type: "string";
|
||||
readonly description: "Displayed public URL (used for QR code)";
|
||||
readonly required: false;
|
||||
};
|
||||
qr: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Display The QR code of public URL when available";
|
||||
readonly required: false;
|
||||
};
|
||||
public: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Listen to all network interfaces";
|
||||
readonly required: false;
|
||||
};
|
||||
tunnel: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Open a tunnel using https://github.com/unjs/untun";
|
||||
readonly required: false;
|
||||
};
|
||||
cwd: {
|
||||
type: "string";
|
||||
description: string;
|
||||
};
|
||||
entry: {
|
||||
type: "positional";
|
||||
description: string;
|
||||
required: true;
|
||||
};
|
||||
name: {
|
||||
type: "string";
|
||||
description: string;
|
||||
};
|
||||
baseURL: {
|
||||
type: "string";
|
||||
description: string;
|
||||
};
|
||||
watch: {
|
||||
type: "boolean";
|
||||
description: string;
|
||||
alias: string;
|
||||
};
|
||||
ws: {
|
||||
type: "boolean";
|
||||
description: string;
|
||||
};
|
||||
}>;
|
||||
declare const runMain: () => Promise<void>;
|
||||
/** Returns unjs/citty compatible args object */
|
||||
declare function getArgs(): {
|
||||
readonly port: {
|
||||
readonly type: "string";
|
||||
readonly description: "Port to listen on (use `PORT` environment variable to override)";
|
||||
};
|
||||
readonly host: {
|
||||
readonly description: "Host to listen on. If no value or an empty string provided, will listen on all available interfaces (use `HOST` environment variable to override)";
|
||||
};
|
||||
readonly clipboard: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Copy the URL to the clipboard";
|
||||
};
|
||||
readonly open: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Open the URL in the browser";
|
||||
};
|
||||
readonly https: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Enable HTTPS";
|
||||
};
|
||||
readonly "https.cert": {
|
||||
readonly type: "string";
|
||||
readonly description: "Path to TLS certificate used with HTTPS in PEM format";
|
||||
};
|
||||
readonly "https.key": {
|
||||
readonly type: "string";
|
||||
readonly description: "Path to TLS key used with HTTPS in PEM format";
|
||||
};
|
||||
readonly "https.pfx": {
|
||||
readonly type: "string";
|
||||
readonly description: "Path to PKCS#12 (.p12/.pfx) keystore containing a TLS certificate and Key";
|
||||
};
|
||||
readonly "https.passphrase": {
|
||||
readonly type: "string";
|
||||
readonly description: "Passphrase used for TLS key or keystore";
|
||||
};
|
||||
readonly "https.validityDays": {
|
||||
readonly type: "string";
|
||||
readonly description: "Validity in days of the autogenerated TLS certificate (https: true)";
|
||||
};
|
||||
readonly "https.domains": {
|
||||
readonly type: "string";
|
||||
readonly description: "Comma seperated list of domains and IPs, the autogenerated certificate should be valid for (https: true)";
|
||||
};
|
||||
readonly publicURL: {
|
||||
readonly type: "string";
|
||||
readonly description: "Displayed public URL (used for QR code)";
|
||||
readonly required: false;
|
||||
};
|
||||
readonly qr: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Display The QR code of public URL when available";
|
||||
readonly required: false;
|
||||
};
|
||||
readonly public: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Listen to all network interfaces";
|
||||
readonly required: false;
|
||||
};
|
||||
readonly tunnel: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Open a tunnel using https://github.com/unjs/untun";
|
||||
readonly required: false;
|
||||
};
|
||||
};
|
||||
type ParsedListhenArgs = ParsedArgs<ReturnType<typeof getArgs>>;
|
||||
/** Convert unjs/citty compatible args to listhen options */
|
||||
declare function parseArgs(args: ParsedListhenArgs): Partial<ListenOptions>;
|
||||
|
||||
export { getArgs, main, parseArgs, runMain };
|
||||
172
Frontend-Learner/node_modules/listhen/dist/cli.d.mts
generated
vendored
Normal file
172
Frontend-Learner/node_modules/listhen/dist/cli.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,172 @@
|
|||
import * as citty from 'citty';
|
||||
import { ParsedArgs } from 'citty';
|
||||
import { L as ListenOptions } from './shared/listhen.1c46e31d.mjs';
|
||||
import 'node:http';
|
||||
import 'node:https';
|
||||
import 'node:net';
|
||||
import 'get-port-please';
|
||||
import 'crossws/adapters/node';
|
||||
|
||||
declare const main: citty.CommandDef<{
|
||||
port: {
|
||||
readonly type: "string";
|
||||
readonly description: "Port to listen on (use `PORT` environment variable to override)";
|
||||
};
|
||||
host: {
|
||||
readonly description: "Host to listen on. If no value or an empty string provided, will listen on all available interfaces (use `HOST` environment variable to override)";
|
||||
};
|
||||
clipboard: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Copy the URL to the clipboard";
|
||||
};
|
||||
open: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Open the URL in the browser";
|
||||
};
|
||||
https: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Enable HTTPS";
|
||||
};
|
||||
"https.cert": {
|
||||
readonly type: "string";
|
||||
readonly description: "Path to TLS certificate used with HTTPS in PEM format";
|
||||
};
|
||||
"https.key": {
|
||||
readonly type: "string";
|
||||
readonly description: "Path to TLS key used with HTTPS in PEM format";
|
||||
};
|
||||
"https.pfx": {
|
||||
readonly type: "string";
|
||||
readonly description: "Path to PKCS#12 (.p12/.pfx) keystore containing a TLS certificate and Key";
|
||||
};
|
||||
"https.passphrase": {
|
||||
readonly type: "string";
|
||||
readonly description: "Passphrase used for TLS key or keystore";
|
||||
};
|
||||
"https.validityDays": {
|
||||
readonly type: "string";
|
||||
readonly description: "Validity in days of the autogenerated TLS certificate (https: true)";
|
||||
};
|
||||
"https.domains": {
|
||||
readonly type: "string";
|
||||
readonly description: "Comma seperated list of domains and IPs, the autogenerated certificate should be valid for (https: true)";
|
||||
};
|
||||
publicURL: {
|
||||
readonly type: "string";
|
||||
readonly description: "Displayed public URL (used for QR code)";
|
||||
readonly required: false;
|
||||
};
|
||||
qr: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Display The QR code of public URL when available";
|
||||
readonly required: false;
|
||||
};
|
||||
public: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Listen to all network interfaces";
|
||||
readonly required: false;
|
||||
};
|
||||
tunnel: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Open a tunnel using https://github.com/unjs/untun";
|
||||
readonly required: false;
|
||||
};
|
||||
cwd: {
|
||||
type: "string";
|
||||
description: string;
|
||||
};
|
||||
entry: {
|
||||
type: "positional";
|
||||
description: string;
|
||||
required: true;
|
||||
};
|
||||
name: {
|
||||
type: "string";
|
||||
description: string;
|
||||
};
|
||||
baseURL: {
|
||||
type: "string";
|
||||
description: string;
|
||||
};
|
||||
watch: {
|
||||
type: "boolean";
|
||||
description: string;
|
||||
alias: string;
|
||||
};
|
||||
ws: {
|
||||
type: "boolean";
|
||||
description: string;
|
||||
};
|
||||
}>;
|
||||
declare const runMain: () => Promise<void>;
|
||||
/** Returns unjs/citty compatible args object */
|
||||
declare function getArgs(): {
|
||||
readonly port: {
|
||||
readonly type: "string";
|
||||
readonly description: "Port to listen on (use `PORT` environment variable to override)";
|
||||
};
|
||||
readonly host: {
|
||||
readonly description: "Host to listen on. If no value or an empty string provided, will listen on all available interfaces (use `HOST` environment variable to override)";
|
||||
};
|
||||
readonly clipboard: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Copy the URL to the clipboard";
|
||||
};
|
||||
readonly open: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Open the URL in the browser";
|
||||
};
|
||||
readonly https: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Enable HTTPS";
|
||||
};
|
||||
readonly "https.cert": {
|
||||
readonly type: "string";
|
||||
readonly description: "Path to TLS certificate used with HTTPS in PEM format";
|
||||
};
|
||||
readonly "https.key": {
|
||||
readonly type: "string";
|
||||
readonly description: "Path to TLS key used with HTTPS in PEM format";
|
||||
};
|
||||
readonly "https.pfx": {
|
||||
readonly type: "string";
|
||||
readonly description: "Path to PKCS#12 (.p12/.pfx) keystore containing a TLS certificate and Key";
|
||||
};
|
||||
readonly "https.passphrase": {
|
||||
readonly type: "string";
|
||||
readonly description: "Passphrase used for TLS key or keystore";
|
||||
};
|
||||
readonly "https.validityDays": {
|
||||
readonly type: "string";
|
||||
readonly description: "Validity in days of the autogenerated TLS certificate (https: true)";
|
||||
};
|
||||
readonly "https.domains": {
|
||||
readonly type: "string";
|
||||
readonly description: "Comma seperated list of domains and IPs, the autogenerated certificate should be valid for (https: true)";
|
||||
};
|
||||
readonly publicURL: {
|
||||
readonly type: "string";
|
||||
readonly description: "Displayed public URL (used for QR code)";
|
||||
readonly required: false;
|
||||
};
|
||||
readonly qr: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Display The QR code of public URL when available";
|
||||
readonly required: false;
|
||||
};
|
||||
readonly public: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Listen to all network interfaces";
|
||||
readonly required: false;
|
||||
};
|
||||
readonly tunnel: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Open a tunnel using https://github.com/unjs/untun";
|
||||
readonly required: false;
|
||||
};
|
||||
};
|
||||
type ParsedListhenArgs = ParsedArgs<ReturnType<typeof getArgs>>;
|
||||
/** Convert unjs/citty compatible args to listhen options */
|
||||
declare function parseArgs(args: ParsedListhenArgs): Partial<ListenOptions>;
|
||||
|
||||
export { getArgs, main, parseArgs, runMain };
|
||||
172
Frontend-Learner/node_modules/listhen/dist/cli.d.ts
generated
vendored
Normal file
172
Frontend-Learner/node_modules/listhen/dist/cli.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,172 @@
|
|||
import * as citty from 'citty';
|
||||
import { ParsedArgs } from 'citty';
|
||||
import { L as ListenOptions } from './shared/listhen.1c46e31d.js';
|
||||
import 'node:http';
|
||||
import 'node:https';
|
||||
import 'node:net';
|
||||
import 'get-port-please';
|
||||
import 'crossws/adapters/node';
|
||||
|
||||
declare const main: citty.CommandDef<{
|
||||
port: {
|
||||
readonly type: "string";
|
||||
readonly description: "Port to listen on (use `PORT` environment variable to override)";
|
||||
};
|
||||
host: {
|
||||
readonly description: "Host to listen on. If no value or an empty string provided, will listen on all available interfaces (use `HOST` environment variable to override)";
|
||||
};
|
||||
clipboard: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Copy the URL to the clipboard";
|
||||
};
|
||||
open: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Open the URL in the browser";
|
||||
};
|
||||
https: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Enable HTTPS";
|
||||
};
|
||||
"https.cert": {
|
||||
readonly type: "string";
|
||||
readonly description: "Path to TLS certificate used with HTTPS in PEM format";
|
||||
};
|
||||
"https.key": {
|
||||
readonly type: "string";
|
||||
readonly description: "Path to TLS key used with HTTPS in PEM format";
|
||||
};
|
||||
"https.pfx": {
|
||||
readonly type: "string";
|
||||
readonly description: "Path to PKCS#12 (.p12/.pfx) keystore containing a TLS certificate and Key";
|
||||
};
|
||||
"https.passphrase": {
|
||||
readonly type: "string";
|
||||
readonly description: "Passphrase used for TLS key or keystore";
|
||||
};
|
||||
"https.validityDays": {
|
||||
readonly type: "string";
|
||||
readonly description: "Validity in days of the autogenerated TLS certificate (https: true)";
|
||||
};
|
||||
"https.domains": {
|
||||
readonly type: "string";
|
||||
readonly description: "Comma seperated list of domains and IPs, the autogenerated certificate should be valid for (https: true)";
|
||||
};
|
||||
publicURL: {
|
||||
readonly type: "string";
|
||||
readonly description: "Displayed public URL (used for QR code)";
|
||||
readonly required: false;
|
||||
};
|
||||
qr: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Display The QR code of public URL when available";
|
||||
readonly required: false;
|
||||
};
|
||||
public: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Listen to all network interfaces";
|
||||
readonly required: false;
|
||||
};
|
||||
tunnel: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Open a tunnel using https://github.com/unjs/untun";
|
||||
readonly required: false;
|
||||
};
|
||||
cwd: {
|
||||
type: "string";
|
||||
description: string;
|
||||
};
|
||||
entry: {
|
||||
type: "positional";
|
||||
description: string;
|
||||
required: true;
|
||||
};
|
||||
name: {
|
||||
type: "string";
|
||||
description: string;
|
||||
};
|
||||
baseURL: {
|
||||
type: "string";
|
||||
description: string;
|
||||
};
|
||||
watch: {
|
||||
type: "boolean";
|
||||
description: string;
|
||||
alias: string;
|
||||
};
|
||||
ws: {
|
||||
type: "boolean";
|
||||
description: string;
|
||||
};
|
||||
}>;
|
||||
declare const runMain: () => Promise<void>;
|
||||
/** Returns unjs/citty compatible args object */
|
||||
declare function getArgs(): {
|
||||
readonly port: {
|
||||
readonly type: "string";
|
||||
readonly description: "Port to listen on (use `PORT` environment variable to override)";
|
||||
};
|
||||
readonly host: {
|
||||
readonly description: "Host to listen on. If no value or an empty string provided, will listen on all available interfaces (use `HOST` environment variable to override)";
|
||||
};
|
||||
readonly clipboard: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Copy the URL to the clipboard";
|
||||
};
|
||||
readonly open: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Open the URL in the browser";
|
||||
};
|
||||
readonly https: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Enable HTTPS";
|
||||
};
|
||||
readonly "https.cert": {
|
||||
readonly type: "string";
|
||||
readonly description: "Path to TLS certificate used with HTTPS in PEM format";
|
||||
};
|
||||
readonly "https.key": {
|
||||
readonly type: "string";
|
||||
readonly description: "Path to TLS key used with HTTPS in PEM format";
|
||||
};
|
||||
readonly "https.pfx": {
|
||||
readonly type: "string";
|
||||
readonly description: "Path to PKCS#12 (.p12/.pfx) keystore containing a TLS certificate and Key";
|
||||
};
|
||||
readonly "https.passphrase": {
|
||||
readonly type: "string";
|
||||
readonly description: "Passphrase used for TLS key or keystore";
|
||||
};
|
||||
readonly "https.validityDays": {
|
||||
readonly type: "string";
|
||||
readonly description: "Validity in days of the autogenerated TLS certificate (https: true)";
|
||||
};
|
||||
readonly "https.domains": {
|
||||
readonly type: "string";
|
||||
readonly description: "Comma seperated list of domains and IPs, the autogenerated certificate should be valid for (https: true)";
|
||||
};
|
||||
readonly publicURL: {
|
||||
readonly type: "string";
|
||||
readonly description: "Displayed public URL (used for QR code)";
|
||||
readonly required: false;
|
||||
};
|
||||
readonly qr: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Display The QR code of public URL when available";
|
||||
readonly required: false;
|
||||
};
|
||||
readonly public: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Listen to all network interfaces";
|
||||
readonly required: false;
|
||||
};
|
||||
readonly tunnel: {
|
||||
readonly type: "boolean";
|
||||
readonly description: "Open a tunnel using https://github.com/unjs/untun";
|
||||
readonly required: false;
|
||||
};
|
||||
};
|
||||
type ParsedListhenArgs = ParsedArgs<ReturnType<typeof getArgs>>;
|
||||
/** Convert unjs/citty compatible args to listhen options */
|
||||
declare function parseArgs(args: ParsedListhenArgs): Partial<ListenOptions>;
|
||||
|
||||
export { getArgs, main, parseArgs, runMain };
|
||||
172
Frontend-Learner/node_modules/listhen/dist/cli.mjs
generated
vendored
Normal file
172
Frontend-Learner/node_modules/listhen/dist/cli.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,172 @@
|
|||
import { defineCommand, runMain as runMain$1 } from 'citty';
|
||||
import { isAbsolute } from 'pathe';
|
||||
import { listenAndWatch, createDevServer, listen } from './index.mjs';
|
||||
import 'node:http';
|
||||
import 'node:https';
|
||||
import 'node:util';
|
||||
import 'get-port-please';
|
||||
import 'http-shutdown';
|
||||
import 'consola';
|
||||
import 'defu';
|
||||
import 'consola/utils';
|
||||
import 'uqr';
|
||||
import 'node:child_process';
|
||||
import 'node:fs';
|
||||
import 'node:os';
|
||||
import 'node:path';
|
||||
import 'std-env';
|
||||
import 'node-forge';
|
||||
import 'node:fs/promises';
|
||||
import 'mlly';
|
||||
|
||||
const name = "listhen";
|
||||
const version = "1.8.0";
|
||||
const description = "👂 Elegant HTTP Listener";
|
||||
|
||||
const main = defineCommand({
|
||||
meta: {
|
||||
name,
|
||||
description,
|
||||
version
|
||||
},
|
||||
args: {
|
||||
cwd: {
|
||||
type: "string",
|
||||
description: "Current working directory"
|
||||
},
|
||||
entry: {
|
||||
type: "positional",
|
||||
description: "Listener entry file (./app.ts)",
|
||||
required: true
|
||||
},
|
||||
name: {
|
||||
type: "string",
|
||||
description: "Name to use in the banner"
|
||||
},
|
||||
baseURL: {
|
||||
type: "string",
|
||||
description: "Base URL to use"
|
||||
},
|
||||
watch: {
|
||||
type: "boolean",
|
||||
description: "Watch for changes",
|
||||
alias: "w"
|
||||
},
|
||||
ws: {
|
||||
type: "boolean",
|
||||
description: "Enable Experimental WebSocket support"
|
||||
},
|
||||
...getArgs()
|
||||
},
|
||||
async run({ args }) {
|
||||
const opts = {
|
||||
...args,
|
||||
...parseArgs(args),
|
||||
baseURL: args.baseURL,
|
||||
name: args.name
|
||||
};
|
||||
const entry = isAbsolute(args.entry) || args.entry.startsWith(".") ? args.entry : `./${args.entry}`;
|
||||
if (args.watch) {
|
||||
await listenAndWatch(entry, opts);
|
||||
} else {
|
||||
const devServer = await createDevServer(entry, opts);
|
||||
await listen(devServer.nodeListener, {
|
||||
...opts,
|
||||
_entry: devServer._entry,
|
||||
ws: opts.ws ? devServer._ws : void 0
|
||||
});
|
||||
await devServer.reload(true);
|
||||
}
|
||||
}
|
||||
});
|
||||
const runMain = () => runMain$1(main);
|
||||
function getArgs() {
|
||||
return {
|
||||
port: {
|
||||
type: "string",
|
||||
description: "Port to listen on (use `PORT` environment variable to override)"
|
||||
},
|
||||
host: {
|
||||
description: "Host to listen on. If no value or an empty string provided, will listen on all available interfaces (use `HOST` environment variable to override)"
|
||||
},
|
||||
clipboard: {
|
||||
type: "boolean",
|
||||
description: "Copy the URL to the clipboard"
|
||||
},
|
||||
open: {
|
||||
type: "boolean",
|
||||
description: "Open the URL in the browser"
|
||||
},
|
||||
https: {
|
||||
type: "boolean",
|
||||
description: "Enable HTTPS"
|
||||
},
|
||||
"https.cert": {
|
||||
type: "string",
|
||||
description: "Path to TLS certificate used with HTTPS in PEM format"
|
||||
},
|
||||
"https.key": {
|
||||
type: "string",
|
||||
description: "Path to TLS key used with HTTPS in PEM format"
|
||||
},
|
||||
"https.pfx": {
|
||||
type: "string",
|
||||
description: "Path to PKCS#12 (.p12/.pfx) keystore containing a TLS certificate and Key"
|
||||
},
|
||||
"https.passphrase": {
|
||||
type: "string",
|
||||
description: "Passphrase used for TLS key or keystore"
|
||||
},
|
||||
"https.validityDays": {
|
||||
type: "string",
|
||||
description: "Validity in days of the autogenerated TLS certificate (https: true)"
|
||||
},
|
||||
"https.domains": {
|
||||
type: "string",
|
||||
description: "Comma seperated list of domains and IPs, the autogenerated certificate should be valid for (https: true)"
|
||||
},
|
||||
publicURL: {
|
||||
type: "string",
|
||||
description: "Displayed public URL (used for QR code)",
|
||||
required: false
|
||||
},
|
||||
qr: {
|
||||
type: "boolean",
|
||||
description: "Display The QR code of public URL when available",
|
||||
required: false
|
||||
},
|
||||
public: {
|
||||
type: "boolean",
|
||||
description: "Listen to all network interfaces",
|
||||
required: false
|
||||
},
|
||||
tunnel: {
|
||||
type: "boolean",
|
||||
description: "Open a tunnel using https://github.com/unjs/untun",
|
||||
required: false
|
||||
}
|
||||
};
|
||||
}
|
||||
function parseArgs(args) {
|
||||
return {
|
||||
port: args.port,
|
||||
// prettier-ignore
|
||||
hostname: typeof args.host === "string" ? args.host : args.host === true ? "" : void 0,
|
||||
clipboard: args.clipboard,
|
||||
open: args.open,
|
||||
qr: args.qr,
|
||||
publicURL: args.publicURL,
|
||||
public: args.public,
|
||||
tunnel: args.tunnel,
|
||||
https: args.https ? {
|
||||
cert: args["https.cert"],
|
||||
key: args["https.key"],
|
||||
pfx: args["https.pfx"],
|
||||
passphrase: args["https.passphrase"],
|
||||
validityDays: args["https.validityDays"] ? +args["https.validityDays"] : void 0,
|
||||
domains: args["https.domains"] ? args["https.domains"].split(",") : void 0
|
||||
} : false
|
||||
};
|
||||
}
|
||||
|
||||
export { getArgs, main, parseArgs, runMain };
|
||||
1072
Frontend-Learner/node_modules/listhen/dist/index.cjs
generated
vendored
Normal file
1072
Frontend-Learner/node_modules/listhen/dist/index.cjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
44
Frontend-Learner/node_modules/listhen/dist/index.d.cts
generated
vendored
Normal file
44
Frontend-Learner/node_modules/listhen/dist/index.d.cts
generated
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import { RequestListener } from 'node:http';
|
||||
import { L as ListenOptions, a as Listener } from './shared/listhen.1c46e31d.cjs';
|
||||
export { b as Certificate, C as CrossWSOptions, G as GetURLOptions, H as HTTPSOptions, c as ListenURL, S as ShowURLOptions } from './shared/listhen.1c46e31d.cjs';
|
||||
import { ConsolaInstance } from 'consola';
|
||||
import * as http from 'http';
|
||||
import * as crossws_adapters_node from 'crossws/adapters/node';
|
||||
import * as h3 from 'h3';
|
||||
import * as jiti_lib_types from 'jiti/lib/types';
|
||||
import 'node:https';
|
||||
import 'node:net';
|
||||
import 'get-port-please';
|
||||
|
||||
declare function listen(handle: RequestListener, _options?: Partial<ListenOptions>): Promise<Listener>;
|
||||
|
||||
interface DevServerOptions {
|
||||
cwd?: string;
|
||||
staticDirs?: string[];
|
||||
logger?: ConsolaInstance;
|
||||
ws?: ListenOptions["ws"];
|
||||
}
|
||||
declare function createDevServer(entry: string, options: DevServerOptions): Promise<{
|
||||
cwd: string;
|
||||
resolver: {
|
||||
relative: (path: string) => string;
|
||||
formatRelative: (path: string) => string;
|
||||
import: (id: string, opts?: jiti_lib_types.JitiResolveOptions) => Promise<unknown>;
|
||||
resolve: (id: string) => string;
|
||||
tryResolve: (id: string) => string | undefined;
|
||||
};
|
||||
nodeListener: h3.NodeListener;
|
||||
reload: (_initial?: boolean) => Promise<void>;
|
||||
_ws: false | crossws_adapters_node.NodeOptions | ((req: http.IncomingMessage, head: Buffer) => void) | undefined;
|
||||
_entry: string | undefined;
|
||||
}>;
|
||||
|
||||
interface WatchOptions extends DevServerOptions {
|
||||
cwd?: string;
|
||||
logger?: ConsolaInstance;
|
||||
ignore?: string[];
|
||||
publicDirs?: string[];
|
||||
}
|
||||
declare function listenAndWatch(entry: string, options: Partial<ListenOptions & WatchOptions>): Promise<Listener>;
|
||||
|
||||
export { type DevServerOptions, ListenOptions, Listener, type WatchOptions, createDevServer, listen, listenAndWatch };
|
||||
44
Frontend-Learner/node_modules/listhen/dist/index.d.mts
generated
vendored
Normal file
44
Frontend-Learner/node_modules/listhen/dist/index.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import { RequestListener } from 'node:http';
|
||||
import { L as ListenOptions, a as Listener } from './shared/listhen.1c46e31d.mjs';
|
||||
export { b as Certificate, C as CrossWSOptions, G as GetURLOptions, H as HTTPSOptions, c as ListenURL, S as ShowURLOptions } from './shared/listhen.1c46e31d.mjs';
|
||||
import { ConsolaInstance } from 'consola';
|
||||
import * as http from 'http';
|
||||
import * as crossws_adapters_node from 'crossws/adapters/node';
|
||||
import * as h3 from 'h3';
|
||||
import * as jiti_lib_types from 'jiti/lib/types';
|
||||
import 'node:https';
|
||||
import 'node:net';
|
||||
import 'get-port-please';
|
||||
|
||||
declare function listen(handle: RequestListener, _options?: Partial<ListenOptions>): Promise<Listener>;
|
||||
|
||||
interface DevServerOptions {
|
||||
cwd?: string;
|
||||
staticDirs?: string[];
|
||||
logger?: ConsolaInstance;
|
||||
ws?: ListenOptions["ws"];
|
||||
}
|
||||
declare function createDevServer(entry: string, options: DevServerOptions): Promise<{
|
||||
cwd: string;
|
||||
resolver: {
|
||||
relative: (path: string) => string;
|
||||
formatRelative: (path: string) => string;
|
||||
import: (id: string, opts?: jiti_lib_types.JitiResolveOptions) => Promise<unknown>;
|
||||
resolve: (id: string) => string;
|
||||
tryResolve: (id: string) => string | undefined;
|
||||
};
|
||||
nodeListener: h3.NodeListener;
|
||||
reload: (_initial?: boolean) => Promise<void>;
|
||||
_ws: false | crossws_adapters_node.NodeOptions | ((req: http.IncomingMessage, head: Buffer) => void) | undefined;
|
||||
_entry: string | undefined;
|
||||
}>;
|
||||
|
||||
interface WatchOptions extends DevServerOptions {
|
||||
cwd?: string;
|
||||
logger?: ConsolaInstance;
|
||||
ignore?: string[];
|
||||
publicDirs?: string[];
|
||||
}
|
||||
declare function listenAndWatch(entry: string, options: Partial<ListenOptions & WatchOptions>): Promise<Listener>;
|
||||
|
||||
export { type DevServerOptions, ListenOptions, Listener, type WatchOptions, createDevServer, listen, listenAndWatch };
|
||||
44
Frontend-Learner/node_modules/listhen/dist/index.d.ts
generated
vendored
Normal file
44
Frontend-Learner/node_modules/listhen/dist/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import { RequestListener } from 'node:http';
|
||||
import { L as ListenOptions, a as Listener } from './shared/listhen.1c46e31d.js';
|
||||
export { b as Certificate, C as CrossWSOptions, G as GetURLOptions, H as HTTPSOptions, c as ListenURL, S as ShowURLOptions } from './shared/listhen.1c46e31d.js';
|
||||
import { ConsolaInstance } from 'consola';
|
||||
import * as http from 'http';
|
||||
import * as crossws_adapters_node from 'crossws/adapters/node';
|
||||
import * as h3 from 'h3';
|
||||
import * as jiti_lib_types from 'jiti/lib/types';
|
||||
import 'node:https';
|
||||
import 'node:net';
|
||||
import 'get-port-please';
|
||||
|
||||
declare function listen(handle: RequestListener, _options?: Partial<ListenOptions>): Promise<Listener>;
|
||||
|
||||
interface DevServerOptions {
|
||||
cwd?: string;
|
||||
staticDirs?: string[];
|
||||
logger?: ConsolaInstance;
|
||||
ws?: ListenOptions["ws"];
|
||||
}
|
||||
declare function createDevServer(entry: string, options: DevServerOptions): Promise<{
|
||||
cwd: string;
|
||||
resolver: {
|
||||
relative: (path: string) => string;
|
||||
formatRelative: (path: string) => string;
|
||||
import: (id: string, opts?: jiti_lib_types.JitiResolveOptions) => Promise<unknown>;
|
||||
resolve: (id: string) => string;
|
||||
tryResolve: (id: string) => string | undefined;
|
||||
};
|
||||
nodeListener: h3.NodeListener;
|
||||
reload: (_initial?: boolean) => Promise<void>;
|
||||
_ws: false | crossws_adapters_node.NodeOptions | ((req: http.IncomingMessage, head: Buffer) => void) | undefined;
|
||||
_entry: string | undefined;
|
||||
}>;
|
||||
|
||||
interface WatchOptions extends DevServerOptions {
|
||||
cwd?: string;
|
||||
logger?: ConsolaInstance;
|
||||
ignore?: string[];
|
||||
publicDirs?: string[];
|
||||
}
|
||||
declare function listenAndWatch(entry: string, options: Partial<ListenOptions & WatchOptions>): Promise<Listener>;
|
||||
|
||||
export { type DevServerOptions, ListenOptions, Listener, type WatchOptions, createDevServer, listen, listenAndWatch };
|
||||
1058
Frontend-Learner/node_modules/listhen/dist/index.mjs
generated
vendored
Normal file
1058
Frontend-Learner/node_modules/listhen/dist/index.mjs
generated
vendored
Normal file
File diff suppressed because it is too large
Load diff
82
Frontend-Learner/node_modules/listhen/dist/shared/listhen.1c46e31d.d.cts
generated
vendored
Normal file
82
Frontend-Learner/node_modules/listhen/dist/shared/listhen.1c46e31d.d.cts
generated
vendored
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
import { IncomingMessage, Server } from 'node:http';
|
||||
import { Server as Server$1 } from 'node:https';
|
||||
import { AddressInfo } from 'node:net';
|
||||
import { GetPortInput } from 'get-port-please';
|
||||
import { NodeOptions } from 'crossws/adapters/node';
|
||||
|
||||
type CrossWSOptions = NodeOptions;
|
||||
interface Certificate {
|
||||
key: string;
|
||||
cert: string;
|
||||
passphrase?: string;
|
||||
}
|
||||
interface HTTPSOptions {
|
||||
cert?: string;
|
||||
key?: string;
|
||||
pfx?: string;
|
||||
passphrase?: string;
|
||||
validityDays?: number;
|
||||
domains?: string[];
|
||||
}
|
||||
interface ListenOptions {
|
||||
name: string;
|
||||
port: GetPortInput;
|
||||
hostname: string;
|
||||
showURL: boolean;
|
||||
baseURL: string;
|
||||
open: boolean;
|
||||
https: boolean | HTTPSOptions;
|
||||
clipboard: boolean;
|
||||
isTest: boolean;
|
||||
isProd: boolean;
|
||||
autoClose: boolean;
|
||||
_entry?: string;
|
||||
/**
|
||||
* Used as main public url to display
|
||||
* @default The first public IPV4 address listening to
|
||||
*/
|
||||
publicURL?: string;
|
||||
/**
|
||||
* Print QR Code for public IPv4 address
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
qr?: boolean;
|
||||
/**
|
||||
* When enabled, listhen tries to listen to all network interfaces
|
||||
*
|
||||
* @default `false` for development and `true` for production
|
||||
*/
|
||||
public: boolean;
|
||||
/**
|
||||
* Open a tunnel using https://github.com/unjs/untun
|
||||
*/
|
||||
tunnel?: boolean;
|
||||
/**
|
||||
* WebSocket Upgrade Handler
|
||||
*
|
||||
* Input can be an upgrade handler or CrossWS options
|
||||
*
|
||||
* @experimental CrossWS usage is subject to change
|
||||
* @see https://github.com/unjs/crossws
|
||||
*/
|
||||
ws?: boolean | CrossWSOptions | ((req: IncomingMessage, head: Buffer) => void);
|
||||
}
|
||||
type GetURLOptions = Pick<Partial<ListenOptions>, "baseURL" | "publicURL">;
|
||||
type ShowURLOptions = Pick<Partial<ListenOptions>, "baseURL" | "name" | "publicURL" | "qr">;
|
||||
interface ListenURL {
|
||||
url: string;
|
||||
type: "local" | "network" | "tunnel";
|
||||
}
|
||||
interface Listener {
|
||||
url: string;
|
||||
address: AddressInfo;
|
||||
server: Server | Server$1;
|
||||
https: false | Certificate;
|
||||
close: () => Promise<void>;
|
||||
open: () => Promise<void>;
|
||||
showURL: (options?: ShowURLOptions) => Promise<void>;
|
||||
getURLs: (options?: GetURLOptions) => Promise<ListenURL[]>;
|
||||
}
|
||||
|
||||
export type { CrossWSOptions as C, GetURLOptions as G, HTTPSOptions as H, ListenOptions as L, ShowURLOptions as S, Listener as a, Certificate as b, ListenURL as c };
|
||||
82
Frontend-Learner/node_modules/listhen/dist/shared/listhen.1c46e31d.d.mts
generated
vendored
Normal file
82
Frontend-Learner/node_modules/listhen/dist/shared/listhen.1c46e31d.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
import { IncomingMessage, Server } from 'node:http';
|
||||
import { Server as Server$1 } from 'node:https';
|
||||
import { AddressInfo } from 'node:net';
|
||||
import { GetPortInput } from 'get-port-please';
|
||||
import { NodeOptions } from 'crossws/adapters/node';
|
||||
|
||||
type CrossWSOptions = NodeOptions;
|
||||
interface Certificate {
|
||||
key: string;
|
||||
cert: string;
|
||||
passphrase?: string;
|
||||
}
|
||||
interface HTTPSOptions {
|
||||
cert?: string;
|
||||
key?: string;
|
||||
pfx?: string;
|
||||
passphrase?: string;
|
||||
validityDays?: number;
|
||||
domains?: string[];
|
||||
}
|
||||
interface ListenOptions {
|
||||
name: string;
|
||||
port: GetPortInput;
|
||||
hostname: string;
|
||||
showURL: boolean;
|
||||
baseURL: string;
|
||||
open: boolean;
|
||||
https: boolean | HTTPSOptions;
|
||||
clipboard: boolean;
|
||||
isTest: boolean;
|
||||
isProd: boolean;
|
||||
autoClose: boolean;
|
||||
_entry?: string;
|
||||
/**
|
||||
* Used as main public url to display
|
||||
* @default The first public IPV4 address listening to
|
||||
*/
|
||||
publicURL?: string;
|
||||
/**
|
||||
* Print QR Code for public IPv4 address
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
qr?: boolean;
|
||||
/**
|
||||
* When enabled, listhen tries to listen to all network interfaces
|
||||
*
|
||||
* @default `false` for development and `true` for production
|
||||
*/
|
||||
public: boolean;
|
||||
/**
|
||||
* Open a tunnel using https://github.com/unjs/untun
|
||||
*/
|
||||
tunnel?: boolean;
|
||||
/**
|
||||
* WebSocket Upgrade Handler
|
||||
*
|
||||
* Input can be an upgrade handler or CrossWS options
|
||||
*
|
||||
* @experimental CrossWS usage is subject to change
|
||||
* @see https://github.com/unjs/crossws
|
||||
*/
|
||||
ws?: boolean | CrossWSOptions | ((req: IncomingMessage, head: Buffer) => void);
|
||||
}
|
||||
type GetURLOptions = Pick<Partial<ListenOptions>, "baseURL" | "publicURL">;
|
||||
type ShowURLOptions = Pick<Partial<ListenOptions>, "baseURL" | "name" | "publicURL" | "qr">;
|
||||
interface ListenURL {
|
||||
url: string;
|
||||
type: "local" | "network" | "tunnel";
|
||||
}
|
||||
interface Listener {
|
||||
url: string;
|
||||
address: AddressInfo;
|
||||
server: Server | Server$1;
|
||||
https: false | Certificate;
|
||||
close: () => Promise<void>;
|
||||
open: () => Promise<void>;
|
||||
showURL: (options?: ShowURLOptions) => Promise<void>;
|
||||
getURLs: (options?: GetURLOptions) => Promise<ListenURL[]>;
|
||||
}
|
||||
|
||||
export type { CrossWSOptions as C, GetURLOptions as G, HTTPSOptions as H, ListenOptions as L, ShowURLOptions as S, Listener as a, Certificate as b, ListenURL as c };
|
||||
82
Frontend-Learner/node_modules/listhen/dist/shared/listhen.1c46e31d.d.ts
generated
vendored
Normal file
82
Frontend-Learner/node_modules/listhen/dist/shared/listhen.1c46e31d.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
import { IncomingMessage, Server } from 'node:http';
|
||||
import { Server as Server$1 } from 'node:https';
|
||||
import { AddressInfo } from 'node:net';
|
||||
import { GetPortInput } from 'get-port-please';
|
||||
import { NodeOptions } from 'crossws/adapters/node';
|
||||
|
||||
type CrossWSOptions = NodeOptions;
|
||||
interface Certificate {
|
||||
key: string;
|
||||
cert: string;
|
||||
passphrase?: string;
|
||||
}
|
||||
interface HTTPSOptions {
|
||||
cert?: string;
|
||||
key?: string;
|
||||
pfx?: string;
|
||||
passphrase?: string;
|
||||
validityDays?: number;
|
||||
domains?: string[];
|
||||
}
|
||||
interface ListenOptions {
|
||||
name: string;
|
||||
port: GetPortInput;
|
||||
hostname: string;
|
||||
showURL: boolean;
|
||||
baseURL: string;
|
||||
open: boolean;
|
||||
https: boolean | HTTPSOptions;
|
||||
clipboard: boolean;
|
||||
isTest: boolean;
|
||||
isProd: boolean;
|
||||
autoClose: boolean;
|
||||
_entry?: string;
|
||||
/**
|
||||
* Used as main public url to display
|
||||
* @default The first public IPV4 address listening to
|
||||
*/
|
||||
publicURL?: string;
|
||||
/**
|
||||
* Print QR Code for public IPv4 address
|
||||
*
|
||||
* @default true
|
||||
*/
|
||||
qr?: boolean;
|
||||
/**
|
||||
* When enabled, listhen tries to listen to all network interfaces
|
||||
*
|
||||
* @default `false` for development and `true` for production
|
||||
*/
|
||||
public: boolean;
|
||||
/**
|
||||
* Open a tunnel using https://github.com/unjs/untun
|
||||
*/
|
||||
tunnel?: boolean;
|
||||
/**
|
||||
* WebSocket Upgrade Handler
|
||||
*
|
||||
* Input can be an upgrade handler or CrossWS options
|
||||
*
|
||||
* @experimental CrossWS usage is subject to change
|
||||
* @see https://github.com/unjs/crossws
|
||||
*/
|
||||
ws?: boolean | CrossWSOptions | ((req: IncomingMessage, head: Buffer) => void);
|
||||
}
|
||||
type GetURLOptions = Pick<Partial<ListenOptions>, "baseURL" | "publicURL">;
|
||||
type ShowURLOptions = Pick<Partial<ListenOptions>, "baseURL" | "name" | "publicURL" | "qr">;
|
||||
interface ListenURL {
|
||||
url: string;
|
||||
type: "local" | "network" | "tunnel";
|
||||
}
|
||||
interface Listener {
|
||||
url: string;
|
||||
address: AddressInfo;
|
||||
server: Server | Server$1;
|
||||
https: false | Certificate;
|
||||
close: () => Promise<void>;
|
||||
open: () => Promise<void>;
|
||||
showURL: (options?: ShowURLOptions) => Promise<void>;
|
||||
getURLs: (options?: GetURLOptions) => Promise<ListenURL[]>;
|
||||
}
|
||||
|
||||
export type { CrossWSOptions as C, GetURLOptions as G, HTTPSOptions as H, ListenOptions as L, ShowURLOptions as S, Listener as a, Certificate as b, ListenURL as c };
|
||||
44
Frontend-Learner/node_modules/listhen/node_modules/pathe/LICENSE
generated
vendored
Normal file
44
Frontend-Learner/node_modules/listhen/node_modules/pathe/LICENSE
generated
vendored
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
MIT License
|
||||
|
||||
Copyright (c) Pooya Parsa <pooya@pi0.io> - Daniel Roe <daniel@roe.dev>
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
Copyright Joyent, Inc. and other Node contributors.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a
|
||||
copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to permit
|
||||
persons to whom the Software is furnished to do so, subject to the
|
||||
following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included
|
||||
in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
|
||||
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
|
||||
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
|
||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
69
Frontend-Learner/node_modules/listhen/node_modules/pathe/README.md
generated
vendored
Normal file
69
Frontend-Learner/node_modules/listhen/node_modules/pathe/README.md
generated
vendored
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
# 🛣️ pathe
|
||||
|
||||
> Universal filesystem path utils
|
||||
|
||||
[![version][npm-v-src]][npm-v-href]
|
||||
[![downloads][npm-d-src]][npm-d-href]
|
||||
[![size][size-src]][size-href]
|
||||
|
||||
> **❓ Why**
|
||||
>
|
||||
> For [historical reasons](https://docs.microsoft.com/en-us/archive/blogs/larryosterman/why-is-the-dos-path-character), windows followed MS-DOS and using backslash for separating paths rather than slash used for macOS, Linux, and other Posix operating systems. Nowadays, [Windows](https://docs.microsoft.com/en-us/windows/win32/fileio/naming-a-file?redirectedfrom=MSDN) supports both Slash and Backslash for paths. [Node.js's built in `path` module](https://nodejs.org/api/path.html) in the default operation of the path module varies based on the operating system on which a Node.js application is running. Specifically, when running on a Windows operating system, the path module will assume that Windows-style paths are being used. **This makes inconsistent code behavior between Windows and POSIX.**
|
||||
> Compared to popular [upath](https://github.com/anodynos/upath), pathe is providing **identical exports** of Node.js with normalization on **all operations** and written in modern **ESM/Typescript** and has **no dependency on Node.js**!
|
||||
|
||||
This package is a drop-in replacement of the Node.js's [path module](https://nodejs.org/api/path.html) module and ensures paths are normalized with slash `/` and work in environments including Node.js.
|
||||
|
||||
## 💿 Usage
|
||||
|
||||
Install using npm or yarn:
|
||||
|
||||
```bash
|
||||
# npm
|
||||
npm i pathe
|
||||
|
||||
# yarn
|
||||
yarn add pathe
|
||||
|
||||
# pnpm
|
||||
pnpm i pathe
|
||||
```
|
||||
|
||||
Import:
|
||||
|
||||
```js
|
||||
// ESM / Typescript
|
||||
import { resolve } from 'pathe'
|
||||
|
||||
// CommonJS
|
||||
const { resolve } = require('pathe')
|
||||
```
|
||||
|
||||
Read more about path utils from [Node.js documentation](https://nodejs.org/api/path.html) and rest assured behavior is ALWAYS like POSIX regardless of your input paths format and running platform!
|
||||
|
||||
### Extra utilties
|
||||
|
||||
Pathe exports some extra utilities that do not exist in standard Node.js [path module](https://nodejs.org/api/path.html).
|
||||
In order to use them, you can import from `pathe/utils` subpath:
|
||||
|
||||
```js
|
||||
import { filename, normalizeAliases, resolveAlias } from 'pathe/utils'
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
MIT. Made with 💖
|
||||
|
||||
Some code used from Node.js project. See [LICENSE](./LICENSE).
|
||||
|
||||
<!-- Refs -->
|
||||
[npm-v-src]: https://img.shields.io/npm/v/pathe?style=flat-square
|
||||
[npm-v-href]: https://npmjs.com/package/pathe
|
||||
|
||||
[npm-d-src]: https://img.shields.io/npm/dm/pathe?style=flat-square
|
||||
[npm-d-href]: https://npmjs.com/package/pathe
|
||||
|
||||
[github-actions-src]: https://img.shields.io/github/workflow/status/unjs/pathe/ci/main?style=flat-square
|
||||
[github-actions-href]: https://github.com/unjs/pathe/actions?query=workflow%3Aci
|
||||
|
||||
[size-src]: https://packagephobia.now.sh/badge?p=pathe
|
||||
[size-href]: https://packagephobia.now.sh/result?p=pathe
|
||||
23
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/index.cjs
generated
vendored
Normal file
23
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/index.cjs
generated
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
'use strict';
|
||||
|
||||
Object.defineProperty(exports, '__esModule', { value: true });
|
||||
|
||||
const index = require('./shared/pathe.1f0a373c.cjs');
|
||||
|
||||
|
||||
|
||||
exports.basename = index.basename;
|
||||
exports.default = index.path;
|
||||
exports.delimiter = index.delimiter;
|
||||
exports.dirname = index.dirname;
|
||||
exports.extname = index.extname;
|
||||
exports.format = index.format;
|
||||
exports.isAbsolute = index.isAbsolute;
|
||||
exports.join = index.join;
|
||||
exports.normalize = index.normalize;
|
||||
exports.normalizeString = index.normalizeString;
|
||||
exports.parse = index.parse;
|
||||
exports.relative = index.relative;
|
||||
exports.resolve = index.resolve;
|
||||
exports.sep = index.sep;
|
||||
exports.toNamespacedPath = index.toNamespacedPath;
|
||||
36
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/index.d.cts
generated
vendored
Normal file
36
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/index.d.cts
generated
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import path$1 from 'node:path';
|
||||
|
||||
declare const sep = "/";
|
||||
declare const delimiter = ":";
|
||||
declare const normalize: typeof path$1.normalize;
|
||||
declare const join: typeof path$1.join;
|
||||
declare const resolve: typeof path$1.resolve;
|
||||
declare function normalizeString(path: string, allowAboveRoot: boolean): string;
|
||||
declare const isAbsolute: typeof path$1.isAbsolute;
|
||||
declare const toNamespacedPath: typeof path$1.toNamespacedPath;
|
||||
declare const extname: typeof path$1.extname;
|
||||
declare const relative: typeof path$1.relative;
|
||||
declare const dirname: typeof path$1.dirname;
|
||||
declare const format: typeof path$1.format;
|
||||
declare const basename: typeof path$1.basename;
|
||||
declare const parse: typeof path$1.parse;
|
||||
|
||||
declare const path_basename: typeof basename;
|
||||
declare const path_delimiter: typeof delimiter;
|
||||
declare const path_dirname: typeof dirname;
|
||||
declare const path_extname: typeof extname;
|
||||
declare const path_format: typeof format;
|
||||
declare const path_isAbsolute: typeof isAbsolute;
|
||||
declare const path_join: typeof join;
|
||||
declare const path_normalize: typeof normalize;
|
||||
declare const path_normalizeString: typeof normalizeString;
|
||||
declare const path_parse: typeof parse;
|
||||
declare const path_relative: typeof relative;
|
||||
declare const path_resolve: typeof resolve;
|
||||
declare const path_sep: typeof sep;
|
||||
declare const path_toNamespacedPath: typeof toNamespacedPath;
|
||||
declare namespace path {
|
||||
export { path_basename as basename, path_delimiter as delimiter, path_dirname as dirname, path_extname as extname, path_format as format, path_isAbsolute as isAbsolute, path_join as join, path_normalize as normalize, path_normalizeString as normalizeString, path_parse as parse, path_relative as relative, path_resolve as resolve, path_sep as sep, path_toNamespacedPath as toNamespacedPath };
|
||||
}
|
||||
|
||||
export { basename, path as default, delimiter, dirname, extname, format, isAbsolute, join, normalize, normalizeString, parse, relative, resolve, sep, toNamespacedPath };
|
||||
36
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/index.d.mts
generated
vendored
Normal file
36
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/index.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import path$1 from 'node:path';
|
||||
|
||||
declare const sep = "/";
|
||||
declare const delimiter = ":";
|
||||
declare const normalize: typeof path$1.normalize;
|
||||
declare const join: typeof path$1.join;
|
||||
declare const resolve: typeof path$1.resolve;
|
||||
declare function normalizeString(path: string, allowAboveRoot: boolean): string;
|
||||
declare const isAbsolute: typeof path$1.isAbsolute;
|
||||
declare const toNamespacedPath: typeof path$1.toNamespacedPath;
|
||||
declare const extname: typeof path$1.extname;
|
||||
declare const relative: typeof path$1.relative;
|
||||
declare const dirname: typeof path$1.dirname;
|
||||
declare const format: typeof path$1.format;
|
||||
declare const basename: typeof path$1.basename;
|
||||
declare const parse: typeof path$1.parse;
|
||||
|
||||
declare const path_basename: typeof basename;
|
||||
declare const path_delimiter: typeof delimiter;
|
||||
declare const path_dirname: typeof dirname;
|
||||
declare const path_extname: typeof extname;
|
||||
declare const path_format: typeof format;
|
||||
declare const path_isAbsolute: typeof isAbsolute;
|
||||
declare const path_join: typeof join;
|
||||
declare const path_normalize: typeof normalize;
|
||||
declare const path_normalizeString: typeof normalizeString;
|
||||
declare const path_parse: typeof parse;
|
||||
declare const path_relative: typeof relative;
|
||||
declare const path_resolve: typeof resolve;
|
||||
declare const path_sep: typeof sep;
|
||||
declare const path_toNamespacedPath: typeof toNamespacedPath;
|
||||
declare namespace path {
|
||||
export { path_basename as basename, path_delimiter as delimiter, path_dirname as dirname, path_extname as extname, path_format as format, path_isAbsolute as isAbsolute, path_join as join, path_normalize as normalize, path_normalizeString as normalizeString, path_parse as parse, path_relative as relative, path_resolve as resolve, path_sep as sep, path_toNamespacedPath as toNamespacedPath };
|
||||
}
|
||||
|
||||
export { basename, path as default, delimiter, dirname, extname, format, isAbsolute, join, normalize, normalizeString, parse, relative, resolve, sep, toNamespacedPath };
|
||||
36
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/index.d.ts
generated
vendored
Normal file
36
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/index.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
import path$1 from 'node:path';
|
||||
|
||||
declare const sep = "/";
|
||||
declare const delimiter = ":";
|
||||
declare const normalize: typeof path$1.normalize;
|
||||
declare const join: typeof path$1.join;
|
||||
declare const resolve: typeof path$1.resolve;
|
||||
declare function normalizeString(path: string, allowAboveRoot: boolean): string;
|
||||
declare const isAbsolute: typeof path$1.isAbsolute;
|
||||
declare const toNamespacedPath: typeof path$1.toNamespacedPath;
|
||||
declare const extname: typeof path$1.extname;
|
||||
declare const relative: typeof path$1.relative;
|
||||
declare const dirname: typeof path$1.dirname;
|
||||
declare const format: typeof path$1.format;
|
||||
declare const basename: typeof path$1.basename;
|
||||
declare const parse: typeof path$1.parse;
|
||||
|
||||
declare const path_basename: typeof basename;
|
||||
declare const path_delimiter: typeof delimiter;
|
||||
declare const path_dirname: typeof dirname;
|
||||
declare const path_extname: typeof extname;
|
||||
declare const path_format: typeof format;
|
||||
declare const path_isAbsolute: typeof isAbsolute;
|
||||
declare const path_join: typeof join;
|
||||
declare const path_normalize: typeof normalize;
|
||||
declare const path_normalizeString: typeof normalizeString;
|
||||
declare const path_parse: typeof parse;
|
||||
declare const path_relative: typeof relative;
|
||||
declare const path_resolve: typeof resolve;
|
||||
declare const path_sep: typeof sep;
|
||||
declare const path_toNamespacedPath: typeof toNamespacedPath;
|
||||
declare namespace path {
|
||||
export { path_basename as basename, path_delimiter as delimiter, path_dirname as dirname, path_extname as extname, path_format as format, path_isAbsolute as isAbsolute, path_join as join, path_normalize as normalize, path_normalizeString as normalizeString, path_parse as parse, path_relative as relative, path_resolve as resolve, path_sep as sep, path_toNamespacedPath as toNamespacedPath };
|
||||
}
|
||||
|
||||
export { basename, path as default, delimiter, dirname, extname, format, isAbsolute, join, normalize, normalizeString, parse, relative, resolve, sep, toNamespacedPath };
|
||||
1
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/index.mjs
generated
vendored
Normal file
1
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/index.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export { h as basename, p as default, d as delimiter, f as dirname, e as extname, g as format, i as isAbsolute, j as join, a as normalize, b as normalizeString, k as parse, c as relative, r as resolve, s as sep, t as toNamespacedPath } from './shared/pathe.ff20891b.mjs';
|
||||
238
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/shared/pathe.1f0a373c.cjs
generated
vendored
Normal file
238
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/shared/pathe.1f0a373c.cjs
generated
vendored
Normal file
|
|
@ -0,0 +1,238 @@
|
|||
'use strict';
|
||||
|
||||
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
||||
function normalizeWindowsPath(input = "") {
|
||||
if (!input) {
|
||||
return input;
|
||||
}
|
||||
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
||||
}
|
||||
|
||||
const _UNC_REGEX = /^[/\\]{2}/;
|
||||
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
||||
const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
||||
const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
|
||||
const sep = "/";
|
||||
const delimiter = ":";
|
||||
const normalize = function(path) {
|
||||
if (path.length === 0) {
|
||||
return ".";
|
||||
}
|
||||
path = normalizeWindowsPath(path);
|
||||
const isUNCPath = path.match(_UNC_REGEX);
|
||||
const isPathAbsolute = isAbsolute(path);
|
||||
const trailingSeparator = path[path.length - 1] === "/";
|
||||
path = normalizeString(path, !isPathAbsolute);
|
||||
if (path.length === 0) {
|
||||
if (isPathAbsolute) {
|
||||
return "/";
|
||||
}
|
||||
return trailingSeparator ? "./" : ".";
|
||||
}
|
||||
if (trailingSeparator) {
|
||||
path += "/";
|
||||
}
|
||||
if (_DRIVE_LETTER_RE.test(path)) {
|
||||
path += "/";
|
||||
}
|
||||
if (isUNCPath) {
|
||||
if (!isPathAbsolute) {
|
||||
return `//./${path}`;
|
||||
}
|
||||
return `//${path}`;
|
||||
}
|
||||
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
||||
};
|
||||
const join = function(...arguments_) {
|
||||
if (arguments_.length === 0) {
|
||||
return ".";
|
||||
}
|
||||
let joined;
|
||||
for (const argument of arguments_) {
|
||||
if (argument && argument.length > 0) {
|
||||
if (joined === void 0) {
|
||||
joined = argument;
|
||||
} else {
|
||||
joined += `/${argument}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (joined === void 0) {
|
||||
return ".";
|
||||
}
|
||||
return normalize(joined.replace(/\/\/+/g, "/"));
|
||||
};
|
||||
function cwd() {
|
||||
if (typeof process !== "undefined" && typeof process.cwd === "function") {
|
||||
return process.cwd().replace(/\\/g, "/");
|
||||
}
|
||||
return "/";
|
||||
}
|
||||
const resolve = function(...arguments_) {
|
||||
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
||||
let resolvedPath = "";
|
||||
let resolvedAbsolute = false;
|
||||
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
||||
const path = index >= 0 ? arguments_[index] : cwd();
|
||||
if (!path || path.length === 0) {
|
||||
continue;
|
||||
}
|
||||
resolvedPath = `${path}/${resolvedPath}`;
|
||||
resolvedAbsolute = isAbsolute(path);
|
||||
}
|
||||
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
||||
if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
|
||||
return `/${resolvedPath}`;
|
||||
}
|
||||
return resolvedPath.length > 0 ? resolvedPath : ".";
|
||||
};
|
||||
function normalizeString(path, allowAboveRoot) {
|
||||
let res = "";
|
||||
let lastSegmentLength = 0;
|
||||
let lastSlash = -1;
|
||||
let dots = 0;
|
||||
let char = null;
|
||||
for (let index = 0; index <= path.length; ++index) {
|
||||
if (index < path.length) {
|
||||
char = path[index];
|
||||
} else if (char === "/") {
|
||||
break;
|
||||
} else {
|
||||
char = "/";
|
||||
}
|
||||
if (char === "/") {
|
||||
if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
|
||||
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
||||
if (res.length > 2) {
|
||||
const lastSlashIndex = res.lastIndexOf("/");
|
||||
if (lastSlashIndex === -1) {
|
||||
res = "";
|
||||
lastSegmentLength = 0;
|
||||
} else {
|
||||
res = res.slice(0, lastSlashIndex);
|
||||
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
||||
}
|
||||
lastSlash = index;
|
||||
dots = 0;
|
||||
continue;
|
||||
} else if (res.length > 0) {
|
||||
res = "";
|
||||
lastSegmentLength = 0;
|
||||
lastSlash = index;
|
||||
dots = 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (allowAboveRoot) {
|
||||
res += res.length > 0 ? "/.." : "..";
|
||||
lastSegmentLength = 2;
|
||||
}
|
||||
} else {
|
||||
if (res.length > 0) {
|
||||
res += `/${path.slice(lastSlash + 1, index)}`;
|
||||
} else {
|
||||
res = path.slice(lastSlash + 1, index);
|
||||
}
|
||||
lastSegmentLength = index - lastSlash - 1;
|
||||
}
|
||||
lastSlash = index;
|
||||
dots = 0;
|
||||
} else if (char === "." && dots !== -1) {
|
||||
++dots;
|
||||
} else {
|
||||
dots = -1;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
const isAbsolute = function(p) {
|
||||
return _IS_ABSOLUTE_RE.test(p);
|
||||
};
|
||||
const toNamespacedPath = function(p) {
|
||||
return normalizeWindowsPath(p);
|
||||
};
|
||||
const _EXTNAME_RE = /.(\.[^./]+)$/;
|
||||
const extname = function(p) {
|
||||
const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
|
||||
return match && match[1] || "";
|
||||
};
|
||||
const relative = function(from, to) {
|
||||
const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
||||
const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
||||
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
|
||||
return _to.join("/");
|
||||
}
|
||||
const _fromCopy = [..._from];
|
||||
for (const segment of _fromCopy) {
|
||||
if (_to[0] !== segment) {
|
||||
break;
|
||||
}
|
||||
_from.shift();
|
||||
_to.shift();
|
||||
}
|
||||
return [..._from.map(() => ".."), ..._to].join("/");
|
||||
};
|
||||
const dirname = function(p) {
|
||||
const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
||||
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
|
||||
segments[0] += "/";
|
||||
}
|
||||
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
||||
};
|
||||
const format = function(p) {
|
||||
const segments = [p.root, p.dir, p.base ?? p.name + p.ext].filter(Boolean);
|
||||
return normalizeWindowsPath(
|
||||
p.root ? resolve(...segments) : segments.join("/")
|
||||
);
|
||||
};
|
||||
const basename = function(p, extension) {
|
||||
const lastSegment = normalizeWindowsPath(p).split("/").pop();
|
||||
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
||||
};
|
||||
const parse = function(p) {
|
||||
const root = normalizeWindowsPath(p).split("/").shift() || "/";
|
||||
const base = basename(p);
|
||||
const extension = extname(base);
|
||||
return {
|
||||
root,
|
||||
dir: dirname(p),
|
||||
base,
|
||||
ext: extension,
|
||||
name: base.slice(0, base.length - extension.length)
|
||||
};
|
||||
};
|
||||
|
||||
const path = {
|
||||
__proto__: null,
|
||||
basename: basename,
|
||||
delimiter: delimiter,
|
||||
dirname: dirname,
|
||||
extname: extname,
|
||||
format: format,
|
||||
isAbsolute: isAbsolute,
|
||||
join: join,
|
||||
normalize: normalize,
|
||||
normalizeString: normalizeString,
|
||||
parse: parse,
|
||||
relative: relative,
|
||||
resolve: resolve,
|
||||
sep: sep,
|
||||
toNamespacedPath: toNamespacedPath
|
||||
};
|
||||
|
||||
exports.basename = basename;
|
||||
exports.delimiter = delimiter;
|
||||
exports.dirname = dirname;
|
||||
exports.extname = extname;
|
||||
exports.format = format;
|
||||
exports.isAbsolute = isAbsolute;
|
||||
exports.join = join;
|
||||
exports.normalize = normalize;
|
||||
exports.normalizeString = normalizeString;
|
||||
exports.normalizeWindowsPath = normalizeWindowsPath;
|
||||
exports.parse = parse;
|
||||
exports.path = path;
|
||||
exports.relative = relative;
|
||||
exports.resolve = resolve;
|
||||
exports.sep = sep;
|
||||
exports.toNamespacedPath = toNamespacedPath;
|
||||
221
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/shared/pathe.ff20891b.mjs
generated
vendored
Normal file
221
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/shared/pathe.ff20891b.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,221 @@
|
|||
const _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
|
||||
function normalizeWindowsPath(input = "") {
|
||||
if (!input) {
|
||||
return input;
|
||||
}
|
||||
return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
|
||||
}
|
||||
|
||||
const _UNC_REGEX = /^[/\\]{2}/;
|
||||
const _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
|
||||
const _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
|
||||
const _ROOT_FOLDER_RE = /^\/([A-Za-z]:)?$/;
|
||||
const sep = "/";
|
||||
const delimiter = ":";
|
||||
const normalize = function(path) {
|
||||
if (path.length === 0) {
|
||||
return ".";
|
||||
}
|
||||
path = normalizeWindowsPath(path);
|
||||
const isUNCPath = path.match(_UNC_REGEX);
|
||||
const isPathAbsolute = isAbsolute(path);
|
||||
const trailingSeparator = path[path.length - 1] === "/";
|
||||
path = normalizeString(path, !isPathAbsolute);
|
||||
if (path.length === 0) {
|
||||
if (isPathAbsolute) {
|
||||
return "/";
|
||||
}
|
||||
return trailingSeparator ? "./" : ".";
|
||||
}
|
||||
if (trailingSeparator) {
|
||||
path += "/";
|
||||
}
|
||||
if (_DRIVE_LETTER_RE.test(path)) {
|
||||
path += "/";
|
||||
}
|
||||
if (isUNCPath) {
|
||||
if (!isPathAbsolute) {
|
||||
return `//./${path}`;
|
||||
}
|
||||
return `//${path}`;
|
||||
}
|
||||
return isPathAbsolute && !isAbsolute(path) ? `/${path}` : path;
|
||||
};
|
||||
const join = function(...arguments_) {
|
||||
if (arguments_.length === 0) {
|
||||
return ".";
|
||||
}
|
||||
let joined;
|
||||
for (const argument of arguments_) {
|
||||
if (argument && argument.length > 0) {
|
||||
if (joined === void 0) {
|
||||
joined = argument;
|
||||
} else {
|
||||
joined += `/${argument}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (joined === void 0) {
|
||||
return ".";
|
||||
}
|
||||
return normalize(joined.replace(/\/\/+/g, "/"));
|
||||
};
|
||||
function cwd() {
|
||||
if (typeof process !== "undefined" && typeof process.cwd === "function") {
|
||||
return process.cwd().replace(/\\/g, "/");
|
||||
}
|
||||
return "/";
|
||||
}
|
||||
const resolve = function(...arguments_) {
|
||||
arguments_ = arguments_.map((argument) => normalizeWindowsPath(argument));
|
||||
let resolvedPath = "";
|
||||
let resolvedAbsolute = false;
|
||||
for (let index = arguments_.length - 1; index >= -1 && !resolvedAbsolute; index--) {
|
||||
const path = index >= 0 ? arguments_[index] : cwd();
|
||||
if (!path || path.length === 0) {
|
||||
continue;
|
||||
}
|
||||
resolvedPath = `${path}/${resolvedPath}`;
|
||||
resolvedAbsolute = isAbsolute(path);
|
||||
}
|
||||
resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute);
|
||||
if (resolvedAbsolute && !isAbsolute(resolvedPath)) {
|
||||
return `/${resolvedPath}`;
|
||||
}
|
||||
return resolvedPath.length > 0 ? resolvedPath : ".";
|
||||
};
|
||||
function normalizeString(path, allowAboveRoot) {
|
||||
let res = "";
|
||||
let lastSegmentLength = 0;
|
||||
let lastSlash = -1;
|
||||
let dots = 0;
|
||||
let char = null;
|
||||
for (let index = 0; index <= path.length; ++index) {
|
||||
if (index < path.length) {
|
||||
char = path[index];
|
||||
} else if (char === "/") {
|
||||
break;
|
||||
} else {
|
||||
char = "/";
|
||||
}
|
||||
if (char === "/") {
|
||||
if (lastSlash === index - 1 || dots === 1) ; else if (dots === 2) {
|
||||
if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
|
||||
if (res.length > 2) {
|
||||
const lastSlashIndex = res.lastIndexOf("/");
|
||||
if (lastSlashIndex === -1) {
|
||||
res = "";
|
||||
lastSegmentLength = 0;
|
||||
} else {
|
||||
res = res.slice(0, lastSlashIndex);
|
||||
lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
|
||||
}
|
||||
lastSlash = index;
|
||||
dots = 0;
|
||||
continue;
|
||||
} else if (res.length > 0) {
|
||||
res = "";
|
||||
lastSegmentLength = 0;
|
||||
lastSlash = index;
|
||||
dots = 0;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (allowAboveRoot) {
|
||||
res += res.length > 0 ? "/.." : "..";
|
||||
lastSegmentLength = 2;
|
||||
}
|
||||
} else {
|
||||
if (res.length > 0) {
|
||||
res += `/${path.slice(lastSlash + 1, index)}`;
|
||||
} else {
|
||||
res = path.slice(lastSlash + 1, index);
|
||||
}
|
||||
lastSegmentLength = index - lastSlash - 1;
|
||||
}
|
||||
lastSlash = index;
|
||||
dots = 0;
|
||||
} else if (char === "." && dots !== -1) {
|
||||
++dots;
|
||||
} else {
|
||||
dots = -1;
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
const isAbsolute = function(p) {
|
||||
return _IS_ABSOLUTE_RE.test(p);
|
||||
};
|
||||
const toNamespacedPath = function(p) {
|
||||
return normalizeWindowsPath(p);
|
||||
};
|
||||
const _EXTNAME_RE = /.(\.[^./]+)$/;
|
||||
const extname = function(p) {
|
||||
const match = _EXTNAME_RE.exec(normalizeWindowsPath(p));
|
||||
return match && match[1] || "";
|
||||
};
|
||||
const relative = function(from, to) {
|
||||
const _from = resolve(from).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
||||
const _to = resolve(to).replace(_ROOT_FOLDER_RE, "$1").split("/");
|
||||
if (_to[0][1] === ":" && _from[0][1] === ":" && _from[0] !== _to[0]) {
|
||||
return _to.join("/");
|
||||
}
|
||||
const _fromCopy = [..._from];
|
||||
for (const segment of _fromCopy) {
|
||||
if (_to[0] !== segment) {
|
||||
break;
|
||||
}
|
||||
_from.shift();
|
||||
_to.shift();
|
||||
}
|
||||
return [..._from.map(() => ".."), ..._to].join("/");
|
||||
};
|
||||
const dirname = function(p) {
|
||||
const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
|
||||
if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
|
||||
segments[0] += "/";
|
||||
}
|
||||
return segments.join("/") || (isAbsolute(p) ? "/" : ".");
|
||||
};
|
||||
const format = function(p) {
|
||||
const segments = [p.root, p.dir, p.base ?? p.name + p.ext].filter(Boolean);
|
||||
return normalizeWindowsPath(
|
||||
p.root ? resolve(...segments) : segments.join("/")
|
||||
);
|
||||
};
|
||||
const basename = function(p, extension) {
|
||||
const lastSegment = normalizeWindowsPath(p).split("/").pop();
|
||||
return extension && lastSegment.endsWith(extension) ? lastSegment.slice(0, -extension.length) : lastSegment;
|
||||
};
|
||||
const parse = function(p) {
|
||||
const root = normalizeWindowsPath(p).split("/").shift() || "/";
|
||||
const base = basename(p);
|
||||
const extension = extname(base);
|
||||
return {
|
||||
root,
|
||||
dir: dirname(p),
|
||||
base,
|
||||
ext: extension,
|
||||
name: base.slice(0, base.length - extension.length)
|
||||
};
|
||||
};
|
||||
|
||||
const path = {
|
||||
__proto__: null,
|
||||
basename: basename,
|
||||
delimiter: delimiter,
|
||||
dirname: dirname,
|
||||
extname: extname,
|
||||
format: format,
|
||||
isAbsolute: isAbsolute,
|
||||
join: join,
|
||||
normalize: normalize,
|
||||
normalizeString: normalizeString,
|
||||
parse: parse,
|
||||
relative: relative,
|
||||
resolve: resolve,
|
||||
sep: sep,
|
||||
toNamespacedPath: toNamespacedPath
|
||||
};
|
||||
|
||||
export { normalize as a, normalizeString as b, relative as c, delimiter as d, extname as e, dirname as f, format as g, basename as h, isAbsolute as i, join as j, parse as k, normalizeWindowsPath as n, path as p, resolve as r, sep as s, toNamespacedPath as t };
|
||||
58
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/utils.cjs
generated
vendored
Normal file
58
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/utils.cjs
generated
vendored
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
'use strict';
|
||||
|
||||
const index = require('./shared/pathe.1f0a373c.cjs');
|
||||
|
||||
const pathSeparators = /* @__PURE__ */ new Set(["/", "\\", void 0]);
|
||||
const normalizedAliasSymbol = Symbol.for("pathe:normalizedAlias");
|
||||
function normalizeAliases(_aliases) {
|
||||
if (_aliases[normalizedAliasSymbol]) {
|
||||
return _aliases;
|
||||
}
|
||||
const aliases = Object.fromEntries(
|
||||
Object.entries(_aliases).sort(([a], [b]) => _compareAliases(a, b))
|
||||
);
|
||||
for (const key in aliases) {
|
||||
for (const alias in aliases) {
|
||||
if (alias === key || key.startsWith(alias)) {
|
||||
continue;
|
||||
}
|
||||
if (aliases[key].startsWith(alias) && pathSeparators.has(aliases[key][alias.length])) {
|
||||
aliases[key] = aliases[alias] + aliases[key].slice(alias.length);
|
||||
}
|
||||
}
|
||||
}
|
||||
Object.defineProperty(aliases, normalizedAliasSymbol, {
|
||||
value: true,
|
||||
enumerable: false
|
||||
});
|
||||
return aliases;
|
||||
}
|
||||
function resolveAlias(path, aliases) {
|
||||
const _path = index.normalizeWindowsPath(path);
|
||||
aliases = normalizeAliases(aliases);
|
||||
for (const [alias, to] of Object.entries(aliases)) {
|
||||
if (!_path.startsWith(alias)) {
|
||||
continue;
|
||||
}
|
||||
const _alias = hasTrailingSlash(alias) ? alias.slice(0, -1) : alias;
|
||||
if (hasTrailingSlash(_path[_alias.length])) {
|
||||
return index.join(to, _path.slice(alias.length));
|
||||
}
|
||||
}
|
||||
return _path;
|
||||
}
|
||||
const FILENAME_RE = /(^|[/\\])([^/\\]+?)(?=(\.[^.]+)?$)/;
|
||||
function filename(path) {
|
||||
return path.match(FILENAME_RE)?.[2];
|
||||
}
|
||||
function _compareAliases(a, b) {
|
||||
return b.split("/").length - a.split("/").length;
|
||||
}
|
||||
function hasTrailingSlash(path = "/") {
|
||||
const lastChar = path[path.length - 1];
|
||||
return lastChar === "/" || lastChar === "\\";
|
||||
}
|
||||
|
||||
exports.filename = filename;
|
||||
exports.normalizeAliases = normalizeAliases;
|
||||
exports.resolveAlias = resolveAlias;
|
||||
5
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/utils.d.cts
generated
vendored
Normal file
5
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/utils.d.cts
generated
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
declare function normalizeAliases(_aliases: Record<string, string>): Record<string, string>;
|
||||
declare function resolveAlias(path: string, aliases: Record<string, string>): string;
|
||||
declare function filename(path: string): string;
|
||||
|
||||
export { filename, normalizeAliases, resolveAlias };
|
||||
5
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/utils.d.mts
generated
vendored
Normal file
5
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/utils.d.mts
generated
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
declare function normalizeAliases(_aliases: Record<string, string>): Record<string, string>;
|
||||
declare function resolveAlias(path: string, aliases: Record<string, string>): string;
|
||||
declare function filename(path: string): string;
|
||||
|
||||
export { filename, normalizeAliases, resolveAlias };
|
||||
5
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/utils.d.ts
generated
vendored
Normal file
5
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/utils.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
declare function normalizeAliases(_aliases: Record<string, string>): Record<string, string>;
|
||||
declare function resolveAlias(path: string, aliases: Record<string, string>): string;
|
||||
declare function filename(path: string): string;
|
||||
|
||||
export { filename, normalizeAliases, resolveAlias };
|
||||
54
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/utils.mjs
generated
vendored
Normal file
54
Frontend-Learner/node_modules/listhen/node_modules/pathe/dist/utils.mjs
generated
vendored
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
import { n as normalizeWindowsPath, j as join } from './shared/pathe.ff20891b.mjs';
|
||||
|
||||
const pathSeparators = /* @__PURE__ */ new Set(["/", "\\", void 0]);
|
||||
const normalizedAliasSymbol = Symbol.for("pathe:normalizedAlias");
|
||||
function normalizeAliases(_aliases) {
|
||||
if (_aliases[normalizedAliasSymbol]) {
|
||||
return _aliases;
|
||||
}
|
||||
const aliases = Object.fromEntries(
|
||||
Object.entries(_aliases).sort(([a], [b]) => _compareAliases(a, b))
|
||||
);
|
||||
for (const key in aliases) {
|
||||
for (const alias in aliases) {
|
||||
if (alias === key || key.startsWith(alias)) {
|
||||
continue;
|
||||
}
|
||||
if (aliases[key].startsWith(alias) && pathSeparators.has(aliases[key][alias.length])) {
|
||||
aliases[key] = aliases[alias] + aliases[key].slice(alias.length);
|
||||
}
|
||||
}
|
||||
}
|
||||
Object.defineProperty(aliases, normalizedAliasSymbol, {
|
||||
value: true,
|
||||
enumerable: false
|
||||
});
|
||||
return aliases;
|
||||
}
|
||||
function resolveAlias(path, aliases) {
|
||||
const _path = normalizeWindowsPath(path);
|
||||
aliases = normalizeAliases(aliases);
|
||||
for (const [alias, to] of Object.entries(aliases)) {
|
||||
if (!_path.startsWith(alias)) {
|
||||
continue;
|
||||
}
|
||||
const _alias = hasTrailingSlash(alias) ? alias.slice(0, -1) : alias;
|
||||
if (hasTrailingSlash(_path[_alias.length])) {
|
||||
return join(to, _path.slice(alias.length));
|
||||
}
|
||||
}
|
||||
return _path;
|
||||
}
|
||||
const FILENAME_RE = /(^|[/\\])([^/\\]+?)(?=(\.[^.]+)?$)/;
|
||||
function filename(path) {
|
||||
return path.match(FILENAME_RE)?.[2];
|
||||
}
|
||||
function _compareAliases(a, b) {
|
||||
return b.split("/").length - a.split("/").length;
|
||||
}
|
||||
function hasTrailingSlash(path = "/") {
|
||||
const lastChar = path[path.length - 1];
|
||||
return lastChar === "/" || lastChar === "\\";
|
||||
}
|
||||
|
||||
export { filename, normalizeAliases, resolveAlias };
|
||||
48
Frontend-Learner/node_modules/listhen/node_modules/pathe/package.json
generated
vendored
Normal file
48
Frontend-Learner/node_modules/listhen/node_modules/pathe/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
{
|
||||
"name": "pathe",
|
||||
"version": "1.1.2",
|
||||
"description": "Universal filesystem path utils",
|
||||
"repository": "unjs/pathe",
|
||||
"license": "MIT",
|
||||
"sideEffects": false,
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.cjs"
|
||||
},
|
||||
"./utils": {
|
||||
"types": "./dist/utils.d.ts",
|
||||
"import": "./dist/utils.mjs",
|
||||
"require": "./dist/utils.cjs"
|
||||
}
|
||||
},
|
||||
"main": "./dist/index.cjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"files": [
|
||||
"dist",
|
||||
"utils.d.ts"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.10.8",
|
||||
"@vitest/coverage-v8": "^1.1.3",
|
||||
"changelogen": "^0.5.5",
|
||||
"eslint": "^8.56.0",
|
||||
"eslint-config-unjs": "^0.2.1",
|
||||
"jiti": "^1.21.0",
|
||||
"prettier": "^3.1.1",
|
||||
"typescript": "^5.3.3",
|
||||
"unbuild": "^2.0.0",
|
||||
"vitest": "^1.1.3"
|
||||
},
|
||||
"packageManager": "pnpm@8.14.0",
|
||||
"scripts": {
|
||||
"build": "unbuild",
|
||||
"dev": "vitest",
|
||||
"lint": "eslint --ext .ts . && prettier -c src test",
|
||||
"lint:fix": "eslint --cache --ext .ts,.js,.mjs,.cjs . --fix && prettier -c src test -w",
|
||||
"release": "pnpm test && pnpm build && changelogen --release && pnpm publish && git push --follow-tags",
|
||||
"test": "pnpm lint && vitest run --coverage",
|
||||
"test:types": "tsc --noEmit"
|
||||
}
|
||||
}
|
||||
1
Frontend-Learner/node_modules/listhen/node_modules/pathe/utils.d.ts
generated
vendored
Normal file
1
Frontend-Learner/node_modules/listhen/node_modules/pathe/utils.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1 @@
|
|||
export * from "./dist/utils";
|
||||
75
Frontend-Learner/node_modules/listhen/package.json
generated
vendored
Normal file
75
Frontend-Learner/node_modules/listhen/package.json
generated
vendored
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
{
|
||||
"name": "listhen",
|
||||
"version": "1.9.0",
|
||||
"description": "👂 Elegant HTTP Listener",
|
||||
"repository": "unjs/listhen",
|
||||
"license": "MIT",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.cjs"
|
||||
},
|
||||
"./cli": {
|
||||
"types": "./dist/cli.d.ts",
|
||||
"import": "./dist/cli.mjs",
|
||||
"require": "./dist/cli.cjs"
|
||||
}
|
||||
},
|
||||
"main": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"bin": {
|
||||
"listen": "./bin/listhen.mjs",
|
||||
"listhen": "./bin/listhen.mjs"
|
||||
},
|
||||
"files": [
|
||||
"dist",
|
||||
"lib",
|
||||
"bin",
|
||||
"cli.d.ts"
|
||||
],
|
||||
"dependencies": {
|
||||
"@parcel/watcher": "^2.4.1",
|
||||
"@parcel/watcher-wasm": "^2.4.1",
|
||||
"citty": "^0.1.6",
|
||||
"clipboardy": "^4.0.0",
|
||||
"consola": "^3.2.3",
|
||||
"crossws": ">=0.2.0 <0.4.0",
|
||||
"defu": "^6.1.4",
|
||||
"get-port-please": "^3.1.2",
|
||||
"h3": "^1.12.0",
|
||||
"http-shutdown": "^1.2.2",
|
||||
"jiti": "^2.1.2",
|
||||
"mlly": "^1.7.1",
|
||||
"node-forge": "^1.3.1",
|
||||
"pathe": "^1.1.2",
|
||||
"std-env": "^3.7.0",
|
||||
"ufo": "^1.5.4",
|
||||
"untun": "^0.1.3",
|
||||
"uqr": "^0.1.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.7.4",
|
||||
"@types/node-forge": "^1.3.11",
|
||||
"@vitest/coverage-v8": "^2.1.2",
|
||||
"automd": "^0.3.9",
|
||||
"changelogen": "^0.5.7",
|
||||
"eslint": "^9.11.1",
|
||||
"eslint-config-unjs": "^0.4.1",
|
||||
"ip-regex": "^5.0.0",
|
||||
"prettier": "^3.3.3",
|
||||
"typescript": "^5.6.2",
|
||||
"unbuild": "^2.0.0",
|
||||
"vitest": "^2.1.2"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "unbuild",
|
||||
"dev": "vitest",
|
||||
"lint": "eslint . && prettier -c src test",
|
||||
"lint:fix": "eslint --fix . && prettier -w src test",
|
||||
"listhen": "node ./scripts/listhen.mjs",
|
||||
"play": "node ./scripts/listhen.mjs -w ./playground --ws",
|
||||
"release": "pnpm test && pnpm build && changelogen --release && pnpm publish && git push --follow-tags",
|
||||
"test": "pnpm lint && vitest run --coverage"
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue