@microteia/console 2.22.1 → 2.24.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/CONSOLE-VERSIONS.md
CHANGED
|
@@ -22,6 +22,14 @@
|
|
|
22
22
|
- fix(command): what was broken, and what it did to whoever hit it.
|
|
23
23
|
-->
|
|
24
24
|
|
|
25
|
+
#### [2.24.0] — 2026-10-07
|
|
26
|
+
|
|
27
|
+
- feat(export-catalog): each screen in `installed-catalog.json` now carries its `sourceId`. The snapshot only had the installed key, which may have been disambiguated on install, so an extension that adds a tab to another's record detail (`record:<sourceId>`) could not be checked against the installation. Older snapshots simply lack the field.
|
|
28
|
+
|
|
29
|
+
#### [2.23.0] — 2026-10-07
|
|
30
|
+
|
|
31
|
+
- fix(provision): `microteia provision` run on its own now probes the deployed stamps itself instead of concluding that nothing changed. It could only compare stamps with the map `deploy` hands it, and running alone — the path of anyone who has just swapped kernels with `unpack` — there was no map: `outdatedByStamp` drew no conclusion, the function stayed out of the queue, and the record said "applied" because it genuinely was running, from the previous package. An office upgraded this way kept serving an extension's old Cloud Function with nothing anywhere saying so; the symptom surfaced in the client, not in the Console. The queue is now everything the installed extensions claim, and `deployFunctionsThatChanged` — the same probe `deploy` uses — decides what actually goes up: one reference function per stamp, and the rest left alone when it comes back unchanged. What the probe skips counts as satisfied, or a complete installation would stay "pending" forever.
|
|
32
|
+
|
|
25
33
|
#### [2.22.1] — 2026-09-19
|
|
26
34
|
|
|
27
35
|
- fix(cli/publish): the release notes now carry every changelog entry since the last PUBLISHED version,
|
package/README.md
CHANGED
|
@@ -58,6 +58,11 @@ export interface CatalogFieldExport {
|
|
|
58
58
|
}
|
|
59
59
|
export interface CatalogScreenExport {
|
|
60
60
|
key: string;
|
|
61
|
+
/**
|
|
62
|
+
* O id UNIVERSAL da tela. A chave acima é a instalada, que pode ter sido desambiguada; é pelo
|
|
63
|
+
* `sourceId` que uma extensão endereça a tela de outra (`record:<sourceId>`).
|
|
64
|
+
*/
|
|
65
|
+
sourceId?: string;
|
|
61
66
|
collection?: string;
|
|
62
67
|
titleSingular: string;
|
|
63
68
|
titlePlural?: string;
|
|
@@ -121,6 +121,7 @@ const screenExport = (document) => {
|
|
|
121
121
|
const fields = Array.isArray(data.fields) ? data.fields : [];
|
|
122
122
|
return {
|
|
123
123
|
key: document.id,
|
|
124
|
+
...(text(data.sourceId) === undefined ? {} : { sourceId: text(data.sourceId) }),
|
|
124
125
|
...(text(data.dataCollection) === undefined ? {} : { collection: text(data.dataCollection) }),
|
|
125
126
|
titleSingular: text(data.titleSingular) ?? document.id,
|
|
126
127
|
...(text(data.titlePlural) === undefined ? {} : { titlePlural: text(data.titlePlural) }),
|
package/lib/console/provision.js
CHANGED
|
@@ -10,6 +10,7 @@ import { changedParameters, functionsDeclaringParameters, parameterDigests, pars
|
|
|
10
10
|
import { ENVIRONMENT_FILE, readEnvironment, writeEnvironment } from './environment.js';
|
|
11
11
|
import { FIREBASE_BIN } from './firebaseCli.js';
|
|
12
12
|
import { deployFunctionsOneByOne, reportFailures, reportNotices } from './deployFunctions.js';
|
|
13
|
+
import { deployFunctionsThatChanged } from './functionsUpToDate.js';
|
|
13
14
|
import { clearRegionOrphans, listDeployedFunctions } from './regionOrphans.js';
|
|
14
15
|
import { outdatedByStamp } from './functionsUpToDate.js';
|
|
15
16
|
import { checkCallables, invokerGrantCommand } from './callableAccess.js';
|
|
@@ -363,7 +364,28 @@ export const provisionBackend = async (options) => {
|
|
|
363
364
|
info(' Cloud Function at ITS deploy, so a function already running keeps the previous one.');
|
|
364
365
|
blank();
|
|
365
366
|
}
|
|
366
|
-
|
|
367
|
+
/**
|
|
368
|
+
* De onde vem a conclusão sobre o que mudou — e são DOIS caminhos, porque as duas situações são
|
|
369
|
+
* diferentes de verdade.
|
|
370
|
+
*
|
|
371
|
+
* Vindo do `deploy`, o carimbo de agora já foi observado: as functions do kernel acabaram de subir,
|
|
372
|
+
* e as de extensão estão no MESMO codebase, então `outdatedByStamp` decide sem sondar nada.
|
|
373
|
+
*
|
|
374
|
+
* Rodando SOZINHO — que é o caminho de quem acabou de trocar de kernel por `unpack` — não há mapa
|
|
375
|
+
* nenhum, e era aqui que estava o defeito: `outdatedByStamp` não tinha com o que comparar, não
|
|
376
|
+
* tirava conclusão, e a function de extensão cujo CÓDIGO mudou ficava de fora da fila para sempre.
|
|
377
|
+
* O registro dizia "aplicada", porque ela de fato estava no ar — só que da versão anterior. Nada
|
|
378
|
+
* avisava, e o sintoma aparecia no cliente, não aqui.
|
|
379
|
+
*
|
|
380
|
+
* Então a fila passa a ser TUDO o que as extensões pedem, e quem decide o que realmente sobe é
|
|
381
|
+
* `deployFunctionsThatChanged` — a mesma sondagem do `deploy`, pela mesma função: deploya uma
|
|
382
|
+
* referência por carimbo e, se o carimbo voltar igual, deixa as outras em paz. Custa uma function
|
|
383
|
+
* por execução; não custar nada era o que fazia a conta ficar errada.
|
|
384
|
+
*/
|
|
385
|
+
const probing = options.refreshedStamps === undefined;
|
|
386
|
+
const queued = probing
|
|
387
|
+
? wantedFunctions
|
|
388
|
+
: wantedFunctions.filter((name) => options.all === true || !appliedNames.has(name) || staleFunctions.has(name));
|
|
367
389
|
/**
|
|
368
390
|
* A recusa do portão, cobrada de quem está na fila — e só dela.
|
|
369
391
|
*
|
|
@@ -382,6 +404,8 @@ export const provisionBackend = async (options) => {
|
|
|
382
404
|
info(' they are the only ones held back. Fix the guard and run "microteia provision" again.');
|
|
383
405
|
outcome.failed.push(...refused);
|
|
384
406
|
}
|
|
407
|
+
/** O que já estava no ar com ESTE código, e por isso não subiu. Conta como satisfeito. */
|
|
408
|
+
let skippedNow = [];
|
|
385
409
|
if (toDeploy.length === 0) {
|
|
386
410
|
// Anunciar "as 0 functions já estão deployadas" seria o preço de ter tirado o desvio, e não é
|
|
387
411
|
// preciso pagá-lo: quando não há exigência nenhuma, quem já falou foi a linha lá em cima.
|
|
@@ -405,17 +429,27 @@ export const provisionBackend = async (options) => {
|
|
|
405
429
|
// A extensão que mudou de região deixa a cópia antiga para trás igual ao kernel, e ali o efeito
|
|
406
430
|
// é o mesmo: deploy recusado em toda tentativa, e gatilho disparando em duas regiões.
|
|
407
431
|
await clearRegionOrphans(projectId, toDeploy, region, options.prune, await projectFunctions());
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
432
|
+
const deployOptions = { projectId, cwd: install, delaySeconds, force: false };
|
|
433
|
+
if (!probing)
|
|
434
|
+
info(` deploying ${toDeploy.length} function(s), one at a time…`);
|
|
435
|
+
const report = probing
|
|
436
|
+
? await deployFunctionsThatChanged(toDeploy, deployOptions, {
|
|
437
|
+
deployed: await projectFunctions(),
|
|
438
|
+
region,
|
|
439
|
+
all: options.all === true,
|
|
440
|
+
})
|
|
441
|
+
: { ...await deployFunctionsOneByOne(toDeploy, deployOptions), skipped: [] };
|
|
442
|
+
skippedNow = report.skipped;
|
|
412
443
|
outcome.deployed = report.deployed;
|
|
413
444
|
outcome.failed.push(...report.failed.map((entry) => entry.name));
|
|
414
445
|
reportFailures(report.failed);
|
|
415
446
|
reportNotices(report.notices);
|
|
416
447
|
await checkNewCallables([...(manifest.callables ?? []), ...office.callables], report.deployed, projectId, region);
|
|
417
448
|
}
|
|
418
|
-
|
|
449
|
+
// O PULADO entra junto: ele não subiu agora porque o projeto já roda exatamente este código, que é
|
|
450
|
+
// o mesmo que estar satisfeito. Deixá-lo de fora manteria a extensão "pendente" para sempre numa
|
|
451
|
+
// instalação em que não falta nada.
|
|
452
|
+
const deployedNow = new Set([...appliedNames, ...outcome.deployed, ...skippedNow]);
|
|
419
453
|
for (const claim of valid) {
|
|
420
454
|
const satisfied = (claim.backend.functions ?? []).every((name) => deployedNow.has(name));
|
|
421
455
|
if (satisfied) {
|
package/lib/shared/paths.d.ts
CHANGED
|
@@ -87,4 +87,4 @@ export declare const consoleRoot: string;
|
|
|
87
87
|
* de código nunca chegou a quem instala. Este bloco fica sendo o que ele já era antes de crescer: a
|
|
88
88
|
* política de semver da ferramenta, mais o registro do que motivou as versões até a `2.5.0`.
|
|
89
89
|
*/
|
|
90
|
-
export declare const CLI_VERSION = "2.
|
|
90
|
+
export declare const CLI_VERSION = "2.24.0";
|
package/lib/shared/paths.js
CHANGED
|
@@ -94,4 +94,4 @@ export const consoleRoot = resolve(here, '..', '..');
|
|
|
94
94
|
* de código nunca chegou a quem instala. Este bloco fica sendo o que ele já era antes de crescer: a
|
|
95
95
|
* política de semver da ferramenta, mais o registro do que motivou as versões até a `2.5.0`.
|
|
96
96
|
*/
|
|
97
|
-
export const CLI_VERSION = '2.
|
|
97
|
+
export const CLI_VERSION = '2.24.0';
|