@scalebun/react-native 1.6.4 → 1.7.0
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/scalebun.js +70 -8
- package/dist/scalebun.full.js +1 -1
- package/dist/scalebun.slim.js +1 -1
- package/lib/commonjs/core/constants/version.js +1 -1
- package/lib/module/core/constants/version.js +1 -1
- package/lib/typescript/core/constants/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/core/constants/version.ts +1 -1
package/bin/scalebun.js
CHANGED
|
@@ -866,6 +866,73 @@ function resolveOtaCli() {
|
|
|
866
866
|
}
|
|
867
867
|
}
|
|
868
868
|
|
|
869
|
+
/**
|
|
870
|
+
* Run the bundled CLI, showing a loader until it produces its first output.
|
|
871
|
+
*
|
|
872
|
+
* `npx scalebun <cmd>` pays npx + two Node startups + module loading (~0.5–1s)
|
|
873
|
+
* before anything appears — a blank terminal that reads as "hung". This spins a
|
|
874
|
+
* dependency-free loader in this (fast, dep-free) process while the CLI child
|
|
875
|
+
* boots, then clears it the instant the child writes.
|
|
876
|
+
*
|
|
877
|
+
* Only stdout is piped (so we can detect that first byte); stdin and stderr stay
|
|
878
|
+
* inherited, so masked token input and the delete/rollback confirmations — all of
|
|
879
|
+
* which key off `process.stdin.isTTY` — keep working. FORCE_COLOR keeps the
|
|
880
|
+
* child's colours despite the pipe. On a non-TTY (CI, pipes) we skip the loader
|
|
881
|
+
* and inherit everything, exactly as before.
|
|
882
|
+
*/
|
|
883
|
+
function runCli(cliEntry, args) {
|
|
884
|
+
const { spawn, spawnSync } = require('child_process');
|
|
885
|
+
|
|
886
|
+
if (!process.stdout.isTTY) {
|
|
887
|
+
const res = spawnSync(process.execPath, [cliEntry, ...args], { stdio: 'inherit' });
|
|
888
|
+
process.exit(res.status ?? 1);
|
|
889
|
+
return;
|
|
890
|
+
}
|
|
891
|
+
|
|
892
|
+
const env = { ...process.env };
|
|
893
|
+
if (!env.FORCE_COLOR) env.FORCE_COLOR = '1';
|
|
894
|
+
|
|
895
|
+
const child = spawn(process.execPath, [cliEntry, ...args], {
|
|
896
|
+
stdio: ['inherit', 'pipe', 'inherit'],
|
|
897
|
+
env,
|
|
898
|
+
});
|
|
899
|
+
|
|
900
|
+
const frames = ['⠋', '⠙', '⠹', '⠸', '⠼', '⠴', '⠦', '⠧', '⠇', '⠏'];
|
|
901
|
+
const label = ' Starting ScaleBun…';
|
|
902
|
+
let i = 0;
|
|
903
|
+
let spinning = true;
|
|
904
|
+
process.stdout.write('\x1b[?25l'); // hide cursor
|
|
905
|
+
const timer = setInterval(() => {
|
|
906
|
+
i = (i + 1) % frames.length;
|
|
907
|
+
process.stdout.write(`\r${paint(frames[i], C.cyan)}${label}`);
|
|
908
|
+
}, 80);
|
|
909
|
+
const stopSpinner = () => {
|
|
910
|
+
if (!spinning) return;
|
|
911
|
+
spinning = false;
|
|
912
|
+
clearInterval(timer);
|
|
913
|
+
// Erase the spinner line and restore the cursor.
|
|
914
|
+
process.stdout.write('\r' + ' '.repeat(label.length + 2) + '\r\x1b[?25h');
|
|
915
|
+
};
|
|
916
|
+
|
|
917
|
+
child.stdout.on('data', (chunk) => {
|
|
918
|
+
stopSpinner();
|
|
919
|
+
process.stdout.write(chunk);
|
|
920
|
+
});
|
|
921
|
+
child.on('error', () => {
|
|
922
|
+
stopSpinner();
|
|
923
|
+
process.exit(1);
|
|
924
|
+
});
|
|
925
|
+
child.on('exit', (code) => {
|
|
926
|
+
stopSpinner();
|
|
927
|
+
process.exit(code ?? 0);
|
|
928
|
+
});
|
|
929
|
+
// Defensive: never leave the terminal cursor hidden.
|
|
930
|
+
process.on('SIGINT', stopSpinner);
|
|
931
|
+
process.on('exit', () => {
|
|
932
|
+
if (spinning) process.stdout.write('\x1b[?25h');
|
|
933
|
+
});
|
|
934
|
+
}
|
|
935
|
+
|
|
869
936
|
/**
|
|
870
937
|
* Hand the invocation to @scalebun/cli, preserving argv and exit code.
|
|
871
938
|
* Falls back to an actionable install instruction when it is not present.
|
|
@@ -891,11 +958,7 @@ function delegateToOtaCli(argv) {
|
|
|
891
958
|
process.exit(2);
|
|
892
959
|
}
|
|
893
960
|
|
|
894
|
-
|
|
895
|
-
const res = spawnSync(process.execPath, [cliEntry, ...argv], {
|
|
896
|
-
stdio: 'inherit',
|
|
897
|
-
});
|
|
898
|
-
process.exit(res.status ?? 1);
|
|
961
|
+
runCli(cliEntry, argv);
|
|
899
962
|
}
|
|
900
963
|
|
|
901
964
|
/**
|
|
@@ -913,9 +976,8 @@ function printFullHelp() {
|
|
|
913
976
|
const cliEntry = resolveOtaCli();
|
|
914
977
|
if (cliEntry) {
|
|
915
978
|
// No args → the CLI prints its banner + status + full guided command list.
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
process.exit(res.status ?? 0);
|
|
979
|
+
runCli(cliEntry, []);
|
|
980
|
+
return;
|
|
919
981
|
}
|
|
920
982
|
|
|
921
983
|
// Fallback: CLI unresolvable — show at least the setup commands + how to fix.
|
package/dist/scalebun.full.js
CHANGED
package/dist/scalebun.slim.js
CHANGED
|
@@ -9,5 +9,5 @@ exports.SDK_VERSION = void 0;
|
|
|
9
9
|
* can attribute telemetry to the SDK build that produced it.
|
|
10
10
|
* Keep in sync with package.json "version".
|
|
11
11
|
*/
|
|
12
|
-
const SDK_VERSION = exports.SDK_VERSION = '1.
|
|
12
|
+
const SDK_VERSION = exports.SDK_VERSION = '1.7.0';
|
|
13
13
|
//# sourceMappingURL=version.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalebun/react-native",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "Production-grade React Native SDK for ScaleBun",
|
|
5
5
|
"main": "lib/commonjs/index",
|
|
6
6
|
"module": "lib/module/index",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"@babel/runtime": "^7.25.0",
|
|
106
106
|
"@jridgewell/sourcemap-codec": "1.5.5",
|
|
107
107
|
"@jridgewell/trace-mapping": "0.3.31",
|
|
108
|
-
"@scalebun/cli": "^1.
|
|
108
|
+
"@scalebun/cli": "^1.7.0"
|
|
109
109
|
},
|
|
110
110
|
"codegenConfig": {
|
|
111
111
|
"name": "ScaleBunSpec",
|