yaver-cli 1.99.2 → 1.99.4
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/package.json +3 -2
- package/src/commands/doctor.js +10 -1
- package/src/commands/push.js +28 -14
- package/src/index.js +8 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "yaver-cli",
|
|
3
|
-
"version": "1.99.
|
|
3
|
+
"version": "1.99.4",
|
|
4
4
|
"mcpName": "io.github.kivanccakmak/yaver",
|
|
5
5
|
"description": "Unified npm bootstrap for the Yaver agent, SDK injection, and local-first developer runtime",
|
|
6
6
|
"bin": {
|
|
@@ -38,6 +38,7 @@
|
|
|
38
38
|
"node": ">=18"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"semver": "^7.6.0"
|
|
41
|
+
"semver": "^7.6.0",
|
|
42
|
+
"yaver-mobile-headless": "^0.1.0"
|
|
42
43
|
}
|
|
43
44
|
}
|
package/src/commands/doctor.js
CHANGED
|
@@ -2,7 +2,7 @@ const fs = require('fs');
|
|
|
2
2
|
const { analyzeProject } = require('../analyzer');
|
|
3
3
|
const { loadSDKManifest } = require('../sdk-manifest');
|
|
4
4
|
|
|
5
|
-
async function doctor() {
|
|
5
|
+
async function doctor(options = {}) {
|
|
6
6
|
if (!fs.existsSync('package.json')) {
|
|
7
7
|
console.error('❌ No package.json found. Run this from your RN project root.');
|
|
8
8
|
process.exit(1);
|
|
@@ -84,6 +84,15 @@ async function doctor() {
|
|
|
84
84
|
console.log(` ${analysis.missingModules.length} missing (push with --ignore-missing)`);
|
|
85
85
|
console.log(` ${analysis.warnings.length} warnings`);
|
|
86
86
|
console.log(` ${hardErrors.length} critical issues\n`);
|
|
87
|
+
|
|
88
|
+
if (options.strict) {
|
|
89
|
+
const failCount = hardErrors.length + analysis.missingModules.length;
|
|
90
|
+
if (failCount > 0) {
|
|
91
|
+
console.error(`❌ doctor --strict: ${hardErrors.length} critical issue(s), ${analysis.missingModules.length} missing module(s)`);
|
|
92
|
+
process.exit(1);
|
|
93
|
+
}
|
|
94
|
+
console.log('✅ doctor --strict: project is Yaver-compatible');
|
|
95
|
+
}
|
|
87
96
|
}
|
|
88
97
|
|
|
89
98
|
module.exports = { doctor };
|
package/src/commands/push.js
CHANGED
|
@@ -12,19 +12,26 @@ async function push(options = {}) {
|
|
|
12
12
|
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf8'));
|
|
13
13
|
const sdkManifest = loadSDKManifest();
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
if (!
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
15
|
+
let device = null;
|
|
16
|
+
let platform = options.platform || 'ios';
|
|
17
|
+
|
|
18
|
+
if (!options.bundleOnly) {
|
|
19
|
+
// Find device
|
|
20
|
+
if (!quiet) console.log('📡 Finding device...');
|
|
21
|
+
device = await discoverDevice(options.device);
|
|
22
|
+
if (!quiet) console.log(`✅ Found: ${device.name} (${device.ip})`);
|
|
23
|
+
|
|
24
|
+
// Fetch health + verify SDK
|
|
25
|
+
const health = await fetchHealth(device);
|
|
26
|
+
platform = health.platform || 'ios';
|
|
27
|
+
|
|
28
|
+
if (health.hermes?.bytecodeVersion !== sdkManifest.hermes.bytecodeVersion) {
|
|
29
|
+
console.error(`❌ Hermes BC mismatch: device BC${health.hermes?.bytecodeVersion}, CLI BC${sdkManifest.hermes.bytecodeVersion}`);
|
|
30
|
+
console.error(' Update the npm package or the yaver.io app.');
|
|
31
|
+
process.exit(1);
|
|
32
|
+
}
|
|
33
|
+
} else if (!quiet) {
|
|
34
|
+
console.log(`📦 Bundle-only mode (no device push, platform=${platform})`);
|
|
28
35
|
}
|
|
29
36
|
|
|
30
37
|
// Analyze compatibility
|
|
@@ -65,9 +72,16 @@ async function push(options = {}) {
|
|
|
65
72
|
process.exit(1);
|
|
66
73
|
}
|
|
67
74
|
|
|
68
|
-
// Push
|
|
69
75
|
const moduleName = getModuleName(pkg);
|
|
70
76
|
const bundleData = fs.readFileSync(bundlePath);
|
|
77
|
+
|
|
78
|
+
if (options.bundleOnly) {
|
|
79
|
+
const elapsed = ((Date.now() - startTime) / 1000).toFixed(1);
|
|
80
|
+
if (!quiet) console.log(`\n📦 Bundle ready in ${elapsed}s — ${(bundleData.length / 1024).toFixed(1)} KB at ${bundlePath}\n`);
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
// Push
|
|
71
85
|
if (!quiet) console.log(`📤 Pushing ${(bundleData.length / 1024).toFixed(1)} KB...`);
|
|
72
86
|
|
|
73
87
|
const result = await pushBundle(device, bundleData, {
|
package/src/index.js
CHANGED
|
@@ -15,7 +15,8 @@ Commands:
|
|
|
15
15
|
init Analyze project, show compatibility, create yaver.json
|
|
16
16
|
push [--device <ip>] [--watch] Bundle + validate + push to device
|
|
17
17
|
push --ignore-missing Push even with missing native modules
|
|
18
|
-
|
|
18
|
+
push --bundle-only [--platform P] Bundle + Hermes compile without pushing (CI)
|
|
19
|
+
doctor [--strict] Deep compatibility report (non-zero exit in --strict)
|
|
19
20
|
devices List discovered devices
|
|
20
21
|
modules List all SDK native modules
|
|
21
22
|
reset [--device <ip>] Clear pushed bundle on device
|
|
@@ -161,6 +162,12 @@ function parseArgs(args) {
|
|
|
161
162
|
opts.watch = true;
|
|
162
163
|
} else if (arg === '--ignore-missing') {
|
|
163
164
|
opts.ignoreMissing = true;
|
|
165
|
+
} else if (arg === '--strict') {
|
|
166
|
+
opts.strict = true;
|
|
167
|
+
} else if (arg === '--bundle-only') {
|
|
168
|
+
opts.bundleOnly = true;
|
|
169
|
+
} else if (arg === '--platform' && args[i + 1]) {
|
|
170
|
+
opts.platform = args[++i];
|
|
164
171
|
} else if (arg === '--force') {
|
|
165
172
|
opts.force = true;
|
|
166
173
|
} else if (arg === '--quiet' || arg === '-q') {
|