@supacloud/cli 0.12.3 → 0.13.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.
Files changed (2) hide show
  1. package/dist/index.js +15 -11
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -6525,22 +6525,26 @@ function migrationRows(data) {
6525
6525
  const rows = Array.isArray(data) ? data : data?.rows || [];
6526
6526
  return Array.isArray(rows) ? rows.filter((row) => Boolean(row && typeof row === "object")) : [];
6527
6527
  }
6528
- function baselineMigrationKey(version, name) {
6528
+ function migrationIdentityKey(version, name) {
6529
6529
  return `${version}\x00${name}`;
6530
6530
  }
6531
- function baselineMigrationKeys(data) {
6531
+ function nameBoundMigrationMarkerKeys(data) {
6532
6532
  const keys = new Set;
6533
6533
  for (const row of migrationRows(data)) {
6534
6534
  if (row.version == null || row.name == null || !Array.isArray(row.statements))
6535
6535
  continue;
6536
- if (row.statements.length !== 1 || row.statements[0] !== `baseline:${String(row.name)}`)
6536
+ if (row.statements.length !== 1)
6537
6537
  continue;
6538
- keys.add(baselineMigrationKey(String(row.version), String(row.name)));
6538
+ const name = String(row.name);
6539
+ const marker = row.statements[0];
6540
+ if (marker !== `baseline:${name}` && marker !== `direct-apply:${name}`)
6541
+ continue;
6542
+ keys.add(migrationIdentityKey(String(row.version), String(row.name)));
6539
6543
  }
6540
6544
  return keys;
6541
6545
  }
6542
6546
  function historicalChecksumMarkerKeys(data, migrationFiles) {
6543
- const filesByKey = new Map(migrationFiles.map((migration) => [baselineMigrationKey(migration.version, migration.name), migration]));
6547
+ const filesByKey = new Map(migrationFiles.map((migration) => [migrationIdentityKey(migration.version, migration.name), migration]));
6544
6548
  const keys = new Set;
6545
6549
  for (const row of migrationRows(data)) {
6546
6550
  if (row.version == null || row.name == null || !Array.isArray(row.statements) || row.statements.length !== 1)
@@ -6548,7 +6552,7 @@ function historicalChecksumMarkerKeys(data, migrationFiles) {
6548
6552
  const marker = row.statements[0];
6549
6553
  if (typeof marker !== "string" || !/^sha256:[0-9a-f]{64}$/.test(marker))
6550
6554
  continue;
6551
- const key = baselineMigrationKey(String(row.version), String(row.name));
6555
+ const key = migrationIdentityKey(String(row.version), String(row.name));
6552
6556
  const migration = filesByKey.get(key);
6553
6557
  if (!migration)
6554
6558
  continue;
@@ -6809,11 +6813,11 @@ Actions: ${allActions.join(", ")}${readOnly ? " (read-only mode)" : ""}`, {
6809
6813
  }
6810
6814
  const applied = [];
6811
6815
  const skipped = [];
6812
- const baselineKeys = baselineMigrationKeys(migrationsResult.data);
6816
+ const nameBoundMarkerKeys = nameBoundMigrationMarkerKeys(migrationsResult.data);
6813
6817
  const historicalChecksumKeys = historicalChecksumMarkerKeys(migrationsResult.data, migrationFiles);
6814
6818
  for (const { file, name, version, sql } of migrationFiles) {
6815
- const migrationKey = baselineMigrationKey(version, name);
6816
- if (baselineKeys.has(migrationKey) || historicalChecksumKeys.has(migrationKey)) {
6819
+ const migrationKey = migrationIdentityKey(version, name);
6820
+ if (nameBoundMarkerKeys.has(migrationKey) || historicalChecksumKeys.has(migrationKey)) {
6817
6821
  skipped.push(file);
6818
6822
  continue;
6819
6823
  }
@@ -8579,7 +8583,7 @@ Actions: routes, upsert_route, update_route, delete_route, config, get_certifica
8579
8583
  ref: optional(Type.String(), projectRef ? "可选:覆盖自动关联的项目 ref" : "项目 ref"),
8580
8584
  route_id: optional(Type.String(), "[upsert_route/update_route/delete_route] 路由 ID(字母/数字/_/-,1-64)"),
8581
8585
  hosts: withDescription(stringArray, "[upsert_route/update_route] 主机名列表,逗号分隔或 JSON 数组(1-20)"),
8582
- paths: withDescription(stringArray, "[upsert_route/update_route] 路径列表,逗号分隔或 JSON 数组(1-20)"),
8586
+ paths: withDescription(stringArray, "[upsert_route/update_route] 路径列表,逗号分隔或 JSON 数组(1-32)"),
8583
8587
  upstream: optional(Type.String(), "[upsert_route/update_route] 反代上游 host:port 或 http(s)://host[:port]"),
8584
8588
  upstream_tls_insecure_skip_verify: optional(Type.Boolean(), "[upsert_route/update_route] 上游 TLS 跳过校验"),
8585
8589
  static_root: optional(Type.String(), "[upsert_route/update_route] 静态站点根目录"),
@@ -9157,7 +9161,7 @@ function resolveOfficialSupabaseCommand(workdir, environment = process.env) {
9157
9161
  const version = environment.SUPABASE_CLI_VERSION?.trim();
9158
9162
  if (version) {
9159
9163
  if (!VALID_VERSION.test(version))
9160
- throw new Error("Invalid SUPABASE_CLI_VERSION; use an exact version such as 2.109.1");
9164
+ throw new Error("Invalid SUPABASE_CLI_VERSION; use an exact version such as 2.110.0");
9161
9165
  if (process.versions.bun)
9162
9166
  return [process.execPath, "x", `supabase@${version}`];
9163
9167
  if (process.platform === "win32") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supacloud/cli",
3
- "version": "0.12.3",
3
+ "version": "0.13.0",
4
4
  "description": "Project-scoped CLI for SupaCloud users",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",