@vercel/fs-detectors 5.17.0 → 5.18.1
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.
|
@@ -271,15 +271,10 @@ function generateServicesRoutes(services) {
|
|
|
271
271
|
}
|
|
272
272
|
const cronServices = services.filter((s) => s.type === "cron");
|
|
273
273
|
for (const service of cronServices) {
|
|
274
|
-
const
|
|
275
|
-
const cronPath = (0, import_utils.getInternalServiceCronPath)(
|
|
276
|
-
service.name,
|
|
277
|
-
cronEntrypoint,
|
|
278
|
-
service.handlerFunction || "cron"
|
|
279
|
-
);
|
|
274
|
+
const cronPrefix = (0, import_utils.getInternalServiceCronPathPrefix)(service.name);
|
|
280
275
|
const functionPath = (0, import_utils.getInternalServiceFunctionPath)(service.name);
|
|
281
276
|
crons.push({
|
|
282
|
-
src: `^${escapeRegex(
|
|
277
|
+
src: `^${escapeRegex(cronPrefix)}/.*$`,
|
|
283
278
|
dest: functionPath,
|
|
284
279
|
check: true
|
|
285
280
|
});
|
package/dist/services/utils.d.ts
CHANGED
|
@@ -1,19 +1,14 @@
|
|
|
1
|
+
import { INTERNAL_SERVICE_PREFIX, getInternalServiceFunctionPath, getInternalServiceCronPathPrefix, getInternalServiceCronPath } from '@vercel/build-utils';
|
|
1
2
|
import type { DetectorFilesystem } from '../detectors/filesystem';
|
|
2
3
|
import type { ServiceRuntime, ExperimentalServices, ServiceDetectionError, ResolvedService } from './types';
|
|
4
|
+
export { INTERNAL_SERVICE_PREFIX, getInternalServiceFunctionPath, getInternalServiceCronPathPrefix, getInternalServiceCronPath, };
|
|
3
5
|
export declare function hasFile(fs: DetectorFilesystem, filePath: string): Promise<boolean>;
|
|
4
|
-
/**
|
|
5
|
-
* Reserved internal namespace used by services routing/runtime plumbing.
|
|
6
|
-
*/
|
|
7
|
-
export declare const INTERNAL_SERVICE_PREFIX = "/_svc";
|
|
8
6
|
/**
|
|
9
7
|
* Reserved internal namespace used by the dev queue proxy.
|
|
10
8
|
*/
|
|
11
9
|
export declare const INTERNAL_QUEUES_PREFIX = "/_svc/_queues";
|
|
12
|
-
export declare function getInternalServiceFunctionPath(serviceName: string): string;
|
|
13
10
|
export declare function getInternalServiceWorkerPathPrefix(serviceName: string): string;
|
|
14
|
-
export declare function getInternalServiceCronPathPrefix(serviceName: string): string;
|
|
15
11
|
export declare function getInternalServiceWorkerPath(serviceName: string, entrypoint: string, handler?: string): string;
|
|
16
|
-
export declare function getInternalServiceCronPath(serviceName: string, entrypoint: string, handler?: string): string;
|
|
17
12
|
export declare function getBuilderForRuntime(runtime: ServiceRuntime): string;
|
|
18
13
|
export declare function isStaticBuild(service: ResolvedService): boolean;
|
|
19
14
|
/**
|
package/dist/services/utils.js
CHANGED
|
@@ -29,12 +29,12 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
var utils_exports = {};
|
|
30
30
|
__export(utils_exports, {
|
|
31
31
|
INTERNAL_QUEUES_PREFIX: () => INTERNAL_QUEUES_PREFIX,
|
|
32
|
-
INTERNAL_SERVICE_PREFIX: () => INTERNAL_SERVICE_PREFIX,
|
|
32
|
+
INTERNAL_SERVICE_PREFIX: () => import_build_utils.INTERNAL_SERVICE_PREFIX,
|
|
33
33
|
filterFrameworksByRuntime: () => filterFrameworksByRuntime,
|
|
34
34
|
getBuilderForRuntime: () => getBuilderForRuntime,
|
|
35
|
-
getInternalServiceCronPath: () => getInternalServiceCronPath,
|
|
36
|
-
getInternalServiceCronPathPrefix: () => getInternalServiceCronPathPrefix,
|
|
37
|
-
getInternalServiceFunctionPath: () => getInternalServiceFunctionPath,
|
|
35
|
+
getInternalServiceCronPath: () => import_build_utils.getInternalServiceCronPath,
|
|
36
|
+
getInternalServiceCronPathPrefix: () => import_build_utils.getInternalServiceCronPathPrefix,
|
|
37
|
+
getInternalServiceFunctionPath: () => import_build_utils.getInternalServiceFunctionPath,
|
|
38
38
|
getInternalServiceWorkerPath: () => getInternalServiceWorkerPath,
|
|
39
39
|
getInternalServiceWorkerPathPrefix: () => getInternalServiceWorkerPathPrefix,
|
|
40
40
|
hasFile: () => hasFile,
|
|
@@ -47,6 +47,7 @@ __export(utils_exports, {
|
|
|
47
47
|
});
|
|
48
48
|
module.exports = __toCommonJS(utils_exports);
|
|
49
49
|
var import_framework_helpers = require("@vercel/build-utils/dist/framework-helpers");
|
|
50
|
+
var import_build_utils = require("@vercel/build-utils");
|
|
50
51
|
var import_types = require("./types");
|
|
51
52
|
async function hasFile(fs, filePath) {
|
|
52
53
|
try {
|
|
@@ -55,29 +56,18 @@ async function hasFile(fs, filePath) {
|
|
|
55
56
|
return false;
|
|
56
57
|
}
|
|
57
58
|
}
|
|
58
|
-
const INTERNAL_SERVICE_PREFIX = "/_svc";
|
|
59
59
|
const INTERNAL_QUEUES_PREFIX = "/_svc/_queues";
|
|
60
|
-
function getInternalServiceFunctionPath(serviceName) {
|
|
61
|
-
return `${INTERNAL_SERVICE_PREFIX}/${serviceName}/index`;
|
|
62
|
-
}
|
|
63
60
|
function normalizeInternalServiceEntrypoint(entrypoint) {
|
|
64
61
|
const normalized = entrypoint.replace(/\\/g, "/").replace(/^\/+/, "").replace(/\.[^/.]+$/, "");
|
|
65
62
|
return normalized || "index";
|
|
66
63
|
}
|
|
67
64
|
function getInternalServiceWorkerPathPrefix(serviceName) {
|
|
68
|
-
return `${INTERNAL_SERVICE_PREFIX}/${serviceName}/workers`;
|
|
69
|
-
}
|
|
70
|
-
function getInternalServiceCronPathPrefix(serviceName) {
|
|
71
|
-
return `${INTERNAL_SERVICE_PREFIX}/${serviceName}/crons`;
|
|
65
|
+
return `${import_build_utils.INTERNAL_SERVICE_PREFIX}/${serviceName}/workers`;
|
|
72
66
|
}
|
|
73
67
|
function getInternalServiceWorkerPath(serviceName, entrypoint, handler = "worker") {
|
|
74
68
|
const normalizedEntrypoint = normalizeInternalServiceEntrypoint(entrypoint);
|
|
75
69
|
return `${getInternalServiceWorkerPathPrefix(serviceName)}/${normalizedEntrypoint}/${handler}`;
|
|
76
70
|
}
|
|
77
|
-
function getInternalServiceCronPath(serviceName, entrypoint, handler = "cron") {
|
|
78
|
-
const normalizedEntrypoint = normalizeInternalServiceEntrypoint(entrypoint);
|
|
79
|
-
return `${getInternalServiceCronPathPrefix(serviceName)}/${normalizedEntrypoint}/${handler}`;
|
|
80
|
-
}
|
|
81
71
|
function getBuilderForRuntime(runtime) {
|
|
82
72
|
const builder = import_types.RUNTIME_BUILDERS[runtime];
|
|
83
73
|
if (!builder) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vercel/fs-detectors",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.18.1",
|
|
4
4
|
"description": "Vercel filesystem detectors",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -20,9 +20,9 @@
|
|
|
20
20
|
"minimatch": "3.1.2",
|
|
21
21
|
"semver": "6.3.1",
|
|
22
22
|
"smol-toml": "1.5.2",
|
|
23
|
-
"@vercel/build-utils": "13.
|
|
24
|
-
"@vercel/routing-utils": "6.1.1",
|
|
23
|
+
"@vercel/build-utils": "13.17.1",
|
|
25
24
|
"@vercel/error-utils": "2.0.3",
|
|
25
|
+
"@vercel/routing-utils": "6.1.1",
|
|
26
26
|
"@vercel/frameworks": "3.24.1"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|