@hot-updater/supabase 1.2.0-rc.22 → 1.2.0-rc.24
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/dist/init/index.cjs +32 -18
- package/dist/init/index.mjs +32 -18
- package/package.json +8 -8
package/dist/init/index.cjs
CHANGED
|
@@ -6605,6 +6605,17 @@ const supabaseApi = (supabaseUrl, supabaseServiceRoleKey) => {
|
|
|
6605
6605
|
};
|
|
6606
6606
|
};
|
|
6607
6607
|
//#endregion
|
|
6608
|
+
//#region iac/supabaseCliPackage.ts
|
|
6609
|
+
/**
|
|
6610
|
+
* The Supabase CLI init runs, as `npx -y <SUPABASE_CLI>`, so whichever CLI
|
|
6611
|
+
* the project installs or npx resolves can't change what its commands do.
|
|
6612
|
+
* Its commands use Supabase CLI 3's forms: `--remote` targets the linked
|
|
6613
|
+
* project or `--remote=<ref>` another one, and every hosted change passes
|
|
6614
|
+
* `--yes`, because CLI 3 fails one without a terminal unless it does. Move
|
|
6615
|
+
* to a new major only after checking each command against its release notes.
|
|
6616
|
+
*/
|
|
6617
|
+
const SUPABASE_CLI = "supabase@3.0.0";
|
|
6618
|
+
//#endregion
|
|
6608
6619
|
//#region iac/supabaseAuthentication.ts
|
|
6609
6620
|
const SUPABASE_AUTH_METHOD = {
|
|
6610
6621
|
accessToken: "access-token",
|
|
@@ -6625,7 +6636,7 @@ const openBrowser = async (url) => {
|
|
|
6625
6636
|
const hasValidSupabaseCliLogin = async () => {
|
|
6626
6637
|
return (await execa("npx", [
|
|
6627
6638
|
"-y",
|
|
6628
|
-
|
|
6639
|
+
SUPABASE_CLI,
|
|
6629
6640
|
"projects",
|
|
6630
6641
|
"list",
|
|
6631
6642
|
"--output",
|
|
@@ -6652,7 +6663,7 @@ const inputSupabaseAccessToken = async (accessToken) => {
|
|
|
6652
6663
|
if (await hasValidSupabaseCliLogin()) return;
|
|
6653
6664
|
const loginProcess = execa("npx", [
|
|
6654
6665
|
"-y",
|
|
6655
|
-
|
|
6666
|
+
SUPABASE_CLI,
|
|
6656
6667
|
"login",
|
|
6657
6668
|
"--no-browser",
|
|
6658
6669
|
"--agent",
|
|
@@ -6737,9 +6748,9 @@ const confirmSupabaseDatabaseMigrations = async ({ nonInteractive }) => {
|
|
|
6737
6748
|
const runSupabaseLink = async (workdir, { accessToken, projectId, dbPassword }) => {
|
|
6738
6749
|
await fs_promises.default.writeFile(path.default.join(workdir, "supabase", "config.toml"), (0, _hot_updater_cli_tools.transformTemplate)(SUPABASE_CONFIG_TEMPLATE, { projectId }));
|
|
6739
6750
|
await execa("npx", [
|
|
6740
|
-
"
|
|
6751
|
+
"-y",
|
|
6752
|
+
SUPABASE_CLI,
|
|
6741
6753
|
"link",
|
|
6742
|
-
"--project-ref",
|
|
6743
6754
|
projectId,
|
|
6744
6755
|
"--workdir",
|
|
6745
6756
|
workdir
|
|
@@ -6768,10 +6779,11 @@ const linkSupabase = async (workdir, options) => {
|
|
|
6768
6779
|
/** Pushes the workdir's migrations the linked project has not run, after its own history. */
|
|
6769
6780
|
const runSupabasePush = async (workdir, { accessToken, dbPassword, quiet = false }) => {
|
|
6770
6781
|
await execa("npx", [
|
|
6771
|
-
"
|
|
6782
|
+
"-y",
|
|
6783
|
+
SUPABASE_CLI,
|
|
6772
6784
|
"migration",
|
|
6773
6785
|
"fetch",
|
|
6774
|
-
"--
|
|
6786
|
+
"--remote",
|
|
6775
6787
|
"--yes",
|
|
6776
6788
|
"--workdir",
|
|
6777
6789
|
workdir
|
|
@@ -6783,10 +6795,12 @@ const runSupabasePush = async (workdir, { accessToken, dbPassword, quiet = false
|
|
|
6783
6795
|
throw error;
|
|
6784
6796
|
});
|
|
6785
6797
|
return execa("npx", [
|
|
6786
|
-
"
|
|
6798
|
+
"-y",
|
|
6799
|
+
SUPABASE_CLI,
|
|
6787
6800
|
"db",
|
|
6788
6801
|
"push",
|
|
6789
6802
|
"--include-all",
|
|
6803
|
+
"--remote",
|
|
6790
6804
|
"--yes",
|
|
6791
6805
|
"--workdir",
|
|
6792
6806
|
workdir
|
|
@@ -6949,7 +6963,7 @@ const isRecord$1 = (value) => typeof value === "object" && value !== null;
|
|
|
6949
6963
|
const runSupabaseCli = async (args) => {
|
|
6950
6964
|
const result = await execa("npx", [
|
|
6951
6965
|
"-y",
|
|
6952
|
-
|
|
6966
|
+
SUPABASE_CLI,
|
|
6953
6967
|
...args
|
|
6954
6968
|
], { env: void 0 });
|
|
6955
6969
|
return JSON.parse(result.stdout);
|
|
@@ -6972,15 +6986,14 @@ const supabaseCliManagementApi = () => ({
|
|
|
6972
6986
|
listFunctions: async (projectId) => parseSupabaseFunctionSlugs(await runSupabaseCli([
|
|
6973
6987
|
"functions",
|
|
6974
6988
|
"list",
|
|
6975
|
-
|
|
6976
|
-
projectId,
|
|
6989
|
+
`--remote=${projectId}`,
|
|
6977
6990
|
"--output",
|
|
6978
6991
|
"json"
|
|
6979
6992
|
])),
|
|
6980
6993
|
createProject: async ({ name, organizationSlug, region }) => {
|
|
6981
6994
|
await execa("npx", [
|
|
6982
6995
|
"-y",
|
|
6983
|
-
|
|
6996
|
+
SUPABASE_CLI,
|
|
6984
6997
|
"projects",
|
|
6985
6998
|
"create",
|
|
6986
6999
|
name,
|
|
@@ -6988,6 +7001,7 @@ const supabaseCliManagementApi = () => ({
|
|
|
6988
7001
|
organizationSlug,
|
|
6989
7002
|
"--region",
|
|
6990
7003
|
region,
|
|
7004
|
+
"--yes",
|
|
6991
7005
|
"--agent",
|
|
6992
7006
|
"no"
|
|
6993
7007
|
], { stdio: "inherit" });
|
|
@@ -7276,7 +7290,7 @@ const selectProject = async (preferredProjectId, nonInteractive = false, accessT
|
|
|
7276
7290
|
try {
|
|
7277
7291
|
const listProjects = await execa("npx", [
|
|
7278
7292
|
"-y",
|
|
7279
|
-
|
|
7293
|
+
SUPABASE_CLI,
|
|
7280
7294
|
"projects",
|
|
7281
7295
|
"list",
|
|
7282
7296
|
"--output",
|
|
@@ -7437,13 +7451,14 @@ const deployEdgeFunction = async (accessToken, workdir, projectId, functionName)
|
|
|
7437
7451
|
task: async () => {
|
|
7438
7452
|
try {
|
|
7439
7453
|
return (await execa("npx", [
|
|
7440
|
-
"
|
|
7454
|
+
"-y",
|
|
7455
|
+
SUPABASE_CLI,
|
|
7441
7456
|
"functions",
|
|
7442
7457
|
"deploy",
|
|
7443
7458
|
functionName,
|
|
7444
|
-
|
|
7445
|
-
projectId,
|
|
7459
|
+
`--remote=${projectId}`,
|
|
7446
7460
|
"--no-verify-jwt",
|
|
7461
|
+
"--yes",
|
|
7447
7462
|
"--workdir",
|
|
7448
7463
|
workdir
|
|
7449
7464
|
], {
|
|
@@ -7482,11 +7497,10 @@ const getSupabaseProjectAccess = async ({ accessToken, managementApi, project, w
|
|
|
7482
7497
|
const getServiceRoleApiKey = async () => {
|
|
7483
7498
|
const keysProcess = await execa("npx", [
|
|
7484
7499
|
"-y",
|
|
7485
|
-
|
|
7500
|
+
SUPABASE_CLI,
|
|
7486
7501
|
"projects",
|
|
7487
7502
|
"api-keys",
|
|
7488
|
-
|
|
7489
|
-
project.id,
|
|
7503
|
+
`--remote=${project.id}`,
|
|
7490
7504
|
"--output",
|
|
7491
7505
|
"json"
|
|
7492
7506
|
], { env: getSupabaseCliEnv(accessToken) });
|
package/dist/init/index.mjs
CHANGED
|
@@ -6600,6 +6600,17 @@ const supabaseApi = (supabaseUrl, supabaseServiceRoleKey) => {
|
|
|
6600
6600
|
};
|
|
6601
6601
|
};
|
|
6602
6602
|
//#endregion
|
|
6603
|
+
//#region iac/supabaseCliPackage.ts
|
|
6604
|
+
/**
|
|
6605
|
+
* The Supabase CLI init runs, as `npx -y <SUPABASE_CLI>`, so whichever CLI
|
|
6606
|
+
* the project installs or npx resolves can't change what its commands do.
|
|
6607
|
+
* Its commands use Supabase CLI 3's forms: `--remote` targets the linked
|
|
6608
|
+
* project or `--remote=<ref>` another one, and every hosted change passes
|
|
6609
|
+
* `--yes`, because CLI 3 fails one without a terminal unless it does. Move
|
|
6610
|
+
* to a new major only after checking each command against its release notes.
|
|
6611
|
+
*/
|
|
6612
|
+
const SUPABASE_CLI = "supabase@3.0.0";
|
|
6613
|
+
//#endregion
|
|
6603
6614
|
//#region iac/supabaseAuthentication.ts
|
|
6604
6615
|
const SUPABASE_AUTH_METHOD = {
|
|
6605
6616
|
accessToken: "access-token",
|
|
@@ -6620,7 +6631,7 @@ const openBrowser = async (url) => {
|
|
|
6620
6631
|
const hasValidSupabaseCliLogin = async () => {
|
|
6621
6632
|
return (await execa("npx", [
|
|
6622
6633
|
"-y",
|
|
6623
|
-
|
|
6634
|
+
SUPABASE_CLI,
|
|
6624
6635
|
"projects",
|
|
6625
6636
|
"list",
|
|
6626
6637
|
"--output",
|
|
@@ -6647,7 +6658,7 @@ const inputSupabaseAccessToken = async (accessToken) => {
|
|
|
6647
6658
|
if (await hasValidSupabaseCliLogin()) return;
|
|
6648
6659
|
const loginProcess = execa("npx", [
|
|
6649
6660
|
"-y",
|
|
6650
|
-
|
|
6661
|
+
SUPABASE_CLI,
|
|
6651
6662
|
"login",
|
|
6652
6663
|
"--no-browser",
|
|
6653
6664
|
"--agent",
|
|
@@ -6732,9 +6743,9 @@ const confirmSupabaseDatabaseMigrations = async ({ nonInteractive }) => {
|
|
|
6732
6743
|
const runSupabaseLink = async (workdir, { accessToken, projectId, dbPassword }) => {
|
|
6733
6744
|
await fs.writeFile(path.join(workdir, "supabase", "config.toml"), transformTemplate(SUPABASE_CONFIG_TEMPLATE, { projectId }));
|
|
6734
6745
|
await execa("npx", [
|
|
6735
|
-
"
|
|
6746
|
+
"-y",
|
|
6747
|
+
SUPABASE_CLI,
|
|
6736
6748
|
"link",
|
|
6737
|
-
"--project-ref",
|
|
6738
6749
|
projectId,
|
|
6739
6750
|
"--workdir",
|
|
6740
6751
|
workdir
|
|
@@ -6763,10 +6774,11 @@ const linkSupabase = async (workdir, options) => {
|
|
|
6763
6774
|
/** Pushes the workdir's migrations the linked project has not run, after its own history. */
|
|
6764
6775
|
const runSupabasePush = async (workdir, { accessToken, dbPassword, quiet = false }) => {
|
|
6765
6776
|
await execa("npx", [
|
|
6766
|
-
"
|
|
6777
|
+
"-y",
|
|
6778
|
+
SUPABASE_CLI,
|
|
6767
6779
|
"migration",
|
|
6768
6780
|
"fetch",
|
|
6769
|
-
"--
|
|
6781
|
+
"--remote",
|
|
6770
6782
|
"--yes",
|
|
6771
6783
|
"--workdir",
|
|
6772
6784
|
workdir
|
|
@@ -6778,10 +6790,12 @@ const runSupabasePush = async (workdir, { accessToken, dbPassword, quiet = false
|
|
|
6778
6790
|
throw error;
|
|
6779
6791
|
});
|
|
6780
6792
|
return execa("npx", [
|
|
6781
|
-
"
|
|
6793
|
+
"-y",
|
|
6794
|
+
SUPABASE_CLI,
|
|
6782
6795
|
"db",
|
|
6783
6796
|
"push",
|
|
6784
6797
|
"--include-all",
|
|
6798
|
+
"--remote",
|
|
6785
6799
|
"--yes",
|
|
6786
6800
|
"--workdir",
|
|
6787
6801
|
workdir
|
|
@@ -6944,7 +6958,7 @@ const isRecord$1 = (value) => typeof value === "object" && value !== null;
|
|
|
6944
6958
|
const runSupabaseCli = async (args) => {
|
|
6945
6959
|
const result = await execa("npx", [
|
|
6946
6960
|
"-y",
|
|
6947
|
-
|
|
6961
|
+
SUPABASE_CLI,
|
|
6948
6962
|
...args
|
|
6949
6963
|
], { env: void 0 });
|
|
6950
6964
|
return JSON.parse(result.stdout);
|
|
@@ -6967,15 +6981,14 @@ const supabaseCliManagementApi = () => ({
|
|
|
6967
6981
|
listFunctions: async (projectId) => parseSupabaseFunctionSlugs(await runSupabaseCli([
|
|
6968
6982
|
"functions",
|
|
6969
6983
|
"list",
|
|
6970
|
-
|
|
6971
|
-
projectId,
|
|
6984
|
+
`--remote=${projectId}`,
|
|
6972
6985
|
"--output",
|
|
6973
6986
|
"json"
|
|
6974
6987
|
])),
|
|
6975
6988
|
createProject: async ({ name, organizationSlug, region }) => {
|
|
6976
6989
|
await execa("npx", [
|
|
6977
6990
|
"-y",
|
|
6978
|
-
|
|
6991
|
+
SUPABASE_CLI,
|
|
6979
6992
|
"projects",
|
|
6980
6993
|
"create",
|
|
6981
6994
|
name,
|
|
@@ -6983,6 +6996,7 @@ const supabaseCliManagementApi = () => ({
|
|
|
6983
6996
|
organizationSlug,
|
|
6984
6997
|
"--region",
|
|
6985
6998
|
region,
|
|
6999
|
+
"--yes",
|
|
6986
7000
|
"--agent",
|
|
6987
7001
|
"no"
|
|
6988
7002
|
], { stdio: "inherit" });
|
|
@@ -7271,7 +7285,7 @@ const selectProject = async (preferredProjectId, nonInteractive = false, accessT
|
|
|
7271
7285
|
try {
|
|
7272
7286
|
const listProjects = await execa("npx", [
|
|
7273
7287
|
"-y",
|
|
7274
|
-
|
|
7288
|
+
SUPABASE_CLI,
|
|
7275
7289
|
"projects",
|
|
7276
7290
|
"list",
|
|
7277
7291
|
"--output",
|
|
@@ -7432,13 +7446,14 @@ const deployEdgeFunction = async (accessToken, workdir, projectId, functionName)
|
|
|
7432
7446
|
task: async () => {
|
|
7433
7447
|
try {
|
|
7434
7448
|
return (await execa("npx", [
|
|
7435
|
-
"
|
|
7449
|
+
"-y",
|
|
7450
|
+
SUPABASE_CLI,
|
|
7436
7451
|
"functions",
|
|
7437
7452
|
"deploy",
|
|
7438
7453
|
functionName,
|
|
7439
|
-
|
|
7440
|
-
projectId,
|
|
7454
|
+
`--remote=${projectId}`,
|
|
7441
7455
|
"--no-verify-jwt",
|
|
7456
|
+
"--yes",
|
|
7442
7457
|
"--workdir",
|
|
7443
7458
|
workdir
|
|
7444
7459
|
], {
|
|
@@ -7477,11 +7492,10 @@ const getSupabaseProjectAccess = async ({ accessToken, managementApi, project, w
|
|
|
7477
7492
|
const getServiceRoleApiKey = async () => {
|
|
7478
7493
|
const keysProcess = await execa("npx", [
|
|
7479
7494
|
"-y",
|
|
7480
|
-
|
|
7495
|
+
SUPABASE_CLI,
|
|
7481
7496
|
"projects",
|
|
7482
7497
|
"api-keys",
|
|
7483
|
-
|
|
7484
|
-
project.id,
|
|
7498
|
+
`--remote=${project.id}`,
|
|
7485
7499
|
"--output",
|
|
7486
7500
|
"json"
|
|
7487
7501
|
], { env: getSupabaseCliEnv(accessToken) });
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hot-updater/supabase",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.2.0-rc.
|
|
4
|
+
"version": "1.2.0-rc.24",
|
|
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/
|
|
55
|
-
"@hot-updater/
|
|
56
|
-
"@hot-updater/cli-tools": "1.2.0-rc.
|
|
57
|
-
"@hot-updater/server": "1.2.0-rc.
|
|
54
|
+
"@hot-updater/protocol": "1.2.0-rc.24",
|
|
55
|
+
"@hot-updater/plugin-core": "1.2.0-rc.24",
|
|
56
|
+
"@hot-updater/cli-tools": "1.2.0-rc.24",
|
|
57
|
+
"@hot-updater/server": "1.2.0-rc.24"
|
|
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/mock": "1.2.0-rc.
|
|
68
|
-
"@hot-updater/test-utils": "1.2.0-rc.
|
|
69
|
-
"@hot-updater/postgres": "1.2.0-rc.
|
|
67
|
+
"@hot-updater/mock": "1.2.0-rc.24",
|
|
68
|
+
"@hot-updater/test-utils": "1.2.0-rc.24",
|
|
69
|
+
"@hot-updater/postgres": "1.2.0-rc.24"
|
|
70
70
|
},
|
|
71
71
|
"scripts": {
|
|
72
72
|
"build": "tsdown",
|