create-skateboard-app 1.1.0 → 1.1.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,5 @@
1
+ 1.1.1
2
+ fixed database config
1
3
 
2
4
  1.1.0
3
5
  changed constants to include /api route
package/bin/cli.js CHANGED
@@ -384,40 +384,17 @@ async function main() {
384
384
  if (existsSync(backendConfigPath)) {
385
385
  const backendConfig = JSON.parse(readFileSync(backendConfigPath, 'utf8'));
386
386
 
387
- // Handle new format with databases array
388
- if (backendConfig.databases && Array.isArray(backendConfig.databases) && backendConfig.databases.length > 0) {
389
- const dbConfig = backendConfig.databases[0];
390
-
391
- // Set database configuration
392
- dbConfig.dbType = config.database.value;
393
- dbConfig.db = config.appName.replace(/\s+/g, '');
394
- dbConfig.origin = config.devBackendURL;
395
-
387
+ // Update the database configuration
388
+ if (backendConfig.database) {
389
+ backendConfig.database.dbType = config.database.value;
390
+ backendConfig.database.db = config.appName.replace(/\s+/g, '');
391
+
396
392
  if (config.database.value === 'sqlite') {
397
- dbConfig.connectionString = config.database.connectionString;
393
+ backendConfig.database.connectionString = config.database.connectionString;
398
394
  } else if (config.database.value === 'postgresql') {
399
- dbConfig.connectionString = '${POSTGRES_URL}';
395
+ backendConfig.database.connectionString = '${POSTGRES_URL}';
400
396
  } else if (config.database.value === 'mongodb') {
401
- dbConfig.connectionString = '${MONGODB_URL}';
402
- }
403
- } else {
404
- // Fallback for old format - handle both array and single object formats defensively
405
- const configArray = Array.isArray(backendConfig) ? backendConfig : [backendConfig];
406
-
407
- configArray.forEach(configObj => {
408
- configObj.dbType = config.database.value;
409
- if (config.database.value === 'sqlite') {
410
- configObj.connectionString = config.database.connectionString;
411
- } else if (config.database.value === 'postgresql') {
412
- configObj.connectionString = '${POSTGRES_URL}';
413
- } else if (config.database.value === 'mongodb') {
414
- configObj.connectionString = '${MONGODB_URL}';
415
- }
416
- });
417
-
418
- // Update backendConfig reference for old format
419
- if (!Array.isArray(backendConfig)) {
420
- Object.assign(backendConfig, configArray[0]);
397
+ backendConfig.database.connectionString = '${MONGODB_URL}';
421
398
  }
422
399
  }
423
400
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-skateboard-app",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "Create a new Skateboard app with React, TailwindCSS, and more",
5
5
  "main": "index.js",
6
6
  "type": "module",