create-prisma-php-app 4.0.0-alpha.36 → 4.0.0-alpha.38
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/index.js +37 -12
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1277,14 +1277,23 @@ function mergeConfigurationFiles(
|
|
|
1277
1277
|
const bsConfig = bsConfigUrls(projectPathModified);
|
|
1278
1278
|
// If we have existing config, merge with it
|
|
1279
1279
|
if (existingConfig) {
|
|
1280
|
+
console.log(chalk.blue("Merging with existing configuration..."));
|
|
1281
|
+
console.log(
|
|
1282
|
+
chalk.gray(
|
|
1283
|
+
`Preserving excludeFiles: ${JSON.stringify(
|
|
1284
|
+
existingConfig.excludeFiles || []
|
|
1285
|
+
)}`
|
|
1286
|
+
)
|
|
1287
|
+
);
|
|
1280
1288
|
const mergedConfig = {
|
|
1281
|
-
...existingConfig, // Start with existing config
|
|
1282
|
-
// Only update specific fields that should be updated
|
|
1289
|
+
...existingConfig, // Start with existing config to preserve all existing fields
|
|
1290
|
+
// Only update specific fields that should be updated for starter kits
|
|
1283
1291
|
projectName: answer.projectName,
|
|
1284
1292
|
projectRootPath: projectPathModified,
|
|
1285
1293
|
bsTarget: bsConfig.bsTarget,
|
|
1286
1294
|
bsPathRewrite: bsConfig.bsPathRewrite,
|
|
1287
|
-
|
|
1295
|
+
version: latestVersion,
|
|
1296
|
+
// Update feature flags based on starter kit
|
|
1288
1297
|
backendOnly: answer.backendOnly,
|
|
1289
1298
|
swaggerDocs: answer.swaggerDocs,
|
|
1290
1299
|
tailwindcss: answer.tailwindcss,
|
|
@@ -1292,8 +1301,7 @@ function mergeConfigurationFiles(
|
|
|
1292
1301
|
mcp: answer.mcp,
|
|
1293
1302
|
prisma: answer.prisma,
|
|
1294
1303
|
docker: answer.docker,
|
|
1295
|
-
|
|
1296
|
-
// KEEP existing excludeFiles - this is crucial!
|
|
1304
|
+
// CRITICAL: Always preserve existing excludeFiles
|
|
1297
1305
|
excludeFiles: existingConfig.excludeFiles || [],
|
|
1298
1306
|
};
|
|
1299
1307
|
fs.writeFileSync(
|
|
@@ -1301,10 +1309,16 @@ function mergeConfigurationFiles(
|
|
|
1301
1309
|
JSON.stringify(mergedConfig, null, 2),
|
|
1302
1310
|
{ flag: "w" }
|
|
1303
1311
|
);
|
|
1312
|
+
console.log(chalk.green("✓ Configuration merged successfully!"));
|
|
1304
1313
|
console.log(
|
|
1305
|
-
chalk.green(
|
|
1314
|
+
chalk.green(
|
|
1315
|
+
`✓ Preserved ${
|
|
1316
|
+
(existingConfig.excludeFiles || []).length
|
|
1317
|
+
} excluded files`
|
|
1318
|
+
)
|
|
1306
1319
|
);
|
|
1307
1320
|
} else {
|
|
1321
|
+
console.log(chalk.blue("Creating new configuration..."));
|
|
1308
1322
|
// New project - create fresh config
|
|
1309
1323
|
const prismaPhpConfig = {
|
|
1310
1324
|
projectName: answer.projectName,
|
|
@@ -1328,6 +1342,7 @@ function mergeConfigurationFiles(
|
|
|
1328
1342
|
JSON.stringify(prismaPhpConfig, null, 2),
|
|
1329
1343
|
{ flag: "w" }
|
|
1330
1344
|
);
|
|
1345
|
+
console.log(chalk.green("✓ New configuration created"));
|
|
1331
1346
|
}
|
|
1332
1347
|
}
|
|
1333
1348
|
async function main() {
|
|
@@ -1509,6 +1524,10 @@ async function main() {
|
|
|
1509
1524
|
projectPath = path.join(currentDir, answer.projectName);
|
|
1510
1525
|
process.chdir(answer.projectName);
|
|
1511
1526
|
}
|
|
1527
|
+
// Add starter kit setup before npm/composer installation
|
|
1528
|
+
if (answer.starterKit) {
|
|
1529
|
+
await setupStarterKit(projectPath, answer);
|
|
1530
|
+
}
|
|
1512
1531
|
let npmDependencies = [
|
|
1513
1532
|
npmPkg("typescript"),
|
|
1514
1533
|
npmPkg("@types/node"),
|
|
@@ -1557,10 +1576,6 @@ async function main() {
|
|
|
1557
1576
|
if (answer.prisma) {
|
|
1558
1577
|
execSync("npm install -g prisma-client-php", { stdio: "inherit" });
|
|
1559
1578
|
}
|
|
1560
|
-
// Add starter kit setup before npm/composer installation
|
|
1561
|
-
if (answer.starterKit) {
|
|
1562
|
-
await setupStarterKit(projectPath, answer);
|
|
1563
|
-
}
|
|
1564
1579
|
await installNpmDependencies(projectPath, npmDependencies, true);
|
|
1565
1580
|
await installComposerDependencies(projectPath, composerDependencies);
|
|
1566
1581
|
if (!projectName) {
|
|
@@ -1797,14 +1812,24 @@ async function main() {
|
|
|
1797
1812
|
// Check if there's an existing config to merge with
|
|
1798
1813
|
let existingConfig = null;
|
|
1799
1814
|
const configPath = path.join(projectPath, "prisma-php.json");
|
|
1800
|
-
if
|
|
1815
|
+
// Always check if config exists - don't depend on updateAnswer
|
|
1816
|
+
if (fs.existsSync(configPath)) {
|
|
1801
1817
|
try {
|
|
1802
|
-
|
|
1818
|
+
const rawConfig = fs.readFileSync(configPath, "utf8");
|
|
1819
|
+
existingConfig = JSON.parse(rawConfig);
|
|
1803
1820
|
console.log(chalk.blue("Found existing configuration, merging..."));
|
|
1821
|
+
console.log(
|
|
1822
|
+
chalk.gray(
|
|
1823
|
+
`Existing excludeFiles: ${JSON.stringify(
|
|
1824
|
+
existingConfig.excludeFiles || []
|
|
1825
|
+
)}`
|
|
1826
|
+
)
|
|
1827
|
+
);
|
|
1804
1828
|
} catch (error) {
|
|
1805
1829
|
console.warn(
|
|
1806
1830
|
chalk.yellow("Could not read existing config, creating new one")
|
|
1807
1831
|
);
|
|
1832
|
+
existingConfig = null;
|
|
1808
1833
|
}
|
|
1809
1834
|
}
|
|
1810
1835
|
// Merge or create configuration
|