electron-version-deployer-cli 0.4.7 → 0.4.8

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/dist/cli.cjs CHANGED
@@ -402,6 +402,8 @@ async function netRequest(options) {
402
402
  }
403
403
  return new Promise((resolve, reject) => {
404
404
  const request = electron.net.request(options.url);
405
+ request.setHeader("Accept-Encoding", "identity");
406
+ request.setHeader("Cache-Control", "no-cache");
405
407
  let data = "";
406
408
  let isResolved = false;
407
409
  const timeoutId = setTimeout(() => {
@@ -472,7 +474,7 @@ function versionToNum(a) {
472
474
  let res = c.join("");
473
475
  return res;
474
476
  }
475
- const _Netlify = class _Netlify {
477
+ const _Netlify = class {
476
478
  static get instance() {
477
479
  if (!this._instance) {
478
480
  this._instance = new _Netlify();
@@ -530,8 +532,8 @@ const _Netlify = class _Netlify {
530
532
  return `configs.netlify 配置不存在`;
531
533
  }
532
534
  };
533
- __publicField(_Netlify, "_instance");
534
535
  let Netlify = _Netlify;
536
+ __publicField(Netlify, "_instance");
535
537
  function forceDeleteSync(targetPath) {
536
538
  try {
537
539
  const stats = fs.statSync(targetPath);
@@ -555,7 +557,7 @@ function forceDeleteSync(targetPath) {
555
557
  }
556
558
  }
557
559
  }
558
- const _Cloudflare = class _Cloudflare {
560
+ const _Cloudflare = class {
559
561
  static get instance() {
560
562
  if (!this._instance) {
561
563
  this._instance = new _Cloudflare();
@@ -654,8 +656,8 @@ const _Cloudflare = class _Cloudflare {
654
656
  return `configs.cloudflare 配置不存在`;
655
657
  }
656
658
  };
657
- __publicField(_Cloudflare, "_instance");
658
659
  let Cloudflare = _Cloudflare;
660
+ __publicField(Cloudflare, "_instance");
659
661
  commander.program.command("deploy").description("执行部署").action(async (source, destination) => {
660
662
  const configs = await getConfigs();
661
663
  try {
@@ -798,4 +800,4 @@ async function installPrebuilt(configs) {
798
800
  }
799
801
  commander.program.description(
800
802
  "Electron 版本部署 CLI,简化你的 Electron 软件更新,让一切变得简单。"
801
- ).helpOption("-h, --help", "使用帮助").version("0.4.7", "-V, --version", "显示版本号").parse(process.argv);
803
+ ).helpOption("-h, --help", "使用帮助").version("0.4.8", "-V, --version", "显示版本号").parse(process.argv);
@@ -1,6 +1,6 @@
1
1
  interface RequestOptions {
2
2
  url: string;
3
- responseType?: 'json' | 'stream' | 'text';
3
+ responseType?: "json" | "stream" | "text";
4
4
  }
5
5
  export declare function netRequest<T = any>(options: RequestOptions): Promise<T>;
6
6
  export {};
package/dist/main.js CHANGED
@@ -41,6 +41,8 @@ async function netRequest(options) {
41
41
  }
42
42
  return new Promise((resolve, reject) => {
43
43
  const request = electron.net.request(options.url);
44
+ request.setHeader("Accept-Encoding", "identity");
45
+ request.setHeader("Cache-Control", "no-cache");
44
46
  let data = "";
45
47
  let isResolved = false;
46
48
  const timeoutId = setTimeout(() => {
@@ -322,6 +324,8 @@ async function installPkg(zipFile) {
322
324
  url: `${remoteUrl}/fullCodeZipSplitZips/${fileName}?hash=${Math.random()}`,
323
325
  method: "GET"
324
326
  });
327
+ request.setHeader("Accept-Encoding", "identity");
328
+ request.setHeader("Cache-Control", "no-cache");
325
329
  request.on("response", (response) => {
326
330
  response.pipe(tmpSplitZip).on("finish", () => {
327
331
  tmpSplitZip.end(() => {
@@ -350,6 +354,8 @@ async function installPkg(zipFile) {
350
354
  url: `${remoteUrl}/${zipFile}?hash=${Math.random()}`,
351
355
  method: "GET"
352
356
  });
357
+ request.setHeader("Accept-Encoding", "identity");
358
+ request.setHeader("Cache-Control", "no-cache");
353
359
  request.on("response", (response) => {
354
360
  response.pipe(tmpZipFilePath).on("finish", () => {
355
361
  tmpZipFilePath.end(() => {
package/package.json CHANGED
@@ -1,10 +1,14 @@
1
1
  {
2
2
  "name": "electron-version-deployer-cli",
3
3
  "private": false,
4
- "version": "0.4.7",
4
+ "version": "0.4.8",
5
5
  "types": "./dist/index.d.ts",
6
6
  "main": "./dist/index.cjs.js",
7
7
  "module": "./dist/index.es.js",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/FrontEndSharedProject/electron-version-deployer-cli.git"
11
+ },
8
12
  "scripts": {
9
13
  "serve": "esno ./watch.ts",
10
14
  "build": "MODE=production esno ./watch.ts && tsc -p ./tsconfig.dist.json -emitDeclarationOnly && tsc-alias -p ./tsconfig.dist.json",