pinokiod 3.2.209 → 3.2.210

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.
@@ -167,7 +167,7 @@ class Bin {
167
167
  await fs.promises.mkdir(bin_folder, { recursive: true }).catch((e) => { })
168
168
  const playwright_folder = path.resolve(bin_folder, "playwright/browsers")
169
169
  process.env.PLAYWRIGHT_BROWSERS_PATH = playwright_folder
170
- await fs.promises.mkdir(playwright_folder, { recursive: true }).catch((e) => { })
170
+ // await fs.promises.mkdir(playwright_folder, { recursive: true }).catch((e) => { })
171
171
  }
172
172
  // ORDERING MATTERS.
173
173
  // General purpose package managers like conda, conda needs to come at the end
@@ -3,40 +3,15 @@ const path = require('path')
3
3
  const { rimraf } = require('rimraf')
4
4
  class Playwright {
5
5
  async install(req, ondata) {
6
- // let c
7
- // if (this.kernel.platform === "win32") {
8
- // c = `npm config --global set prefix ${this.kernel.bin.path("miniconda")}`
9
- // } else {
10
- // c = [
11
- // `npm config --global set prefix ${this.kernel.bin.path("miniconda")} --loglevel verbose`,
12
- // `npm config set prefix ${this.kernel.bin.path("miniconda")} --loglevel verbose`
13
- // ]
14
- // }
15
- // await this.kernel.exec({
16
- // message: c,
17
- //// path: this.kernel.bin.path("playwright"),
18
- // env: {
19
- // PLAYWRIGHT_BROWSERS_PATH: this.kernel.bin.path("playwright/browsers")
20
- // }
21
- // }, ondata)
22
-
23
-
24
- let p
25
- if (this.kernel.platform === "win32") {
26
- p = this.kernel.path("bin/miniconda")
27
- } else {
28
- p = this.kernel.path("bin/miniconda/lib")
29
- }
6
+ let p = this.kernel.path("bin/playwright")
7
+ await rimraf(p)
8
+ await fs.promises.mkdir(p, { recursive: true }).catch((e) => { })
30
9
  await this.kernel.exec({
31
10
  message: [
32
- // "npm init -y",
33
- // "which npm",
34
- // "npm config get userconfig",
35
- // "npm config get globalconfig",
36
- // "npm config list -l --loglevel verbose",
37
- // "env",
38
- //"npm install -g playwright@1.49.0 --loglevel verbose",
39
- "npm install npm corepack playwright@1.49.1 --loglevel verbose",
11
+ "npm init -y",
12
+ //"npm install npm corepack playwright@1.49.1 --loglevel verbose",
13
+ "npm install playwright --loglevel verbose",
14
+ "playwright install firefox",
40
15
  // "playwright install chromium",
41
16
  ],
42
17
  path: p,
@@ -44,56 +19,13 @@ class Playwright {
44
19
  PLAYWRIGHT_BROWSERS_PATH: this.kernel.bin.path("playwright/browsers")
45
20
  }
46
21
  }, ondata)
47
- let pw_path = path.resolve(p, "node_modules/playwright/cli.js")
48
- await this.kernel.exec({
49
- message: [
50
- // "npm init -y",
51
- `node ${pw_path} install firefox`,
52
- // "playwright install firefox",
53
- // "npx -y playwright install firefox"
54
- ],
55
- //path: this.kernel.bin.path("playwright"),
56
- env: {
57
- PLAYWRIGHT_BROWSERS_PATH: this.kernel.bin.path("playwright/browsers")
58
- }
59
- }, ondata)
60
- // await this.kernel.exec({
61
- // message: [
62
- // "npm init -y",
63
- // "npm install @playwright/browser-chromium@1.47.0",
64
- // "npm install @playwright/browser-firefox@1.47.0",
65
- // "npm install @playwright/browser-webkit@1.47.0"
66
- //// "npx playwright install chromium"
67
- // ],
68
- // path: this.kernel.bin.path("playwright"),
69
- // env: {
70
- // PLAYWRIGHT_BROWSERS_PATH: this.kernel.bin.path("playwright/browsers")
71
- // }
72
- // }, ondata)
73
- // await this.kernel.exec({
74
- // message: [
75
- // "pip install playwright==1.48.0",
76
- //// "playwright install"
77
- //// "npm install playwright --ignore-scripts"
78
- // ],
79
- // env: {
80
- // PLAYWRIGHT_BROWSERS_PATH: this.kernel.bin.path("playwright/browsers")
81
- // }
82
- // }, ondata)
83
-
84
- let pwpath
85
- if (this.kernel.platform === "win32") {
86
- pwpath = this.kernel.bin.path("miniconda/node_modules/playwright")
87
- } else {
88
- pwpath = this.kernel.bin.path("miniconda/lib/node_modules/playwright")
89
- }
90
- process.env.PLAYWRIGHT_BROWSERS_PATH = this.kernel.bin.path("playwright/browsers")
91
- this.kernel.playwright = (await this.kernel.loader.load(pwpath)).resolved
92
22
  }
93
23
  async installed() {
94
- let p = this.kernel.bin.path("playwright/browsers")
95
- let e = await this.kernel.bin.exists(p)
96
- return e
24
+ let browsers = this.kernel.bin.path("playwright/browsers")
25
+ let node_modules = this.kernel.bin.path("playwright/node_modules")
26
+ let e1 = await this.kernel.bin.exists(browsers)
27
+ let e2 = await this.kernel.bin.exists(node_modules)
28
+ return e1 && e2
97
29
  }
98
30
  async uninstall(req, ondata) {
99
31
  ondata({ raw: "cleaning up\r\n" })
package/kernel/index.js CHANGED
@@ -542,6 +542,13 @@ class Kernel {
542
542
  //await this.shell.init()
543
543
  }
544
544
 
545
+ let pwpath
546
+ if (this.platform === "win32") {
547
+ pwpath = this.bin.path("playwright/node_modules/playwright")
548
+ } else {
549
+ pwpath = this.bin.path("playwright/lib/node_modules/playwright")
550
+ }
551
+ this.kernel.playwright = (await this.kernel.loader.load(pwpath)).resolved
545
552
 
546
553
 
547
554
  // let pwpath
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.2.209",
3
+ "version": "3.2.210",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
package/server/index.js CHANGED
@@ -516,8 +516,8 @@ class Server {
516
516
  name: "py"
517
517
  }, {
518
518
  name: "cloudflared"
519
- // }, {
520
- // name: "playwright"
519
+ }, {
520
+ name: "playwright"
521
521
  }, {
522
522
  name: "huggingface"
523
523
  }, {
@@ -798,8 +798,8 @@ class Server {
798
798
  name: "py"
799
799
  }, {
800
800
  name: "cloudflared"
801
- // }, {
802
- // name: "playwright"
801
+ }, {
802
+ name: "playwright"
803
803
  }, {
804
804
  name: "huggingface"
805
805
  }, {