@vercel/go 3.6.0 → 3.7.0

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.
Files changed (2) hide show
  1. package/dist/index.js +11 -1
  2. package/package.json +7 -6
package/dist/index.js CHANGED
@@ -10881,6 +10881,8 @@ var require_xdg_app_paths = __commonJS({
10881
10881
  var src_exports = {};
10882
10882
  __export(src_exports, {
10883
10883
  build: () => build,
10884
+ detectEntrypoint: () => detectEntrypoint,
10885
+ detectGoEntrypoint: () => detectGoEntrypoint,
10884
10886
  getNewHandlerFunctionName: () => getNewHandlerFunctionName,
10885
10887
  prepareCache: () => prepareCache,
10886
10888
  shouldServe: () => import_build_utils4.shouldServe,
@@ -14537,7 +14539,7 @@ var GO_CANDIDATE_ENTRYPOINTS = [
14537
14539
  "cmd/server/main.go"
14538
14540
  ];
14539
14541
  async function detectGoEntrypoint(workPath, configuredEntrypoint) {
14540
- if (await (0, import_fs_extra2.pathExists)((0, import_path5.join)(workPath, configuredEntrypoint))) {
14542
+ if (configuredEntrypoint && await (0, import_fs_extra2.pathExists)((0, import_path5.join)(workPath, configuredEntrypoint))) {
14541
14543
  (0, import_build_utils2.debug)(`Using configured Go entrypoint: ${configuredEntrypoint}`);
14542
14544
  return configuredEntrypoint;
14543
14545
  }
@@ -14549,6 +14551,12 @@ async function detectGoEntrypoint(workPath, configuredEntrypoint) {
14549
14551
  }
14550
14552
  return null;
14551
14553
  }
14554
+ var detectEntrypoint = async ({ workPath }) => {
14555
+ const file = await detectGoEntrypoint(workPath);
14556
+ if (!file)
14557
+ return null;
14558
+ return { kind: "file", entrypoint: file };
14559
+ };
14552
14560
 
14553
14561
  // src/standalone-server.ts
14554
14562
  var import_child_process = require("child_process");
@@ -15451,6 +15459,8 @@ async function prepareCache({
15451
15459
  // Annotate the CommonJS export names for ESM import in node:
15452
15460
  0 && (module.exports = {
15453
15461
  build,
15462
+ detectEntrypoint,
15463
+ detectGoEntrypoint,
15454
15464
  getNewHandlerFunctionName,
15455
15465
  prepareCache,
15456
15466
  shouldServe,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/go",
3
- "version": "3.6.0",
3
+ "version": "3.7.0",
4
4
  "license": "Apache-2.0",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/go",
@@ -18,25 +18,26 @@
18
18
  "@types/async-retry": "1.4.5",
19
19
  "@types/execa": "^0.9.0",
20
20
  "@types/fs-extra": "^5.0.5",
21
- "@types/jest": "28.1.6",
22
21
  "@types/node": "20.11.0",
23
22
  "@types/node-fetch": "^2.3.0",
24
23
  "@types/yauzl-promise": "2.1.0",
25
24
  "async-retry": "1.3.3",
26
25
  "execa": "^1.0.0",
27
26
  "fs-extra": "^7.0.0",
28
- "jest-junit": "16.0.0",
29
27
  "node-fetch": "^2.2.1",
30
28
  "string-argv": "0.3.1",
31
29
  "tar": "7.5.11",
30
+ "vitest": "2.0.3",
32
31
  "xdg-app-paths": "5.1.0",
33
32
  "yauzl-promise": "2.1.3",
34
- "@vercel/build-utils": "13.21.0"
33
+ "@vercel/build-utils": "13.25.0"
35
34
  },
36
35
  "scripts": {
37
36
  "build": "node ../../utils/build-builder.mjs",
38
- "test": "jest --reporters=default --reporters=jest-junit --env node --verbose --runInBand --bail",
37
+ "test": "vitest run --config ../../vitest.config.mts",
39
38
  "test-e2e": "pnpm test test/integration-*",
40
- "type-check": "tsc --noEmit"
39
+ "type-check": "tsc --noEmit",
40
+ "vitest-run": "vitest -c ../../vitest.config.mts",
41
+ "vitest-e2e": "glob --absolute 'test/integration-*'"
41
42
  }
42
43
  }