@wvb/remote-local 0.0.0-next.9a8f99e → 0.0.0-next.e459de3

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,9 +1,10 @@
1
1
  # Changelog
2
2
 
3
- ## local v0.0.0-next.9a8f99e
3
+ ## local v0.0.0-next.e459de3
4
4
 
5
- This release includes packages: [`@wvb/remote-local`](https://www.npmjs.com/package/@wvb/remote-local/v/0.0.0-next.9a8f99e)
5
+ This release includes packages: [`@wvb/remote-local`](https://www.npmjs.com/package/@wvb/remote-local/v/0.0.0-next.e459de3)
6
6
 
7
+ - fix(remote-local): add missing `content-length` header (#162) (0c184ac)
7
8
  - feat(ffi): add ffi package for Android/iOS bindings (#139) (c41b723)
8
9
  - feat: redesgin cli commands, add local remote provider, oxc -> biome (#132) (af26b39)
9
- - update dependencies: @wvb/config@0.1.0-next.9a8f99e
10
+ - update dependencies: @wvb/config@0.1.0-next.e459de3
@@ -1,11 +1,12 @@
1
- const require_api = require('../api-oBJy5sKt.cjs');
2
-
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_api = require("../api-BAHtiZKk.cjs");
3
3
  exports.BundleMetadataFileSchema = require_api.BundleMetadataFileSchema;
4
4
  exports.DeploymentFileSchema = require_api.DeploymentFileSchema;
5
+ exports.getBundleFileSize = require_api.getBundleFileSize;
5
6
  exports.readAllDeployments = require_api.readAllDeployments;
6
7
  exports.readBundleMetadata = require_api.readBundleMetadata;
7
8
  exports.readBundleStream = require_api.readBundleStream;
8
9
  exports.readDeployment = require_api.readDeployment;
9
10
  exports.writeBundle = require_api.writeBundle;
10
11
  exports.writeBundleMetadata = require_api.writeBundleMetadata;
11
- exports.writeDeployment = require_api.writeDeployment;
12
+ exports.writeDeployment = require_api.writeDeployment;
@@ -13,6 +13,11 @@ declare function readBundleStream({
13
13
  bundle,
14
14
  version
15
15
  }: ReadBundleStreamParams): ReadStream;
16
+ declare function getBundleFileSize({
17
+ baseDir,
18
+ bundle,
19
+ version
20
+ }: ReadBundleStreamParams): Promise<number>;
16
21
  interface WriteBundleParams {
17
22
  baseDir: string;
18
23
  bundle: string;
@@ -87,4 +92,4 @@ declare function writeDeployment({
87
92
  channel
88
93
  }: WriteDeploymentParams): Promise<void>;
89
94
  //#endregion
90
- export { type BundleMetadataFile, BundleMetadataFileSchema, type DeploymentFile, DeploymentFileSchema, readAllDeployments, readBundleMetadata, readBundleStream, readDeployment, writeBundle, writeBundleMetadata, writeDeployment };
95
+ export { type BundleMetadataFile, BundleMetadataFileSchema, type DeploymentFile, DeploymentFileSchema, getBundleFileSize, readAllDeployments, readBundleMetadata, readBundleStream, readDeployment, writeBundle, writeBundleMetadata, writeDeployment };
@@ -13,6 +13,11 @@ declare function readBundleStream({
13
13
  bundle,
14
14
  version
15
15
  }: ReadBundleStreamParams): ReadStream;
16
+ declare function getBundleFileSize({
17
+ baseDir,
18
+ bundle,
19
+ version
20
+ }: ReadBundleStreamParams): Promise<number>;
16
21
  interface WriteBundleParams {
17
22
  baseDir: string;
18
23
  bundle: string;
@@ -87,4 +92,4 @@ declare function writeDeployment({
87
92
  channel
88
93
  }: WriteDeploymentParams): Promise<void>;
89
94
  //#endregion
90
- export { type BundleMetadataFile, BundleMetadataFileSchema, type DeploymentFile, DeploymentFileSchema, readAllDeployments, readBundleMetadata, readBundleStream, readDeployment, writeBundle, writeBundleMetadata, writeDeployment };
95
+ export { type BundleMetadataFile, BundleMetadataFileSchema, type DeploymentFile, DeploymentFileSchema, getBundleFileSize, readAllDeployments, readBundleMetadata, readBundleStream, readDeployment, writeBundle, writeBundleMetadata, writeDeployment };
@@ -1,3 +1,2 @@
1
- import { a as BundleMetadataFileSchema, c as writeBundle, i as writeDeployment, l as writeBundleMetadata, n as readAllDeployments, o as readBundleMetadata, r as readDeployment, s as readBundleStream, t as DeploymentFileSchema } from "../api-8MXKpsHj.mjs";
2
-
3
- export { BundleMetadataFileSchema, DeploymentFileSchema, readAllDeployments, readBundleMetadata, readBundleStream, readDeployment, writeBundle, writeBundleMetadata, writeDeployment };
1
+ import { a as BundleMetadataFileSchema, c as readBundleStream, i as writeDeployment, l as writeBundle, n as readAllDeployments, o as getBundleFileSize, r as readDeployment, s as readBundleMetadata, t as DeploymentFileSchema, u as writeBundleMetadata } from "../api-CHVFBPei.mjs";
2
+ export { BundleMetadataFileSchema, DeploymentFileSchema, getBundleFileSize, readAllDeployments, readBundleMetadata, readBundleStream, readDeployment, writeBundle, writeBundleMetadata, writeDeployment };
@@ -1,4 +1,4 @@
1
- //#region rolldown:runtime
1
+ //#region \0rolldown/runtime.js
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -6,16 +6,12 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
6
6
  var __getProtoOf = Object.getPrototypeOf;
7
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
8
  var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
- key = keys[i];
12
- if (!__hasOwnProp.call(to, key) && key !== except) {
13
- __defProp(to, key, {
14
- get: ((k) => from[k]).bind(null, key),
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- }
9
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
10
+ key = keys[i];
11
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
12
+ get: ((k) => from[k]).bind(null, key),
13
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
14
+ });
19
15
  }
20
16
  return to;
21
17
  };
@@ -23,26 +19,27 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
23
19
  value: mod,
24
20
  enumerable: true
25
21
  }) : target, mod));
26
-
27
22
  //#endregion
28
23
  let node_path = require("node:path");
29
- node_path = __toESM(node_path);
24
+ node_path = __toESM(node_path, 1);
30
25
  let node_fs = require("node:fs");
31
26
  let node_fs_promises = require("node:fs/promises");
32
- node_fs_promises = __toESM(node_fs_promises);
27
+ node_fs_promises = __toESM(node_fs_promises, 1);
33
28
  let zod = require("zod");
34
29
  let tinyglobby = require("tinyglobby");
35
-
36
30
  //#region src/utils.ts
37
31
  function normalizeBundleName(file) {
38
32
  return file.replace(/([\\/\s])/g, "-").replace(/\.wvb$/, "");
39
33
  }
40
-
41
34
  //#endregion
42
35
  //#region src/api/bundles.ts
43
36
  function readBundleStream({ baseDir, bundle, version }) {
44
37
  return (0, node_fs.createReadStream)(getBundleFilePath(baseDir, bundle, version));
45
38
  }
39
+ async function getBundleFileSize({ baseDir, bundle, version }) {
40
+ const filePath = getBundleFilePath(baseDir, bundle, version);
41
+ return (await node_fs_promises.default.stat(filePath)).size;
42
+ }
46
43
  async function writeBundle({ baseDir, bundle, version, data }) {
47
44
  const filePath = getBundleFilePath(baseDir, bundle, version);
48
45
  await node_fs_promises.default.mkdir(node_path.default.dirname(filePath), { recursive: true });
@@ -74,7 +71,6 @@ function getBundleMetadataFilePath(baseDir, bundle, version) {
74
71
  const bundleName = normalizeBundleName(bundle);
75
72
  return node_path.default.join(baseDir, "bundles", bundleName, `${bundleName}_${version}.json`);
76
73
  }
77
-
78
74
  //#endregion
79
75
  //#region src/api/deployment.ts
80
76
  const DeploymentFileSchema = zod.z.object({
@@ -125,65 +121,70 @@ async function writeDeployment({ baseDir, bundle, version, channel }) {
125
121
  function getDeploymentFilePath(baseDir, bundle) {
126
122
  return node_path.default.join(baseDir, "bundles", `${normalizeBundleName(bundle)}`, "deployment.json");
127
123
  }
128
-
129
124
  //#endregion
130
- Object.defineProperty(exports, 'BundleMetadataFileSchema', {
131
- enumerable: true,
132
- get: function () {
133
- return BundleMetadataFileSchema;
134
- }
125
+ Object.defineProperty(exports, "BundleMetadataFileSchema", {
126
+ enumerable: true,
127
+ get: function() {
128
+ return BundleMetadataFileSchema;
129
+ }
135
130
  });
136
- Object.defineProperty(exports, 'DeploymentFileSchema', {
137
- enumerable: true,
138
- get: function () {
139
- return DeploymentFileSchema;
140
- }
131
+ Object.defineProperty(exports, "DeploymentFileSchema", {
132
+ enumerable: true,
133
+ get: function() {
134
+ return DeploymentFileSchema;
135
+ }
141
136
  });
142
- Object.defineProperty(exports, '__toESM', {
143
- enumerable: true,
144
- get: function () {
145
- return __toESM;
146
- }
137
+ Object.defineProperty(exports, "__toESM", {
138
+ enumerable: true,
139
+ get: function() {
140
+ return __toESM;
141
+ }
147
142
  });
148
- Object.defineProperty(exports, 'readAllDeployments', {
149
- enumerable: true,
150
- get: function () {
151
- return readAllDeployments;
152
- }
143
+ Object.defineProperty(exports, "getBundleFileSize", {
144
+ enumerable: true,
145
+ get: function() {
146
+ return getBundleFileSize;
147
+ }
153
148
  });
154
- Object.defineProperty(exports, 'readBundleMetadata', {
155
- enumerable: true,
156
- get: function () {
157
- return readBundleMetadata;
158
- }
149
+ Object.defineProperty(exports, "readAllDeployments", {
150
+ enumerable: true,
151
+ get: function() {
152
+ return readAllDeployments;
153
+ }
159
154
  });
160
- Object.defineProperty(exports, 'readBundleStream', {
161
- enumerable: true,
162
- get: function () {
163
- return readBundleStream;
164
- }
155
+ Object.defineProperty(exports, "readBundleMetadata", {
156
+ enumerable: true,
157
+ get: function() {
158
+ return readBundleMetadata;
159
+ }
165
160
  });
166
- Object.defineProperty(exports, 'readDeployment', {
167
- enumerable: true,
168
- get: function () {
169
- return readDeployment;
170
- }
161
+ Object.defineProperty(exports, "readBundleStream", {
162
+ enumerable: true,
163
+ get: function() {
164
+ return readBundleStream;
165
+ }
166
+ });
167
+ Object.defineProperty(exports, "readDeployment", {
168
+ enumerable: true,
169
+ get: function() {
170
+ return readDeployment;
171
+ }
171
172
  });
172
- Object.defineProperty(exports, 'writeBundle', {
173
- enumerable: true,
174
- get: function () {
175
- return writeBundle;
176
- }
173
+ Object.defineProperty(exports, "writeBundle", {
174
+ enumerable: true,
175
+ get: function() {
176
+ return writeBundle;
177
+ }
177
178
  });
178
- Object.defineProperty(exports, 'writeBundleMetadata', {
179
- enumerable: true,
180
- get: function () {
181
- return writeBundleMetadata;
182
- }
179
+ Object.defineProperty(exports, "writeBundleMetadata", {
180
+ enumerable: true,
181
+ get: function() {
182
+ return writeBundleMetadata;
183
+ }
184
+ });
185
+ Object.defineProperty(exports, "writeDeployment", {
186
+ enumerable: true,
187
+ get: function() {
188
+ return writeDeployment;
189
+ }
183
190
  });
184
- Object.defineProperty(exports, 'writeDeployment', {
185
- enumerable: true,
186
- get: function () {
187
- return writeDeployment;
188
- }
189
- });
@@ -3,17 +3,19 @@ import { createReadStream } from "node:fs";
3
3
  import fs from "node:fs/promises";
4
4
  import { z } from "zod";
5
5
  import { glob } from "tinyglobby";
6
-
7
6
  //#region src/utils.ts
8
7
  function normalizeBundleName(file) {
9
8
  return file.replace(/([\\/\s])/g, "-").replace(/\.wvb$/, "");
10
9
  }
11
-
12
10
  //#endregion
13
11
  //#region src/api/bundles.ts
14
12
  function readBundleStream({ baseDir, bundle, version }) {
15
13
  return createReadStream(getBundleFilePath(baseDir, bundle, version));
16
14
  }
15
+ async function getBundleFileSize({ baseDir, bundle, version }) {
16
+ const filePath = getBundleFilePath(baseDir, bundle, version);
17
+ return (await fs.stat(filePath)).size;
18
+ }
17
19
  async function writeBundle({ baseDir, bundle, version, data }) {
18
20
  const filePath = getBundleFilePath(baseDir, bundle, version);
19
21
  await fs.mkdir(path.dirname(filePath), { recursive: true });
@@ -45,7 +47,6 @@ function getBundleMetadataFilePath(baseDir, bundle, version) {
45
47
  const bundleName = normalizeBundleName(bundle);
46
48
  return path.join(baseDir, "bundles", bundleName, `${bundleName}_${version}.json`);
47
49
  }
48
-
49
50
  //#endregion
50
51
  //#region src/api/deployment.ts
51
52
  const DeploymentFileSchema = z.object({
@@ -96,6 +97,5 @@ async function writeDeployment({ baseDir, bundle, version, channel }) {
96
97
  function getDeploymentFilePath(baseDir, bundle) {
97
98
  return path.join(baseDir, "bundles", `${normalizeBundleName(bundle)}`, "deployment.json");
98
99
  }
99
-
100
100
  //#endregion
101
- export { BundleMetadataFileSchema as a, writeBundle as c, writeDeployment as i, writeBundleMetadata as l, readAllDeployments as n, readBundleMetadata as o, readDeployment as r, readBundleStream as s, DeploymentFileSchema as t };
101
+ export { BundleMetadataFileSchema as a, readBundleStream as c, writeDeployment as i, writeBundle as l, readAllDeployments as n, getBundleFileSize as o, readDeployment as r, readBundleMetadata as s, DeploymentFileSchema as t, writeBundleMetadata as u };
package/dist/index.cjs CHANGED
@@ -1,11 +1,12 @@
1
- const require_api = require('./api-oBJy5sKt.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_api = require("./api-BAHtiZKk.cjs");
2
3
  let node_os = require("node:os");
3
- node_os = require_api.__toESM(node_os);
4
+ node_os = require_api.__toESM(node_os, 1);
4
5
  let node_path = require("node:path");
5
- node_path = require_api.__toESM(node_path);
6
-
6
+ node_path = require_api.__toESM(node_path, 1);
7
7
  //#region src/deployer.ts
8
8
  var LocalRemoteDeployer = class {
9
+ config;
9
10
  constructor(config) {
10
11
  this.config = config;
11
12
  }
@@ -23,10 +24,10 @@ var LocalRemoteDeployer = class {
23
24
  function localRemoteDeployer(config) {
24
25
  return new LocalRemoteDeployer(config);
25
26
  }
26
-
27
27
  //#endregion
28
28
  //#region src/uploader.ts
29
29
  var LocalUploaderImpl = class {
30
+ config;
30
31
  constructor(config) {
31
32
  this.config = config;
32
33
  }
@@ -54,7 +55,6 @@ var LocalUploaderImpl = class {
54
55
  function localRemoteUploader(config) {
55
56
  return new LocalUploaderImpl(config);
56
57
  }
57
-
58
58
  //#endregion
59
59
  //#region src/config.ts
60
60
  function localRemote(config) {
@@ -64,6 +64,5 @@ function localRemote(config) {
64
64
  deployer: localRemoteDeployer(resolvedConfig)
65
65
  };
66
66
  }
67
-
68
67
  //#endregion
69
- exports.localRemote = localRemote;
68
+ exports.localRemote = localRemote;
package/dist/index.mjs CHANGED
@@ -1,9 +1,9 @@
1
- import { c as writeBundle, i as writeDeployment, l as writeBundleMetadata } from "./api-8MXKpsHj.mjs";
1
+ import { i as writeDeployment, l as writeBundle, u as writeBundleMetadata } from "./api-CHVFBPei.mjs";
2
2
  import * as os from "node:os";
3
3
  import path from "node:path";
4
-
5
4
  //#region src/deployer.ts
6
5
  var LocalRemoteDeployer = class {
6
+ config;
7
7
  constructor(config) {
8
8
  this.config = config;
9
9
  }
@@ -21,10 +21,10 @@ var LocalRemoteDeployer = class {
21
21
  function localRemoteDeployer(config) {
22
22
  return new LocalRemoteDeployer(config);
23
23
  }
24
-
25
24
  //#endregion
26
25
  //#region src/uploader.ts
27
26
  var LocalUploaderImpl = class {
27
+ config;
28
28
  constructor(config) {
29
29
  this.config = config;
30
30
  }
@@ -52,7 +52,6 @@ var LocalUploaderImpl = class {
52
52
  function localRemoteUploader(config) {
53
53
  return new LocalUploaderImpl(config);
54
54
  }
55
-
56
55
  //#endregion
57
56
  //#region src/config.ts
58
57
  function localRemote(config) {
@@ -62,6 +61,5 @@ function localRemote(config) {
62
61
  deployer: localRemoteDeployer(resolvedConfig)
63
62
  };
64
63
  }
65
-
66
64
  //#endregion
67
- export { localRemote };
65
+ export { localRemote };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wvb/remote-local",
3
- "version": "0.0.0-next.9a8f99e",
3
+ "version": "0.0.0-next.e459de3",
4
4
  "description": "Webview Bundle remote config for local simulation",
5
5
  "homepage": "https://github.com/webview-bundle/webview-bundle",
6
6
  "bugs": {
@@ -42,14 +42,14 @@
42
42
  "typecheck": "tsc --noEmit"
43
43
  },
44
44
  "dependencies": {
45
- "@wvb/config": "^0.1.0-next.9a8f99e",
45
+ "@wvb/config": "^0.1.0-next.e459de3",
46
46
  "tinyglobby": "^0.2.14",
47
47
  "zod": "^4.0.5"
48
48
  },
49
49
  "devDependencies": {
50
- "@types/node": "22.19.3",
51
- "tsdown": "0.20.1",
52
- "typescript": "5.9.3",
53
- "vitest": "4.1.5"
50
+ "@types/node": "25.9.1",
51
+ "tsdown": "0.22.1",
52
+ "typescript": "6.0.3",
53
+ "vitest": "4.1.8"
54
54
  }
55
55
  }