Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 4 additions & 13 deletions .audit-allowlist.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"El gate corre `npm audit --omit=dev --audit-level=high` y BLOQUEA cualquier CVE high+ NUEVO en deps de",
"PRODUCCIÓN (lo que viaja en el bundle standalone). Las advisories de acá son el backlog CONOCIDO al",
"2026-06-22: aceptadas temporalmente para no frenar releases mientras se saldan. Cada upgrade que cierre",
"una debe ELIMINAR su entrada (el gate avisa cuáles quedaron obsoletas). Burn-down pendiente: subir Next a",
"una versión sin estos CVEs (upgrade mayor, breaking), reemplazar/quitar xlsx (sin fix), y `npm audit fix`",
"de las no-breaking (form-data, lodash, ws, flatted, minimatch, picomatch)."
"una debe ELIMINAR su entrada (el gate avisa cuáles quedaron obsoletas). La poda del CLI npx (sacar",
"wrangler/@opennextjs/cloudflare/@aws-sdk) eliminó las advisories transitivas de form-data, lodash, ws,",
"flatted, minimatch y picomatch, ya quitadas de acá. Burn-down restante: subir Next a una versión sin",
"estos CVEs (upgrade mayor, breaking) y reemplazar/quitar xlsx (sin fix)."
],
"created": "2026-06-22",
"allow": [
Expand All @@ -19,16 +20,6 @@
{ "id": "GHSA-492v-c6pp-mqqv", "pkg": "next", "severity": "high", "fix": "upgrade-mayor (breaking)", "note": "Middleware/proxy bypass (route params)." },
{ "id": "GHSA-267c-6grr-h53f", "pkg": "next", "severity": "high", "fix": "upgrade-mayor (breaking)", "note": "Middleware/proxy bypass (segment-prefetch)." },
{ "id": "GHSA-36qx-fr4f-26g5", "pkg": "next", "severity": "high", "fix": "upgrade-mayor (breaking)", "note": "Middleware/proxy bypass (Pages Router i18n)." },
{ "id": "GHSA-fjxv-7rqg-78g4", "pkg": "form-data", "severity": "critical", "fix": "npm audit fix (no-breaking)", "note": "Random inseguro para boundary. Transitiva. Saldar en el burn-down." },
{ "id": "GHSA-hmw2-7cc7-3qxx", "pkg": "form-data", "severity": "high", "fix": "npm audit fix (no-breaking)", "note": "CRLF injection. Transitiva. Saldar en el burn-down." },
{ "id": "GHSA-r5fr-rjxr-66jc", "pkg": "lodash / lodash-es", "severity": "high", "fix": "npm audit fix (no-breaking)", "note": "Code injection vía _.template. Saldar en el burn-down." },
{ "id": "GHSA-3ppc-4f35-3m26", "pkg": "minimatch", "severity": "high", "fix": "npm audit fix", "note": "ReDoS. Transitiva. Saldar en el burn-down." },
{ "id": "GHSA-7r86-cg39-jmmj", "pkg": "minimatch", "severity": "high", "fix": "npm audit fix", "note": "ReDoS matchOne(). Transitiva." },
{ "id": "GHSA-23c5-xmqv-rm74", "pkg": "minimatch", "severity": "high", "fix": "npm audit fix", "note": "ReDoS extglobs anidados. Transitiva." },
{ "id": "GHSA-c2c7-rcm5-vvqj", "pkg": "picomatch", "severity": "high", "fix": "npm audit fix", "note": "ReDoS extglob quantifiers. Transitiva." },
{ "id": "GHSA-96hv-2xvq-fx4p", "pkg": "ws", "severity": "high", "fix": "npm audit fix (no-breaking)", "note": "Memory exhaustion DoS. Transitiva (miniflare/dev)." },
{ "id": "GHSA-25h7-pfq9-p65f", "pkg": "flatted", "severity": "high", "fix": "npm audit fix (no-breaking)", "note": "DoS recursión en parse(). Transitiva." },
{ "id": "GHSA-rf6f-7fwh-wjgh", "pkg": "flatted", "severity": "high", "fix": "npm audit fix (no-breaking)", "note": "Prototype pollution vía parse(). Transitiva." },
{ "id": "GHSA-4r6h-8v6p-xvw6", "pkg": "xlsx", "severity": "high", "fix": "SIN FIX", "note": "Prototype pollution SheetJS. No hay fix en npm: evaluar reemplazo o dejar de exponer import/export xlsx." },
{ "id": "GHSA-5pgg-2g8v-p4x9", "pkg": "xlsx", "severity": "high", "fix": "SIN FIX", "note": "ReDoS SheetJS. No hay fix en npm: evaluar reemplazo." }
]
Expand Down
53 changes: 53 additions & 0 deletions _deprecated/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# `_deprecated/` — maquinaria cloud del upstream, fuera del build del CLI npx

Esta carpeta junta código y config del upstream Outerbase Studio que el flujo del CLI
`npx quick-outerbase` (ruta `/env`) **no usa**. Nada se borró: todo está movido acá y
excluido del typecheck (`tsconfig.json` → `exclude`), del lint (fuera de `src/`), del
jest (`testPathIgnorePatterns`) y del build de Next (Next solo rutea/compila lo que vive
en `src/app`). El prefijo del directorio no es `_` por casualidad: Next ignora carpetas
`_`-prefijadas, así que aunque algo quedara bajo `src/app` no se rutearía.

Todo es **100% reversible**: mover de vuelta + revertir los edits puntuales (ver abajo).

## 1. Deploy a Cloudflare (`cloudflare-deploy/`)
Movidos: `wrangler.jsonc`, `open-next.config.ts`, `Dockerfile`, `.dockerignore`.
- Sacados de `package.json`: scripts `preview` y `deploy`; devDeps `@opennextjs/cloudflare` y `wrangler`.
- **Reactivar:** mover los 4 archivos a la raíz, reponer scripts/devDeps, `npm i`.
- El release a npm (`release-bundles.yml`) NO usa Cloudflare → esto no lo rompe.

## 2. Agent Cloudflare Workers AI (`src/drivers/agent/cloudflare.ts`)
El assistant quedó como BYO (Anthropic/OpenAI/Gemini). Se sacó el free-tier de Cloudflare.
- **Reactivar:** mover `cloudflare.ts` de vuelta a `src/drivers/agent/`, descomentar el import,
el registro del `dict` y el grupo `cloudflare` en `src/drivers/agent/list.tsx`.

## 3. DynamoDB (corte activo)
Era el único lastre cableado al flujo `/env`, así que se cortó activamente con marcadores
`// DEPRECATED: dynamodb` en cada branch (buscables con grep). Archivos movidos acá:
`src/drivers/dynamodb/*`, `src/drivers/database/dynamodb-queryable.ts`, `src/app/proxy/dynamodb/`,
`src/lib/dynamodb-credentials.ts` (+ tests). Se sacaron `@aws-sdk/{client,lib,util}-dynamodb`.
- Puntos de corte (KEEP, reversibles por git): `lib/env-driver.ts`, `lib/database-url.ts`
(SCHEME_MAP), `app/api/env-database/route.ts`, `bin/fork-studio.mjs`, `lib/build-table-result.ts`,
`components/gui/sql-editor/index.tsx`, `drivers/base-driver.ts` (tipo SupportedDialect conserva
"dynamodb" a propósito).
- **Reactivar:** revertir esos marcadores, mover los archivos de vuelta, reponer `@aws-sdk/*`.

## 4. Lastre upstream (rutas/componentes/drivers cloud)
Movidos a `_deprecated/src/...` preservando estructura: rutas `(outerbase)` (salvo
`local-setting-dialog.tsx`), `(dark-only)`, `(public)`, `(theme)/{client,playground,embed}`,
`(theme)/connect/saved-connection-storage.ts`, `storybook`, `proxy/d1`; componentes `board`,
`chart`, `mdx`, `picker`, extras de `orbit`, listview de `gui`; `outerbase-cloud`; extensions
`outerbase/data-catalog/dolt/local-setting-sidebar`; drivers de nicho (cloudflare-d1/wae,
starbasedb, rqlite, valtown, sqljs, iframe, helpers, mysql-playground). Se agregó
`src/app/page.tsx` (redirect `/`→`/env`, antes lo servía `(outerbase)/page.tsx`).
- Deps sacadas: `echarts`, `react-grid-layout`, `react-color` (+ @types).
- **Reactivar:** mover `_deprecated/src/<path>` de vuelta a `src/<path>` y reponer deps.

## 5. MDX (docs/storybook)
No quedan páginas `.mdx` en el build. `next.config.js` ya no usa `@next/mdx` ni el pageExtension
`mdx`. Deps sacadas: `@next/mdx`, `@mdx-js/loader`, `@mdx-js/react`, `@types/mdx`; devDeps `shiki`,
`@types/sql.js`. (`showdown` se mantiene: lo usa `build-dialect.js`.)
- **Reactivar:** reponer `withMDX` + `"mdx"` en `next.config.js` y las deps mdx.

## Mecanismo de exclusión (todo reversible)
`tsconfig.json` → `exclude: ["node_modules","_deprecated"]`; `jest.config.ts` →
`testPathIgnorePatterns` incluye `_deprecated`; Next no rutea/compila fuera de `src/app`.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 4 additions & 21 deletions bin/fork-studio.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ function positionalUrl() {
return process.argv
.slice(2)
.find((a) =>
/^(postgres|postgresql|mysql|mariadb|sqlite|file|libsql|dynamodb):/i.test(a)
/^(postgres|postgresql|mysql|mariadb|sqlite|file|libsql):/i.test(a)
);
}

Expand All @@ -63,6 +63,8 @@ if (!url) {

// Inferencia/validación del motor por el scheme (espejo de src/lib/database-url.ts).
const scheme = (url.match(/^([a-zA-Z][a-zA-Z0-9+.-]*):/) || [])[1]?.toLowerCase();
// DEPRECATED: dynamodb — scheme y guard de credenciales AWS removidos del build del CLI.
// Reversible: ver _deprecated/README.md.
const SUPPORTED = new Set([
"postgres",
"postgresql",
Expand All @@ -71,32 +73,13 @@ const SUPPORTED = new Set([
"sqlite",
"file",
"libsql",
"dynamodb",
]);
if (!scheme || !SUPPORTED.has(scheme)) {
fail(
`Scheme no reconocido: "${scheme || "(ninguno)"}". ` +
"Motores soportados: postgres://, postgresql://, mysql://, sqlite:/file:, libsql://, dynamodb://<region>"
"Motores soportados: postgres://, postgresql://, mysql://, sqlite:/file:, libsql://"
);
}

// DynamoDB: las credenciales NO van en la URL. La URL solo lleva región (+endpoint
// opcional para DynamoDB Local). Las creds las resuelve el server desde la cadena
// estándar de AWS (env AWS_ACCESS_KEY_ID/SECRET/SESSION_TOKEN, ~/.aws/credentials o
// IAM role) — heredadas vía process.env por el build/start de Next de abajo.
if (scheme === "dynamodb") {
const hasEnvCreds =
process.env.AWS_ACCESS_KEY_ID ||
process.env.AWS_PROFILE ||
process.env.AWS_CONTAINER_CREDENTIALS_RELATIVE_URI ||
process.env.AWS_WEB_IDENTITY_TOKEN_FILE;
if (!hasEnvCreds) {
console.warn(
'\x1b[33m⚠ DynamoDB: no detecté credenciales AWS en el entorno. Si no usás un perfil ' +
"(~/.aws/credentials) ni un IAM role, seteá AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY antes de correr.\x1b[0m"
);
}
}
const redacted = url.replace(/\/\/([^:/@]+):([^@]+)@/, "//$1:***@");
console.log(`▶ Fork-Outerbase Studio → ${scheme} (${redacted})`);

Expand Down
2 changes: 2 additions & 0 deletions jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ const config: Config = {
window: {},
},
testEnvironment: "node",
// _deprecated/ = maquinaria cloud upstream fuera del build del CLI npx.
testPathIgnorePatterns: ["<rootDir>/node_modules/", "<rootDir>/_deprecated/"],
// Add more setup options before each test is run
setupFilesAfterEnv: ["<rootDir>/jest.setup.ts"],
};
Expand Down
9 changes: 6 additions & 3 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const withMDX = require("@next/mdx")();
// DEPRECATED: mdx — las páginas .mdx (docs/storybook) se movieron a _deprecated en la
// poda del CLI npx, así que sacamos @next/mdx y el pageExtension "mdx". Reversible:
// reponer `const withMDX = require("@next/mdx")();`, "mdx" en pageExtensions y envolver
// con withMDX(...). Ver _deprecated/README.md.
const pkg = require("./package.json");

// Para correr local con `next start` necesitamos un build normal (no standalone).
Expand All @@ -10,7 +13,7 @@ const OUTPUT_MODE = process.env.FORK_LOCAL === "1" ? undefined : "standalone";
const nextConfig = {
output: OUTPUT_MODE,
reactStrictMode: false,
pageExtensions: ["js", "jsx", "mdx", "ts", "tsx"],
pageExtensions: ["js", "jsx", "ts", "tsx"],
env: {
NEXT_PUBLIC_STUDIO_VERSION: pkg.version,
},
Expand All @@ -24,4 +27,4 @@ const nextConfig = {
},
};

module.exports = { ...withMDX(nextConfig), output: OUTPUT_MODE };
module.exports = { ...nextConfig, output: OUTPUT_MODE };
Loading
Loading