@surnie/plugin-kit 0.2.6 → 0.2.7

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.
Files changed (2) hide show
  1. package/dist/cli.js +19 -5
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -617,6 +617,16 @@ function parseManifest(input, { contracts = [PLUGIN_CONTRACT] } = {}) {
617
617
  }
618
618
  function manifestTexts(m) {
619
619
  const out = [];
620
+ const str2 = (v) => typeof v === "string" ? [v] : [];
621
+ for (const item of [...m.model?.collections ?? [], ...m.model?.singleTypes ?? [], ...m.model?.components ?? []]) {
622
+ const t = item;
623
+ out.push(...str2(t.labelSingular), ...str2(t.labelPlural), ...str2(t.label));
624
+ for (const f of Object.values(item.fields ?? {})) {
625
+ const field3 = f;
626
+ out.push(...str2(field3.label), ...str2(field3.description), ...str2(field3.placeholder));
627
+ for (const o of Array.isArray(field3.options) ? field3.options : []) out.push(...str2(o?.label));
628
+ }
629
+ }
620
630
  for (const p of [...m.permissions.required, ...m.permissions.optional]) out.push(p.purpose);
621
631
  for (const st of m.settings) {
622
632
  out.push(st.label);
@@ -1805,7 +1815,7 @@ function yarnrc(dir, pm) {
1805
1815
  }
1806
1816
  function installEnv() {
1807
1817
  const env = {};
1808
- for (const [k, v] of Object.entries(process.env)) if (!/^npm_|^NPM_CONFIG_|^YARN_|^BUN_CONFIG_/i.test(k)) env[k] = v;
1818
+ for (const [k, v] of Object.entries(process.env)) if (!/^npm_|^NPM_CONFIG_|^YARN_|^BUN_CONFIG_|^NODE_ENV$/i.test(k)) env[k] = v;
1809
1819
  return {
1810
1820
  ...env,
1811
1821
  CI: "1",
@@ -2407,7 +2417,7 @@ async function publish(dir, opts) {
2407
2417
  opts.log?.(`Enviando ${namespace} ${version} (${build.pkg.length} B y la fuente, ${build.source.length} B)\u2026`);
2408
2418
  const response = await call(opts, "PUT", `/v1/plugins/${namespace}/versions/${version}`, {
2409
2419
  body: form,
2410
- headers: { "Surnie-Kit-Version": build.kit }
2420
+ headers: { "Surnie-Kit-Version": build.kit, ...opts.security ? { "Surnie-Security": "1" } : {} }
2411
2421
  });
2412
2422
  return follow(dir, build, opts, await response.json());
2413
2423
  }
@@ -2499,7 +2509,11 @@ function inspectPackage(gz, approvalRaw) {
2499
2509
  }
2500
2510
 
2501
2511
  // src/cli.ts
2502
- var USAGE = `Uso: surnie-plugin keygen | dev | types | pack | sign | inspect <paquete.tgz> | publish | status
2512
+ var USAGE = `Uso: surnie-plugin keygen | dev | types | pack | sign | inspect <paquete.tgz> | publish [--security] | status
2513
+
2514
+ publish --security
2515
+ la versi\xF3n arregla un fallo de seguridad: la revisa siempre una persona y, aprobada, llega sin
2516
+ espera a las instalaciones que actualizan el plugin solo en "solo seguridad"
2503
2517
 
2504
2518
  dev [--port <n>] [--image <imagen>] [--reset] [--no-docker]
2505
2519
  --port puerto del panel en esta m\xE1quina (${DEV_PORT})
@@ -2539,7 +2553,7 @@ function report(r) {
2539
2553
  if (r.outcome === "approved") {
2540
2554
  console.log(`
2541
2555
  \u2714 ${namespace} ${version} publicado. Su aprobaci\xF3n: ${r.approvalFile}`);
2542
- console.log(" Para instalarlo a mano, sube el paquete y ese fichero en Ajustes \u2192 Plugins.\n");
2556
+ console.log(" Para instalarlo a mano, sube el paquete y ese fichero en Plugins \u2192 Instalar desde un paquete.\n");
2543
2557
  return 0;
2544
2558
  }
2545
2559
  if (r.outcome === "review") {
@@ -2605,7 +2619,7 @@ async function main(argv) {
2605
2619
  const token = await publishToken();
2606
2620
  const opts = { token, platformUrl: url };
2607
2621
  if (cmd === "status") return report(await status(process.cwd(), opts));
2608
- return report(await publish(process.cwd(), { ...opts, log: (line) => console.log(line) }));
2622
+ return report(await publish(process.cwd(), { ...opts, security: argv.includes("--security"), log: (line) => console.log(line) }));
2609
2623
  }
2610
2624
  if (cmd === "inspect" && arg) {
2611
2625
  const approvalPath = arg.replace(/\.tgz$/, ".approval.json");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@surnie/plugin-kit",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
4
4
  "description": "Kit para escribir plugins de Surnie: manifiesto, compilación reproducible, firma e inspección.",
5
5
  "type": "module",
6
6
  "bin": {