create-skateboard-app 1.0.9 → 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 +5 -0
- package/bin/cli.js +10 -33
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/bin/cli.js
CHANGED
|
@@ -241,8 +241,8 @@ async function collectProjectConfig(projectName) {
|
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
// Default values for removed questions
|
|
244
|
-
const backendURL = '
|
|
245
|
-
const devBackendURL = 'http://localhost:8000';
|
|
244
|
+
const backendURL = '/api';
|
|
245
|
+
const devBackendURL = 'http://localhost:8000/api';
|
|
246
246
|
const companyName = 'Your Company';
|
|
247
247
|
|
|
248
248
|
// Read pages from the downloaded template's constants.json
|
|
@@ -384,40 +384,17 @@ async function main() {
|
|
|
384
384
|
if (existsSync(backendConfigPath)) {
|
|
385
385
|
const backendConfig = JSON.parse(readFileSync(backendConfigPath, 'utf8'));
|
|
386
386
|
|
|
387
|
-
//
|
|
388
|
-
if (backendConfig.
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
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
|
-
|
|
393
|
+
backendConfig.database.connectionString = config.database.connectionString;
|
|
398
394
|
} else if (config.database.value === 'postgresql') {
|
|
399
|
-
|
|
395
|
+
backendConfig.database.connectionString = '${POSTGRES_URL}';
|
|
400
396
|
} else if (config.database.value === 'mongodb') {
|
|
401
|
-
|
|
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
|
|