mirror of
https://github.com/DayuanJiang/next-ai-draw-io.git
synced 2026-10-10 03:29:50 +08:00
Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab33dae69d |
@@ -11,9 +11,11 @@ const REQUIRED = [
|
|||||||
"dist/preview/preview.js",
|
"dist/preview/preview.js",
|
||||||
]
|
]
|
||||||
|
|
||||||
const [pack] = JSON.parse(
|
const output = JSON.parse(
|
||||||
execSync("npm pack --dry-run --json", { encoding: "utf8" }),
|
execSync("npm pack --dry-run --json", { encoding: "utf8" }),
|
||||||
)
|
)
|
||||||
|
// npm 11 prints a list, npm 12 an object keyed by package name
|
||||||
|
const pack = Array.isArray(output) ? output[0] : Object.values(output)[0]
|
||||||
const files = new Set(pack.files.map((f) => f.path))
|
const files = new Set(pack.files.map((f) => f.path))
|
||||||
const missing = REQUIRED.filter((f) => !files.has(f))
|
const missing = REQUIRED.filter((f) => !files.has(f))
|
||||||
if (missing.length > 0) {
|
if (missing.length > 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user