@iflyrpa/playwright 1.0.11 → 1.0.12

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/index.cjs CHANGED
@@ -16,7 +16,7 @@ const npminstall__default = /*#__PURE__*/_interopDefaultCompat(npminstall);
16
16
 
17
17
  const name = "@iflyrpa/playwright";
18
18
  const type = "module";
19
- const version$1 = "1.0.11";
19
+ const version$1 = "1.0.12";
20
20
  const main = "./dist/index.cjs";
21
21
  const module$1 = "./dist/index.mjs";
22
22
  const types = "./dist/index.d.ts";
@@ -212,6 +212,9 @@ function fetchJSON(url) {
212
212
  });
213
213
  });
214
214
  }
215
+ function isNil(value) {
216
+ return value === null || value === void 0;
217
+ }
215
218
 
216
219
  const visibleRangeTexts = {
217
220
  public: "\u516C\u5F00",
@@ -452,7 +455,7 @@ class PackageManager {
452
455
  __publicField$1(this, "logger");
453
456
  this.logger = Logger.getInstance(params.cacheDir);
454
457
  this.cacheDir = params.cacheDir;
455
- this.forceUpdate = params.forceUpdate || true;
458
+ this.forceUpdate = isNil(params.forceUpdate) ? true : params.forceUpdate;
456
459
  this.initCacheProject();
457
460
  this.initPromise = this.init(params.packageName, params.packageVersion);
458
461
  }
@@ -494,15 +497,16 @@ class PackageManager {
494
497
  return this.getPlugin(module);
495
498
  }
496
499
  // 安装依赖
497
- install(module, version) {
500
+ install(name, version) {
498
501
  return npminstall__default({
499
502
  root: this.cacheDir,
500
- pkgs: [{ name: module, version }],
503
+ pkgs: [{ name, version }],
501
504
  registry: NPM_REGISTRY
502
505
  });
503
506
  }
504
507
  async init(name, version) {
505
508
  const plugin = this.getPlugin(path__default.join(name, "package.json"));
509
+ this.logger.info(`${name} \u662F\u5426\u5DF2\u5B89\u88C5\uFF1A${!!plugin}`);
506
510
  try {
507
511
  if (!plugin) {
508
512
  await this.install(name, version);
@@ -512,6 +516,7 @@ class PackageManager {
512
516
  return;
513
517
  const hasNewVersion = semver.gt(pkInfo.version, plugin.version);
514
518
  if (hasNewVersion) {
519
+ this.logger.info(`${name} \u68C0\u67E5\u5230\u65B0\u7248\u672C ${pkInfo.version}\uFF0C\u66F4\u65B0\u4F9D\u8D56`);
515
520
  await this.install(name, pkInfo.version);
516
521
  }
517
522
  }
@@ -552,7 +557,8 @@ class LocalAutomateTask {
552
557
  const playwrightPackageManager = new PackageManager({
553
558
  packageName: "playwright",
554
559
  packageVersion: PLAYWRIGHT_VERSION,
555
- cacheDir: this.cachePath
560
+ cacheDir: this.cachePath,
561
+ forceUpdate: false
556
562
  });
557
563
  return playwrightPackageManager.getPluginAfterInit("playwright");
558
564
  }
@@ -564,7 +570,8 @@ class LocalAutomateTask {
564
570
  const playwrightPackageManager = new PackageManager({
565
571
  packageName: "electron",
566
572
  packageVersion: ELECTRON_VERSION,
567
- cacheDir: this.cachePath
573
+ cacheDir: this.cachePath,
574
+ forceUpdate: false
568
575
  });
569
576
  return playwrightPackageManager.getPluginAfterInit("electron");
570
577
  }
package/dist/index.mjs CHANGED
@@ -6,7 +6,7 @@ import npminstall from 'npminstall';
6
6
 
7
7
  const name = "@iflyrpa/playwright";
8
8
  const type = "module";
9
- const version$1 = "1.0.11";
9
+ const version$1 = "1.0.12";
10
10
  const main = "./dist/index.cjs";
11
11
  const module = "./dist/index.mjs";
12
12
  const types = "./dist/index.d.ts";
@@ -202,6 +202,9 @@ function fetchJSON(url) {
202
202
  });
203
203
  });
204
204
  }
205
+ function isNil(value) {
206
+ return value === null || value === void 0;
207
+ }
205
208
 
206
209
  const visibleRangeTexts = {
207
210
  public: "\u516C\u5F00",
@@ -442,7 +445,7 @@ class PackageManager {
442
445
  __publicField$1(this, "logger");
443
446
  this.logger = Logger.getInstance(params.cacheDir);
444
447
  this.cacheDir = params.cacheDir;
445
- this.forceUpdate = params.forceUpdate || true;
448
+ this.forceUpdate = isNil(params.forceUpdate) ? true : params.forceUpdate;
446
449
  this.initCacheProject();
447
450
  this.initPromise = this.init(params.packageName, params.packageVersion);
448
451
  }
@@ -484,15 +487,16 @@ class PackageManager {
484
487
  return this.getPlugin(module);
485
488
  }
486
489
  // 安装依赖
487
- install(module, version) {
490
+ install(name, version) {
488
491
  return npminstall({
489
492
  root: this.cacheDir,
490
- pkgs: [{ name: module, version }],
493
+ pkgs: [{ name, version }],
491
494
  registry: NPM_REGISTRY
492
495
  });
493
496
  }
494
497
  async init(name, version) {
495
498
  const plugin = this.getPlugin(path.join(name, "package.json"));
499
+ this.logger.info(`${name} \u662F\u5426\u5DF2\u5B89\u88C5\uFF1A${!!plugin}`);
496
500
  try {
497
501
  if (!plugin) {
498
502
  await this.install(name, version);
@@ -502,6 +506,7 @@ class PackageManager {
502
506
  return;
503
507
  const hasNewVersion = semver.gt(pkInfo.version, plugin.version);
504
508
  if (hasNewVersion) {
509
+ this.logger.info(`${name} \u68C0\u67E5\u5230\u65B0\u7248\u672C ${pkInfo.version}\uFF0C\u66F4\u65B0\u4F9D\u8D56`);
505
510
  await this.install(name, pkInfo.version);
506
511
  }
507
512
  }
@@ -542,7 +547,8 @@ class LocalAutomateTask {
542
547
  const playwrightPackageManager = new PackageManager({
543
548
  packageName: "playwright",
544
549
  packageVersion: PLAYWRIGHT_VERSION,
545
- cacheDir: this.cachePath
550
+ cacheDir: this.cachePath,
551
+ forceUpdate: false
546
552
  });
547
553
  return playwrightPackageManager.getPluginAfterInit("playwright");
548
554
  }
@@ -554,7 +560,8 @@ class LocalAutomateTask {
554
560
  const playwrightPackageManager = new PackageManager({
555
561
  packageName: "electron",
556
562
  packageVersion: ELECTRON_VERSION,
557
- cacheDir: this.cachePath
563
+ cacheDir: this.cachePath,
564
+ forceUpdate: false
558
565
  });
559
566
  return playwrightPackageManager.getPluginAfterInit("electron");
560
567
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@iflyrpa/playwright",
3
3
  "type": "module",
4
- "version": "1.0.11",
4
+ "version": "1.0.12",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",