wip:milestone 0 fixes
Some checks failed
CI/CD Pipeline / unit-tests (push) Failing after 1m16s
CI/CD Pipeline / integration-tests (push) Failing after 2m32s
CI/CD Pipeline / lint (push) Successful in 5m22s
CI/CD Pipeline / e2e-tests (push) Has been skipped
CI/CD Pipeline / build (push) Has been skipped

This commit is contained in:
2026-03-15 12:35:42 +02:00
parent 6708cf28a7
commit cffdf8af86
61266 changed files with 4511646 additions and 1938 deletions

21
control-plane-ui/node_modules/mlly/LICENSE generated vendored Normal file
View File

@@ -0,0 +1,21 @@
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.

561
control-plane-ui/node_modules/mlly/README.md generated vendored Normal file
View File

@@ -0,0 +1,561 @@
# mlly
[![npm version][npm-version-src]][npm-version-href]
[![npm downloads][npm-downloads-src]][npm-downloads-href]
[![Codecov][codecov-src]][codecov-href]
> Missing [ECMAScript module](https://nodejs.org/api/esm.html) utils for Node.js
While ESM Modules are evolving in Node.js ecosystem, there are still
many required features that are still experimental or missing or needed to support ESM. This package tries to fill in the gap.
## Usage
Install npm package:
```sh
# using yarn
yarn add mlly
# using npm
npm install mlly
```
**Note:** Node.js 14+ is recommended.
Import utils:
```js
// ESM
import {} from "mlly";
// CommonJS
const {} = require("mlly");
```
## Resolving ESM modules
Several utilities to make ESM resolution easier:
- Respecting [ECMAScript Resolver algorithm](https://nodejs.org/dist/latest-v14.x/docs/api/esm.html#esm_resolver_algorithm)
- Exposed from Node.js implementation
- Windows paths normalized
- Supporting custom `extensions` and `/index` resolution
- Supporting custom `conditions`
- Support resolving from multiple paths or urls
### `resolve` / `resolveSync`
Resolve a module by respecting [ECMAScript Resolver algorithm](https://nodejs.org/dist/latest-v14.x/docs/api/esm.html#esm_resolver_algorithm)
(using [wooorm/import-meta-resolve](https://github.com/wooorm/import-meta-resolve)).
Additionally supports resolving without extension and `/index` similar to CommonJS.
```js
import { resolve, resolveSync } from "mlly";
// file:///home/user/project/module.mjs
console.log(await resolve("./module.mjs", { url: import.meta.url }));
```
**Resolve options:**
- `url`: URL or string to resolve from (default is `pwd()`)
- `conditions`: Array of conditions used for resolution algorithm (default is `['node', 'import']`)
- `extensions`: Array of additional extensions to check if import failed (default is `['.mjs', '.cjs', '.js', '.json']`)
### `resolvePath` / `resolvePathSync`
Similar to `resolve` but returns a path instead of URL using `fileURLToPath`.
```js
import { resolvePath, resolveSync } from "mlly";
// /home/user/project/module.mjs
console.log(await resolvePath("./module.mjs", { url: import.meta.url }));
```
### `createResolve`
Create a `resolve` function with defaults.
```js
import { createResolve } from "mlly";
const _resolve = createResolve({ url: import.meta.url });
// file:///home/user/project/module.mjs
console.log(await _resolve("./module.mjs"));
```
**Example:** Ponyfill [import.meta.resolve](https://nodejs.org/api/esm.html#esm_import_meta_resolve_specifier_parent):
```js
import { createResolve } from "mlly";
import.meta.resolve = createResolve({ url: import.meta.url });
```
### `resolveImports`
Resolve all static and dynamic imports with relative paths to full resolved path.
```js
import { resolveImports } from "mlly";
// import foo from 'file:///home/user/project/bar.mjs'
console.log(
await resolveImports(`import foo from './bar.mjs'`, { url: import.meta.url }),
);
```
## Syntax Analyzes
### `isValidNodeImport`
Using various syntax detection and heuristics, this method can determine if import is a valid import or not to be imported using dynamic `import()` before hitting an error!
When result is `false`, we usually need a to create a CommonJS require context or add specific rules to the bundler to transform dependency.
```js
import { isValidNodeImport } from "mlly";
// If returns true, we are safe to use `import('some-lib')`
await isValidNodeImport("some-lib", {});
```
**Algorithm:**
- Check import protocol - If is `data:` return `true` (✅ valid) - If is not `node:`, `file:` or `data:`, return `false` (
❌ invalid)
- Resolve full path of import using Node.js [Resolution algorithm](https://nodejs.org/api/esm.html#resolution-algorithm)
- Check full path extension
- If is `.mjs`, `.cjs`, `.node` or `.wasm`, return `true` (✅ valid)
- If is not `.js`, return `false` (❌ invalid)
- If is matching known mixed syntax (`.esm.js`, `.es.js`, etc) return `false` (
❌ invalid)
- Read closest `package.json` file to resolve path
- If `type: 'module'` field is set, return `true` (✅ valid)
- Read source code of resolved path
- Try to detect CommonJS syntax usage
- If yes, return `true` (✅ valid)
- Try to detect ESM syntax usage
- if yes, return `false` (
❌ invalid)
**Notes:**
- There might be still edge cases algorithm cannot cover. It is designed with best-efforts.
- This method also allows using dynamic import of CommonJS libraries considering
Node.js has [Interoperability with CommonJS](https://nodejs.org/api/esm.html#interoperability-with-commonjs).
### `hasESMSyntax`
Detect if code, has usage of ESM syntax (Static `import`, ESM `export` and `import.meta` usage)
```js
import { hasESMSyntax } from "mlly";
hasESMSyntax("export default foo = 123"); // true
```
### `hasCJSSyntax`
Detect if code, has usage of CommonJS syntax (`exports`, `module.exports`, `require` and `global` usage)
```js
import { hasCJSSyntax } from "mlly";
hasCJSSyntax("export default foo = 123"); // false
```
### `detectSyntax`
Tests code against both CJS and ESM.
`isMixed` indicates if both are detected! This is a common case with legacy packages exporting semi-compatible ESM syntax meant to be used by bundlers.
```js
import { detectSyntax } from "mlly";
// { hasESM: true, hasCJS: true, isMixed: true }
detectSyntax('export default require("lodash")');
```
## CommonJS Context
### `createCommonJS`
This utility creates a compatible CommonJS context that is missing in ECMAScript modules.
```js
import { createCommonJS } from "mlly";
const { __dirname, __filename, require } = createCommonJS(import.meta.url);
```
Note: `require` and `require.resolve` implementation are lazy functions. [`createRequire`](https://nodejs.org/api/module.html#module_module_createrequire_filename) will be called on first usage.
## Import/Export Analyzes
Tools to quickly analyze ESM syntax and extract static `import`/`export`
- Super fast Regex based implementation
- Handle most edge cases
- Find all static ESM imports
- Find all dynamic ESM imports
- Parse static import statement
- Find all named, declared and default exports
### `findStaticImports`
Find all static ESM imports.
Example:
```js
import { findStaticImports } from "mlly";
console.log(
findStaticImports(`
// Empty line
import foo, { bar /* foo */ } from 'baz'
`),
);
```
Outputs:
```js
[
{
type: "static",
imports: "foo, { bar /* foo */ } ",
specifier: "baz",
code: "import foo, { bar /* foo */ } from 'baz'",
start: 15,
end: 55,
},
];
```
### `parseStaticImport`
Parse a dynamic ESM import statement previously matched by `findStaticImports`.
Example:
```js
import { findStaticImports, parseStaticImport } from "mlly";
const [match0] = findStaticImports(`import baz, { x, y as z } from 'baz'`);
console.log(parseStaticImport(match0));
```
Outputs:
```js
{
type: 'static',
imports: 'baz, { x, y as z } ',
specifier: 'baz',
code: "import baz, { x, y as z } from 'baz'",
start: 0,
end: 36,
defaultImport: 'baz',
namespacedImport: undefined,
namedImports: { x: 'x', y: 'z' }
}
```
### `findDynamicImports`
Find all dynamic ESM imports.
Example:
```js
import { findDynamicImports } from "mlly";
console.log(
findDynamicImports(`
const foo = await import('bar')
`),
);
```
### `findExports`
```js
import { findExports } from "mlly";
console.log(
findExports(`
export const foo = 'bar'
export { bar, baz }
export default something
`),
);
```
Outputs:
```js
[
{
type: "declaration",
declaration: "const",
name: "foo",
code: "export const foo",
start: 1,
end: 17,
},
{
type: "named",
exports: " bar, baz ",
code: "export { bar, baz }",
start: 26,
end: 45,
names: ["bar", "baz"],
},
{ type: "default", code: "export default ", start: 46, end: 61 },
];
```
### `findExportNames`
Same as `findExports` but returns array of export names.
```js
import { findExportNames } from "mlly";
// [ "foo", "bar", "baz", "default" ]
console.log(
findExportNames(`
export const foo = 'bar'
export { bar, baz }
export default something
`),
);
```
## `resolveModuleExportNames`
Resolves module and reads its contents to extract possible export names using static analyzes.
```js
import { resolveModuleExportNames } from "mlly";
// ["basename", "dirname", ... ]
console.log(await resolveModuleExportNames("mlly"));
```
## Evaluating Modules
Set of utilities to evaluate ESM modules using `data:` imports
- Automatic import rewrite to resolved path using static analyzes
- Allow bypass ESM Cache
- Stack-trace support
- `.json` loader
### `evalModule`
Transform and evaluates module code using dynamic imports.
```js
import { evalModule } from "mlly";
await evalModule(`console.log("Hello World!")`);
await evalModule(
`
import { reverse } from './utils.mjs'
console.log(reverse('!emosewa si sj'))
`,
{ url: import.meta.url },
);
```
**Options:**
- all `resolve` options
- `url`: File URL
### `loadModule`
Dynamically loads a module by evaluating source code.
```js
import { loadModule } from "mlly";
await loadModule("./hello.mjs", { url: import.meta.url });
```
Options are same as `evalModule`.
### `transformModule`
- Resolves all relative imports will be resolved
- All usages of `import.meta.url` will be replaced with `url` or `from` option
```js
import { transformModule } from "mlly";
console.log(transformModule(`console.log(import.meta.url)`), {
url: "test.mjs",
});
```
Options are same as `evalModule`.
## Other Utils
### `fileURLToPath`
Similar to [url.fileURLToPath](https://nodejs.org/api/url.html#url_url_fileurltopath_url) but also converts windows backslash `\` to unix slash `/` and handles if input is already a path.
```js
import { fileURLToPath } from "mlly";
// /foo/bar.js
console.log(fileURLToPath("file:///foo/bar.js"));
// C:/path
console.log(fileURLToPath("file:///C:/path/"));
```
### `pathToFileURL`
Similar to [url.pathToFileURL](https://nodejs.org/api/url.html#urlpathtofileurlpath) but also handles `URL` input and returns a **string** with `file://` protocol.
```js
import { pathToFileURL } from "mlly";
// /foo/bar.js
console.log(pathToFileURL("foo/bar.js"));
// C:/path
console.log(pathToFileURL("C:\\path"));
```
### `normalizeid`
Ensures id has either of `node:`, `data:`, `http:`, `https:` or `file:` protocols.
```js
import { ensureProtocol } from "mlly";
// file:///foo/bar.js
console.log(normalizeid("/foo/bar.js"));
```
### `loadURL`
Read source contents of a URL. (currently only file protocol supported)
```js
import { resolve, loadURL } from "mlly";
const url = await resolve("./index.mjs", { url: import.meta.url });
console.log(await loadURL(url));
```
### `toDataURL`
Convert code to [`data:`](https://nodejs.org/api/esm.html#esm_data_imports) URL using base64 encoding.
```js
import { toDataURL } from "mlly";
console.log(
toDataURL(`
// This is an example
console.log('Hello world')
`),
);
```
### `interopDefault`
Return the default export of a module at the top-level, alongside any other named exports.
```js
// Assuming the shape { default: { foo: 'bar' }, baz: 'qux' }
import myModule from "my-module";
// Returns { foo: 'bar', baz: 'qux' }
console.log(interopDefault(myModule));
```
**Options:**
- `preferNamespace`: In case that `default` value exists but is not extendable (when is string for example), return input as-is (default is `false`, meaning `default`'s value is prefered even if cannot be extended)
### `sanitizeURIComponent`
Replace reserved characters from a segment of URI to make it compatible with [rfc2396](https://datatracker.ietf.org/doc/html/rfc2396).
```js
import { sanitizeURIComponent } from "mlly";
// foo_bar
console.log(sanitizeURIComponent(`foo:bar`));
```
### `sanitizeFilePath`
Sanitize each path of a file name or path with `sanitizeURIComponent` for URI compatibility.
```js
import { sanitizeFilePath } from "mlly";
// C:/te_st/_...slug_.jsx'
console.log(sanitizeFilePath("C:\\te#st\\[...slug].jsx"));
```
### `parseNodeModulePath`
Parses an absolute file path in `node_modules` to three segments:
- `dir`: Path to main directory of package
- `name`: Package name
- `subpath`: The optional package subpath
It returns an empty object (with partial keys) if parsing fails.
```js
import { parseNodeModulePath } from "mlly";
// dir: "/src/a/node_modules/"
// name: "lib"
// subpath: "./dist/index.mjs"
const { dir, name, subpath } = parseNodeModulePath(
"/src/a/node_modules/lib/dist/index.mjs",
);
```
### `lookupNodeModuleSubpath`
Parses an absolute file path in `node_modules` and tries to reverse lookup (or guess) the original package exports subpath for it.
```js
import { lookupNodeModuleSubpath } from "mlly";
// subpath: "./utils"
const subpath = lookupNodeModuleSubpath(
"/src/a/node_modules/lib/dist/utils.mjs",
);
```
## License
[MIT](./LICENSE) - Made with 💛
<!-- Badges -->
[npm-version-src]: https://img.shields.io/npm/v/mlly?style=flat&colorA=18181B&colorB=F0DB4F
[npm-version-href]: https://npmjs.com/package/mlly
[npm-downloads-src]: https://img.shields.io/npm/dm/mlly?style=flat&colorA=18181B&colorB=F0DB4F
[npm-downloads-href]: https://npmjs.com/package/mlly
[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/mlly/main?style=flat&colorA=18181B&colorB=F0DB4F
[codecov-href]: https://codecov.io/gh/unjs/mlly

2744
control-plane-ui/node_modules/mlly/dist/index.cjs generated vendored Normal file

File diff suppressed because it is too large Load Diff

564
control-plane-ui/node_modules/mlly/dist/index.d.cts generated vendored Normal file
View File

@@ -0,0 +1,564 @@
interface ResolveOptions {
/**
* A URL, path or array of URLs/paths to resolve against.
*/
url?: string | URL | (string | URL)[];
/**
* File extensions to consider when resolving modules.
*/
extensions?: string[];
/**
* Conditions to consider when resolving package exports.
*/
conditions?: string[];
}
/**
* Synchronously resolves a module path based on the options provided.
*
* @param {string} id - The identifier or path of the module to resolve.
* @param {ResolveOptions} [options] - Options to resolve the module. See {@link ResolveOptions}.
* @returns {string} The resolved URL as a string.
*/
declare function resolveSync(id: string, options?: ResolveOptions): string;
/**
* Asynchronously resolves a module path based on the given options.
*
* @param {string} id - The identifier or path of the module to resolve.
* @param {ResolveOptions} [options] - Options for resolving the module. See {@link ResolveOptions}.
* @returns {Promise<string>} A promise to resolve the URL as a string.
*/
declare function resolve(id: string, options?: ResolveOptions): Promise<string>;
/**
* Synchronously resolves a module path to a local file path based on the given options.
*
* @param {string} id - The identifier or path of the module to resolve.
* @param {ResolveOptions} [options] - Options to resolve the module. See {@link ResolveOptions}.
* @returns {string} The resolved file path.
*/
declare function resolvePathSync(id: string, options?: ResolveOptions): string;
/**
* Asynchronously resolves a module path to a local file path based on the options provided.
*
* @param {string} id - The identifier or path of the module to resolve.
* @param {ResolveOptions} [options] - Options for resolving the module. See {@link ResolveOptions}.
* @returns {Promise<string>} A promise to resolve to the file path.
*/
declare function resolvePath(id: string, options?: ResolveOptions): Promise<string>;
/**
* Creates a resolver function with default options that can be used to resolve module identifiers.
*
* @param {ResolveOptions} [defaults] - Default options to use for all resolutions. See {@link ResolveOptions}.
* @returns {Function} A resolver function that takes an identifier and an optional URL, and resolves the identifier using the default options and the given URL.
*/
declare function createResolve(defaults?: ResolveOptions): (id: string, url?: ResolveOptions["url"]) => Promise<string>;
/**
* Parses a node module path to extract the directory, name, and subpath.
*
* @param {string} path - The path to parse.
* @returns {Object} An object containing the directory, module name, and subpath of the node module.
*/
declare function parseNodeModulePath(path: string): {
dir?: undefined;
name?: undefined;
subpath?: undefined;
} | {
dir: string;
name: string;
subpath: string | undefined;
};
/**
* Attempts to reverse engineer a subpath export within a node module.
*
* @param {string} path - The path within the node module.
* @returns {Promise<string | undefined>} A promise that resolves to the detected subpath or undefined if not found.
*/
declare function lookupNodeModuleSubpath(path: string): Promise<string | undefined>;
/**
* Represents a general structure for ECMAScript module imports.
*/
interface ESMImport {
/**
* Specifies the type of import: "static" for static imports and "dynamic" for dynamic imports.
*/
type: "static" | "dynamic";
/**
* The full import declaration code snippet as a string.
*/
code: string;
/**
* The starting position (index) of the import declaration in the source code.
*/
start: number;
/**
* The end position (index) of the import declaration in the source code.
*/
end: number;
}
/**
* Represents a static import declaration in an ECMAScript module.
* Extends {@link ESMImport}.
*/
interface StaticImport extends ESMImport {
/**
* Indicates the type of import, specifically a static import.
*/
type: "static";
/**
* Contains the entire import statement as a string, excluding the module specifier.
*/
imports: string;
/**
* The module specifier from which imports are being brought in.
*/
specifier: string;
}
/**
* Represents a parsed static import declaration with detailed components of the import.
* Extends {@link StaticImport}.
*/
interface ParsedStaticImport extends StaticImport {
/**
* The default import name, if any.
* @optional
*/
defaultImport?: string;
/**
* The namespace import name, if any, using the `* as` syntax.
* @optional
*/
namespacedImport?: string;
/**
* An object representing named imports, with their local aliases if specified.
* Each property key is the original name and its value is the alias.
* @optional
*/
namedImports?: {
[name: string]: string;
};
}
/**
* Represents a dynamic import declaration that is loaded at runtime.
* Extends {@link ESMImport}.
*/
interface DynamicImport extends ESMImport {
/**
* Indicates that this is a dynamic import.
*/
type: "dynamic";
/**
* The expression or path to be dynamically imported, typically a module path or URL.
*/
expression: string;
}
/**
* Represents a type-specific import, primarily used for importing types in TypeScript.
* Extends {@link ESMImport} but omits the 'type' to redefine it specifically for type imports.
*/
interface TypeImport extends Omit<ESMImport, "type"> {
/**
* Specifies that this is a type import.
*/
type: "type";
/**
* Contains the entire type import statement as a string, excluding the module specifier.
*/
imports: string;
/**
* The module specifier from which to import types.
*/
specifier: string;
}
/**
* Represents a general structure for ECMAScript module exports.
*/
interface ESMExport {
/**
* Optional explicit type for complex scenarios, often used internally.
* @optional
*/
_type?: "declaration" | "named" | "default" | "star";
/**
* The type of export (declaration, named, default or star).
*/
type: "declaration" | "named" | "default" | "star";
/**
* The specific type of declaration being exported, if applicable.
* @optional
*/
declarationType?: "let" | "var" | "const" | "enum" | "const enum" | "class" | "function" | "async function";
/**
* The full code snippet of the export statement.
*/
code: string;
/**
* The starting position (index) of the export declaration in the source code.
*/
start: number;
/**
* The end position (index) of the export declaration in the source code.
*/
end: number;
/**
* The name of the variable, function or class being exported, if given explicitly.
* @optional
*/
name?: string;
/**
* The name used for default exports when a specific identifier isn't given.
* @optional
*/
defaultName?: string;
/**
* An array of names to export, applicable to named and destructured exports.
*/
names: string[];
/**
* The module specifier, if any, from which exports are being re-exported.
* @optional
*/
specifier?: string;
}
/**
* Represents a declaration export within an ECMAScript module.
* Extends {@link ESMExport}.
*/
interface DeclarationExport extends ESMExport {
/**
* Indicates that this export is a declaration export.
*/
type: "declaration";
/**
* The declaration string, such as 'let', 'const', 'class', etc., describing what is being exported.
*/
declaration: string;
/**
* The name of the declaration to be exported.
*/
name: string;
}
/**
* Represents a named export within an ECMAScript module.
* Extends {@link ESMExport}.
*/
interface NamedExport extends ESMExport {
/**
* Specifies that this export is a named export.
*/
type: "named";
/**
* The export string, containing all exported identifiers.
*/
exports: string;
/**
* An array of names to export.
*/
names: string[];
/**
* The module specifier, if any, from which exports are being re-exported.
* @optional
*/
specifier?: string;
}
/**
* Represents a standard export within an ECMAScript module.
* Extends {@link ESMExport}.
*/
interface DefaultExport extends ESMExport {
/**
* Specifies that this export is a standard export.
*/
type: "default";
}
/**
* Regular expression to match static import statements in JavaScript/TypeScript code.
* @example `import { foo, bar as baz } from 'module'`
*/
declare const ESM_STATIC_IMPORT_RE: RegExp;
/**
* Regular expression to match dynamic import statements in JavaScript/TypeScript code.
* @example `import('module')`
*/
declare const DYNAMIC_IMPORT_RE: RegExp;
/**
* Regular expression to match various types of export declarations including variables, functions, and classes.
* @example `export const num = 1, str = 'hello'; export class Example {}`
*/
declare const EXPORT_DECAL_RE: RegExp;
/**
* Regular expression to match export declarations specifically for types, interfaces, and type aliases in TypeScript.
* @example `export type Result = { success: boolean; }; export interface User { name: string; age: number; };`
*/
declare const EXPORT_DECAL_TYPE_RE: RegExp;
/**
* Finds all static import statements within the given code string.
* @param {string} code - The source code to search for static imports.
* @returns {StaticImport[]} An array of {@link StaticImport} objects representing each static import found.
*/
declare function findStaticImports(code: string): StaticImport[];
/**
* Searches for dynamic import statements in the given source code.
* @param {string} code - The source to search for dynamic imports in.
* @returns {DynamicImport[]} An array of {@link DynamicImport} objects representing each dynamic import found.
*/
declare function findDynamicImports(code: string): DynamicImport[];
/**
* Identifies and returns all type import statements in the given source code.
* This function is specifically targeted at type imports used in TypeScript.
* @param {string} code - The source code to search for type imports.
* @returns {TypeImport[]} An array of {@link TypeImport} objects representing each type import found.
*/
declare function findTypeImports(code: string): TypeImport[];
/**
* Parses a static import or type import to extract detailed import elements such as default, namespace and named imports.
* @param {StaticImport | TypeImport} matched - The matched import statement to parse. See {@link StaticImport} and {@link TypeImport}.
* @returns {ParsedStaticImport} A structured object representing the parsed static import. See {@link ParsedStaticImport}.
*/
declare function parseStaticImport(matched: StaticImport | TypeImport): ParsedStaticImport;
/**
* Parses a static import or type import to extract detailed import elements such as default, namespace and named imports.
* @param {StaticImport | TypeImport} matched - The matched import statement to parse. See {@link StaticImport} and {@link TypeImport}.
* @returns {ParsedStaticImport} A structured object representing the parsed static import. See {@link ParsedStaticImport}.
*/
declare function parseTypeImport(matched: TypeImport | StaticImport): ParsedStaticImport;
/**
* Identifies all export statements in the supplied source code and categorises them into different types such as declarations, named, default and star exports.
* This function processes the code to capture different forms of export statements and normalise their representation for further processing.
*
* @param {string} code - The source code containing the export statements to be analysed.
* @returns {ESMExport[]} An array of {@link ESMExport} objects representing each export found, properly categorised and structured.
*/
declare function findExports(code: string): ESMExport[];
/**
* Searches specifically for type-related exports in TypeScript code, such as exported interfaces, types, and declarations prefixed with 'declare'.
* This function uses specialised regular expressions to identify type exports and normalises them for consistency.
*
* @param {string} code - The TypeScript source code to search for type exports.
* @returns {ESMExport[]} An array of {@link ESMExport} objects representing each type export found.
*/
declare function findTypeExports(code: string): ESMExport[];
/**
* Extracts and returns a list of all export names from the given source.
* This function uses {@link findExports} to retrieve all types of exports and consolidates their names into a single array.
*
* @param {string} code - The source code to search for export names.
* @returns {string[]} An array containing the names of all exports found in the code.
*/
declare function findExportNames(code: string): string[];
/**
* Asynchronously resolves and returns all export names from a module specified by its module identifier.
* This function recursively resolves all explicitly named and asterisked (* as) exports to fully enumerate the exported identifiers.
*
* @param {string} id - The module identifier to resolve.
* @param {ResolveOptions} [options] - Optional settings for resolving the module path, such as the base URL.
* @returns {Promise<string[]>} A promise that resolves to an array of export names from the module.
*/
declare function resolveModuleExportNames(id: string, options?: ResolveOptions): Promise<string[]>;
/**
* Represents the context of a CommonJS environment, providing node-like module resolution capabilities within a module.
*/
interface CommonjsContext {
/**
* The absolute path to the current module file.
*/
__filename: string;
/**
* The directory name of the current module.
*/
__dirname: string;
/**
* A function to require modules as in CommonJS.
*/
require: NodeRequire;
}
/**
* Creates a CommonJS context for a given module URL, enabling `require`, `__filename` and `__dirname` support similar to Node.js.
* This function dynamically generates a `require` function that is context-aware and bound to the location of the given module URL.
*
* @param {string} url - The URL of the module file to create a context for.
* @returns {CommonjsContext} A context object containing `__filename`, `__dirname` and a custom `require` function. See {@link CommonjsContext}.
*/
declare function createCommonJS(url: string): CommonjsContext;
declare function interopDefault(sourceModule: any, opts?: {
preferNamespace?: boolean;
}): any;
/**
* Options for evaluating or transforming modules, extending resolution options with optional URL specifications.
*/
interface EvaluateOptions extends ResolveOptions {
/**
* The URL of the module, which can be specified to override the URL resolved from the module identifier.
* @optional
*/
url?: string;
}
/**
* Loads a module by resolving its identifier to a URL, fetching the module's code and evaluating it.
*
* @param {string} id - The identifier of the module to load.
* @param {EvaluateOptions} options - Optional parameters to resolve and load the module. See {@link EvaluateOptions}.
* @returns {Promise<any>} A promise to resolve to the evaluated module.
* });
*/
declare function loadModule(id: string, options?: EvaluateOptions): Promise<any>;
/**
* Evaluates JavaScript code as a module using a dynamic import from a data URL.
*
* @param {string} code - The code of the module to evaluate.
* @param {EvaluateOptions} options - Includes the original URL of the module for better error mapping. See {@link EvaluateOptions}.
* @returns {Promise<any>} A promise that resolves to the evaluated module or throws an error if the evaluation fails.
*/
declare function evalModule(code: string, options?: EvaluateOptions): Promise<any>;
/**
* Transform module code to handle specific scenarios, such as converting JSON to a module or rewriting import.meta.url.
*
* @param {string} code - The code of the module to transform.
* @param {EvaluateOptions} options - Options to control how the code is transformed. See {@link EvaluateOptions}.
* @returns {Promise<string>} A promise that resolves to the transformed code.
*/
declare function transformModule(code: string, options?: EvaluateOptions): Promise<string>;
/**
* Resolves all import URLs found within the provided code to their absolute URLs, based on the given options.
*
* @param {string} code - The code containing the import directives to resolve.
* @param {EvaluateOptions} [options] - Options to use for resolving imports. See {@link EvaluateOptions}.
* @returns {Promise<string>} A promise that resolves to the code, replacing import URLs with resolved URLs.
*/
declare function resolveImports(code: string, options?: EvaluateOptions): Promise<string>;
/**
* Options for detecting syntax within a code string.
*/
type DetectSyntaxOptions = {
/**
* Indicates whether comments should be stripped from the code before syntax checking.
* @default false
*/
stripComments?: boolean;
};
/**
* Determines if a given code string contains ECMAScript module syntax.
*
* @param {string} code - The source code to analyse.
* @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
* @returns {boolean} `true` if the code contains ESM syntax, otherwise `false`.
*/
declare function hasESMSyntax(code: string, opts?: DetectSyntaxOptions): boolean;
/**
* Determines if a given string of code contains CommonJS syntax.
*
* @param {string} code - The source code to analyse.
* @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
* @returns {boolean} `true` if the code contains CommonJS syntax, `false` otherwise.
*/
declare function hasCJSSyntax(code: string, opts?: DetectSyntaxOptions): boolean;
/**
* Analyses the supplied code to determine if it contains ECMAScript module syntax, CommonJS syntax, or both.
*
* @param {string} code - The source code to analyse.
* @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
* @returns {object} An object indicating the presence of ESM syntax (`hasESM`), CJS syntax (`hasCJS`) and whether both syntaxes are present (`isMixed`).
*/
declare function detectSyntax(code: string, opts?: DetectSyntaxOptions): {
hasESM: boolean;
hasCJS: boolean;
isMixed: boolean;
};
interface ValidNodeImportOptions extends ResolveOptions {
/**
* The contents of the import, which may be analyzed to see if it contains
* CJS or ESM syntax as a last step in checking whether it is a valid import.
*/
code?: string;
/**
* Protocols that are allowed as valid node imports.
*
* @default ['node', 'file', 'data']
*
*/
allowedProtocols?: Array<string>;
/**
* Whether to strip comments from the code before checking for ESM syntax.
*
* @default false
*/
stripComments?: boolean;
}
/**
* Validates whether a given identifier represents a valid node import, based on its protocol, file extension, and optionally its contents.
*
* @param {string} id - The identifier or URL of the import to validate.
* @param {ValidNodeImportOptions} _options - Options for resolving and validating the import. See {@link ValidNodeImportOptions}.
* @returns {Promise<boolean>} A promise that resolves to `true` if the import is valid, otherwise `false`.
*/
declare function isValidNodeImport(id: string, _options?: ValidNodeImportOptions): Promise<boolean>;
/**
* Converts a file URL to a local file system path with normalized slashes.
*
* @param {string | URL} id - The file URL or local path to convert.
* @returns {string} A normalized file system path.
*/
declare function fileURLToPath(id: string | URL): string;
/**
* Converts a local file system path to a file URL.
*
* @param {string | URL} id - The file system path to convert.
* @returns {string} The resulting file URL as a string.
*/
declare function pathToFileURL(id: string | URL): string;
/**
* Sanitises a component of a URI by replacing invalid characters.
*
* @param {string} name - The URI component to sanitise.
* @param {string} [replacement="_"] - The string to replace invalid characters with.
* @returns {string} The sanitised URI component.
*/
declare function sanitizeURIComponent(name?: string, replacement?: string): string;
/**
* Cleans a file path string by sanitising each component of the path.
*
* @param {string} filePath - The file path to sanitise.
* @returns {string} The sanitised file path.
*/
declare function sanitizeFilePath(filePath?: string): string;
/**
* Normalises a module identifier to ensure it has a protocol if missing, handling built-in modules and file paths.
*
* @param {string} id - The identifier to normalise.
* @returns {string} The normalised identifier with the appropriate protocol.
*/
declare function normalizeid(id: string): string;
/**
* Loads the contents of a file from a URL into a string.
*
* @param {string} url - The URL of the file to load.
* @returns {Promise<string>} A promise that resolves to the content of the file.
*/
declare function loadURL(url: string): Promise<string>;
/**
* Converts a string of code into a data URL that can be used for dynamic imports.
*
* @param {string} code - The string of code to convert.
* @returns {string} The data URL containing the encoded code.
*/
declare function toDataURL(code: string): string;
/**
* Checks if a module identifier matches a Node.js built-in module.
*
* @param {string} id - The identifier to check.
* @returns {boolean} `true` if the identifier is a built-in module, otherwise `false`.
*/
declare function isNodeBuiltin(id?: string): boolean;
/**
* Extracts the protocol portion of a given identifier string.
*
* @param {string} id - The identifier from which to extract the log.
* @returns {string | undefined} The protocol part of the identifier, or undefined if no protocol is present.
*/
declare function getProtocol(id: string): string | undefined;
export { DYNAMIC_IMPORT_RE, ESM_STATIC_IMPORT_RE, EXPORT_DECAL_RE, EXPORT_DECAL_TYPE_RE, createCommonJS, createResolve, detectSyntax, evalModule, fileURLToPath, findDynamicImports, findExportNames, findExports, findStaticImports, findTypeExports, findTypeImports, getProtocol, hasCJSSyntax, hasESMSyntax, interopDefault, isNodeBuiltin, isValidNodeImport, loadModule, loadURL, lookupNodeModuleSubpath, normalizeid, parseNodeModulePath, parseStaticImport, parseTypeImport, pathToFileURL, resolve, resolveImports, resolveModuleExportNames, resolvePath, resolvePathSync, resolveSync, sanitizeFilePath, sanitizeURIComponent, toDataURL, transformModule };
export type { CommonjsContext, DeclarationExport, DefaultExport, DetectSyntaxOptions, DynamicImport, ESMExport, ESMImport, EvaluateOptions, NamedExport, ParsedStaticImport, ResolveOptions, StaticImport, TypeImport, ValidNodeImportOptions };

564
control-plane-ui/node_modules/mlly/dist/index.d.mts generated vendored Normal file
View File

@@ -0,0 +1,564 @@
interface ResolveOptions {
/**
* A URL, path or array of URLs/paths to resolve against.
*/
url?: string | URL | (string | URL)[];
/**
* File extensions to consider when resolving modules.
*/
extensions?: string[];
/**
* Conditions to consider when resolving package exports.
*/
conditions?: string[];
}
/**
* Synchronously resolves a module path based on the options provided.
*
* @param {string} id - The identifier or path of the module to resolve.
* @param {ResolveOptions} [options] - Options to resolve the module. See {@link ResolveOptions}.
* @returns {string} The resolved URL as a string.
*/
declare function resolveSync(id: string, options?: ResolveOptions): string;
/**
* Asynchronously resolves a module path based on the given options.
*
* @param {string} id - The identifier or path of the module to resolve.
* @param {ResolveOptions} [options] - Options for resolving the module. See {@link ResolveOptions}.
* @returns {Promise<string>} A promise to resolve the URL as a string.
*/
declare function resolve(id: string, options?: ResolveOptions): Promise<string>;
/**
* Synchronously resolves a module path to a local file path based on the given options.
*
* @param {string} id - The identifier or path of the module to resolve.
* @param {ResolveOptions} [options] - Options to resolve the module. See {@link ResolveOptions}.
* @returns {string} The resolved file path.
*/
declare function resolvePathSync(id: string, options?: ResolveOptions): string;
/**
* Asynchronously resolves a module path to a local file path based on the options provided.
*
* @param {string} id - The identifier or path of the module to resolve.
* @param {ResolveOptions} [options] - Options for resolving the module. See {@link ResolveOptions}.
* @returns {Promise<string>} A promise to resolve to the file path.
*/
declare function resolvePath(id: string, options?: ResolveOptions): Promise<string>;
/**
* Creates a resolver function with default options that can be used to resolve module identifiers.
*
* @param {ResolveOptions} [defaults] - Default options to use for all resolutions. See {@link ResolveOptions}.
* @returns {Function} A resolver function that takes an identifier and an optional URL, and resolves the identifier using the default options and the given URL.
*/
declare function createResolve(defaults?: ResolveOptions): (id: string, url?: ResolveOptions["url"]) => Promise<string>;
/**
* Parses a node module path to extract the directory, name, and subpath.
*
* @param {string} path - The path to parse.
* @returns {Object} An object containing the directory, module name, and subpath of the node module.
*/
declare function parseNodeModulePath(path: string): {
dir?: undefined;
name?: undefined;
subpath?: undefined;
} | {
dir: string;
name: string;
subpath: string | undefined;
};
/**
* Attempts to reverse engineer a subpath export within a node module.
*
* @param {string} path - The path within the node module.
* @returns {Promise<string | undefined>} A promise that resolves to the detected subpath or undefined if not found.
*/
declare function lookupNodeModuleSubpath(path: string): Promise<string | undefined>;
/**
* Represents a general structure for ECMAScript module imports.
*/
interface ESMImport {
/**
* Specifies the type of import: "static" for static imports and "dynamic" for dynamic imports.
*/
type: "static" | "dynamic";
/**
* The full import declaration code snippet as a string.
*/
code: string;
/**
* The starting position (index) of the import declaration in the source code.
*/
start: number;
/**
* The end position (index) of the import declaration in the source code.
*/
end: number;
}
/**
* Represents a static import declaration in an ECMAScript module.
* Extends {@link ESMImport}.
*/
interface StaticImport extends ESMImport {
/**
* Indicates the type of import, specifically a static import.
*/
type: "static";
/**
* Contains the entire import statement as a string, excluding the module specifier.
*/
imports: string;
/**
* The module specifier from which imports are being brought in.
*/
specifier: string;
}
/**
* Represents a parsed static import declaration with detailed components of the import.
* Extends {@link StaticImport}.
*/
interface ParsedStaticImport extends StaticImport {
/**
* The default import name, if any.
* @optional
*/
defaultImport?: string;
/**
* The namespace import name, if any, using the `* as` syntax.
* @optional
*/
namespacedImport?: string;
/**
* An object representing named imports, with their local aliases if specified.
* Each property key is the original name and its value is the alias.
* @optional
*/
namedImports?: {
[name: string]: string;
};
}
/**
* Represents a dynamic import declaration that is loaded at runtime.
* Extends {@link ESMImport}.
*/
interface DynamicImport extends ESMImport {
/**
* Indicates that this is a dynamic import.
*/
type: "dynamic";
/**
* The expression or path to be dynamically imported, typically a module path or URL.
*/
expression: string;
}
/**
* Represents a type-specific import, primarily used for importing types in TypeScript.
* Extends {@link ESMImport} but omits the 'type' to redefine it specifically for type imports.
*/
interface TypeImport extends Omit<ESMImport, "type"> {
/**
* Specifies that this is a type import.
*/
type: "type";
/**
* Contains the entire type import statement as a string, excluding the module specifier.
*/
imports: string;
/**
* The module specifier from which to import types.
*/
specifier: string;
}
/**
* Represents a general structure for ECMAScript module exports.
*/
interface ESMExport {
/**
* Optional explicit type for complex scenarios, often used internally.
* @optional
*/
_type?: "declaration" | "named" | "default" | "star";
/**
* The type of export (declaration, named, default or star).
*/
type: "declaration" | "named" | "default" | "star";
/**
* The specific type of declaration being exported, if applicable.
* @optional
*/
declarationType?: "let" | "var" | "const" | "enum" | "const enum" | "class" | "function" | "async function";
/**
* The full code snippet of the export statement.
*/
code: string;
/**
* The starting position (index) of the export declaration in the source code.
*/
start: number;
/**
* The end position (index) of the export declaration in the source code.
*/
end: number;
/**
* The name of the variable, function or class being exported, if given explicitly.
* @optional
*/
name?: string;
/**
* The name used for default exports when a specific identifier isn't given.
* @optional
*/
defaultName?: string;
/**
* An array of names to export, applicable to named and destructured exports.
*/
names: string[];
/**
* The module specifier, if any, from which exports are being re-exported.
* @optional
*/
specifier?: string;
}
/**
* Represents a declaration export within an ECMAScript module.
* Extends {@link ESMExport}.
*/
interface DeclarationExport extends ESMExport {
/**
* Indicates that this export is a declaration export.
*/
type: "declaration";
/**
* The declaration string, such as 'let', 'const', 'class', etc., describing what is being exported.
*/
declaration: string;
/**
* The name of the declaration to be exported.
*/
name: string;
}
/**
* Represents a named export within an ECMAScript module.
* Extends {@link ESMExport}.
*/
interface NamedExport extends ESMExport {
/**
* Specifies that this export is a named export.
*/
type: "named";
/**
* The export string, containing all exported identifiers.
*/
exports: string;
/**
* An array of names to export.
*/
names: string[];
/**
* The module specifier, if any, from which exports are being re-exported.
* @optional
*/
specifier?: string;
}
/**
* Represents a standard export within an ECMAScript module.
* Extends {@link ESMExport}.
*/
interface DefaultExport extends ESMExport {
/**
* Specifies that this export is a standard export.
*/
type: "default";
}
/**
* Regular expression to match static import statements in JavaScript/TypeScript code.
* @example `import { foo, bar as baz } from 'module'`
*/
declare const ESM_STATIC_IMPORT_RE: RegExp;
/**
* Regular expression to match dynamic import statements in JavaScript/TypeScript code.
* @example `import('module')`
*/
declare const DYNAMIC_IMPORT_RE: RegExp;
/**
* Regular expression to match various types of export declarations including variables, functions, and classes.
* @example `export const num = 1, str = 'hello'; export class Example {}`
*/
declare const EXPORT_DECAL_RE: RegExp;
/**
* Regular expression to match export declarations specifically for types, interfaces, and type aliases in TypeScript.
* @example `export type Result = { success: boolean; }; export interface User { name: string; age: number; };`
*/
declare const EXPORT_DECAL_TYPE_RE: RegExp;
/**
* Finds all static import statements within the given code string.
* @param {string} code - The source code to search for static imports.
* @returns {StaticImport[]} An array of {@link StaticImport} objects representing each static import found.
*/
declare function findStaticImports(code: string): StaticImport[];
/**
* Searches for dynamic import statements in the given source code.
* @param {string} code - The source to search for dynamic imports in.
* @returns {DynamicImport[]} An array of {@link DynamicImport} objects representing each dynamic import found.
*/
declare function findDynamicImports(code: string): DynamicImport[];
/**
* Identifies and returns all type import statements in the given source code.
* This function is specifically targeted at type imports used in TypeScript.
* @param {string} code - The source code to search for type imports.
* @returns {TypeImport[]} An array of {@link TypeImport} objects representing each type import found.
*/
declare function findTypeImports(code: string): TypeImport[];
/**
* Parses a static import or type import to extract detailed import elements such as default, namespace and named imports.
* @param {StaticImport | TypeImport} matched - The matched import statement to parse. See {@link StaticImport} and {@link TypeImport}.
* @returns {ParsedStaticImport} A structured object representing the parsed static import. See {@link ParsedStaticImport}.
*/
declare function parseStaticImport(matched: StaticImport | TypeImport): ParsedStaticImport;
/**
* Parses a static import or type import to extract detailed import elements such as default, namespace and named imports.
* @param {StaticImport | TypeImport} matched - The matched import statement to parse. See {@link StaticImport} and {@link TypeImport}.
* @returns {ParsedStaticImport} A structured object representing the parsed static import. See {@link ParsedStaticImport}.
*/
declare function parseTypeImport(matched: TypeImport | StaticImport): ParsedStaticImport;
/**
* Identifies all export statements in the supplied source code and categorises them into different types such as declarations, named, default and star exports.
* This function processes the code to capture different forms of export statements and normalise their representation for further processing.
*
* @param {string} code - The source code containing the export statements to be analysed.
* @returns {ESMExport[]} An array of {@link ESMExport} objects representing each export found, properly categorised and structured.
*/
declare function findExports(code: string): ESMExport[];
/**
* Searches specifically for type-related exports in TypeScript code, such as exported interfaces, types, and declarations prefixed with 'declare'.
* This function uses specialised regular expressions to identify type exports and normalises them for consistency.
*
* @param {string} code - The TypeScript source code to search for type exports.
* @returns {ESMExport[]} An array of {@link ESMExport} objects representing each type export found.
*/
declare function findTypeExports(code: string): ESMExport[];
/**
* Extracts and returns a list of all export names from the given source.
* This function uses {@link findExports} to retrieve all types of exports and consolidates their names into a single array.
*
* @param {string} code - The source code to search for export names.
* @returns {string[]} An array containing the names of all exports found in the code.
*/
declare function findExportNames(code: string): string[];
/**
* Asynchronously resolves and returns all export names from a module specified by its module identifier.
* This function recursively resolves all explicitly named and asterisked (* as) exports to fully enumerate the exported identifiers.
*
* @param {string} id - The module identifier to resolve.
* @param {ResolveOptions} [options] - Optional settings for resolving the module path, such as the base URL.
* @returns {Promise<string[]>} A promise that resolves to an array of export names from the module.
*/
declare function resolveModuleExportNames(id: string, options?: ResolveOptions): Promise<string[]>;
/**
* Represents the context of a CommonJS environment, providing node-like module resolution capabilities within a module.
*/
interface CommonjsContext {
/**
* The absolute path to the current module file.
*/
__filename: string;
/**
* The directory name of the current module.
*/
__dirname: string;
/**
* A function to require modules as in CommonJS.
*/
require: NodeRequire;
}
/**
* Creates a CommonJS context for a given module URL, enabling `require`, `__filename` and `__dirname` support similar to Node.js.
* This function dynamically generates a `require` function that is context-aware and bound to the location of the given module URL.
*
* @param {string} url - The URL of the module file to create a context for.
* @returns {CommonjsContext} A context object containing `__filename`, `__dirname` and a custom `require` function. See {@link CommonjsContext}.
*/
declare function createCommonJS(url: string): CommonjsContext;
declare function interopDefault(sourceModule: any, opts?: {
preferNamespace?: boolean;
}): any;
/**
* Options for evaluating or transforming modules, extending resolution options with optional URL specifications.
*/
interface EvaluateOptions extends ResolveOptions {
/**
* The URL of the module, which can be specified to override the URL resolved from the module identifier.
* @optional
*/
url?: string;
}
/**
* Loads a module by resolving its identifier to a URL, fetching the module's code and evaluating it.
*
* @param {string} id - The identifier of the module to load.
* @param {EvaluateOptions} options - Optional parameters to resolve and load the module. See {@link EvaluateOptions}.
* @returns {Promise<any>} A promise to resolve to the evaluated module.
* });
*/
declare function loadModule(id: string, options?: EvaluateOptions): Promise<any>;
/**
* Evaluates JavaScript code as a module using a dynamic import from a data URL.
*
* @param {string} code - The code of the module to evaluate.
* @param {EvaluateOptions} options - Includes the original URL of the module for better error mapping. See {@link EvaluateOptions}.
* @returns {Promise<any>} A promise that resolves to the evaluated module or throws an error if the evaluation fails.
*/
declare function evalModule(code: string, options?: EvaluateOptions): Promise<any>;
/**
* Transform module code to handle specific scenarios, such as converting JSON to a module or rewriting import.meta.url.
*
* @param {string} code - The code of the module to transform.
* @param {EvaluateOptions} options - Options to control how the code is transformed. See {@link EvaluateOptions}.
* @returns {Promise<string>} A promise that resolves to the transformed code.
*/
declare function transformModule(code: string, options?: EvaluateOptions): Promise<string>;
/**
* Resolves all import URLs found within the provided code to their absolute URLs, based on the given options.
*
* @param {string} code - The code containing the import directives to resolve.
* @param {EvaluateOptions} [options] - Options to use for resolving imports. See {@link EvaluateOptions}.
* @returns {Promise<string>} A promise that resolves to the code, replacing import URLs with resolved URLs.
*/
declare function resolveImports(code: string, options?: EvaluateOptions): Promise<string>;
/**
* Options for detecting syntax within a code string.
*/
type DetectSyntaxOptions = {
/**
* Indicates whether comments should be stripped from the code before syntax checking.
* @default false
*/
stripComments?: boolean;
};
/**
* Determines if a given code string contains ECMAScript module syntax.
*
* @param {string} code - The source code to analyse.
* @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
* @returns {boolean} `true` if the code contains ESM syntax, otherwise `false`.
*/
declare function hasESMSyntax(code: string, opts?: DetectSyntaxOptions): boolean;
/**
* Determines if a given string of code contains CommonJS syntax.
*
* @param {string} code - The source code to analyse.
* @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
* @returns {boolean} `true` if the code contains CommonJS syntax, `false` otherwise.
*/
declare function hasCJSSyntax(code: string, opts?: DetectSyntaxOptions): boolean;
/**
* Analyses the supplied code to determine if it contains ECMAScript module syntax, CommonJS syntax, or both.
*
* @param {string} code - The source code to analyse.
* @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
* @returns {object} An object indicating the presence of ESM syntax (`hasESM`), CJS syntax (`hasCJS`) and whether both syntaxes are present (`isMixed`).
*/
declare function detectSyntax(code: string, opts?: DetectSyntaxOptions): {
hasESM: boolean;
hasCJS: boolean;
isMixed: boolean;
};
interface ValidNodeImportOptions extends ResolveOptions {
/**
* The contents of the import, which may be analyzed to see if it contains
* CJS or ESM syntax as a last step in checking whether it is a valid import.
*/
code?: string;
/**
* Protocols that are allowed as valid node imports.
*
* @default ['node', 'file', 'data']
*
*/
allowedProtocols?: Array<string>;
/**
* Whether to strip comments from the code before checking for ESM syntax.
*
* @default false
*/
stripComments?: boolean;
}
/**
* Validates whether a given identifier represents a valid node import, based on its protocol, file extension, and optionally its contents.
*
* @param {string} id - The identifier or URL of the import to validate.
* @param {ValidNodeImportOptions} _options - Options for resolving and validating the import. See {@link ValidNodeImportOptions}.
* @returns {Promise<boolean>} A promise that resolves to `true` if the import is valid, otherwise `false`.
*/
declare function isValidNodeImport(id: string, _options?: ValidNodeImportOptions): Promise<boolean>;
/**
* Converts a file URL to a local file system path with normalized slashes.
*
* @param {string | URL} id - The file URL or local path to convert.
* @returns {string} A normalized file system path.
*/
declare function fileURLToPath(id: string | URL): string;
/**
* Converts a local file system path to a file URL.
*
* @param {string | URL} id - The file system path to convert.
* @returns {string} The resulting file URL as a string.
*/
declare function pathToFileURL(id: string | URL): string;
/**
* Sanitises a component of a URI by replacing invalid characters.
*
* @param {string} name - The URI component to sanitise.
* @param {string} [replacement="_"] - The string to replace invalid characters with.
* @returns {string} The sanitised URI component.
*/
declare function sanitizeURIComponent(name?: string, replacement?: string): string;
/**
* Cleans a file path string by sanitising each component of the path.
*
* @param {string} filePath - The file path to sanitise.
* @returns {string} The sanitised file path.
*/
declare function sanitizeFilePath(filePath?: string): string;
/**
* Normalises a module identifier to ensure it has a protocol if missing, handling built-in modules and file paths.
*
* @param {string} id - The identifier to normalise.
* @returns {string} The normalised identifier with the appropriate protocol.
*/
declare function normalizeid(id: string): string;
/**
* Loads the contents of a file from a URL into a string.
*
* @param {string} url - The URL of the file to load.
* @returns {Promise<string>} A promise that resolves to the content of the file.
*/
declare function loadURL(url: string): Promise<string>;
/**
* Converts a string of code into a data URL that can be used for dynamic imports.
*
* @param {string} code - The string of code to convert.
* @returns {string} The data URL containing the encoded code.
*/
declare function toDataURL(code: string): string;
/**
* Checks if a module identifier matches a Node.js built-in module.
*
* @param {string} id - The identifier to check.
* @returns {boolean} `true` if the identifier is a built-in module, otherwise `false`.
*/
declare function isNodeBuiltin(id?: string): boolean;
/**
* Extracts the protocol portion of a given identifier string.
*
* @param {string} id - The identifier from which to extract the log.
* @returns {string | undefined} The protocol part of the identifier, or undefined if no protocol is present.
*/
declare function getProtocol(id: string): string | undefined;
export { DYNAMIC_IMPORT_RE, ESM_STATIC_IMPORT_RE, EXPORT_DECAL_RE, EXPORT_DECAL_TYPE_RE, createCommonJS, createResolve, detectSyntax, evalModule, fileURLToPath, findDynamicImports, findExportNames, findExports, findStaticImports, findTypeExports, findTypeImports, getProtocol, hasCJSSyntax, hasESMSyntax, interopDefault, isNodeBuiltin, isValidNodeImport, loadModule, loadURL, lookupNodeModuleSubpath, normalizeid, parseNodeModulePath, parseStaticImport, parseTypeImport, pathToFileURL, resolve, resolveImports, resolveModuleExportNames, resolvePath, resolvePathSync, resolveSync, sanitizeFilePath, sanitizeURIComponent, toDataURL, transformModule };
export type { CommonjsContext, DeclarationExport, DefaultExport, DetectSyntaxOptions, DynamicImport, ESMExport, ESMImport, EvaluateOptions, NamedExport, ParsedStaticImport, ResolveOptions, StaticImport, TypeImport, ValidNodeImportOptions };

564
control-plane-ui/node_modules/mlly/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,564 @@
interface ResolveOptions {
/**
* A URL, path or array of URLs/paths to resolve against.
*/
url?: string | URL | (string | URL)[];
/**
* File extensions to consider when resolving modules.
*/
extensions?: string[];
/**
* Conditions to consider when resolving package exports.
*/
conditions?: string[];
}
/**
* Synchronously resolves a module path based on the options provided.
*
* @param {string} id - The identifier or path of the module to resolve.
* @param {ResolveOptions} [options] - Options to resolve the module. See {@link ResolveOptions}.
* @returns {string} The resolved URL as a string.
*/
declare function resolveSync(id: string, options?: ResolveOptions): string;
/**
* Asynchronously resolves a module path based on the given options.
*
* @param {string} id - The identifier or path of the module to resolve.
* @param {ResolveOptions} [options] - Options for resolving the module. See {@link ResolveOptions}.
* @returns {Promise<string>} A promise to resolve the URL as a string.
*/
declare function resolve(id: string, options?: ResolveOptions): Promise<string>;
/**
* Synchronously resolves a module path to a local file path based on the given options.
*
* @param {string} id - The identifier or path of the module to resolve.
* @param {ResolveOptions} [options] - Options to resolve the module. See {@link ResolveOptions}.
* @returns {string} The resolved file path.
*/
declare function resolvePathSync(id: string, options?: ResolveOptions): string;
/**
* Asynchronously resolves a module path to a local file path based on the options provided.
*
* @param {string} id - The identifier or path of the module to resolve.
* @param {ResolveOptions} [options] - Options for resolving the module. See {@link ResolveOptions}.
* @returns {Promise<string>} A promise to resolve to the file path.
*/
declare function resolvePath(id: string, options?: ResolveOptions): Promise<string>;
/**
* Creates a resolver function with default options that can be used to resolve module identifiers.
*
* @param {ResolveOptions} [defaults] - Default options to use for all resolutions. See {@link ResolveOptions}.
* @returns {Function} A resolver function that takes an identifier and an optional URL, and resolves the identifier using the default options and the given URL.
*/
declare function createResolve(defaults?: ResolveOptions): (id: string, url?: ResolveOptions["url"]) => Promise<string>;
/**
* Parses a node module path to extract the directory, name, and subpath.
*
* @param {string} path - The path to parse.
* @returns {Object} An object containing the directory, module name, and subpath of the node module.
*/
declare function parseNodeModulePath(path: string): {
dir?: undefined;
name?: undefined;
subpath?: undefined;
} | {
dir: string;
name: string;
subpath: string | undefined;
};
/**
* Attempts to reverse engineer a subpath export within a node module.
*
* @param {string} path - The path within the node module.
* @returns {Promise<string | undefined>} A promise that resolves to the detected subpath or undefined if not found.
*/
declare function lookupNodeModuleSubpath(path: string): Promise<string | undefined>;
/**
* Represents a general structure for ECMAScript module imports.
*/
interface ESMImport {
/**
* Specifies the type of import: "static" for static imports and "dynamic" for dynamic imports.
*/
type: "static" | "dynamic";
/**
* The full import declaration code snippet as a string.
*/
code: string;
/**
* The starting position (index) of the import declaration in the source code.
*/
start: number;
/**
* The end position (index) of the import declaration in the source code.
*/
end: number;
}
/**
* Represents a static import declaration in an ECMAScript module.
* Extends {@link ESMImport}.
*/
interface StaticImport extends ESMImport {
/**
* Indicates the type of import, specifically a static import.
*/
type: "static";
/**
* Contains the entire import statement as a string, excluding the module specifier.
*/
imports: string;
/**
* The module specifier from which imports are being brought in.
*/
specifier: string;
}
/**
* Represents a parsed static import declaration with detailed components of the import.
* Extends {@link StaticImport}.
*/
interface ParsedStaticImport extends StaticImport {
/**
* The default import name, if any.
* @optional
*/
defaultImport?: string;
/**
* The namespace import name, if any, using the `* as` syntax.
* @optional
*/
namespacedImport?: string;
/**
* An object representing named imports, with their local aliases if specified.
* Each property key is the original name and its value is the alias.
* @optional
*/
namedImports?: {
[name: string]: string;
};
}
/**
* Represents a dynamic import declaration that is loaded at runtime.
* Extends {@link ESMImport}.
*/
interface DynamicImport extends ESMImport {
/**
* Indicates that this is a dynamic import.
*/
type: "dynamic";
/**
* The expression or path to be dynamically imported, typically a module path or URL.
*/
expression: string;
}
/**
* Represents a type-specific import, primarily used for importing types in TypeScript.
* Extends {@link ESMImport} but omits the 'type' to redefine it specifically for type imports.
*/
interface TypeImport extends Omit<ESMImport, "type"> {
/**
* Specifies that this is a type import.
*/
type: "type";
/**
* Contains the entire type import statement as a string, excluding the module specifier.
*/
imports: string;
/**
* The module specifier from which to import types.
*/
specifier: string;
}
/**
* Represents a general structure for ECMAScript module exports.
*/
interface ESMExport {
/**
* Optional explicit type for complex scenarios, often used internally.
* @optional
*/
_type?: "declaration" | "named" | "default" | "star";
/**
* The type of export (declaration, named, default or star).
*/
type: "declaration" | "named" | "default" | "star";
/**
* The specific type of declaration being exported, if applicable.
* @optional
*/
declarationType?: "let" | "var" | "const" | "enum" | "const enum" | "class" | "function" | "async function";
/**
* The full code snippet of the export statement.
*/
code: string;
/**
* The starting position (index) of the export declaration in the source code.
*/
start: number;
/**
* The end position (index) of the export declaration in the source code.
*/
end: number;
/**
* The name of the variable, function or class being exported, if given explicitly.
* @optional
*/
name?: string;
/**
* The name used for default exports when a specific identifier isn't given.
* @optional
*/
defaultName?: string;
/**
* An array of names to export, applicable to named and destructured exports.
*/
names: string[];
/**
* The module specifier, if any, from which exports are being re-exported.
* @optional
*/
specifier?: string;
}
/**
* Represents a declaration export within an ECMAScript module.
* Extends {@link ESMExport}.
*/
interface DeclarationExport extends ESMExport {
/**
* Indicates that this export is a declaration export.
*/
type: "declaration";
/**
* The declaration string, such as 'let', 'const', 'class', etc., describing what is being exported.
*/
declaration: string;
/**
* The name of the declaration to be exported.
*/
name: string;
}
/**
* Represents a named export within an ECMAScript module.
* Extends {@link ESMExport}.
*/
interface NamedExport extends ESMExport {
/**
* Specifies that this export is a named export.
*/
type: "named";
/**
* The export string, containing all exported identifiers.
*/
exports: string;
/**
* An array of names to export.
*/
names: string[];
/**
* The module specifier, if any, from which exports are being re-exported.
* @optional
*/
specifier?: string;
}
/**
* Represents a standard export within an ECMAScript module.
* Extends {@link ESMExport}.
*/
interface DefaultExport extends ESMExport {
/**
* Specifies that this export is a standard export.
*/
type: "default";
}
/**
* Regular expression to match static import statements in JavaScript/TypeScript code.
* @example `import { foo, bar as baz } from 'module'`
*/
declare const ESM_STATIC_IMPORT_RE: RegExp;
/**
* Regular expression to match dynamic import statements in JavaScript/TypeScript code.
* @example `import('module')`
*/
declare const DYNAMIC_IMPORT_RE: RegExp;
/**
* Regular expression to match various types of export declarations including variables, functions, and classes.
* @example `export const num = 1, str = 'hello'; export class Example {}`
*/
declare const EXPORT_DECAL_RE: RegExp;
/**
* Regular expression to match export declarations specifically for types, interfaces, and type aliases in TypeScript.
* @example `export type Result = { success: boolean; }; export interface User { name: string; age: number; };`
*/
declare const EXPORT_DECAL_TYPE_RE: RegExp;
/**
* Finds all static import statements within the given code string.
* @param {string} code - The source code to search for static imports.
* @returns {StaticImport[]} An array of {@link StaticImport} objects representing each static import found.
*/
declare function findStaticImports(code: string): StaticImport[];
/**
* Searches for dynamic import statements in the given source code.
* @param {string} code - The source to search for dynamic imports in.
* @returns {DynamicImport[]} An array of {@link DynamicImport} objects representing each dynamic import found.
*/
declare function findDynamicImports(code: string): DynamicImport[];
/**
* Identifies and returns all type import statements in the given source code.
* This function is specifically targeted at type imports used in TypeScript.
* @param {string} code - The source code to search for type imports.
* @returns {TypeImport[]} An array of {@link TypeImport} objects representing each type import found.
*/
declare function findTypeImports(code: string): TypeImport[];
/**
* Parses a static import or type import to extract detailed import elements such as default, namespace and named imports.
* @param {StaticImport | TypeImport} matched - The matched import statement to parse. See {@link StaticImport} and {@link TypeImport}.
* @returns {ParsedStaticImport} A structured object representing the parsed static import. See {@link ParsedStaticImport}.
*/
declare function parseStaticImport(matched: StaticImport | TypeImport): ParsedStaticImport;
/**
* Parses a static import or type import to extract detailed import elements such as default, namespace and named imports.
* @param {StaticImport | TypeImport} matched - The matched import statement to parse. See {@link StaticImport} and {@link TypeImport}.
* @returns {ParsedStaticImport} A structured object representing the parsed static import. See {@link ParsedStaticImport}.
*/
declare function parseTypeImport(matched: TypeImport | StaticImport): ParsedStaticImport;
/**
* Identifies all export statements in the supplied source code and categorises them into different types such as declarations, named, default and star exports.
* This function processes the code to capture different forms of export statements and normalise their representation for further processing.
*
* @param {string} code - The source code containing the export statements to be analysed.
* @returns {ESMExport[]} An array of {@link ESMExport} objects representing each export found, properly categorised and structured.
*/
declare function findExports(code: string): ESMExport[];
/**
* Searches specifically for type-related exports in TypeScript code, such as exported interfaces, types, and declarations prefixed with 'declare'.
* This function uses specialised regular expressions to identify type exports and normalises them for consistency.
*
* @param {string} code - The TypeScript source code to search for type exports.
* @returns {ESMExport[]} An array of {@link ESMExport} objects representing each type export found.
*/
declare function findTypeExports(code: string): ESMExport[];
/**
* Extracts and returns a list of all export names from the given source.
* This function uses {@link findExports} to retrieve all types of exports and consolidates their names into a single array.
*
* @param {string} code - The source code to search for export names.
* @returns {string[]} An array containing the names of all exports found in the code.
*/
declare function findExportNames(code: string): string[];
/**
* Asynchronously resolves and returns all export names from a module specified by its module identifier.
* This function recursively resolves all explicitly named and asterisked (* as) exports to fully enumerate the exported identifiers.
*
* @param {string} id - The module identifier to resolve.
* @param {ResolveOptions} [options] - Optional settings for resolving the module path, such as the base URL.
* @returns {Promise<string[]>} A promise that resolves to an array of export names from the module.
*/
declare function resolveModuleExportNames(id: string, options?: ResolveOptions): Promise<string[]>;
/**
* Represents the context of a CommonJS environment, providing node-like module resolution capabilities within a module.
*/
interface CommonjsContext {
/**
* The absolute path to the current module file.
*/
__filename: string;
/**
* The directory name of the current module.
*/
__dirname: string;
/**
* A function to require modules as in CommonJS.
*/
require: NodeRequire;
}
/**
* Creates a CommonJS context for a given module URL, enabling `require`, `__filename` and `__dirname` support similar to Node.js.
* This function dynamically generates a `require` function that is context-aware and bound to the location of the given module URL.
*
* @param {string} url - The URL of the module file to create a context for.
* @returns {CommonjsContext} A context object containing `__filename`, `__dirname` and a custom `require` function. See {@link CommonjsContext}.
*/
declare function createCommonJS(url: string): CommonjsContext;
declare function interopDefault(sourceModule: any, opts?: {
preferNamespace?: boolean;
}): any;
/**
* Options for evaluating or transforming modules, extending resolution options with optional URL specifications.
*/
interface EvaluateOptions extends ResolveOptions {
/**
* The URL of the module, which can be specified to override the URL resolved from the module identifier.
* @optional
*/
url?: string;
}
/**
* Loads a module by resolving its identifier to a URL, fetching the module's code and evaluating it.
*
* @param {string} id - The identifier of the module to load.
* @param {EvaluateOptions} options - Optional parameters to resolve and load the module. See {@link EvaluateOptions}.
* @returns {Promise<any>} A promise to resolve to the evaluated module.
* });
*/
declare function loadModule(id: string, options?: EvaluateOptions): Promise<any>;
/**
* Evaluates JavaScript code as a module using a dynamic import from a data URL.
*
* @param {string} code - The code of the module to evaluate.
* @param {EvaluateOptions} options - Includes the original URL of the module for better error mapping. See {@link EvaluateOptions}.
* @returns {Promise<any>} A promise that resolves to the evaluated module or throws an error if the evaluation fails.
*/
declare function evalModule(code: string, options?: EvaluateOptions): Promise<any>;
/**
* Transform module code to handle specific scenarios, such as converting JSON to a module or rewriting import.meta.url.
*
* @param {string} code - The code of the module to transform.
* @param {EvaluateOptions} options - Options to control how the code is transformed. See {@link EvaluateOptions}.
* @returns {Promise<string>} A promise that resolves to the transformed code.
*/
declare function transformModule(code: string, options?: EvaluateOptions): Promise<string>;
/**
* Resolves all import URLs found within the provided code to their absolute URLs, based on the given options.
*
* @param {string} code - The code containing the import directives to resolve.
* @param {EvaluateOptions} [options] - Options to use for resolving imports. See {@link EvaluateOptions}.
* @returns {Promise<string>} A promise that resolves to the code, replacing import URLs with resolved URLs.
*/
declare function resolveImports(code: string, options?: EvaluateOptions): Promise<string>;
/**
* Options for detecting syntax within a code string.
*/
type DetectSyntaxOptions = {
/**
* Indicates whether comments should be stripped from the code before syntax checking.
* @default false
*/
stripComments?: boolean;
};
/**
* Determines if a given code string contains ECMAScript module syntax.
*
* @param {string} code - The source code to analyse.
* @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
* @returns {boolean} `true` if the code contains ESM syntax, otherwise `false`.
*/
declare function hasESMSyntax(code: string, opts?: DetectSyntaxOptions): boolean;
/**
* Determines if a given string of code contains CommonJS syntax.
*
* @param {string} code - The source code to analyse.
* @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
* @returns {boolean} `true` if the code contains CommonJS syntax, `false` otherwise.
*/
declare function hasCJSSyntax(code: string, opts?: DetectSyntaxOptions): boolean;
/**
* Analyses the supplied code to determine if it contains ECMAScript module syntax, CommonJS syntax, or both.
*
* @param {string} code - The source code to analyse.
* @param {DetectSyntaxOptions} opts - See {@link DetectSyntaxOptions}.
* @returns {object} An object indicating the presence of ESM syntax (`hasESM`), CJS syntax (`hasCJS`) and whether both syntaxes are present (`isMixed`).
*/
declare function detectSyntax(code: string, opts?: DetectSyntaxOptions): {
hasESM: boolean;
hasCJS: boolean;
isMixed: boolean;
};
interface ValidNodeImportOptions extends ResolveOptions {
/**
* The contents of the import, which may be analyzed to see if it contains
* CJS or ESM syntax as a last step in checking whether it is a valid import.
*/
code?: string;
/**
* Protocols that are allowed as valid node imports.
*
* @default ['node', 'file', 'data']
*
*/
allowedProtocols?: Array<string>;
/**
* Whether to strip comments from the code before checking for ESM syntax.
*
* @default false
*/
stripComments?: boolean;
}
/**
* Validates whether a given identifier represents a valid node import, based on its protocol, file extension, and optionally its contents.
*
* @param {string} id - The identifier or URL of the import to validate.
* @param {ValidNodeImportOptions} _options - Options for resolving and validating the import. See {@link ValidNodeImportOptions}.
* @returns {Promise<boolean>} A promise that resolves to `true` if the import is valid, otherwise `false`.
*/
declare function isValidNodeImport(id: string, _options?: ValidNodeImportOptions): Promise<boolean>;
/**
* Converts a file URL to a local file system path with normalized slashes.
*
* @param {string | URL} id - The file URL or local path to convert.
* @returns {string} A normalized file system path.
*/
declare function fileURLToPath(id: string | URL): string;
/**
* Converts a local file system path to a file URL.
*
* @param {string | URL} id - The file system path to convert.
* @returns {string} The resulting file URL as a string.
*/
declare function pathToFileURL(id: string | URL): string;
/**
* Sanitises a component of a URI by replacing invalid characters.
*
* @param {string} name - The URI component to sanitise.
* @param {string} [replacement="_"] - The string to replace invalid characters with.
* @returns {string} The sanitised URI component.
*/
declare function sanitizeURIComponent(name?: string, replacement?: string): string;
/**
* Cleans a file path string by sanitising each component of the path.
*
* @param {string} filePath - The file path to sanitise.
* @returns {string} The sanitised file path.
*/
declare function sanitizeFilePath(filePath?: string): string;
/**
* Normalises a module identifier to ensure it has a protocol if missing, handling built-in modules and file paths.
*
* @param {string} id - The identifier to normalise.
* @returns {string} The normalised identifier with the appropriate protocol.
*/
declare function normalizeid(id: string): string;
/**
* Loads the contents of a file from a URL into a string.
*
* @param {string} url - The URL of the file to load.
* @returns {Promise<string>} A promise that resolves to the content of the file.
*/
declare function loadURL(url: string): Promise<string>;
/**
* Converts a string of code into a data URL that can be used for dynamic imports.
*
* @param {string} code - The string of code to convert.
* @returns {string} The data URL containing the encoded code.
*/
declare function toDataURL(code: string): string;
/**
* Checks if a module identifier matches a Node.js built-in module.
*
* @param {string} id - The identifier to check.
* @returns {boolean} `true` if the identifier is a built-in module, otherwise `false`.
*/
declare function isNodeBuiltin(id?: string): boolean;
/**
* Extracts the protocol portion of a given identifier string.
*
* @param {string} id - The identifier from which to extract the log.
* @returns {string | undefined} The protocol part of the identifier, or undefined if no protocol is present.
*/
declare function getProtocol(id: string): string | undefined;
export { DYNAMIC_IMPORT_RE, ESM_STATIC_IMPORT_RE, EXPORT_DECAL_RE, EXPORT_DECAL_TYPE_RE, createCommonJS, createResolve, detectSyntax, evalModule, fileURLToPath, findDynamicImports, findExportNames, findExports, findStaticImports, findTypeExports, findTypeImports, getProtocol, hasCJSSyntax, hasESMSyntax, interopDefault, isNodeBuiltin, isValidNodeImport, loadModule, loadURL, lookupNodeModuleSubpath, normalizeid, parseNodeModulePath, parseStaticImport, parseTypeImport, pathToFileURL, resolve, resolveImports, resolveModuleExportNames, resolvePath, resolvePathSync, resolveSync, sanitizeFilePath, sanitizeURIComponent, toDataURL, transformModule };
export type { CommonjsContext, DeclarationExport, DefaultExport, DetectSyntaxOptions, DynamicImport, ESMExport, ESMImport, EvaluateOptions, NamedExport, ParsedStaticImport, ResolveOptions, StaticImport, TypeImport, ValidNodeImportOptions };

2696
control-plane-ui/node_modules/mlly/dist/index.mjs generated vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,70 @@
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.
---
Bundled zeptomatch (https://github.com/fabiospampinato/zeptomatch)
The MIT License (MIT)
Copyright (c) 2023-present Fabio Spampinato
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.

View File

@@ -0,0 +1,73 @@
# 🛣️ 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 used 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 provides **identical exports** of Node.js with normalization on **all operations** and is 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, matchesGlob } from "pathe";
// CommonJS
const { resolve, matchesGlob } = require("pathe");
```
Read more about path utils from [Node.js documentation](https://nodejs.org/api/path.html) and rest assured behavior is consistently like POSIX regardless of your input paths format and running platform (the only exception is `delimiter` constant export, it will be set to `;` on windows platform).
### Extra utilities
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,
reverseResolveAlias,
} from "pathe/utils";
```
## License
Made with 💛 Published under the [MIT](./LICENSE) license.
Some code was used from the Node.js project. Glob supported is powered by [zeptomatch](https://github.com/fabiospampinato/zeptomatch).
<!-- 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

View File

@@ -0,0 +1,39 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
const _path = require('./shared/pathe.BSlhyZSM.cjs');
const delimiter = /* @__PURE__ */ (() => globalThis.process?.platform === "win32" ? ";" : ":")();
const _platforms = { posix: void 0, win32: void 0 };
const mix = (del = delimiter) => {
return new Proxy(_path._path, {
get(_, prop) {
if (prop === "delimiter") return del;
if (prop === "posix") return posix;
if (prop === "win32") return win32;
return _platforms[prop] || _path._path[prop];
}
});
};
const posix = /* @__PURE__ */ mix(":");
const win32 = /* @__PURE__ */ mix(";");
exports.basename = _path.basename;
exports.dirname = _path.dirname;
exports.extname = _path.extname;
exports.format = _path.format;
exports.isAbsolute = _path.isAbsolute;
exports.join = _path.join;
exports.matchesGlob = _path.matchesGlob;
exports.normalize = _path.normalize;
exports.normalizeString = _path.normalizeString;
exports.parse = _path.parse;
exports.relative = _path.relative;
exports.resolve = _path.resolve;
exports.sep = _path.sep;
exports.toNamespacedPath = _path.toNamespacedPath;
exports.default = posix;
exports.delimiter = delimiter;
exports.posix = posix;
exports.win32 = win32;

View File

@@ -0,0 +1,47 @@
import * as path from 'node:path';
import path__default from 'node:path';
/**
* Constant for path separator.
*
* Always equals to `"/"`.
*/
declare const sep = "/";
declare const normalize: typeof path__default.normalize;
declare const join: typeof path__default.join;
declare const resolve: typeof path__default.resolve;
/**
* Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
*
* @param path - The path to normalise.
* @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.
* @returns the normalised path string.
*/
declare function normalizeString(path: string, allowAboveRoot: boolean): string;
declare const isAbsolute: typeof path__default.isAbsolute;
declare const toNamespacedPath: typeof path__default.toNamespacedPath;
declare const extname: typeof path__default.extname;
declare const relative: typeof path__default.relative;
declare const dirname: typeof path__default.dirname;
declare const format: typeof path__default.format;
declare const basename: typeof path__default.basename;
declare const parse: typeof path__default.parse;
/**
* The `path.matchesGlob()` method determines if `path` matches the `pattern`.
* @param path The path to glob-match against.
* @param pattern The glob to check the path against.
*/
declare const matchesGlob: (path: string, pattern: string | string[]) => boolean;
type NodePath = typeof path;
/**
* The platform-specific file delimiter.
*
* Equals to `";"` in windows and `":"` in all other platforms.
*/
declare const delimiter: ";" | ":";
declare const posix: NodePath["posix"];
declare const win32: NodePath["win32"];
declare const _default: NodePath;
export { basename, _default as default, delimiter, dirname, extname, format, isAbsolute, join, matchesGlob, normalize, normalizeString, parse, posix, relative, resolve, sep, toNamespacedPath, win32 };

View File

@@ -0,0 +1,47 @@
import * as path from 'node:path';
import path__default from 'node:path';
/**
* Constant for path separator.
*
* Always equals to `"/"`.
*/
declare const sep = "/";
declare const normalize: typeof path__default.normalize;
declare const join: typeof path__default.join;
declare const resolve: typeof path__default.resolve;
/**
* Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
*
* @param path - The path to normalise.
* @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.
* @returns the normalised path string.
*/
declare function normalizeString(path: string, allowAboveRoot: boolean): string;
declare const isAbsolute: typeof path__default.isAbsolute;
declare const toNamespacedPath: typeof path__default.toNamespacedPath;
declare const extname: typeof path__default.extname;
declare const relative: typeof path__default.relative;
declare const dirname: typeof path__default.dirname;
declare const format: typeof path__default.format;
declare const basename: typeof path__default.basename;
declare const parse: typeof path__default.parse;
/**
* The `path.matchesGlob()` method determines if `path` matches the `pattern`.
* @param path The path to glob-match against.
* @param pattern The glob to check the path against.
*/
declare const matchesGlob: (path: string, pattern: string | string[]) => boolean;
type NodePath = typeof path;
/**
* The platform-specific file delimiter.
*
* Equals to `";"` in windows and `":"` in all other platforms.
*/
declare const delimiter: ";" | ":";
declare const posix: NodePath["posix"];
declare const win32: NodePath["win32"];
declare const _default: NodePath;
export { basename, _default as default, delimiter, dirname, extname, format, isAbsolute, join, matchesGlob, normalize, normalizeString, parse, posix, relative, resolve, sep, toNamespacedPath, win32 };

View File

@@ -0,0 +1,47 @@
import * as path from 'node:path';
import path__default from 'node:path';
/**
* Constant for path separator.
*
* Always equals to `"/"`.
*/
declare const sep = "/";
declare const normalize: typeof path__default.normalize;
declare const join: typeof path__default.join;
declare const resolve: typeof path__default.resolve;
/**
* Resolves a string path, resolving '.' and '.' segments and allowing paths above the root.
*
* @param path - The path to normalise.
* @param allowAboveRoot - Whether to allow the resulting path to be above the root directory.
* @returns the normalised path string.
*/
declare function normalizeString(path: string, allowAboveRoot: boolean): string;
declare const isAbsolute: typeof path__default.isAbsolute;
declare const toNamespacedPath: typeof path__default.toNamespacedPath;
declare const extname: typeof path__default.extname;
declare const relative: typeof path__default.relative;
declare const dirname: typeof path__default.dirname;
declare const format: typeof path__default.format;
declare const basename: typeof path__default.basename;
declare const parse: typeof path__default.parse;
/**
* The `path.matchesGlob()` method determines if `path` matches the `pattern`.
* @param path The path to glob-match against.
* @param pattern The glob to check the path against.
*/
declare const matchesGlob: (path: string, pattern: string | string[]) => boolean;
type NodePath = typeof path;
/**
* The platform-specific file delimiter.
*
* Equals to `";"` in windows and `":"` in all other platforms.
*/
declare const delimiter: ";" | ":";
declare const posix: NodePath["posix"];
declare const win32: NodePath["win32"];
declare const _default: NodePath;
export { basename, _default as default, delimiter, dirname, extname, format, isAbsolute, join, matchesGlob, normalize, normalizeString, parse, posix, relative, resolve, sep, toNamespacedPath, win32 };

View File

@@ -0,0 +1,19 @@
import { _ as _path } from './shared/pathe.M-eThtNZ.mjs';
export { c as basename, d as dirname, e as extname, f as format, i as isAbsolute, j as join, m as matchesGlob, n as normalize, a as normalizeString, p as parse, b as relative, r as resolve, s as sep, t as toNamespacedPath } from './shared/pathe.M-eThtNZ.mjs';
const delimiter = /* @__PURE__ */ (() => globalThis.process?.platform === "win32" ? ";" : ":")();
const _platforms = { posix: void 0, win32: void 0 };
const mix = (del = delimiter) => {
return new Proxy(_path, {
get(_, prop) {
if (prop === "delimiter") return del;
if (prop === "posix") return posix;
if (prop === "win32") return win32;
return _platforms[prop] || _path[prop];
}
});
};
const posix = /* @__PURE__ */ mix(":");
const win32 = /* @__PURE__ */ mix(";");
export { posix as default, delimiter, posix, win32 };

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,82 @@
'use strict';
const _path = require('./shared/pathe.BSlhyZSM.cjs');
const pathSeparators = /* @__PURE__ */ new Set(["/", "\\", void 0]);
const normalizedAliasSymbol = Symbol.for("pathe:normalizedAlias");
const SLASH_RE = /[/\\]/;
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$1 = _path.normalizeWindowsPath(path);
aliases = normalizeAliases(aliases);
for (const [alias, to] of Object.entries(aliases)) {
if (!_path$1.startsWith(alias)) {
continue;
}
const _alias = hasTrailingSlash(alias) ? alias.slice(0, -1) : alias;
if (hasTrailingSlash(_path$1[_alias.length])) {
return _path.join(to, _path$1.slice(alias.length));
}
}
return _path$1;
}
function reverseResolveAlias(path, aliases) {
const _path$1 = _path.normalizeWindowsPath(path);
aliases = normalizeAliases(aliases);
const matches = [];
for (const [to, alias] of Object.entries(aliases)) {
if (!_path$1.startsWith(alias)) {
continue;
}
const _alias = hasTrailingSlash(alias) ? alias.slice(0, -1) : alias;
if (hasTrailingSlash(_path$1[_alias.length])) {
matches.push(_path.join(to, _path$1.slice(alias.length)));
}
}
return matches.sort((a, b) => b.length - a.length);
}
function filename(path) {
const base = path.split(SLASH_RE).pop();
if (!base) {
return void 0;
}
const separatorIndex = base.lastIndexOf(".");
if (separatorIndex <= 0) {
return base;
}
return base.slice(0, separatorIndex);
}
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;
exports.reverseResolveAlias = reverseResolveAlias;

View File

@@ -0,0 +1,32 @@
/**
* Normalises alias mappings, ensuring that more specific aliases are resolved before less specific ones.
* This function also ensures that aliases do not resolve to themselves cyclically.
*
* @param _aliases - A set of alias mappings where each key is an alias and its value is the actual path it points to.
* @returns a set of normalised alias mappings.
*/
declare function normalizeAliases(_aliases: Record<string, string>): Record<string, string>;
/**
* Resolves a path string to its alias if applicable, otherwise returns the original path.
* This function normalises the path, resolves the alias and then joins it to the alias target if necessary.
*
* @param path - The path string to resolve.
* @param aliases - A set of alias mappings to use for resolution.
* @returns the resolved path as a string.
*/
declare function resolveAlias(path: string, aliases: Record<string, string>): string;
/**
* Resolves a path string to its possible alias.
*
* Returns an array of possible alias resolutions (could be empty), sorted by specificity (longest first).
*/
declare function reverseResolveAlias(path: string, aliases: Record<string, string>): string[];
/**
* Extracts the filename from a given path, excluding any directory paths and the file extension.
*
* @param path - The full path of the file from which to extract the filename.
* @returns the filename without the extension, or `undefined` if the filename cannot be extracted.
*/
declare function filename(path: string): string | undefined;
export { filename, normalizeAliases, resolveAlias, reverseResolveAlias };

View File

@@ -0,0 +1,32 @@
/**
* Normalises alias mappings, ensuring that more specific aliases are resolved before less specific ones.
* This function also ensures that aliases do not resolve to themselves cyclically.
*
* @param _aliases - A set of alias mappings where each key is an alias and its value is the actual path it points to.
* @returns a set of normalised alias mappings.
*/
declare function normalizeAliases(_aliases: Record<string, string>): Record<string, string>;
/**
* Resolves a path string to its alias if applicable, otherwise returns the original path.
* This function normalises the path, resolves the alias and then joins it to the alias target if necessary.
*
* @param path - The path string to resolve.
* @param aliases - A set of alias mappings to use for resolution.
* @returns the resolved path as a string.
*/
declare function resolveAlias(path: string, aliases: Record<string, string>): string;
/**
* Resolves a path string to its possible alias.
*
* Returns an array of possible alias resolutions (could be empty), sorted by specificity (longest first).
*/
declare function reverseResolveAlias(path: string, aliases: Record<string, string>): string[];
/**
* Extracts the filename from a given path, excluding any directory paths and the file extension.
*
* @param path - The full path of the file from which to extract the filename.
* @returns the filename without the extension, or `undefined` if the filename cannot be extracted.
*/
declare function filename(path: string): string | undefined;
export { filename, normalizeAliases, resolveAlias, reverseResolveAlias };

View File

@@ -0,0 +1,32 @@
/**
* Normalises alias mappings, ensuring that more specific aliases are resolved before less specific ones.
* This function also ensures that aliases do not resolve to themselves cyclically.
*
* @param _aliases - A set of alias mappings where each key is an alias and its value is the actual path it points to.
* @returns a set of normalised alias mappings.
*/
declare function normalizeAliases(_aliases: Record<string, string>): Record<string, string>;
/**
* Resolves a path string to its alias if applicable, otherwise returns the original path.
* This function normalises the path, resolves the alias and then joins it to the alias target if necessary.
*
* @param path - The path string to resolve.
* @param aliases - A set of alias mappings to use for resolution.
* @returns the resolved path as a string.
*/
declare function resolveAlias(path: string, aliases: Record<string, string>): string;
/**
* Resolves a path string to its possible alias.
*
* Returns an array of possible alias resolutions (could be empty), sorted by specificity (longest first).
*/
declare function reverseResolveAlias(path: string, aliases: Record<string, string>): string[];
/**
* Extracts the filename from a given path, excluding any directory paths and the file extension.
*
* @param path - The full path of the file from which to extract the filename.
* @returns the filename without the extension, or `undefined` if the filename cannot be extracted.
*/
declare function filename(path: string): string | undefined;
export { filename, normalizeAliases, resolveAlias, reverseResolveAlias };

View File

@@ -0,0 +1,77 @@
import { g as normalizeWindowsPath, j as join } from './shared/pathe.M-eThtNZ.mjs';
const pathSeparators = /* @__PURE__ */ new Set(["/", "\\", void 0]);
const normalizedAliasSymbol = Symbol.for("pathe:normalizedAlias");
const SLASH_RE = /[/\\]/;
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;
}
function reverseResolveAlias(path, aliases) {
const _path = normalizeWindowsPath(path);
aliases = normalizeAliases(aliases);
const matches = [];
for (const [to, alias] of Object.entries(aliases)) {
if (!_path.startsWith(alias)) {
continue;
}
const _alias = hasTrailingSlash(alias) ? alias.slice(0, -1) : alias;
if (hasTrailingSlash(_path[_alias.length])) {
matches.push(join(to, _path.slice(alias.length)));
}
}
return matches.sort((a, b) => b.length - a.length);
}
function filename(path) {
const base = path.split(SLASH_RE).pop();
if (!base) {
return void 0;
}
const separatorIndex = base.lastIndexOf(".");
if (separatorIndex <= 0) {
return base;
}
return base.slice(0, separatorIndex);
}
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, reverseResolveAlias };

View File

@@ -0,0 +1,61 @@
{
"name": "pathe",
"version": "2.0.3",
"description": "Universal filesystem path utils",
"repository": "unjs/pathe",
"license": "MIT",
"sideEffects": false,
"type": "module",
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.cts",
"default": "./dist/index.cjs"
}
},
"./utils": {
"import": {
"types": "./dist/utils.d.mts",
"default": "./dist/utils.mjs"
},
"require": {
"types": "./dist/utils.d.cts",
"default": "./dist/utils.cjs"
}
}
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist",
"utils.d.ts"
],
"devDependencies": {
"@types/node": "^22.13.1",
"@vitest/coverage-v8": "^3.0.5",
"changelogen": "^0.5.7",
"esbuild": "^0.25.0",
"eslint": "^9.20.1",
"eslint-config-unjs": "^0.4.2",
"jiti": "^2.4.2",
"prettier": "^3.5.0",
"typescript": "^5.7.3",
"unbuild": "^3.3.1",
"vitest": "^3.0.5",
"zeptomatch": "^2.0.0"
},
"scripts": {
"build": "unbuild",
"dev": "vitest",
"lint": "eslint . && prettier -c src test",
"lint:fix": "eslint . --fix && prettier -w src test",
"release": "pnpm test && pnpm build && changelogen --release && pnpm publish && git push --follow-tags",
"test": "pnpm lint && vitest run --coverage",
"test:types": "tsc --noEmit"
}
}

View File

@@ -0,0 +1 @@
export * from "./dist/utils";

55
control-plane-ui/node_modules/mlly/package.json generated vendored Normal file
View File

@@ -0,0 +1,55 @@
{
"name": "mlly",
"version": "1.8.1",
"description": "Missing ECMAScript module utils for Node.js",
"repository": "unjs/mlly",
"license": "MIT",
"sideEffects": false,
"type": "module",
"exports": {
"types": "./dist/index.d.ts",
"import": "./dist/index.mjs",
"require": "./dist/index.cjs"
},
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist"
],
"scripts": {
"build": "unbuild",
"dev": "vitest",
"lint": "eslint src test && prettier -c src test",
"lint:fix": "eslint src test --fix && prettier -w src test",
"release": "pnpm test && pnpm build && changelogen --release && npm publish && git push --follow-tags",
"test": "pnpm lint && pnpm test:types && vitest run",
"test:types": "tsc --noEmit"
},
"dependencies": {
"acorn": "^8.16.0",
"pathe": "^2.0.3",
"pkg-types": "^1.3.1",
"ufo": "^1.6.3"
},
"devDependencies": {
"@types/node": "^25.3.3",
"@vitest/coverage-v8": "^4.0.18",
"changelogen": "^0.6.2",
"eslint": "^10.0.2",
"eslint-config-unjs": "^0.6.2",
"import-meta-resolve": "^4.2.0",
"jiti": "^2.6.1",
"prettier": "^3.8.1",
"std-env": "^3.10.0",
"typescript": "^5.9.3",
"unbuild": "^3.6.1",
"vitest": "^4.0.18"
},
"packageManager": "pnpm@10.20.0",
"pnpm": {
"onlyBuiltDependencies": [
"esbuild"
]
}
}