IF Commons GitHub

pack-metapackage

The generator and the packer of the metapackages (commons 0036-distribution FR-007, FR-008): the file of each set that records its exact dependencies, and the tarball of its package.

bun commons/libraries/src/pack-metapackage.ts write the file dependencies.auto.json of every metapackage again from the manifests bun commons/libraries/src/pack-metapackage.ts --check write nothing and exit 1 where a file is not what the manifests make bun tools/pack.ts [--check] (in the folder of a metapackage) stage, inspect and pack its package other flags: --repo DIR (the repository, the working folder by default)

A metapackage is a folder commons/<set>/ whose manifest names bundle; the folder holds the manifest, a private package.json, the LICENSE and tools/pack.ts, and nothing that is code. Its members come from the manifests (membersOf) and are written to dependencies.auto.json in its folder, so that a change of the set is a change of the folder, which the release sees. The packer writes the staged package (package.json with the exact dependencies, an empty index.js and its declaration, the README, the LICENSE), inspects it with the same inspection as every library's and packs it with bun pm pack.

import { synchronize } from "./pack-metapackage.ts";
synchronize(".", false).problems; // []

Spec: 0001-libraries FR-023

Source: commons/libraries/src/pack-metapackage.ts

2 of 4 exports are imported by a test of the run. A test that imports an export may not call it or check what it returns.

metapackagesOffunction
function metapackagesOf(repo: string): readonly (Library & { readonly bundle: NonNullable<"commons" | "foundation" | "patterns" | "programs" | "standards" | undefined>; })[]

The metapackages of a repository: the libraries whose manifest names a set.

Imported by 9 tests of the run (9 passed, 0 failed): the library's results

PackedSettypeno test imports it
type PackedSet = { readonly stage: string; readonly tarball: string | undefined; readonly findings: readonly string[] };

What packing a metapackage gave: the staged folder, the tarball where nothing was wrong, and what was wrong.

packMetapackagefunction
function packMetapackage(root: string): Promise<PackedSet>

Stages, inspects and packs the metapackage in the folder root (commons/<set>/).

Imported by 9 tests of the run (9 passed, 0 failed): the library's results

generatefunctionno test imports it
function generate(argv: readonly string[]): number

The command line of the generator: 0, or 1 where a file is not what the manifests make (with --check) or a manifest is wrong.

Titles, headings, exports, tables, columns and requirements. Esc closes.