@wvb/config 0.0.0 → 0.1.0-next.4513cab

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 CHANGED
@@ -1 +1,9 @@
1
1
  # Changelog
2
+
3
+ ## config v0.1.0-next.4513cab
4
+
5
+ This release includes packages: [`@wvb/config`](https://www.npmjs.com/package/@wvb/config/v/0.1.0-next.4513cab)
6
+
7
+ - feat(ffi): add ffi package for Android/iOS bindings (#139) (c41b723)
8
+ - feat: redesgin cli commands, add local remote provider, oxc -> biome (#132) (af26b39)
9
+ - chore: fix xtask artifacts missing platforms (#112) (5d60ad6)
@@ -79,16 +79,20 @@ interface BaseRemoteUploader {
79
79
  upload(params: RemoteUploadParams): Promise<void>;
80
80
  }
81
81
  //#endregion
82
- //#region src/remote/remote.d.ts
82
+ //#region src/remote/config.d.ts
83
83
  interface RemoteConfig {
84
84
  /**
85
85
  * Endpoint to remote server.
86
86
  */
87
- endpoint?: string;
87
+ endpoint: string;
88
88
  /**
89
89
  * Name of the bundle to be used in remote.
90
90
  */
91
- bundleName?: string;
91
+ bundleName?: string | (() => string | Promise<string>);
92
+ /**
93
+ * Name of the bundle to be used in remote.
94
+ */
95
+ version?: string | (() => string | Promise<string>);
92
96
  uploader?: BaseRemoteUploader;
93
97
  deployer?: BaseRemoteDeployer;
94
98
  integrity?: boolean | IntegrityMakeConfig;
@@ -79,16 +79,20 @@ interface BaseRemoteUploader {
79
79
  upload(params: RemoteUploadParams): Promise<void>;
80
80
  }
81
81
  //#endregion
82
- //#region src/remote/remote.d.ts
82
+ //#region src/remote/config.d.ts
83
83
  interface RemoteConfig {
84
84
  /**
85
85
  * Endpoint to remote server.
86
86
  */
87
- endpoint?: string;
87
+ endpoint: string;
88
88
  /**
89
89
  * Name of the bundle to be used in remote.
90
90
  */
91
- bundleName?: string;
91
+ bundleName?: string | (() => string | Promise<string>);
92
+ /**
93
+ * Name of the bundle to be used in remote.
94
+ */
95
+ version?: string | (() => string | Promise<string>);
92
96
  uploader?: BaseRemoteUploader;
93
97
  deployer?: BaseRemoteDeployer;
94
98
  integrity?: boolean | IntegrityMakeConfig;
package/dist/index.cjs CHANGED
@@ -1,8 +1,7 @@
1
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  //#region src/config.ts
3
3
  function defineConfig(config) {
4
4
  return config;
5
5
  }
6
-
7
6
  //#endregion
8
- exports.defineConfig = defineConfig;
7
+ exports.defineConfig = defineConfig;
package/dist/index.d.cts CHANGED
@@ -1,14 +1,20 @@
1
- import { n as RemoteConfig } from "./index-cK1sn_xk.cjs";
1
+ import { n as RemoteConfig } from "./index-BS61KYGj.cjs";
2
2
 
3
3
  //#region src/builtin.d.ts
4
4
  type RemoteBundleMatches = string | RegExp | Array<string | RegExp> | ((info: {
5
5
  name: string;
6
6
  version: string;
7
7
  }) => boolean | Promise<boolean>);
8
+ interface BuiltinDownloadConfig {
9
+ /**
10
+ * Concurrency of the download bundles.
11
+ */
12
+ concurrency?: number;
13
+ }
8
14
  interface BuiltinConfig {
9
15
  /**
10
16
  * Directory path where to download builtin bundles from remote.
11
- * @default ".wvb/builtin"
17
+ * @default ".wvb/builtin/bundles"
12
18
  */
13
19
  outDir?: string;
14
20
  /**
@@ -24,19 +30,33 @@ interface BuiltinConfig {
24
30
  * @default true
25
31
  */
26
32
  clean?: boolean;
27
- /**
28
- * Concurrency of the download bundles.
29
- */
30
- concurrency?: number;
33
+ download?: BuiltinDownloadConfig;
31
34
  }
32
35
  //#endregion
33
- //#region src/create.d.ts
36
+ //#region src/pack.d.ts
34
37
  type IgnoreConfig = Array<string | RegExp> | ((file: string) => boolean | Promise<boolean>);
35
38
  type HeadersConfig = Record<string, HeadersInit> | Array<[string, HeadersInit]> | ((file: string) => HeadersInit | null | undefined | Promise<HeadersInit | null | undefined>);
36
39
  /**
37
- * Webview Bundle create config.
40
+ * Webview Bundle pack config.
38
41
  */
39
- interface CreateConfig {
42
+ interface PackConfig {
43
+ /**
44
+ * Path to the source directory.
45
+ *
46
+ * All files under this directory will be included in the Webview Bundle.
47
+ * Use "ignore" to exclude files you don't want to pack.
48
+ */
49
+ srcDir?: string;
50
+ /**
51
+ * Directory that out-file should be created.
52
+ * @default ".wvb"
53
+ */
54
+ outDir?: string;
55
+ /**
56
+ * Outfile name to create Webview Bundle archive.
57
+ * If not provided, default to name field in "package.json" with normalized.
58
+ */
59
+ outFile?: string;
40
60
  /**
41
61
  * Overwrite out-file if file is already exists
42
62
  * @default true
@@ -60,25 +80,6 @@ interface CreateConfig {
60
80
  headers?: HeadersConfig;
61
81
  }
62
82
  //#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
83
  //#region src/serve.d.ts
83
84
  interface ServeConfig {
84
85
  /**
@@ -115,28 +116,10 @@ interface Config {
115
116
  * @default process.cwd()
116
117
  */
117
118
  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;
119
+ pack?: PackConfig;
137
120
  remote?: RemoteConfig;
138
121
  serve?: ServeConfig;
139
122
  builtin?: BuiltinConfig;
140
123
  }
141
124
  //#endregion
142
- export { type BuiltinConfig, type Config, type ConfigInput, type ConfigInputFn, type ConfigInputFnObj, type ConfigInputFnPromise, type CreateConfig, type ExtractConfig, type HeadersConfig, type IgnoreConfig, type RemoteBundleMatches, type ServeConfig, defineConfig };
125
+ export { type BuiltinConfig, type Config, type ConfigInput, type ConfigInputFn, type ConfigInputFnObj, type ConfigInputFnPromise, type HeadersConfig, type IgnoreConfig, type PackConfig, type RemoteBundleMatches, type ServeConfig, defineConfig };
package/dist/index.d.mts CHANGED
@@ -1,14 +1,20 @@
1
- import { n as RemoteConfig } from "./index-Da62rQR9.mjs";
1
+ import { n as RemoteConfig } from "./index-BS61KYGj.mjs";
2
2
 
3
3
  //#region src/builtin.d.ts
4
4
  type RemoteBundleMatches = string | RegExp | Array<string | RegExp> | ((info: {
5
5
  name: string;
6
6
  version: string;
7
7
  }) => boolean | Promise<boolean>);
8
+ interface BuiltinDownloadConfig {
9
+ /**
10
+ * Concurrency of the download bundles.
11
+ */
12
+ concurrency?: number;
13
+ }
8
14
  interface BuiltinConfig {
9
15
  /**
10
16
  * Directory path where to download builtin bundles from remote.
11
- * @default ".wvb/builtin"
17
+ * @default ".wvb/builtin/bundles"
12
18
  */
13
19
  outDir?: string;
14
20
  /**
@@ -24,19 +30,33 @@ interface BuiltinConfig {
24
30
  * @default true
25
31
  */
26
32
  clean?: boolean;
27
- /**
28
- * Concurrency of the download bundles.
29
- */
30
- concurrency?: number;
33
+ download?: BuiltinDownloadConfig;
31
34
  }
32
35
  //#endregion
33
- //#region src/create.d.ts
36
+ //#region src/pack.d.ts
34
37
  type IgnoreConfig = Array<string | RegExp> | ((file: string) => boolean | Promise<boolean>);
35
38
  type HeadersConfig = Record<string, HeadersInit> | Array<[string, HeadersInit]> | ((file: string) => HeadersInit | null | undefined | Promise<HeadersInit | null | undefined>);
36
39
  /**
37
- * Webview Bundle create config.
40
+ * Webview Bundle pack config.
38
41
  */
39
- interface CreateConfig {
42
+ interface PackConfig {
43
+ /**
44
+ * Path to the source directory.
45
+ *
46
+ * All files under this directory will be included in the Webview Bundle.
47
+ * Use "ignore" to exclude files you don't want to pack.
48
+ */
49
+ srcDir?: string;
50
+ /**
51
+ * Directory that out-file should be created.
52
+ * @default ".wvb"
53
+ */
54
+ outDir?: string;
55
+ /**
56
+ * Outfile name to create Webview Bundle archive.
57
+ * If not provided, default to name field in "package.json" with normalized.
58
+ */
59
+ outFile?: string;
40
60
  /**
41
61
  * Overwrite out-file if file is already exists
42
62
  * @default true
@@ -60,25 +80,6 @@ interface CreateConfig {
60
80
  headers?: HeadersConfig;
61
81
  }
62
82
  //#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
83
  //#region src/serve.d.ts
83
84
  interface ServeConfig {
84
85
  /**
@@ -115,28 +116,10 @@ interface Config {
115
116
  * @default process.cwd()
116
117
  */
117
118
  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;
119
+ pack?: PackConfig;
137
120
  remote?: RemoteConfig;
138
121
  serve?: ServeConfig;
139
122
  builtin?: BuiltinConfig;
140
123
  }
141
124
  //#endregion
142
- export { type BuiltinConfig, type Config, type ConfigInput, type ConfigInputFn, type ConfigInputFnObj, type ConfigInputFnPromise, type CreateConfig, type ExtractConfig, type HeadersConfig, type IgnoreConfig, type RemoteBundleMatches, type ServeConfig, defineConfig };
125
+ export { type BuiltinConfig, type Config, type ConfigInput, type ConfigInputFn, type ConfigInputFnObj, type ConfigInputFnPromise, type HeadersConfig, type IgnoreConfig, type PackConfig, type RemoteBundleMatches, type ServeConfig, defineConfig };
package/dist/index.mjs CHANGED
@@ -2,6 +2,5 @@
2
2
  function defineConfig(config) {
3
3
  return config;
4
4
  }
5
-
6
5
  //#endregion
7
- export { defineConfig };
6
+ export { defineConfig };
@@ -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;
@@ -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-cK1sn_xk.cjs";
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-BS61KYGj.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 };
@@ -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-Da62rQR9.mjs";
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-BS61KYGj.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 };
@@ -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.0",
3
+ "version": "0.1.0-next.4513cab",
4
4
  "description": "Configuration for webview bundle",
5
5
  "homepage": "https://github.com/webview-bundle/webview-bundle",
6
6
  "bugs": {
@@ -42,9 +42,9 @@
42
42
  "typecheck": "tsc --noEmit"
43
43
  },
44
44
  "devDependencies": {
45
- "@types/node": "22.19.3",
46
- "tsdown": "0.20.1",
47
- "typescript": "5.9.3",
48
- "vitest": "4.0.15"
45
+ "@types/node": "25.9.1",
46
+ "tsdown": "0.22.1",
47
+ "typescript": "6.0.3",
48
+ "vitest": "4.1.8"
49
49
  }
50
50
  }