pinokiod 2.15.51 → 2.15.53
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/kernel/bin/playwright.js +44 -26
- package/kernel/index.js +7 -1
- package/kernel/shell.js +4 -0
- package/package.json +1 -1
- package/server/index.js +13 -5
- package/server/views/download.ejs +1 -1
- package/server/views/editor.ejs +1 -1
- package/server/views/fullscreen_editor.ejs +1 -1
package/kernel/bin/playwright.js
CHANGED
|
@@ -1,38 +1,56 @@
|
|
|
1
1
|
const fs = require('fs')
|
|
2
|
+
const path = require('path')
|
|
2
3
|
const { rimraf } = require('rimraf')
|
|
3
4
|
class Playwright {
|
|
4
5
|
async install(req, ondata) {
|
|
5
|
-
let c
|
|
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
|
|
6
25
|
if (this.kernel.platform === "win32") {
|
|
7
|
-
|
|
26
|
+
p = this.kernel.path("bin/miniconda")
|
|
8
27
|
} else {
|
|
9
|
-
|
|
28
|
+
p = this.kernel.path("bin/miniconda/lib")
|
|
10
29
|
}
|
|
11
30
|
await this.kernel.exec({
|
|
12
31
|
message: [
|
|
13
32
|
// "npm init -y",
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
await this.kernel.exec({
|
|
22
|
-
message: [
|
|
23
|
-
// "npm init -y",
|
|
24
|
-
"npm install -g playwright@1.49.0",
|
|
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 playwright@1.49.1 --loglevel verbose",
|
|
25
40
|
// "playwright install chromium",
|
|
26
41
|
],
|
|
27
|
-
|
|
42
|
+
path: p,
|
|
28
43
|
env: {
|
|
29
44
|
PLAYWRIGHT_BROWSERS_PATH: this.kernel.bin.path("playwright/browsers")
|
|
30
45
|
}
|
|
31
46
|
}, ondata)
|
|
47
|
+
let pw_path = path.resolve(p, "node_modules/playwright/cli.js")
|
|
32
48
|
await this.kernel.exec({
|
|
33
49
|
message: [
|
|
34
50
|
// "npm init -y",
|
|
35
|
-
|
|
51
|
+
`${pw_path} install firefox`,
|
|
52
|
+
// "playwright install firefox",
|
|
53
|
+
// "npx -y playwright install firefox"
|
|
36
54
|
],
|
|
37
55
|
//path: this.kernel.bin.path("playwright"),
|
|
38
56
|
env: {
|
|
@@ -52,16 +70,16 @@ class Playwright {
|
|
|
52
70
|
// PLAYWRIGHT_BROWSERS_PATH: this.kernel.bin.path("playwright/browsers")
|
|
53
71
|
// }
|
|
54
72
|
// }, ondata)
|
|
55
|
-
await this.kernel.exec({
|
|
56
|
-
message: [
|
|
57
|
-
"pip install playwright==1.48.0",
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
],
|
|
61
|
-
env: {
|
|
62
|
-
PLAYWRIGHT_BROWSERS_PATH: this.kernel.bin.path("playwright/browsers")
|
|
63
|
-
}
|
|
64
|
-
}, 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)
|
|
65
83
|
|
|
66
84
|
let pwpath
|
|
67
85
|
if (this.kernel.platform === "win32") {
|
package/kernel/index.js
CHANGED
|
@@ -369,7 +369,13 @@ class Kernel {
|
|
|
369
369
|
}
|
|
370
370
|
|
|
371
371
|
|
|
372
|
-
let pwpath
|
|
372
|
+
let pwpath
|
|
373
|
+
if (this.platform === "win32") {
|
|
374
|
+
pwpath = this.bin.path("miniconda/node_modules/playwright")
|
|
375
|
+
} else {
|
|
376
|
+
pwpath = this.bin.path("miniconda/lib/node_modules/playwright")
|
|
377
|
+
}
|
|
378
|
+
console.log("pwpath", pwpath)
|
|
373
379
|
process.env.PLAYWRIGHT_BROWSERS_PATH = this.bin.path("playwright/browsers")
|
|
374
380
|
this.playwright = (await this.loader.load(pwpath)).resolved
|
|
375
381
|
|
package/kernel/shell.js
CHANGED
|
@@ -112,6 +112,10 @@ class Shell {
|
|
|
112
112
|
|
|
113
113
|
this.env.CMAKE_OBJECT_PATH_MAX = 1024
|
|
114
114
|
this.env.PYTORCH_ENABLE_MPS_FALLBACK = 1
|
|
115
|
+
// this.env.NPM_CONFIG_USERCONFIG = this.kernel.path("user_npmrc")
|
|
116
|
+
// this.env.NPM_CONFIG_GLOBALCONFIG = this.kernel.path("global_npmrc")
|
|
117
|
+
// this.env.npm_config_userconfig = this.kernel.path("user_npmrc")
|
|
118
|
+
// this.env.npm_config_globalconfig = this.kernel.path("global_npmrc")
|
|
115
119
|
|
|
116
120
|
// First override this.env with system env
|
|
117
121
|
let system_env = await Environment.get(this.kernel.homedir)
|
package/package.json
CHANGED
package/server/index.js
CHANGED
|
@@ -2140,14 +2140,22 @@ class Server {
|
|
|
2140
2140
|
origin: '*'
|
|
2141
2141
|
}));
|
|
2142
2142
|
|
|
2143
|
-
|
|
2143
|
+
if (this.kernel.homedir) {
|
|
2144
|
+
this.app.use(express.static(this.kernel.path("web/public")))
|
|
2145
|
+
}
|
|
2144
2146
|
this.app.use(express.static(path.resolve(__dirname, 'public')));
|
|
2145
2147
|
this.app.use("/web", express.static(path.resolve(__dirname, "..", "..", "web")))
|
|
2146
2148
|
this.app.set('view engine', 'ejs');
|
|
2147
|
-
this.
|
|
2148
|
-
this.
|
|
2149
|
-
|
|
2150
|
-
|
|
2149
|
+
if (this.kernel.homedir) {
|
|
2150
|
+
this.app.set("views", [
|
|
2151
|
+
this.kernel.path("web/views"),
|
|
2152
|
+
path.resolve(__dirname, "views")
|
|
2153
|
+
])
|
|
2154
|
+
} else {
|
|
2155
|
+
this.app.set("views", [
|
|
2156
|
+
path.resolve(__dirname, "views")
|
|
2157
|
+
])
|
|
2158
|
+
}
|
|
2151
2159
|
this.app.use(express.json());
|
|
2152
2160
|
this.app.use(express.urlencoded({ extended: true }));
|
|
2153
2161
|
this.app.use(cookieParser());
|
|
@@ -255,7 +255,7 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
255
255
|
alert(res.error)
|
|
256
256
|
} else {
|
|
257
257
|
//location.href = location.href
|
|
258
|
-
document.
|
|
258
|
+
document.querySelector("#install-form").submit()
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
})
|
package/server/views/editor.ejs
CHANGED
|
@@ -770,7 +770,7 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
770
770
|
if (res.error) {
|
|
771
771
|
alert(res.error)
|
|
772
772
|
} else {
|
|
773
|
-
document.
|
|
773
|
+
document.querySelector("#install-form").submit()
|
|
774
774
|
//location.href = location.href
|
|
775
775
|
}
|
|
776
776
|
}
|
|
@@ -740,7 +740,7 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
740
740
|
alert(res.error)
|
|
741
741
|
} else {
|
|
742
742
|
//location.href = location.href
|
|
743
|
-
document.
|
|
743
|
+
document.querySelector("#install-form").submit()
|
|
744
744
|
}
|
|
745
745
|
}
|
|
746
746
|
})
|