kasy-cli 1.19.0 → 1.19.1
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/kasy.js
CHANGED
|
@@ -354,8 +354,9 @@ function buildProgram(language) {
|
|
|
354
354
|
.argument('[directory]', 'Project folder (default: current directory)', '.')
|
|
355
355
|
.option('--ios', 'Run on iOS simulator/device')
|
|
356
356
|
.option('--android', 'Run on Android emulator/device')
|
|
357
|
-
.option('--web', 'Run on
|
|
358
|
-
.option('--
|
|
357
|
+
.option('--web', 'Run on web — prints localhost URL in lime so you open it in your own browser (your extensions, your accounts)')
|
|
358
|
+
.option('--open', 'With --web: auto-launch a clean Chrome window (Flutter profile, no extensions) instead of just printing the URL')
|
|
359
|
+
.option('--web-port <port>', 'Fixed port for web (default 5555) — keeps the origin stable so Firebase Auth sessions persist between runs')
|
|
359
360
|
.option('-d, --device <id>', 'Run on specific device ID')
|
|
360
361
|
.option('--prod', 'Use production dart-defines (from launch.json)')
|
|
361
362
|
.option('--no-defines', 'Skip dart-defines from launch.json')
|
package/lib/commands/run.js
CHANGED
|
@@ -4,7 +4,7 @@ const fs = require('fs-extra');
|
|
|
4
4
|
const kleur = require('kleur');
|
|
5
5
|
const ui = require('../utils/ui');
|
|
6
6
|
const { createTranslator, detectDefaultLanguage } = require('../utils/i18n');
|
|
7
|
-
const { printCompactHeader } = require('../utils/brand');
|
|
7
|
+
const { printCompactHeader, paintLime } = require('../utils/brand');
|
|
8
8
|
const { spawnFlutterWithSpinner } = require('../utils/flutter-run');
|
|
9
9
|
|
|
10
10
|
function listFlutterDevices(projectDir) {
|
|
@@ -252,9 +252,19 @@ async function runRun(directory, options = {}) {
|
|
|
252
252
|
let resolvedDeviceLabel = null;
|
|
253
253
|
let pickedDevice = null;
|
|
254
254
|
let isChromeTarget = false;
|
|
255
|
+
let isWebServerTarget = false;
|
|
255
256
|
if (options.web) {
|
|
256
|
-
|
|
257
|
-
|
|
257
|
+
// Default: web-server (no auto-launched Chrome window with a throwaway
|
|
258
|
+
// profile). The URL is printed in lime so the user opens it in their own
|
|
259
|
+
// browser — keeping access to extensions, logged-in accounts, etc.
|
|
260
|
+
// Pass --open to fall back to flutter's auto-Chrome behavior.
|
|
261
|
+
if (options.open) {
|
|
262
|
+
isChromeTarget = true;
|
|
263
|
+
deviceArgs.push('-d', 'chrome');
|
|
264
|
+
} else {
|
|
265
|
+
isWebServerTarget = true;
|
|
266
|
+
deviceArgs.push('-d', 'web-server');
|
|
267
|
+
}
|
|
258
268
|
} else if (options.ios) {
|
|
259
269
|
deviceArgs.push('-d', 'ios');
|
|
260
270
|
} else if (options.android) {
|
|
@@ -281,7 +291,7 @@ async function runRun(directory, options = {}) {
|
|
|
281
291
|
}
|
|
282
292
|
}
|
|
283
293
|
|
|
284
|
-
if (isChromeTarget) {
|
|
294
|
+
if (isChromeTarget || isWebServerTarget) {
|
|
285
295
|
// Pin a fixed port so the Chrome origin stays the same between runs.
|
|
286
296
|
// Firebase Auth persists sessions per-origin (IndexedDB) — a random port
|
|
287
297
|
// each run means the user gets logged out every restart.
|
|
@@ -320,7 +330,7 @@ async function runRun(directory, options = {}) {
|
|
|
320
330
|
const envDefine = dartDefines.find((a) => a.startsWith('--dart-define=ENV='));
|
|
321
331
|
const envValue = envDefine ? envDefine.split('=').pop() : null;
|
|
322
332
|
const deviceLabel = options.web
|
|
323
|
-
? 'chrome'
|
|
333
|
+
? (isWebServerTarget ? 'web-server' : 'chrome')
|
|
324
334
|
: options.ios
|
|
325
335
|
? 'ios'
|
|
326
336
|
: options.android
|
|
@@ -333,6 +343,11 @@ async function runRun(directory, options = {}) {
|
|
|
333
343
|
|
|
334
344
|
printCompactHeader(t);
|
|
335
345
|
console.log(kleur.bold(`${t('run.launching')}${summary}`));
|
|
346
|
+
if (isWebServerTarget) {
|
|
347
|
+
const url = `http://localhost:${options.webPort || '5555'}`;
|
|
348
|
+
console.log(` ${paintLime(`✦ ${t('run.web.open')}: ${url}`)}`);
|
|
349
|
+
console.log(kleur.dim(` ${t('run.web.openHint')}`));
|
|
350
|
+
}
|
|
336
351
|
if (rcInfo && rcInfo.mode !== 'legacy') {
|
|
337
352
|
const mode = (options.rc || 'auto').toLowerCase();
|
|
338
353
|
let label;
|
|
@@ -716,6 +716,8 @@ module.exports = {
|
|
|
716
716
|
// run command
|
|
717
717
|
'cli.command.run.description': 'Run your app on phone, simulator, or browser',
|
|
718
718
|
'run.launching': 'Launching Flutter app...',
|
|
719
|
+
'run.web.open': 'Open in your browser',
|
|
720
|
+
'run.web.openHint': 'Cmd+click the link above (or copy/paste it). Use --open to auto-launch a dedicated Flutter Chrome window instead.',
|
|
719
721
|
'run.prompt.pickDevice': 'Multiple devices detected. Which one do you want to run on?',
|
|
720
722
|
'run.warn.nothingSelected': 'No device selected.',
|
|
721
723
|
'run.updateHint.prefix': 'Project improvements available —',
|
|
@@ -749,6 +749,8 @@ module.exports = {
|
|
|
749
749
|
'reset.warn.launcherCacheFailed': 'No se pudo limpiar la caché del launcher.',
|
|
750
750
|
'reset.warn.launcherNotDetected': 'Launcher por defecto no detectado — saltando limpieza de caché.',
|
|
751
751
|
'run.launching': 'Iniciando app Flutter...',
|
|
752
|
+
'run.web.open': 'Abre en tu navegador',
|
|
753
|
+
'run.web.openHint': 'Cmd+clic en el enlace de arriba (o copia/pega). Usa --open para abrir automáticamente una ventana dedicada de Chrome de Flutter.',
|
|
752
754
|
'run.prompt.pickDevice': 'Varios dispositivos detectados. ¿En cuál quieres ejecutar?',
|
|
753
755
|
'run.warn.nothingSelected': 'Ningún dispositivo seleccionado.',
|
|
754
756
|
'run.updateHint.prefix': 'Mejoras disponibles para el proyecto —',
|
|
@@ -749,6 +749,8 @@ module.exports = {
|
|
|
749
749
|
'reset.warn.launcherCacheFailed': 'Não foi possível limpar o cache do launcher.',
|
|
750
750
|
'reset.warn.launcherNotDetected': 'Launcher padrão não detectado — pulando limpeza de cache.',
|
|
751
751
|
'run.launching': 'Iniciando app Flutter...',
|
|
752
|
+
'run.web.open': 'Abra no seu navegador',
|
|
753
|
+
'run.web.openHint': 'Cmd+clique no link acima (ou copie e cole). Use --open pra abrir automaticamente num Chrome dedicado do Flutter.',
|
|
752
754
|
'run.prompt.pickDevice': 'Vários dispositivos detectados. Em qual deles rodar?',
|
|
753
755
|
'run.warn.nothingSelected': 'Nenhum dispositivo selecionado.',
|
|
754
756
|
'run.updateHint.prefix': 'Melhorias disponíveis para o projeto —',
|