@open-assets/open-assets 0.6.3 → 0.6.5

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/lib/renderer.mjs CHANGED
@@ -1,6 +1,7 @@
1
1
  import { launch } from "puppeteer";
2
2
  import { resolve } from "path";
3
- import { writeFileSync, mkdirSync, readdirSync, unlinkSync } from "fs";
3
+ import { writeFileSync, mkdirSync, readdirSync, unlinkSync, existsSync, readFileSync } from "fs";
4
+ import { samePngPixels } from "./png.mjs";
4
5
 
5
6
  // Browsers are launched once per process and shared. Storing the launch
6
7
  // promise (not the instance) makes concurrent callers await the same launch
@@ -397,7 +398,10 @@ export async function runXcodeOutput(projectDir, collection, outputConfig) {
397
398
  }
398
399
 
399
400
  const buffer = await renderScreenshot(projectDir, template.src, sw, sh, sw, sh);
400
- writeFileSync(outputPath, buffer);
401
+ // Same rule as other outputs: identical pixels keep the existing file.
402
+ if (!existsSync(outputPath) || !samePngPixels(readFileSync(outputPath), buffer)) {
403
+ writeFileSync(outputPath, buffer);
404
+ }
401
405
 
402
406
  const contentsJson = {
403
407
  images: [
@@ -416,6 +420,7 @@ export async function runXcodeOutput(projectDir, collection, outputConfig) {
416
420
  const contentsPath = resolve(outputDir, "Contents.json");
417
421
  writeFileSync(contentsPath, JSON.stringify(contentsJson, null, 2) + "\n");
418
422
 
419
- console.log(`Updated: ${outputPath}`);
423
+ // stderr: `render --json` owns stdout.
424
+ console.error(`Updated: ${outputPath}`);
420
425
  return outputPath;
421
426
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-assets/open-assets",
3
- "version": "0.6.3",
3
+ "version": "0.6.5",
4
4
  "description": "Screenshots, icons, and marketing assets, made a breeze in your git repo. Design in HTML/CSS/SVG, render at every size, export anywhere. Like Storybook for marketing assets.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -9,7 +9,8 @@
9
9
  "files": [
10
10
  "bin/",
11
11
  "lib/",
12
- "public/",
12
+ "public/viewer.html",
13
+ "public/img/icon/",
13
14
  "skills/",
14
15
  "README.md",
15
16
  "LICENSE"
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file