kasy-cli 1.5.2 → 1.6.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/kasy.js +5 -2
- package/lib/commands/add.js +101 -100
- package/lib/commands/check.js +55 -38
- package/lib/commands/codemagic.js +61 -58
- package/lib/commands/deploy.js +49 -45
- package/lib/commands/docs.js +19 -18
- package/lib/commands/doctor.js +46 -44
- package/lib/commands/features.js +20 -17
- package/lib/commands/ios.js +69 -69
- package/lib/commands/new.js +662 -913
- package/lib/commands/notifications.js +59 -59
- package/lib/commands/remove.js +28 -27
- package/lib/commands/run.js +5 -2
- package/lib/commands/update.js +104 -96
- package/lib/commands/validate.js +24 -19
- package/lib/utils/apple-release.js +23 -11
- package/lib/utils/brand.js +72 -0
- package/lib/utils/checks.js +39 -10
- package/lib/utils/i18n.js +21 -3
- package/lib/utils/prompts.js +82 -142
- package/lib/utils/ui.js +174 -0
- package/lib/utils/updates.js +17 -18
- package/package.json +3 -1
package/lib/utils/updates.js
CHANGED
|
@@ -4,8 +4,8 @@ const https = require('node:https');
|
|
|
4
4
|
const path = require('node:path');
|
|
5
5
|
const { existsSync, readJsonSync, writeJsonSync, ensureDirSync } = require('fs-extra');
|
|
6
6
|
const kleur = require('kleur');
|
|
7
|
-
const prompts = require('prompts');
|
|
8
7
|
const pkg = require('../../package.json');
|
|
8
|
+
const ui = require('./ui');
|
|
9
9
|
const { CONFIG_PATH } = require('./license');
|
|
10
10
|
|
|
11
11
|
const CHECK_INTERVAL_MS = 24 * 60 * 60 * 1000; // 24 horas
|
|
@@ -105,28 +105,27 @@ async function warnIfOutdatedBeforeNew(t) {
|
|
|
105
105
|
const cache = (readConfig().updateCheck) || {};
|
|
106
106
|
if (!cache.latestVersion || !isNewer(cache.latestVersion, pkg.version)) return;
|
|
107
107
|
|
|
108
|
-
|
|
108
|
+
const hint = t ? t('new.outdated.hint') : 'projetos criados agora não terão as últimas melhorias.';
|
|
109
109
|
console.log(
|
|
110
|
-
|
|
110
|
+
'\n' +
|
|
111
|
+
kleur.bgYellow().black(' UPDATE ') + ' ' +
|
|
111
112
|
kleur.bold(`v${cache.latestVersion} disponível`) +
|
|
112
|
-
kleur.dim(`
|
|
113
|
+
kleur.dim(` — ${hint}`) +
|
|
114
|
+
'\n'
|
|
113
115
|
);
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
message: t ? t('new.outdated.continueAnyway') : 'Continuar com a versão atual?',
|
|
122
|
-
initial: true,
|
|
116
|
+
|
|
117
|
+
// Called BEFORE any ui.intro fires in kasy new, so this prompt runs as a
|
|
118
|
+
// standalone Clack confirm (no rail to break). On cancel we exit cleanly.
|
|
119
|
+
const upgrade = await ui.confirm({
|
|
120
|
+
message: t ? t('new.outdated.upgradeNow') : 'Atualizar antes de criar? (requer assinatura ativa)',
|
|
121
|
+
initialValue: false,
|
|
122
|
+
onCancel: () => process.exit(0),
|
|
123
123
|
});
|
|
124
124
|
|
|
125
|
-
if (
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
process.exit(0);
|
|
125
|
+
if (upgrade) {
|
|
126
|
+
const { spawnSync } = require('node:child_process');
|
|
127
|
+
const result = spawnSync('kasy', ['upgrade'], { stdio: 'inherit', shell: true });
|
|
128
|
+
process.exit(result.status ?? 0);
|
|
130
129
|
}
|
|
131
130
|
} catch {
|
|
132
131
|
// Nunca travar o kasy new por causa do aviso de versão
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kasy-cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "CLI for scaffolding production-ready Flutter SaaS apps with Firebase, Supabase, or API REST backends.",
|
|
5
5
|
"bin": {
|
|
6
6
|
"kasy": "./bin/kasy.js"
|
|
@@ -44,6 +44,8 @@
|
|
|
44
44
|
"test:localize-docs": "node ./test/localize-release-docs.test.js"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
+
"@clack/prompts": "^1.4.0",
|
|
48
|
+
"boxen": "^8.0.1",
|
|
47
49
|
"commander": "^12.0.0",
|
|
48
50
|
"fs-extra": "^11.2.0",
|
|
49
51
|
"gradient-string": "^1.2.0",
|