@iflyrpa/playwright 1.0.11 → 1.0.13

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.13";
20
20
  const main = "./dist/index.cjs";
21
21
  const module$1 = "./dist/index.mjs";
22
22
  const types = "./dist/index.d.ts";
@@ -35,9 +35,6 @@ const dependencies = {
35
35
  npminstall: "^7.12.0",
36
36
  playwright: "^1.46.1"
37
37
  };
38
- const peerDependencies = {
39
- electron: "*"
40
- };
41
38
  const devDependencies = {
42
39
  esno: "^4.7.0",
43
40
  typescript: "^5.5.2",
@@ -55,7 +52,6 @@ const packageJson = {
55
52
  license: license,
56
53
  files: files,
57
54
  dependencies: dependencies,
58
- peerDependencies: peerDependencies,
59
55
  devDependencies: devDependencies
60
56
  };
61
57
 
@@ -212,6 +208,9 @@ function fetchJSON(url) {
212
208
  });
213
209
  });
214
210
  }
211
+ function isNil(value) {
212
+ return value === null || value === void 0;
213
+ }
215
214
 
216
215
  const visibleRangeTexts = {
217
216
  public: "\u516C\u5F00",
@@ -452,7 +451,7 @@ class PackageManager {
452
451
  __publicField$1(this, "logger");
453
452
  this.logger = Logger.getInstance(params.cacheDir);
454
453
  this.cacheDir = params.cacheDir;
455
- this.forceUpdate = params.forceUpdate || true;
454
+ this.forceUpdate = isNil(params.forceUpdate) ? true : params.forceUpdate;
456
455
  this.initCacheProject();
457
456
  this.initPromise = this.init(params.packageName, params.packageVersion);
458
457
  }
@@ -494,15 +493,16 @@ class PackageManager {
494
493
  return this.getPlugin(module);
495
494
  }
496
495
  // 安装依赖
497
- install(module, version) {
496
+ install(name, version) {
498
497
  return npminstall__default({
499
498
  root: this.cacheDir,
500
- pkgs: [{ name: module, version }],
499
+ pkgs: [{ name, version }],
501
500
  registry: NPM_REGISTRY
502
501
  });
503
502
  }
504
503
  async init(name, version) {
505
504
  const plugin = this.getPlugin(path__default.join(name, "package.json"));
505
+ this.logger.info(`${name} \u662F\u5426\u5DF2\u5B89\u88C5\uFF1A${!!plugin}`);
506
506
  try {
507
507
  if (!plugin) {
508
508
  await this.install(name, version);
@@ -512,6 +512,7 @@ class PackageManager {
512
512
  return;
513
513
  const hasNewVersion = semver.gt(pkInfo.version, plugin.version);
514
514
  if (hasNewVersion) {
515
+ this.logger.info(`${name} \u68C0\u67E5\u5230\u65B0\u7248\u672C ${pkInfo.version}\uFF0C\u66F4\u65B0\u4F9D\u8D56`);
515
516
  await this.install(name, pkInfo.version);
516
517
  }
517
518
  }
@@ -552,7 +553,8 @@ class LocalAutomateTask {
552
553
  const playwrightPackageManager = new PackageManager({
553
554
  packageName: "playwright",
554
555
  packageVersion: PLAYWRIGHT_VERSION,
555
- cacheDir: this.cachePath
556
+ cacheDir: this.cachePath,
557
+ forceUpdate: false
556
558
  });
557
559
  return playwrightPackageManager.getPluginAfterInit("playwright");
558
560
  }
@@ -564,7 +566,8 @@ class LocalAutomateTask {
564
566
  const playwrightPackageManager = new PackageManager({
565
567
  packageName: "electron",
566
568
  packageVersion: ELECTRON_VERSION,
567
- cacheDir: this.cachePath
569
+ cacheDir: this.cachePath,
570
+ forceUpdate: false
568
571
  });
569
572
  return playwrightPackageManager.getPluginAfterInit("electron");
570
573
  }
package/dist/index.d.cts CHANGED
@@ -1,4 +1,47 @@
1
- import { CookiesSetDetails } from 'electron';
1
+ interface CookiesSetDetails {
2
+ /**
3
+ * The URL to associate the cookie with. The promise will be rejected if the URL is
4
+ * invalid.
5
+ */
6
+ url: string;
7
+ /**
8
+ * The name of the cookie. Empty by default if omitted.
9
+ */
10
+ name?: string;
11
+ /**
12
+ * The value of the cookie. Empty by default if omitted.
13
+ */
14
+ value?: string;
15
+ /**
16
+ * The domain of the cookie; this will be normalized with a preceding dot so that
17
+ * it's also valid for subdomains. Empty by default if omitted.
18
+ */
19
+ domain?: string;
20
+ /**
21
+ * The path of the cookie. Empty by default if omitted.
22
+ */
23
+ path?: string;
24
+ /**
25
+ * Whether the cookie should be marked as Secure. Defaults to false unless Same
26
+ * Site=None attribute is used.
27
+ */
28
+ secure?: boolean;
29
+ /**
30
+ * Whether the cookie should be marked as HTTP only. Defaults to false.
31
+ */
32
+ httpOnly?: boolean;
33
+ /**
34
+ * The expiration date of the cookie as the number of seconds since the UNIX epoch.
35
+ * If omitted then the cookie becomes a session cookie and will not be retained
36
+ * between sessions.
37
+ */
38
+ expirationDate?: number;
39
+ /**
40
+ * The Same Site policy to apply to this cookie. Can be `unspecified`,
41
+ * `no_restriction`, `lax` or `strict`. Default is `lax`.
42
+ */
43
+ sameSite?: "unspecified" | "no_restriction" | "lax" | "strict";
44
+ }
2
45
 
3
46
  type CookieMap = CookiesSetDetails[];
4
47
 
package/dist/index.d.mts CHANGED
@@ -1,4 +1,47 @@
1
- import { CookiesSetDetails } from 'electron';
1
+ interface CookiesSetDetails {
2
+ /**
3
+ * The URL to associate the cookie with. The promise will be rejected if the URL is
4
+ * invalid.
5
+ */
6
+ url: string;
7
+ /**
8
+ * The name of the cookie. Empty by default if omitted.
9
+ */
10
+ name?: string;
11
+ /**
12
+ * The value of the cookie. Empty by default if omitted.
13
+ */
14
+ value?: string;
15
+ /**
16
+ * The domain of the cookie; this will be normalized with a preceding dot so that
17
+ * it's also valid for subdomains. Empty by default if omitted.
18
+ */
19
+ domain?: string;
20
+ /**
21
+ * The path of the cookie. Empty by default if omitted.
22
+ */
23
+ path?: string;
24
+ /**
25
+ * Whether the cookie should be marked as Secure. Defaults to false unless Same
26
+ * Site=None attribute is used.
27
+ */
28
+ secure?: boolean;
29
+ /**
30
+ * Whether the cookie should be marked as HTTP only. Defaults to false.
31
+ */
32
+ httpOnly?: boolean;
33
+ /**
34
+ * The expiration date of the cookie as the number of seconds since the UNIX epoch.
35
+ * If omitted then the cookie becomes a session cookie and will not be retained
36
+ * between sessions.
37
+ */
38
+ expirationDate?: number;
39
+ /**
40
+ * The Same Site policy to apply to this cookie. Can be `unspecified`,
41
+ * `no_restriction`, `lax` or `strict`. Default is `lax`.
42
+ */
43
+ sameSite?: "unspecified" | "no_restriction" | "lax" | "strict";
44
+ }
2
45
 
3
46
  type CookieMap = CookiesSetDetails[];
4
47
 
package/dist/index.d.ts CHANGED
@@ -1,4 +1,47 @@
1
- import { CookiesSetDetails } from 'electron';
1
+ interface CookiesSetDetails {
2
+ /**
3
+ * The URL to associate the cookie with. The promise will be rejected if the URL is
4
+ * invalid.
5
+ */
6
+ url: string;
7
+ /**
8
+ * The name of the cookie. Empty by default if omitted.
9
+ */
10
+ name?: string;
11
+ /**
12
+ * The value of the cookie. Empty by default if omitted.
13
+ */
14
+ value?: string;
15
+ /**
16
+ * The domain of the cookie; this will be normalized with a preceding dot so that
17
+ * it's also valid for subdomains. Empty by default if omitted.
18
+ */
19
+ domain?: string;
20
+ /**
21
+ * The path of the cookie. Empty by default if omitted.
22
+ */
23
+ path?: string;
24
+ /**
25
+ * Whether the cookie should be marked as Secure. Defaults to false unless Same
26
+ * Site=None attribute is used.
27
+ */
28
+ secure?: boolean;
29
+ /**
30
+ * Whether the cookie should be marked as HTTP only. Defaults to false.
31
+ */
32
+ httpOnly?: boolean;
33
+ /**
34
+ * The expiration date of the cookie as the number of seconds since the UNIX epoch.
35
+ * If omitted then the cookie becomes a session cookie and will not be retained
36
+ * between sessions.
37
+ */
38
+ expirationDate?: number;
39
+ /**
40
+ * The Same Site policy to apply to this cookie. Can be `unspecified`,
41
+ * `no_restriction`, `lax` or `strict`. Default is `lax`.
42
+ */
43
+ sameSite?: "unspecified" | "no_restriction" | "lax" | "strict";
44
+ }
2
45
 
3
46
  type CookieMap = CookiesSetDetails[];
4
47
 
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.13";
10
10
  const main = "./dist/index.cjs";
11
11
  const module = "./dist/index.mjs";
12
12
  const types = "./dist/index.d.ts";
@@ -25,9 +25,6 @@ const dependencies = {
25
25
  npminstall: "^7.12.0",
26
26
  playwright: "^1.46.1"
27
27
  };
28
- const peerDependencies = {
29
- electron: "*"
30
- };
31
28
  const devDependencies = {
32
29
  esno: "^4.7.0",
33
30
  typescript: "^5.5.2",
@@ -45,7 +42,6 @@ const packageJson = {
45
42
  license: license,
46
43
  files: files,
47
44
  dependencies: dependencies,
48
- peerDependencies: peerDependencies,
49
45
  devDependencies: devDependencies
50
46
  };
51
47
 
@@ -202,6 +198,9 @@ function fetchJSON(url) {
202
198
  });
203
199
  });
204
200
  }
201
+ function isNil(value) {
202
+ return value === null || value === void 0;
203
+ }
205
204
 
206
205
  const visibleRangeTexts = {
207
206
  public: "\u516C\u5F00",
@@ -442,7 +441,7 @@ class PackageManager {
442
441
  __publicField$1(this, "logger");
443
442
  this.logger = Logger.getInstance(params.cacheDir);
444
443
  this.cacheDir = params.cacheDir;
445
- this.forceUpdate = params.forceUpdate || true;
444
+ this.forceUpdate = isNil(params.forceUpdate) ? true : params.forceUpdate;
446
445
  this.initCacheProject();
447
446
  this.initPromise = this.init(params.packageName, params.packageVersion);
448
447
  }
@@ -484,15 +483,16 @@ class PackageManager {
484
483
  return this.getPlugin(module);
485
484
  }
486
485
  // 安装依赖
487
- install(module, version) {
486
+ install(name, version) {
488
487
  return npminstall({
489
488
  root: this.cacheDir,
490
- pkgs: [{ name: module, version }],
489
+ pkgs: [{ name, version }],
491
490
  registry: NPM_REGISTRY
492
491
  });
493
492
  }
494
493
  async init(name, version) {
495
494
  const plugin = this.getPlugin(path.join(name, "package.json"));
495
+ this.logger.info(`${name} \u662F\u5426\u5DF2\u5B89\u88C5\uFF1A${!!plugin}`);
496
496
  try {
497
497
  if (!plugin) {
498
498
  await this.install(name, version);
@@ -502,6 +502,7 @@ class PackageManager {
502
502
  return;
503
503
  const hasNewVersion = semver.gt(pkInfo.version, plugin.version);
504
504
  if (hasNewVersion) {
505
+ this.logger.info(`${name} \u68C0\u67E5\u5230\u65B0\u7248\u672C ${pkInfo.version}\uFF0C\u66F4\u65B0\u4F9D\u8D56`);
505
506
  await this.install(name, pkInfo.version);
506
507
  }
507
508
  }
@@ -542,7 +543,8 @@ class LocalAutomateTask {
542
543
  const playwrightPackageManager = new PackageManager({
543
544
  packageName: "playwright",
544
545
  packageVersion: PLAYWRIGHT_VERSION,
545
- cacheDir: this.cachePath
546
+ cacheDir: this.cachePath,
547
+ forceUpdate: false
546
548
  });
547
549
  return playwrightPackageManager.getPluginAfterInit("playwright");
548
550
  }
@@ -554,7 +556,8 @@ class LocalAutomateTask {
554
556
  const playwrightPackageManager = new PackageManager({
555
557
  packageName: "electron",
556
558
  packageVersion: ELECTRON_VERSION,
557
- cacheDir: this.cachePath
559
+ cacheDir: this.cachePath,
560
+ forceUpdate: false
558
561
  });
559
562
  return playwrightPackageManager.getPluginAfterInit("electron");
560
563
  }
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.13",
5
5
  "main": "./dist/index.cjs",
6
6
  "module": "./dist/index.mjs",
7
7
  "types": "./dist/index.d.ts",
@@ -18,9 +18,6 @@
18
18
  "npminstall": "^7.12.0",
19
19
  "playwright": "^1.46.1"
20
20
  },
21
- "peerDependencies": {
22
- "electron": "*"
23
- },
24
21
  "devDependencies": {
25
22
  "esno": "^4.7.0",
26
23
  "typescript": "^5.5.2",