depcurfew 1.5.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -91,9 +91,9 @@ node dist/cli.js doctor /path/to/your/repository
91
91
 
92
92
  ### Verifying a release
93
93
 
94
- Every release is built and published from its git tag by the [Release workflow](https://github.com/DevXord/depcurfew/blob/main/.github/workflows/release.yml) with npm trusted publishing, so the npm page of each version shows its provenance: the repository, the workflow and the commit it was built from. After installing, `npm audit signatures` checks the registry signature and the provenance attestation of every installed package, depcurfew included.
94
+ Every release is built and published from its git tag by the [Release workflow](https://github.com/DevXord/depcurfew/blob/main/.github/workflows/release.yml) with npm trusted publishing, so the npm page of each version shows its provenance: the repository, the workflow and the commit it was built from. One job of the workflow installs, tests and packs the package without the right to publish it; a second job, which runs no code of the repository or of its dependencies, stages exactly the file the first one packed, after comparing its SHA-512 checksum. After installing, `npm audit signatures` checks the registry signature and the provenance attestation of every installed package, depcurfew included.
95
95
 
96
- The package contains nothing but the build of that commit, and anyone can check it: check out the tag, build it and compare the checksum with the one the registry serves, here for the release the [GitHub Action](#github-action) example uses:
96
+ The package contains nothing but the build of that commit, and anyone can check it: check out the tag, build it and compare the checksum with the one the registry serves, here for 1.4.1:
97
97
 
98
98
  <!-- BEGIN GENERATED: verify-release -->
99
99
  ```bash
@@ -106,7 +106,7 @@ npm view depcurfew@1.4.1 dist.shasum
106
106
  ```
107
107
  <!-- END GENERATED: verify-release -->
108
108
 
109
- The two checksums are the same. The [Verify release workflow](https://github.com/DevXord/depcurfew/blob/main/.github/workflows/verify-release.yml) does this for the newest version on npm every day and on demand, and its runs are public in the Actions tab of the repository.
109
+ The two checksums are the same. For 1.5.0 they differ: its JavaScript files are the build of the tag byte for byte, but its declaration file `dist/index.d.ts` lists the properties of the policy types in another order, which a build that ran right after the tests produced; later releases write those types out, so every build gives the same file. The [Verify release workflow](https://github.com/DevXord/depcurfew/blob/main/.github/workflows/verify-release.yml) does this for the newest version on npm every day and on demand, and its runs are public in the Actions tab of the repository.
110
110
 
111
111
  ## Step-by-step guide
112
112
 
@@ -734,7 +734,7 @@ jobs:
734
734
  - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
735
735
  with:
736
736
  persist-credentials: false
737
- - uses: DevXord/depcurfew@7ad4fa864789f5f266cc99cf2d58538597b8238e # v1.4.1
737
+ - uses: DevXord/depcurfew@2c45b13c38b5fbae4b3b7ce71d57e7cee084610e # v1.5.0
738
738
  ```
739
739
  <!-- END GENERATED: action-workflow -->
740
740
 
package/dist/index.d.ts CHANGED
@@ -1551,6 +1551,11 @@ type FetchLike = (url: string, init: {
1551
1551
  * fetches and reads each document once (decision D-113).
1552
1552
  */
1553
1553
  type LookupCache = Map<string, Promise<unknown>>;
1554
+ interface Issue {
1555
+ /** Path to the field, e.g. `cooldown.exclude[2]`; `(root)` for the document itself. */
1556
+ path: string;
1557
+ message: string;
1558
+ }
1554
1559
  interface Duration {
1555
1560
  /** The duration as written in the policy. */
1556
1561
  text: string;
@@ -1566,105 +1571,65 @@ type DurationResult = {
1566
1571
  /** Writes minutes with the largest unit that represents them exactly, e.g. 2160 → "36h". */
1567
1572
  export declare function formatDuration(minutes: number): string;
1568
1573
  export declare function parseDuration(input: string): DurationResult;
1569
- interface Issue {
1570
- /** Path to the field, e.g. `cooldown.exclude[2]`; `(root)` for the document itself. */
1571
- path: string;
1572
- message: string;
1573
- }
1574
- type Path = readonly (string | number)[];
1575
- type JsonType = 'object' | 'array' | 'string' | 'number' | 'boolean' | 'null';
1576
- /** The JSON Schema keywords this module emits. */
1577
- interface JsonSchema {
1578
- type?: 'object' | 'array' | 'string' | 'integer' | 'number';
1579
- description?: string;
1580
- const?: string | number;
1581
- enum?: readonly string[];
1582
- pattern?: string;
1583
- examples?: readonly unknown[];
1584
- default?: unknown;
1585
- properties?: Record<string, JsonSchema>;
1586
- required?: string[];
1587
- additionalProperties?: false;
1588
- items?: JsonSchema;
1589
- uniqueItems?: true;
1590
- minItems?: number;
1591
- anyOf?: JsonSchema[];
1592
- }
1593
- type ParseResult<T> = {
1594
- ok: true;
1595
- value: T;
1596
- } | {
1597
- ok: false;
1598
- };
1599
- interface Shape<In, Out = In> {
1600
- /** How the shape is named in messages: `must be ${label}`. */
1601
- readonly label: string;
1602
- /** JSON types this shape can accept; a union picks its branch by the type of the value. */
1603
- readonly jsonTypes: readonly JsonType[];
1604
- /** Candidate values for "did you mean" suggestions. */
1605
- readonly suggestions?: readonly string[];
1606
- parse(value: unknown, path: Path, issues: Issue[]): ParseResult<Out>;
1607
- toJsonSchema(): JsonSchema;
1608
- /** Type-level only: the input type. */
1609
- readonly __input?: In;
1610
- }
1611
- type Input<S> = S extends Shape<infer In, unknown> ? In : never;
1612
- type Output<S> = S extends Shape<unknown, infer Out> ? Out : never;
1613
1574
  /** Which findings make depcurfew doctor exit with 1 (decision D-112). */
1614
1575
  declare const FAIL_ON_LEVELS: readonly ["error", "warning"];
1615
- declare const policyShape: Shape<{
1616
- version: 1;
1576
+ type Access = 'allow' | 'deny';
1577
+ /**
1578
+ * The policy as written in depcurfew.json. Written out instead of inferred from policyShape: the declaration file would
1579
+ * otherwise list the inferred properties in an order that depends on the order TypeScript happens to check the files
1580
+ * in, so two builds of the same commit could differ (decision D-174). The annotation of policyShape keeps it in step.
1581
+ */
1582
+ interface Policy {
1617
1583
  $schema?: string;
1584
+ version: 1;
1618
1585
  cooldown?: {
1619
1586
  minimum: string;
1620
1587
  exclude?: readonly string[];
1621
- securityUpdates?: "bypass" | "delay";
1588
+ securityUpdates?: 'bypass' | 'delay';
1622
1589
  };
1623
1590
  installScripts?: {
1624
- default: "allow" | "deny";
1591
+ default: Access;
1625
1592
  allow?: readonly string[];
1626
1593
  deny?: readonly string[];
1627
1594
  };
1628
1595
  sources?: {
1629
- git?: "allow" | "deny";
1630
- remoteTarball?: "allow" | "deny";
1631
- file?: "allow" | "deny";
1632
- directory?: "allow" | "deny";
1596
+ git?: Access;
1597
+ remoteTarball?: Access;
1598
+ file?: Access;
1599
+ directory?: Access;
1633
1600
  };
1634
- targets?: "auto" | readonly ToolId[];
1601
+ targets?: 'auto' | readonly ToolId[];
1635
1602
  projects?: readonly string[];
1636
1603
  doctor?: {
1637
- failOn?: "error" | "warning";
1604
+ failOn?: (typeof FAIL_ON_LEVELS)[number];
1638
1605
  };
1639
- }, {
1640
- version: 1;
1641
- targets: "auto" | readonly ToolId[];
1642
- projects: readonly string[];
1606
+ }
1607
+ /** The policy after validation: defaults filled in, durations parsed. */
1608
+ interface ResolvedPolicy {
1643
1609
  $schema?: string;
1610
+ version: 1;
1644
1611
  cooldown?: {
1645
1612
  minimum: Duration;
1646
1613
  exclude: readonly string[];
1647
- securityUpdates: "bypass" | "delay";
1614
+ securityUpdates: 'bypass' | 'delay';
1648
1615
  };
1649
1616
  installScripts?: {
1650
- default: "allow" | "deny";
1617
+ default: Access;
1651
1618
  allow: readonly string[];
1652
1619
  deny: readonly string[];
1653
1620
  };
1654
1621
  sources?: {
1655
- git?: "allow" | "deny";
1656
- remoteTarball?: "allow" | "deny";
1657
- file?: "allow" | "deny";
1658
- directory?: "allow" | "deny";
1622
+ git?: Access;
1623
+ remoteTarball?: Access;
1624
+ file?: Access;
1625
+ directory?: Access;
1659
1626
  };
1627
+ targets: 'auto' | readonly ToolId[];
1628
+ projects: readonly string[];
1660
1629
  doctor?: {
1661
- failOn?: "error" | "warning";
1630
+ failOn?: (typeof FAIL_ON_LEVELS)[number];
1662
1631
  };
1663
- }>;
1664
- /** The policy as written in depcurfew.json. */
1665
- type Policy = Input<typeof policyShape>;
1666
- /** The policy after validation: defaults filled in, durations parsed. */
1667
- type ResolvedPolicy = Output<typeof policyShape>;
1632
+ }
1668
1633
  interface SimilarName {
1669
1634
  /** The popular package the name resembles. */
1670
1635
  match: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "depcurfew",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
4
4
  "description": "One supply-chain security policy for npm, pnpm, Yarn, Bun, Deno, uv, pip, Poetry, PDM, Pipenv, Composer, Bundler, Renovate and Dependabot, plus a doctor that finds config that silently does nothing.",
5
5
  "license": "MIT",
6
6
  "author": "depcurfew",