yap2app 1.1.7 → 1.1.8
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/bin/cli.bundle.js +7 -5
- package/bin/cli.js +7 -5
- package/bridge.js +6 -5
- package/package.json +1 -1
package/bin/cli.bundle.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -7581,6 +7582,7 @@ var PORT = Number(process.env.YAP2APP_PORT) || 10420;
|
|
|
7581
7582
|
var PROJECT_ROOT = process.cwd();
|
|
7582
7583
|
var CLOUD_RELAY_URL = process.env.YAP2APP_CLOUD_URL || "https://yap2app-dot-cybage-hackathon.uc.r.appspot.com";
|
|
7583
7584
|
var PAIR_CODE = (process.env.YAP2APP_PAIR_CODE || "CYB-" + Math.floor(100 + Math.random() * 900)).toUpperCase();
|
|
7585
|
+
var CLI_VERSION = "1.1.8";
|
|
7584
7586
|
function safeResolvePath(baseDir, relativePath) {
|
|
7585
7587
|
const cleanRel = (relativePath || "").replace(/^[\\\/]+/, "");
|
|
7586
7588
|
const resolved = path2.resolve(baseDir, cleanRel);
|
|
@@ -7603,7 +7605,7 @@ function sendCloudRelayRequest(method, endpoint, payload) {
|
|
|
7603
7605
|
headers: {
|
|
7604
7606
|
"Content-Type": "application/json",
|
|
7605
7607
|
"Content-Length": Buffer.byteLength(body),
|
|
7606
|
-
"User-Agent":
|
|
7608
|
+
"User-Agent": `yap2app-cli/${CLI_VERSION}`
|
|
7607
7609
|
},
|
|
7608
7610
|
timeout: 6e3
|
|
7609
7611
|
}, (res) => {
|
|
@@ -7698,7 +7700,7 @@ var server = http.createServer(async (req, res) => {
|
|
|
7698
7700
|
res.end(JSON.stringify({
|
|
7699
7701
|
status: "healthy",
|
|
7700
7702
|
service: "yap2app-bridge",
|
|
7701
|
-
version:
|
|
7703
|
+
version: CLI_VERSION,
|
|
7702
7704
|
port: PORT,
|
|
7703
7705
|
pair_code: PAIR_CODE,
|
|
7704
7706
|
project_root: PROJECT_ROOT,
|
|
@@ -7817,7 +7819,7 @@ async function startBridge(port = PORT) {
|
|
|
7817
7819
|
server.listen(port, "0.0.0.0", () => {
|
|
7818
7820
|
console.log(`
|
|
7819
7821
|
---------------------------------------------------------------`);
|
|
7820
|
-
console.log(`Yap2App Bridge
|
|
7822
|
+
console.log(`Yap2App Bridge v${CLI_VERSION}`);
|
|
7821
7823
|
console.log(`Local Endpoint: http://127.0.0.1:${port}`);
|
|
7822
7824
|
console.log(`Active Workspace: ${PROJECT_ROOT}`);
|
|
7823
7825
|
console.log(`Pairing Code: ${PAIR_CODE}`);
|
|
@@ -7842,7 +7844,7 @@ async function startBridge(port = PORT) {
|
|
|
7842
7844
|
project_root: PROJECT_ROOT,
|
|
7843
7845
|
framework: initialContext.framework,
|
|
7844
7846
|
context: initialContext,
|
|
7845
|
-
version:
|
|
7847
|
+
version: CLI_VERSION
|
|
7846
7848
|
});
|
|
7847
7849
|
} catch (e) {
|
|
7848
7850
|
}
|
|
@@ -7855,7 +7857,7 @@ async function startBridge(port = PORT) {
|
|
|
7855
7857
|
project_root: PROJECT_ROOT,
|
|
7856
7858
|
framework: context.framework,
|
|
7857
7859
|
context,
|
|
7858
|
-
version:
|
|
7860
|
+
version: CLI_VERSION
|
|
7859
7861
|
});
|
|
7860
7862
|
if (hbResult && hbResult.data && hbResult.data.pending_writes_count > 0) {
|
|
7861
7863
|
const pollResult = await sendCloudRelayRequest("GET", `/api/v1/bridge/poll-writes?pair_code=${PAIR_CODE}`);
|
package/bin/cli.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { createRequire } from 'module'; const require = createRequire(import.meta.url);
|
|
2
3
|
var __create = Object.create;
|
|
3
4
|
var __defProp = Object.defineProperty;
|
|
4
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -7581,6 +7582,7 @@ var PORT = Number(process.env.YAP2APP_PORT) || 10420;
|
|
|
7581
7582
|
var PROJECT_ROOT = process.cwd();
|
|
7582
7583
|
var CLOUD_RELAY_URL = process.env.YAP2APP_CLOUD_URL || "https://yap2app-dot-cybage-hackathon.uc.r.appspot.com";
|
|
7583
7584
|
var PAIR_CODE = (process.env.YAP2APP_PAIR_CODE || "CYB-" + Math.floor(100 + Math.random() * 900)).toUpperCase();
|
|
7585
|
+
var CLI_VERSION = "1.1.8";
|
|
7584
7586
|
function safeResolvePath(baseDir, relativePath) {
|
|
7585
7587
|
const cleanRel = (relativePath || "").replace(/^[\\\/]+/, "");
|
|
7586
7588
|
const resolved = path2.resolve(baseDir, cleanRel);
|
|
@@ -7603,7 +7605,7 @@ function sendCloudRelayRequest(method, endpoint, payload) {
|
|
|
7603
7605
|
headers: {
|
|
7604
7606
|
"Content-Type": "application/json",
|
|
7605
7607
|
"Content-Length": Buffer.byteLength(body),
|
|
7606
|
-
"User-Agent":
|
|
7608
|
+
"User-Agent": `yap2app-cli/${CLI_VERSION}`
|
|
7607
7609
|
},
|
|
7608
7610
|
timeout: 6e3
|
|
7609
7611
|
}, (res) => {
|
|
@@ -7698,7 +7700,7 @@ var server = http.createServer(async (req, res) => {
|
|
|
7698
7700
|
res.end(JSON.stringify({
|
|
7699
7701
|
status: "healthy",
|
|
7700
7702
|
service: "yap2app-bridge",
|
|
7701
|
-
version:
|
|
7703
|
+
version: CLI_VERSION,
|
|
7702
7704
|
port: PORT,
|
|
7703
7705
|
pair_code: PAIR_CODE,
|
|
7704
7706
|
project_root: PROJECT_ROOT,
|
|
@@ -7817,7 +7819,7 @@ async function startBridge(port = PORT) {
|
|
|
7817
7819
|
server.listen(port, "0.0.0.0", () => {
|
|
7818
7820
|
console.log(`
|
|
7819
7821
|
---------------------------------------------------------------`);
|
|
7820
|
-
console.log(`Yap2App Bridge
|
|
7822
|
+
console.log(`Yap2App Bridge v${CLI_VERSION}`);
|
|
7821
7823
|
console.log(`Local Endpoint: http://127.0.0.1:${port}`);
|
|
7822
7824
|
console.log(`Active Workspace: ${PROJECT_ROOT}`);
|
|
7823
7825
|
console.log(`Pairing Code: ${PAIR_CODE}`);
|
|
@@ -7842,7 +7844,7 @@ async function startBridge(port = PORT) {
|
|
|
7842
7844
|
project_root: PROJECT_ROOT,
|
|
7843
7845
|
framework: initialContext.framework,
|
|
7844
7846
|
context: initialContext,
|
|
7845
|
-
version:
|
|
7847
|
+
version: CLI_VERSION
|
|
7846
7848
|
});
|
|
7847
7849
|
} catch (e) {
|
|
7848
7850
|
}
|
|
@@ -7855,7 +7857,7 @@ async function startBridge(port = PORT) {
|
|
|
7855
7857
|
project_root: PROJECT_ROOT,
|
|
7856
7858
|
framework: context.framework,
|
|
7857
7859
|
context,
|
|
7858
|
-
version:
|
|
7860
|
+
version: CLI_VERSION
|
|
7859
7861
|
});
|
|
7860
7862
|
if (hbResult && hbResult.data && hbResult.data.pending_writes_count > 0) {
|
|
7861
7863
|
const pollResult = await sendCloudRelayRequest("GET", `/api/v1/bridge/poll-writes?pair_code=${PAIR_CODE}`);
|
package/bridge.js
CHANGED
|
@@ -17,6 +17,7 @@ const PORT = Number(process.env.YAP2APP_PORT) || 10420;
|
|
|
17
17
|
const PROJECT_ROOT = process.cwd();
|
|
18
18
|
const CLOUD_RELAY_URL = process.env.YAP2APP_CLOUD_URL || 'https://yap2app-dot-cybage-hackathon.uc.r.appspot.com';
|
|
19
19
|
const PAIR_CODE = (process.env.YAP2APP_PAIR_CODE || ('CYB-' + Math.floor(100 + Math.random() * 900))).toUpperCase();
|
|
20
|
+
const CLI_VERSION = '1.1.8';
|
|
20
21
|
|
|
21
22
|
/**
|
|
22
23
|
* Validates and resolves relative file paths strictly inside PROJECT_ROOT.
|
|
@@ -46,7 +47,7 @@ function sendCloudRelayRequest(method, endpoint, payload) {
|
|
|
46
47
|
headers: {
|
|
47
48
|
'Content-Type': 'application/json',
|
|
48
49
|
'Content-Length': Buffer.byteLength(body),
|
|
49
|
-
'User-Agent':
|
|
50
|
+
'User-Agent': `yap2app-cli/${CLI_VERSION}`
|
|
50
51
|
},
|
|
51
52
|
timeout: 6000
|
|
52
53
|
}, (res) => {
|
|
@@ -163,7 +164,7 @@ const server = http.createServer(async (req, res) => {
|
|
|
163
164
|
res.end(JSON.stringify({
|
|
164
165
|
status: 'healthy',
|
|
165
166
|
service: 'yap2app-bridge',
|
|
166
|
-
version:
|
|
167
|
+
version: CLI_VERSION,
|
|
167
168
|
port: PORT,
|
|
168
169
|
pair_code: PAIR_CODE,
|
|
169
170
|
project_root: PROJECT_ROOT,
|
|
@@ -297,7 +298,7 @@ server.on('error', (err) => {
|
|
|
297
298
|
export async function startBridge(port = PORT) {
|
|
298
299
|
server.listen(port, '0.0.0.0', () => {
|
|
299
300
|
console.log(`\n---------------------------------------------------------------`);
|
|
300
|
-
console.log(`Yap2App Bridge
|
|
301
|
+
console.log(`Yap2App Bridge v${CLI_VERSION}`);
|
|
301
302
|
console.log(`Local Endpoint: http://127.0.0.1:${port}`);
|
|
302
303
|
console.log(`Active Workspace: ${PROJECT_ROOT}`);
|
|
303
304
|
console.log(`Pairing Code: ${PAIR_CODE}`);
|
|
@@ -321,7 +322,7 @@ export async function startBridge(port = PORT) {
|
|
|
321
322
|
project_root: PROJECT_ROOT,
|
|
322
323
|
framework: initialContext.framework,
|
|
323
324
|
context: initialContext,
|
|
324
|
-
version:
|
|
325
|
+
version: CLI_VERSION
|
|
325
326
|
});
|
|
326
327
|
} catch (e) {}
|
|
327
328
|
|
|
@@ -335,7 +336,7 @@ export async function startBridge(port = PORT) {
|
|
|
335
336
|
project_root: PROJECT_ROOT,
|
|
336
337
|
framework: context.framework,
|
|
337
338
|
context: context,
|
|
338
|
-
version:
|
|
339
|
+
version: CLI_VERSION
|
|
339
340
|
});
|
|
340
341
|
|
|
341
342
|
// If pending write tasks, fetch and execute them on local disk
|