realtimex-crm 0.7.2 → 0.7.3

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.
@@ -58,6 +58,9 @@ async function main() {
58
58
  });
59
59
 
60
60
  if (configureNow) {
61
+ console.log("First, ensure you are logged in to the Supabase CLI.");
62
+ console.log("Run `npx supabase login` if you haven't already.");
63
+
61
64
  const supabaseUrl = await input({
62
65
  message: "Supabase URL:",
63
66
  validate: (value) => {
@@ -123,30 +126,43 @@ To configure the app:
123
126
  });
124
127
  };
125
128
 
126
- const runDbPush = await confirm({
127
- message: "Run `npx supabase db push` to apply migrations?",
128
- default: false,
129
- });
130
-
131
- if (runDbPush) {
129
+ // Link the project
130
+ const projectRefMatch = supabaseUrl.match(/https:\/\/([a-zA-Z0-9_-]+)\.supabase\.co/);
131
+ if (projectRefMatch && projectRefMatch[1]) {
132
+ const projectRef = projectRefMatch[1];
132
133
  try {
133
- await runSupabaseCommand(["db", "push"], "🚀 Running `npx supabase db push`...");
134
- } catch (error) {
135
- console.error("Continuing without successful db push.");
136
- }
137
- }
134
+ await runSupabaseCommand(["link", "--project-ref", projectRef], `🔗 Linking to Supabase project '${projectRef}'...`);
138
135
 
139
- const runFunctionsDeploy = await confirm({
140
- message: "Run `npx supabase functions deploy` to deploy functions?",
141
- default: false,
142
- });
136
+ const runDbPush = await confirm({
137
+ message: "Run `npx supabase db push` to apply migrations?",
138
+ default: false,
139
+ });
143
140
 
144
- if (runFunctionsDeploy) {
145
- try {
146
- await runSupabaseCommand(["functions", "deploy"], "🚀 Running `npx supabase functions deploy`...");
141
+ if (runDbPush) {
142
+ try {
143
+ await runSupabaseCommand(["db", "push"], "🚀 Running `npx supabase db push`...");
144
+ } catch (error) {
145
+ console.error("Continuing without successful db push.");
146
+ }
147
+ }
148
+
149
+ const runFunctionsDeploy = await confirm({
150
+ message: "Run `npx supabase functions deploy` to deploy functions?",
151
+ default: false,
152
+ });
153
+
154
+ if (runFunctionsDeploy) {
155
+ try {
156
+ await runSupabaseCommand(["functions", "deploy"], "🚀 Running `npx supabase functions deploy`...");
157
+ } catch (error) {
158
+ console.error("Continuing without successful functions deploy.");
159
+ }
160
+ }
147
161
  } catch (error) {
148
- console.error("Continuing without successful functions deploy.");
162
+ console.error("Could not link to Supabase project. Skipping db push and functions deploy.");
149
163
  }
164
+ } else {
165
+ console.warn("Could not extract project reference from Supabase URL. Skipping link, db push, and functions deploy.");
150
166
  }
151
167
  }
152
168
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "realtimex-crm",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "RealTimeX CRM - A full-featured CRM built with React, shadcn-admin-kit, and Supabase. Fork of Atomic CRM with RealTimeX App SDK integration.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",