@slicemachine/manager 0.25.7-alpha.jp-figma-to-prismic.8 → 0.25.7-alpha.jp-figma-to-slice-1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_node_modules/cross-spawn/lib/parse.cjs +2 -2
- package/dist/_node_modules/cross-spawn/lib/parse.cjs.map +1 -1
- package/dist/_node_modules/cross-spawn/lib/parse.js +2 -2
- package/dist/_node_modules/cross-spawn/lib/parse.js.map +1 -1
- package/dist/_node_modules/cross-spawn/lib/util/resolveCommand.cjs +2 -2
- package/dist/_node_modules/cross-spawn/lib/util/resolveCommand.cjs.map +1 -1
- package/dist/_node_modules/cross-spawn/lib/util/resolveCommand.js +2 -2
- package/dist/_node_modules/cross-spawn/lib/util/resolveCommand.js.map +1 -1
- package/dist/_node_modules/which/which.cjs +2 -2
- package/dist/_node_modules/which/which.cjs.map +1 -1
- package/dist/_node_modules/which/which.js +2 -2
- package/dist/_node_modules/which/which.js.map +1 -1
- package/dist/managers/customTypes/CustomTypesManager.cjs +18 -48
- package/dist/managers/customTypes/CustomTypesManager.cjs.map +1 -1
- package/dist/managers/customTypes/CustomTypesManager.d.ts +0 -7
- package/dist/managers/customTypes/CustomTypesManager.js +22 -52
- package/dist/managers/customTypes/CustomTypesManager.js.map +1 -1
- package/package.json +2 -2
- package/src/managers/customTypes/CustomTypesManager.ts +17 -63
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const require$$0 = require("path");
|
|
4
4
|
const resolveCommand$1 = require("./util/resolveCommand.cjs");
|
|
5
5
|
require("./util/escape.cjs");
|
|
6
6
|
const readShebang$1 = require("./util/readShebang.cjs");
|
|
7
7
|
const escape$1 = require("../../../_virtual/escape.cjs");
|
|
8
|
-
const path =
|
|
8
|
+
const path = require$$0;
|
|
9
9
|
const resolveCommand = resolveCommand$1.resolveCommand_1;
|
|
10
10
|
const escape = escape$1.__exports;
|
|
11
11
|
const readShebang = readShebang$1.readShebang_1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.cjs","sources":["../../../../../../node_modules/cross-spawn/lib/parse.js"],"sourcesContent":["'use strict';\n\nconst path = require('path');\nconst resolveCommand = require('./util/resolveCommand');\nconst escape = require('./util/escape');\nconst readShebang = require('./util/readShebang');\n\nconst isWin = process.platform === 'win32';\nconst isExecutableRegExp = /\\.(?:com|exe)$/i;\nconst isCmdShimRegExp = /node_modules[\\\\/].bin[\\\\/][^\\\\/]+\\.cmd$/i;\n\nfunction detectShebang(parsed) {\n parsed.file = resolveCommand(parsed);\n\n const shebang = parsed.file && readShebang(parsed.file);\n\n if (shebang) {\n parsed.args.unshift(parsed.file);\n parsed.command = shebang;\n\n return resolveCommand(parsed);\n }\n\n return parsed.file;\n}\n\nfunction parseNonShell(parsed) {\n if (!isWin) {\n return parsed;\n }\n\n // Detect & add support for shebangs\n const commandFile = detectShebang(parsed);\n\n // We don't need a shell if the command filename is an executable\n const needsShell = !isExecutableRegExp.test(commandFile);\n\n // If a shell is required, use cmd.exe and take care of escaping everything correctly\n // Note that `forceShell` is an hidden option used only in tests\n if (parsed.options.forceShell || needsShell) {\n // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`\n // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument\n // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,\n // we need to double escape them\n const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);\n\n // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\\bar)\n // This is necessary otherwise it will always fail with ENOENT in those cases\n parsed.command = path.normalize(parsed.command);\n\n // Escape command & arguments\n parsed.command = escape.command(parsed.command);\n parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));\n\n const shellCommand = [parsed.command].concat(parsed.args).join(' ');\n\n parsed.args = ['/d', '/s', '/c', `\"${shellCommand}\"`];\n parsed.command = process.env.comspec || 'cmd.exe';\n parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped\n }\n\n return parsed;\n}\n\nfunction parse(command, args, options) {\n // Normalize arguments, similar to nodejs\n if (args && !Array.isArray(args)) {\n options = args;\n args = null;\n }\n\n args = args ? args.slice(0) : []; // Clone array to avoid changing the original\n options = Object.assign({}, options); // Clone object to avoid changing the original\n\n // Build our parsed object\n const parsed = {\n command,\n args,\n options,\n file: undefined,\n original: {\n command,\n args,\n },\n };\n\n // Delegate further parsing to shell or non-shell\n return options.shell ? parsed : parseNonShell(parsed);\n}\n\nmodule.exports = parse;\n"],"names":["require$$
|
|
1
|
+
{"version":3,"file":"parse.cjs","sources":["../../../../../../node_modules/cross-spawn/lib/parse.js"],"sourcesContent":["'use strict';\n\nconst path = require('path');\nconst resolveCommand = require('./util/resolveCommand');\nconst escape = require('./util/escape');\nconst readShebang = require('./util/readShebang');\n\nconst isWin = process.platform === 'win32';\nconst isExecutableRegExp = /\\.(?:com|exe)$/i;\nconst isCmdShimRegExp = /node_modules[\\\\/].bin[\\\\/][^\\\\/]+\\.cmd$/i;\n\nfunction detectShebang(parsed) {\n parsed.file = resolveCommand(parsed);\n\n const shebang = parsed.file && readShebang(parsed.file);\n\n if (shebang) {\n parsed.args.unshift(parsed.file);\n parsed.command = shebang;\n\n return resolveCommand(parsed);\n }\n\n return parsed.file;\n}\n\nfunction parseNonShell(parsed) {\n if (!isWin) {\n return parsed;\n }\n\n // Detect & add support for shebangs\n const commandFile = detectShebang(parsed);\n\n // We don't need a shell if the command filename is an executable\n const needsShell = !isExecutableRegExp.test(commandFile);\n\n // If a shell is required, use cmd.exe and take care of escaping everything correctly\n // Note that `forceShell` is an hidden option used only in tests\n if (parsed.options.forceShell || needsShell) {\n // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`\n // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument\n // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,\n // we need to double escape them\n const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);\n\n // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\\bar)\n // This is necessary otherwise it will always fail with ENOENT in those cases\n parsed.command = path.normalize(parsed.command);\n\n // Escape command & arguments\n parsed.command = escape.command(parsed.command);\n parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));\n\n const shellCommand = [parsed.command].concat(parsed.args).join(' ');\n\n parsed.args = ['/d', '/s', '/c', `\"${shellCommand}\"`];\n parsed.command = process.env.comspec || 'cmd.exe';\n parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped\n }\n\n return parsed;\n}\n\nfunction parse(command, args, options) {\n // Normalize arguments, similar to nodejs\n if (args && !Array.isArray(args)) {\n options = args;\n args = null;\n }\n\n args = args ? args.slice(0) : []; // Clone array to avoid changing the original\n options = Object.assign({}, options); // Clone object to avoid changing the original\n\n // Build our parsed object\n const parsed = {\n command,\n args,\n options,\n file: undefined,\n original: {\n command,\n args,\n },\n };\n\n // Delegate further parsing to shell or non-shell\n return options.shell ? parsed : parseNonShell(parsed);\n}\n\nmodule.exports = parse;\n"],"names":["require$$1","require$$2","require$$3"],"mappings":";;;;;;;AAEA,MAAM,OAAO;AACb,MAAM,iBAAiBA,iBAAAA;AACvB,MAAM,SAASC,SAAAA;AACf,MAAM,cAAcC,cAAAA;AAEpB,MAAM,QAAQ,QAAQ,aAAa;AACnC,MAAM,qBAAqB;AAC3B,MAAM,kBAAkB;AAExB,SAAS,cAAc,QAAQ;AAC3B,SAAO,OAAO,eAAe,MAAM;AAEnC,QAAM,UAAU,OAAO,QAAQ,YAAY,OAAO,IAAI;AAEtD,MAAI,SAAS;AACT,WAAO,KAAK,QAAQ,OAAO,IAAI;AAC/B,WAAO,UAAU;AAEjB,WAAO,eAAe,MAAM;AAAA,EACpC;AAEI,SAAO,OAAO;AAClB;AAEA,SAAS,cAAc,QAAQ;AAC3B,MAAI,CAAC,OAAO;AACR,WAAO;AAAA,EACf;AAGI,QAAM,cAAc,cAAc,MAAM;AAGxC,QAAM,aAAa,CAAC,mBAAmB,KAAK,WAAW;AAIvD,MAAI,OAAO,QAAQ,cAAc,YAAY;AAKzC,UAAM,6BAA6B,gBAAgB,KAAK,WAAW;AAInE,WAAO,UAAU,KAAK,UAAU,OAAO,OAAO;AAG9C,WAAO,UAAU,OAAO,QAAQ,OAAO,OAAO;AAC9C,WAAO,OAAO,OAAO,KAAK,IAAI,CAAC,QAAQ,OAAO,SAAS,KAAK,0BAA0B,CAAC;AAEvF,UAAM,eAAe,CAAC,OAAO,OAAO,EAAE,OAAO,OAAO,IAAI,EAAE,KAAK,GAAG;AAElE,WAAO,OAAO,CAAC,MAAM,MAAM,MAAM,IAAI,YAAY,GAAG;AACpD,WAAO,UAAU,QAAQ,IAAI,WAAW;AACxC,WAAO,QAAQ,2BAA2B;AAAA,EAClD;AAEI,SAAO;AACX;AAEA,SAAS,MAAM,SAAS,MAAM,SAAS;AAEnC,MAAI,QAAQ,CAAC,MAAM,QAAQ,IAAI,GAAG;AAC9B,cAAU;AACV,WAAO;AAAA,EACf;AAEI,SAAO,OAAO,KAAK,MAAM,CAAC,IAAI,CAAA;AAC9B,YAAU,OAAO,OAAO,CAAA,GAAI,OAAO;AAGnC,QAAM,SAAS;AAAA,IACX;AAAA,IACA;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN,UAAU;AAAA,MACN;AAAA,MACA;AAAA,IACZ;AAAA,EACA;AAGI,SAAO,QAAQ,QAAQ,SAAS,cAAc,MAAM;AACxD;AAEA,IAAA,UAAiB;;","x_google_ignoreList":[0]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import require$$0 from "path";
|
|
2
2
|
import { r as resolveCommand_1 } from "./util/resolveCommand.js";
|
|
3
3
|
import "./util/escape.js";
|
|
4
4
|
import { r as readShebang_1 } from "./util/readShebang.js";
|
|
5
5
|
import { __exports as _escape } from "../../../_virtual/escape.js";
|
|
6
|
-
const path =
|
|
6
|
+
const path = require$$0;
|
|
7
7
|
const resolveCommand = resolveCommand_1;
|
|
8
8
|
const escape = _escape;
|
|
9
9
|
const readShebang = readShebang_1;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parse.js","sources":["../../../../../../node_modules/cross-spawn/lib/parse.js"],"sourcesContent":["'use strict';\n\nconst path = require('path');\nconst resolveCommand = require('./util/resolveCommand');\nconst escape = require('./util/escape');\nconst readShebang = require('./util/readShebang');\n\nconst isWin = process.platform === 'win32';\nconst isExecutableRegExp = /\\.(?:com|exe)$/i;\nconst isCmdShimRegExp = /node_modules[\\\\/].bin[\\\\/][^\\\\/]+\\.cmd$/i;\n\nfunction detectShebang(parsed) {\n parsed.file = resolveCommand(parsed);\n\n const shebang = parsed.file && readShebang(parsed.file);\n\n if (shebang) {\n parsed.args.unshift(parsed.file);\n parsed.command = shebang;\n\n return resolveCommand(parsed);\n }\n\n return parsed.file;\n}\n\nfunction parseNonShell(parsed) {\n if (!isWin) {\n return parsed;\n }\n\n // Detect & add support for shebangs\n const commandFile = detectShebang(parsed);\n\n // We don't need a shell if the command filename is an executable\n const needsShell = !isExecutableRegExp.test(commandFile);\n\n // If a shell is required, use cmd.exe and take care of escaping everything correctly\n // Note that `forceShell` is an hidden option used only in tests\n if (parsed.options.forceShell || needsShell) {\n // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`\n // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument\n // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,\n // we need to double escape them\n const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);\n\n // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\\bar)\n // This is necessary otherwise it will always fail with ENOENT in those cases\n parsed.command = path.normalize(parsed.command);\n\n // Escape command & arguments\n parsed.command = escape.command(parsed.command);\n parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));\n\n const shellCommand = [parsed.command].concat(parsed.args).join(' ');\n\n parsed.args = ['/d', '/s', '/c', `\"${shellCommand}\"`];\n parsed.command = process.env.comspec || 'cmd.exe';\n parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped\n }\n\n return parsed;\n}\n\nfunction parse(command, args, options) {\n // Normalize arguments, similar to nodejs\n if (args && !Array.isArray(args)) {\n options = args;\n args = null;\n }\n\n args = args ? args.slice(0) : []; // Clone array to avoid changing the original\n options = Object.assign({}, options); // Clone object to avoid changing the original\n\n // Build our parsed object\n const parsed = {\n command,\n args,\n options,\n file: undefined,\n original: {\n command,\n args,\n },\n };\n\n // Delegate further parsing to shell or non-shell\n return options.shell ? parsed : parseNonShell(parsed);\n}\n\nmodule.exports = parse;\n"],"names":["require$$
|
|
1
|
+
{"version":3,"file":"parse.js","sources":["../../../../../../node_modules/cross-spawn/lib/parse.js"],"sourcesContent":["'use strict';\n\nconst path = require('path');\nconst resolveCommand = require('./util/resolveCommand');\nconst escape = require('./util/escape');\nconst readShebang = require('./util/readShebang');\n\nconst isWin = process.platform === 'win32';\nconst isExecutableRegExp = /\\.(?:com|exe)$/i;\nconst isCmdShimRegExp = /node_modules[\\\\/].bin[\\\\/][^\\\\/]+\\.cmd$/i;\n\nfunction detectShebang(parsed) {\n parsed.file = resolveCommand(parsed);\n\n const shebang = parsed.file && readShebang(parsed.file);\n\n if (shebang) {\n parsed.args.unshift(parsed.file);\n parsed.command = shebang;\n\n return resolveCommand(parsed);\n }\n\n return parsed.file;\n}\n\nfunction parseNonShell(parsed) {\n if (!isWin) {\n return parsed;\n }\n\n // Detect & add support for shebangs\n const commandFile = detectShebang(parsed);\n\n // We don't need a shell if the command filename is an executable\n const needsShell = !isExecutableRegExp.test(commandFile);\n\n // If a shell is required, use cmd.exe and take care of escaping everything correctly\n // Note that `forceShell` is an hidden option used only in tests\n if (parsed.options.forceShell || needsShell) {\n // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`\n // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument\n // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,\n // we need to double escape them\n const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);\n\n // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\\bar)\n // This is necessary otherwise it will always fail with ENOENT in those cases\n parsed.command = path.normalize(parsed.command);\n\n // Escape command & arguments\n parsed.command = escape.command(parsed.command);\n parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));\n\n const shellCommand = [parsed.command].concat(parsed.args).join(' ');\n\n parsed.args = ['/d', '/s', '/c', `\"${shellCommand}\"`];\n parsed.command = process.env.comspec || 'cmd.exe';\n parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped\n }\n\n return parsed;\n}\n\nfunction parse(command, args, options) {\n // Normalize arguments, similar to nodejs\n if (args && !Array.isArray(args)) {\n options = args;\n args = null;\n }\n\n args = args ? args.slice(0) : []; // Clone array to avoid changing the original\n options = Object.assign({}, options); // Clone object to avoid changing the original\n\n // Build our parsed object\n const parsed = {\n command,\n args,\n options,\n file: undefined,\n original: {\n command,\n args,\n },\n };\n\n // Delegate further parsing to shell or non-shell\n return options.shell ? parsed : parseNonShell(parsed);\n}\n\nmodule.exports = parse;\n"],"names":["require$$1","require$$2","require$$3"],"mappings":";;;;;AAEA,MAAM,OAAO;AACb,MAAM,iBAAiBA;AACvB,MAAM,SAASC;AACf,MAAM,cAAcC;AAEpB,MAAM,QAAQ,QAAQ,aAAa;AACnC,MAAM,qBAAqB;AAC3B,MAAM,kBAAkB;AAExB,SAAS,cAAc,QAAQ;AAC3B,SAAO,OAAO,eAAe,MAAM;AAEnC,QAAM,UAAU,OAAO,QAAQ,YAAY,OAAO,IAAI;AAEtD,MAAI,SAAS;AACT,WAAO,KAAK,QAAQ,OAAO,IAAI;AAC/B,WAAO,UAAU;AAEj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|
|
3
|
+
const require$$0 = require("path");
|
|
4
4
|
const which$1 = require("../../../which/which.cjs");
|
|
5
5
|
const index = require("../../../path-key/index.cjs");
|
|
6
|
-
const path =
|
|
6
|
+
const path = require$$0;
|
|
7
7
|
const which = which$1.which_1;
|
|
8
8
|
const getPathKey = index.pathKeyExports;
|
|
9
9
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveCommand.cjs","sources":["../../../../../../../node_modules/cross-spawn/lib/util/resolveCommand.js"],"sourcesContent":["'use strict';\n\nconst path = require('path');\nconst which = require('which');\nconst getPathKey = require('path-key');\n\nfunction resolveCommandAttempt(parsed, withoutPathExt) {\n const env = parsed.options.env || process.env;\n const cwd = process.cwd();\n const hasCustomCwd = parsed.options.cwd != null;\n // Worker threads do not have process.chdir()\n const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled;\n\n // If a custom `cwd` was specified, we need to change the process cwd\n // because `which` will do stat calls but does not support a custom cwd\n if (shouldSwitchCwd) {\n try {\n process.chdir(parsed.options.cwd);\n } catch (err) {\n /* Empty */\n }\n }\n\n let resolved;\n\n try {\n resolved = which.sync(parsed.command, {\n path: env[getPathKey({ env })],\n pathExt: withoutPathExt ? path.delimiter : undefined,\n });\n } catch (e) {\n /* Empty */\n } finally {\n if (shouldSwitchCwd) {\n process.chdir(cwd);\n }\n }\n\n // If we successfully resolved, ensure that an absolute path is returned\n // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it\n if (resolved) {\n resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);\n }\n\n return resolved;\n}\n\nfunction resolveCommand(parsed) {\n return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);\n}\n\nmodule.exports = resolveCommand;\n"],"names":["require$$
|
|
1
|
+
{"version":3,"file":"resolveCommand.cjs","sources":["../../../../../../../node_modules/cross-spawn/lib/util/resolveCommand.js"],"sourcesContent":["'use strict';\n\nconst path = require('path');\nconst which = require('which');\nconst getPathKey = require('path-key');\n\nfunction resolveCommandAttempt(parsed, withoutPathExt) {\n const env = parsed.options.env || process.env;\n const cwd = process.cwd();\n const hasCustomCwd = parsed.options.cwd != null;\n // Worker threads do not have process.chdir()\n const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled;\n\n // If a custom `cwd` was specified, we need to change the process cwd\n // because `which` will do stat calls but does not support a custom cwd\n if (shouldSwitchCwd) {\n try {\n process.chdir(parsed.options.cwd);\n } catch (err) {\n /* Empty */\n }\n }\n\n let resolved;\n\n try {\n resolved = which.sync(parsed.command, {\n path: env[getPathKey({ env })],\n pathExt: withoutPathExt ? path.delimiter : undefined,\n });\n } catch (e) {\n /* Empty */\n } finally {\n if (shouldSwitchCwd) {\n process.chdir(cwd);\n }\n }\n\n // If we successfully resolved, ensure that an absolute path is returned\n // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it\n if (resolved) {\n resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);\n }\n\n return resolved;\n}\n\nfunction resolveCommand(parsed) {\n return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);\n}\n\nmodule.exports = resolveCommand;\n"],"names":["require$$1","require$$2"],"mappings":";;;;;AAEA,MAAM,OAAO;AACb,MAAM,QAAQA,QAAAA;AACd,MAAM,aAAaC,MAAAA;AAEnB,SAAS,sBAAsB,QAAQ,gBAAgB;AACnD,QAAM,MAAM,OAAO,QAAQ,OAAO,QAAQ;AAC1C,QAAM,MAAM,QAAQ,IAAG;AACvB,QAAM,eAAe,OAAO,QAAQ,OAAO;AAE3C,QAAM,kBAAkB,gBAAgB,QAAQ,UAAU,UAAa,CAAC,QAAQ,MAAM;AAItF,MAAI,iBAAiB;AACjB,QAAI;AACA,cAAQ,MAAM,OAAO,QAAQ,GAAG;AAAA,IAC5C,SAAiB,KAAK;AAAA,IAEtB;AAAA,EACA;AAEI,MAAI;AAEJ,MAAI;AACA,eAAW,MAAM,KAAK,OAAO,SAAS;AAAA,MAClC,MAAM,IAAI,WAAW,EAAE,IAAG,CAAE,CAAC;AAAA,MAC7B,SAAS,iBAAiB,KAAK,YAAY;AAAA,IACvD,CAAS;AAAA,EACT,SAAa,GAAG;AAAA,EAEhB,UAAK;AACG,QAAI,iBAAiB;AACjB,cAAQ,MAAM,GAAG;AAAA,IAC7B;AAAA,EACA;AAII,MAAI,UAAU;AACV,eAAW,KAAK,QAAQ,eAAe,OAAO,QAAQ,MAAM,IAAI,QAAQ;AAAA,EAChF;AAEI,SAAO;AACX;AAEA,SAAS,eAAe,QAAQ;AAC5B,SAAO,sBAAsB,MAAM,KAAK,sBAAsB,QAAQ,IAAI;AAC9E;AAEA,IAAA,mBAAiB;;","x_google_ignoreList":[0]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import require$$0 from "path";
|
|
2
2
|
import { w as which_1 } from "../../../which/which.js";
|
|
3
3
|
import { p as pathKeyExports } from "../../../path-key/index.js";
|
|
4
|
-
const path =
|
|
4
|
+
const path = require$$0;
|
|
5
5
|
const which = which_1;
|
|
6
6
|
const getPathKey = pathKeyExports;
|
|
7
7
|
function resolveCommandAttempt(parsed, withoutPathExt) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveCommand.js","sources":["../../../../../../../node_modules/cross-spawn/lib/util/resolveCommand.js"],"sourcesContent":["'use strict';\n\nconst path = require('path');\nconst which = require('which');\nconst getPathKey = require('path-key');\n\nfunction resolveCommandAttempt(parsed, withoutPathExt) {\n const env = parsed.options.env || process.env;\n const cwd = process.cwd();\n const hasCustomCwd = parsed.options.cwd != null;\n // Worker threads do not have process.chdir()\n const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled;\n\n // If a custom `cwd` was specified, we need to change the process cwd\n // because `which` will do stat calls but does not support a custom cwd\n if (shouldSwitchCwd) {\n try {\n process.chdir(parsed.options.cwd);\n } catch (err) {\n /* Empty */\n }\n }\n\n let resolved;\n\n try {\n resolved = which.sync(parsed.command, {\n path: env[getPathKey({ env })],\n pathExt: withoutPathExt ? path.delimiter : undefined,\n });\n } catch (e) {\n /* Empty */\n } finally {\n if (shouldSwitchCwd) {\n process.chdir(cwd);\n }\n }\n\n // If we successfully resolved, ensure that an absolute path is returned\n // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it\n if (resolved) {\n resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);\n }\n\n return resolved;\n}\n\nfunction resolveCommand(parsed) {\n return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);\n}\n\nmodule.exports = resolveCommand;\n"],"names":["require$$
|
|
1
|
+
{"version":3,"file":"resolveCommand.js","sources":["../../../../../../../node_modules/cross-spawn/lib/util/resolveCommand.js"],"sourcesContent":["'use strict';\n\nconst path = require('path');\nconst which = require('which');\nconst getPathKey = require('path-key');\n\nfunction resolveCommandAttempt(parsed, withoutPathExt) {\n const env = parsed.options.env || process.env;\n const cwd = process.cwd();\n const hasCustomCwd = parsed.options.cwd != null;\n // Worker threads do not have process.chdir()\n const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled;\n\n // If a custom `cwd` was specified, we need to change the process cwd\n // because `which` will do stat calls but does not support a custom cwd\n if (shouldSwitchCwd) {\n try {\n process.chdir(parsed.options.cwd);\n } catch (err) {\n /* Empty */\n }\n }\n\n let resolved;\n\n try {\n resolved = which.sync(parsed.command, {\n path: env[getPathKey({ env })],\n pathExt: withoutPathExt ? path.delimiter : undefined,\n });\n } catch (e) {\n /* Empty */\n } finally {\n if (shouldSwitchCwd) {\n process.chdir(cwd);\n }\n }\n\n // If we successfully resolved, ensure that an absolute path is returned\n // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it\n if (resolved) {\n resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);\n }\n\n return resolved;\n}\n\nfunction resolveCommand(parsed) {\n return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);\n}\n\nmodule.exports = resolveCommand;\n"],"names":["require$$1","require$$2"],"mappings":";;;AAEA,MAAM,OAAO;AACb,MAAM,QAAQA;AACd,MAAM,aAAaC;AAEnB,SAAS,sBAAsB,QAAQ,gBAAgB;AACnD,QAAM,MAAM,OAAO,QAAQ,OAAO,QAAQ;AAC1C,QAAM,MAAM,QAAQ,IAAG;AACvB,QAAM,eAAe,OAAO,QAAQ,OAAO;AAE3C,QAAM,kBAAkB,gBAAgB,QAAQ,UAAU,UAAa,CAAC,QAAQ,MAAM;AAItF,MAAI,iBAAiB;AACjB,QAAI;AACA,cAAQ,MAAM,OAAO,QAAQ,GAAG;AAAA,IAC5C,SAAiB,KAAK;AAAA,IAEtB;AAAA,EACA;AAEI,MAAI;AAEJ,MAAI;AACA,eAAW,MAAM,KAAK,OAAO,SAAS;AAAA,MAClC,MAAM,IAAI,WAAW,EAAE,IAAG,CAAE,CAAC;AAAA,MAC7B,SAAS,iBAAiB,KAAK,YAAY;AAAA,IACvD,CAAS;AAAA,EACT,SAAa,GAAG;AAAA,EAEhB,UAAK;AACG,QAAI,iBAAiB;AACjB,cAAQ,MAAM,GAAG;AAAA,IAC7B;AAAA,EACA;AAII,MAAI,UAAU;AACV,eAAW,KAAK,QAAQ,eAAe,OAAO,QAAQ,MAAM,IAAI,QAAQ;AAAA,EAChF;AAEI,SAAO;AACX;AAEA,SAAS,eAAe,QAAQ;AAC5B,SAAO,sBAAsB,MAAM,KAAK,sBAAsB,QAAQ,IAAI;AAC9E;AAEA,IAAA,mBAAiB;","x_google_ignoreList":[0]}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
3
|
+
const require$$0 = require("path");
|
|
4
4
|
const index = require("../isexe/index.cjs");
|
|
5
5
|
const isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
6
|
-
const path =
|
|
6
|
+
const path = require$$0;
|
|
7
7
|
const COLON = isWindows ? ";" : ":";
|
|
8
8
|
const isexe = index.isexe_1;
|
|
9
9
|
const getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"which.cjs","sources":["../../../../../node_modules/which/which.js"],"sourcesContent":["const isWindows = process.platform === 'win32' ||\n process.env.OSTYPE === 'cygwin' ||\n process.env.OSTYPE === 'msys'\n\nconst path = require('path')\nconst COLON = isWindows ? ';' : ':'\nconst isexe = require('isexe')\n\nconst getNotFoundError = (cmd) =>\n Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })\n\nconst getPathInfo = (cmd, opt) => {\n const colon = opt.colon || COLON\n\n // If it has a slash, then we don't bother searching the pathenv.\n // just check the file itself, and that's it.\n const pathEnv = cmd.match(/\\//) || isWindows && cmd.match(/\\\\/) ? ['']\n : (\n [\n // windows always checks the cwd first\n ...(isWindows ? [process.cwd()] : []),\n ...(opt.path || process.env.PATH ||\n /* istanbul ignore next: very unusual */ '').split(colon),\n ]\n )\n const pathExtExe = isWindows\n ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM'\n : ''\n const pathExt = isWindows ? pathExtExe.split(colon) : ['']\n\n if (isWindows) {\n if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')\n pathExt.unshift('')\n }\n\n return {\n pathEnv,\n pathExt,\n pathExtExe,\n }\n}\n\nconst which = (cmd, opt, cb) => {\n if (typeof opt === 'function') {\n cb = opt\n opt = {}\n }\n if (!opt)\n opt = {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n const step = i => new Promise((resolve, reject) => {\n if (i === pathEnv.length)\n return opt.all && found.length ? resolve(found)\n : reject(getNotFoundError(cmd))\n\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n resolve(subStep(p, i, 0))\n })\n\n const subStep = (p, i, ii) => new Promise((resolve, reject) => {\n if (ii === pathExt.length)\n return resolve(step(i + 1))\n const ext = pathExt[ii]\n isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {\n if (!er && is) {\n if (opt.all)\n found.push(p + ext)\n else\n return resolve(p + ext)\n }\n return resolve(subStep(p, i, ii + 1))\n })\n })\n\n return cb ? step(0).then(res => cb(null, res), cb) : step(0)\n}\n\nconst whichSync = (cmd, opt) => {\n opt = opt || {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n for (let i = 0; i < pathEnv.length; i ++) {\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n for (let j = 0; j < pathExt.length; j ++) {\n const cur = p + pathExt[j]\n try {\n const is = isexe.sync(cur, { pathExt: pathExtExe })\n if (is) {\n if (opt.all)\n found.push(cur)\n else\n return cur\n }\n } catch (ex) {}\n }\n }\n\n if (opt.all && found.length)\n return found\n\n if (opt.nothrow)\n return null\n\n throw getNotFoundError(cmd)\n}\n\nmodule.exports = which\nwhich.sync = whichSync\n"],"names":["require$$
|
|
1
|
+
{"version":3,"file":"which.cjs","sources":["../../../../../node_modules/which/which.js"],"sourcesContent":["const isWindows = process.platform === 'win32' ||\n process.env.OSTYPE === 'cygwin' ||\n process.env.OSTYPE === 'msys'\n\nconst path = require('path')\nconst COLON = isWindows ? ';' : ':'\nconst isexe = require('isexe')\n\nconst getNotFoundError = (cmd) =>\n Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })\n\nconst getPathInfo = (cmd, opt) => {\n const colon = opt.colon || COLON\n\n // If it has a slash, then we don't bother searching the pathenv.\n // just check the file itself, and that's it.\n const pathEnv = cmd.match(/\\//) || isWindows && cmd.match(/\\\\/) ? ['']\n : (\n [\n // windows always checks the cwd first\n ...(isWindows ? [process.cwd()] : []),\n ...(opt.path || process.env.PATH ||\n /* istanbul ignore next: very unusual */ '').split(colon),\n ]\n )\n const pathExtExe = isWindows\n ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM'\n : ''\n const pathExt = isWindows ? pathExtExe.split(colon) : ['']\n\n if (isWindows) {\n if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')\n pathExt.unshift('')\n }\n\n return {\n pathEnv,\n pathExt,\n pathExtExe,\n }\n}\n\nconst which = (cmd, opt, cb) => {\n if (typeof opt === 'function') {\n cb = opt\n opt = {}\n }\n if (!opt)\n opt = {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n const step = i => new Promise((resolve, reject) => {\n if (i === pathEnv.length)\n return opt.all && found.length ? resolve(found)\n : reject(getNotFoundError(cmd))\n\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n resolve(subStep(p, i, 0))\n })\n\n const subStep = (p, i, ii) => new Promise((resolve, reject) => {\n if (ii === pathExt.length)\n return resolve(step(i + 1))\n const ext = pathExt[ii]\n isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {\n if (!er && is) {\n if (opt.all)\n found.push(p + ext)\n else\n return resolve(p + ext)\n }\n return resolve(subStep(p, i, ii + 1))\n })\n })\n\n return cb ? step(0).then(res => cb(null, res), cb) : step(0)\n}\n\nconst whichSync = (cmd, opt) => {\n opt = opt || {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n for (let i = 0; i < pathEnv.length; i ++) {\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n for (let j = 0; j < pathExt.length; j ++) {\n const cur = p + pathExt[j]\n try {\n const is = isexe.sync(cur, { pathExt: pathExtExe })\n if (is) {\n if (opt.all)\n found.push(cur)\n else\n return cur\n }\n } catch (ex) {}\n }\n }\n\n if (opt.all && found.length)\n return found\n\n if (opt.nothrow)\n return null\n\n throw getNotFoundError(cmd)\n}\n\nmodule.exports = which\nwhich.sync = whichSync\n"],"names":["require$$1"],"mappings":";;;;AAAA,MAAM,YAAY,QAAQ,aAAa,WACnC,QAAQ,IAAI,WAAW,YACvB,QAAQ,IAAI,WAAW;AAE3B,MAAM,OAAO;AACb,MAAM,QAAQ,YAAY,MAAM;AAChC,MAAM,QAAQA,MAAAA;AAEd,MAAM,mBAAmB,CAAC,QACxB,OAAO,OAAO,IAAI,MAAM,cAAc,GAAG,EAAE,GAAG,EAAE,MAAM,SAAQ,CAAE;AAElE,MAAM,cAAc,CAAC,KAAK,QAAQ;AAChC,QAAM,QAAQ,IAAI,SAAS;AAI3B,QAAM,UAAU,IAAI,MAAM,IAAI,KAAK,aAAa,IAAI,MAAM,IAAI,IAAI,CAAC,EAAE,IAEjE;AAAA;AAAA,IAEE,GAAI,YAAY,CAAC,QAAQ,IAAG,CAAE,IAAI,CAAA;AAAA,IAClC,IAAI,IAAI,QAAQ,QAAQ,IAAI;AAAA,IACe,IAAI,MAAM,KAAK;AAAA,EAClE;AAEE,QAAM,aAAa,YACf,IAAI,WAAW,QAAQ,IAAI,WAAW,wBACtC;AACJ,QAAM,UAAU,YAAY,WAAW,MAAM,KAAK,IAAI,CAAC,EAAE;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|
const isWindows = process.platform === "win32" || process.env.OSTYPE === "cygwin" || process.env.OSTYPE === "msys";
|
|
4
|
-
const path =
|
|
4
|
+
const path = require$$0;
|
|
5
5
|
const COLON = isWindows ? ";" : ":";
|
|
6
6
|
const isexe = isexe_1;
|
|
7
7
|
const getNotFoundError = (cmd) => Object.assign(new Error(`not found: ${cmd}`), { code: "ENOENT" });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"which.js","sources":["../../../../../node_modules/which/which.js"],"sourcesContent":["const isWindows = process.platform === 'win32' ||\n process.env.OSTYPE === 'cygwin' ||\n process.env.OSTYPE === 'msys'\n\nconst path = require('path')\nconst COLON = isWindows ? ';' : ':'\nconst isexe = require('isexe')\n\nconst getNotFoundError = (cmd) =>\n Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })\n\nconst getPathInfo = (cmd, opt) => {\n const colon = opt.colon || COLON\n\n // If it has a slash, then we don't bother searching the pathenv.\n // just check the file itself, and that's it.\n const pathEnv = cmd.match(/\\//) || isWindows && cmd.match(/\\\\/) ? ['']\n : (\n [\n // windows always checks the cwd first\n ...(isWindows ? [process.cwd()] : []),\n ...(opt.path || process.env.PATH ||\n /* istanbul ignore next: very unusual */ '').split(colon),\n ]\n )\n const pathExtExe = isWindows\n ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM'\n : ''\n const pathExt = isWindows ? pathExtExe.split(colon) : ['']\n\n if (isWindows) {\n if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')\n pathExt.unshift('')\n }\n\n return {\n pathEnv,\n pathExt,\n pathExtExe,\n }\n}\n\nconst which = (cmd, opt, cb) => {\n if (typeof opt === 'function') {\n cb = opt\n opt = {}\n }\n if (!opt)\n opt = {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n const step = i => new Promise((resolve, reject) => {\n if (i === pathEnv.length)\n return opt.all && found.length ? resolve(found)\n : reject(getNotFoundError(cmd))\n\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n resolve(subStep(p, i, 0))\n })\n\n const subStep = (p, i, ii) => new Promise((resolve, reject) => {\n if (ii === pathExt.length)\n return resolve(step(i + 1))\n const ext = pathExt[ii]\n isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {\n if (!er && is) {\n if (opt.all)\n found.push(p + ext)\n else\n return resolve(p + ext)\n }\n return resolve(subStep(p, i, ii + 1))\n })\n })\n\n return cb ? step(0).then(res => cb(null, res), cb) : step(0)\n}\n\nconst whichSync = (cmd, opt) => {\n opt = opt || {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n for (let i = 0; i < pathEnv.length; i ++) {\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n for (let j = 0; j < pathExt.length; j ++) {\n const cur = p + pathExt[j]\n try {\n const is = isexe.sync(cur, { pathExt: pathExtExe })\n if (is) {\n if (opt.all)\n found.push(cur)\n else\n return cur\n }\n } catch (ex) {}\n }\n }\n\n if (opt.all && found.length)\n return found\n\n if (opt.nothrow)\n return null\n\n throw getNotFoundError(cmd)\n}\n\nmodule.exports = which\nwhich.sync = whichSync\n"],"names":["require$$
|
|
1
|
+
{"version":3,"file":"which.js","sources":["../../../../../node_modules/which/which.js"],"sourcesContent":["const isWindows = process.platform === 'win32' ||\n process.env.OSTYPE === 'cygwin' ||\n process.env.OSTYPE === 'msys'\n\nconst path = require('path')\nconst COLON = isWindows ? ';' : ':'\nconst isexe = require('isexe')\n\nconst getNotFoundError = (cmd) =>\n Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })\n\nconst getPathInfo = (cmd, opt) => {\n const colon = opt.colon || COLON\n\n // If it has a slash, then we don't bother searching the pathenv.\n // just check the file itself, and that's it.\n const pathEnv = cmd.match(/\\//) || isWindows && cmd.match(/\\\\/) ? ['']\n : (\n [\n // windows always checks the cwd first\n ...(isWindows ? [process.cwd()] : []),\n ...(opt.path || process.env.PATH ||\n /* istanbul ignore next: very unusual */ '').split(colon),\n ]\n )\n const pathExtExe = isWindows\n ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM'\n : ''\n const pathExt = isWindows ? pathExtExe.split(colon) : ['']\n\n if (isWindows) {\n if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')\n pathExt.unshift('')\n }\n\n return {\n pathEnv,\n pathExt,\n pathExtExe,\n }\n}\n\nconst which = (cmd, opt, cb) => {\n if (typeof opt === 'function') {\n cb = opt\n opt = {}\n }\n if (!opt)\n opt = {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n const step = i => new Promise((resolve, reject) => {\n if (i === pathEnv.length)\n return opt.all && found.length ? resolve(found)\n : reject(getNotFoundError(cmd))\n\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n resolve(subStep(p, i, 0))\n })\n\n const subStep = (p, i, ii) => new Promise((resolve, reject) => {\n if (ii === pathExt.length)\n return resolve(step(i + 1))\n const ext = pathExt[ii]\n isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {\n if (!er && is) {\n if (opt.all)\n found.push(p + ext)\n else\n return resolve(p + ext)\n }\n return resolve(subStep(p, i, ii + 1))\n })\n })\n\n return cb ? step(0).then(res => cb(null, res), cb) : step(0)\n}\n\nconst whichSync = (cmd, opt) => {\n opt = opt || {}\n\n const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)\n const found = []\n\n for (let i = 0; i < pathEnv.length; i ++) {\n const ppRaw = pathEnv[i]\n const pathPart = /^\".*\"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw\n\n const pCmd = path.join(pathPart, cmd)\n const p = !pathPart && /^\\.[\\\\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd\n : pCmd\n\n for (let j = 0; j < pathExt.length; j ++) {\n const cur = p + pathExt[j]\n try {\n const is = isexe.sync(cur, { pathExt: pathExtExe })\n if (is) {\n if (opt.all)\n found.push(cur)\n else\n return cur\n }\n } catch (ex) {}\n }\n }\n\n if (opt.all && found.length)\n return found\n\n if (opt.nothrow)\n return null\n\n throw getNotFoundError(cmd)\n}\n\nmodule.exports = which\nwhich.sync = whichSync\n"],"names":["require$$1"],"mappings":";;AAAA,MAAM,YAAY,QAAQ,aAAa,WACnC,QAAQ,IAAI,WAAW,YACvB,QAAQ,IAAI,WAAW;AAE3B,MAAM,OAAO;AACb,MAAM,QAAQ,YAAY,MAAM;AAChC,MAAM,QAAQA;AAEd,MAAM,mBAAmB,CAAC,QACxB,OAAO,OAAO,IAAI,MAAM,cAAc,GAAG,EAAE,GAAG,EAAE,MAAM,SAAQ,CAAE;AAElE,MAAM,cAAc,CAAC,KAAK,QAAQ;AAChC,QAAM,QAAQ,IAAI,SAAS;AAI3B,QAAM,UAAU,IAAI,MAAM,IAAI,KAAK,aAAa,IAAI,MAAM,IAAI,IAAI,CAAC,EAAE,IAEjE;AAAA;AAAA,IAEE,GAAI,YAAY,CAAC,QAAQ,IAAG,CAAE,IAAI,CAAA;AAAA,IAClC,IAAI,IAAI,QAAQ,QAAQ,IAAI;AAAA,IACe,IAAI,MAAM,KAAK;AAAA,EAClE;AAEE,QAAM,aAAa,YACf,IAAI,WAAW,QAAQ,IAAI,WAAW,wBACtC;AACJ,QAAM,UAAU,YAAY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|
3
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
6
3
|
const t = require("io-ts");
|
|
7
4
|
const prismicCustomTypesClient = require("@prismicio/custom-types-client");
|
|
8
5
|
const customtypes = require("@prismicio/types-internal/lib/customtypes");
|
|
9
6
|
const index = require('./../../_node_modules/zod/lib/index.cjs');
|
|
10
|
-
const claudeAgentSdk = require("@anthropic-ai/claude-agent-sdk");
|
|
11
7
|
const assertPluginsInitialized = require("../../lib/assertPluginsInitialized.cjs");
|
|
12
8
|
const decodeHookResult = require("../../lib/decodeHookResult.cjs");
|
|
13
9
|
const fetch = require("../../lib/fetch.cjs");
|
|
14
10
|
const API_ENDPOINTS = require("../../constants/API_ENDPOINTS.cjs");
|
|
15
11
|
const SLICE_MACHINE_USER_AGENT = require("../../constants/SLICE_MACHINE_USER_AGENT.cjs");
|
|
16
12
|
const errors = require("../../errors.cjs");
|
|
17
|
-
const promises = require("fs/promises");
|
|
18
|
-
const os = require("os");
|
|
19
|
-
const path = require("path");
|
|
20
|
-
const crypto = require("crypto");
|
|
21
|
-
const require$$0 = require("fs");
|
|
22
13
|
const BaseManager = require("../BaseManager.cjs");
|
|
14
|
+
const node_fs = require("node:fs");
|
|
15
|
+
const os = require("node:os");
|
|
16
|
+
const crypto = require("node:crypto");
|
|
17
|
+
const path = require("node:path");
|
|
18
|
+
const fs = require("node:fs/promises");
|
|
19
|
+
const claudeAgentSdk = require("@anthropic-ai/claude-agent-sdk");
|
|
23
20
|
function _interopNamespaceDefault(e) {
|
|
24
21
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
25
22
|
if (e) {
|
|
@@ -39,10 +36,6 @@ function _interopNamespaceDefault(e) {
|
|
|
39
36
|
const t__namespace = /* @__PURE__ */ _interopNamespaceDefault(t);
|
|
40
37
|
const prismicCustomTypesClient__namespace = /* @__PURE__ */ _interopNamespaceDefault(prismicCustomTypesClient);
|
|
41
38
|
class CustomTypesManager extends BaseManager.BaseManager {
|
|
42
|
-
constructor() {
|
|
43
|
-
super(...arguments);
|
|
44
|
-
__publicField(this, "inferSliceAbortControllers", /* @__PURE__ */ new Map());
|
|
45
|
-
}
|
|
46
39
|
async readCustomTypeLibrary() {
|
|
47
40
|
var _a;
|
|
48
41
|
assertPluginsInitialized.assertPluginsInitialized(this.sliceMachinePluginRunner);
|
|
@@ -306,18 +299,10 @@ class CustomTypesManager extends BaseManager.BaseManager {
|
|
|
306
299
|
}
|
|
307
300
|
async inferSlice(args) {
|
|
308
301
|
var _a;
|
|
309
|
-
const { source, imageUrl
|
|
302
|
+
const { source, imageUrl } = args;
|
|
310
303
|
const authToken = await this.user.getAuthenticationToken();
|
|
311
304
|
const repository = await this.project.getResolvedRepositoryName();
|
|
312
|
-
|
|
313
|
-
if (requestId) {
|
|
314
|
-
abortController = new AbortController();
|
|
315
|
-
abortController.signal.addEventListener("abort", () => {
|
|
316
|
-
console.warn(`inferSlice (${source}) request ${requestId} was aborted`);
|
|
317
|
-
});
|
|
318
|
-
this.inferSliceAbortControllers.set(requestId, abortController);
|
|
319
|
-
}
|
|
320
|
-
console.info(`inferSlice (${source}) started${requestId ? ` for request ${requestId}` : ""}`);
|
|
305
|
+
console.info(`inferSlice (${source}) started`);
|
|
321
306
|
const startTime = Date.now();
|
|
322
307
|
try {
|
|
323
308
|
if (source === "figma") {
|
|
@@ -354,13 +339,13 @@ class CustomTypesManager extends BaseManager.BaseManager {
|
|
|
354
339
|
}
|
|
355
340
|
const projectRoot = await this.project.getRoot();
|
|
356
341
|
const libraryAbsPath = path.join(projectRoot, libraryID);
|
|
357
|
-
tmpDir = await
|
|
342
|
+
tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), "slice-machine-infer-slice-tmp-"));
|
|
358
343
|
const tmpImagePath = path.join(tmpDir, `${crypto.randomUUID()}.png`);
|
|
359
344
|
const response = await fetch.default(imageUrl);
|
|
360
345
|
if (!response.ok) {
|
|
361
346
|
throw new Error(`Failed to download image: ${response.status} ${response.statusText}`);
|
|
362
347
|
}
|
|
363
|
-
await
|
|
348
|
+
await fs.writeFile(tmpImagePath, Buffer.from(await response.arrayBuffer()));
|
|
364
349
|
const queries = claudeAgentSdk.query({
|
|
365
350
|
prompt: `CRITICAL INSTRUCTIONS - READ FIRST:
|
|
366
351
|
- You MUST start immediately with Step 1.1. DO NOT read, analyze, or explore any project files first.
|
|
@@ -534,8 +519,7 @@ x-prismic-repository: ${repository}
|
|
|
534
519
|
command: "npx",
|
|
535
520
|
args: ["-y", "@prismicio/mcp-server@0.0.20-alpha.6"]
|
|
536
521
|
}
|
|
537
|
-
}
|
|
538
|
-
...abortController && { abortController }
|
|
522
|
+
}
|
|
539
523
|
}
|
|
540
524
|
});
|
|
541
525
|
let newSliceAbsPath;
|
|
@@ -551,15 +535,15 @@ x-prismic-repository: ${repository}
|
|
|
551
535
|
if (!newSliceAbsPath) {
|
|
552
536
|
throw new Error("Could not find path for the newly created slice.");
|
|
553
537
|
}
|
|
554
|
-
const model = await
|
|
538
|
+
const model = await fs.readFile(path.join(newSliceAbsPath, "model.json"), "utf8");
|
|
555
539
|
if (!model) {
|
|
556
540
|
throw new Error("Could not find model for the newly created slice.");
|
|
557
541
|
}
|
|
558
|
-
await
|
|
542
|
+
await fs.rename(tmpImagePath, path.join(newSliceAbsPath, "screenshot-default.png"));
|
|
559
543
|
return InferSliceResponse.parse({ slice: JSON.parse(model) });
|
|
560
544
|
} finally {
|
|
561
|
-
if (tmpDir &&
|
|
562
|
-
await
|
|
545
|
+
if (tmpDir && node_fs.existsSync(tmpDir)) {
|
|
546
|
+
await fs.rm(tmpDir, { recursive: true });
|
|
563
547
|
}
|
|
564
548
|
}
|
|
565
549
|
} else {
|
|
@@ -569,8 +553,7 @@ x-prismic-repository: ${repository}
|
|
|
569
553
|
const response = await fetch.default(url.toString(), {
|
|
570
554
|
method: "POST",
|
|
571
555
|
headers: { Authorization: `Bearer ${authToken}` },
|
|
572
|
-
body: JSON.stringify({ imageUrl })
|
|
573
|
-
...abortController && { signal: abortController.signal }
|
|
556
|
+
body: JSON.stringify({ imageUrl })
|
|
574
557
|
});
|
|
575
558
|
if (!response.ok) {
|
|
576
559
|
throw new Error(`Failed to infer slice: ${response.statusText}`);
|
|
@@ -579,25 +562,12 @@ x-prismic-repository: ${repository}
|
|
|
579
562
|
return InferSliceResponse.parse(json);
|
|
580
563
|
}
|
|
581
564
|
} catch (error) {
|
|
582
|
-
console.error(`inferSlice (${source}) failed
|
|
565
|
+
console.error(`inferSlice (${source}) failed`, error);
|
|
583
566
|
throw error;
|
|
584
567
|
} finally {
|
|
585
|
-
if (requestId) {
|
|
586
|
-
this.inferSliceAbortControllers.delete(requestId);
|
|
587
|
-
}
|
|
588
568
|
const elapsedTimeSeconds = (Date.now() - startTime) / 1e3;
|
|
589
|
-
console.info(`inferSlice
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
async cancelInferSlice(args) {
|
|
593
|
-
const { requestId } = args;
|
|
594
|
-
const abortController = this.inferSliceAbortControllers.get(requestId);
|
|
595
|
-
if (abortController) {
|
|
596
|
-
abortController.abort();
|
|
597
|
-
this.inferSliceAbortControllers.delete(requestId);
|
|
598
|
-
return { cancelled: true };
|
|
569
|
+
console.info(`inferSlice (${source}) took ${elapsedTimeSeconds}s`);
|
|
599
570
|
}
|
|
600
|
-
return { cancelled: false };
|
|
601
571
|
}
|
|
602
572
|
}
|
|
603
573
|
const InferSliceResponse = index.default.object({
|