@vercel/fs-detectors 7.12.1 → 7.12.2-snapshot-92f4d50bf3fb

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.
@@ -156,14 +156,20 @@ var require_entrypoint = __commonJS({
156
156
  var __toCommonJS2 = (mod) => __copyProps2(__defProp2({}, "__esModule", { value: true }), mod);
157
157
  var entrypoint_exports = {};
158
158
  __export2(entrypoint_exports, {
159
+ getScheduleEntrypointRuntime: () => getScheduleEntrypointRuntime,
159
160
  isDockerfileEntrypoint: () => isDockerfileEntrypoint,
160
161
  parsePyModuleAttrEntrypoint: () => parsePyModuleAttrEntrypoint2,
162
+ parsePythonScheduleModule: () => parsePythonScheduleModule,
161
163
  stripTrailingSlash: () => stripTrailingSlash
162
164
  });
163
165
  module2.exports = __toCommonJS2(entrypoint_exports);
164
166
  var import_path2 = require("path");
165
167
  var import_constants2 = require_constants();
166
168
  var PYTHON_MODULE_ATTR_RE = /^([A-Za-z_][\w]*(?:\.[A-Za-z_][\w]*)*):([A-Za-z_][\w]*)$/;
169
+ var PYTHON_MODULE_RE = /^[A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*$/;
170
+ var SOURCE_FILE_RE = /\.(?:py|[cm]?[jt]s)$/;
171
+ var NODE_SOURCE_FILE_RE = /\.(?:m?js|[cm]?ts)$/;
172
+ var DOCKERFILE_NAME_RE = /^(docker|container)file(\..+)?$/i;
167
173
  function parsePyModuleAttrEntrypoint2(entrypoint) {
168
174
  const match = PYTHON_MODULE_ATTR_RE.exec(entrypoint);
169
175
  if (!match)
@@ -177,6 +183,23 @@ var require_entrypoint = __commonJS({
177
183
  moduleName: modulePart
178
184
  };
179
185
  }
186
+ function parsePythonScheduleModule(entrypoint) {
187
+ if (!PYTHON_MODULE_RE.test(entrypoint) || SOURCE_FILE_RE.test(entrypoint)) {
188
+ return null;
189
+ }
190
+ const path = entrypoint.replace(/\./g, "/");
191
+ return {
192
+ moduleName: entrypoint,
193
+ sourceFiles: [`${path}/__init__.py`, `${path}.py`]
194
+ };
195
+ }
196
+ function getScheduleEntrypointRuntime(entrypoint) {
197
+ if (NODE_SOURCE_FILE_RE.test(entrypoint))
198
+ return "node";
199
+ if (DOCKERFILE_NAME_RE.test(entrypoint))
200
+ return void 0;
201
+ return parsePythonScheduleModule(entrypoint) ? "python" : void 0;
202
+ }
180
203
  var CONTAINER_ENTRYPOINT_BASENAMES = new Set(
181
204
  import_constants2.CONTAINER_ENTRYPOINT_CANDIDATES.map((name) => name.toLowerCase())
182
205
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/fs-detectors",
3
- "version": "7.12.1",
3
+ "version": "7.12.2-snapshot-92f4d50bf3fb",
4
4
  "description": "Vercel filesystem detectors",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -20,11 +20,11 @@
20
20
  "minimatch": "3.1.2",
21
21
  "semver": "6.3.1",
22
22
  "smol-toml": "1.5.2",
23
- "@vercel/build-utils": "15.4.0",
24
- "@vercel/frameworks": "3.35.0",
25
- "@vercel/routing-utils": "6.6.1",
23
+ "@vercel/build-utils": "15.4.1-snapshot-92f4d50bf3fb",
24
+ "@vercel/error-utils": "2.2.1",
26
25
  "@vercel/python-analysis": "0.15.3",
27
- "@vercel/error-utils": "2.2.1"
26
+ "@vercel/routing-utils": "6.6.1",
27
+ "@vercel/frameworks": "3.35.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@types/glob": "7.2.0",
@@ -33,7 +33,7 @@
33
33
  "@types/node": "20.11.0",
34
34
  "@types/semver": "7.3.10",
35
35
  "vitest": "4.1.10",
36
- "@vercel-internals/runtimes": "1.2.9"
36
+ "@vercel-internals/runtimes": "1.2.10"
37
37
  },
38
38
  "scripts": {
39
39
  "build": "node build.mjs",