@vercel/python 32.1.0 → 33.0.0-snapshot-fdd4372a7e51
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.js +1 -29
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -9611,9 +9611,7 @@ function moduleColonFuncToCronPath(serviceName, moduleFunction) {
|
|
|
9611
9611
|
}
|
|
9612
9612
|
|
|
9613
9613
|
// src/schedules.ts
|
|
9614
|
-
var import_crypto2 = require("crypto");
|
|
9615
9614
|
var import_build_utils14 = require("@vercel/build-utils");
|
|
9616
|
-
var SCHEDULES_FUNCTION_PATH = "schedules";
|
|
9617
9615
|
var GENERATED_SCHEDULE_HANDLER_PATH = "_vc_schedule_handlers/schedules.py";
|
|
9618
9616
|
function createScheduleHandlerModule({
|
|
9619
9617
|
moduleName,
|
|
@@ -9654,32 +9652,6 @@ function createScheduleIntrospectionScript(moduleName) {
|
|
|
9654
9652
|
"out.close()"
|
|
9655
9653
|
].join("\n");
|
|
9656
9654
|
}
|
|
9657
|
-
var REGION_ID_RE = /^[a-z]{3}[0-9]$/;
|
|
9658
|
-
var MAX_FUNCTION_NAME_LENGTH = 64;
|
|
9659
|
-
function formatMaxDuration(seconds) {
|
|
9660
|
-
if (seconds % 3600 === 0)
|
|
9661
|
-
return `${seconds / 3600}h`;
|
|
9662
|
-
if (seconds % 60 === 0)
|
|
9663
|
-
return `${seconds / 60}m`;
|
|
9664
|
-
return `${seconds}s`;
|
|
9665
|
-
}
|
|
9666
|
-
function getScheduleFunction(maxDuration, regions) {
|
|
9667
|
-
const sortedRegions = regions && [...new Set(regions)].sort();
|
|
9668
|
-
const parts = [
|
|
9669
|
-
...sortedRegions ?? [],
|
|
9670
|
-
...maxDuration === null ? [] : [formatMaxDuration(maxDuration)]
|
|
9671
|
-
];
|
|
9672
|
-
let path = [SCHEDULES_FUNCTION_PATH, ...parts].join("-");
|
|
9673
|
-
if (!(sortedRegions ?? []).every((region) => REGION_ID_RE.test(region)) || path.length > MAX_FUNCTION_NAME_LENGTH) {
|
|
9674
|
-
const hash = (0, import_crypto2.createHash)("sha256").update(JSON.stringify([maxDuration, sortedRegions])).digest("hex").slice(0, 8);
|
|
9675
|
-
path = `${SCHEDULES_FUNCTION_PATH}-${hash}`;
|
|
9676
|
-
}
|
|
9677
|
-
return {
|
|
9678
|
-
path,
|
|
9679
|
-
...maxDuration !== null && { maxDuration },
|
|
9680
|
-
...sortedRegions !== null && { regions: sortedRegions }
|
|
9681
|
-
};
|
|
9682
|
-
}
|
|
9683
9655
|
function parseIntrospectedSchedules(stdout) {
|
|
9684
9656
|
try {
|
|
9685
9657
|
const parsed = JSON.parse(stdout);
|
|
@@ -9752,7 +9724,7 @@ async function introspectSchedules({
|
|
|
9752
9724
|
`${error} Shorten the \`@schedule\` name "${name}".`
|
|
9753
9725
|
);
|
|
9754
9726
|
}
|
|
9755
|
-
const target = getScheduleFunction(maxDuration, regions);
|
|
9727
|
+
const target = (0, import_build_utils14.getScheduleFunction)(maxDuration, regions);
|
|
9756
9728
|
const fn = functions.get(target.path) ?? { ...target, schedules: [] };
|
|
9757
9729
|
fn.schedules.push(name);
|
|
9758
9730
|
functions.set(fn.path, fn);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/python",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "33.0.0-snapshot-fdd4372a7e51",
|
|
4
4
|
"main": "./dist/index.js",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/python",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"@vercel/python-analysis": "0.15.3"
|
|
18
18
|
},
|
|
19
19
|
"peerDependencies": {
|
|
20
|
-
"@vercel/build-utils": "15.
|
|
20
|
+
"@vercel/build-utils": "15.5.0-snapshot-fdd4372a7e51"
|
|
21
21
|
},
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"@renovatebot/pep440": "4.2.1",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"smol-toml": "1.5.2",
|
|
38
38
|
"vitest": "4.1.10",
|
|
39
39
|
"which": "3.0.0",
|
|
40
|
-
"@vercel/
|
|
41
|
-
"@vercel/build-utils": "15.
|
|
42
|
-
"@vercel/
|
|
40
|
+
"@vercel/error-utils": "2.2.1",
|
|
41
|
+
"@vercel/build-utils": "15.5.0-snapshot-fdd4372a7e51",
|
|
42
|
+
"@vercel/python-runtime": "0.26.0"
|
|
43
43
|
},
|
|
44
44
|
"scripts": {
|
|
45
45
|
"build": "node ../../utils/build-builder.mjs",
|