@wvb/config 0.0.0 → 0.1.0-next.3603a22
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 +11 -0
- package/dist/index-UT0J3u_e.d.cts +740 -0
- package/dist/index-UT0J3u_e.d.mts +740 -0
- package/dist/index.cjs +2 -3
- package/dist/index.d.cts +93 -55
- package/dist/index.d.mts +93 -55
- package/dist/index.mjs +1 -2
- package/dist/remote/index.cjs +2 -4
- package/dist/remote/index.d.cts +2 -2
- package/dist/remote/index.d.mts +2 -2
- package/dist/remote/index.mjs +1 -4
- package/package.json +7 -5
- package/dist/index-Da62rQR9.d.mts +0 -108
- package/dist/index-cK1sn_xk.d.cts +0 -108
package/dist/index.cjs
CHANGED
package/dist/index.d.cts
CHANGED
|
@@ -1,42 +1,117 @@
|
|
|
1
|
-
import { n as RemoteConfig } from "./index-
|
|
1
|
+
import { C as BundleNameResolver, S as BundleInfoResolverParams, T as PackageJson, g as IntegrityMakeConfig, l as SignatureSignConfig, n as RemoteConfig, w as VersionResolver } from "./index-UT0J3u_e.cjs";
|
|
2
2
|
|
|
3
|
+
//#region ../node/index.d.ts
|
|
4
|
+
interface HttpOptions {
|
|
5
|
+
defaultHeaders?: Record<string, string>;
|
|
6
|
+
userAgent?: string;
|
|
7
|
+
timeout?: number;
|
|
8
|
+
readTimeout?: number;
|
|
9
|
+
connectTimeout?: number;
|
|
10
|
+
poolIdleTimeout?: number;
|
|
11
|
+
poolMaxIdlePerHost?: number;
|
|
12
|
+
referer?: boolean;
|
|
13
|
+
tcpNodelay?: boolean;
|
|
14
|
+
hickoryDns?: boolean;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
3
17
|
//#region src/builtin.d.ts
|
|
4
|
-
type
|
|
18
|
+
type BuiltinBundleMatches = string | RegExp | Array<string | RegExp> | ((info: {
|
|
5
19
|
name: string;
|
|
6
20
|
version: string;
|
|
7
21
|
}) => boolean | Promise<boolean>);
|
|
22
|
+
interface BuiltinDownloadConfig {
|
|
23
|
+
/**
|
|
24
|
+
* Concurrency of the download bundles.
|
|
25
|
+
*/
|
|
26
|
+
concurrency?: number;
|
|
27
|
+
http?: HttpOptions;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Install builtin bundles from a remote target.
|
|
31
|
+
*/
|
|
32
|
+
interface BuiltinRemoteTargetConfig extends Pick<RemoteConfig, "endpoint"> {
|
|
33
|
+
download?: BuiltinDownloadConfig;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Install builtin bundles from a local target.
|
|
37
|
+
*/
|
|
38
|
+
interface BuiltinLocalTargetConfig {
|
|
39
|
+
/**
|
|
40
|
+
* Workspace directory path to install builtin bundles.
|
|
41
|
+
* Glob pattern is supported.
|
|
42
|
+
*
|
|
43
|
+
* Automatically resolve the workspace directory which includes a config file inside.
|
|
44
|
+
* (e.g. wvb.config.ts)
|
|
45
|
+
*/
|
|
46
|
+
workspaces: string[] | (() => string[] | Promise<string[]>);
|
|
47
|
+
bundleName?: BundleNameResolver;
|
|
48
|
+
version?: VersionResolver;
|
|
49
|
+
integrity?: boolean | IntegrityMakeConfig;
|
|
50
|
+
signature?: SignatureSignConfig;
|
|
51
|
+
/**
|
|
52
|
+
* Whether to pack the bundle before installing.
|
|
53
|
+
* This option is used when the workspace detected.
|
|
54
|
+
* @default true
|
|
55
|
+
*/
|
|
56
|
+
packBeforeInstall?: boolean;
|
|
57
|
+
}
|
|
58
|
+
type BuiltinTarget = ({
|
|
59
|
+
type: "remote";
|
|
60
|
+
} & BuiltinRemoteTargetConfig) | ({
|
|
61
|
+
type: "local";
|
|
62
|
+
} & BuiltinLocalTargetConfig);
|
|
8
63
|
interface BuiltinConfig {
|
|
9
64
|
/**
|
|
10
|
-
* Directory path where to download builtin bundles from
|
|
11
|
-
* @default ".wvb/builtin"
|
|
65
|
+
* Directory path where to download builtin bundles from target.
|
|
66
|
+
* @default ".wvb/builtin/bundles"
|
|
12
67
|
*/
|
|
13
68
|
outDir?: string;
|
|
14
69
|
/**
|
|
15
|
-
*
|
|
70
|
+
* Target to install builtin bundles.
|
|
71
|
+
* @default { type: "remote" }
|
|
72
|
+
*/
|
|
73
|
+
target?: BuiltinTarget;
|
|
74
|
+
/**
|
|
75
|
+
* Patterns to which bundles should be included from target bundles.
|
|
16
76
|
*/
|
|
17
|
-
include?:
|
|
77
|
+
include?: BuiltinBundleMatches;
|
|
18
78
|
/**
|
|
19
|
-
* Patterns to which bundles should be excluded from
|
|
79
|
+
* Patterns to which bundles should be excluded from target bundles.
|
|
20
80
|
*/
|
|
21
|
-
exclude?:
|
|
81
|
+
exclude?: BuiltinBundleMatches;
|
|
22
82
|
/**
|
|
23
83
|
* Clean up builtin directory before the operation.
|
|
24
84
|
* @default true
|
|
25
85
|
*/
|
|
26
86
|
clean?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Concurrency of the download bundles.
|
|
29
|
-
*/
|
|
30
|
-
concurrency?: number;
|
|
31
87
|
}
|
|
32
88
|
//#endregion
|
|
33
|
-
//#region src/
|
|
89
|
+
//#region src/pack.d.ts
|
|
34
90
|
type IgnoreConfig = Array<string | RegExp> | ((file: string) => boolean | Promise<boolean>);
|
|
35
91
|
type HeadersConfig = Record<string, HeadersInit> | Array<[string, HeadersInit]> | ((file: string) => HeadersInit | null | undefined | Promise<HeadersInit | null | undefined>);
|
|
36
92
|
/**
|
|
37
|
-
* Webview Bundle
|
|
93
|
+
* Webview Bundle pack config.
|
|
38
94
|
*/
|
|
39
|
-
interface
|
|
95
|
+
interface PackConfig {
|
|
96
|
+
/**
|
|
97
|
+
* Path to the source directory.
|
|
98
|
+
*
|
|
99
|
+
* All files under this directory will be included in the Webview Bundle.
|
|
100
|
+
* Use "ignore" to exclude files you don't want to pack.
|
|
101
|
+
*
|
|
102
|
+
* @default "./dist"
|
|
103
|
+
*/
|
|
104
|
+
srcDir?: string;
|
|
105
|
+
/**
|
|
106
|
+
* Output path for the Webview Bundle archive.
|
|
107
|
+
*
|
|
108
|
+
* Resolved relative to the config root (or used as-is when absolute).
|
|
109
|
+
* The ".wvb" extension is appended automatically when omitted.
|
|
110
|
+
*
|
|
111
|
+
* If not provided, defaults to ".wvb/<name>", where `<name>` is derived from
|
|
112
|
+
* the "name" field in "package.json" (scope stripped).
|
|
113
|
+
*/
|
|
114
|
+
outFile?: string;
|
|
40
115
|
/**
|
|
41
116
|
* Overwrite out-file if file is already exists
|
|
42
117
|
* @default true
|
|
@@ -47,7 +122,7 @@ interface CreateConfig {
|
|
|
47
122
|
*/
|
|
48
123
|
ignore?: IgnoreConfig;
|
|
49
124
|
/**
|
|
50
|
-
* Headers to set for each
|
|
125
|
+
* Headers to set for each file in the Webview Bundle.
|
|
51
126
|
*
|
|
52
127
|
* @example
|
|
53
128
|
* {
|
|
@@ -60,25 +135,6 @@ interface CreateConfig {
|
|
|
60
135
|
headers?: HeadersConfig;
|
|
61
136
|
}
|
|
62
137
|
//#endregion
|
|
63
|
-
//#region src/extract.d.ts
|
|
64
|
-
interface ExtractConfig {
|
|
65
|
-
/**
|
|
66
|
-
* Webview Bundle file to use for extracting.
|
|
67
|
-
* If not provided, the file at the "outFile" path is used by default.
|
|
68
|
-
*/
|
|
69
|
-
file?: string;
|
|
70
|
-
/**
|
|
71
|
-
* Path to extract Webview Bundle files.
|
|
72
|
-
* If not provided, will use Webview Bundle file name as directory.
|
|
73
|
-
*/
|
|
74
|
-
outDir?: string;
|
|
75
|
-
/**
|
|
76
|
-
* Clean up extracted files if out directory already exists.
|
|
77
|
-
* @default false
|
|
78
|
-
*/
|
|
79
|
-
clean?: boolean;
|
|
80
|
-
}
|
|
81
|
-
//#endregion
|
|
82
138
|
//#region src/serve.d.ts
|
|
83
139
|
interface ServeConfig {
|
|
84
140
|
/**
|
|
@@ -115,28 +171,10 @@ interface Config {
|
|
|
115
171
|
* @default process.cwd()
|
|
116
172
|
*/
|
|
117
173
|
root?: string;
|
|
118
|
-
|
|
119
|
-
* Path to the source directory.
|
|
120
|
-
*
|
|
121
|
-
* All files under this directory will be included in the Webview Bundle.
|
|
122
|
-
* Use "create.ignore" to exclude files you don't want to pack.
|
|
123
|
-
*/
|
|
124
|
-
srcDir?: string;
|
|
125
|
-
/**
|
|
126
|
-
* Directory that out-file should be created.
|
|
127
|
-
* @default ".wvb"
|
|
128
|
-
*/
|
|
129
|
-
outDir?: string;
|
|
130
|
-
/**
|
|
131
|
-
* Outfile name to create Webview Bundle archive.
|
|
132
|
-
* If not provided, default to name field in "package.json" with normalized.
|
|
133
|
-
*/
|
|
134
|
-
outFile?: string;
|
|
135
|
-
create?: CreateConfig;
|
|
136
|
-
extract?: ExtractConfig;
|
|
174
|
+
pack?: PackConfig;
|
|
137
175
|
remote?: RemoteConfig;
|
|
138
176
|
serve?: ServeConfig;
|
|
139
177
|
builtin?: BuiltinConfig;
|
|
140
178
|
}
|
|
141
179
|
//#endregion
|
|
142
|
-
export { type BuiltinConfig, type Config, type ConfigInput, type ConfigInputFn, type ConfigInputFnObj, type ConfigInputFnPromise, type
|
|
180
|
+
export { type BuiltinBundleMatches, type BuiltinConfig, type BuiltinDownloadConfig, type BuiltinLocalTargetConfig, type BuiltinRemoteTargetConfig, type BuiltinTarget, type BundleInfoResolverParams, type BundleNameResolver, type Config, type ConfigInput, type ConfigInputFn, type ConfigInputFnObj, type ConfigInputFnPromise, type HeadersConfig, type IgnoreConfig, type PackConfig, type PackageJson, type ServeConfig, type VersionResolver, defineConfig };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,42 +1,117 @@
|
|
|
1
|
-
import { n as RemoteConfig } from "./index-
|
|
1
|
+
import { C as BundleNameResolver, S as BundleInfoResolverParams, T as PackageJson, g as IntegrityMakeConfig, l as SignatureSignConfig, n as RemoteConfig, w as VersionResolver } from "./index-UT0J3u_e.mjs";
|
|
2
2
|
|
|
3
|
+
//#region ../node/index.d.ts
|
|
4
|
+
interface HttpOptions {
|
|
5
|
+
defaultHeaders?: Record<string, string>;
|
|
6
|
+
userAgent?: string;
|
|
7
|
+
timeout?: number;
|
|
8
|
+
readTimeout?: number;
|
|
9
|
+
connectTimeout?: number;
|
|
10
|
+
poolIdleTimeout?: number;
|
|
11
|
+
poolMaxIdlePerHost?: number;
|
|
12
|
+
referer?: boolean;
|
|
13
|
+
tcpNodelay?: boolean;
|
|
14
|
+
hickoryDns?: boolean;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
3
17
|
//#region src/builtin.d.ts
|
|
4
|
-
type
|
|
18
|
+
type BuiltinBundleMatches = string | RegExp | Array<string | RegExp> | ((info: {
|
|
5
19
|
name: string;
|
|
6
20
|
version: string;
|
|
7
21
|
}) => boolean | Promise<boolean>);
|
|
22
|
+
interface BuiltinDownloadConfig {
|
|
23
|
+
/**
|
|
24
|
+
* Concurrency of the download bundles.
|
|
25
|
+
*/
|
|
26
|
+
concurrency?: number;
|
|
27
|
+
http?: HttpOptions;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Install builtin bundles from a remote target.
|
|
31
|
+
*/
|
|
32
|
+
interface BuiltinRemoteTargetConfig extends Pick<RemoteConfig, "endpoint"> {
|
|
33
|
+
download?: BuiltinDownloadConfig;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Install builtin bundles from a local target.
|
|
37
|
+
*/
|
|
38
|
+
interface BuiltinLocalTargetConfig {
|
|
39
|
+
/**
|
|
40
|
+
* Workspace directory path to install builtin bundles.
|
|
41
|
+
* Glob pattern is supported.
|
|
42
|
+
*
|
|
43
|
+
* Automatically resolve the workspace directory which includes a config file inside.
|
|
44
|
+
* (e.g. wvb.config.ts)
|
|
45
|
+
*/
|
|
46
|
+
workspaces: string[] | (() => string[] | Promise<string[]>);
|
|
47
|
+
bundleName?: BundleNameResolver;
|
|
48
|
+
version?: VersionResolver;
|
|
49
|
+
integrity?: boolean | IntegrityMakeConfig;
|
|
50
|
+
signature?: SignatureSignConfig;
|
|
51
|
+
/**
|
|
52
|
+
* Whether to pack the bundle before installing.
|
|
53
|
+
* This option is used when the workspace detected.
|
|
54
|
+
* @default true
|
|
55
|
+
*/
|
|
56
|
+
packBeforeInstall?: boolean;
|
|
57
|
+
}
|
|
58
|
+
type BuiltinTarget = ({
|
|
59
|
+
type: "remote";
|
|
60
|
+
} & BuiltinRemoteTargetConfig) | ({
|
|
61
|
+
type: "local";
|
|
62
|
+
} & BuiltinLocalTargetConfig);
|
|
8
63
|
interface BuiltinConfig {
|
|
9
64
|
/**
|
|
10
|
-
* Directory path where to download builtin bundles from
|
|
11
|
-
* @default ".wvb/builtin"
|
|
65
|
+
* Directory path where to download builtin bundles from target.
|
|
66
|
+
* @default ".wvb/builtin/bundles"
|
|
12
67
|
*/
|
|
13
68
|
outDir?: string;
|
|
14
69
|
/**
|
|
15
|
-
*
|
|
70
|
+
* Target to install builtin bundles.
|
|
71
|
+
* @default { type: "remote" }
|
|
72
|
+
*/
|
|
73
|
+
target?: BuiltinTarget;
|
|
74
|
+
/**
|
|
75
|
+
* Patterns to which bundles should be included from target bundles.
|
|
16
76
|
*/
|
|
17
|
-
include?:
|
|
77
|
+
include?: BuiltinBundleMatches;
|
|
18
78
|
/**
|
|
19
|
-
* Patterns to which bundles should be excluded from
|
|
79
|
+
* Patterns to which bundles should be excluded from target bundles.
|
|
20
80
|
*/
|
|
21
|
-
exclude?:
|
|
81
|
+
exclude?: BuiltinBundleMatches;
|
|
22
82
|
/**
|
|
23
83
|
* Clean up builtin directory before the operation.
|
|
24
84
|
* @default true
|
|
25
85
|
*/
|
|
26
86
|
clean?: boolean;
|
|
27
|
-
/**
|
|
28
|
-
* Concurrency of the download bundles.
|
|
29
|
-
*/
|
|
30
|
-
concurrency?: number;
|
|
31
87
|
}
|
|
32
88
|
//#endregion
|
|
33
|
-
//#region src/
|
|
89
|
+
//#region src/pack.d.ts
|
|
34
90
|
type IgnoreConfig = Array<string | RegExp> | ((file: string) => boolean | Promise<boolean>);
|
|
35
91
|
type HeadersConfig = Record<string, HeadersInit> | Array<[string, HeadersInit]> | ((file: string) => HeadersInit | null | undefined | Promise<HeadersInit | null | undefined>);
|
|
36
92
|
/**
|
|
37
|
-
* Webview Bundle
|
|
93
|
+
* Webview Bundle pack config.
|
|
38
94
|
*/
|
|
39
|
-
interface
|
|
95
|
+
interface PackConfig {
|
|
96
|
+
/**
|
|
97
|
+
* Path to the source directory.
|
|
98
|
+
*
|
|
99
|
+
* All files under this directory will be included in the Webview Bundle.
|
|
100
|
+
* Use "ignore" to exclude files you don't want to pack.
|
|
101
|
+
*
|
|
102
|
+
* @default "./dist"
|
|
103
|
+
*/
|
|
104
|
+
srcDir?: string;
|
|
105
|
+
/**
|
|
106
|
+
* Output path for the Webview Bundle archive.
|
|
107
|
+
*
|
|
108
|
+
* Resolved relative to the config root (or used as-is when absolute).
|
|
109
|
+
* The ".wvb" extension is appended automatically when omitted.
|
|
110
|
+
*
|
|
111
|
+
* If not provided, defaults to ".wvb/<name>", where `<name>` is derived from
|
|
112
|
+
* the "name" field in "package.json" (scope stripped).
|
|
113
|
+
*/
|
|
114
|
+
outFile?: string;
|
|
40
115
|
/**
|
|
41
116
|
* Overwrite out-file if file is already exists
|
|
42
117
|
* @default true
|
|
@@ -47,7 +122,7 @@ interface CreateConfig {
|
|
|
47
122
|
*/
|
|
48
123
|
ignore?: IgnoreConfig;
|
|
49
124
|
/**
|
|
50
|
-
* Headers to set for each
|
|
125
|
+
* Headers to set for each file in the Webview Bundle.
|
|
51
126
|
*
|
|
52
127
|
* @example
|
|
53
128
|
* {
|
|
@@ -60,25 +135,6 @@ interface CreateConfig {
|
|
|
60
135
|
headers?: HeadersConfig;
|
|
61
136
|
}
|
|
62
137
|
//#endregion
|
|
63
|
-
//#region src/extract.d.ts
|
|
64
|
-
interface ExtractConfig {
|
|
65
|
-
/**
|
|
66
|
-
* Webview Bundle file to use for extracting.
|
|
67
|
-
* If not provided, the file at the "outFile" path is used by default.
|
|
68
|
-
*/
|
|
69
|
-
file?: string;
|
|
70
|
-
/**
|
|
71
|
-
* Path to extract Webview Bundle files.
|
|
72
|
-
* If not provided, will use Webview Bundle file name as directory.
|
|
73
|
-
*/
|
|
74
|
-
outDir?: string;
|
|
75
|
-
/**
|
|
76
|
-
* Clean up extracted files if out directory already exists.
|
|
77
|
-
* @default false
|
|
78
|
-
*/
|
|
79
|
-
clean?: boolean;
|
|
80
|
-
}
|
|
81
|
-
//#endregion
|
|
82
138
|
//#region src/serve.d.ts
|
|
83
139
|
interface ServeConfig {
|
|
84
140
|
/**
|
|
@@ -115,28 +171,10 @@ interface Config {
|
|
|
115
171
|
* @default process.cwd()
|
|
116
172
|
*/
|
|
117
173
|
root?: string;
|
|
118
|
-
|
|
119
|
-
* Path to the source directory.
|
|
120
|
-
*
|
|
121
|
-
* All files under this directory will be included in the Webview Bundle.
|
|
122
|
-
* Use "create.ignore" to exclude files you don't want to pack.
|
|
123
|
-
*/
|
|
124
|
-
srcDir?: string;
|
|
125
|
-
/**
|
|
126
|
-
* Directory that out-file should be created.
|
|
127
|
-
* @default ".wvb"
|
|
128
|
-
*/
|
|
129
|
-
outDir?: string;
|
|
130
|
-
/**
|
|
131
|
-
* Outfile name to create Webview Bundle archive.
|
|
132
|
-
* If not provided, default to name field in "package.json" with normalized.
|
|
133
|
-
*/
|
|
134
|
-
outFile?: string;
|
|
135
|
-
create?: CreateConfig;
|
|
136
|
-
extract?: ExtractConfig;
|
|
174
|
+
pack?: PackConfig;
|
|
137
175
|
remote?: RemoteConfig;
|
|
138
176
|
serve?: ServeConfig;
|
|
139
177
|
builtin?: BuiltinConfig;
|
|
140
178
|
}
|
|
141
179
|
//#endregion
|
|
142
|
-
export { type BuiltinConfig, type Config, type ConfigInput, type ConfigInputFn, type ConfigInputFnObj, type ConfigInputFnPromise, type
|
|
180
|
+
export { type BuiltinBundleMatches, type BuiltinConfig, type BuiltinDownloadConfig, type BuiltinLocalTargetConfig, type BuiltinRemoteTargetConfig, type BuiltinTarget, type BundleInfoResolverParams, type BundleNameResolver, type Config, type ConfigInput, type ConfigInputFn, type ConfigInputFnObj, type ConfigInputFnPromise, type HeadersConfig, type IgnoreConfig, type PackConfig, type PackageJson, type ServeConfig, type VersionResolver, defineConfig };
|
package/dist/index.mjs
CHANGED
package/dist/remote/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
1
2
|
let node_buffer = require("node:buffer");
|
|
2
|
-
|
|
3
3
|
//#region src/remote/integrity.ts
|
|
4
4
|
async function makeIntegrity(maker, data) {
|
|
5
5
|
if (typeof maker === "function") return maker({ data });
|
|
@@ -14,7 +14,6 @@ function hashAlg$1(rasHash) {
|
|
|
14
14
|
case "sha512": return "SHA-512";
|
|
15
15
|
}
|
|
16
16
|
}
|
|
17
|
-
|
|
18
17
|
//#endregion
|
|
19
18
|
//#region src/remote/signature.ts
|
|
20
19
|
async function signSignature(signer, message) {
|
|
@@ -75,7 +74,6 @@ function signAlg(config) {
|
|
|
75
74
|
};
|
|
76
75
|
}
|
|
77
76
|
}
|
|
78
|
-
|
|
79
77
|
//#endregion
|
|
80
78
|
exports.makeIntegrity = makeIntegrity;
|
|
81
|
-
exports.signSignature = signSignature;
|
|
79
|
+
exports.signSignature = signSignature;
|
package/dist/remote/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as IntegrityMakeFn, a as RemoteUploadProgress, b as BaseRemoteDeployer, c as SignatureHash, d as SignatureSigner, f as SignatureSigningKeyConfig, g as IntegrityMakeConfig, h as IntegrityAlgorithm, i as RemoteUploadParams, l as SignatureSignConfig, m as signSignature, n as RemoteConfig, o as SignatureAlgorithm, p as SigningKeyFormat, r as BaseRemoteUploader, s as SignatureEcdsaCurve, t as RemoteBundleDeployment, u as SignatureSignFn, v as IntegrityMaker, x as RemoteDeployParams, y as makeIntegrity } from "../index-
|
|
2
|
-
export { BaseRemoteDeployer, BaseRemoteUploader, IntegrityAlgorithm, IntegrityMakeConfig, IntegrityMakeFn, IntegrityMaker, RemoteBundleDeployment, RemoteConfig, RemoteDeployParams, RemoteUploadParams, RemoteUploadProgress, SignatureAlgorithm, SignatureEcdsaCurve, SignatureHash, SignatureSignConfig, SignatureSignFn, SignatureSigner, SignatureSigningKeyConfig, SigningKeyFormat, makeIntegrity, signSignature };
|
|
1
|
+
import { _ as IntegrityMakeFn, a as RemoteUploadProgress, b as BaseRemoteDeployer, c as SignatureHash, d as SignatureSigner, f as SignatureSigningKeyConfig, g as IntegrityMakeConfig, h as IntegrityAlgorithm, i as RemoteUploadParams, l as SignatureSignConfig, m as signSignature, n as RemoteConfig, o as SignatureAlgorithm, p as SigningKeyFormat, r as BaseRemoteUploader, s as SignatureEcdsaCurve, t as RemoteBundleDeployment, u as SignatureSignFn, v as IntegrityMaker, x as RemoteDeployParams, y as makeIntegrity } from "../index-UT0J3u_e.cjs";
|
|
2
|
+
export { type BaseRemoteDeployer, type BaseRemoteUploader, type IntegrityAlgorithm, type IntegrityMakeConfig, type IntegrityMakeFn, type IntegrityMaker, type RemoteBundleDeployment, type RemoteConfig, type RemoteDeployParams, type RemoteUploadParams, type RemoteUploadProgress, type SignatureAlgorithm, type SignatureEcdsaCurve, type SignatureHash, type SignatureSignConfig, type SignatureSignFn, type SignatureSigner, type SignatureSigningKeyConfig, type SigningKeyFormat, makeIntegrity, signSignature };
|
package/dist/remote/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as IntegrityMakeFn, a as RemoteUploadProgress, b as BaseRemoteDeployer, c as SignatureHash, d as SignatureSigner, f as SignatureSigningKeyConfig, g as IntegrityMakeConfig, h as IntegrityAlgorithm, i as RemoteUploadParams, l as SignatureSignConfig, m as signSignature, n as RemoteConfig, o as SignatureAlgorithm, p as SigningKeyFormat, r as BaseRemoteUploader, s as SignatureEcdsaCurve, t as RemoteBundleDeployment, u as SignatureSignFn, v as IntegrityMaker, x as RemoteDeployParams, y as makeIntegrity } from "../index-
|
|
2
|
-
export { BaseRemoteDeployer, BaseRemoteUploader, IntegrityAlgorithm, IntegrityMakeConfig, IntegrityMakeFn, IntegrityMaker, RemoteBundleDeployment, RemoteConfig, RemoteDeployParams, RemoteUploadParams, RemoteUploadProgress, SignatureAlgorithm, SignatureEcdsaCurve, SignatureHash, SignatureSignConfig, SignatureSignFn, SignatureSigner, SignatureSigningKeyConfig, SigningKeyFormat, makeIntegrity, signSignature };
|
|
1
|
+
import { _ as IntegrityMakeFn, a as RemoteUploadProgress, b as BaseRemoteDeployer, c as SignatureHash, d as SignatureSigner, f as SignatureSigningKeyConfig, g as IntegrityMakeConfig, h as IntegrityAlgorithm, i as RemoteUploadParams, l as SignatureSignConfig, m as signSignature, n as RemoteConfig, o as SignatureAlgorithm, p as SigningKeyFormat, r as BaseRemoteUploader, s as SignatureEcdsaCurve, t as RemoteBundleDeployment, u as SignatureSignFn, v as IntegrityMaker, x as RemoteDeployParams, y as makeIntegrity } from "../index-UT0J3u_e.mjs";
|
|
2
|
+
export { type BaseRemoteDeployer, type BaseRemoteUploader, type IntegrityAlgorithm, type IntegrityMakeConfig, type IntegrityMakeFn, type IntegrityMaker, type RemoteBundleDeployment, type RemoteConfig, type RemoteDeployParams, type RemoteUploadParams, type RemoteUploadProgress, type SignatureAlgorithm, type SignatureEcdsaCurve, type SignatureHash, type SignatureSignConfig, type SignatureSignFn, type SignatureSigner, type SignatureSigningKeyConfig, type SigningKeyFormat, makeIntegrity, signSignature };
|
package/dist/remote/index.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { Buffer } from "node:buffer";
|
|
2
|
-
|
|
3
2
|
//#region src/remote/integrity.ts
|
|
4
3
|
async function makeIntegrity(maker, data) {
|
|
5
4
|
if (typeof maker === "function") return maker({ data });
|
|
@@ -14,7 +13,6 @@ function hashAlg$1(rasHash) {
|
|
|
14
13
|
case "sha512": return "SHA-512";
|
|
15
14
|
}
|
|
16
15
|
}
|
|
17
|
-
|
|
18
16
|
//#endregion
|
|
19
17
|
//#region src/remote/signature.ts
|
|
20
18
|
async function signSignature(signer, message) {
|
|
@@ -75,6 +73,5 @@ function signAlg(config) {
|
|
|
75
73
|
};
|
|
76
74
|
}
|
|
77
75
|
}
|
|
78
|
-
|
|
79
76
|
//#endregion
|
|
80
|
-
export { makeIntegrity, signSignature };
|
|
77
|
+
export { makeIntegrity, signSignature };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wvb/config",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.1.0-next.3603a22",
|
|
4
4
|
"description": "Configuration for webview bundle",
|
|
5
5
|
"homepage": "https://github.com/webview-bundle/webview-bundle",
|
|
6
6
|
"bugs": {
|
|
@@ -42,9 +42,11 @@
|
|
|
42
42
|
"typecheck": "tsc --noEmit"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@types/node": "
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
45
|
+
"@types/node": "25.9.1",
|
|
46
|
+
"@wvb/node": "^0.1.0-next.3603a22",
|
|
47
|
+
"tsdown": "0.22.1",
|
|
48
|
+
"type-fest": "^4.40.1",
|
|
49
|
+
"typescript": "6.0.3",
|
|
50
|
+
"vitest": "4.1.8"
|
|
49
51
|
}
|
|
50
52
|
}
|
|
@@ -1,108 +0,0 @@
|
|
|
1
|
-
import { Buffer } from "node:buffer";
|
|
2
|
-
|
|
3
|
-
//#region src/remote/deployer.d.ts
|
|
4
|
-
interface RemoteDeployParams {
|
|
5
|
-
bundleName: string;
|
|
6
|
-
version: string;
|
|
7
|
-
channel?: string;
|
|
8
|
-
}
|
|
9
|
-
interface BaseRemoteDeployer {
|
|
10
|
-
deploy(params: RemoteDeployParams): Promise<void>;
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/remote/integrity.d.ts
|
|
14
|
-
type IntegrityAlgorithm = "sha256" | "sha384" | "sha512";
|
|
15
|
-
interface IntegrityMakeConfig {
|
|
16
|
-
algorithm?: IntegrityAlgorithm;
|
|
17
|
-
}
|
|
18
|
-
type IntegrityMakeFn = (params: {
|
|
19
|
-
data: Buffer;
|
|
20
|
-
}) => Promise<string>;
|
|
21
|
-
type IntegrityMaker = IntegrityMakeConfig | IntegrityMakeFn;
|
|
22
|
-
declare function makeIntegrity(maker: IntegrityMaker, data: Buffer): Promise<string>;
|
|
23
|
-
//#endregion
|
|
24
|
-
//#region src/remote/signature.d.ts
|
|
25
|
-
type SignatureAlgorithm = "ecdsa" | "ed25519" | "rsa-pkcs1-v1.5" | "rsa-pss";
|
|
26
|
-
type SignatureEcdsaCurve = "p256" | "p384";
|
|
27
|
-
type SignatureHash = "sha256" | "sha384" | "sha512";
|
|
28
|
-
type SigningKeyFormat = "raw" | "pkcs8" | "spki" | "jwk";
|
|
29
|
-
type SignatureSigningKeyConfig = {
|
|
30
|
-
format: "jwk";
|
|
31
|
-
data: JsonWebKey;
|
|
32
|
-
} | {
|
|
33
|
-
format: Exclude<SigningKeyFormat, "jwk">;
|
|
34
|
-
data: Buffer;
|
|
35
|
-
};
|
|
36
|
-
type SignatureSignConfig = {
|
|
37
|
-
algorithm: "ecdsa";
|
|
38
|
-
curve: SignatureEcdsaCurve;
|
|
39
|
-
hash: SignatureHash;
|
|
40
|
-
key: SignatureSigningKeyConfig;
|
|
41
|
-
} | {
|
|
42
|
-
algorithm: "rsa-pkcs1-v1.5";
|
|
43
|
-
hash: SignatureHash;
|
|
44
|
-
key: SignatureSigningKeyConfig;
|
|
45
|
-
} | {
|
|
46
|
-
algorithm: "rsa-pss";
|
|
47
|
-
hash: SignatureHash;
|
|
48
|
-
saltLength?: number;
|
|
49
|
-
key: SignatureSigningKeyConfig;
|
|
50
|
-
} | {
|
|
51
|
-
algorithm: Exclude<SignatureAlgorithm, "ecdsa" | "rsa-pkcs1-v1.5" | "rsa-pss">;
|
|
52
|
-
key: SignatureSigningKeyConfig;
|
|
53
|
-
};
|
|
54
|
-
type SignatureSignFn = (params: {
|
|
55
|
-
message: Buffer;
|
|
56
|
-
}) => Promise<string>;
|
|
57
|
-
type SignatureSigner = SignatureSignConfig | SignatureSignFn;
|
|
58
|
-
declare function signSignature(signer: SignatureSigner, message: Buffer): Promise<string>;
|
|
59
|
-
//#endregion
|
|
60
|
-
//#region src/remote/uploader.d.ts
|
|
61
|
-
interface RemoteUploadParams {
|
|
62
|
-
bundle: Buffer;
|
|
63
|
-
bundleName: string;
|
|
64
|
-
version: string;
|
|
65
|
-
force?: boolean;
|
|
66
|
-
integrity?: string;
|
|
67
|
-
signature?: string;
|
|
68
|
-
}
|
|
69
|
-
interface RemoteUploadProgress {
|
|
70
|
-
/** Number of bytes successfully transferred so far */
|
|
71
|
-
loaded?: number;
|
|
72
|
-
/** Total payload size in byres */
|
|
73
|
-
total?: number;
|
|
74
|
-
/** 1-based multipart part index currently being uploaded */
|
|
75
|
-
part?: number;
|
|
76
|
-
}
|
|
77
|
-
interface BaseRemoteUploader {
|
|
78
|
-
_onUploadProgress?: (progress: RemoteUploadProgress) => void;
|
|
79
|
-
upload(params: RemoteUploadParams): Promise<void>;
|
|
80
|
-
}
|
|
81
|
-
//#endregion
|
|
82
|
-
//#region src/remote/remote.d.ts
|
|
83
|
-
interface RemoteConfig {
|
|
84
|
-
/**
|
|
85
|
-
* Endpoint to remote server.
|
|
86
|
-
*/
|
|
87
|
-
endpoint?: string;
|
|
88
|
-
/**
|
|
89
|
-
* Name of the bundle to be used in remote.
|
|
90
|
-
*/
|
|
91
|
-
bundleName?: string;
|
|
92
|
-
uploader?: BaseRemoteUploader;
|
|
93
|
-
deployer?: BaseRemoteDeployer;
|
|
94
|
-
integrity?: boolean | IntegrityMakeConfig;
|
|
95
|
-
signature?: SignatureSignConfig;
|
|
96
|
-
}
|
|
97
|
-
//#endregion
|
|
98
|
-
//#region src/remote/types.d.ts
|
|
99
|
-
interface RemoteBundleDeployment {
|
|
100
|
-
/** The name of the bundle */
|
|
101
|
-
name: string;
|
|
102
|
-
/** Current deployed version of the bundle */
|
|
103
|
-
version?: string;
|
|
104
|
-
/** Versions deployed in each channel */
|
|
105
|
-
channels?: Record<string, string>;
|
|
106
|
-
}
|
|
107
|
-
//#endregion
|
|
108
|
-
export { IntegrityMakeFn as _, RemoteUploadProgress as a, BaseRemoteDeployer as b, SignatureHash as c, SignatureSigner as d, SignatureSigningKeyConfig as f, IntegrityMakeConfig as g, IntegrityAlgorithm as h, RemoteUploadParams as i, SignatureSignConfig as l, signSignature as m, RemoteConfig as n, SignatureAlgorithm as o, SigningKeyFormat as p, BaseRemoteUploader as r, SignatureEcdsaCurve as s, RemoteBundleDeployment as t, SignatureSignFn as u, IntegrityMaker as v, RemoteDeployParams as x, makeIntegrity as y };
|