@vercel/build-utils 13.27.0 → 13.27.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.
- package/CHANGELOG.md +6 -0
- package/dist/get-service-url-env-vars.js +6 -3
- package/dist/index.js +15 -3
- package/dist/types.d.ts +32 -1
- package/dist/types.js +10 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -22,6 +22,7 @@ __export(get_service_url_env_vars_exports, {
|
|
|
22
22
|
getServiceUrlEnvVars: () => getServiceUrlEnvVars
|
|
23
23
|
});
|
|
24
24
|
module.exports = __toCommonJS(get_service_url_env_vars_exports);
|
|
25
|
+
var import_types = require("./types");
|
|
25
26
|
function serviceNameToEnvVar(name) {
|
|
26
27
|
return `${name.replace(/-/g, "_").toUpperCase()}_URL`;
|
|
27
28
|
}
|
|
@@ -56,7 +57,8 @@ function getServiceUrlEnvVars(options) {
|
|
|
56
57
|
const baseUrl = origin || deploymentUrl;
|
|
57
58
|
if (!baseUrl)
|
|
58
59
|
return {};
|
|
59
|
-
const
|
|
60
|
+
const v1Services = services.filter(import_types.isExperimentalService);
|
|
61
|
+
const servicesByName = new Map(v1Services.map((s) => [s.name, s]));
|
|
60
62
|
const consumerEnvPrefix = getFrameworkEnvPrefix(
|
|
61
63
|
consumerService?.framework,
|
|
62
64
|
frameworkList
|
|
@@ -90,15 +92,16 @@ function getExperimentalServiceUrlEnvVars(options) {
|
|
|
90
92
|
if (!baseUrl || !services || services.length === 0) {
|
|
91
93
|
return {};
|
|
92
94
|
}
|
|
95
|
+
const v1Services = services.filter(import_types.isExperimentalService);
|
|
93
96
|
const envVars = {};
|
|
94
97
|
const frameworkPrefixes = /* @__PURE__ */ new Set();
|
|
95
|
-
for (const service of
|
|
98
|
+
for (const service of v1Services) {
|
|
96
99
|
const prefix = getFrameworkEnvPrefix(service.framework, frameworkList);
|
|
97
100
|
if (prefix) {
|
|
98
101
|
frameworkPrefixes.add(prefix);
|
|
99
102
|
}
|
|
100
103
|
}
|
|
101
|
-
for (const service of
|
|
104
|
+
for (const service of v1Services) {
|
|
102
105
|
if (service.type !== "web" || !service.routePrefix) {
|
|
103
106
|
continue;
|
|
104
107
|
}
|
package/dist/index.js
CHANGED
|
@@ -34596,6 +34596,8 @@ __export(src_exports, {
|
|
|
34596
34596
|
isDirectory: () => isDirectory,
|
|
34597
34597
|
isExperimentalBackendsEnabled: () => isExperimentalBackendsEnabled,
|
|
34598
34598
|
isExperimentalBackendsWithoutIntrospectionEnabled: () => isExperimentalBackendsWithoutIntrospectionEnabled,
|
|
34599
|
+
isExperimentalService: () => isExperimentalService,
|
|
34600
|
+
isExperimentalServiceV2: () => isExperimentalServiceV2,
|
|
34599
34601
|
isExternalSymlink: () => isExternalSymlink,
|
|
34600
34602
|
isExternalSymlinkTarget: () => isExternalSymlinkTarget,
|
|
34601
34603
|
isNodeBackendFramework: () => isNodeBackendFramework,
|
|
@@ -35852,6 +35854,12 @@ var NodeVersion = class extends Version {
|
|
|
35852
35854
|
var BunVersion = class extends Version {
|
|
35853
35855
|
};
|
|
35854
35856
|
var JOB_TRIGGERS = ["queue", "schedule", "workflow"];
|
|
35857
|
+
function isExperimentalService(service) {
|
|
35858
|
+
return service.schema === "experimentalServices";
|
|
35859
|
+
}
|
|
35860
|
+
function isExperimentalServiceV2(service) {
|
|
35861
|
+
return service.schema === "experimentalServicesV2";
|
|
35862
|
+
}
|
|
35855
35863
|
function getServiceQueueTopicConfigs(config) {
|
|
35856
35864
|
if (Array.isArray(config.topics) && config.topics.length > 0) {
|
|
35857
35865
|
return typeof config.topics[0] === "string" ? config.topics.map((topic) => ({ topic })) : config.topics;
|
|
@@ -38011,7 +38019,8 @@ function getServiceUrlEnvVars(options) {
|
|
|
38011
38019
|
const baseUrl = origin || deploymentUrl;
|
|
38012
38020
|
if (!baseUrl)
|
|
38013
38021
|
return {};
|
|
38014
|
-
const
|
|
38022
|
+
const v1Services = services.filter(isExperimentalService);
|
|
38023
|
+
const servicesByName = new Map(v1Services.map((s) => [s.name, s]));
|
|
38015
38024
|
const consumerEnvPrefix = getFrameworkEnvPrefix(
|
|
38016
38025
|
consumerService?.framework,
|
|
38017
38026
|
frameworkList
|
|
@@ -38045,15 +38054,16 @@ function getExperimentalServiceUrlEnvVars(options) {
|
|
|
38045
38054
|
if (!baseUrl || !services || services.length === 0) {
|
|
38046
38055
|
return {};
|
|
38047
38056
|
}
|
|
38057
|
+
const v1Services = services.filter(isExperimentalService);
|
|
38048
38058
|
const envVars = {};
|
|
38049
38059
|
const frameworkPrefixes = /* @__PURE__ */ new Set();
|
|
38050
|
-
for (const service of
|
|
38060
|
+
for (const service of v1Services) {
|
|
38051
38061
|
const prefix = getFrameworkEnvPrefix(service.framework, frameworkList);
|
|
38052
38062
|
if (prefix) {
|
|
38053
38063
|
frameworkPrefixes.add(prefix);
|
|
38054
38064
|
}
|
|
38055
38065
|
}
|
|
38056
|
-
for (const service of
|
|
38066
|
+
for (const service of v1Services) {
|
|
38057
38067
|
if (service.type !== "web" || !service.routePrefix) {
|
|
38058
38068
|
continue;
|
|
38059
38069
|
}
|
|
@@ -40451,6 +40461,8 @@ function getExtendedPayload({
|
|
|
40451
40461
|
isDirectory,
|
|
40452
40462
|
isExperimentalBackendsEnabled,
|
|
40453
40463
|
isExperimentalBackendsWithoutIntrospectionEnabled,
|
|
40464
|
+
isExperimentalService,
|
|
40465
|
+
isExperimentalServiceV2,
|
|
40454
40466
|
isExternalSymlink,
|
|
40455
40467
|
isExternalSymlinkTarget,
|
|
40456
40468
|
isNodeBackendFramework,
|
package/dist/types.d.ts
CHANGED
|
@@ -513,7 +513,8 @@ export interface ServiceRefEnvVar {
|
|
|
513
513
|
}
|
|
514
514
|
export type EnvVar = ServiceRefEnvVar;
|
|
515
515
|
export type EnvVars = Record<string, EnvVar>;
|
|
516
|
-
export interface
|
|
516
|
+
export interface ExperimentalService {
|
|
517
|
+
schema: 'experimentalServices';
|
|
517
518
|
name: string;
|
|
518
519
|
type: ServiceType;
|
|
519
520
|
trigger?: JobTrigger;
|
|
@@ -534,6 +535,36 @@ export interface Service {
|
|
|
534
535
|
topics?: ServiceTopics;
|
|
535
536
|
env?: EnvVars;
|
|
536
537
|
}
|
|
538
|
+
export interface ExperimentalServiceV2 {
|
|
539
|
+
schema: 'experimentalServicesV2';
|
|
540
|
+
name: string;
|
|
541
|
+
/** Path to the service root, relative to the project root. */
|
|
542
|
+
root: string;
|
|
543
|
+
framework?: string;
|
|
544
|
+
runtime?: string;
|
|
545
|
+
/** Resolved entrypoint, relative to the service root. */
|
|
546
|
+
entrypoint?: string;
|
|
547
|
+
/** Builder selected by the resolver. */
|
|
548
|
+
builder: Builder;
|
|
549
|
+
installCommand?: string;
|
|
550
|
+
buildCommand?: string;
|
|
551
|
+
devCommand?: string;
|
|
552
|
+
ignoreCommand?: string;
|
|
553
|
+
outputDirectory?: string;
|
|
554
|
+
/** Caller-side bindings to other services. */
|
|
555
|
+
bindings?: ExperimentalServiceV2Binding[];
|
|
556
|
+
/** Function configuration scoped to this service. */
|
|
557
|
+
functions?: BuilderFunctions;
|
|
558
|
+
headers?: Header[];
|
|
559
|
+
redirects?: Redirect[];
|
|
560
|
+
rewrites?: Rewrite[];
|
|
561
|
+
routes?: Route[];
|
|
562
|
+
cleanUrls?: boolean;
|
|
563
|
+
trailingSlash?: boolean;
|
|
564
|
+
}
|
|
565
|
+
export type Service = ExperimentalService | ExperimentalServiceV2;
|
|
566
|
+
export declare function isExperimentalService(service: Service): service is ExperimentalService;
|
|
567
|
+
export declare function isExperimentalServiceV2(service: Service): service is ExperimentalServiceV2;
|
|
537
568
|
export declare function getServiceQueueTopicConfigs(config: {
|
|
538
569
|
type?: ServiceType;
|
|
539
570
|
topics?: ServiceTopics;
|
package/dist/types.js
CHANGED
|
@@ -25,6 +25,8 @@ __export(types_exports, {
|
|
|
25
25
|
getReportedServiceType: () => getReportedServiceType,
|
|
26
26
|
getServiceQueueTopicConfigs: () => getServiceQueueTopicConfigs,
|
|
27
27
|
getServiceQueueTopics: () => getServiceQueueTopics,
|
|
28
|
+
isExperimentalService: () => isExperimentalService,
|
|
29
|
+
isExperimentalServiceV2: () => isExperimentalServiceV2,
|
|
28
30
|
isQueueBackedService: () => isQueueBackedService,
|
|
29
31
|
isQueueTriggeredService: () => isQueueTriggeredService,
|
|
30
32
|
isScheduleTriggeredService: () => isScheduleTriggeredService,
|
|
@@ -56,6 +58,12 @@ class NodeVersion extends Version {
|
|
|
56
58
|
class BunVersion extends Version {
|
|
57
59
|
}
|
|
58
60
|
const JOB_TRIGGERS = ["queue", "schedule", "workflow"];
|
|
61
|
+
function isExperimentalService(service) {
|
|
62
|
+
return service.schema === "experimentalServices";
|
|
63
|
+
}
|
|
64
|
+
function isExperimentalServiceV2(service) {
|
|
65
|
+
return service.schema === "experimentalServicesV2";
|
|
66
|
+
}
|
|
59
67
|
function getServiceQueueTopicConfigs(config) {
|
|
60
68
|
if (Array.isArray(config.topics) && config.topics.length > 0) {
|
|
61
69
|
return typeof config.topics[0] === "string" ? config.topics.map((topic) => ({ topic })) : config.topics;
|
|
@@ -106,6 +114,8 @@ function getReportedServiceType(service) {
|
|
|
106
114
|
getReportedServiceType,
|
|
107
115
|
getServiceQueueTopicConfigs,
|
|
108
116
|
getServiceQueueTopics,
|
|
117
|
+
isExperimentalService,
|
|
118
|
+
isExperimentalServiceV2,
|
|
109
119
|
isQueueBackedService,
|
|
110
120
|
isQueueTriggeredService,
|
|
111
121
|
isScheduleTriggeredService,
|