@azure/arm-signalr 6.0.0-beta.1 → 6.0.0-beta.2
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 +89 -46
- package/dist/index.js +151 -144
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist-esm/samples-dev/operationsListSample.js +4 -9
- package/dist-esm/samples-dev/operationsListSample.js.map +1 -1
- package/dist-esm/samples-dev/signalRCheckNameAvailabilitySample.js +1 -1
- package/dist-esm/samples-dev/signalRCreateOrUpdateSample.js +1 -1
- package/dist-esm/samples-dev/signalRCustomCertificatesCreateOrUpdateSample.js +1 -1
- package/dist-esm/samples-dev/signalRCustomCertificatesDeleteSample.js +1 -1
- package/dist-esm/samples-dev/signalRCustomCertificatesGetSample.js +1 -1
- package/dist-esm/samples-dev/signalRCustomCertificatesListSample.js +4 -9
- package/dist-esm/samples-dev/signalRCustomCertificatesListSample.js.map +1 -1
- package/dist-esm/samples-dev/signalRCustomDomainsCreateOrUpdateSample.js +1 -1
- package/dist-esm/samples-dev/signalRCustomDomainsDeleteSample.js +1 -1
- package/dist-esm/samples-dev/signalRCustomDomainsGetSample.js +1 -1
- package/dist-esm/samples-dev/signalRCustomDomainsListSample.js +4 -9
- package/dist-esm/samples-dev/signalRCustomDomainsListSample.js.map +1 -1
- package/dist-esm/samples-dev/signalRDeleteSample.js +1 -1
- package/dist-esm/samples-dev/signalRGetSample.js +1 -1
- package/dist-esm/samples-dev/signalRListByResourceGroupSample.js +4 -9
- package/dist-esm/samples-dev/signalRListByResourceGroupSample.js.map +1 -1
- package/dist-esm/samples-dev/signalRListBySubscriptionSample.js +4 -9
- package/dist-esm/samples-dev/signalRListBySubscriptionSample.js.map +1 -1
- package/dist-esm/samples-dev/signalRListKeysSample.js +1 -1
- package/dist-esm/samples-dev/signalRListReplicaSkusSample.js +1 -1
- package/dist-esm/samples-dev/signalRListSkusSample.js +1 -1
- package/dist-esm/samples-dev/signalRPrivateEndpointConnectionsDeleteSample.js +1 -1
- package/dist-esm/samples-dev/signalRPrivateEndpointConnectionsGetSample.js +1 -1
- package/dist-esm/samples-dev/signalRPrivateEndpointConnectionsListSample.js +4 -9
- package/dist-esm/samples-dev/signalRPrivateEndpointConnectionsListSample.js.map +1 -1
- package/dist-esm/samples-dev/signalRPrivateEndpointConnectionsUpdateSample.js +1 -1
- package/dist-esm/samples-dev/signalRPrivateLinkResourcesListSample.js +4 -9
- package/dist-esm/samples-dev/signalRPrivateLinkResourcesListSample.js.map +1 -1
- package/dist-esm/samples-dev/signalRRegenerateKeySample.js +1 -1
- package/dist-esm/samples-dev/signalRReplicasCreateOrUpdateSample.js +2 -1
- package/dist-esm/samples-dev/signalRReplicasCreateOrUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/signalRReplicasDeleteSample.js +1 -1
- package/dist-esm/samples-dev/signalRReplicasGetSample.js +1 -1
- package/dist-esm/samples-dev/signalRReplicasListSample.js +4 -9
- package/dist-esm/samples-dev/signalRReplicasListSample.js.map +1 -1
- package/dist-esm/samples-dev/signalRReplicasRestartSample.js +1 -1
- package/dist-esm/samples-dev/signalRReplicasUpdateSample.js +2 -1
- package/dist-esm/samples-dev/signalRReplicasUpdateSample.js.map +1 -1
- package/dist-esm/samples-dev/signalRRestartSample.js +1 -1
- package/dist-esm/samples-dev/signalRSharedPrivateLinkResourcesCreateOrUpdateSample.js +1 -1
- package/dist-esm/samples-dev/signalRSharedPrivateLinkResourcesDeleteSample.js +1 -1
- package/dist-esm/samples-dev/signalRSharedPrivateLinkResourcesGetSample.js +1 -1
- package/dist-esm/samples-dev/signalRSharedPrivateLinkResourcesListSample.js +4 -9
- package/dist-esm/samples-dev/signalRSharedPrivateLinkResourcesListSample.js.map +1 -1
- package/dist-esm/samples-dev/signalRUpdateSample.js +1 -1
- package/dist-esm/samples-dev/usagesListSample.js +4 -9
- package/dist-esm/samples-dev/usagesListSample.js.map +1 -1
- package/dist-esm/src/models/index.d.ts +32 -0
- package/dist-esm/src/models/index.d.ts.map +1 -1
- package/dist-esm/src/models/index.js.map +1 -1
- package/dist-esm/src/models/mappers.d.ts +1 -0
- package/dist-esm/src/models/mappers.d.ts.map +1 -1
- package/dist-esm/src/models/mappers.js +59 -0
- package/dist-esm/src/models/mappers.js.map +1 -1
- package/dist-esm/src/models/parameters.js +1 -1
- package/dist-esm/src/operations/operations.js +3 -8
- package/dist-esm/src/operations/operations.js.map +1 -1
- package/dist-esm/src/operations/signalR.js +6 -16
- package/dist-esm/src/operations/signalR.js.map +1 -1
- package/dist-esm/src/operations/signalRCustomCertificates.js +3 -8
- package/dist-esm/src/operations/signalRCustomCertificates.js.map +1 -1
- package/dist-esm/src/operations/signalRCustomDomains.js +3 -8
- package/dist-esm/src/operations/signalRCustomDomains.js.map +1 -1
- package/dist-esm/src/operations/signalRPrivateEndpointConnections.js +3 -8
- package/dist-esm/src/operations/signalRPrivateEndpointConnections.js.map +1 -1
- package/dist-esm/src/operations/signalRPrivateLinkResources.js +3 -8
- package/dist-esm/src/operations/signalRPrivateLinkResources.js.map +1 -1
- package/dist-esm/src/operations/signalRReplicas.js +3 -8
- package/dist-esm/src/operations/signalRReplicas.js.map +1 -1
- package/dist-esm/src/operations/signalRSharedPrivateLinkResources.js +3 -8
- package/dist-esm/src/operations/signalRSharedPrivateLinkResources.js.map +1 -1
- package/dist-esm/src/operations/usages.js +3 -8
- package/dist-esm/src/operations/usages.js.map +1 -1
- package/dist-esm/src/signalRManagementClient.js +2 -2
- package/dist-esm/test/signalr_examples.spec.js +7 -17
- package/dist-esm/test/signalr_examples.spec.js.map +1 -1
- package/package.json +10 -17
- package/review/arm-signalr.api.md +11 -0
- package/src/models/index.ts +33 -0
- package/src/models/mappers.ts +64 -0
- package/src/models/parameters.ts +1 -1
- package/src/signalRManagementClient.ts +2 -2
- package/types/arm-signalr.d.ts +33 -0
- package/types/tsdoc-metadata.json +1 -1
- package/rollup.config.js +0 -122
package/src/models/index.ts
CHANGED
|
@@ -469,6 +469,8 @@ export interface SignalRNetworkACLs {
|
|
|
469
469
|
publicNetwork?: NetworkACL;
|
|
470
470
|
/** ACLs for requests from private endpoints */
|
|
471
471
|
privateEndpoints?: PrivateEndpointACL[];
|
|
472
|
+
/** IP rules for filtering public traffic */
|
|
473
|
+
ipRules?: IPRule[];
|
|
472
474
|
}
|
|
473
475
|
|
|
474
476
|
/** Network ACL */
|
|
@@ -479,6 +481,14 @@ export interface NetworkACL {
|
|
|
479
481
|
deny?: SignalRRequestType[];
|
|
480
482
|
}
|
|
481
483
|
|
|
484
|
+
/** An IP rule */
|
|
485
|
+
export interface IPRule {
|
|
486
|
+
/** An IP or CIDR or ServiceTag */
|
|
487
|
+
value?: string;
|
|
488
|
+
/** Azure Networking ACL Action. */
|
|
489
|
+
action?: ACLAction;
|
|
490
|
+
}
|
|
491
|
+
|
|
482
492
|
/** A class represent managed identities used for request and response */
|
|
483
493
|
export interface ManagedIdentity {
|
|
484
494
|
/** Represents the identity type: systemAssigned, userAssigned, None */
|
|
@@ -868,6 +878,18 @@ export interface SignalRResource extends TrackedResource {
|
|
|
868
878
|
* When set as true, connection with AuthType=aad won't work.
|
|
869
879
|
*/
|
|
870
880
|
disableAadAuth?: boolean;
|
|
881
|
+
/**
|
|
882
|
+
* Enable or disable the regional endpoint. Default to "Enabled".
|
|
883
|
+
* When it's Disabled, new connections will not be routed to this endpoint, however existing connections will not be affected.
|
|
884
|
+
* This property is replica specific. Disable the regional endpoint without replica is not allowed.
|
|
885
|
+
*/
|
|
886
|
+
regionEndpointEnabled?: string;
|
|
887
|
+
/**
|
|
888
|
+
* Stop or start the resource. Default to "False".
|
|
889
|
+
* When it's true, the data plane of the resource is shutdown.
|
|
890
|
+
* When it's false, the data plane of the resource is started.
|
|
891
|
+
*/
|
|
892
|
+
resourceStopped?: string;
|
|
871
893
|
}
|
|
872
894
|
|
|
873
895
|
/** A class represent a replica resource. */
|
|
@@ -879,6 +901,17 @@ export interface Replica extends TrackedResource {
|
|
|
879
901
|
* NOTE: This property will not be serialized. It can only be populated by the server.
|
|
880
902
|
*/
|
|
881
903
|
readonly provisioningState?: ProvisioningState;
|
|
904
|
+
/**
|
|
905
|
+
* Enable or disable the regional endpoint. Default to "Enabled".
|
|
906
|
+
* When it's Disabled, new connections will not be routed to this endpoint, however existing connections will not be affected.
|
|
907
|
+
*/
|
|
908
|
+
regionEndpointEnabled?: string;
|
|
909
|
+
/**
|
|
910
|
+
* Stop or start the resource. Default to "false".
|
|
911
|
+
* When it's true, the data plane of the resource is shutdown.
|
|
912
|
+
* When it's false, the data plane of the resource is started.
|
|
913
|
+
*/
|
|
914
|
+
resourceStopped?: string;
|
|
882
915
|
}
|
|
883
916
|
|
|
884
917
|
/** Defines headers for SignalR_update operation. */
|
package/src/models/mappers.ts
CHANGED
|
@@ -1011,6 +1011,21 @@ export const SignalRNetworkACLs: coreClient.CompositeMapper = {
|
|
|
1011
1011
|
}
|
|
1012
1012
|
}
|
|
1013
1013
|
}
|
|
1014
|
+
},
|
|
1015
|
+
ipRules: {
|
|
1016
|
+
constraints: {
|
|
1017
|
+
MaxItems: 30
|
|
1018
|
+
},
|
|
1019
|
+
serializedName: "ipRules",
|
|
1020
|
+
type: {
|
|
1021
|
+
name: "Sequence",
|
|
1022
|
+
element: {
|
|
1023
|
+
type: {
|
|
1024
|
+
name: "Composite",
|
|
1025
|
+
className: "IPRule"
|
|
1026
|
+
}
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1014
1029
|
}
|
|
1015
1030
|
}
|
|
1016
1031
|
}
|
|
@@ -1047,6 +1062,27 @@ export const NetworkACL: coreClient.CompositeMapper = {
|
|
|
1047
1062
|
}
|
|
1048
1063
|
};
|
|
1049
1064
|
|
|
1065
|
+
export const IPRule: coreClient.CompositeMapper = {
|
|
1066
|
+
type: {
|
|
1067
|
+
name: "Composite",
|
|
1068
|
+
className: "IPRule",
|
|
1069
|
+
modelProperties: {
|
|
1070
|
+
value: {
|
|
1071
|
+
serializedName: "value",
|
|
1072
|
+
type: {
|
|
1073
|
+
name: "String"
|
|
1074
|
+
}
|
|
1075
|
+
},
|
|
1076
|
+
action: {
|
|
1077
|
+
serializedName: "action",
|
|
1078
|
+
type: {
|
|
1079
|
+
name: "String"
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
}
|
|
1083
|
+
}
|
|
1084
|
+
};
|
|
1085
|
+
|
|
1050
1086
|
export const ManagedIdentity: coreClient.CompositeMapper = {
|
|
1051
1087
|
type: {
|
|
1052
1088
|
name: "Composite",
|
|
@@ -1929,6 +1965,20 @@ export const SignalRResource: coreClient.CompositeMapper = {
|
|
|
1929
1965
|
type: {
|
|
1930
1966
|
name: "Boolean"
|
|
1931
1967
|
}
|
|
1968
|
+
},
|
|
1969
|
+
regionEndpointEnabled: {
|
|
1970
|
+
defaultValue: "Enabled",
|
|
1971
|
+
serializedName: "properties.regionEndpointEnabled",
|
|
1972
|
+
type: {
|
|
1973
|
+
name: "String"
|
|
1974
|
+
}
|
|
1975
|
+
},
|
|
1976
|
+
resourceStopped: {
|
|
1977
|
+
defaultValue: "false",
|
|
1978
|
+
serializedName: "properties.resourceStopped",
|
|
1979
|
+
type: {
|
|
1980
|
+
name: "String"
|
|
1981
|
+
}
|
|
1932
1982
|
}
|
|
1933
1983
|
}
|
|
1934
1984
|
}
|
|
@@ -1953,6 +2003,20 @@ export const Replica: coreClient.CompositeMapper = {
|
|
|
1953
2003
|
type: {
|
|
1954
2004
|
name: "String"
|
|
1955
2005
|
}
|
|
2006
|
+
},
|
|
2007
|
+
regionEndpointEnabled: {
|
|
2008
|
+
defaultValue: "Enabled",
|
|
2009
|
+
serializedName: "properties.regionEndpointEnabled",
|
|
2010
|
+
type: {
|
|
2011
|
+
name: "String"
|
|
2012
|
+
}
|
|
2013
|
+
},
|
|
2014
|
+
resourceStopped: {
|
|
2015
|
+
defaultValue: "false",
|
|
2016
|
+
serializedName: "properties.resourceStopped",
|
|
2017
|
+
type: {
|
|
2018
|
+
name: "String"
|
|
2019
|
+
}
|
|
1956
2020
|
}
|
|
1957
2021
|
}
|
|
1958
2022
|
}
|
package/src/models/parameters.ts
CHANGED
|
@@ -49,7 +49,7 @@ export const $host: OperationURLParameter = {
|
|
|
49
49
|
export const apiVersion: OperationQueryParameter = {
|
|
50
50
|
parameterPath: "apiVersion",
|
|
51
51
|
mapper: {
|
|
52
|
-
defaultValue: "2023-
|
|
52
|
+
defaultValue: "2023-08-01-preview",
|
|
53
53
|
isConstant: true,
|
|
54
54
|
serializedName: "api-version",
|
|
55
55
|
type: {
|
|
@@ -70,7 +70,7 @@ export class SignalRManagementClient extends coreClient.ServiceClient {
|
|
|
70
70
|
credential: credentials
|
|
71
71
|
};
|
|
72
72
|
|
|
73
|
-
const packageDetails = `azsdk-js-arm-signalr/6.0.0-beta.
|
|
73
|
+
const packageDetails = `azsdk-js-arm-signalr/6.0.0-beta.2`;
|
|
74
74
|
const userAgentPrefix =
|
|
75
75
|
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
76
76
|
? `${options.userAgentOptions.userAgentPrefix} ${packageDetails}`
|
|
@@ -123,7 +123,7 @@ export class SignalRManagementClient extends coreClient.ServiceClient {
|
|
|
123
123
|
|
|
124
124
|
// Assigning values to Constant parameters
|
|
125
125
|
this.$host = options.$host || "https://management.azure.com";
|
|
126
|
-
this.apiVersion = options.apiVersion || "2023-
|
|
126
|
+
this.apiVersion = options.apiVersion || "2023-08-01-preview";
|
|
127
127
|
this.operations = new OperationsImpl(this);
|
|
128
128
|
this.signalR = new SignalRImpl(this);
|
|
129
129
|
this.usages = new UsagesImpl(this);
|
package/types/arm-signalr.d.ts
CHANGED
|
@@ -158,6 +158,14 @@ export declare type FeatureFlags = string;
|
|
|
158
158
|
*/
|
|
159
159
|
export declare function getContinuationToken(page: unknown): string | undefined;
|
|
160
160
|
|
|
161
|
+
/** An IP rule */
|
|
162
|
+
export declare interface IPRule {
|
|
163
|
+
/** An IP or CIDR or ServiceTag */
|
|
164
|
+
value?: string;
|
|
165
|
+
/** Azure Networking ACL Action. */
|
|
166
|
+
action?: ACLAction;
|
|
167
|
+
}
|
|
168
|
+
|
|
161
169
|
/**
|
|
162
170
|
* Defines values for KeyType. \
|
|
163
171
|
* {@link KnownKeyType} can be used interchangeably with KeyType,
|
|
@@ -635,6 +643,17 @@ export declare interface Replica extends TrackedResource {
|
|
|
635
643
|
* NOTE: This property will not be serialized. It can only be populated by the server.
|
|
636
644
|
*/
|
|
637
645
|
readonly provisioningState?: ProvisioningState;
|
|
646
|
+
/**
|
|
647
|
+
* Enable or disable the regional endpoint. Default to "Enabled".
|
|
648
|
+
* When it's Disabled, new connections will not be routed to this endpoint, however existing connections will not be affected.
|
|
649
|
+
*/
|
|
650
|
+
regionEndpointEnabled?: string;
|
|
651
|
+
/**
|
|
652
|
+
* Stop or start the resource. Default to "false".
|
|
653
|
+
* When it's true, the data plane of the resource is shutdown.
|
|
654
|
+
* When it's false, the data plane of the resource is started.
|
|
655
|
+
*/
|
|
656
|
+
resourceStopped?: string;
|
|
638
657
|
}
|
|
639
658
|
|
|
640
659
|
export declare interface ReplicaList {
|
|
@@ -1306,6 +1325,8 @@ export declare interface SignalRNetworkACLs {
|
|
|
1306
1325
|
publicNetwork?: NetworkACL;
|
|
1307
1326
|
/** ACLs for requests from private endpoints */
|
|
1308
1327
|
privateEndpoints?: PrivateEndpointACL[];
|
|
1328
|
+
/** IP rules for filtering public traffic */
|
|
1329
|
+
ipRules?: IPRule[];
|
|
1309
1330
|
}
|
|
1310
1331
|
|
|
1311
1332
|
/** Interface representing a SignalRPrivateEndpointConnections. */
|
|
@@ -1686,6 +1707,18 @@ export declare interface SignalRResource extends TrackedResource {
|
|
|
1686
1707
|
* When set as true, connection with AuthType=aad won't work.
|
|
1687
1708
|
*/
|
|
1688
1709
|
disableAadAuth?: boolean;
|
|
1710
|
+
/**
|
|
1711
|
+
* Enable or disable the regional endpoint. Default to "Enabled".
|
|
1712
|
+
* When it's Disabled, new connections will not be routed to this endpoint, however existing connections will not be affected.
|
|
1713
|
+
* This property is replica specific. Disable the regional endpoint without replica is not allowed.
|
|
1714
|
+
*/
|
|
1715
|
+
regionEndpointEnabled?: string;
|
|
1716
|
+
/**
|
|
1717
|
+
* Stop or start the resource. Default to "False".
|
|
1718
|
+
* When it's true, the data plane of the resource is shutdown.
|
|
1719
|
+
* When it's false, the data plane of the resource is started.
|
|
1720
|
+
*/
|
|
1721
|
+
resourceStopped?: string;
|
|
1689
1722
|
}
|
|
1690
1723
|
|
|
1691
1724
|
/** Object that includes an array of resources and a possible link for next set. */
|
package/rollup.config.js
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Copyright (c) Microsoft Corporation.
|
|
3
|
-
* Licensed under the MIT License.
|
|
4
|
-
*
|
|
5
|
-
* Code generated by Microsoft (R) AutoRest Code Generator.
|
|
6
|
-
* Changes may cause incorrect behavior and will be lost if the code is regenerated.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import nodeResolve from "@rollup/plugin-node-resolve";
|
|
10
|
-
import cjs from "@rollup/plugin-commonjs";
|
|
11
|
-
import sourcemaps from "rollup-plugin-sourcemaps";
|
|
12
|
-
import multiEntry from "@rollup/plugin-multi-entry";
|
|
13
|
-
import json from "@rollup/plugin-json";
|
|
14
|
-
|
|
15
|
-
import nodeBuiltins from "builtin-modules";
|
|
16
|
-
|
|
17
|
-
// #region Warning Handler
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* A function that can determine whether a rollup warning should be ignored. If
|
|
21
|
-
* the function returns `true`, then the warning will not be displayed.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
function ignoreNiseSinonEval(warning) {
|
|
25
|
-
return (
|
|
26
|
-
warning.code === "EVAL" &&
|
|
27
|
-
warning.id &&
|
|
28
|
-
(warning.id.includes("node_modules/nise") ||
|
|
29
|
-
warning.id.includes("node_modules/sinon")) === true
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function ignoreChaiCircularDependency(warning) {
|
|
34
|
-
return (
|
|
35
|
-
warning.code === "CIRCULAR_DEPENDENCY" &&
|
|
36
|
-
warning.importer && warning.importer.includes("node_modules/chai") === true
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval];
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Construct a warning handler for the shared rollup configuration
|
|
44
|
-
* that ignores certain warnings that are not relevant to testing.
|
|
45
|
-
*/
|
|
46
|
-
function makeOnWarnForTesting() {
|
|
47
|
-
return (warning, warn) => {
|
|
48
|
-
// If every inhibitor returns false (i.e. no inhibitors), then show the warning
|
|
49
|
-
if (warningInhibitors.every((inhib) => !inhib(warning))) {
|
|
50
|
-
warn(warning);
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
// #endregion
|
|
56
|
-
|
|
57
|
-
function makeBrowserTestConfig() {
|
|
58
|
-
const config = {
|
|
59
|
-
input: {
|
|
60
|
-
include: ["dist-esm/test/**/*.spec.js"],
|
|
61
|
-
exclude: ["dist-esm/test/**/node/**"]
|
|
62
|
-
},
|
|
63
|
-
output: {
|
|
64
|
-
file: `dist-test/index.browser.js`,
|
|
65
|
-
format: "umd",
|
|
66
|
-
sourcemap: true
|
|
67
|
-
},
|
|
68
|
-
preserveSymlinks: false,
|
|
69
|
-
plugins: [
|
|
70
|
-
multiEntry({ exports: false }),
|
|
71
|
-
nodeResolve({
|
|
72
|
-
mainFields: ["module", "browser"]
|
|
73
|
-
}),
|
|
74
|
-
cjs(),
|
|
75
|
-
json(),
|
|
76
|
-
sourcemaps()
|
|
77
|
-
//viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
|
|
78
|
-
],
|
|
79
|
-
onwarn: makeOnWarnForTesting(),
|
|
80
|
-
// Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0,
|
|
81
|
-
// rollup started respecting the "sideEffects" field in package.json. Since
|
|
82
|
-
// our package.json sets "sideEffects=false", this also applies to test
|
|
83
|
-
// code, which causes all tests to be removed by tree-shaking.
|
|
84
|
-
treeshake: false
|
|
85
|
-
};
|
|
86
|
-
|
|
87
|
-
return config;
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
const defaultConfigurationOptions = {
|
|
91
|
-
disableBrowserBundle: false
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
export function makeConfig(pkg, options) {
|
|
95
|
-
options = {
|
|
96
|
-
...defaultConfigurationOptions,
|
|
97
|
-
...(options || {})
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
const baseConfig = {
|
|
101
|
-
// Use the package's module field if it has one
|
|
102
|
-
input: pkg["module"] || "dist-esm/src/index.js",
|
|
103
|
-
external: [
|
|
104
|
-
...nodeBuiltins,
|
|
105
|
-
...Object.keys(pkg.dependencies),
|
|
106
|
-
...Object.keys(pkg.devDependencies)
|
|
107
|
-
],
|
|
108
|
-
output: { file: "dist/index.js", format: "cjs", sourcemap: true },
|
|
109
|
-
preserveSymlinks: false,
|
|
110
|
-
plugins: [sourcemaps(), nodeResolve()]
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
const config = [baseConfig];
|
|
114
|
-
|
|
115
|
-
if (!options.disableBrowserBundle) {
|
|
116
|
-
config.push(makeBrowserTestConfig());
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
return config;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export default makeConfig(require("./package.json"));
|