Skip to content

Commit

Permalink
fix: Make flatpack-json diff friendly. (#6243)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason3S committed Sep 16, 2024
1 parent dcabb73 commit 319f09e
Show file tree
Hide file tree
Showing 38 changed files with 15,159 additions and 21,512 deletions.
2 changes: 2 additions & 0 deletions cspell-dict.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ elisp
estree
exonum
flatpack
Flatpacked
gimu
globby
globstar
Expand All @@ -28,6 +29,7 @@ iife
jamstack
lcov
licia
linkcode
liriliri
megistos
mkdir
Expand Down
3 changes: 2 additions & 1 deletion packages/flatpack-json/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"node": ">=18"
},
"devDependencies": {
"@cspell/filetypes": "workspace:*"
"@cspell/filetypes": "workspace:*",
"diff": "^7.0.0"
}
}
22 changes: 22 additions & 0 deletions packages/flatpack-json/scripts/flatten.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import { FlatpackStore } from '../dist/index.js';

function readStdin() {
return new Promise((resolve, reject) => {
let data = '';
process.stdin.on('data', (chunk) => {
data += chunk;
});
process.stdin.on('end', () => {
resolve(data);
});
process.stdin.on('error', reject);
});
}

async function main() {
const content = await readStdin();
const store = new FlatpackStore(JSON.parse(content));
process.stdout.write(store.stringify());
}

main();
Loading

0 comments on commit 319f09e

Please sign in to comment.