scripting-cli 1.1.2 → 1.1.3
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 +5 -1
- package/package.json +4 -2
- package/src/index.ts +5 -1
package/dist/index.js
CHANGED
|
@@ -27,6 +27,7 @@ const crypto_1 = __importDefault(require("crypto"));
|
|
|
27
27
|
const chalk_1 = __importDefault(require("chalk"));
|
|
28
28
|
const child_process_1 = __importDefault(require("child_process"));
|
|
29
29
|
const os_1 = __importDefault(require("os"));
|
|
30
|
+
const qrcode_terminal_1 = __importDefault(require("qrcode-terminal"));
|
|
30
31
|
const app = (0, express_1.default)();
|
|
31
32
|
const server = http_1.default.createServer(app);
|
|
32
33
|
const io = new socket_io_1.Server(server);
|
|
@@ -80,6 +81,7 @@ function startServer(port) {
|
|
|
80
81
|
"skipLibCheck": true,
|
|
81
82
|
"jsx": "react",
|
|
82
83
|
"jsxFactory": "createElement",
|
|
84
|
+
"jsxFragmentFactory": "Fragment",
|
|
83
85
|
"paths": {
|
|
84
86
|
"scripting": [
|
|
85
87
|
"./dts/scripting.d.ts"
|
|
@@ -367,7 +369,9 @@ function startServer(port) {
|
|
|
367
369
|
createVSCodeSettings(); // Create vscode settings.json when the server starts
|
|
368
370
|
const ipAddress = ip_1.default.address();
|
|
369
371
|
const address = `http://${ipAddress}:${PORT}`;
|
|
370
|
-
console.log(`Server listening on ${chalk_1.default.bold.blue(address)}\nYou can select this server in the Scripting app to connect
|
|
372
|
+
console.log(`Server listening on ${chalk_1.default.bold.blue(address)}\nYou can select this server in the Scripting app to connect.\n`);
|
|
373
|
+
console.log(`Alternatively, you can ${chalk_1.default.green.bold("use the Scripting app to scan")} the QR code and connect: `);
|
|
374
|
+
qrcode_terminal_1.default.generate(address, { small: true });
|
|
371
375
|
bonjour.publish({ name: 'Scripting-service', type: 'http', port: PORT });
|
|
372
376
|
process.on('SIGINT', () => {
|
|
373
377
|
bonjour.unpublishAll(() => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "scripting-cli",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.3",
|
|
4
4
|
"description": "This plugin integrates the desktop editor synchronization feature of the Scripting app.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -32,6 +32,7 @@
|
|
|
32
32
|
"chokidar": "^4.0.3",
|
|
33
33
|
"express": "^4.21.2",
|
|
34
34
|
"ip": "^2.0.1",
|
|
35
|
+
"qrcode-terminal": "^0.12.0",
|
|
35
36
|
"socket.io": "^4.8.1",
|
|
36
37
|
"typescript": "^5.7.3",
|
|
37
38
|
"yargs": "^17.7.2"
|
|
@@ -41,8 +42,9 @@
|
|
|
41
42
|
"@types/express": "^5.0.0",
|
|
42
43
|
"@types/ip": "^1.1.3",
|
|
43
44
|
"@types/node": "^22.13.4",
|
|
45
|
+
"@types/qrcode-terminal": "^0.12.2",
|
|
44
46
|
"@types/socket.io": "^3.0.2",
|
|
45
47
|
"@types/yargs": "^17.0.33",
|
|
46
48
|
"ts-node": "^10.9.2"
|
|
47
49
|
}
|
|
48
|
-
}
|
|
50
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -13,6 +13,7 @@ import crypto from 'crypto';
|
|
|
13
13
|
import chalk from 'chalk';
|
|
14
14
|
import childProcess from 'child_process';
|
|
15
15
|
import os from 'os';
|
|
16
|
+
import qrcode from 'qrcode-terminal';
|
|
16
17
|
|
|
17
18
|
const app = express();
|
|
18
19
|
const server = http.createServer(app);
|
|
@@ -441,7 +442,10 @@ function startServer(port?: number) {
|
|
|
441
442
|
const ipAddress = ip.address()
|
|
442
443
|
const address = `http://${ipAddress}:${PORT}`;
|
|
443
444
|
|
|
444
|
-
console.log(`Server listening on ${chalk.bold.blue(address)}\nYou can select this server in the Scripting app to connect
|
|
445
|
+
console.log(`Server listening on ${chalk.bold.blue(address)}\nYou can select this server in the Scripting app to connect.\n`);
|
|
446
|
+
|
|
447
|
+
console.log(`Alternatively, you can ${chalk.green.bold("use the Scripting app to scan")} the QR code and connect: `);
|
|
448
|
+
qrcode.generate(address, { small: true });
|
|
445
449
|
|
|
446
450
|
bonjour.publish({ name: 'Scripting-service', type: 'http', port: PORT });
|
|
447
451
|
|