@vercel/container 25.0.3 → 26.0.0-snapshot-23cc3b13430e

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.
@@ -98,10 +98,11 @@ async function listStateRecords(directory, suffix) {
98
98
  }
99
99
 
100
100
  // src/buildah-store-cache/command/index.ts
101
+ var import_build_utils2 = require("@vercel/build-utils");
101
102
  var import_node_path2 = require("path");
102
103
  var STORE_COMMAND_SCRIPT = (0, import_node_path2.join)(__dirname, "buildah-store-command.js");
103
104
  function storeCommand(request, script = STORE_COMMAND_SCRIPT) {
104
- return [process.execPath, script, JSON.stringify(request)];
105
+ return [(0, import_build_utils2.getNodeExecPath)(), script, JSON.stringify(request)];
105
106
  }
106
107
  async function runStoreCommand(request, lock) {
107
108
  const [command, ...args] = lock.exclusive(storeCommand(request));
package/dist/index.js CHANGED
@@ -38,13 +38,13 @@ __export(src_exports, {
38
38
  version: () => version
39
39
  });
40
40
  module.exports = __toCommonJS(src_exports);
41
- var import_build_utils8 = require("@vercel/build-utils");
41
+ var import_build_utils9 = require("@vercel/build-utils");
42
42
 
43
43
  // src/schedules-command.ts
44
44
  var import_promises = require("fs/promises");
45
45
  var import_node_os = require("os");
46
46
  var import_node_path = require("path");
47
- var SCHEDULES_COMMAND_ENV = "VERCEL_SCHEDULE_COMMAND";
47
+ var SCHEDULES_COMMAND_ENV = "VERCEL_SCHEDULE_RUN_COMMAND";
48
48
  var DISPATCHER = "schedules-command-dispatcher";
49
49
  async function buildSchedulesCommandImage(engine, params, dispatcher = (0, import_node_path.join)(__dirname, DISPATCHER)) {
50
50
  const baseImage = await engine.build(params);
@@ -127,9 +127,6 @@ function write(line) {
127
127
  function info(message) {
128
128
  write(`\u25B2 container ${message}`);
129
129
  }
130
- function warn(message) {
131
- write(`\u25B2 container Warning: ${message}`);
132
- }
133
130
  function step(message) {
134
131
  write(` \u2192 ${message}`);
135
132
  }
@@ -1664,18 +1661,18 @@ var distribution_default = {
1664
1661
  buildpacks: {
1665
1662
  ruby: {
1666
1663
  id: "vercel/ruby",
1667
- version: "0.3.2",
1668
- sha256: "c0e8439800b9354f24028168869315e714650275ecdd4a8a85bd4e7659890a64"
1664
+ version: "0.4.0",
1665
+ sha256: "78c155cf5df2e7693e156e7ea981525a4716b4f40d46c6f3114ebd621d226244"
1669
1666
  },
1670
1667
  go: {
1671
1668
  id: "vercel/go",
1672
- version: "0.3.0",
1673
- sha256: "748ac1fad8164467dfee92face04b2d5bf2942d8762624625f473fb41bfa2bdb"
1669
+ version: "0.4.0",
1670
+ sha256: "b26528a6f6cd5bd3065e96b4aa13990dde178fec734bff0491773e076f29754a"
1674
1671
  },
1675
1672
  rust: {
1676
1673
  id: "vercel/rust",
1677
- version: "0.3.0",
1678
- sha256: "624fd0cddecd31197eef634342d3ea0e77ce0d5d8e10bbb582aa143edc88ca3e"
1674
+ version: "0.5.0",
1675
+ sha256: "f0f038437829d45077c8ad31060cd2274b80c3c55acfbe00ca937ea7dddfad5c"
1679
1676
  }
1680
1677
  }
1681
1678
  };
@@ -1887,6 +1884,9 @@ function writePlatformEnvDir(buildEnv, config, parentDir = (0, import_node_os6.t
1887
1884
  delete environment.VERCEL_NODE_HOME;
1888
1885
  delete environment.VERCEL_ENTRYPOINT;
1889
1886
  delete environment.VERCEL_COMMAND;
1887
+ delete environment.VERCEL_INSTALL_COMMAND;
1888
+ delete environment.VERCEL_BUILD_COMMAND;
1889
+ delete environment.VERCEL_OUTPUT_FILE;
1890
1890
  if (config.nodeHome) {
1891
1891
  environment.VERCEL_NODE_HOME = config.nodeHome;
1892
1892
  }
@@ -1896,6 +1896,12 @@ function writePlatformEnvDir(buildEnv, config, parentDir = (0, import_node_os6.t
1896
1896
  if (config.command) {
1897
1897
  environment.VERCEL_COMMAND = JSON.stringify(config.command);
1898
1898
  }
1899
+ if (config.installCommand) {
1900
+ environment.VERCEL_INSTALL_COMMAND = config.installCommand;
1901
+ }
1902
+ if (config.buildCommand) {
1903
+ environment.VERCEL_BUILD_COMMAND = config.buildCommand;
1904
+ }
1899
1905
  const dir = (0, import_node_fs5.mkdtempSync)((0, import_node_path7.join)(parentDir, "vercel-cnb-env-"));
1900
1906
  (0, import_node_fs5.chmodSync)(dir, 493);
1901
1907
  for (const [key, value] of Object.entries(environment)) {
@@ -2144,10 +2150,11 @@ var import_node_path11 = require("path");
2144
2150
  var import_node_child_process3 = require("child_process");
2145
2151
 
2146
2152
  // src/buildah-store-cache/command/index.ts
2153
+ var import_build_utils5 = require("@vercel/build-utils");
2147
2154
  var import_node_path8 = require("path");
2148
2155
  var STORE_COMMAND_SCRIPT = (0, import_node_path8.join)(__dirname, "buildah-store-command.js");
2149
2156
  function storeCommand(request, script = STORE_COMMAND_SCRIPT) {
2150
- return [process.execPath, script, JSON.stringify(request)];
2157
+ return [(0, import_build_utils5.getNodeExecPath)(), script, JSON.stringify(request)];
2151
2158
  }
2152
2159
  async function runStoreCommand(request, lock) {
2153
2160
  const [command, ...args] = lock.exclusive(storeCommand(request));
@@ -2536,7 +2543,9 @@ async function buildAndPushWithLifecycle(buildpack, params, client, span) {
2536
2543
  platformEnvDir = writePlatformEnvDir(params.buildEnv, {
2537
2544
  nodeHome: params.nodeToolchain?.home,
2538
2545
  entrypoint: params.entrypoint,
2539
- command: params.command
2546
+ command: params.command,
2547
+ installCommand: params.installCommand,
2548
+ buildCommand: params.buildCommand
2540
2549
  });
2541
2550
  const registrySetup = params.prepareRegistry?.();
2542
2551
  const containerReady = prepareBuildContainer(
@@ -2742,7 +2751,9 @@ var buildAndPushWithLifecycleDocker = async (buildpack, params, span) => {
2742
2751
  {
2743
2752
  nodeHome: params.nodeToolchain?.home,
2744
2753
  entrypoint: params.entrypoint,
2745
- command: params.command
2754
+ command: params.command,
2755
+ installCommand: params.installCommand,
2756
+ buildCommand: params.buildCommand
2746
2757
  },
2747
2758
  stageDir
2748
2759
  );
@@ -2915,15 +2926,15 @@ var buildAndPushWithLifecycleDocker = async (buildpack, params, span) => {
2915
2926
  };
2916
2927
 
2917
2928
  // src/buildpacks/node-toolchain.ts
2918
- var import_build_utils5 = require("@vercel/build-utils");
2929
+ var import_build_utils6 = require("@vercel/build-utils");
2919
2930
  var import_node_fs9 = require("fs");
2920
2931
  var import_node_path13 = require("path");
2921
2932
  async function selectNodeMajor(workPath, config, meta) {
2922
2933
  if (!(0, import_node_fs9.existsSync)((0, import_node_path13.join)(workPath, "package.json"))) {
2923
2934
  return void 0;
2924
2935
  }
2925
- const version2 = await (0, import_build_utils5.getNodeVersion)(workPath, void 0, config, meta);
2926
- if ((0, import_build_utils5.isBunVersion)(version2)) {
2936
+ const version2 = await (0, import_build_utils6.getNodeVersion)(workPath, void 0, config, meta);
2937
+ if ((0, import_build_utils6.isBunVersion)(version2)) {
2927
2938
  throw new Error(
2928
2939
  "Buildpack asset builds require Node.js. Bun is not supported yet; configure engines.node or use Dockerfile.vercel."
2929
2940
  );
@@ -3202,6 +3213,21 @@ function selectEntrypoint(params, sourceDir) {
3202
3213
  const fromEnv = zeroConfig ? readString(params.buildEnv?.VERCEL_ENTRYPOINT) : void 0;
3203
3214
  return fromEnv ?? params.buildpack.defaultEntrypoint?.({ workPath: sourceDir, zeroConfig });
3204
3215
  }
3216
+ function selectCommands(params) {
3217
+ if (params.config.daemon)
3218
+ return {};
3219
+ const commands = {};
3220
+ for (const name of ["installCommand", "buildCommand"]) {
3221
+ const command = params.config[name];
3222
+ if (typeof command === "string" && command.trim()) {
3223
+ debug(
3224
+ `Passing ${name} ${JSON.stringify(command)} to the ${params.buildpack.runtime} buildpack`
3225
+ );
3226
+ commands[name] = command;
3227
+ }
3228
+ }
3229
+ return commands;
3230
+ }
3205
3231
  async function buildAndPushBuildpack(params) {
3206
3232
  const sourceDir = (0, import_node_fs14.mkdtempSync)((0, import_node_path18.join)((0, import_node_os10.tmpdir)(), "vercel-cnb-source-"));
3207
3233
  try {
@@ -3224,12 +3250,7 @@ async function buildAndPushBuildpack(params) {
3224
3250
  `Passing VERCEL_ENTRYPOINT=${entrypoint} to the ${params.buildpack.runtime} buildpack`
3225
3251
  );
3226
3252
  }
3227
- const buildCommand = readString(params.config.buildCommand);
3228
- if (buildCommand?.trim()) {
3229
- warn(
3230
- `The build command ${JSON.stringify(buildCommand)} is not supported and will be ignored.`
3231
- );
3232
- }
3253
+ const commands = selectCommands(params);
3233
3254
  const prereleaseUrl = getPrereleaseUrl();
3234
3255
  const buildpack = prereleaseUrl ? await withPrereleaseBuildpack(params.buildpack, prereleaseUrl) : params.buildpack;
3235
3256
  const image = await buildpack.resolveImage(sourceDir);
@@ -3318,7 +3339,8 @@ async function buildAndPushBuildpack(params) {
3318
3339
  nodeToolchain,
3319
3340
  cache,
3320
3341
  entrypoint,
3321
- command: params.config.daemon?.command
3342
+ command: params.config.daemon?.command,
3343
+ ...commands
3322
3344
  };
3323
3345
  let result;
3324
3346
  if (engine.name === "buildah") {
@@ -3392,7 +3414,7 @@ function resolveImageSource(options, context) {
3392
3414
  }
3393
3415
 
3394
3416
  // src/buildah-store-cache/cache.ts
3395
- var import_build_utils6 = require("@vercel/build-utils");
3417
+ var import_build_utils7 = require("@vercel/build-utils");
3396
3418
  var import_node_crypto8 = require("crypto");
3397
3419
  var import_promises7 = require("fs/promises");
3398
3420
  var import_node_os11 = require("os");
@@ -3486,7 +3508,7 @@ var BuildahStoreCache = class _BuildahStoreCache {
3486
3508
  if (!await isRegularFile(archive)) {
3487
3509
  return {};
3488
3510
  }
3489
- return await (0, import_build_utils6.glob)(
3511
+ return await (0, import_build_utils7.glob)(
3490
3512
  `${BUILDAH_STORE_CACHE_DIR}/${(0, import_node_path20.basename)(archive)}`,
3491
3513
  this.repositoryRoot
3492
3514
  );
@@ -4067,7 +4089,7 @@ async function startContainer(options, reuseKey) {
4067
4089
  }
4068
4090
 
4069
4091
  // src/prepare-cache.ts
4070
- var import_build_utils7 = require("@vercel/build-utils");
4092
+ var import_build_utils8 = require("@vercel/build-utils");
4071
4093
  var import_node_path22 = require("path");
4072
4094
  async function prepareCache(options) {
4073
4095
  const root = (0, import_node_path22.resolve)(options.repoRootPath || options.workPath);
@@ -4080,7 +4102,7 @@ async function prepareCache(options) {
4080
4102
  }
4081
4103
  async function collectBuildpackCache(root) {
4082
4104
  const start = Date.now();
4083
- const files = await (0, import_build_utils7.glob)(`${BUILDPACK_CACHE_DIR}/**`, root);
4105
+ const files = await (0, import_build_utils8.glob)(`${BUILDPACK_CACHE_DIR}/**`, root);
4084
4106
  const count = Object.keys(files).length;
4085
4107
  if (count > 0) {
4086
4108
  info(
@@ -4297,7 +4319,7 @@ async function resolveImageHandler(options, source, buildahClient, span, schedul
4297
4319
  });
4298
4320
  return tag3;
4299
4321
  }
4300
- const repository2 = daemon ? (0, import_build_utils8.getDaemonImageRepository)(daemon.name) : sanitizeRepository(options.service?.name ?? buildpack.runtime);
4322
+ const repository2 = daemon ? (0, import_build_utils9.getDaemonImageRepository)(daemon.name) : sanitizeRepository(options.service?.name ?? buildpack.runtime);
4301
4323
  const tag2 = resolveImageTag();
4302
4324
  span?.setAttributes({
4303
4325
  "container.mode": "buildpack-build-and-push",
@@ -4343,7 +4365,7 @@ async function resolveImageHandler(options, source, buildahClient, span, schedul
4343
4365
  `Dockerfile not found at "${dockerfilePath}" for container service.`
4344
4366
  );
4345
4367
  }
4346
- const repository = daemon ? (0, import_build_utils8.getDaemonImageRepository)(daemon.name) : sanitizeRepository(
4368
+ const repository = daemon ? (0, import_build_utils9.getDaemonImageRepository)(daemon.name) : sanitizeRepository(
4347
4369
  options.service?.name ?? import_node_path23.default.basename(dockerfileRel).split(".")[0]
4348
4370
  );
4349
4371
  const tag = resolveImageTag();
@@ -4432,7 +4454,7 @@ async function build(options) {
4432
4454
  }
4433
4455
  };
4434
4456
  }
4435
- const lambdaOptions = await (0, import_build_utils8.getLambdaOptionsFromFunction)({
4457
+ const lambdaOptions = await (0, import_build_utils9.getLambdaOptionsFromFunction)({
4436
4458
  sourceFile: resolveFunctionSourceFile(options),
4437
4459
  config: options.config,
4438
4460
  isScheduleEntrypoint: schedulesCommand !== void 0
@@ -4441,7 +4463,7 @@ async function build(options) {
4441
4463
  await generateProjectManifest({
4442
4464
  workPath: options.workPath,
4443
4465
  framework: options.diagnosticsValues?.framework,
4444
- serviceType: options.service ? (0, import_build_utils8.getReportedServiceType)(options.service) : void 0
4466
+ serviceType: options.service ? (0, import_build_utils9.getReportedServiceType)(options.service) : void 0
4445
4467
  });
4446
4468
  const routes = [
4447
4469
  { handle: "filesystem" },
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/container",
3
- "version": "25.0.3",
3
+ "version": "26.0.0-snapshot-23cc3b13430e",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index.js",
6
6
  "homepage": "https://vercel.com/docs",
@@ -17,13 +17,13 @@
17
17
  "tar": "7.5.11"
18
18
  },
19
19
  "peerDependencies": {
20
- "@vercel/build-utils": "15.3.0"
20
+ "@vercel/build-utils": "15.4.0-snapshot-23cc3b13430e"
21
21
  },
22
22
  "devDependencies": {
23
23
  "@types/node": "20.11.0",
24
24
  "vitest": "4.1.10",
25
25
  "@vercel-internals/ipc-proxy": "1.1.4",
26
- "@vercel/build-utils": "15.3.0"
26
+ "@vercel/build-utils": "15.4.0-snapshot-23cc3b13430e"
27
27
  },
28
28
  "publishConfig": {
29
29
  "access": "public"