initial commit

This commit is contained in:
2026-04-05 16:08:59 +03:00
commit 75ab9bec9f
1117 changed files with 789034 additions and 0 deletions

153
editor/node_modules/tsup/dist/chunk-DI5BO6XE.js generated vendored Normal file
View File

@@ -0,0 +1,153 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
var _chunkPEEXUWMSjs = require('./chunk-PEEXUWMS.js');
var _chunkTWFEYLU4js = require('./chunk-TWFEYLU4.js');
// src/cli-main.ts
var _cac = require('cac');
// node_modules/.pnpm/flat@6.0.1/node_modules/flat/index.js
function isBuffer(obj) {
return obj && obj.constructor && typeof obj.constructor.isBuffer === "function" && obj.constructor.isBuffer(obj);
}
function keyIdentity(key) {
return key;
}
function flatten(target, opts) {
opts = opts || {};
const delimiter = opts.delimiter || ".";
const maxDepth = opts.maxDepth;
const transformKey = opts.transformKey || keyIdentity;
const output = {};
function step(object, prev, currentDepth) {
currentDepth = currentDepth || 1;
Object.keys(object).forEach(function(key) {
const value = object[key];
const isarray = opts.safe && Array.isArray(value);
const type = Object.prototype.toString.call(value);
const isbuffer = isBuffer(value);
const isobject = type === "[object Object]" || type === "[object Array]";
const newKey = prev ? prev + delimiter + transformKey(key) : transformKey(key);
if (!isarray && !isbuffer && isobject && Object.keys(value).length && (!opts.maxDepth || currentDepth < maxDepth)) {
return step(value, newKey, currentDepth + 1);
}
output[newKey] = value;
});
}
step(target);
return output;
}
// src/cli-main.ts
function ensureArray(input) {
return Array.isArray(input) ? input : input.split(",");
}
async function main(options = {}) {
const cli = _cac.cac.call(void 0, "tsup");
cli.command("[...files]", "Bundle files", {
ignoreOptionDefaultValue: true
}).option("--entry.* <file>", "Use a key-value pair as entry files").option("-d, --out-dir <dir>", "Output directory", { default: "dist" }).option("--format <format>", 'Bundle format, "cjs", "iife", "esm"', {
default: "cjs"
}).option("--minify [terser]", "Minify bundle").option("--minify-whitespace", "Minify whitespace").option("--minify-identifiers", "Minify identifiers").option("--minify-syntax", "Minify syntax").option(
"--keep-names",
"Keep original function and class names in minified code"
).option("--target <target>", 'Bundle target, "es20XX" or "esnext"', {
default: "es2017"
}).option(
"--legacy-output",
"Output different formats to different folder instead of using different extensions"
).option("--dts [entry]", "Generate declaration file").option("--dts-resolve", "Resolve externals types used for d.ts files").option("--dts-only", "Emit declaration files only").option(
"--experimental-dts [entry]",
"Generate declaration file (experimental)"
).option(
"--sourcemap [inline]",
"Generate external sourcemap, or inline source: --sourcemap inline"
).option(
"--watch [path]",
'Watch mode, if path is not specified, it watches the current folder ".". Repeat "--watch" for more than one path'
).option("--ignore-watch <path>", "Ignore custom paths in watch mode").option(
"--onSuccess <command>",
"Execute command after successful build, specially useful for watch mode"
).option("--env.* <value>", "Define compile-time env variables").option(
"--inject <file>",
"Replace a global variable with an import from another file"
).option("--define.* <value>", "Define compile-time constants").option(
"--external <name>",
"Mark specific packages / package.json (dependencies and peerDependencies) as external"
).option("--global-name <name>", "Global variable name for iife format").option("--jsxFactory <jsxFactory>", "Name of JSX factory function", {
default: "React.createElement"
}).option("--jsxFragment <jsxFragment>", "Name of JSX fragment function", {
default: "React.Fragment"
}).option("--replaceNodeEnv", "Replace process.env.NODE_ENV").option("--no-splitting", "Disable code splitting").option("--clean", "Clean output directory").option(
"--silent",
'Suppress non-error logs (excluding "onSuccess" process output)'
).option("--pure <express>", "Mark specific expressions as pure").option("--metafile", "Emit esbuild metafile (a JSON file)").option("--platform <platform>", "Target platform", {
default: "node"
}).option("--loader <ext=loader>", "Specify the loader for a file extension").option("--tsconfig <filename>", "Use a custom tsconfig").option("--config <filename>", "Use a custom config file").option("--no-config", "Disable config file").option("--shims", "Enable cjs and esm shims").option("--inject-style", "Inject style tag to document head").option(
"--treeshake [strategy]",
'Using Rollup for treeshaking instead, "recommended" or "smallest" or "safest"'
).option("--publicDir [dir]", "Copy public directory to output directory").option(
"--killSignal <signal>",
'Signal to kill child process, "SIGTERM" or "SIGKILL"'
).option("--cjsInterop", "Enable cjs interop").action(async (files, flags) => {
const { build } = await Promise.resolve().then(() => _interopRequireWildcard(require("./index.js")));
Object.assign(options, {
...flags
});
if (!options.entry && files.length > 0) {
options.entry = files.map(_chunkTWFEYLU4js.slash);
}
if (flags.format) {
const format = ensureArray(flags.format);
options.format = format;
}
if (flags.external) {
const external = ensureArray(flags.external);
options.external = external;
}
if (flags.target) {
options.target = flags.target.includes(",") ? flags.target.split(",") : flags.target;
}
if (flags.dts || flags.dtsResolve || flags.dtsOnly) {
options.dts = {};
if (typeof flags.dts === "string") {
options.dts.entry = flags.dts;
}
if (flags.dtsResolve) {
options.dts.resolve = flags.dtsResolve;
}
if (flags.dtsOnly) {
options.dts.only = true;
}
}
if (flags.inject) {
const inject = ensureArray(flags.inject);
options.inject = inject;
}
if (flags.define) {
const define = flatten(flags.define);
options.define = define;
}
if (flags.loader) {
const loader = ensureArray(flags.loader);
options.loader = loader.reduce((result, item) => {
const parts = item.split("=");
return {
...result,
[parts[0]]: parts[1]
};
}, {});
}
await build(options);
});
cli.help();
cli.version(_chunkPEEXUWMSjs.version);
cli.parse(process.argv, { run: false });
await cli.runMatchedCommand();
}
exports.main = main;

42
editor/node_modules/tsup/dist/chunk-JZ25TPTY.js generated vendored Normal file
View File

@@ -0,0 +1,42 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }// src/errors.ts
var _worker_threads = require('worker_threads');
var _picocolors = require('picocolors'); var _picocolors2 = _interopRequireDefault(_picocolors);
var PrettyError = class extends Error {
constructor(message) {
super(message);
this.name = this.constructor.name;
if (typeof Error.captureStackTrace === "function") {
Error.captureStackTrace(this, this.constructor);
} else {
this.stack = new Error(message).stack;
}
}
};
function handleError(error) {
if (error.loc) {
console.error(
_picocolors2.default.bold(
_picocolors2.default.red(
`Error parsing: ${error.loc.file}:${error.loc.line}:${error.loc.column}`
)
)
);
}
if (error.frame) {
console.error(_picocolors2.default.red(error.message));
console.error(_picocolors2.default.dim(error.frame));
} else if (error instanceof PrettyError) {
console.error(_picocolors2.default.red(error.message));
} else {
console.error(_picocolors2.default.red(error.stack));
}
process.exitCode = 1;
if (!_worker_threads.isMainThread && _worker_threads.parentPort) {
_worker_threads.parentPort.postMessage("error");
}
}
exports.PrettyError = PrettyError; exports.handleError = handleError;

6
editor/node_modules/tsup/dist/chunk-PEEXUWMS.js generated vendored Normal file
View File

@@ -0,0 +1,6 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// package.json
var version = "8.5.1";
exports.version = version;

352
editor/node_modules/tsup/dist/chunk-TWFEYLU4.js generated vendored Normal file
View File

@@ -0,0 +1,352 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
}) : x)(function(x) {
if (typeof require !== "undefined") return require.apply(this, arguments);
throw Error('Dynamic require of "' + x + '" is not supported');
});
var __commonJS = (cb, mod) => function __require2() {
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
// If the importer is in node compatibility mode or this is not an ESM
// file that has been converted to a CommonJS file using a Babel-
// compatible transform (i.e. "__esModule" has not been set), then set
// "default" to the CommonJS "module.exports" for node compatibility.
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
mod
));
// src/utils.ts
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
var _resolvefrom = require('resolve-from'); var _resolvefrom2 = _interopRequireDefault(_resolvefrom);
// node_modules/.pnpm/strip-json-comments@5.0.1/node_modules/strip-json-comments/index.js
var singleComment = Symbol("singleComment");
var multiComment = Symbol("multiComment");
var stripWithoutWhitespace = () => "";
var stripWithWhitespace = (string, start, end) => string.slice(start, end).replace(/\S/g, " ");
var isEscaped = (jsonString, quotePosition) => {
let index = quotePosition - 1;
let backslashCount = 0;
while (jsonString[index] === "\\") {
index -= 1;
backslashCount += 1;
}
return Boolean(backslashCount % 2);
};
function stripJsonComments(jsonString, { whitespace = true, trailingCommas = false } = {}) {
if (typeof jsonString !== "string") {
throw new TypeError(`Expected argument \`jsonString\` to be a \`string\`, got \`${typeof jsonString}\``);
}
const strip = whitespace ? stripWithWhitespace : stripWithoutWhitespace;
let isInsideString = false;
let isInsideComment = false;
let offset = 0;
let buffer = "";
let result = "";
let commaIndex = -1;
for (let index = 0; index < jsonString.length; index++) {
const currentCharacter = jsonString[index];
const nextCharacter = jsonString[index + 1];
if (!isInsideComment && currentCharacter === '"') {
const escaped = isEscaped(jsonString, index);
if (!escaped) {
isInsideString = !isInsideString;
}
}
if (isInsideString) {
continue;
}
if (!isInsideComment && currentCharacter + nextCharacter === "//") {
buffer += jsonString.slice(offset, index);
offset = index;
isInsideComment = singleComment;
index++;
} else if (isInsideComment === singleComment && currentCharacter + nextCharacter === "\r\n") {
index++;
isInsideComment = false;
buffer += strip(jsonString, offset, index);
offset = index;
continue;
} else if (isInsideComment === singleComment && currentCharacter === "\n") {
isInsideComment = false;
buffer += strip(jsonString, offset, index);
offset = index;
} else if (!isInsideComment && currentCharacter + nextCharacter === "/*") {
buffer += jsonString.slice(offset, index);
offset = index;
isInsideComment = multiComment;
index++;
continue;
} else if (isInsideComment === multiComment && currentCharacter + nextCharacter === "*/") {
index++;
isInsideComment = false;
buffer += strip(jsonString, offset, index + 1);
offset = index + 1;
continue;
} else if (trailingCommas && !isInsideComment) {
if (commaIndex !== -1) {
if (currentCharacter === "}" || currentCharacter === "]") {
buffer += jsonString.slice(offset, index);
result += strip(buffer, 0, 1) + buffer.slice(1);
buffer = "";
offset = index;
commaIndex = -1;
} else if (currentCharacter !== " " && currentCharacter !== " " && currentCharacter !== "\r" && currentCharacter !== "\n") {
buffer += jsonString.slice(offset, index);
offset = index;
commaIndex = -1;
}
} else if (currentCharacter === ",") {
result += buffer + jsonString.slice(offset, index);
buffer = "";
offset = index;
commaIndex = index;
}
}
}
return result + buffer + (isInsideComment ? strip(jsonString.slice(offset)) : jsonString.slice(offset));
}
// src/utils.ts
var _tinyglobby = require('tinyglobby');
function getPostcss() {
return localRequire("postcss");
}
function getApiExtractor() {
return localRequire("@microsoft/api-extractor");
}
function localRequire(moduleName) {
const p = _resolvefrom2.default.silent(process.cwd(), moduleName);
return p && __require(p);
}
async function removeFiles(patterns, dir) {
const files = await _tinyglobby.glob.call(void 0, patterns, {
cwd: dir,
absolute: true
});
files.forEach((file) => _fs2.default.existsSync(file) && _fs2.default.unlinkSync(file));
}
function debouncePromise(fn, delay, onError) {
let timeout;
let promiseInFly;
let callbackPending;
return function debounced(...args) {
if (promiseInFly) {
callbackPending = () => {
debounced(...args);
callbackPending = void 0;
};
} else {
if (timeout != null) clearTimeout(timeout);
timeout = setTimeout(() => {
timeout = void 0;
promiseInFly = fn(...args).catch(onError).finally(() => {
promiseInFly = void 0;
if (callbackPending) callbackPending();
});
}, delay);
}
};
}
function slash(path2) {
const isExtendedLengthPath = path2.startsWith("\\\\?\\");
if (isExtendedLengthPath) {
return path2;
}
return path2.replace(/\\/g, "/");
}
function truthy(value) {
return Boolean(value);
}
function jsoncParse(data) {
try {
return new Function(`return ${stripJsonComments(data).trim()}`)();
} catch (e2) {
return {};
}
}
function defaultOutExtension({
format,
pkgType
}) {
let jsExtension = ".js";
let dtsExtension = ".d.ts";
const isModule = pkgType === "module";
if (isModule && format === "cjs") {
jsExtension = ".cjs";
dtsExtension = ".d.cts";
}
if (!isModule && format === "esm") {
jsExtension = ".mjs";
dtsExtension = ".d.mts";
}
if (format === "iife") {
jsExtension = ".global.js";
}
return {
js: jsExtension,
dts: dtsExtension
};
}
function ensureTempDeclarationDir() {
const cwd = process.cwd();
const dirPath = _path2.default.join(cwd, ".tsup", "declaration");
if (_fs2.default.existsSync(dirPath)) {
return dirPath;
}
_fs2.default.mkdirSync(dirPath, { recursive: true });
const gitIgnorePath = _path2.default.join(cwd, ".tsup", ".gitignore");
writeFileSync(gitIgnorePath, "**/*\n");
return dirPath;
}
var toObjectEntry = (entry) => {
if (typeof entry === "string") {
entry = [entry];
}
if (!Array.isArray(entry)) {
return entry;
}
entry = entry.map((e) => e.replace(/\\/g, "/"));
const ancestor = findLowestCommonAncestor(entry);
return entry.reduce(
(result, item) => {
const key = item.replace(ancestor, "").replace(/^\//, "").replace(/\.[a-z]+$/, "");
return {
...result,
[key]: item
};
},
{}
);
};
var findLowestCommonAncestor = (filepaths) => {
if (filepaths.length <= 1) return "";
const [first, ...rest] = filepaths;
let ancestor = first.split("/");
for (const filepath of rest) {
const directories = filepath.split("/", ancestor.length);
let index = 0;
for (const directory of directories) {
if (directory === ancestor[index]) {
index += 1;
} else {
ancestor = ancestor.slice(0, index);
break;
}
}
ancestor = ancestor.slice(0, index);
}
return ancestor.length <= 1 && ancestor[0] === "" ? `/${ancestor[0]}` : ancestor.join("/");
};
function toAbsolutePath(p, cwd) {
if (_path2.default.isAbsolute(p)) {
return p;
}
return slash(_path2.default.normalize(_path2.default.join(cwd || process.cwd(), p)));
}
function writeFileSync(filePath, content) {
_fs2.default.mkdirSync(_path2.default.dirname(filePath), { recursive: true });
_fs2.default.writeFileSync(filePath, content);
}
function replaceDtsWithJsExtensions(dtsFilePath) {
return dtsFilePath.replace(
/\.d\.(ts|mts|cts)$/,
(_, fileExtension) => {
switch (fileExtension) {
case "ts":
return ".js";
case "mts":
return ".mjs";
case "cts":
return ".cjs";
default:
return "";
}
}
);
}
var convertArrayEntriesToObjectEntries = (arrayOfEntries) => {
const objectEntries = Object.fromEntries(
arrayOfEntries.map(
(entry) => [
_path2.default.posix.join(
...entry.split(_path2.default.posix.sep).slice(1, -1).concat(_path2.default.parse(entry).name)
),
entry
]
)
);
return objectEntries;
};
var resolveEntryPaths = async (entryPaths) => {
const resolvedEntryPaths = typeof entryPaths === "string" || Array.isArray(entryPaths) ? convertArrayEntriesToObjectEntries(await _tinyglobby.glob.call(void 0, entryPaths)) : entryPaths;
return resolvedEntryPaths;
};
var resolveExperimentalDtsConfig = async (options, tsconfig) => {
const resolvedEntryPaths = await resolveEntryPaths(
_optionalChain([options, 'access', _2 => _2.experimentalDts, 'optionalAccess', _3 => _3.entry]) || options.entry
);
const experimentalDtsObjectEntry = Object.keys(resolvedEntryPaths).length === 0 ? Array.isArray(options.entry) ? convertArrayEntriesToObjectEntries(options.entry) : options.entry : resolvedEntryPaths;
const normalizedExperimentalDtsConfig = {
compilerOptions: {
...tsconfig.data.compilerOptions || {},
..._optionalChain([options, 'access', _4 => _4.experimentalDts, 'optionalAccess', _5 => _5.compilerOptions]) || {}
},
entry: experimentalDtsObjectEntry
};
return normalizedExperimentalDtsConfig;
};
var resolveInitialExperimentalDtsConfig = async (experimentalDts) => {
if (experimentalDts == null) {
return;
}
if (typeof experimentalDts === "boolean")
return experimentalDts ? { entry: {} } : void 0;
if (typeof experimentalDts === "string") {
return {
entry: convertArrayEntriesToObjectEntries(await _tinyglobby.glob.call(void 0, experimentalDts))
};
}
return {
...experimentalDts,
entry: _optionalChain([experimentalDts, 'optionalAccess', _6 => _6.entry]) == null ? {} : await resolveEntryPaths(experimentalDts.entry)
};
};
exports.__require = __require; exports.__commonJS = __commonJS; exports.__toESM = __toESM; exports.getPostcss = getPostcss; exports.getApiExtractor = getApiExtractor; exports.localRequire = localRequire; exports.removeFiles = removeFiles; exports.debouncePromise = debouncePromise; exports.slash = slash; exports.truthy = truthy; exports.jsoncParse = jsoncParse; exports.defaultOutExtension = defaultOutExtension; exports.ensureTempDeclarationDir = ensureTempDeclarationDir; exports.toObjectEntry = toObjectEntry; exports.toAbsolutePath = toAbsolutePath; exports.writeFileSync = writeFileSync; exports.replaceDtsWithJsExtensions = replaceDtsWithJsExtensions; exports.resolveExperimentalDtsConfig = resolveExperimentalDtsConfig; exports.resolveInitialExperimentalDtsConfig = resolveInitialExperimentalDtsConfig;

203
editor/node_modules/tsup/dist/chunk-VGC3FXLU.js generated vendored Normal file
View File

@@ -0,0 +1,203 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
var _chunkTWFEYLU4js = require('./chunk-TWFEYLU4.js');
// src/load.ts
var _fs = require('fs'); var _fs2 = _interopRequireDefault(_fs);
var _path = require('path'); var _path2 = _interopRequireDefault(_path);
var _joycon = require('joycon'); var _joycon2 = _interopRequireDefault(_joycon);
var _bundlerequire = require('bundle-require');
var joycon = new (0, _joycon2.default)();
var loadJson = async (filepath) => {
try {
return _chunkTWFEYLU4js.jsoncParse.call(void 0, await _fs2.default.promises.readFile(filepath, "utf8"));
} catch (error) {
if (error instanceof Error) {
throw new Error(
`Failed to parse ${_path2.default.relative(process.cwd(), filepath)}: ${error.message}`
);
} else {
throw error;
}
}
};
var jsonLoader = {
test: /\.json$/,
load(filepath) {
return loadJson(filepath);
}
};
joycon.addLoader(jsonLoader);
async function loadTsupConfig(cwd, configFile) {
const configJoycon = new (0, _joycon2.default)();
const configPath = await configJoycon.resolve({
files: configFile ? [configFile] : [
"tsup.config.ts",
"tsup.config.cts",
"tsup.config.mts",
"tsup.config.js",
"tsup.config.cjs",
"tsup.config.mjs",
"tsup.config.json",
"package.json"
],
cwd,
stopDir: _path2.default.parse(cwd).root,
packageKey: "tsup"
});
if (configPath) {
if (configPath.endsWith(".json")) {
let data = await loadJson(configPath);
if (configPath.endsWith("package.json")) {
data = data.tsup;
}
if (data) {
return { path: configPath, data };
}
return {};
}
const config = await _bundlerequire.bundleRequire.call(void 0, {
filepath: configPath
});
return {
path: configPath,
data: config.mod.tsup || config.mod.default || config.mod
};
}
return {};
}
async function loadPkg(cwd, clearCache = false) {
if (clearCache) {
joycon.clearCache();
}
const { data } = await joycon.load(["package.json"], cwd, _path2.default.dirname(cwd));
return data || {};
}
async function getProductionDeps(cwd, clearCache = false) {
const data = await loadPkg(cwd, clearCache);
const deps = Array.from(
/* @__PURE__ */ new Set([
...Object.keys(data.dependencies || {}),
...Object.keys(data.peerDependencies || {})
])
);
return deps;
}
async function getAllDepsHash(cwd) {
const data = await loadPkg(cwd, true);
return JSON.stringify({
...data.dependencies,
...data.peerDependencies,
...data.devDependencies
});
}
// src/log.ts
var _util = require('util'); var _util2 = _interopRequireDefault(_util);
var _worker_threads = require('worker_threads');
var _picocolors = require('picocolors'); var _picocolors2 = _interopRequireDefault(_picocolors);
var colorize = (type, data, onlyImportant = false) => {
if (onlyImportant && (type === "info" || type === "success")) return data;
const color = type === "info" ? "blue" : type === "error" ? "red" : type === "warn" ? "yellow" : "green";
return _picocolors2.default[color](data);
};
var makeLabel = (name, input, type) => {
return [
name && `${_picocolors2.default.dim("[")}${name.toUpperCase()}${_picocolors2.default.dim("]")}`,
colorize(type, input.toUpperCase())
].filter(Boolean).join(" ");
};
var silent = false;
function setSilent(isSilent) {
silent = !!isSilent;
}
function getSilent() {
return silent;
}
var createLogger = (name) => {
return {
setName(_name) {
name = _name;
},
success(label, ...args) {
return this.log(label, "success", ...args);
},
info(label, ...args) {
return this.log(label, "info", ...args);
},
error(label, ...args) {
return this.log(label, "error", ...args);
},
warn(label, ...args) {
return this.log(label, "warn", ...args);
},
log(label, type, ...data) {
const args = [
makeLabel(name, label, type),
...data.map((item) => colorize(type, item, true))
];
switch (type) {
case "error": {
if (!_worker_threads.isMainThread) {
_optionalChain([_worker_threads.parentPort, 'optionalAccess', _ => _.postMessage, 'call', _2 => _2({
type: "error",
text: _util2.default.format(...args)
})]);
return;
}
return console.error(...args);
}
default:
if (silent) return;
if (!_worker_threads.isMainThread) {
_optionalChain([_worker_threads.parentPort, 'optionalAccess', _3 => _3.postMessage, 'call', _4 => _4({
type: "log",
text: _util2.default.format(...args)
})]);
return;
}
console.log(...args);
}
}
};
};
// src/lib/report-size.ts
var prettyBytes = (bytes) => {
if (bytes === 0) return "0 B";
const unit = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
const exp = Math.floor(Math.log(bytes) / Math.log(1024));
return `${(bytes / 1024 ** exp).toFixed(2)} ${unit[exp]}`;
};
var getLengthOfLongestString = (strings) => {
return strings.reduce((max, str) => {
return Math.max(max, str.length);
}, 0);
};
var padRight = (str, maxLength) => {
return str + " ".repeat(maxLength - str.length);
};
var reportSize = (logger, format, files) => {
const filenames = Object.keys(files);
const maxLength = getLengthOfLongestString(filenames) + 1;
for (const name of filenames) {
logger.success(
format,
`${_picocolors2.default.bold(padRight(name, maxLength))}${_picocolors2.default.green(
prettyBytes(files[name])
)}`
);
}
};
exports.loadTsupConfig = loadTsupConfig; exports.loadPkg = loadPkg; exports.getProductionDeps = getProductionDeps; exports.getAllDepsHash = getAllDepsHash; exports.setSilent = setSilent; exports.getSilent = getSilent; exports.createLogger = createLogger; exports.reportSize = reportSize;

12
editor/node_modules/tsup/dist/cli-default.js generated vendored Executable file
View File

@@ -0,0 +1,12 @@
#!/usr/bin/env node
"use strict";
var _chunkDI5BO6XEjs = require('./chunk-DI5BO6XE.js');
require('./chunk-PEEXUWMS.js');
var _chunkJZ25TPTYjs = require('./chunk-JZ25TPTY.js');
require('./chunk-TWFEYLU4.js');
// src/cli-default.ts
_chunkDI5BO6XEjs.main.call(void 0, ).catch(_chunkJZ25TPTYjs.handleError);

8
editor/node_modules/tsup/dist/cli-main.js generated vendored Normal file
View File

@@ -0,0 +1,8 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
var _chunkDI5BO6XEjs = require('./chunk-DI5BO6XE.js');
require('./chunk-PEEXUWMS.js');
require('./chunk-TWFEYLU4.js');
exports.main = _chunkDI5BO6XEjs.main;

14
editor/node_modules/tsup/dist/cli-node.js generated vendored Executable file
View File

@@ -0,0 +1,14 @@
#!/usr/bin/env node
"use strict";
var _chunkDI5BO6XEjs = require('./chunk-DI5BO6XE.js');
require('./chunk-PEEXUWMS.js');
var _chunkJZ25TPTYjs = require('./chunk-JZ25TPTY.js');
require('./chunk-TWFEYLU4.js');
// src/cli-node.ts
_chunkDI5BO6XEjs.main.call(void 0, {
skipNodeModulesBundle: true
}).catch(_chunkJZ25TPTYjs.handleError);

511
editor/node_modules/tsup/dist/index.d.ts generated vendored Normal file
View File

@@ -0,0 +1,511 @@
import { BuildOptions, Metafile, Plugin as Plugin$1, Loader } from 'esbuild';
import { SourceMap, TreeshakingOptions, TreeshakingPreset, InputOption } from 'rollup';
import { SectionedSourceMapInput } from './types.cts';
import { RawSourceMap } from 'source-map';
import { Options as Options$1 } from '@swc/core';
/// <reference lib="es2015" />
type ECMA = 5 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020;
type ConsoleProperty = keyof typeof console;
type DropConsoleOption = boolean | ConsoleProperty[];
interface ParseOptions {
bare_returns?: boolean;
/** @deprecated legacy option. Currently, all supported EcmaScript is valid to parse. */
ecma?: ECMA;
html5_comments?: boolean;
shebang?: boolean;
}
interface CompressOptions {
arguments?: boolean;
arrows?: boolean;
booleans_as_integers?: boolean;
booleans?: boolean;
collapse_vars?: boolean;
comparisons?: boolean;
computed_props?: boolean;
conditionals?: boolean;
dead_code?: boolean;
defaults?: boolean;
directives?: boolean;
drop_console?: DropConsoleOption;
drop_debugger?: boolean;
ecma?: ECMA;
evaluate?: boolean;
expression?: boolean;
global_defs?: object;
hoist_funs?: boolean;
hoist_props?: boolean;
hoist_vars?: boolean;
ie8?: boolean;
if_return?: boolean;
inline?: boolean | InlineFunctions;
join_vars?: boolean;
keep_classnames?: boolean | RegExp;
keep_fargs?: boolean;
keep_fnames?: boolean | RegExp;
keep_infinity?: boolean;
lhs_constants?: boolean;
loops?: boolean;
module?: boolean;
negate_iife?: boolean;
passes?: number;
properties?: boolean;
pure_funcs?: string[];
pure_new?: boolean;
pure_getters?: boolean | 'strict';
reduce_funcs?: boolean;
reduce_vars?: boolean;
sequences?: boolean | number;
side_effects?: boolean;
switches?: boolean;
toplevel?: boolean;
top_retain?: null | string | string[] | RegExp;
typeofs?: boolean;
unsafe_arrows?: boolean;
unsafe?: boolean;
unsafe_comps?: boolean;
unsafe_Function?: boolean;
unsafe_math?: boolean;
unsafe_symbols?: boolean;
unsafe_methods?: boolean;
unsafe_proto?: boolean;
unsafe_regexp?: boolean;
unsafe_undefined?: boolean;
unused?: boolean;
}
declare enum InlineFunctions {
Disabled = 0,
SimpleFunctions = 1,
WithArguments = 2,
WithArgumentsAndVariables = 3
}
interface MangleOptions {
eval?: boolean;
keep_classnames?: boolean | RegExp;
keep_fnames?: boolean | RegExp;
module?: boolean;
nth_identifier?: SimpleIdentifierMangler | WeightedIdentifierMangler;
properties?: boolean | ManglePropertiesOptions;
reserved?: string[];
safari10?: boolean;
toplevel?: boolean;
}
/**
* An identifier mangler for which the output is invariant with respect to the source code.
*/
interface SimpleIdentifierMangler {
/**
* Obtains the nth most favored (usually shortest) identifier to rename a variable to.
* The mangler will increment n and retry until the return value is not in use in scope, and is not a reserved word.
* This function is expected to be stable; Evaluating get(n) === get(n) should always return true.
* @param n The ordinal of the identifier.
*/
get(n: number): string;
}
/**
* An identifier mangler that leverages character frequency analysis to determine identifier precedence.
*/
interface WeightedIdentifierMangler extends SimpleIdentifierMangler {
/**
* Modifies the internal weighting of the input characters by the specified delta.
* Will be invoked on the entire printed AST, and then deduct mangleable identifiers.
* @param chars The characters to modify the weighting of.
* @param delta The numeric weight to add to the characters.
*/
consider(chars: string, delta: number): number;
/**
* Resets character weights.
*/
reset(): void;
/**
* Sorts identifiers by character frequency, in preparation for calls to get(n).
*/
sort(): void;
}
interface ManglePropertiesOptions {
builtins?: boolean;
debug?: boolean;
keep_quoted?: boolean | 'strict';
nth_identifier?: SimpleIdentifierMangler | WeightedIdentifierMangler;
regex?: RegExp | string;
reserved?: string[];
}
interface FormatOptions {
ascii_only?: boolean;
/** @deprecated Not implemented anymore */
beautify?: boolean;
braces?: boolean;
comments?: boolean | 'all' | 'some' | RegExp | ( (node: any, comment: {
value: string,
type: 'comment1' | 'comment2' | 'comment3' | 'comment4',
pos: number,
line: number,
col: number,
}) => boolean );
ecma?: ECMA;
ie8?: boolean;
keep_numbers?: boolean;
indent_level?: number;
indent_start?: number;
inline_script?: boolean;
keep_quoted_props?: boolean;
max_line_len?: number | false;
preamble?: string;
preserve_annotations?: boolean;
quote_keys?: boolean;
quote_style?: OutputQuoteStyle;
safari10?: boolean;
semicolons?: boolean;
shebang?: boolean;
shorthand?: boolean;
source_map?: SourceMapOptions;
webkit?: boolean;
width?: number;
wrap_iife?: boolean;
wrap_func_args?: boolean;
}
declare enum OutputQuoteStyle {
PreferDouble = 0,
AlwaysSingle = 1,
AlwaysDouble = 2,
AlwaysOriginal = 3
}
interface MinifyOptions {
compress?: boolean | CompressOptions;
ecma?: ECMA;
enclose?: boolean | string;
ie8?: boolean;
keep_classnames?: boolean | RegExp;
keep_fnames?: boolean | RegExp;
mangle?: boolean | MangleOptions;
module?: boolean;
nameCache?: object;
format?: FormatOptions;
/** @deprecated */
output?: FormatOptions;
parse?: ParseOptions;
safari10?: boolean;
sourceMap?: boolean | SourceMapOptions;
toplevel?: boolean;
}
interface SourceMapOptions {
/** Source map object, 'inline' or source map file content */
content?: SectionedSourceMapInput | string;
includeSources?: boolean;
filename?: string;
root?: string;
asObject?: boolean;
url?: string | 'inline';
}
type Prettify<Type> = Type extends Function ? Type : Extract<{
[Key in keyof Type]: Type[Key];
}, Type>;
type MarkRequired<Type, Keys extends keyof Type> = Type extends Type ? Prettify<Type & Required<Omit<Type, Exclude<keyof Type, Keys>>>> : never;
type Logger = ReturnType<typeof createLogger>;
declare const createLogger: (name?: string) => {
setName(_name: string): void;
success(label: string, ...args: any[]): void;
info(label: string, ...args: any[]): void;
error(label: string, ...args: any[]): void;
warn(label: string, ...args: any[]): void;
log(label: string, type: "info" | "success" | "error" | "warn", ...data: unknown[]): void;
};
type ChunkInfo = {
type: 'chunk';
code: string;
map?: string | RawSourceMap | null;
path: string;
/**
* Sets the file mode
*/
mode?: number;
entryPoint?: string;
exports?: string[];
imports?: Metafile['outputs'][string]['imports'];
};
type RenderChunk = (this: PluginContext, code: string, chunkInfo: ChunkInfo) => MaybePromise<{
code: string;
map?: object | string | SourceMap | null;
} | undefined | null | void>;
type BuildStart = (this: PluginContext) => MaybePromise<void>;
type BuildEnd = (this: PluginContext, ctx: {
writtenFiles: WrittenFile[];
}) => MaybePromise<void>;
type ModifyEsbuildOptions = (this: PluginContext, options: BuildOptions) => void;
type Plugin = {
name: string;
esbuildOptions?: ModifyEsbuildOptions;
buildStart?: BuildStart;
renderChunk?: RenderChunk;
buildEnd?: BuildEnd;
};
type PluginContext = {
format: Format;
splitting?: boolean;
options: NormalizedOptions;
logger: Logger;
};
type WrittenFile = {
readonly name: string;
readonly size: number;
};
type TreeshakingStrategy = boolean | TreeshakingOptions | TreeshakingPreset;
type SwcPluginConfig = {
logger: Logger;
} & Options$1;
type KILL_SIGNAL = 'SIGKILL' | 'SIGTERM';
type Format = 'cjs' | 'esm' | 'iife';
type ContextForOutPathGeneration = {
options: NormalizedOptions;
format: Format;
/** "type" field in project's package.json */
pkgType?: string;
};
type OutExtensionObject = {
js?: string;
dts?: string;
};
type OutExtensionFactory = (ctx: ContextForOutPathGeneration) => OutExtensionObject;
type DtsConfig = {
entry?: InputOption;
/** Resolve external types used in dts files from node_modules */
resolve?: boolean | (string | RegExp)[];
/** Emit declaration files only */
only?: boolean;
/** Insert at the top of each output .d.ts file */
banner?: string;
/** Insert at the bottom */
footer?: string;
/**
* Overrides `compilerOptions`
* This option takes higher priority than `compilerOptions` in tsconfig.json
*/
compilerOptions?: any;
};
type ExperimentalDtsConfig = {
entry?: InputOption;
/**
* Overrides `compilerOptions`
* This option takes higher priority than `compilerOptions` in tsconfig.json
*/
compilerOptions?: any;
};
type BannerOrFooter = {
js?: string;
css?: string;
} | ((ctx: {
format: Format;
}) => {
js?: string;
css?: string;
} | undefined);
type BrowserTarget = 'chrome' | 'deno' | 'edge' | 'firefox' | 'hermes' | 'ie' | 'ios' | 'node' | 'opera' | 'rhino' | 'safari';
type BrowserTargetWithVersion = `${BrowserTarget}${number}` | `${BrowserTarget}${number}.${number}` | `${BrowserTarget}${number}.${number}.${number}`;
type EsTarget = 'es3' | 'es5' | 'es6' | 'es2015' | 'es2016' | 'es2017' | 'es2018' | 'es2019' | 'es2020' | 'es2021' | 'es2022' | 'es2023' | 'es2024' | 'esnext';
type Target = BrowserTarget | BrowserTargetWithVersion | EsTarget | (string & {});
type Entry = string[] | Record<string, string>;
/**
* The options available in tsup.config.ts
* Not all of them are available from CLI flags
*/
type Options = {
/** Optional config name to show in CLI output */
name?: string;
/**
* @deprecated Use `entry` instead
*/
entryPoints?: Entry;
entry?: Entry;
/**
* Output different formats to different folder instead of using different extensions
*/
legacyOutput?: boolean;
/**
* Compile target
*
* default to `node16`
*/
target?: Target | Target[];
minify?: boolean | 'terser';
terserOptions?: MinifyOptions;
minifyWhitespace?: boolean;
minifyIdentifiers?: boolean;
minifySyntax?: boolean;
keepNames?: boolean;
watch?: boolean | string | (string | boolean)[];
ignoreWatch?: string[] | string;
onSuccess?: string | (() => Promise<void | undefined | (() => void | Promise<void>)>);
jsxFactory?: string;
jsxFragment?: string;
outDir?: string;
outExtension?: OutExtensionFactory;
format?: Format[] | Format;
globalName?: string;
env?: {
[k: string]: string;
};
define?: {
[k: string]: string;
};
dts?: boolean | string | DtsConfig;
experimentalDts?: boolean | string | ExperimentalDtsConfig;
sourcemap?: boolean | 'inline';
/** Always bundle modules matching given patterns */
noExternal?: (string | RegExp)[];
/** Don't bundle these modules */
external?: (string | RegExp)[];
/**
* Replace `process.env.NODE_ENV` with `production` or `development`
* `production` when the bundled is minified, `development` otherwise
*/
replaceNodeEnv?: boolean;
/**
* Code splitting
* Default to `true` for ESM, `false` for CJS.
*
* You can set it to `true` explicitly, and may want to disable code splitting sometimes: [`#255`](https://github.com/egoist/tsup/issues/255)
*/
splitting?: boolean;
/**
* Clean output directory before each build
*/
clean?: boolean | string[];
esbuildPlugins?: Plugin$1[];
esbuildOptions?: (options: BuildOptions, context: {
format: Format;
}) => void;
/**
* Suppress non-error logs (excluding "onSuccess" process output)
*/
silent?: boolean;
/**
* Skip node_modules bundling
* Will still bundle modules matching the `noExternal` option
*/
skipNodeModulesBundle?: boolean;
/**
* @see https://esbuild.github.io/api/#pure
*/
pure?: string | string[];
/**
* Disable bundling, default to true
*/
bundle?: boolean;
/**
* This option allows you to automatically replace a global variable with an import from another file.
* @see https://esbuild.github.io/api/#inject
*/
inject?: string[];
/**
* Emit esbuild metafile
* @see https://esbuild.github.io/api/#metafile
*/
metafile?: boolean;
footer?: BannerOrFooter;
banner?: BannerOrFooter;
/**
* Target platform
* @default `node`
*/
platform?: 'node' | 'browser' | 'neutral';
/**
* Esbuild loader option
*/
loader?: Record<string, Loader>;
/**
* Disable config file with `false`
* Or pass a custom config filename
*/
config?: boolean | string;
/**
* Use a custom tsconfig
*/
tsconfig?: string;
/**
* Inject CSS as style tags to document head
* @default {false}
*/
injectStyle?: boolean | ((css: string, fileId: string) => string | Promise<string>);
/**
* Inject cjs and esm shims if needed
* @default false
*/
shims?: boolean;
/**
* TSUP plugins
* @experimental
* @alpha
*/
plugins?: Plugin[];
/**
* By default esbuild already does treeshaking
*
* But this option allow you to perform additional treeshaking with Rollup
*
* This can result in smaller bundle size
*/
treeshake?: TreeshakingStrategy;
/**
* Copy the files inside `publicDir` to output directory
*/
publicDir?: string | boolean;
killSignal?: KILL_SIGNAL;
/**
* Interop default within `module.exports` in cjs
* @default false
*/
cjsInterop?: boolean;
/**
* Remove `node:` protocol from imports
*
* The default value will be flipped to `false` in the next major release
* @default true
*/
removeNodeProtocol?: boolean;
swc?: SwcPluginConfig;
};
interface NormalizedExperimentalDtsConfig {
entry: {
[entryAlias: string]: string;
};
compilerOptions?: any;
}
type NormalizedOptions = Omit<MarkRequired<Options, 'entry' | 'outDir'>, 'dts' | 'experimentalDts' | 'format'> & {
dts?: DtsConfig;
experimentalDts?: NormalizedExperimentalDtsConfig;
tsconfigResolvePaths: Record<string, string[]>;
tsconfigDecoratorMetadata?: boolean;
format: Format[];
swc?: SwcPluginConfig;
};
type MaybePromise<T> = T | Promise<T>;
declare const defineConfig: (options: Options | Options[] | ((
/** The options derived from CLI flags */
overrideOptions: Options) => MaybePromise<Options | Options[]>)) => Options | Options[] | ((overrideOptions: Options) => MaybePromise<Options | Options[]>);
declare function build(_options: Options): Promise<void>;
export { type Format, type NormalizedOptions, type Options, build, defineConfig };

1711
editor/node_modules/tsup/dist/index.js generated vendored Normal file

File diff suppressed because it is too large Load Diff

6949
editor/node_modules/tsup/dist/rollup.js generated vendored Normal file

File diff suppressed because it is too large Load Diff