@jskit-ai/jskit-cli 0.2.65 → 0.2.66

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jskit-ai/jskit-cli",
3
- "version": "0.2.65",
3
+ "version": "0.2.66",
4
4
  "description": "Bundle and package orchestration CLI for JSKIT apps.",
5
5
  "type": "module",
6
6
  "files": [
@@ -20,9 +20,9 @@
20
20
  "test": "node --test"
21
21
  },
22
22
  "dependencies": {
23
- "@jskit-ai/jskit-catalog": "0.1.64",
24
- "@jskit-ai/kernel": "0.1.56",
25
- "@jskit-ai/shell-web": "0.1.55"
23
+ "@jskit-ai/jskit-catalog": "0.1.65",
24
+ "@jskit-ai/kernel": "0.1.57",
25
+ "@jskit-ai/shell-web": "0.1.56"
26
26
  },
27
27
  "engines": {
28
28
  "node": "20.x"
@@ -196,7 +196,10 @@ async function applyFileMutations(
196
196
  managedMigrations,
197
197
  touchedFiles,
198
198
  warnings = [],
199
- existingManagedFiles = []
199
+ existingManagedFiles = [],
200
+ {
201
+ reapplyManagedAppFiles = false
202
+ } = {}
200
203
  ) {
201
204
  const existingManagedFilesByPath = new Map();
202
205
  for (const managedFileValue of ensureArray(existingManagedFiles)) {
@@ -242,8 +245,16 @@ async function applyFileMutations(
242
245
  const relativeTargetPath = normalizeRelativePath(appRoot, targetPath);
243
246
  const previous = await readFileBufferIfExists(targetPath);
244
247
  const existingManaged = existingManagedFilesByPath.get(relativeTargetPath);
248
+ const existingManagedHash = String(existingManaged?.hash || "").trim();
249
+ const currentContentMatchesManagedVersion =
250
+ previous.exists &&
251
+ existingManagedHash &&
252
+ hashBuffer(previous.buffer) === existingManagedHash;
253
+ const canSafelyReapplyManagedAppFile =
254
+ reapplyManagedAppFiles === true &&
255
+ (!previous.exists || currentContentMatchesManagedVersion);
245
256
 
246
- if (mutation.ownership === "app" && existingManaged) {
257
+ if (mutation.ownership === "app" && existingManaged && !canSafelyReapplyManagedAppFile) {
247
258
  managedFiles.push({
248
259
  ...existingManaged,
249
260
  path: relativeTargetPath,
@@ -503,7 +503,10 @@ async function applyPackageInstall({
503
503
  managedRecord.managed.migrations,
504
504
  touchedFiles,
505
505
  mutationWarnings,
506
- ensureArray(existingManaged.files)
506
+ ensureArray(existingManaged.files),
507
+ {
508
+ reapplyManagedAppFiles: Object.keys(existingInstall).length > 0
509
+ }
507
510
  );
508
511
 
509
512
  await applyTextMutations(