@pipelab/plugin-poki 1.0.0-beta.13 → 1.0.0-beta.15

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/index.cjs CHANGED
@@ -8,11 +8,11 @@ let node_os = require("node:os");
8
8
  let node_url = require("node:url");
9
9
  let node_fs = require("node:fs");
10
10
  node_fs = require_chunk.__toESM(node_fs);
11
+ let node_fs_promises = require("node:fs/promises");
12
+ node_fs_promises = require_chunk.__toESM(node_fs_promises);
11
13
  let node_http = require("node:http");
12
14
  node_http = require_chunk.__toESM(node_http);
13
15
  let node_crypto = require("node:crypto");
14
- let node_fs_promises = require("node:fs/promises");
15
- node_fs_promises = require_chunk.__toESM(node_fs_promises);
16
16
  let node_child_process = require("node:child_process");
17
17
  let node_string_decoder = require("node:string_decoder");
18
18
  let node_util = require("node:util");
@@ -1604,6 +1604,56 @@ function literal(literal_, message) {
1604
1604
  }
1605
1605
  };
1606
1606
  }
1607
+ function looseObject(entries, message) {
1608
+ return {
1609
+ kind: "schema",
1610
+ type: "loose_object",
1611
+ reference: looseObject,
1612
+ expects: "Object",
1613
+ async: false,
1614
+ entries,
1615
+ message,
1616
+ _run(dataset, config2) {
1617
+ const input = dataset.value;
1618
+ if (input && typeof input === "object") {
1619
+ dataset.typed = true;
1620
+ dataset.value = {};
1621
+ for (const key in this.entries) {
1622
+ const value2 = input[key];
1623
+ const valueDataset = this.entries[key]._run({
1624
+ typed: false,
1625
+ value: value2
1626
+ }, config2);
1627
+ if (valueDataset.issues) {
1628
+ const pathItem = {
1629
+ type: "object",
1630
+ origin: "value",
1631
+ input,
1632
+ key,
1633
+ value: value2
1634
+ };
1635
+ for (const issue of valueDataset.issues) {
1636
+ if (issue.path) issue.path.unshift(pathItem);
1637
+ else issue.path = [pathItem];
1638
+ dataset.issues?.push(issue);
1639
+ }
1640
+ if (!dataset.issues) dataset.issues = valueDataset.issues;
1641
+ if (config2.abortEarly) {
1642
+ dataset.typed = false;
1643
+ break;
1644
+ }
1645
+ }
1646
+ if (!valueDataset.typed) dataset.typed = false;
1647
+ if (valueDataset.value !== void 0 || key in input) dataset.value[key] = valueDataset.value;
1648
+ }
1649
+ if (!dataset.issues || !config2.abortEarly) {
1650
+ for (const key in input) if (_isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key];
1651
+ }
1652
+ } else _addIssue(this, "type", dataset, config2);
1653
+ return dataset;
1654
+ }
1655
+ };
1656
+ }
1607
1657
  function number(message) {
1608
1658
  return {
1609
1659
  kind: "schema",
@@ -2141,6 +2191,18 @@ settingsMigratorInternal.createMigrations({
2141
2191
  })
2142
2192
  ]
2143
2193
  });
2194
+ const connectionsMigratorInternal = createMigrator();
2195
+ const defaultConnections = connectionsMigratorInternal.createDefault({
2196
+ version: "1.0.0",
2197
+ connections: []
2198
+ });
2199
+ connectionsMigratorInternal.createMigrations({
2200
+ defaultValue: defaultConnections,
2201
+ migrations: [createMigration({
2202
+ version: "1.0.0",
2203
+ up: finalVersion
2204
+ })]
2205
+ });
2144
2206
  const fileRepoMigratorInternal = createMigrator();
2145
2207
  const defaultFileRepo = fileRepoMigratorInternal.createDefault({
2146
2208
  version: "2.0.0",
@@ -2302,11 +2364,51 @@ const LEGACY_ID_MAP = {
2302
2364
  };
2303
2365
  const getStrictPluginId = (pluginId) => {
2304
2366
  if (!pluginId) return pluginId;
2305
- if (LEGACY_ID_MAP[pluginId]) return LEGACY_ID_MAP[pluginId];
2306
- if (pluginId.startsWith("@") || pluginId.includes("/") || pluginId.startsWith("pipelab-plugin-")) return pluginId;
2307
- const prefixed = `@pipelab/plugin-${pluginId}`;
2308
- return LEGACY_ID_MAP[prefixed] || prefixed;
2367
+ return LEGACY_ID_MAP[pluginId] || pluginId;
2309
2368
  };
2369
+ //#endregion
2370
+ //#region ../../packages/shared/src/save-location.ts
2371
+ const SaveLocationInternalValidator = object({
2372
+ id: string(),
2373
+ project: string(),
2374
+ lastModified: string(),
2375
+ type: literal("internal"),
2376
+ configName: string()
2377
+ });
2378
+ const SaveLocationValidator = union([
2379
+ object({
2380
+ id: string(),
2381
+ project: string(),
2382
+ path: string(),
2383
+ lastModified: string(),
2384
+ type: literal("external"),
2385
+ summary: object({
2386
+ plugins: array(string()),
2387
+ name: string(),
2388
+ description: string()
2389
+ })
2390
+ }),
2391
+ SaveLocationInternalValidator,
2392
+ object({
2393
+ id: string(),
2394
+ project: string(),
2395
+ type: literal("pipelab-cloud")
2396
+ })
2397
+ ]);
2398
+ object({
2399
+ version: literal("1.0.0"),
2400
+ data: optional(record(string(), SaveLocationValidator), {})
2401
+ });
2402
+ const FileRepoProjectValidatorV2$1 = object({
2403
+ id: string(),
2404
+ name: string(),
2405
+ description: string()
2406
+ });
2407
+ object({
2408
+ version: literal("2.0.0"),
2409
+ projects: array(FileRepoProjectValidatorV2$1),
2410
+ pipelines: optional(array(SaveLocationValidator), [])
2411
+ });
2310
2412
  object({
2311
2413
  cacheFolder: string(),
2312
2414
  theme: union([literal("light"), literal("dark")]),
@@ -2458,6 +2560,17 @@ object({
2458
2560
  })),
2459
2561
  isInternalMigrationBannerClosed: optional(boolean(), false)
2460
2562
  });
2563
+ const ConnectionValidator = looseObject({
2564
+ id: string(),
2565
+ pluginName: string(),
2566
+ name: string(),
2567
+ createdAt: string(),
2568
+ isDefault: boolean()
2569
+ });
2570
+ object({
2571
+ version: literal("1.0.0"),
2572
+ connections: array(ConnectionValidator)
2573
+ });
2461
2574
  //#endregion
2462
2575
  //#region ../../node_modules/tslog/dist/esm/prettyLogStyles.js
2463
2576
  const prettyLogStyles = {
@@ -2978,7 +3091,7 @@ const useLogger = () => {
2978
3091
  const OriginValidator = object({
2979
3092
  pluginId: string(),
2980
3093
  nodeId: string(),
2981
- version: pipe(optional(string()), description("Pinned version of the plugin for this block. Falls back to \"latest\" when absent."))
3094
+ version: optional(pipe(string(), description("Pinned version of the plugin for this block. Falls back to \"latest\" when absent.")))
2982
3095
  });
2983
3096
  const BlockActionValidatorV1 = object({
2984
3097
  type: literal("action"),
@@ -2991,7 +3104,7 @@ const EditorParamValidatorV3 = union([literal("simple"), literal("editor")]);
2991
3104
  const BlockActionValidatorV3 = object({
2992
3105
  type: literal("action"),
2993
3106
  uid: string(),
2994
- name: pipe(optional(string()), description("A custom name provided by the user")),
3107
+ name: optional(pipe(string(), description("A custom name provided by the user"))),
2995
3108
  disabled: optional(boolean()),
2996
3109
  params: record(string(), object({
2997
3110
  editor: EditorParamValidatorV3,
@@ -45291,35 +45404,6 @@ const createPathParam = (value, definition) => {
45291
45404
  };
45292
45405
  };
45293
45406
  //#endregion
45294
- //#region ../../packages/shared/src/save-location.ts
45295
- const SaveLocationInternalValidator = object({
45296
- id: string(),
45297
- project: string(),
45298
- lastModified: string(),
45299
- type: literal("internal"),
45300
- configName: string()
45301
- });
45302
- const SaveLocationValidator = union([
45303
- object({
45304
- id: string(),
45305
- project: string(),
45306
- path: string(),
45307
- lastModified: string(),
45308
- type: literal("external"),
45309
- summary: object({
45310
- plugins: array(string()),
45311
- name: string(),
45312
- description: string()
45313
- })
45314
- }),
45315
- SaveLocationInternalValidator,
45316
- object({
45317
- id: string(),
45318
- project: string(),
45319
- type: literal("pipelab-cloud")
45320
- })
45321
- ]);
45322
- //#endregion
45323
45407
  //#region ../../packages/shared/src/websocket.types.ts
45324
45408
  var WebSocketError = class extends Error {
45325
45409
  constructor(message, code, requestId) {
@@ -45336,20 +45420,6 @@ object({
45336
45420
  version: literal("1.0.0"),
45337
45421
  data: optional(record(string(), SaveLocationValidator), {})
45338
45422
  });
45339
- const FileRepoProjectValidatorV2$1 = object({
45340
- id: string(),
45341
- name: string(),
45342
- description: string()
45343
- });
45344
- object({
45345
- version: literal("2.0.0"),
45346
- projects: array(FileRepoProjectValidatorV2$1),
45347
- pipelines: optional(array(SaveLocationValidator), [])
45348
- });
45349
- object({
45350
- version: literal("1.0.0"),
45351
- data: optional(record(string(), SaveLocationValidator), {})
45352
- });
45353
45423
  const FileRepoProjectValidatorV2 = object({
45354
45424
  id: string(),
45355
45425
  name: string(),
@@ -45361,8 +45431,14 @@ object({
45361
45431
  pipelines: optional(array(SaveLocationValidator), [])
45362
45432
  });
45363
45433
  //#endregion
45434
+ //#region ../../packages/constants/src/index.ts
45435
+ const websocketPort = 33753;
45436
+ const DEFAULT_NODE_VERSION = "24.14.1";
45437
+ const DEFAULT_PNPM_VERSION = "10.12.0";
45438
+ //#endregion
45364
45439
  //#region ../../packages/core-node/src/context.ts
45365
- const _dirname = typeof __dirname !== "undefined" ? __dirname : require("url").pathToFileURL(__filename).href ? (0, node_path.dirname)((0, node_url.fileURLToPath)(require("url").pathToFileURL(__filename).href)) : process.cwd();
45440
+ const metaUrl = require("url").pathToFileURL(__filename).href;
45441
+ const _dirname = typeof __dirname !== "undefined" ? __dirname : metaUrl ? (0, node_path.dirname)((0, node_url.fileURLToPath)(metaUrl)) : process.cwd();
45366
45442
  const isDev = process.env.NODE_ENV === "development";
45367
45443
  /**
45368
45444
  * Finds the monorepo root by looking for pnpm-workspace.yaml.
@@ -48934,9 +49010,6 @@ const useAPI = () => {
48934
49010
  };
48935
49011
  };
48936
49012
  //#endregion
48937
- //#region ../../packages/constants/src/index.ts
48938
- const websocketPort = 33753;
48939
- //#endregion
48940
49013
  //#region ../../packages/core-node/src/websocket-server.ts
48941
49014
  var WebSocketServer = class {
48942
49015
  wss = null;
@@ -59945,14 +60018,14 @@ var require_path_reservations = /* @__PURE__ */ require_chunk.__commonJSMin(((ex
59945
60018
  const assert$1 = require("assert");
59946
60019
  const normalize = require_normalize_unicode();
59947
60020
  const stripSlashes = require_strip_trailing_slashes();
59948
- const { join: join$17 } = require("path");
60021
+ const { join: join$18 } = require("path");
59949
60022
  const isWindows = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === "win32";
59950
60023
  module.exports = () => {
59951
60024
  const queues = /* @__PURE__ */ new Map();
59952
60025
  const reservations = /* @__PURE__ */ new Map();
59953
60026
  const getDirs = (path$62) => {
59954
60027
  return path$62.split("/").slice(0, -1).reduce((set, path$63) => {
59955
- if (set.length) path$63 = join$17(set[set.length - 1], path$63);
60028
+ if (set.length) path$63 = join$18(set[set.length - 1], path$63);
59956
60029
  set.push(path$63 || "/");
59957
60030
  return set;
59958
60031
  }, []);
@@ -60006,7 +60079,7 @@ var require_path_reservations = /* @__PURE__ */ require_chunk.__commonJSMin(((ex
60006
60079
  };
60007
60080
  const reserve = (paths, fn) => {
60008
60081
  paths = isWindows ? ["win32 parallelization disabled"] : paths.map((p) => {
60009
- return stripSlashes(join$17(normalize(p))).toLowerCase();
60082
+ return stripSlashes(join$18(normalize(p))).toLowerCase();
60010
60083
  });
60011
60084
  const dirs = new Set(paths.map((path$67) => getDirs(path$67)).reduce((a, b) => a.concat(b)));
60012
60085
  reservations.set(fn, {
@@ -89344,14 +89417,6 @@ var import_tar = /* @__PURE__ */ require_chunk.__toESM(require_tar$1(), 1);
89344
89417
  var import_yauzl = /* @__PURE__ */ require_chunk.__toESM(require_yauzl(), 1);
89345
89418
  require_archiver();
89346
89419
  /**
89347
- * Generates a unique temporary folder.
89348
- */
89349
- const generateTempFolder = async (base) => {
89350
- const targetBase = base || (0, node_os.tmpdir)();
89351
- await (0, node_fs_promises.mkdir)(targetBase, { recursive: true });
89352
- return await (0, node_fs_promises.mkdtemp)((0, node_path.join)(await (0, node_fs_promises.realpath)(targetBase), "pipelab-"));
89353
- };
89354
- /**
89355
89420
  * Extracts a .tar.gz archive.
89356
89421
  */
89357
89422
  async function extractTarGz(archivePath, destinationDir) {
@@ -95851,7 +95916,7 @@ var require_index_min$3 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports)
95851
95916
  //#region ../../node_modules/@npmcli/promise-spawn/node_modules/which/lib/index.js
95852
95917
  var require_lib$27 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
95853
95918
  const { isexe, sync: isexeSync } = require_index_min$3();
95854
- const { join: join$14, delimiter: delimiter$4, sep: sep$4, posix: posix$1 } = require("path");
95919
+ const { join: join$15, delimiter: delimiter$4, sep: sep$4, posix: posix$1 } = require("path");
95855
95920
  const isWindows = process.platform === "win32";
95856
95921
  /* istanbul ignore next */
95857
95922
  const rSlash = new RegExp(`[${posix$1.sep}${sep$4 === posix$1.sep ? "" : sep$4}]`.replace(/(\\)/g, "\\$1"));
@@ -95881,7 +95946,7 @@ var require_lib$27 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
95881
95946
  };
95882
95947
  const getPathPart = (raw, cmd) => {
95883
95948
  const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
95884
- return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$14(pathPart, cmd);
95949
+ return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$15(pathPart, cmd);
95885
95950
  };
95886
95951
  const which = async (cmd, opt = {}) => {
95887
95952
  const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
@@ -96630,7 +96695,7 @@ var require_index_min$2 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports)
96630
96695
  //#region ../../node_modules/@npmcli/git/node_modules/which/lib/index.js
96631
96696
  var require_lib$24 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
96632
96697
  const { isexe, sync: isexeSync } = require_index_min$2();
96633
- const { join: join$13, delimiter: delimiter$3, sep: sep$3, posix } = require("path");
96698
+ const { join: join$14, delimiter: delimiter$3, sep: sep$3, posix } = require("path");
96634
96699
  const isWindows = process.platform === "win32";
96635
96700
  /* istanbul ignore next */
96636
96701
  const rSlash = new RegExp(`[${posix.sep}${sep$3 === posix.sep ? "" : sep$3}]`.replace(/(\\)/g, "\\$1"));
@@ -96660,7 +96725,7 @@ var require_lib$24 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
96660
96725
  };
96661
96726
  const getPathPart = (raw, cmd) => {
96662
96727
  const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
96663
- return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$13(pathPart, cmd);
96728
+ return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$14(pathPart, cmd);
96664
96729
  };
96665
96730
  const which = async (cmd, opt = {}) => {
96666
96731
  const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
@@ -98558,7 +98623,7 @@ var require_lib$22 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
98558
98623
  //#endregion
98559
98624
  //#region ../../node_modules/npm-normalize-package-bin/lib/index.js
98560
98625
  var require_lib$21 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
98561
- const { join: join$12, basename: basename$4 } = require("path");
98626
+ const { join: join$13, basename: basename$4 } = require("path");
98562
98627
  const normalize = (pkg) => !pkg.bin ? removeBin(pkg) : typeof pkg.bin === "string" ? normalizeString(pkg) : Array.isArray(pkg.bin) ? normalizeArray(pkg) : typeof pkg.bin === "object" ? normalizeObject(pkg) : removeBin(pkg);
98563
98628
  const normalizeString = (pkg) => {
98564
98629
  if (!pkg.name) return removeBin(pkg);
@@ -98581,9 +98646,9 @@ var require_lib$21 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
98581
98646
  const clean = {};
98582
98647
  let hasBins = false;
98583
98648
  Object.keys(orig).forEach((binKey) => {
98584
- const base = join$12("/", basename$4(binKey.replace(/\\|:/g, "/"))).slice(1);
98649
+ const base = join$13("/", basename$4(binKey.replace(/\\|:/g, "/"))).slice(1);
98585
98650
  if (typeof orig[binKey] !== "string" || !base) return;
98586
- const binTarget = join$12("/", orig[binKey].replace(/\\/g, "/")).replace(/\\/g, "/").slice(1);
98651
+ const binTarget = join$13("/", orig[binKey].replace(/\\/g, "/")).replace(/\\/g, "/").slice(1);
98587
98652
  if (!binTarget) return;
98588
98653
  clean[base] = binTarget;
98589
98654
  hasBins = true;
@@ -100656,7 +100721,7 @@ var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
100656
100721
  const { ERR_FS_CP_DIR_TO_NON_DIR, ERR_FS_CP_EEXIST, ERR_FS_CP_EINVAL, ERR_FS_CP_FIFO_PIPE, ERR_FS_CP_NON_DIR_TO_DIR, ERR_FS_CP_SOCKET, ERR_FS_CP_SYMLINK_TO_SUBDIRECTORY, ERR_FS_CP_UNKNOWN, ERR_FS_EISDIR, ERR_INVALID_ARG_TYPE } = require_errors$3();
100657
100722
  const { constants: { errno: { EEXIST, EISDIR, EINVAL, ENOTDIR } } } = require("os");
100658
100723
  const { chmod: chmod$2, copyFile, lstat: lstat$2, mkdir: mkdir$8, readdir: readdir$6, readlink, stat: stat$5, symlink, unlink, utimes } = require("fs/promises");
100659
- const { dirname: dirname$9, isAbsolute: isAbsolute$2, join: join$11, parse, resolve: resolve$10, sep: sep$2, toNamespacedPath } = require("path");
100724
+ const { dirname: dirname$9, isAbsolute: isAbsolute$2, join: join$12, parse, resolve: resolve$10, sep: sep$2, toNamespacedPath } = require("path");
100660
100725
  const { fileURLToPath } = require("url");
100661
100726
  const defaultOptions = {
100662
100727
  dereference: false,
@@ -100865,8 +100930,8 @@ var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
100865
100930
  const dir = await readdir$6(src);
100866
100931
  for (let i = 0; i < dir.length; i++) {
100867
100932
  const item = dir[i];
100868
- const srcItem = join$11(src, item);
100869
- const destItem = join$11(dest, item);
100933
+ const srcItem = join$12(src, item);
100934
+ const destItem = join$12(dest, item);
100870
100935
  const { destStat } = await checkPaths(srcItem, destItem, opts);
100871
100936
  await startCopy(destStat, srcItem, destItem, opts);
100872
100937
  }
@@ -100930,13 +100995,13 @@ var require_cp = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module)
100930
100995
  //#endregion
100931
100996
  //#region ../../node_modules/cacache/node_modules/@npmcli/fs/lib/with-temp-dir.js
100932
100997
  var require_with_temp_dir = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
100933
- const { join: join$10, sep: sep$1 } = require("path");
100998
+ const { join: join$11, sep: sep$1 } = require("path");
100934
100999
  const getOptions = require_get_options();
100935
101000
  const { mkdir: mkdir$7, mkdtemp, rm: rm$7 } = require("fs/promises");
100936
101001
  const withTempDir = async (root, fn, opts) => {
100937
101002
  const options = getOptions(opts, { copy: ["tmpPrefix"] });
100938
101003
  await mkdir$7(root, { recursive: true });
100939
- const target = await mkdtemp(join$10(`${root}${sep$1}`, options.tmpPrefix || ""));
101004
+ const target = await mkdtemp(join$11(`${root}${sep$1}`, options.tmpPrefix || ""));
100940
101005
  let err;
100941
101006
  let result;
100942
101007
  try {
@@ -100959,10 +101024,10 @@ var require_with_temp_dir = /* @__PURE__ */ require_chunk.__commonJSMin(((export
100959
101024
  //#region ../../node_modules/cacache/node_modules/@npmcli/fs/lib/readdir-scoped.js
100960
101025
  var require_readdir_scoped = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
100961
101026
  const { readdir: readdir$5 } = require("fs/promises");
100962
- const { join: join$9 } = require("path");
101027
+ const { join: join$10 } = require("path");
100963
101028
  const readdirScoped = async (dir) => {
100964
101029
  const results = [];
100965
- for (const item of await readdir$5(dir)) if (item.startsWith("@")) for (const scopedItem of await readdir$5(join$9(dir, item))) results.push(join$9(item, scopedItem));
101030
+ for (const item of await readdir$5(dir)) if (item.startsWith("@")) for (const scopedItem of await readdir$5(join$10(dir, item))) results.push(join$10(item, scopedItem));
100966
101031
  else results.push(item);
100967
101032
  return results;
100968
101033
  };
@@ -100971,7 +101036,7 @@ var require_readdir_scoped = /* @__PURE__ */ require_chunk.__commonJSMin(((expor
100971
101036
  //#endregion
100972
101037
  //#region ../../node_modules/cacache/node_modules/@npmcli/fs/lib/move-file.js
100973
101038
  var require_move_file = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
100974
- const { dirname: dirname$8, join: join$8, resolve: resolve$9, relative: relative$1, isAbsolute: isAbsolute$1 } = require("path");
101039
+ const { dirname: dirname$8, join: join$9, resolve: resolve$9, relative: relative$1, isAbsolute: isAbsolute$1 } = require("path");
100975
101040
  const fs$12 = require("fs/promises");
100976
101041
  const pathExists = async (path$54) => {
100977
101042
  try {
@@ -100996,7 +101061,7 @@ var require_move_file = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, m
100996
101061
  const sourceStat = await fs$12.lstat(source);
100997
101062
  if (sourceStat.isDirectory()) {
100998
101063
  const files = await fs$12.readdir(source);
100999
- await Promise.all(files.map((file) => moveFile(join$8(source, file), join$8(destination, file), options, false, symlinks)));
101064
+ await Promise.all(files.map((file) => moveFile(join$9(source, file), join$9(destination, file), options, false, symlinks)));
101000
101065
  } else if (sourceStat.isSymbolicLink()) symlinks.push({
101001
101066
  source,
101002
101067
  destination
@@ -110535,9 +110600,9 @@ var require_protected = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, m
110535
110600
  //#region ../../node_modules/pacote/lib/util/cache-dir.js
110536
110601
  var require_cache_dir = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
110537
110602
  const { resolve: resolve$7 } = require("node:path");
110538
- const { tmpdir: tmpdir$2, homedir } = require("node:os");
110603
+ const { tmpdir, homedir } = require("node:os");
110539
110604
  module.exports = (fakePlatform = false) => {
110540
- const temp = tmpdir$2();
110605
+ const temp = tmpdir();
110541
110606
  const uidOrPid = process.getuid ? process.getuid() : process.pid;
110542
110607
  const home = homedir() || resolve$7(temp, "npm-" + uidOrPid);
110543
110608
  const platform = fakePlatform || process.platform;
@@ -112359,7 +112424,7 @@ var require_lib$10 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
112359
112424
  var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
112360
112425
  const { Walker: IgnoreWalker } = require_lib$10();
112361
112426
  const { lstatSync: lstat$1, readFileSync: readFile$4 } = require("fs");
112362
- const { basename: basename$2, dirname: dirname$6, extname: extname$1, join: join$7, relative, resolve: resolve$6, sep } = require("path");
112427
+ const { basename: basename$2, dirname: dirname$6, extname: extname$1, join: join$8, relative, resolve: resolve$6, sep } = require("path");
112363
112428
  const { log } = require_lib$29();
112364
112429
  const defaultRules = Symbol("npm-packlist.rules.default");
112365
112430
  const strictRules = Symbol("npm-packlist.rules.strict");
@@ -112392,7 +112457,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
112392
112457
  const normalizePath = (path$46) => path$46.split("\\").join("/");
112393
112458
  const readOutOfTreeIgnoreFiles = (root, rel, result = []) => {
112394
112459
  for (const file of [".npmignore", ".gitignore"]) try {
112395
- const ignoreContent = readFile$4(join$7(root, file), { encoding: "utf8" });
112460
+ const ignoreContent = readFile$4(join$8(root, file), { encoding: "utf8" });
112396
112461
  result.push(ignoreContent);
112397
112462
  break;
112398
112463
  } catch (err) {
@@ -112401,8 +112466,8 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
112401
112466
  }
112402
112467
  if (!rel) return result;
112403
112468
  const firstRel = rel.split(sep, 1)[0];
112404
- const newRoot = join$7(root, firstRel);
112405
- return readOutOfTreeIgnoreFiles(newRoot, relative(newRoot, join$7(root, rel)), result);
112469
+ const newRoot = join$8(root, firstRel);
112470
+ return readOutOfTreeIgnoreFiles(newRoot, relative(newRoot, join$8(root, rel)), result);
112406
112471
  };
112407
112472
  var PackWalker = class PackWalker extends IgnoreWalker {
112408
112473
  constructor(tree, opts) {
@@ -112469,7 +112534,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
112469
112534
  let ignoreFiles = null;
112470
112535
  if (this.tree.workspaces) {
112471
112536
  const workspaceDirs = [...this.tree.workspaces.values()].map((dir) => dir.replace(/\\/g, "/"));
112472
- const entryPath = join$7(this.path, entry).replace(/\\/g, "/");
112537
+ const entryPath = join$8(this.path, entry).replace(/\\/g, "/");
112473
112538
  if (workspaceDirs.includes(entryPath)) ignoreFiles = [
112474
112539
  defaultRules,
112475
112540
  "package.json",
@@ -112529,7 +112594,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
112529
112594
  if (file.endsWith("/*")) file += "*";
112530
112595
  const inverse = `!${file}`;
112531
112596
  try {
112532
- const stat = lstat$1(join$7(this.path, file.replace(/^!+/, "")).replace(/\\/g, "/"));
112597
+ const stat = lstat$1(join$8(this.path, file.replace(/^!+/, "")).replace(/\\/g, "/"));
112533
112598
  if (stat.isFile()) {
112534
112599
  strict.unshift(inverse);
112535
112600
  this.requiredFiles.push(file.startsWith("/") ? file.slice(1) : file);
@@ -112586,7 +112651,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
112586
112651
  walker.start();
112587
112652
  });
112588
112653
  const relativeFrom = relative(this.root, walker.path);
112589
- for (const file of bundled) this.result.add(join$7(relativeFrom, file).replace(/\\/g, "/"));
112654
+ for (const file of bundled) this.result.add(join$8(relativeFrom, file).replace(/\\/g, "/"));
112590
112655
  }
112591
112656
  }
112592
112657
  };
@@ -151071,8 +151136,6 @@ const sendStartupProgress = (message) => {
151071
151136
  };
151072
151137
  //#endregion
151073
151138
  //#region ../../packages/core-node/src/utils/remote.ts
151074
- const DEFAULT_NODE_VERSION = "24.14.1";
151075
- const DEFAULT_PNPM_VERSION = "10.12.0";
151076
151139
  function isPackageComplete(packageDir) {
151077
151140
  return (0, node_fs.existsSync)((0, node_path.join)(packageDir, "package.json"));
151078
151141
  }
@@ -151264,7 +151327,7 @@ async function ensureNodeJS(context, version = DEFAULT_NODE_VERSION) {
151264
151327
  const extension = isWindows ? "zip" : "tar.gz";
151265
151328
  const fileName = `node-v${version}-${platform === "osx" ? "darwin" : platform}-${arch}.${extension}`;
151266
151329
  const downloadUrl = `https://nodejs.org/dist/v${version}/${fileName}`;
151267
- const tempDir = await generateTempFolder((0, node_os.tmpdir)());
151330
+ const tempDir = await context.createTempFolder("node-download-");
151268
151331
  const archivePath = (0, node_path.join)(tempDir, fileName);
151269
151332
  sendStartupProgress(`Downloading Node.js v${version}...`);
151270
151333
  console.log(`Downloading Node.js from ${downloadUrl}...`);
@@ -151466,7 +151529,7 @@ async function resolveEntryPoint(packageDir, packageName) {
151466
151529
  }
151467
151530
  //#endregion
151468
151531
  //#region ../../packages/core-node/src/handler-func.ts
151469
- const { join: join$5 } = node_path.default;
151532
+ const { join: join$6 } = node_path.default;
151470
151533
  //#endregion
151471
151534
  //#region ../../packages/core-node/src/handlers/plugins.ts
151472
151535
  const localPluginsMap = /* @__PURE__ */ new Map();
@@ -151492,83 +151555,99 @@ if (isDev && projectRoot) {
151492
151555
  const createActionRunner = (runner) => runner;
151493
151556
  //#endregion
151494
151557
  //#region src/index.ts
151495
- var src_default = createNodeDefinition({ nodes: [{
151496
- node: createAction({
151497
- id: "poki-upload",
151498
- name: "Upload to Poki.io",
151499
- description: "",
151500
- icon: "",
151501
- displayString: "`Upload ${fmt.param(params['input-folder'], 'primary', 'No path selected')} to ${fmt.param(params['project'], 'primary', 'No project')} poki game (${fmt.param(params['name'], 'primary', 'No version name')})`",
151502
- meta: {},
151503
- params: {
151504
- "input-folder": createPathParam("", {
151505
- required: true,
151506
- label: "Folder to Upload",
151507
- control: {
151508
- type: "path",
151509
- options: { properties: ["openDirectory"] }
151510
- }
151511
- }),
151512
- project: createStringParam("", {
151513
- required: true,
151514
- label: "Project",
151515
- description: "This is you Poki game id"
151516
- }),
151517
- name: createStringParam("", {
151518
- required: true,
151519
- label: "Version name",
151520
- description: "This is the name of the version"
151521
- }),
151522
- notes: createStringParam("", {
151523
- required: true,
151524
- label: "Version notes",
151525
- description: "These are notes you want to specify with your version"
151526
- })
151527
- },
151528
- outputs: {}
151529
- }),
151530
- runner: createActionRunner(async ({ log, inputs, paths, abortSignal, cwd, context }) => {
151531
- const { node, thirdparty, pnpm } = paths;
151532
- const { packageDir: pokiDir } = await fetchPackage("@poki/cli", "0.1.19", {
151533
- context,
151534
- installDeps: true
151535
- });
151536
- const poki = (0, node_path.join)(pokiDir, "bin", "index.js");
151537
- const dist = (0, node_path.join)(cwd, "dist");
151538
- await (0, node_fs_promises.mkdir)(dist, { recursive: true });
151539
- await (0, node_fs_promises.cp)(inputs["input-folder"], dist, { recursive: true });
151540
- const pokiJsonPath = (0, node_path.join)(cwd, "poki.json");
151541
- console.log("pokiJsonPath", pokiJsonPath);
151542
- await (0, node_fs_promises.writeFile)(pokiJsonPath, JSON.stringify({
151543
- game_id: inputs.project,
151544
- build_dir: "dist"
151545
- }, void 0, 2), "utf-8");
151546
- log("process.env.MSW_BRIDGE_PORT", process.env.MSW_BRIDGE_PORT);
151547
- log("process.env.NODE_OPTIONS", process.env.NODE_OPTIONS);
151548
- await runWithLiveLogs(node, [
151549
- poki,
151550
- "upload",
151551
- "--name",
151552
- inputs.name,
151553
- "--notes",
151554
- inputs.notes
151555
- ], {
151556
- cwd,
151557
- env: {
151558
- ...process.env,
151559
- PATH: `${(0, node_path.dirname)(node)}${node_path.delimiter}${process.env.PATH}`
151560
- },
151561
- cancelSignal: abortSignal
151562
- }, log, {
151563
- onStderr(data, subprocess) {
151564
- log(data);
151558
+ var src_default = createNodeDefinition({
151559
+ nodes: [{
151560
+ node: createAction({
151561
+ id: "poki-upload",
151562
+ name: "Upload to Poki.io",
151563
+ description: "",
151564
+ icon: "",
151565
+ displayString: "`Upload ${fmt.param(params['input-folder'], 'primary', 'No path selected')} to ${fmt.param(params['project'], 'primary', 'No project')} poki game (${fmt.param(params['name'], 'primary', 'No version name')})`",
151566
+ meta: {},
151567
+ params: {
151568
+ "input-folder": createPathParam("", {
151569
+ required: true,
151570
+ label: "Folder to Upload",
151571
+ control: {
151572
+ type: "path",
151573
+ options: { properties: ["openDirectory"] }
151574
+ }
151575
+ }),
151576
+ project: createStringParam("", {
151577
+ required: true,
151578
+ label: "Project",
151579
+ description: "This is you Poki game id"
151580
+ }),
151581
+ name: createStringParam("", {
151582
+ required: true,
151583
+ label: "Version name",
151584
+ description: "This is the name of the version"
151585
+ }),
151586
+ notes: createStringParam("", {
151587
+ required: true,
151588
+ label: "Version notes",
151589
+ description: "These are notes you want to specify with your version"
151590
+ })
151565
151591
  },
151566
- onStdout(data, subprocess) {
151567
- log(data);
151568
- }
151569
- });
151570
- log("Uploaded to poki");
151571
- })
151572
- }] });
151592
+ outputs: {}
151593
+ }),
151594
+ runner: createActionRunner(async ({ log, inputs, paths, abortSignal, cwd, context }) => {
151595
+ const { node, thirdparty, pnpm } = paths;
151596
+ const { packageDir: pokiDir } = await fetchPackage("@poki/cli", "0.1.19", {
151597
+ context,
151598
+ installDeps: true
151599
+ });
151600
+ const poki = (0, node_path.join)(pokiDir, "bin", "index.js");
151601
+ const dist = (0, node_path.join)(cwd, "dist");
151602
+ await (0, node_fs_promises.mkdir)(dist, { recursive: true });
151603
+ await (0, node_fs_promises.cp)(inputs["input-folder"], dist, { recursive: true });
151604
+ const pokiJsonPath = (0, node_path.join)(cwd, "poki.json");
151605
+ console.log("pokiJsonPath", pokiJsonPath);
151606
+ await (0, node_fs_promises.writeFile)(pokiJsonPath, JSON.stringify({
151607
+ game_id: inputs.project,
151608
+ build_dir: "dist"
151609
+ }, void 0, 2), "utf-8");
151610
+ log("process.env.MSW_BRIDGE_PORT", process.env.MSW_BRIDGE_PORT);
151611
+ log("process.env.NODE_OPTIONS", process.env.NODE_OPTIONS);
151612
+ await runWithLiveLogs(node, [
151613
+ poki,
151614
+ "upload",
151615
+ "--name",
151616
+ inputs.name,
151617
+ "--notes",
151618
+ inputs.notes
151619
+ ], {
151620
+ cwd,
151621
+ env: {
151622
+ ...process.env,
151623
+ PATH: `${(0, node_path.dirname)(node)}${node_path.delimiter}${process.env.PATH}`
151624
+ },
151625
+ cancelSignal: abortSignal
151626
+ }, log, {
151627
+ onStderr(data, subprocess) {
151628
+ log(data);
151629
+ },
151630
+ onStdout(data, subprocess) {
151631
+ log(data);
151632
+ }
151633
+ });
151634
+ log("Uploaded to poki");
151635
+ })
151636
+ }],
151637
+ integrations: [{
151638
+ name: "Poki Developer Profile",
151639
+ fields: [{
151640
+ key: "gameId",
151641
+ label: "Game ID",
151642
+ type: "text",
151643
+ placeholder: "e.g., poki-game-id"
151644
+ }, {
151645
+ key: "apiKey",
151646
+ label: "Developer Token",
151647
+ type: "password",
151648
+ placeholder: "Poki Developer Token"
151649
+ }]
151650
+ }]
151651
+ });
151573
151652
  //#endregion
151574
151653
  module.exports = src_default;