create-bw-app 0.24.1 → 0.24.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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/upgrade.mjs +8 -5
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "create-bw-app",
3
3
  "private": false,
4
- "version": "0.24.1",
4
+ "version": "0.24.2",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "create-bw-app": "bin/create-bw-app.mjs",
package/src/upgrade.mjs CHANGED
@@ -62,14 +62,17 @@ export async function upgradeBrightwebApp(moduleKey, argvOptions = {}, runtimeOp
62
62
  for (const [key, entry] of Object.entries(appManifest.modules)) {
63
63
  if (catalog[key]?.packageRoot) entry.version = catalog[key].version;
64
64
  }
65
- for (const write of plan.fileWrites.filter((entry) => entry.type === "starter")) {
65
+ for (const write of plan.fileWrites) {
66
66
  const relativePath = write.relativePath;
67
+ const existingRecord = appManifest.scaffoldFiles[relativePath];
68
+ if (!existingRecord && write.type !== "starter") continue;
67
69
  const targetPath = resolveSafeRelativePath(targetDir, relativePath, "Manifest scaffold file path");
68
- if (protectedPaths.has(relativePath) || !(await pathExists(targetPath))) continue;
70
+ if (write.type === "starter" && protectedPaths.has(relativePath)) continue;
71
+ if (!(await pathExists(targetPath))) continue;
69
72
  const hash = await hashFile(targetPath);
70
- if (appManifest.scaffoldFiles[relativePath]) {
71
- appManifest.scaffoldFiles[relativePath].hash = hash;
72
- appManifest.scaffoldFiles[relativePath].status = "current";
73
+ if (existingRecord) {
74
+ existingRecord.hash = hash;
75
+ existingRecord.status = "current";
73
76
  } else {
74
77
  appManifest.scaffoldFiles[relativePath] = {
75
78
  module: write.moduleKey || "platform-base",