win_webview2 1.1.11 → 1.1.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/node/builder/versiontool.js +2 -1
- package/dist/node/tsExport/dirnameTool.d.ts +1 -1
- package/dist/node/tsExport/dirnameTool.js +9 -2
- package/package.json +2 -2
- package/src/srcNode/builder/versiontool.ts +3 -2
- package/src/srcNode/tsExport/dirnameTool.ts +10 -5
- package/src/srcNode/tsconfig.json +1 -1
- package/{src/srcNode/builder → srcInternal}/copyDll.ts +7 -10
- package/srcInternal/tsconfig.json +13 -0
|
@@ -13,7 +13,8 @@ karena package json mungkin gak ada
|
|
|
13
13
|
async function getWWvVersion() {
|
|
14
14
|
let result = "";
|
|
15
15
|
try {
|
|
16
|
-
let
|
|
16
|
+
let wwvModulePath = (0, dirnameTool_1.getWWVNodeModuleFolder)();
|
|
17
|
+
let jsonPath = node_path_1.default.join(wwvModulePath, "package.json");
|
|
17
18
|
let jsontxt = await (0, promises_1.readFile)(jsonPath, "utf-8");
|
|
18
19
|
let jsonObj = JSON.parse(jsontxt);
|
|
19
20
|
result = jsonObj.version;
|
|
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.getWw2Dirname = getWw2Dirname;
|
|
37
37
|
exports.findUserProjectRoot = findUserProjectRoot;
|
|
38
|
+
exports.getWWVNodeModuleFolder = getWWVNodeModuleFolder;
|
|
38
39
|
const node_url_1 = require("node:url");
|
|
39
40
|
const node_path_1 = __importStar(require("node:path"));
|
|
40
41
|
const node_fs_1 = require("node:fs");
|
|
@@ -55,8 +56,7 @@ function getWw2Dirname() {
|
|
|
55
56
|
const _dirname = typeof __dirname !== 'undefined'
|
|
56
57
|
? __dirname
|
|
57
58
|
: (0, node_path_1.dirname)(_filename);
|
|
58
|
-
|
|
59
|
-
return { _dirname, _filename, ww2ModulePath };
|
|
59
|
+
return { _dirname, _filename };
|
|
60
60
|
}
|
|
61
61
|
function findUserProjectRootRecrusive(currentDir = process.cwd()) {
|
|
62
62
|
const packagePath = node_path_1.default.join(currentDir, 'package.json');
|
|
@@ -77,3 +77,10 @@ function findUserProjectRoot() {
|
|
|
77
77
|
}
|
|
78
78
|
return findUserProjectRootRecrusive(process.cwd());
|
|
79
79
|
}
|
|
80
|
+
function getWWVNodeModuleFolder() {
|
|
81
|
+
let userRootProject = findUserProjectRoot();
|
|
82
|
+
if (userRootProject == null)
|
|
83
|
+
throw "root project user not found";
|
|
84
|
+
let nodeModuleFolder = node_path_1.default.join(userRootProject, "node_modules/win_webview2");
|
|
85
|
+
return nodeModuleFolder;
|
|
86
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "win_webview2",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.12",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/nnttoo/win_webview2"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"build_browser": "tsc -p ./src/srcBrowser/tsconfig.json",
|
|
30
30
|
"build_browser_watch": "npm run build_browser -- --watch",
|
|
31
31
|
"build_all" : "npm run build_node && npm run build_browser",
|
|
32
|
-
"copy_dll": "tsx ./
|
|
32
|
+
"copy_dll": "tsx ./srcInternal/copyDll.ts"
|
|
33
33
|
},
|
|
34
34
|
"author": "",
|
|
35
35
|
"license": "ISC",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { getWw2Dirname } from "../tsExport/dirnameTool";
|
|
2
|
+
import { getWw2Dirname, getWWVNodeModuleFolder } from "../tsExport/dirnameTool";
|
|
3
3
|
import { readFile } from "node:fs/promises";
|
|
4
4
|
|
|
5
5
|
|
|
@@ -10,7 +10,8 @@ export async function getWWvVersion(){
|
|
|
10
10
|
let result = "";
|
|
11
11
|
|
|
12
12
|
try {
|
|
13
|
-
let
|
|
13
|
+
let wwvModulePath = getWWVNodeModuleFolder();
|
|
14
|
+
let jsonPath = path.join(wwvModulePath,"package.json");
|
|
14
15
|
let jsontxt = await readFile(jsonPath,"utf-8");
|
|
15
16
|
let jsonObj = JSON.parse(jsontxt) as { version : string};
|
|
16
17
|
|
|
@@ -21,12 +21,9 @@ export function getWw2Dirname() {
|
|
|
21
21
|
const _dirname = typeof __dirname !== 'undefined'
|
|
22
22
|
? __dirname
|
|
23
23
|
: dirname(_filename);
|
|
24
|
+
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
let ww2ModulePath = path.join(_dirname,"../../../")
|
|
28
|
-
|
|
29
|
-
return { _dirname, _filename , ww2ModulePath};
|
|
26
|
+
return { _dirname, _filename };
|
|
30
27
|
}
|
|
31
28
|
|
|
32
29
|
function findUserProjectRootRecrusive(currentDir : string = process.cwd()) {
|
|
@@ -51,3 +48,11 @@ export function findUserProjectRoot() {
|
|
|
51
48
|
}
|
|
52
49
|
return findUserProjectRootRecrusive(process.cwd());
|
|
53
50
|
}
|
|
51
|
+
|
|
52
|
+
export function getWWVNodeModuleFolder(){
|
|
53
|
+
let userRootProject = findUserProjectRoot();
|
|
54
|
+
if(userRootProject == null) throw "root project user not found";
|
|
55
|
+
|
|
56
|
+
let nodeModuleFolder = path.join(userRootProject,"node_modules/win_webview2");
|
|
57
|
+
return nodeModuleFolder;
|
|
58
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { exec } from "node:child_process";
|
|
2
2
|
import { copyFile, mkdir } from "node:fs/promises";
|
|
3
|
-
import path from "node:path";
|
|
4
|
-
import { getWw2Dirname } from "../tsExport/dirnameTool";
|
|
3
|
+
import path from "node:path";
|
|
5
4
|
|
|
6
5
|
function debugDir(dirPath: string) {
|
|
7
6
|
exec("cd " + dirPath + "&& dir", (s, o) => {
|
|
@@ -13,15 +12,13 @@ function debugDir(dirPath: string) {
|
|
|
13
12
|
|
|
14
13
|
let result = "\n";
|
|
15
14
|
|
|
16
|
-
let
|
|
17
|
-
|
|
18
|
-
let ww2ModulePath = dirname.ww2ModulePath;
|
|
15
|
+
let ww2SourcePath = path.join(__dirname,"../");
|
|
19
16
|
|
|
20
17
|
let copyFromRoot = async (src: string, target: string) => {
|
|
21
18
|
try {
|
|
22
19
|
|
|
23
|
-
let rootPath = path.join(
|
|
24
|
-
console.log("ModulePath : ",
|
|
20
|
+
let rootPath = path.join(ww2SourcePath,"../");
|
|
21
|
+
console.log("ModulePath : ", ww2SourcePath);
|
|
25
22
|
console.log("rootPath : ", rootPath);
|
|
26
23
|
result += "\n" + target;
|
|
27
24
|
await copyFile(path.join(rootPath, src), path.join(rootPath, target));
|
|
@@ -31,13 +28,13 @@ function debugDir(dirPath: string) {
|
|
|
31
28
|
}
|
|
32
29
|
|
|
33
30
|
try{
|
|
34
|
-
await mkdir(path.join(
|
|
31
|
+
await mkdir(path.join(ww2SourcePath, "win_lib"));
|
|
35
32
|
|
|
36
33
|
} catch{
|
|
37
34
|
|
|
38
35
|
}
|
|
39
36
|
try{
|
|
40
|
-
await mkdir(path.join(
|
|
37
|
+
await mkdir(path.join(ww2SourcePath, "win_lib/Win32"));
|
|
41
38
|
|
|
42
39
|
} catch{
|
|
43
40
|
|
|
@@ -45,7 +42,7 @@ function debugDir(dirPath: string) {
|
|
|
45
42
|
|
|
46
43
|
try {
|
|
47
44
|
|
|
48
|
-
await mkdir(path.join(
|
|
45
|
+
await mkdir(path.join(ww2SourcePath, "win_lib/x64"));
|
|
49
46
|
} catch (error) {
|
|
50
47
|
|
|
51
48
|
}
|