wizz-method 2.1.0 → 2.1.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/package.json
CHANGED
package/tools/fetch-assets.mjs
CHANGED
|
@@ -191,7 +191,14 @@ export async function fetchBundle({ url, sha256, parts, dest, marker, force = fa
|
|
|
191
191
|
|
|
192
192
|
export class FetchAssetsError extends Error {}
|
|
193
193
|
|
|
194
|
-
|
|
194
|
+
/**
|
|
195
|
+
* Resolve um bundle do catálogo `BUNDLES` pelo nome e baixa. É o ÚNICO lugar
|
|
196
|
+
* que traduz a entrada do catálogo em argumentos de `fetchBundle`: o wrapper
|
|
197
|
+
* do CLI (`tools/installer/commands/fetch-assets.js`) chama esta função, nunca
|
|
198
|
+
* remonta o objeto à mão. Um wrapper que remontava esqueceu `parts` e quebrava
|
|
199
|
+
* todo bundle em partes com "Cannot read properties of undefined" (2026-09-12).
|
|
200
|
+
*/
|
|
201
|
+
export async function fetchNamedBundle(name, { dest, force } = {}) {
|
|
195
202
|
const bundle = BUNDLES[name];
|
|
196
203
|
if (!bundle) {
|
|
197
204
|
throw new FetchAssetsError(`Bundle desconhecido: "${name}". Disponíveis: ${Object.keys(BUNDLES).join(', ')}`);
|
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
// canvas-design. Wrapper fino de commander sobre tools/fetch-assets.mjs (ESM
|
|
4
4
|
// puro, sem dependência nova) — o motor real fica lá; este arquivo só expõe
|
|
5
5
|
// o comando pro CLI e traduz flags/erros pro padrão dos outros comandos.
|
|
6
|
+
// A resolução nome do bundle → argumentos de download é do motor
|
|
7
|
+
// (`fetchNamedBundle`); este wrapper nunca remonta esse objeto.
|
|
6
8
|
//
|
|
7
9
|
// `--bundle` (não posicional): o loader genérico em wizz-cli.js registra
|
|
8
10
|
// `program.command(name)` sem placeholder de argumento pros comandos deste
|
|
@@ -28,7 +30,7 @@ module.exports = {
|
|
|
28
30
|
['--all', 'Baixa todos os bundles conhecidos'],
|
|
29
31
|
],
|
|
30
32
|
action: async (options) => {
|
|
31
|
-
const {
|
|
33
|
+
const { fetchNamedBundle, BUNDLES } = await import('../../fetch-assets.mjs');
|
|
32
34
|
|
|
33
35
|
const targets = options.all ? Object.keys(BUNDLES) : options.bundle ? [options.bundle] : [];
|
|
34
36
|
|
|
@@ -53,13 +55,10 @@ module.exports = {
|
|
|
53
55
|
continue;
|
|
54
56
|
}
|
|
55
57
|
try {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
marker: meta.marker,
|
|
61
|
-
force: options.force,
|
|
62
|
-
});
|
|
58
|
+
// Delega ao helper do motor em vez de remontar os argumentos: o
|
|
59
|
+
// catálogo tem bundles em `parts` (sem `url`), e toda cópia manual
|
|
60
|
+
// desse mapeamento já esqueceu um campo uma vez.
|
|
61
|
+
const result = await fetchNamedBundle(name, { dest: options.dest, force: options.force });
|
|
63
62
|
console.log(result.cached ? `✓ ${name}: já em cache (${result.dest})` : `✓ ${name}: baixado em ${result.dest}`);
|
|
64
63
|
} catch (error) {
|
|
65
64
|
exitCode = 1;
|