realtimex-crm 0.7.0 → 0.7.2

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.
@@ -97,6 +97,57 @@ To configure the app:
97
97
  `;
98
98
  await writeFile(configPath, configContent);
99
99
  console.log(`Configuration details saved to: ${configPath}\n`);
100
+
101
+ // Helper to run supabase commands
102
+ const runSupabaseCommand = async (command, message) => {
103
+ console.log(`\n${message}`);
104
+ const proc = spawn("npx", ["supabase", ...command], {
105
+ stdio: "inherit",
106
+ shell: true,
107
+ });
108
+
109
+ return new Promise((resolve, reject) => {
110
+ proc.on("close", (code) => {
111
+ if (code === 0) {
112
+ console.log(`✅ Supabase command 'supabase ${command.join(' ')}' completed successfully.`);
113
+ resolve();
114
+ } else {
115
+ console.error(`❌ Supabase command 'supabase ${command.join(' ')}' failed with code ${code}.`);
116
+ reject(new Error(`Supabase command failed with code ${code}`));
117
+ }
118
+ });
119
+ proc.on("error", (err) => {
120
+ console.error(`❌ Failed to start Supabase command 'supabase ${command.join(' ')}': ${err.message}`);
121
+ reject(err);
122
+ });
123
+ });
124
+ };
125
+
126
+ const runDbPush = await confirm({
127
+ message: "Run `npx supabase db push` to apply migrations?",
128
+ default: false,
129
+ });
130
+
131
+ if (runDbPush) {
132
+ try {
133
+ await runSupabaseCommand(["db", "push"], "🚀 Running `npx supabase db push`...");
134
+ } catch (error) {
135
+ console.error("Continuing without successful db push.");
136
+ }
137
+ }
138
+
139
+ const runFunctionsDeploy = await confirm({
140
+ message: "Run `npx supabase functions deploy` to deploy functions?",
141
+ default: false,
142
+ });
143
+
144
+ if (runFunctionsDeploy) {
145
+ try {
146
+ await runSupabaseCommand(["functions", "deploy"], "🚀 Running `npx supabase functions deploy`...");
147
+ } catch (error) {
148
+ console.error("Continuing without successful functions deploy.");
149
+ }
150
+ }
100
151
  }
101
152
 
102
153
  console.log("\n🚀 Starting production server...\n");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "realtimex-crm",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
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",