pixelkiln 0.96.0 → 0.96.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/dist/cli.js CHANGED
@@ -17847,7 +17847,27 @@ function handEditMembers(loaded, spec, lock, editPath) {
17847
17847
  }
17848
17848
  return [{ role: null, path: editPath, base: bases?.[0]?.path ?? null }];
17849
17849
  }
17850
+ function refuseUneditable(spec) {
17851
+ const key2 = `${spec.styleId}/${spec.assetId}`;
17852
+ if (spec.derive) {
17853
+ const from = spec.derive.source.kind === "asset" ? spec.derive.source.assetId : spec.derive.source.file;
17854
+ throw new ManifestEditError(
17855
+ `${key2} is derived from ${from} (${spec.derive.transform}), so it has no hand edit of its own; edit its source, or change the derive transform in the manifest`
17856
+ );
17857
+ }
17858
+ if (spec.external) {
17859
+ throw new ManifestEditError(
17860
+ `${key2} is built outside pixelkiln (${spec.external.builder}); change it there, then run pixelkiln adopt --local --force to record the new file`
17861
+ );
17862
+ }
17863
+ if (spec.mirror) {
17864
+ throw new ManifestEditError(
17865
+ `${key2} is a flip of ${spec.mirror.sourceAssetId}, so it has no hand edit of its own; edit ${spec.mirror.sourceAssetId} and flip it again`
17866
+ );
17867
+ }
17868
+ }
17850
17869
  async function startHandEdit(loaded, lock, spec, opts = {}) {
17870
+ refuseUneditable(spec);
17851
17871
  const entry = lock.entries[lockKey(spec.styleId, spec.assetId)];
17852
17872
  if (entry && entry.outputs.length > 1 && !isMemberSetEntry(entry)) {
17853
17873
  throw new ManifestEditError(
@@ -17961,6 +17981,7 @@ async function readHandEditCompanion(editPath) {
17961
17981
  }
17962
17982
  var MAX_HAND_EDIT_BYTES = 16 * 1024 * 1024;
17963
17983
  async function saveHandEdit(loaded, lock, spec, input) {
17984
+ refuseUneditable(spec);
17964
17985
  const entry = lock.entries[lockKey(spec.styleId, spec.assetId)];
17965
17986
  const memberSet = entry ? isMemberSetEntry(entry) : false;
17966
17987
  const incoming = input.frames ?? (input.png ? [{ role: null, png: input.png }] : []);