Skip to content

Commit

Permalink
stage throws if invalid main or entrypoint (#443)
Browse files Browse the repository at this point in the history
  • Loading branch information
rafapaezbas authored Nov 18, 2024
1 parent 1040c19 commit 021b89d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions subsystems/sidecar/ops/stage.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ module.exports = class Stage extends Opstream {
const builtins = terminalBare ? sidecar.gunk.bareBuiltins : sidecar.gunk.builtins
const linker = new ScriptLinker(src, { builtins })
const entrypoints = [...(state.manifest.main ? [state.main] : []), ...(state.manifest.pear?.stage?.entrypoints || [])].map((entry) => unixPathResolve('/', entry))

for (const entrypoint of entrypoints) {
const entry = await src.entry(entrypoint)
if (!entry) throw ERR_INVALID_CONFIG('Invalid main or stage entrypoint in package.json')
}

const mods = await linker.warmup(entrypoints)
for await (const [filename, mod] of mods) src.metadata.put(filename, mod.cache())
const mirror = new Mirror(src, dst, opts)
Expand Down

0 comments on commit 021b89d

Please sign in to comment.