clickgo-native 0.0.5-dev5 → 0.0.7-dev7
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.js +21 -11
- package/dist/index.ts +1 -1
- package/dist/lib/fs.js +33 -21
- package/dist/lib/fs.ts +4 -1
- package/dist/lib/tool.js +1 -2
- package/dist/pre.js +17 -7
- package/package.json +1 -1
- package/types/loader.d.ts +10 -0
package/dist/index.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -32,7 +42,9 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
42
|
});
|
|
33
43
|
};
|
|
34
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.
|
|
45
|
+
exports.AbstractBoot = exports.tool = exports.fs = void 0;
|
|
46
|
+
exports.launcher = launcher;
|
|
47
|
+
exports.verifyToken = verifyToken;
|
|
36
48
|
const electron = __importStar(require("electron"));
|
|
37
49
|
const path = __importStar(require("path"));
|
|
38
50
|
const libFs = __importStar(require("./lib/fs"));
|
|
@@ -388,7 +400,6 @@ function launcher(boot) {
|
|
|
388
400
|
return;
|
|
389
401
|
});
|
|
390
402
|
}
|
|
391
|
-
exports.launcher = launcher;
|
|
392
403
|
electron.Menu.setApplicationMenu(null);
|
|
393
404
|
electron.ipcMain.handle('pre', function (e, name, ...param) {
|
|
394
405
|
if (!methods[name]) {
|
|
@@ -406,7 +417,6 @@ function verifyToken(t) {
|
|
|
406
417
|
}
|
|
407
418
|
return true;
|
|
408
419
|
}
|
|
409
|
-
exports.verifyToken = verifyToken;
|
|
410
420
|
function createForm(p) {
|
|
411
421
|
const op = {
|
|
412
422
|
'webPreferences': {
|
|
@@ -436,7 +446,7 @@ function createForm(p) {
|
|
|
436
446
|
}
|
|
437
447
|
form.show();
|
|
438
448
|
});
|
|
439
|
-
if (p.startsWith('https://')) {
|
|
449
|
+
if (p.startsWith('https://') || p.startsWith('http://')) {
|
|
440
450
|
form.loadURL(p).catch(function (e) {
|
|
441
451
|
throw e;
|
|
442
452
|
});
|
package/dist/index.ts
CHANGED
package/dist/lib/fs.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
36
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
37
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -32,7 +42,19 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
32
42
|
});
|
|
33
43
|
};
|
|
34
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
35
|
-
exports.
|
|
45
|
+
exports.refreshDrives = refreshDrives;
|
|
46
|
+
exports.getContent = getContent;
|
|
47
|
+
exports.putContent = putContent;
|
|
48
|
+
exports.readLink = readLink;
|
|
49
|
+
exports.symlink = symlink;
|
|
50
|
+
exports.unlink = unlink;
|
|
51
|
+
exports.stats = stats;
|
|
52
|
+
exports.mkdir = mkdir;
|
|
53
|
+
exports.rmdir = rmdir;
|
|
54
|
+
exports.chmod = chmod;
|
|
55
|
+
exports.rename = rename;
|
|
56
|
+
exports.readDir = readDir;
|
|
57
|
+
exports.copyFile = copyFile;
|
|
36
58
|
const fs = __importStar(require("fs"));
|
|
37
59
|
const tool = __importStar(require("./tool"));
|
|
38
60
|
const platform = process.platform;
|
|
@@ -63,7 +85,6 @@ function refreshDrives() {
|
|
|
63
85
|
}
|
|
64
86
|
});
|
|
65
87
|
}
|
|
66
|
-
exports.refreshDrives = refreshDrives;
|
|
67
88
|
function getContent(path, options) {
|
|
68
89
|
return __awaiter(this, void 0, void 0, function* () {
|
|
69
90
|
path = formatPath(path);
|
|
@@ -79,6 +100,9 @@ function getContent(path, options) {
|
|
|
79
100
|
});
|
|
80
101
|
const data = [];
|
|
81
102
|
rs.on('data', function (chunk) {
|
|
103
|
+
if (!(chunk instanceof Buffer)) {
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
82
106
|
data.push(chunk);
|
|
83
107
|
}).on('end', function () {
|
|
84
108
|
const buf = Buffer.concat(data);
|
|
@@ -110,7 +134,6 @@ function getContent(path, options) {
|
|
|
110
134
|
}
|
|
111
135
|
});
|
|
112
136
|
}
|
|
113
|
-
exports.getContent = getContent;
|
|
114
137
|
function putContent(path, data, options) {
|
|
115
138
|
return __awaiter(this, void 0, void 0, function* () {
|
|
116
139
|
path = formatPath(path);
|
|
@@ -123,7 +146,6 @@ function putContent(path, data, options) {
|
|
|
123
146
|
}
|
|
124
147
|
});
|
|
125
148
|
}
|
|
126
|
-
exports.putContent = putContent;
|
|
127
149
|
function readLink(path, encoding) {
|
|
128
150
|
return __awaiter(this, void 0, void 0, function* () {
|
|
129
151
|
path = formatPath(path);
|
|
@@ -137,7 +159,6 @@ function readLink(path, encoding) {
|
|
|
137
159
|
}
|
|
138
160
|
});
|
|
139
161
|
}
|
|
140
|
-
exports.readLink = readLink;
|
|
141
162
|
function symlink(filePath, linkPath, type) {
|
|
142
163
|
return __awaiter(this, void 0, void 0, function* () {
|
|
143
164
|
filePath = formatPath(filePath);
|
|
@@ -151,7 +172,6 @@ function symlink(filePath, linkPath, type) {
|
|
|
151
172
|
}
|
|
152
173
|
});
|
|
153
174
|
}
|
|
154
|
-
exports.symlink = symlink;
|
|
155
175
|
function unlink(path) {
|
|
156
176
|
return __awaiter(this, void 0, void 0, function* () {
|
|
157
177
|
path = formatPath(path);
|
|
@@ -173,7 +193,6 @@ function unlink(path) {
|
|
|
173
193
|
}
|
|
174
194
|
});
|
|
175
195
|
}
|
|
176
|
-
exports.unlink = unlink;
|
|
177
196
|
function stats(path) {
|
|
178
197
|
return __awaiter(this, void 0, void 0, function* () {
|
|
179
198
|
path = formatPath(path);
|
|
@@ -200,7 +219,6 @@ function stats(path) {
|
|
|
200
219
|
}
|
|
201
220
|
});
|
|
202
221
|
}
|
|
203
|
-
exports.stats = stats;
|
|
204
222
|
function mkdir(path, mode) {
|
|
205
223
|
return __awaiter(this, void 0, void 0, function* () {
|
|
206
224
|
path = formatPath(path);
|
|
@@ -220,7 +238,6 @@ function mkdir(path, mode) {
|
|
|
220
238
|
}
|
|
221
239
|
});
|
|
222
240
|
}
|
|
223
|
-
exports.mkdir = mkdir;
|
|
224
241
|
function rmdir(path) {
|
|
225
242
|
return __awaiter(this, void 0, void 0, function* () {
|
|
226
243
|
path = formatPath(path);
|
|
@@ -237,7 +254,6 @@ function rmdir(path) {
|
|
|
237
254
|
}
|
|
238
255
|
});
|
|
239
256
|
}
|
|
240
|
-
exports.rmdir = rmdir;
|
|
241
257
|
function chmod(path, mod) {
|
|
242
258
|
return __awaiter(this, void 0, void 0, function* () {
|
|
243
259
|
path = formatPath(path);
|
|
@@ -250,7 +266,6 @@ function chmod(path, mod) {
|
|
|
250
266
|
}
|
|
251
267
|
});
|
|
252
268
|
}
|
|
253
|
-
exports.chmod = chmod;
|
|
254
269
|
function rename(oldPath, newPath) {
|
|
255
270
|
return __awaiter(this, void 0, void 0, function* () {
|
|
256
271
|
oldPath = formatPath(oldPath);
|
|
@@ -264,7 +279,6 @@ function rename(oldPath, newPath) {
|
|
|
264
279
|
}
|
|
265
280
|
});
|
|
266
281
|
}
|
|
267
|
-
exports.rename = rename;
|
|
268
282
|
function readDir(path, encoding) {
|
|
269
283
|
return __awaiter(this, void 0, void 0, function* () {
|
|
270
284
|
try {
|
|
@@ -307,7 +321,6 @@ function readDir(path, encoding) {
|
|
|
307
321
|
}
|
|
308
322
|
});
|
|
309
323
|
}
|
|
310
|
-
exports.readDir = readDir;
|
|
311
324
|
function copyFile(src, dest) {
|
|
312
325
|
return __awaiter(this, void 0, void 0, function* () {
|
|
313
326
|
src = formatPath(src);
|
|
@@ -321,4 +334,3 @@ function copyFile(src, dest) {
|
|
|
321
334
|
}
|
|
322
335
|
});
|
|
323
336
|
}
|
|
324
|
-
exports.copyFile = copyFile;
|
package/dist/lib/fs.ts
CHANGED
|
@@ -56,7 +56,10 @@ export async function getContent(
|
|
|
56
56
|
'end': end
|
|
57
57
|
});
|
|
58
58
|
const data: Buffer[] = [];
|
|
59
|
-
rs.on('data', function(chunk
|
|
59
|
+
rs.on('data', function(chunk) {
|
|
60
|
+
if (!(chunk instanceof Buffer)) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
60
63
|
data.push(chunk);
|
|
61
64
|
}).on('end', function() {
|
|
62
65
|
const buf = Buffer.concat(data);
|
package/dist/lib/tool.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sleep =
|
|
3
|
+
exports.sleep = sleep;
|
|
4
4
|
function sleep(ms) {
|
|
5
5
|
return new Promise(function (resolve) {
|
|
6
6
|
setTimeout(function () {
|
|
@@ -8,4 +8,3 @@ function sleep(ms) {
|
|
|
8
8
|
}, ms);
|
|
9
9
|
});
|
|
10
10
|
}
|
|
11
|
-
exports.sleep = sleep;
|
package/dist/pre.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
const electron = __importStar(require("electron"));
|
|
27
37
|
electron.contextBridge.exposeInMainWorld('clickgoNative', {
|
package/package.json
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as litertLoader from '@litert/loader';
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
type ILoader = litertLoader.ILoader;
|
|
5
|
+
type ILoaderUrl = litertLoader.ILoaderUrl;
|
|
6
|
+
|
|
7
|
+
const loader: typeof litertLoader.loader;
|
|
8
|
+
const __invoke: typeof litertLoader.__invoke;
|
|
9
|
+
const __preprocess: typeof litertLoader.__preprocess;
|
|
10
|
+
}
|