@pipelab/plugin-netlify 1.0.0-beta.14 → 1.0.0-beta.16
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 +276 -169
- package/dist/index.mjs +253 -147
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
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");
|
|
@@ -26,6 +26,8 @@ let node_v8 = require("node:v8");
|
|
|
26
26
|
let node_stream_promises = require("node:stream/promises");
|
|
27
27
|
let node_stream = require("node:stream");
|
|
28
28
|
let node_buffer = require("node:buffer");
|
|
29
|
+
let node_dns_promises = require("node:dns/promises");
|
|
30
|
+
node_dns_promises = require_chunk.__toESM(node_dns_promises);
|
|
29
31
|
//#region ../../packages/migration/src/models/createMigration.ts
|
|
30
32
|
function createMigration$1(migration) {
|
|
31
33
|
return {
|
|
@@ -1604,6 +1606,56 @@ function literal(literal_, message) {
|
|
|
1604
1606
|
}
|
|
1605
1607
|
};
|
|
1606
1608
|
}
|
|
1609
|
+
function looseObject(entries, message) {
|
|
1610
|
+
return {
|
|
1611
|
+
kind: "schema",
|
|
1612
|
+
type: "loose_object",
|
|
1613
|
+
reference: looseObject,
|
|
1614
|
+
expects: "Object",
|
|
1615
|
+
async: false,
|
|
1616
|
+
entries,
|
|
1617
|
+
message,
|
|
1618
|
+
_run(dataset, config2) {
|
|
1619
|
+
const input = dataset.value;
|
|
1620
|
+
if (input && typeof input === "object") {
|
|
1621
|
+
dataset.typed = true;
|
|
1622
|
+
dataset.value = {};
|
|
1623
|
+
for (const key in this.entries) {
|
|
1624
|
+
const value2 = input[key];
|
|
1625
|
+
const valueDataset = this.entries[key]._run({
|
|
1626
|
+
typed: false,
|
|
1627
|
+
value: value2
|
|
1628
|
+
}, config2);
|
|
1629
|
+
if (valueDataset.issues) {
|
|
1630
|
+
const pathItem = {
|
|
1631
|
+
type: "object",
|
|
1632
|
+
origin: "value",
|
|
1633
|
+
input,
|
|
1634
|
+
key,
|
|
1635
|
+
value: value2
|
|
1636
|
+
};
|
|
1637
|
+
for (const issue of valueDataset.issues) {
|
|
1638
|
+
if (issue.path) issue.path.unshift(pathItem);
|
|
1639
|
+
else issue.path = [pathItem];
|
|
1640
|
+
dataset.issues?.push(issue);
|
|
1641
|
+
}
|
|
1642
|
+
if (!dataset.issues) dataset.issues = valueDataset.issues;
|
|
1643
|
+
if (config2.abortEarly) {
|
|
1644
|
+
dataset.typed = false;
|
|
1645
|
+
break;
|
|
1646
|
+
}
|
|
1647
|
+
}
|
|
1648
|
+
if (!valueDataset.typed) dataset.typed = false;
|
|
1649
|
+
if (valueDataset.value !== void 0 || key in input) dataset.value[key] = valueDataset.value;
|
|
1650
|
+
}
|
|
1651
|
+
if (!dataset.issues || !config2.abortEarly) {
|
|
1652
|
+
for (const key in input) if (_isValidObjectKey(input, key) && !(key in this.entries)) dataset.value[key] = input[key];
|
|
1653
|
+
}
|
|
1654
|
+
} else _addIssue(this, "type", dataset, config2);
|
|
1655
|
+
return dataset;
|
|
1656
|
+
}
|
|
1657
|
+
};
|
|
1658
|
+
}
|
|
1607
1659
|
function number(message) {
|
|
1608
1660
|
return {
|
|
1609
1661
|
kind: "schema",
|
|
@@ -2141,6 +2193,18 @@ settingsMigratorInternal.createMigrations({
|
|
|
2141
2193
|
})
|
|
2142
2194
|
]
|
|
2143
2195
|
});
|
|
2196
|
+
const connectionsMigratorInternal = createMigrator();
|
|
2197
|
+
const defaultConnections = connectionsMigratorInternal.createDefault({
|
|
2198
|
+
version: "1.0.0",
|
|
2199
|
+
connections: []
|
|
2200
|
+
});
|
|
2201
|
+
connectionsMigratorInternal.createMigrations({
|
|
2202
|
+
defaultValue: defaultConnections,
|
|
2203
|
+
migrations: [createMigration({
|
|
2204
|
+
version: "1.0.0",
|
|
2205
|
+
up: finalVersion
|
|
2206
|
+
})]
|
|
2207
|
+
});
|
|
2144
2208
|
const fileRepoMigratorInternal = createMigrator();
|
|
2145
2209
|
const defaultFileRepo = fileRepoMigratorInternal.createDefault({
|
|
2146
2210
|
version: "2.0.0",
|
|
@@ -2302,11 +2366,51 @@ const LEGACY_ID_MAP = {
|
|
|
2302
2366
|
};
|
|
2303
2367
|
const getStrictPluginId = (pluginId) => {
|
|
2304
2368
|
if (!pluginId) return pluginId;
|
|
2305
|
-
|
|
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;
|
|
2369
|
+
return LEGACY_ID_MAP[pluginId] || pluginId;
|
|
2309
2370
|
};
|
|
2371
|
+
//#endregion
|
|
2372
|
+
//#region ../../packages/shared/src/save-location.ts
|
|
2373
|
+
const SaveLocationInternalValidator = object({
|
|
2374
|
+
id: string(),
|
|
2375
|
+
project: string(),
|
|
2376
|
+
lastModified: string(),
|
|
2377
|
+
type: literal("internal"),
|
|
2378
|
+
configName: string()
|
|
2379
|
+
});
|
|
2380
|
+
const SaveLocationValidator = union([
|
|
2381
|
+
object({
|
|
2382
|
+
id: string(),
|
|
2383
|
+
project: string(),
|
|
2384
|
+
path: string(),
|
|
2385
|
+
lastModified: string(),
|
|
2386
|
+
type: literal("external"),
|
|
2387
|
+
summary: object({
|
|
2388
|
+
plugins: array(string()),
|
|
2389
|
+
name: string(),
|
|
2390
|
+
description: string()
|
|
2391
|
+
})
|
|
2392
|
+
}),
|
|
2393
|
+
SaveLocationInternalValidator,
|
|
2394
|
+
object({
|
|
2395
|
+
id: string(),
|
|
2396
|
+
project: string(),
|
|
2397
|
+
type: literal("pipelab-cloud")
|
|
2398
|
+
})
|
|
2399
|
+
]);
|
|
2400
|
+
object({
|
|
2401
|
+
version: literal("1.0.0"),
|
|
2402
|
+
data: optional(record(string(), SaveLocationValidator), {})
|
|
2403
|
+
});
|
|
2404
|
+
const FileRepoProjectValidatorV2$1 = object({
|
|
2405
|
+
id: string(),
|
|
2406
|
+
name: string(),
|
|
2407
|
+
description: string()
|
|
2408
|
+
});
|
|
2409
|
+
object({
|
|
2410
|
+
version: literal("2.0.0"),
|
|
2411
|
+
projects: array(FileRepoProjectValidatorV2$1),
|
|
2412
|
+
pipelines: optional(array(SaveLocationValidator), [])
|
|
2413
|
+
});
|
|
2310
2414
|
object({
|
|
2311
2415
|
cacheFolder: string(),
|
|
2312
2416
|
theme: union([literal("light"), literal("dark")]),
|
|
@@ -2458,6 +2562,17 @@ object({
|
|
|
2458
2562
|
})),
|
|
2459
2563
|
isInternalMigrationBannerClosed: optional(boolean(), false)
|
|
2460
2564
|
});
|
|
2565
|
+
const ConnectionValidator = looseObject({
|
|
2566
|
+
id: string(),
|
|
2567
|
+
pluginName: string(),
|
|
2568
|
+
name: string(),
|
|
2569
|
+
createdAt: string(),
|
|
2570
|
+
isDefault: boolean()
|
|
2571
|
+
});
|
|
2572
|
+
object({
|
|
2573
|
+
version: literal("1.0.0"),
|
|
2574
|
+
connections: array(ConnectionValidator)
|
|
2575
|
+
});
|
|
2461
2576
|
//#endregion
|
|
2462
2577
|
//#region ../../node_modules/tslog/dist/esm/prettyLogStyles.js
|
|
2463
2578
|
const prettyLogStyles = {
|
|
@@ -2978,7 +3093,7 @@ const useLogger = () => {
|
|
|
2978
3093
|
const OriginValidator = object({
|
|
2979
3094
|
pluginId: string(),
|
|
2980
3095
|
nodeId: string(),
|
|
2981
|
-
version: pipe(
|
|
3096
|
+
version: optional(pipe(string(), description("Pinned version of the plugin for this block. Falls back to \"latest\" when absent.")))
|
|
2982
3097
|
});
|
|
2983
3098
|
const BlockActionValidatorV1 = object({
|
|
2984
3099
|
type: literal("action"),
|
|
@@ -2991,7 +3106,7 @@ const EditorParamValidatorV3 = union([literal("simple"), literal("editor")]);
|
|
|
2991
3106
|
const BlockActionValidatorV3 = object({
|
|
2992
3107
|
type: literal("action"),
|
|
2993
3108
|
uid: string(),
|
|
2994
|
-
name: pipe(
|
|
3109
|
+
name: optional(pipe(string(), description("A custom name provided by the user"))),
|
|
2995
3110
|
disabled: optional(boolean()),
|
|
2996
3111
|
params: record(string(), object({
|
|
2997
3112
|
editor: EditorParamValidatorV3,
|
|
@@ -45305,35 +45420,6 @@ const createNetlifySiteParam = (value, tokenKey, definition) => {
|
|
|
45305
45420
|
};
|
|
45306
45421
|
};
|
|
45307
45422
|
//#endregion
|
|
45308
|
-
//#region ../../packages/shared/src/save-location.ts
|
|
45309
|
-
const SaveLocationInternalValidator = object({
|
|
45310
|
-
id: string(),
|
|
45311
|
-
project: string(),
|
|
45312
|
-
lastModified: string(),
|
|
45313
|
-
type: literal("internal"),
|
|
45314
|
-
configName: string()
|
|
45315
|
-
});
|
|
45316
|
-
const SaveLocationValidator = union([
|
|
45317
|
-
object({
|
|
45318
|
-
id: string(),
|
|
45319
|
-
project: string(),
|
|
45320
|
-
path: string(),
|
|
45321
|
-
lastModified: string(),
|
|
45322
|
-
type: literal("external"),
|
|
45323
|
-
summary: object({
|
|
45324
|
-
plugins: array(string()),
|
|
45325
|
-
name: string(),
|
|
45326
|
-
description: string()
|
|
45327
|
-
})
|
|
45328
|
-
}),
|
|
45329
|
-
SaveLocationInternalValidator,
|
|
45330
|
-
object({
|
|
45331
|
-
id: string(),
|
|
45332
|
-
project: string(),
|
|
45333
|
-
type: literal("pipelab-cloud")
|
|
45334
|
-
})
|
|
45335
|
-
]);
|
|
45336
|
-
//#endregion
|
|
45337
45423
|
//#region ../../packages/shared/src/websocket.types.ts
|
|
45338
45424
|
var WebSocketError = class extends Error {
|
|
45339
45425
|
constructor(message, code, requestId) {
|
|
@@ -45350,20 +45436,6 @@ object({
|
|
|
45350
45436
|
version: literal("1.0.0"),
|
|
45351
45437
|
data: optional(record(string(), SaveLocationValidator), {})
|
|
45352
45438
|
});
|
|
45353
|
-
const FileRepoProjectValidatorV2$1 = object({
|
|
45354
|
-
id: string(),
|
|
45355
|
-
name: string(),
|
|
45356
|
-
description: string()
|
|
45357
|
-
});
|
|
45358
|
-
object({
|
|
45359
|
-
version: literal("2.0.0"),
|
|
45360
|
-
projects: array(FileRepoProjectValidatorV2$1),
|
|
45361
|
-
pipelines: optional(array(SaveLocationValidator), [])
|
|
45362
|
-
});
|
|
45363
|
-
object({
|
|
45364
|
-
version: literal("1.0.0"),
|
|
45365
|
-
data: optional(record(string(), SaveLocationValidator), {})
|
|
45366
|
-
});
|
|
45367
45439
|
const FileRepoProjectValidatorV2 = object({
|
|
45368
45440
|
id: string(),
|
|
45369
45441
|
name: string(),
|
|
@@ -45375,8 +45447,14 @@ object({
|
|
|
45375
45447
|
pipelines: optional(array(SaveLocationValidator), [])
|
|
45376
45448
|
});
|
|
45377
45449
|
//#endregion
|
|
45450
|
+
//#region ../../packages/constants/src/index.ts
|
|
45451
|
+
const websocketPort = 33753;
|
|
45452
|
+
const DEFAULT_NODE_VERSION = "24.14.1";
|
|
45453
|
+
const DEFAULT_PNPM_VERSION = "10.12.0";
|
|
45454
|
+
//#endregion
|
|
45378
45455
|
//#region ../../packages/core-node/src/context.ts
|
|
45379
|
-
const
|
|
45456
|
+
const metaUrl = require("url").pathToFileURL(__filename).href;
|
|
45457
|
+
const _dirname = typeof __dirname !== "undefined" ? __dirname : metaUrl ? (0, node_path.dirname)((0, node_url.fileURLToPath)(metaUrl)) : process.cwd();
|
|
45380
45458
|
const isDev = process.env.NODE_ENV === "development";
|
|
45381
45459
|
/**
|
|
45382
45460
|
* Finds the monorepo root by looking for pnpm-workspace.yaml.
|
|
@@ -48948,9 +49026,6 @@ const useAPI = () => {
|
|
|
48948
49026
|
};
|
|
48949
49027
|
};
|
|
48950
49028
|
//#endregion
|
|
48951
|
-
//#region ../../packages/constants/src/index.ts
|
|
48952
|
-
const websocketPort = 33753;
|
|
48953
|
-
//#endregion
|
|
48954
49029
|
//#region ../../packages/core-node/src/websocket-server.ts
|
|
48955
49030
|
var WebSocketServer = class {
|
|
48956
49031
|
wss = null;
|
|
@@ -59959,14 +60034,14 @@ var require_path_reservations = /* @__PURE__ */ require_chunk.__commonJSMin(((ex
|
|
|
59959
60034
|
const assert$1 = require("assert");
|
|
59960
60035
|
const normalize = require_normalize_unicode();
|
|
59961
60036
|
const stripSlashes = require_strip_trailing_slashes();
|
|
59962
|
-
const { join: join$
|
|
60037
|
+
const { join: join$19 } = require("path");
|
|
59963
60038
|
const isWindows = (process.env.TESTING_TAR_FAKE_PLATFORM || process.platform) === "win32";
|
|
59964
60039
|
module.exports = () => {
|
|
59965
60040
|
const queues = /* @__PURE__ */ new Map();
|
|
59966
60041
|
const reservations = /* @__PURE__ */ new Map();
|
|
59967
60042
|
const getDirs = (path$62) => {
|
|
59968
60043
|
return path$62.split("/").slice(0, -1).reduce((set, path$63) => {
|
|
59969
|
-
if (set.length) path$63 = join$
|
|
60044
|
+
if (set.length) path$63 = join$19(set[set.length - 1], path$63);
|
|
59970
60045
|
set.push(path$63 || "/");
|
|
59971
60046
|
return set;
|
|
59972
60047
|
}, []);
|
|
@@ -60020,7 +60095,7 @@ var require_path_reservations = /* @__PURE__ */ require_chunk.__commonJSMin(((ex
|
|
|
60020
60095
|
};
|
|
60021
60096
|
const reserve = (paths, fn) => {
|
|
60022
60097
|
paths = isWindows ? ["win32 parallelization disabled"] : paths.map((p) => {
|
|
60023
|
-
return stripSlashes(join$
|
|
60098
|
+
return stripSlashes(join$19(normalize(p))).toLowerCase();
|
|
60024
60099
|
});
|
|
60025
60100
|
const dirs = new Set(paths.map((path$67) => getDirs(path$67)).reduce((a, b) => a.concat(b)));
|
|
60026
60101
|
reservations.set(fn, {
|
|
@@ -89358,14 +89433,6 @@ var import_tar = /* @__PURE__ */ require_chunk.__toESM(require_tar$1(), 1);
|
|
|
89358
89433
|
var import_yauzl = /* @__PURE__ */ require_chunk.__toESM(require_yauzl(), 1);
|
|
89359
89434
|
require_archiver();
|
|
89360
89435
|
/**
|
|
89361
|
-
* Generates a unique temporary folder.
|
|
89362
|
-
*/
|
|
89363
|
-
const generateTempFolder = async (base) => {
|
|
89364
|
-
const targetBase = base || (0, node_os.tmpdir)();
|
|
89365
|
-
await (0, node_fs_promises.mkdir)(targetBase, { recursive: true });
|
|
89366
|
-
return await (0, node_fs_promises.mkdtemp)((0, node_path.join)(await (0, node_fs_promises.realpath)(targetBase), "pipelab-"));
|
|
89367
|
-
};
|
|
89368
|
-
/**
|
|
89369
89436
|
* Extracts a .tar.gz archive.
|
|
89370
89437
|
*/
|
|
89371
89438
|
async function extractTarGz(archivePath, destinationDir) {
|
|
@@ -95835,7 +95902,7 @@ var require_index_min$3 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports)
|
|
|
95835
95902
|
//#region ../../node_modules/@npmcli/promise-spawn/node_modules/which/lib/index.js
|
|
95836
95903
|
var require_lib$27 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
95837
95904
|
const { isexe, sync: isexeSync } = require_index_min$3();
|
|
95838
|
-
const { join: join$
|
|
95905
|
+
const { join: join$16, delimiter: delimiter$3, sep: sep$4, posix: posix$1 } = require("path");
|
|
95839
95906
|
const isWindows = process.platform === "win32";
|
|
95840
95907
|
/* istanbul ignore next */
|
|
95841
95908
|
const rSlash = new RegExp(`[${posix$1.sep}${sep$4 === posix$1.sep ? "" : sep$4}]`.replace(/(\\)/g, "\\$1"));
|
|
@@ -95865,7 +95932,7 @@ var require_lib$27 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
95865
95932
|
};
|
|
95866
95933
|
const getPathPart = (raw, cmd) => {
|
|
95867
95934
|
const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
|
|
95868
|
-
return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$
|
|
95935
|
+
return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$16(pathPart, cmd);
|
|
95869
95936
|
};
|
|
95870
95937
|
const which = async (cmd, opt = {}) => {
|
|
95871
95938
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
@@ -96614,7 +96681,7 @@ var require_index_min$2 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports)
|
|
|
96614
96681
|
//#region ../../node_modules/@npmcli/git/node_modules/which/lib/index.js
|
|
96615
96682
|
var require_lib$24 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
96616
96683
|
const { isexe, sync: isexeSync } = require_index_min$2();
|
|
96617
|
-
const { join: join$
|
|
96684
|
+
const { join: join$15, delimiter: delimiter$2, sep: sep$3, posix } = require("path");
|
|
96618
96685
|
const isWindows = process.platform === "win32";
|
|
96619
96686
|
/* istanbul ignore next */
|
|
96620
96687
|
const rSlash = new RegExp(`[${posix.sep}${sep$3 === posix.sep ? "" : sep$3}]`.replace(/(\\)/g, "\\$1"));
|
|
@@ -96644,7 +96711,7 @@ var require_lib$24 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
96644
96711
|
};
|
|
96645
96712
|
const getPathPart = (raw, cmd) => {
|
|
96646
96713
|
const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw;
|
|
96647
|
-
return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$
|
|
96714
|
+
return (!pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : "") + join$15(pathPart, cmd);
|
|
96648
96715
|
};
|
|
96649
96716
|
const which = async (cmd, opt = {}) => {
|
|
96650
96717
|
const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt);
|
|
@@ -98542,7 +98609,7 @@ var require_lib$22 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
98542
98609
|
//#endregion
|
|
98543
98610
|
//#region ../../node_modules/npm-normalize-package-bin/lib/index.js
|
|
98544
98611
|
var require_lib$21 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
98545
|
-
const { join: join$
|
|
98612
|
+
const { join: join$14, basename: basename$5 } = require("path");
|
|
98546
98613
|
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);
|
|
98547
98614
|
const normalizeString = (pkg) => {
|
|
98548
98615
|
if (!pkg.name) return removeBin(pkg);
|
|
@@ -98565,9 +98632,9 @@ var require_lib$21 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
98565
98632
|
const clean = {};
|
|
98566
98633
|
let hasBins = false;
|
|
98567
98634
|
Object.keys(orig).forEach((binKey) => {
|
|
98568
|
-
const base = join$
|
|
98635
|
+
const base = join$14("/", basename$5(binKey.replace(/\\|:/g, "/"))).slice(1);
|
|
98569
98636
|
if (typeof orig[binKey] !== "string" || !base) return;
|
|
98570
|
-
const binTarget = join$
|
|
98637
|
+
const binTarget = join$14("/", orig[binKey].replace(/\\/g, "/")).replace(/\\/g, "/").slice(1);
|
|
98571
98638
|
if (!binTarget) return;
|
|
98572
98639
|
clean[base] = binTarget;
|
|
98573
98640
|
hasBins = true;
|
|
@@ -100640,7 +100707,7 @@ var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
|
|
|
100640
100707
|
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();
|
|
100641
100708
|
const { constants: { errno: { EEXIST, EISDIR, EINVAL, ENOTDIR } } } = require("os");
|
|
100642
100709
|
const { chmod: chmod$2, copyFile, lstat: lstat$2, mkdir: mkdir$9, readdir: readdir$6, readlink, stat: stat$5, symlink, unlink, utimes } = require("fs/promises");
|
|
100643
|
-
const { dirname: dirname$8, isAbsolute: isAbsolute$2, join: join$
|
|
100710
|
+
const { dirname: dirname$8, isAbsolute: isAbsolute$2, join: join$13, parse, resolve: resolve$10, sep: sep$2, toNamespacedPath } = require("path");
|
|
100644
100711
|
const { fileURLToPath } = require("url");
|
|
100645
100712
|
const defaultOptions = {
|
|
100646
100713
|
dereference: false,
|
|
@@ -100849,8 +100916,8 @@ var require_polyfill = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, mo
|
|
|
100849
100916
|
const dir = await readdir$6(src);
|
|
100850
100917
|
for (let i = 0; i < dir.length; i++) {
|
|
100851
100918
|
const item = dir[i];
|
|
100852
|
-
const srcItem = join$
|
|
100853
|
-
const destItem = join$
|
|
100919
|
+
const srcItem = join$13(src, item);
|
|
100920
|
+
const destItem = join$13(dest, item);
|
|
100854
100921
|
const { destStat } = await checkPaths(srcItem, destItem, opts);
|
|
100855
100922
|
await startCopy(destStat, srcItem, destItem, opts);
|
|
100856
100923
|
}
|
|
@@ -100914,13 +100981,13 @@ var require_cp = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module)
|
|
|
100914
100981
|
//#endregion
|
|
100915
100982
|
//#region ../../node_modules/cacache/node_modules/@npmcli/fs/lib/with-temp-dir.js
|
|
100916
100983
|
var require_with_temp_dir = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
100917
|
-
const { join: join$
|
|
100984
|
+
const { join: join$12, sep: sep$1 } = require("path");
|
|
100918
100985
|
const getOptions = require_get_options();
|
|
100919
100986
|
const { mkdir: mkdir$8, mkdtemp, rm: rm$7 } = require("fs/promises");
|
|
100920
100987
|
const withTempDir = async (root, fn, opts) => {
|
|
100921
100988
|
const options = getOptions(opts, { copy: ["tmpPrefix"] });
|
|
100922
100989
|
await mkdir$8(root, { recursive: true });
|
|
100923
|
-
const target = await mkdtemp(join$
|
|
100990
|
+
const target = await mkdtemp(join$12(`${root}${sep$1}`, options.tmpPrefix || ""));
|
|
100924
100991
|
let err;
|
|
100925
100992
|
let result;
|
|
100926
100993
|
try {
|
|
@@ -100943,10 +101010,10 @@ var require_with_temp_dir = /* @__PURE__ */ require_chunk.__commonJSMin(((export
|
|
|
100943
101010
|
//#region ../../node_modules/cacache/node_modules/@npmcli/fs/lib/readdir-scoped.js
|
|
100944
101011
|
var require_readdir_scoped = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
100945
101012
|
const { readdir: readdir$5 } = require("fs/promises");
|
|
100946
|
-
const { join: join$
|
|
101013
|
+
const { join: join$11 } = require("path");
|
|
100947
101014
|
const readdirScoped = async (dir) => {
|
|
100948
101015
|
const results = [];
|
|
100949
|
-
for (const item of await readdir$5(dir)) if (item.startsWith("@")) for (const scopedItem of await readdir$5(join$
|
|
101016
|
+
for (const item of await readdir$5(dir)) if (item.startsWith("@")) for (const scopedItem of await readdir$5(join$11(dir, item))) results.push(join$11(item, scopedItem));
|
|
100950
101017
|
else results.push(item);
|
|
100951
101018
|
return results;
|
|
100952
101019
|
};
|
|
@@ -100955,7 +101022,7 @@ var require_readdir_scoped = /* @__PURE__ */ require_chunk.__commonJSMin(((expor
|
|
|
100955
101022
|
//#endregion
|
|
100956
101023
|
//#region ../../node_modules/cacache/node_modules/@npmcli/fs/lib/move-file.js
|
|
100957
101024
|
var require_move_file = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
100958
|
-
const { dirname: dirname$7, join: join$
|
|
101025
|
+
const { dirname: dirname$7, join: join$10, resolve: resolve$9, relative: relative$1, isAbsolute: isAbsolute$1 } = require("path");
|
|
100959
101026
|
const fs$12 = require("fs/promises");
|
|
100960
101027
|
const pathExists = async (path$54) => {
|
|
100961
101028
|
try {
|
|
@@ -100980,7 +101047,7 @@ var require_move_file = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, m
|
|
|
100980
101047
|
const sourceStat = await fs$12.lstat(source);
|
|
100981
101048
|
if (sourceStat.isDirectory()) {
|
|
100982
101049
|
const files = await fs$12.readdir(source);
|
|
100983
|
-
await Promise.all(files.map((file) => moveFile(join$
|
|
101050
|
+
await Promise.all(files.map((file) => moveFile(join$10(source, file), join$10(destination, file), options, false, symlinks)));
|
|
100984
101051
|
} else if (sourceStat.isSymbolicLink()) symlinks.push({
|
|
100985
101052
|
source,
|
|
100986
101053
|
destination
|
|
@@ -110519,9 +110586,9 @@ var require_protected = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, m
|
|
|
110519
110586
|
//#region ../../node_modules/pacote/lib/util/cache-dir.js
|
|
110520
110587
|
var require_cache_dir = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
110521
110588
|
const { resolve: resolve$7 } = require("node:path");
|
|
110522
|
-
const { tmpdir
|
|
110589
|
+
const { tmpdir, homedir } = require("node:os");
|
|
110523
110590
|
module.exports = (fakePlatform = false) => {
|
|
110524
|
-
const temp = tmpdir
|
|
110591
|
+
const temp = tmpdir();
|
|
110525
110592
|
const uidOrPid = process.getuid ? process.getuid() : process.pid;
|
|
110526
110593
|
const home = homedir() || resolve$7(temp, "npm-" + uidOrPid);
|
|
110527
110594
|
const platform = fakePlatform || process.platform;
|
|
@@ -112343,7 +112410,7 @@ var require_lib$10 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modu
|
|
|
112343
112410
|
var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
112344
112411
|
const { Walker: IgnoreWalker } = require_lib$10();
|
|
112345
112412
|
const { lstatSync: lstat$1, readFileSync: readFile$4 } = require("fs");
|
|
112346
|
-
const { basename: basename$3, dirname: dirname$5, extname: extname$1, join: join$
|
|
112413
|
+
const { basename: basename$3, dirname: dirname$5, extname: extname$1, join: join$9, relative, resolve: resolve$6, sep } = require("path");
|
|
112347
112414
|
const { log } = require_lib$29();
|
|
112348
112415
|
const defaultRules = Symbol("npm-packlist.rules.default");
|
|
112349
112416
|
const strictRules = Symbol("npm-packlist.rules.strict");
|
|
@@ -112376,7 +112443,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
|
|
|
112376
112443
|
const normalizePath = (path$46) => path$46.split("\\").join("/");
|
|
112377
112444
|
const readOutOfTreeIgnoreFiles = (root, rel, result = []) => {
|
|
112378
112445
|
for (const file of [".npmignore", ".gitignore"]) try {
|
|
112379
|
-
const ignoreContent = readFile$4(join$
|
|
112446
|
+
const ignoreContent = readFile$4(join$9(root, file), { encoding: "utf8" });
|
|
112380
112447
|
result.push(ignoreContent);
|
|
112381
112448
|
break;
|
|
112382
112449
|
} catch (err) {
|
|
@@ -112385,8 +112452,8 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
|
|
|
112385
112452
|
}
|
|
112386
112453
|
if (!rel) return result;
|
|
112387
112454
|
const firstRel = rel.split(sep, 1)[0];
|
|
112388
|
-
const newRoot = join$
|
|
112389
|
-
return readOutOfTreeIgnoreFiles(newRoot, relative(newRoot, join$
|
|
112455
|
+
const newRoot = join$9(root, firstRel);
|
|
112456
|
+
return readOutOfTreeIgnoreFiles(newRoot, relative(newRoot, join$9(root, rel)), result);
|
|
112390
112457
|
};
|
|
112391
112458
|
var PackWalker = class PackWalker extends IgnoreWalker {
|
|
112392
112459
|
constructor(tree, opts) {
|
|
@@ -112453,7 +112520,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
|
|
|
112453
112520
|
let ignoreFiles = null;
|
|
112454
112521
|
if (this.tree.workspaces) {
|
|
112455
112522
|
const workspaceDirs = [...this.tree.workspaces.values()].map((dir) => dir.replace(/\\/g, "/"));
|
|
112456
|
-
const entryPath = join$
|
|
112523
|
+
const entryPath = join$9(this.path, entry).replace(/\\/g, "/");
|
|
112457
112524
|
if (workspaceDirs.includes(entryPath)) ignoreFiles = [
|
|
112458
112525
|
defaultRules,
|
|
112459
112526
|
"package.json",
|
|
@@ -112513,7 +112580,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
|
|
|
112513
112580
|
if (file.endsWith("/*")) file += "*";
|
|
112514
112581
|
const inverse = `!${file}`;
|
|
112515
112582
|
try {
|
|
112516
|
-
const stat = lstat$1(join$
|
|
112583
|
+
const stat = lstat$1(join$9(this.path, file.replace(/^!+/, "")).replace(/\\/g, "/"));
|
|
112517
112584
|
if (stat.isFile()) {
|
|
112518
112585
|
strict.unshift(inverse);
|
|
112519
112586
|
this.requiredFiles.push(file.startsWith("/") ? file.slice(1) : file);
|
|
@@ -112570,7 +112637,7 @@ var require_lib$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
|
|
|
112570
112637
|
walker.start();
|
|
112571
112638
|
});
|
|
112572
112639
|
const relativeFrom = relative(this.root, walker.path);
|
|
112573
|
-
for (const file of bundled) this.result.add(join$
|
|
112640
|
+
for (const file of bundled) this.result.add(join$9(relativeFrom, file).replace(/\\/g, "/"));
|
|
112574
112641
|
}
|
|
112575
112642
|
}
|
|
112576
112643
|
};
|
|
@@ -123771,7 +123838,7 @@ var require_auth = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module
|
|
|
123771
123838
|
//#endregion
|
|
123772
123839
|
//#region ../../node_modules/make-fetch-happen/lib/options.js
|
|
123773
123840
|
var require_options$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
123774
|
-
const dns$
|
|
123841
|
+
const dns$3 = require("dns");
|
|
123775
123842
|
const conditionalHeaders = [
|
|
123776
123843
|
"if-modified-since",
|
|
123777
123844
|
"if-none-match",
|
|
@@ -123796,7 +123863,7 @@ var require_options$1 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, m
|
|
|
123796
123863
|
};
|
|
123797
123864
|
options.dns = {
|
|
123798
123865
|
ttl: 300 * 1e3,
|
|
123799
|
-
lookup: dns$
|
|
123866
|
+
lookup: dns$3.lookup,
|
|
123800
123867
|
...options.dns
|
|
123801
123868
|
};
|
|
123802
123869
|
options.cache = options.cache || "default";
|
|
@@ -125213,9 +125280,9 @@ var require_key$3 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, modul
|
|
|
125213
125280
|
//#region ../../node_modules/@npmcli/agent/lib/dns.js
|
|
125214
125281
|
var require_dns = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
125215
125282
|
const { LRUCache } = require_index_min$5();
|
|
125216
|
-
const dns$
|
|
125283
|
+
const dns$2 = require("dns");
|
|
125217
125284
|
const cache = new LRUCache({ max: 50 });
|
|
125218
|
-
const getOptions = ({ family = 0, hints = dns$
|
|
125285
|
+
const getOptions = ({ family = 0, hints = dns$2.ADDRCONFIG, all = false, verbatim = void 0, ttl = 300 * 1e3, lookup = dns$2.lookup }) => ({
|
|
125219
125286
|
hints,
|
|
125220
125287
|
lookup: (hostname, ...args) => {
|
|
125221
125288
|
const callback = args.pop();
|
|
@@ -130254,7 +130321,7 @@ var require_dist$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports) => {
|
|
|
130254
130321
|
const socks_1 = require_build$1();
|
|
130255
130322
|
const agent_base_1 = require_dist$12();
|
|
130256
130323
|
const debug_1 = __importDefault(require_src$1());
|
|
130257
|
-
const dns = __importStar(require("dns"));
|
|
130324
|
+
const dns$1 = __importStar(require("dns"));
|
|
130258
130325
|
const net$1 = __importStar(require("net"));
|
|
130259
130326
|
const tls$1 = __importStar(require("tls"));
|
|
130260
130327
|
const url_1$1 = require("url");
|
|
@@ -130326,7 +130393,7 @@ var require_dist$9 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports) => {
|
|
|
130326
130393
|
const { shouldLookup, proxy, timeout } = this;
|
|
130327
130394
|
if (!opts.host) throw new Error("No `host` defined!");
|
|
130328
130395
|
let { host } = opts;
|
|
130329
|
-
const { port, lookup: lookupFn = dns.lookup } = opts;
|
|
130396
|
+
const { port, lookup: lookupFn = dns$1.lookup } = opts;
|
|
130330
130397
|
if (shouldLookup) host = await new Promise((resolve, reject) => {
|
|
130331
130398
|
lookupFn(host, {}, (err, res) => {
|
|
130332
130399
|
if (err) reject(err);
|
|
@@ -151055,8 +151122,6 @@ const sendStartupProgress = (message) => {
|
|
|
151055
151122
|
};
|
|
151056
151123
|
//#endregion
|
|
151057
151124
|
//#region ../../packages/core-node/src/utils/remote.ts
|
|
151058
|
-
const DEFAULT_NODE_VERSION = "24.14.1";
|
|
151059
|
-
const DEFAULT_PNPM_VERSION = "10.12.0";
|
|
151060
151125
|
function isPackageComplete(packageDir) {
|
|
151061
151126
|
return (0, node_fs.existsSync)((0, node_path.join)(packageDir, "package.json"));
|
|
151062
151127
|
}
|
|
@@ -151097,6 +151162,20 @@ async function withLock(key, fn) {
|
|
|
151097
151162
|
activeOperations.set(key, promise);
|
|
151098
151163
|
return promise;
|
|
151099
151164
|
}
|
|
151165
|
+
let isOnlineCached = null;
|
|
151166
|
+
let lastCheckTime = 0;
|
|
151167
|
+
async function isOnline() {
|
|
151168
|
+
const now = Date.now();
|
|
151169
|
+
if (isOnlineCached !== null && now - lastCheckTime < 1e4) return isOnlineCached;
|
|
151170
|
+
try {
|
|
151171
|
+
await Promise.race([node_dns_promises.default.lookup("registry.npmjs.org"), new Promise((_, reject) => setTimeout(() => reject(/* @__PURE__ */ new Error("timeout")), 1500))]);
|
|
151172
|
+
isOnlineCached = true;
|
|
151173
|
+
} catch {
|
|
151174
|
+
isOnlineCached = false;
|
|
151175
|
+
}
|
|
151176
|
+
lastCheckTime = now;
|
|
151177
|
+
return isOnlineCached;
|
|
151178
|
+
}
|
|
151100
151179
|
/**
|
|
151101
151180
|
* Robust utility to fetch, cache, and resolve an NPM package.
|
|
151102
151181
|
* Centralized in core-node to avoid circular dependencies.
|
|
@@ -151123,7 +151202,15 @@ async function fetchPackage(packageName, versionOrRange, options) {
|
|
|
151123
151202
|
if (resolvedVersionOrRange === "local") resolvedVersionOrRange = "latest";
|
|
151124
151203
|
console.log(`[Fetcher] Resolving ${packageName}@${resolvedVersionOrRange || "latest"}...`);
|
|
151125
151204
|
const resolveStart = Date.now();
|
|
151126
|
-
|
|
151205
|
+
if (!await isOnline()) {
|
|
151206
|
+
console.warn(`[Fetcher] ${packageName}: offline mode detected (${Date.now() - resolveStart}ms), trying local fallback...`);
|
|
151207
|
+
const fallbackStart = Date.now();
|
|
151208
|
+
const fallbackVersion = await tryLocalFallback(resolvedVersionOrRange, /* @__PURE__ */ new Error("Offline"), baseDir, packageName);
|
|
151209
|
+
if (fallbackVersion) {
|
|
151210
|
+
resolvedVersion = fallbackVersion;
|
|
151211
|
+
console.log(`[Fetcher] ${packageName}: Resolved to local fallback ${resolvedVersion} (${Date.now() - fallbackStart}ms)`);
|
|
151212
|
+
} else throw new Error(`Offline and no local fallback version available for ${packageName}`);
|
|
151213
|
+
} else try {
|
|
151127
151214
|
const cachePath = (0, node_path.join)(ctx.userDataPath, "cache", "pacote");
|
|
151128
151215
|
let packumentPromise = packumentRequests.get(packageName);
|
|
151129
151216
|
if (!packumentPromise) {
|
|
@@ -151133,7 +151220,16 @@ async function fetchPackage(packageName, versionOrRange, options) {
|
|
|
151133
151220
|
const packument = await packumentPromise;
|
|
151134
151221
|
const versions = Object.keys(packument.versions);
|
|
151135
151222
|
const range = resolvedVersionOrRange || "latest";
|
|
151136
|
-
|
|
151223
|
+
let foundVersion = packument["dist-tags"]?.[range] || import_semver.default.maxSatisfying(versions, range);
|
|
151224
|
+
if (range === "latest" && ctx.releaseTag && ctx.releaseTag !== "latest") {
|
|
151225
|
+
const releaseTagVersion = packument["dist-tags"]?.[ctx.releaseTag];
|
|
151226
|
+
if (releaseTagVersion && import_semver.default.valid(releaseTagVersion)) {
|
|
151227
|
+
if (!foundVersion || import_semver.default.valid(foundVersion) && import_semver.default.gte(releaseTagVersion, foundVersion)) {
|
|
151228
|
+
console.log(`[Fetcher] Using release tag "${ctx.releaseTag}" (${releaseTagVersion}) instead of "latest" (${foundVersion || "none"}) for ${packageName}`);
|
|
151229
|
+
foundVersion = releaseTagVersion;
|
|
151230
|
+
} else if (foundVersion) console.warn(`[Fetcher] Tag "${ctx.releaseTag}" (${releaseTagVersion}) is older than "latest" (${foundVersion}) for ${packageName}, keeping "latest"`);
|
|
151231
|
+
}
|
|
151232
|
+
}
|
|
151137
151233
|
if (!foundVersion) throw new Error(`Package ${packageName}@${range} not found on npm (available tags: ${Object.keys(packument["dist-tags"] || {}).join(", ")})`);
|
|
151138
151234
|
resolvedVersion = foundVersion;
|
|
151139
151235
|
console.log(`[Fetcher] ${packageName}: Resolved to v${resolvedVersion} via npm (${Date.now() - resolveStart}ms)`);
|
|
@@ -151248,7 +151344,7 @@ async function ensureNodeJS(context, version = DEFAULT_NODE_VERSION) {
|
|
|
151248
151344
|
const extension = isWindows ? "zip" : "tar.gz";
|
|
151249
151345
|
const fileName = `node-v${version}-${platform === "osx" ? "darwin" : platform}-${arch}.${extension}`;
|
|
151250
151346
|
const downloadUrl = `https://nodejs.org/dist/v${version}/${fileName}`;
|
|
151251
|
-
const tempDir = await
|
|
151347
|
+
const tempDir = await context.createTempFolder("node-download-");
|
|
151252
151348
|
const archivePath = (0, node_path.join)(tempDir, fileName);
|
|
151253
151349
|
sendStartupProgress(`Downloading Node.js v${version}...`);
|
|
151254
151350
|
console.log(`Downloading Node.js from ${downloadUrl}...`);
|
|
@@ -151458,7 +151554,7 @@ async function resolveEntryPoint(packageDir, packageName) {
|
|
|
151458
151554
|
}
|
|
151459
151555
|
//#endregion
|
|
151460
151556
|
//#region ../../packages/core-node/src/handler-func.ts
|
|
151461
|
-
const { join: join$
|
|
151557
|
+
const { join: join$7 } = node_path.default;
|
|
151462
151558
|
//#endregion
|
|
151463
151559
|
//#region ../../packages/core-node/src/handlers/plugins.ts
|
|
151464
151560
|
const localPluginsMap = /* @__PURE__ */ new Map();
|
|
@@ -151570,71 +151666,82 @@ const uploadToNetlifyRunner = createActionRunner(async ({ log, inputs, cwd, abor
|
|
|
151570
151666
|
});
|
|
151571
151667
|
//#endregion
|
|
151572
151668
|
//#region src/index.ts
|
|
151573
|
-
var src_default = createNodeDefinition({
|
|
151574
|
-
|
|
151575
|
-
|
|
151576
|
-
|
|
151577
|
-
|
|
151578
|
-
|
|
151579
|
-
|
|
151580
|
-
|
|
151581
|
-
|
|
151582
|
-
|
|
151583
|
-
|
|
151584
|
-
|
|
151585
|
-
|
|
151586
|
-
|
|
151587
|
-
|
|
151588
|
-
|
|
151589
|
-
|
|
151590
|
-
|
|
151591
|
-
|
|
151592
|
-
|
|
151593
|
-
|
|
151594
|
-
|
|
151595
|
-
|
|
151596
|
-
|
|
151597
|
-
|
|
151598
|
-
|
|
151599
|
-
|
|
151600
|
-
|
|
151601
|
-
|
|
151602
|
-
|
|
151603
|
-
|
|
151604
|
-
|
|
151605
|
-
|
|
151606
|
-
|
|
151607
|
-
|
|
151608
|
-
|
|
151609
|
-
|
|
151610
|
-
|
|
151611
|
-
|
|
151612
|
-
|
|
151613
|
-
|
|
151614
|
-
|
|
151615
|
-
|
|
151616
|
-
|
|
151617
|
-
|
|
151618
|
-
|
|
151619
|
-
|
|
151620
|
-
|
|
151621
|
-
|
|
151622
|
-
|
|
151623
|
-
|
|
151624
|
-
|
|
151625
|
-
|
|
151626
|
-
|
|
151627
|
-
|
|
151628
|
-
|
|
151629
|
-
|
|
151630
|
-
|
|
151631
|
-
|
|
151632
|
-
|
|
151633
|
-
|
|
151634
|
-
|
|
151635
|
-
}
|
|
151636
|
-
|
|
151637
|
-
|
|
151638
|
-
|
|
151669
|
+
var src_default = createNodeDefinition({
|
|
151670
|
+
nodes: [{
|
|
151671
|
+
node: createAction({
|
|
151672
|
+
id: "netlify-build",
|
|
151673
|
+
name: "Build Netlify site",
|
|
151674
|
+
description: "",
|
|
151675
|
+
icon: "",
|
|
151676
|
+
displayString: "`Build ${fmt.param(params['input-folder'], 'primary', 'No path selected')}`",
|
|
151677
|
+
meta: {},
|
|
151678
|
+
params: {
|
|
151679
|
+
"input-folder": createPathParam("", {
|
|
151680
|
+
required: true,
|
|
151681
|
+
label: "Path to the folder to upload to netlify",
|
|
151682
|
+
control: {
|
|
151683
|
+
type: "path",
|
|
151684
|
+
options: { properties: ["openDirectory"] }
|
|
151685
|
+
}
|
|
151686
|
+
}),
|
|
151687
|
+
token: createStringParam("", {
|
|
151688
|
+
required: true,
|
|
151689
|
+
label: "Token"
|
|
151690
|
+
})
|
|
151691
|
+
},
|
|
151692
|
+
outputs: {}
|
|
151693
|
+
}),
|
|
151694
|
+
runner: createActionRunner(async ({ log, inputs, cwd, abortSignal, paths }) => {
|
|
151695
|
+
log("Building netlify site");
|
|
151696
|
+
const { node } = paths;
|
|
151697
|
+
const buildDir = (0, node_path.join)(cwd, "build");
|
|
151698
|
+
const inputFolder = inputs["input-folder"];
|
|
151699
|
+
if (!await fileExists((0, node_path.join)(inputFolder, "package.json"))) throw new Error("No package.json found in input folder");
|
|
151700
|
+
await (0, node_fs_promises.cp)(inputs["input-folder"], buildDir, { recursive: true });
|
|
151701
|
+
const netlifyDir = (0, node_path.join)(buildDir, ".netlify");
|
|
151702
|
+
const netlifyState = (0, node_path.join)(netlifyDir, "state.json");
|
|
151703
|
+
await (0, node_fs_promises.mkdir)(netlifyDir, { recursive: true });
|
|
151704
|
+
await (0, node_fs_promises.writeFile)(netlifyState, `{ "siteId": "${inputs.site}" }`, "utf-8");
|
|
151705
|
+
const { all: buildOut } = await runPnpm(buildDir, {
|
|
151706
|
+
args: [
|
|
151707
|
+
"--package",
|
|
151708
|
+
"netlify-cli",
|
|
151709
|
+
"dlx",
|
|
151710
|
+
"netlify",
|
|
151711
|
+
"build"
|
|
151712
|
+
],
|
|
151713
|
+
extraEnv: { NETLIFY_AUTH_TOKEN: inputs.token },
|
|
151714
|
+
signal: abortSignal
|
|
151715
|
+
});
|
|
151716
|
+
if (buildOut) log(buildOut);
|
|
151717
|
+
const { all: deployOut } = await runPnpm(buildDir, {
|
|
151718
|
+
args: [
|
|
151719
|
+
"--package",
|
|
151720
|
+
"netlify-cli",
|
|
151721
|
+
"dlx",
|
|
151722
|
+
"netlify",
|
|
151723
|
+
"deploy",
|
|
151724
|
+
"--prod"
|
|
151725
|
+
],
|
|
151726
|
+
extraEnv: { NETLIFY_AUTH_TOKEN: inputs.token },
|
|
151727
|
+
signal: abortSignal
|
|
151728
|
+
});
|
|
151729
|
+
if (deployOut) log(deployOut);
|
|
151730
|
+
log("Uploaded to netlify");
|
|
151731
|
+
})
|
|
151732
|
+
}, {
|
|
151733
|
+
node: uploadToNetlify,
|
|
151734
|
+
runner: uploadToNetlifyRunner
|
|
151735
|
+
}],
|
|
151736
|
+
integrations: [{
|
|
151737
|
+
name: "Netlify Account",
|
|
151738
|
+
fields: [{
|
|
151739
|
+
key: "apiKey",
|
|
151740
|
+
label: "Personal Access Token",
|
|
151741
|
+
type: "password",
|
|
151742
|
+
placeholder: "netlify API token"
|
|
151743
|
+
}]
|
|
151744
|
+
}]
|
|
151745
|
+
});
|
|
151639
151746
|
//#endregion
|
|
151640
151747
|
module.exports = src_default;
|