# `javascript_package_build`

Materialize an approved dependency build in a private context after its selected
dependency builds finish. `javascript_dependencies` generates these targets;
consumers normally depend on a generated member layout instead.

The target runs approved `preinstall`, `install` and `postinstall` hooks while
keeping acquired package trees immutable. Cyclic dependencies share one
component, execute hooks in stable package-key order and export only after all
component hooks finish. Independent components do not wait for unrelated
package acquisition. Selected linked workspace sources are declared inputs.

The `javascript_built_packages` provider maps package-context keys to completed
package roots. Member layouts consume those outputs through their `builds`
dependency role and include generated files in their content-keyed assembly.

Packages without approved hooks reuse content-keyed materialization results,
including restoration after generated outputs are removed. Package contents,
dependency outputs, materialization scripts, authorization, declared environment
and toolchain identity participate in that key.

Actual lifecycle execution remains uncached because arbitrary scripts can invoke host tools
outside the declared Node and shell identities. A cached layout cannot skip a
required lifecycle execution. Root/workspace hooks, implicit node-gyp builds
and unmodeled native trust policies remain unsupported. Exported links must
stay inside their original package under both lexical and effective resolution.

All own packages are checked for unsupported automatic native builds before
the component runs its first hook. A failure includes a structured
`javascript.implicit_node_gyp` payload identifying the component target,
`deps` attribute and repair. npm's `gypfile: false` disables its automatic
detection; this flag is not treated as a portable approval policy.

See [dependency lifecycle builds](/reference/prelude/javascript_dependencies/#dependency-lifecycle-builds)
for native authorization policies, suppression settings and context limits.
