@hot-updater/supabase 1.1.6 → 1.1.8

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.
@@ -6575,6 +6575,16 @@ const supabaseApi = (supabaseUrl, supabaseServiceRoleKey) => {
6575
6575
  };
6576
6576
  };
6577
6577
  //#endregion
6578
+ //#region iac/supabaseCliPackage.ts
6579
+ /**
6580
+ * The Supabase CLI init runs, as `npx -y <SUPABASE_CLI>`, so whichever CLI
6581
+ * the project installs or npx resolves can't change what its commands do.
6582
+ * Supabase CLI 3 sends `db push` and `migration fetch` without a target to
6583
+ * the local stack, and fails a hosted change without a terminal unless
6584
+ * `--yes` is passed: moving to it means passing those flags.
6585
+ */
6586
+ const SUPABASE_CLI = "supabase@2.122.1";
6587
+ //#endregion
6578
6588
  //#region iac/supabaseAuthentication.ts
6579
6589
  const SUPABASE_AUTH_METHOD = {
6580
6590
  accessToken: "access-token",
@@ -6595,7 +6605,7 @@ const openBrowser = async (url) => {
6595
6605
  const hasValidSupabaseCliLogin = async () => {
6596
6606
  return (await execa("npx", [
6597
6607
  "-y",
6598
- "supabase",
6608
+ SUPABASE_CLI,
6599
6609
  "projects",
6600
6610
  "list",
6601
6611
  "--output",
@@ -6622,7 +6632,7 @@ const inputSupabaseAccessToken = async (accessToken) => {
6622
6632
  if (await hasValidSupabaseCliLogin()) return;
6623
6633
  const loginProcess = execa("npx", [
6624
6634
  "-y",
6625
- "supabase",
6635
+ SUPABASE_CLI,
6626
6636
  "login",
6627
6637
  "--no-browser",
6628
6638
  "--agent",
@@ -6704,7 +6714,8 @@ const linkSupabase = async (workdir, { accessToken, projectId, dbPassword }) =>
6704
6714
  await fs_promises.default.writeFile(path.default.join(workdir, "supabase", "config.toml"), (0, _hot_updater_cli_tools.transformTemplate)(SUPABASE_CONFIG_TEMPLATE, { projectId }));
6705
6715
  spinner.start("Linking Supabase...");
6706
6716
  await execa("npx", [
6707
- "supabase",
6717
+ "-y",
6718
+ SUPABASE_CLI,
6708
6719
  "link",
6709
6720
  "--project-ref",
6710
6721
  projectId,
@@ -6729,7 +6740,8 @@ const linkSupabase = async (workdir, { accessToken, projectId, dbPassword }) =>
6729
6740
  const pushDB = async (workdir, { accessToken, dbPassword }) => {
6730
6741
  try {
6731
6742
  await execa("npx", [
6732
- "supabase",
6743
+ "-y",
6744
+ SUPABASE_CLI,
6733
6745
  "migration",
6734
6746
  "fetch",
6735
6747
  "--linked",
@@ -6744,10 +6756,12 @@ const pushDB = async (workdir, { accessToken, dbPassword }) => {
6744
6756
  throw error;
6745
6757
  });
6746
6758
  const dbPush = await execa("npx", [
6747
- "supabase",
6759
+ "-y",
6760
+ SUPABASE_CLI,
6748
6761
  "db",
6749
6762
  "push",
6750
6763
  "--include-all",
6764
+ "--linked",
6751
6765
  "--yes",
6752
6766
  "--workdir",
6753
6767
  workdir
@@ -6904,7 +6918,7 @@ const isRecord$1 = (value) => typeof value === "object" && value !== null;
6904
6918
  const runSupabaseCli = async (args) => {
6905
6919
  const result = await execa("npx", [
6906
6920
  "-y",
6907
- "supabase",
6921
+ SUPABASE_CLI,
6908
6922
  ...args
6909
6923
  ], { env: void 0 });
6910
6924
  return JSON.parse(result.stdout);
@@ -6935,7 +6949,7 @@ const supabaseCliManagementApi = () => ({
6935
6949
  createProject: async ({ name, organizationSlug, region }) => {
6936
6950
  await execa("npx", [
6937
6951
  "-y",
6938
- "supabase",
6952
+ SUPABASE_CLI,
6939
6953
  "projects",
6940
6954
  "create",
6941
6955
  name,
@@ -7231,7 +7245,7 @@ const selectProject = async (preferredProjectId, nonInteractive = false, accessT
7231
7245
  try {
7232
7246
  const listProjects = await execa("npx", [
7233
7247
  "-y",
7234
- "supabase",
7248
+ SUPABASE_CLI,
7235
7249
  "projects",
7236
7250
  "list",
7237
7251
  "--output",
@@ -7392,7 +7406,8 @@ const deployEdgeFunction = async (accessToken, workdir, projectId, functionName)
7392
7406
  task: async () => {
7393
7407
  try {
7394
7408
  return (await execa("npx", [
7395
- "supabase",
7409
+ "-y",
7410
+ SUPABASE_CLI,
7396
7411
  "functions",
7397
7412
  "deploy",
7398
7413
  functionName,
@@ -7437,7 +7452,7 @@ const getSupabaseProjectAccess = async ({ accessToken, managementApi, project, w
7437
7452
  const getServiceRoleApiKey = async () => {
7438
7453
  const keysProcess = await execa("npx", [
7439
7454
  "-y",
7440
- "supabase",
7455
+ SUPABASE_CLI,
7441
7456
  "projects",
7442
7457
  "api-keys",
7443
7458
  "--project-ref",
@@ -6570,6 +6570,16 @@ const supabaseApi = (supabaseUrl, supabaseServiceRoleKey) => {
6570
6570
  };
6571
6571
  };
6572
6572
  //#endregion
6573
+ //#region iac/supabaseCliPackage.ts
6574
+ /**
6575
+ * The Supabase CLI init runs, as `npx -y <SUPABASE_CLI>`, so whichever CLI
6576
+ * the project installs or npx resolves can't change what its commands do.
6577
+ * Supabase CLI 3 sends `db push` and `migration fetch` without a target to
6578
+ * the local stack, and fails a hosted change without a terminal unless
6579
+ * `--yes` is passed: moving to it means passing those flags.
6580
+ */
6581
+ const SUPABASE_CLI = "supabase@2.122.1";
6582
+ //#endregion
6573
6583
  //#region iac/supabaseAuthentication.ts
6574
6584
  const SUPABASE_AUTH_METHOD = {
6575
6585
  accessToken: "access-token",
@@ -6590,7 +6600,7 @@ const openBrowser = async (url) => {
6590
6600
  const hasValidSupabaseCliLogin = async () => {
6591
6601
  return (await execa("npx", [
6592
6602
  "-y",
6593
- "supabase",
6603
+ SUPABASE_CLI,
6594
6604
  "projects",
6595
6605
  "list",
6596
6606
  "--output",
@@ -6617,7 +6627,7 @@ const inputSupabaseAccessToken = async (accessToken) => {
6617
6627
  if (await hasValidSupabaseCliLogin()) return;
6618
6628
  const loginProcess = execa("npx", [
6619
6629
  "-y",
6620
- "supabase",
6630
+ SUPABASE_CLI,
6621
6631
  "login",
6622
6632
  "--no-browser",
6623
6633
  "--agent",
@@ -6699,7 +6709,8 @@ const linkSupabase = async (workdir, { accessToken, projectId, dbPassword }) =>
6699
6709
  await fs.writeFile(path.join(workdir, "supabase", "config.toml"), transformTemplate(SUPABASE_CONFIG_TEMPLATE, { projectId }));
6700
6710
  spinner.start("Linking Supabase...");
6701
6711
  await execa("npx", [
6702
- "supabase",
6712
+ "-y",
6713
+ SUPABASE_CLI,
6703
6714
  "link",
6704
6715
  "--project-ref",
6705
6716
  projectId,
@@ -6724,7 +6735,8 @@ const linkSupabase = async (workdir, { accessToken, projectId, dbPassword }) =>
6724
6735
  const pushDB = async (workdir, { accessToken, dbPassword }) => {
6725
6736
  try {
6726
6737
  await execa("npx", [
6727
- "supabase",
6738
+ "-y",
6739
+ SUPABASE_CLI,
6728
6740
  "migration",
6729
6741
  "fetch",
6730
6742
  "--linked",
@@ -6739,10 +6751,12 @@ const pushDB = async (workdir, { accessToken, dbPassword }) => {
6739
6751
  throw error;
6740
6752
  });
6741
6753
  const dbPush = await execa("npx", [
6742
- "supabase",
6754
+ "-y",
6755
+ SUPABASE_CLI,
6743
6756
  "db",
6744
6757
  "push",
6745
6758
  "--include-all",
6759
+ "--linked",
6746
6760
  "--yes",
6747
6761
  "--workdir",
6748
6762
  workdir
@@ -6899,7 +6913,7 @@ const isRecord$1 = (value) => typeof value === "object" && value !== null;
6899
6913
  const runSupabaseCli = async (args) => {
6900
6914
  const result = await execa("npx", [
6901
6915
  "-y",
6902
- "supabase",
6916
+ SUPABASE_CLI,
6903
6917
  ...args
6904
6918
  ], { env: void 0 });
6905
6919
  return JSON.parse(result.stdout);
@@ -6930,7 +6944,7 @@ const supabaseCliManagementApi = () => ({
6930
6944
  createProject: async ({ name, organizationSlug, region }) => {
6931
6945
  await execa("npx", [
6932
6946
  "-y",
6933
- "supabase",
6947
+ SUPABASE_CLI,
6934
6948
  "projects",
6935
6949
  "create",
6936
6950
  name,
@@ -7226,7 +7240,7 @@ const selectProject = async (preferredProjectId, nonInteractive = false, accessT
7226
7240
  try {
7227
7241
  const listProjects = await execa("npx", [
7228
7242
  "-y",
7229
- "supabase",
7243
+ SUPABASE_CLI,
7230
7244
  "projects",
7231
7245
  "list",
7232
7246
  "--output",
@@ -7387,7 +7401,8 @@ const deployEdgeFunction = async (accessToken, workdir, projectId, functionName)
7387
7401
  task: async () => {
7388
7402
  try {
7389
7403
  return (await execa("npx", [
7390
- "supabase",
7404
+ "-y",
7405
+ SUPABASE_CLI,
7391
7406
  "functions",
7392
7407
  "deploy",
7393
7408
  functionName,
@@ -7432,7 +7447,7 @@ const getSupabaseProjectAccess = async ({ accessToken, managementApi, project, w
7432
7447
  const getServiceRoleApiKey = async () => {
7433
7448
  const keysProcess = await execa("npx", [
7434
7449
  "-y",
7435
- "supabase",
7450
+ SUPABASE_CLI,
7436
7451
  "projects",
7437
7452
  "api-keys",
7438
7453
  "--project-ref",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hot-updater/supabase",
3
3
  "type": "module",
4
- "version": "1.1.6",
4
+ "version": "1.1.8",
5
5
  "description": "React Native OTA solution for self-hosted",
6
6
  "main": "dist/index.cjs",
7
7
  "module": "dist/index.mjs",
@@ -51,10 +51,10 @@
51
51
  "@supabase/supabase-js": "2.76.1",
52
52
  "hono": "4.12.34",
53
53
  "uuidv7": "^1.0.2",
54
- "@hot-updater/protocol": "1.1.6",
55
- "@hot-updater/plugin-core": "1.1.6",
56
- "@hot-updater/server": "1.1.6",
57
- "@hot-updater/cli-tools": "1.1.6"
54
+ "@hot-updater/protocol": "1.1.8",
55
+ "@hot-updater/plugin-core": "1.1.8",
56
+ "@hot-updater/cli-tools": "1.1.8",
57
+ "@hot-updater/server": "1.1.8"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@electric-sql/pglite": "0.4.1",
@@ -64,9 +64,9 @@
64
64
  "execa": "9.5.2",
65
65
  "@types/node": "^20",
66
66
  "mime": "^4.0.4",
67
- "@hot-updater/test-utils": "1.1.6",
68
- "@hot-updater/postgres": "1.1.6",
69
- "@hot-updater/mock": "1.1.6"
67
+ "@hot-updater/mock": "1.1.8",
68
+ "@hot-updater/test-utils": "1.1.8",
69
+ "@hot-updater/postgres": "1.1.8"
70
70
  },
71
71
  "scripts": {
72
72
  "build": "tsdown",