smoonb 1.0.4 → 1.0.5

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/CHANGELOG.md CHANGED
@@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
6
6
 
7
+ ## [1.0.5] - 2026-02-21
8
+
9
+ ### Added
10
+
11
+ - **Flexible Supabase CLI version check** – Instead of requiring the exact latest version, smoonb now accepts any CLI version that is at most 1 minor behind the latest (same major). The minimum accepted version is computed as `major.(minor_latest - 1).0` at runtime from the npm registry. Special case: if `minor_latest === 0`, only the same major.minor is accepted.
12
+ - **`--skip-supabase-version-check` flag** – New opt-in flag for both `backup` and `restore` commands. When set, the Supabase CLI version check is skipped entirely and a warning is displayed. Useful when package managers (e.g. Scoop on Windows) lag behind on updates and the user wants to proceed at their own risk.
13
+
14
+ ### Changed
15
+
16
+ - Error message for outdated Supabase CLI now shows the computed minimum accepted version (`minVersion`) and the current latest, instead of only the latest.
17
+ - README (EN and PT-BR): updated Supabase CLI prerequisites section with the new version policy, added examples with `--skip-supabase-version-check`, updated commands table and troubleshooting section.
18
+ - i18n strings (`en.json`, `pt-BR.json`): removed specific version number references in favour of evergreen language ("always use the latest version").
19
+
20
+ ---
21
+
7
22
  ## [1.0.4] - 2025-01-29
8
23
 
9
24
  ### Changed
@@ -32,56 +47,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
32
47
 
33
48
  ---
34
49
 
35
- ## [1.0.2] - 2025-01-29
36
-
37
- ### Fixed
38
-
39
- - **Backup report** – When Realtime settings are reused from a previous backup file, the final summary now correctly shows "Settings imported from backup {name}" (or the pt-BR equivalent) instead of "Configurations captured interactively"
40
-
41
- ---
42
-
43
- ## [1.0.1] - 2025-01-29
44
-
45
- ### Removed
46
-
47
- - **`check` command** – Post-restore integrity verification command removed from CLI, help and documentation
48
- - **`--skip-realtime`** – Backup option removed; Realtime settings are always captured interactively
49
- - **`--file` and `--storage` on restore** – Restore no longer accepts direct file paths; use `import` then `restore` to select from the list
50
- - **`--lang`** – CLI language option removed; language is determined by `SMOONB_LANG` (env or `.env.local`) and system locale only
51
-
52
- ### Changed
53
-
54
- - README and README.pt-BR: all `#` comment lines removed from code blocks (replaced with normal text) to avoid light-gray rendering issues
55
- - Restore flow: backup selection is always interactive (no skip via `--file`)
56
- - i18n: `detectLocale` no longer reads `--lang` from argv; precedence is SMOONB_LANG → system locale → en
57
-
58
- ---
59
-
60
- ## [1.0.0] - 2025-01-29
61
-
62
- ### Added
63
-
64
- - Commercial release. Use requires an active license and valid subscription (or trial). See https://www.smoonb.com/#price
65
- - License validation (step 00) at the start of backup and restore; CLI aborts if validation fails
66
- - Restore disclaimer before execution: expected errors during DB restore, link to Supabase docs, wait for completion and test result
67
- - Environment variables: `SMOONB_LICENSE_KEY` (required), `SMOONB_TELEMETRY_ENABLED` (optional), `SUPABASE_POSTGRES_MAJOR` (required for backup and restore)
68
- - i18n (en, pt-BR) for all user-facing messages and help
69
-
70
- ### Changed
71
-
72
- - Backup flow: terms → license validation → Docker → consent → variable mapping (license not in wizard) → component selection → summary → execution
73
- - Restore flow: terms → license validation → Docker → consent → mapping (includes `SUPABASE_POSTGRES_MAJOR`) → backup selection → component selection → summary → disclaimer → execution
74
- - Help and README aligned with commercial product; legal disclaimers unchanged
75
- - Documentation and links point to https://www.smoonb.com (terms, privacy, #price, #faq)
76
-
77
- ### Fixed
78
-
79
- - `instructions` used before definition in interactive env mapper; blocks moved after `getVariableInstructions()`
80
-
81
50
  ---
82
51
 
52
+ [1.0.5]: https://github.com/almmello/smoonb/releases/tag/v1.0.5
83
53
  [1.0.4]: https://github.com/almmello/smoonb/releases/tag/v1.0.4
84
- [1.0.3]: https://github.com/almmello/smoonb/releases/tag/v1.0.3
85
- [1.0.2]: https://github.com/almmello/smoonb/releases/tag/v1.0.2
86
- [1.0.1]: https://github.com/almmello/smoonb/releases/tag/v1.0.1
87
- [1.0.0]: https://github.com/almmello/smoonb/releases/tag/v1.0.0
package/README.md CHANGED
@@ -92,7 +92,11 @@ docker ps
92
92
  npm install -g supabase
93
93
  ```
94
94
 
95
- We recommend **Supabase CLI v2.72 or newer** for new features and bug fixes. To update: [Updating the Supabase CLI](https://supabase.com/docs/guides/cli/getting-started#updating-the-supabase-cli).
95
+ **Version policy:** smoonb accepts any Supabase CLI version that is **at most 1 minor behind the latest** (same major). We recommend always using the latest version. Versions that are too old are blocked with an error message.
96
+
97
+ If your package manager (e.g. **Scoop** on Windows) lags behind on updates and you want to proceed anyway, use the `--skip-supabase-version-check` flag (see usage section below).
98
+
99
+ To update the Supabase CLI: [Updating the Supabase CLI](https://supabase.com/docs/guides/cli/getting-started#updating-the-supabase-cli).
96
100
 
97
101
  ### 3. Supabase Personal Access Token
98
102
  You need to obtain a Supabase personal access token to use the Management API:
@@ -190,6 +194,17 @@ Language is detected automatically in the following order of precedence:
190
194
  npx smoonb backup
191
195
  ```
192
196
 
197
+ **Available options:**
198
+
199
+ | Flag | Description |
200
+ |------|-------------|
201
+ | `--skip-supabase-version-check` | Skips the Supabase CLI version check. Use when your package manager (e.g. Scoop) lags behind on updates. A warning is shown and the user assumes the risk. |
202
+
203
+ **Example with flag:**
204
+ ```bash
205
+ npx smoonb backup --skip-supabase-version-check
206
+ ```
207
+
193
208
  **Interactive backup flow:**
194
209
 
195
210
  1. **Terms of use** - Displays and requests acceptance of terms
@@ -252,6 +267,17 @@ backups/backup-2025-10-31-09-37-54/
252
267
  npx smoonb restore
253
268
  ```
254
269
 
270
+ **Available options:**
271
+
272
+ | Flag | Description |
273
+ |------|-------------|
274
+ | `--skip-supabase-version-check` | Skips the Supabase CLI version check. Use when your package manager (e.g. Scoop) lags behind on updates. A warning is shown and the user assumes the risk. |
275
+
276
+ **Example with flag:**
277
+ ```bash
278
+ npx smoonb restore --skip-supabase-version-check
279
+ ```
280
+
255
281
  **Interactive restore flow:**
256
282
 
257
283
  1. **Terms of use** - Displays and requests acceptance of terms
@@ -345,7 +371,9 @@ After running `import`, run `restore` to choose the imported backup from the lis
345
371
  | Command | Description |
346
372
  |---------|-------------|
347
373
  | `npx smoonb backup` | Full interactive backup using Docker |
374
+ | `npx smoonb backup --skip-supabase-version-check` | Backup skipping the Supabase CLI version check |
348
375
  | `npx smoonb restore` | Interactive restoration using psql (Docker) |
376
+ | `npx smoonb restore --skip-supabase-version-check` | Restore skipping the Supabase CLI version check |
349
377
  | `npx smoonb import --file <path> [--storage <path>]` | Import .backup.gz file and optionally .storage.zip from Supabase Dashboard |
350
378
 
351
379
  ## 🏗️ Technical Architecture
@@ -519,6 +547,28 @@ If not, start Docker Desktop (Windows/macOS) or run `sudo systemctl start docker
519
547
  npm install -g supabase
520
548
  ```
521
549
 
550
+ ### Supabase CLI outdated (below minimum accepted version)
551
+
552
+ smoonb accepts versions up to **1 minor behind the latest**. If your installed version is below that threshold, you will see a message like:
553
+
554
+ ```
555
+ ❌ Supabase CLI X.Y.Z is below the minimum accepted version (X.W.0). Latest: X.V.Z. Update to at least version X.W.0.
556
+ ```
557
+
558
+ **Option 1 — Update the Supabase CLI:**
559
+ ```bash
560
+ npm install -g supabase@latest # global install
561
+ npm install supabase@latest # local/project install
562
+ ```
563
+
564
+ **Option 2 — Skip the check (temporary, user assumes the risk):**
565
+ ```bash
566
+ npx smoonb backup --skip-supabase-version-check
567
+ npx smoonb restore --skip-supabase-version-check
568
+ ```
569
+
570
+ > **Note for Scoop users (Windows):** the Scoop repository may take a few days to update after a release. Use `--skip-supabase-version-check` until Scoop ships the updated version.
571
+
522
572
  ### Invalid or missing Personal Access Token
523
573
 
524
574
  1. Verify if `SUPABASE_ACCESS_TOKEN` is in `.env.local`
package/README.pt-BR.md CHANGED
@@ -92,7 +92,11 @@ docker ps
92
92
  npm install -g supabase
93
93
  ```
94
94
 
95
- Recomendamos **Supabase CLI v2.72 ou mais recente** para novos recursos e correções. Para atualizar: [Atualizando o Supabase CLI](https://supabase.com/docs/guides/cli/getting-started#updating-the-supabase-cli).
95
+ **Política de versão:** o smoonb aceita qualquer versão do Supabase CLI que esteja **no máximo 1 minor atrás da latest** (mesma major). Recomendamos sempre usar a versão mais recente. Versões muito antigas são bloqueadas com mensagem de erro.
96
+
97
+ Se o seu gerenciador de pacotes (ex.: **Scoop** no Windows) instala com atraso e você quer avançar mesmo assim, use a flag `--skip-supabase-version-check` (veja a seção de uso abaixo).
98
+
99
+ Para atualizar o Supabase CLI: [Atualizando o Supabase CLI](https://supabase.com/docs/guides/cli/getting-started#updating-the-supabase-cli).
96
100
 
97
101
  ### 3. Personal Access Token do Supabase
98
102
  É necessário obter um token de acesso pessoal do Supabase para usar a Management API:
@@ -190,6 +194,17 @@ O idioma é detectado automaticamente na seguinte ordem de precedência:
190
194
  npx smoonb backup
191
195
  ```
192
196
 
197
+ **Opções disponíveis:**
198
+
199
+ | Flag | Descrição |
200
+ |------|-----------|
201
+ | `--skip-supabase-version-check` | Pula a checagem de versão do Supabase CLI. Use quando seu gerenciador de pacotes (ex.: Scoop) instala com atraso. Um aviso é exibido e o usuário assume o risco. |
202
+
203
+ **Exemplo com a flag:**
204
+ ```bash
205
+ npx smoonb backup --skip-supabase-version-check
206
+ ```
207
+
193
208
  **Fluxo interativo do backup:**
194
209
 
195
210
  1. **Termo de uso** - Exibe e solicita aceitação dos termos
@@ -252,6 +267,17 @@ backups/backup-2025-10-31-09-37-54/
252
267
  npx smoonb restore
253
268
  ```
254
269
 
270
+ **Opções disponíveis:**
271
+
272
+ | Flag | Descrição |
273
+ |------|-----------|
274
+ | `--skip-supabase-version-check` | Pula a checagem de versão do Supabase CLI. Use quando seu gerenciador de pacotes (ex.: Scoop) instala com atraso. Um aviso é exibido e o usuário assume o risco. |
275
+
276
+ **Exemplo com a flag:**
277
+ ```bash
278
+ npx smoonb restore --skip-supabase-version-check
279
+ ```
280
+
255
281
  **Fluxo interativo do restore:**
256
282
 
257
283
  1. **Termo de uso** - Exibe e solicita aceitação dos termos
@@ -345,7 +371,9 @@ Após executar `import`, execute `restore` para escolher o backup importado na l
345
371
  | Comando | Descrição |
346
372
  |---------|-----------|
347
373
  | `npx smoonb backup` | Backup completo interativo usando Docker |
374
+ | `npx smoonb backup --skip-supabase-version-check` | Backup pulando a checagem de versão do Supabase CLI |
348
375
  | `npx smoonb restore` | Restauração interativa usando psql (Docker) |
376
+ | `npx smoonb restore --skip-supabase-version-check` | Restore pulando a checagem de versão do Supabase CLI |
349
377
  | `npx smoonb import --file <path> [--storage <path>]` | Importar arquivo .backup.gz e opcionalmente .storage.zip do Dashboard do Supabase |
350
378
 
351
379
  ## 🏗️ Arquitetura Técnica
@@ -519,6 +547,28 @@ Se não estiver, inicie o Docker Desktop (Windows/macOS) ou execute `sudo system
519
547
  npm install -g supabase
520
548
  ```
521
549
 
550
+ ### Supabase CLI desatualizado (abaixo da versão mínima aceita)
551
+
552
+ O smoonb aceita versões até **1 minor atrás da latest**. Se sua versão instalada estiver abaixo desse limite, você verá uma mensagem como:
553
+
554
+ ```
555
+ ❌ Supabase CLI X.Y.Z está abaixo da versão mínima aceita (X.W.0). Versão latest: X.V.Z. Atualize para pelo menos a versão X.W.0.
556
+ ```
557
+
558
+ **Opção 1 — Atualizar o Supabase CLI:**
559
+ ```bash
560
+ npm install -g supabase@latest # instalação global
561
+ npm install supabase@latest # instalação local/projeto
562
+ ```
563
+
564
+ **Opção 2 — Pular a checagem (temporariamente, risco do usuário):**
565
+ ```bash
566
+ npx smoonb backup --skip-supabase-version-check
567
+ npx smoonb restore --skip-supabase-version-check
568
+ ```
569
+
570
+ > **Nota para usuários de Scoop (Windows):** o repositório do Scoop pode levar alguns dias para atualizar após um release. Use `--skip-supabase-version-check` até que o Scoop disponibilize a versão atualizada.
571
+
522
572
  ### Personal Access Token inválido ou ausente
523
573
 
524
574
  1. Verificar se `SUPABASE_ACCESS_TOKEN` está no `.env.local`
package/bin/smoonb.js CHANGED
@@ -79,6 +79,10 @@ program
79
79
  const getT = global.smoonbI18n?.t || t;
80
80
  return getT('help.commands.backupDesc');
81
81
  })
82
+ .option('--skip-supabase-version-check', () => {
83
+ const getT = global.smoonbI18n?.t || t;
84
+ return getT('help.commands.skipSupabaseVersionCheck');
85
+ })
82
86
  .addHelpText('after', () => {
83
87
  const getT = global.smoonbI18n?.t || t;
84
88
  return `
@@ -86,6 +90,9 @@ ${chalk.yellow.bold(getT('help.commands.backupExamples'))}
86
90
  ${chalk.white(getT('help.commands.backupExample1'))}
87
91
  ${chalk.white(getT('help.commands.backupExample1Desc'))}
88
92
 
93
+ ${chalk.white(getT('help.commands.backupExample3'))}
94
+ ${chalk.white(getT('help.commands.backupExample3Desc'))}
95
+
89
96
  ${chalk.yellow.bold(getT('help.commands.backupFlow'))}
90
97
  ${getT('help.commands.backupFlow1')}
91
98
  ${getT('help.commands.backupFlow2')}
@@ -120,6 +127,10 @@ program
120
127
  const getT = global.smoonbI18n?.t || t;
121
128
  return getT('help.commands.restoreDesc');
122
129
  })
130
+ .option('--skip-supabase-version-check', () => {
131
+ const getT = global.smoonbI18n?.t || t;
132
+ return getT('help.commands.skipSupabaseVersionCheck');
133
+ })
123
134
  .addHelpText('after', () => {
124
135
  const getT = global.smoonbI18n?.t || t;
125
136
  return `
@@ -127,6 +138,9 @@ ${chalk.yellow.bold(getT('help.commands.restoreExamples'))}
127
138
  ${chalk.white(getT('help.commands.restoreExample1'))}
128
139
  ${chalk.white(getT('help.commands.restoreExample1Desc'))}
129
140
 
141
+ ${chalk.white(getT('help.commands.restoreExample4'))}
142
+ ${chalk.white(getT('help.commands.restoreExample4Desc'))}
143
+
130
144
  ${chalk.yellow.bold(getT('help.commands.restoreFlow'))}
131
145
  ${getT('help.commands.restoreFlow1')}
132
146
  ${getT('help.commands.restoreFlow2')}
@@ -144,7 +158,7 @@ ${chalk.yellow.bold(getT('help.commands.restoreFormats'))}
144
158
  ${getT('help.commands.restoreFormats2')}
145
159
  `;
146
160
  })
147
- .action(() => commands.restore({}));
161
+ .action((options) => commands.restore(options));
148
162
 
149
163
  program
150
164
  .command('import')
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smoonb",
3
- "version": "1.0.4",
3
+ "version": "1.0.5",
4
4
  "description": "Complete Supabase backup and migration tool. https://www.smoonb.com/#price",
5
5
  "preferGlobal": false,
6
6
  "preventGlobalInstall": true,
@@ -51,7 +51,7 @@ module.exports = async (options) => {
51
51
  const licenseResult = await step00License({ envPath, command: 'backup' });
52
52
 
53
53
  // Executar validação Docker
54
- await step01DockerValidation();
54
+ await step01DockerValidation({ skipSupabaseVersionCheck: !!(options && options.skipSupabaseVersionCheck) });
55
55
 
56
56
  // Consentimento para leitura e escrita do .env.local
57
57
  console.log(chalk.yellow(`\n⚠️ ${getT('consent.title')}`));
@@ -6,17 +6,25 @@ const { t } = require('../../../i18n');
6
6
  /**
7
7
  * Etapa 0: Validação Docker
8
8
  * Deve ocorrer antes de tudo
9
+ * @param {object} [options]
10
+ * @param {boolean} [options.skipSupabaseVersionCheck=false]
9
11
  */
10
- module.exports = async () => {
12
+ module.exports = async (options = {}) => {
11
13
  const getT = global.smoonbI18n?.t || t;
12
14
  console.log(chalk.blue(`\n🐳 ${getT('docker.validation.title')}`));
13
15
  console.log(chalk.cyan(`🔍 ${getT('docker.validation.checking')}`));
14
16
 
15
- const backupCapability = await canPerformCompleteBackup();
17
+ const backupCapability = await canPerformCompleteBackup({
18
+ skipSupabaseVersionCheck: options.skipSupabaseVersionCheck || false
19
+ });
16
20
 
17
21
  if (!backupCapability.canBackupComplete) {
18
22
  showDockerMessagesAndExit(backupCapability.reason, backupCapability);
19
23
  }
24
+
25
+ if (backupCapability.supabaseVersionCheckSkipped) {
26
+ console.log(chalk.yellow(`⚠️ ${getT('supabase.cliVersionSkipWarning')}`));
27
+ }
20
28
 
21
29
  console.log(chalk.green(`✅ ${getT('docker.validation.detected')}`));
22
30
  console.log(chalk.white(`🐳 ${getT('docker.validation.version', { version: backupCapability.dockerStatus.version })}`));
@@ -83,7 +83,7 @@ function showDockerMessagesAndExit(reason, data = {}) {
83
83
  break;
84
84
 
85
85
  case 'supabase_cli_outdated':
86
- console.log(chalk.red(`❌ ${getT('supabase.cliOutdated', { version: data.supabaseCliVersion || '?', latest: data.supabaseCliLatest || '?' })}`));
86
+ console.log(chalk.red(`❌ ${getT('supabase.cliOutdated', { version: data.supabaseCliVersion || '?', minVersion: data.supabaseCliMinVersion || '?', latest: data.supabaseCliLatest || '?' })}`));
87
87
  console.log('');
88
88
  console.log(chalk.yellow(`📋 ${getT('supabase.cliUpdateInstructions')}`));
89
89
  console.log(chalk.cyan(` ${getT('supabase.cliUpdateCommandExamples')}`));
@@ -25,7 +25,7 @@ const step07DatabaseSettings = require('./steps/07-database-settings');
25
25
  const step08RealtimeSettings = require('./steps/08-realtime-settings');
26
26
  const { sendTelemetry } = require('../../telemetry');
27
27
 
28
- module.exports = async () => {
28
+ module.exports = async (options = {}) => {
29
29
  showBetaBanner();
30
30
  const restoreStartTime = Date.now();
31
31
  let telemetryEnabled = (process.env.SMOONB_TELEMETRY_ENABLED || 'true') !== 'false';
@@ -49,7 +49,7 @@ module.exports = async () => {
49
49
  await step00License({ envPath: envPathForLicense, command: 'restore' });
50
50
 
51
51
  // Executar validação Docker
52
- await step01DockerValidation();
52
+ await step01DockerValidation({ skipSupabaseVersionCheck: !!(options && options.skipSupabaseVersionCheck) });
53
53
 
54
54
  // Consentimento para leitura e escrita do .env.local
55
55
  ui.warn(`\n⚠️ ${getT('consent.title')}`);
@@ -72,8 +72,10 @@
72
72
  "supabase.installLink": "Installation: npm install -g supabase",
73
73
  "supabase.required": "Supabase CLI is required for full Supabase backup",
74
74
  "supabase.requiredComponents": "Supabase CLI is required for full Supabase backup\n - PostgreSQL Database\n - Edge Functions\n - All components via Docker",
75
- "supabase.cliUpdateRecommended": "Supabase CLI {version} detected. We recommend v2.72 or newer for new features and bug fixes: https://supabase.com/docs/guides/cli/getting-started#updating-the-supabase-cli",
76
- "supabase.cliOutdated": "Supabase CLI {version} is not the latest ({latest}). Update to the latest version.",
75
+ "supabase.cliVersionPolicy": "Version policy: accepts any version up to 1 minor behind the latest (same major). Use --skip-supabase-version-check to bypass the check.",
76
+ "supabase.cliUpdateRecommended": "Supabase CLI {version} detected. We recommend always using the latest version for new features and bug fixes: https://supabase.com/docs/guides/cli/getting-started#updating-the-supabase-cli",
77
+ "supabase.cliOutdated": "Supabase CLI {version} is below the minimum accepted version ({minVersion}). Latest: {latest}. Update to at least version {minVersion}.",
78
+ "supabase.cliVersionSkipWarning": "Supabase CLI version check disabled (--skip-supabase-version-check). Proceeding without version check — user assumes the risk.",
77
79
  "supabase.cliUpdateInstructions": "Update the Supabase CLI and run smoonb again:",
78
80
  "supabase.cliUpdateCommandExamples": "Examples (depending on how you installed):",
79
81
  "supabase.cliUpdateCommandGlobal": "npm install -g supabase@latest (global)",
@@ -166,6 +168,7 @@
166
168
  "help.tip5": "• Storage file format must be: *.storage.zip",
167
169
 
168
170
  "help.commands.backupDesc": "Create a full backup of your Supabase project using Supabase CLI",
171
+ "help.commands.skipSupabaseVersionCheck": "Skip the Supabase CLI version check (user assumes the risk)",
169
172
  "help.commands.backupSkipRealtime": "Skip interactive capture of Realtime Settings",
170
173
  "help.commands.backupPostgresMajor": "Postgres major version for dump (15, 17). Non-interactive; no menu.",
171
174
  "help.commands.backupExamples": "Examples:",
@@ -173,6 +176,8 @@
173
176
  "help.commands.backupExample1Desc": "# Complete interactive process",
174
177
  "help.commands.backupExample2": "npx smoonb backup --skip-realtime",
175
178
  "help.commands.backupExample2Desc": "# Skips Realtime Settings configuration",
179
+ "help.commands.backupExample3": "npx smoonb backup --skip-supabase-version-check",
180
+ "help.commands.backupExample3Desc": "# Skips Supabase CLI version check (use when your package manager lags behind, e.g. Scoop)",
176
181
  "help.commands.backupWhat": "What is captured:",
177
182
  "help.commands.backupWhat1": "• Database PostgreSQL (pg_dumpall + separate SQL)",
178
183
  "help.commands.backupWhat2": "• Database Extensions and Settings",
@@ -206,6 +211,8 @@
206
211
  "help.commands.restoreExample2Desc": "# Imports and restores backup file directly",
207
212
  "help.commands.restoreExample3": "npx smoonb restore --file \"backup.backup.gz\" --storage \"my-project.storage.zip\"",
208
213
  "help.commands.restoreExample3Desc": "# Imports and restores backup and storage together",
214
+ "help.commands.restoreExample4": "npx smoonb restore --skip-supabase-version-check",
215
+ "help.commands.restoreExample4Desc": "# Skips Supabase CLI version check (use when your package manager lags behind, e.g. Scoop)",
209
216
  "help.commands.restoreFlow": "Restore flow:",
210
217
  "help.commands.restoreFlow1": "1. Terms of use",
211
218
  "help.commands.restoreFlow2": "2. License validation (SMOONB_LICENSE_KEY)",
@@ -72,8 +72,10 @@
72
72
  "supabase.installLink": "Instalação: npm install -g supabase",
73
73
  "supabase.required": "Supabase CLI é obrigatório para backup completo do Supabase",
74
74
  "supabase.requiredComponents": "Supabase CLI é obrigatório para backup completo do Supabase\n - Database PostgreSQL\n - Edge Functions\n - Todos os componentes via Docker",
75
- "supabase.cliUpdateRecommended": "Supabase CLI {version} detectado. Recomendamos v2.72 ou mais recente para novos recursos e correções: https://supabase.com/docs/guides/cli/getting-started#updating-the-supabase-cli",
76
- "supabase.cliOutdated": "Supabase CLI {version} não é a versão mais recente ({latest}). Atualize para a última versão.",
75
+ "supabase.cliVersionPolicy": "Política de versão: aceita qualquer versão até 1 minor atrás da latest (mesma major). Use --skip-supabase-version-check para pular a checagem.",
76
+ "supabase.cliUpdateRecommended": "Supabase CLI {version} detectado. Recomendamos sempre usar a versão mais recente para obter novos recursos e correções: https://supabase.com/docs/guides/cli/getting-started#updating-the-supabase-cli",
77
+ "supabase.cliOutdated": "Supabase CLI {version} está abaixo da versão mínima aceita ({minVersion}). Versão latest: {latest}. Atualize para pelo menos a versão {minVersion}.",
78
+ "supabase.cliVersionSkipWarning": "Checagem de versão do Supabase CLI desabilitada (--skip-supabase-version-check). Prosseguindo sem verificar a versão — o usuário assume o risco.",
77
79
  "supabase.cliUpdateInstructions": "Atualize o Supabase CLI e execute o smoonb novamente:",
78
80
  "supabase.cliUpdateCommandExamples": "Exemplos (conforme a forma de instalação):",
79
81
  "supabase.cliUpdateCommandGlobal": "npm install -g supabase@latest (global)",
@@ -166,6 +168,7 @@
166
168
  "help.tip5": "• O formato do arquivo de storage deve ser: *.storage.zip",
167
169
 
168
170
  "help.commands.backupDesc": "Fazer backup completo do projeto Supabase usando Supabase CLI",
171
+ "help.commands.skipSupabaseVersionCheck": "Pular checagem de versão do Supabase CLI (o usuário assume o risco)",
169
172
  "help.commands.backupSkipRealtime": "Pular captura interativa de Realtime Settings",
170
173
  "help.commands.backupPostgresMajor": "Versão major do Postgres para o dump (15, 17). Não interativo; sem menu.",
171
174
  "help.commands.backupExamples": "Exemplos:",
@@ -173,6 +176,8 @@
173
176
  "help.commands.backupExample1Desc": "# Processo interativo completo",
174
177
  "help.commands.backupExample2": "npx smoonb backup --skip-realtime",
175
178
  "help.commands.backupExample2Desc": "# Pula configuração de Realtime Settings",
179
+ "help.commands.backupExample3": "npx smoonb backup --skip-supabase-version-check",
180
+ "help.commands.backupExample3Desc": "# Pula checagem de versão do Supabase CLI (use quando seu gerenciador de pacotes instala com atraso, ex.: Scoop)",
176
181
  "help.commands.backupWhat": "O que é capturado:",
177
182
  "help.commands.backupWhat1": "• Database PostgreSQL (pg_dumpall + SQL separado)",
178
183
  "help.commands.backupWhat2": "• Database Extensions and Settings",
@@ -206,6 +211,8 @@
206
211
  "help.commands.restoreExample2Desc": "# Importa e restaura diretamente o arquivo de backup",
207
212
  "help.commands.restoreExample3": "npx smoonb restore --file \"backup.backup.gz\" --storage \"meu-projeto.storage.zip\"",
208
213
  "help.commands.restoreExample3Desc": "# Importa e restaura backup e storage juntos",
214
+ "help.commands.restoreExample4": "npx smoonb restore --skip-supabase-version-check",
215
+ "help.commands.restoreExample4Desc": "# Pula checagem de versão do Supabase CLI (use quando seu gerenciador de pacotes instala com atraso, ex.: Scoop)",
209
216
  "help.commands.restoreFlow": "Fluxo do restore:",
210
217
  "help.commands.restoreFlow1": "1. Termo de uso",
211
218
  "help.commands.restoreFlow2": "2. Validação de licença (SMOONB_LICENSE_KEY)",
@@ -100,6 +100,21 @@ function compareSemver(a, b) {
100
100
  return 0;
101
101
  }
102
102
 
103
+ /**
104
+ * Calcula a versão mínima aceita: no máximo 1 minor atrás da latest.
105
+ * Ex: latest "2.76.12" → "2.75.0"; latest "3.0.5" → "3.0.0"
106
+ * @param {string} latestVersion
107
+ * @returns {string|null}
108
+ */
109
+ function getMinAcceptableVersion(latestVersion) {
110
+ if (!latestVersion) return null;
111
+ const parts = latestVersion.split('.').map(Number);
112
+ const major = parts[0] || 0;
113
+ const minor = parts[1] || 0;
114
+ const minMinor = Math.max(0, minor - 1);
115
+ return `${major}.${minMinor}.0`;
116
+ }
117
+
103
118
  /**
104
119
  * Detecta Docker Desktop completo com versão
105
120
  * @returns {Promise<{installed: boolean, running: boolean, version: string}>}
@@ -159,9 +174,11 @@ async function detectDockerDependencies() {
159
174
 
160
175
  /**
161
176
  * Detecta se é possível fazer backup completo via Docker
177
+ * @param {object} [opts]
178
+ * @param {boolean} [opts.skipSupabaseVersionCheck=false] - Pular checagem de versão do Supabase CLI
162
179
  * @returns {Promise<{canBackupComplete: boolean, reason?: string, dockerStatus: any}>}
163
180
  */
164
- async function canPerformCompleteBackup() {
181
+ async function canPerformCompleteBackup({ skipSupabaseVersionCheck = false } = {}) {
165
182
  const dockerStatus = await detectDockerDesktop();
166
183
 
167
184
  if (!dockerStatus.installed) {
@@ -189,6 +206,14 @@ async function canPerformCompleteBackup() {
189
206
  };
190
207
  }
191
208
 
209
+ if (skipSupabaseVersionCheck) {
210
+ return {
211
+ canBackupComplete: true,
212
+ supabaseVersionCheckSkipped: true,
213
+ dockerStatus
214
+ };
215
+ }
216
+
192
217
  const supabaseCliVersion = await getSupabaseCLIVersion();
193
218
  const latestResult = await getSupabaseCLILatestVersion();
194
219
  if (latestResult.error) {
@@ -200,12 +225,15 @@ async function canPerformCompleteBackup() {
200
225
  dockerStatus
201
226
  };
202
227
  }
203
- if (supabaseCliVersion && latestResult.version && compareSemver(supabaseCliVersion, latestResult.version) < 0) {
228
+
229
+ const minVersion = getMinAcceptableVersion(latestResult.version);
230
+ if (supabaseCliVersion && minVersion && compareSemver(supabaseCliVersion, minVersion) < 0) {
204
231
  return {
205
232
  canBackupComplete: false,
206
233
  reason: 'supabase_cli_outdated',
207
234
  supabaseCliVersion,
208
235
  supabaseCliLatest: latestResult.version,
236
+ supabaseCliMinVersion: minVersion,
209
237
  dockerStatus
210
238
  };
211
239
  }
@@ -226,5 +254,6 @@ module.exports = {
226
254
  getSupabaseCLIVersion,
227
255
  getSupabaseCLILatestVersion,
228
256
  compareSemver,
257
+ getMinAcceptableVersion,
229
258
  canPerformCompleteBackup
230
259
  };