@williamthorsen/toolbelt.packaging 0.2.0 → 0.3.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/CHANGELOG.md CHANGED
@@ -2,6 +2,29 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## 0.3.1 — 2026-08-13
6
+
7
+ ### Tooling
8
+
9
+ - Remove redundant .gitignore files
10
+ - Populate manifest metadata and adopt a pnpm catalog (#140)
11
+
12
+ Adopts a pnpm catalog to avoid specifying the version of a common dependency in multiple places. Separately, fixes violations of newly activated `package-json` lint rules. Missing values have been added to `package.json` fields across the repo, and package descriptions are improved.
13
+
14
+ ## 0.3.0 — 2026-08-12
15
+
16
+ ### Features
17
+
18
+ - 🚨 **Breaking:** Rename get* functions by return kind and verb specificity (#119)
19
+
20
+ Renames thirteen functions across various packages to align with a consistent naming pattern.
21
+
22
+ ### Refactoring
23
+
24
+ - Align stray modules with layout and TypeScript conventions (#118)
25
+
26
+ Aligns all packages with code-layout and annotation conventions, ending a handful of long-standing exceptions. Documentation has been updated to make the conventions clear.
27
+
5
28
  ## 0.2.0 — 2026-08-08
6
29
 
7
30
  ### Features
package/README.md CHANGED
@@ -2,21 +2,7 @@
2
2
 
3
3
  Package and project layout utilities for TypeScript and JavaScript: where a package or project boundary begins, and what the manifest at that boundary declares.
4
4
 
5
- <!-- section:release-notes -->
6
- ## Release notes — v0.2.0 (2026-08-08)
7
-
8
- ### Features
9
-
10
- - Scaffold toolbelt.packaging for project-layout utilities (#99)
11
-
12
- Adds `@williamthorsen/toolbelt.packaging`, a package scoped to package and project layout: where a package or project boundary begins, and what the manifest at that boundary declares. It exports nothing yet.
13
-
14
- - 🚨 **Breaking:** Add findPackageRoot, getSelfVersion, and findProjectRoot to toolbelt.packaging (#107)
15
-
16
- Adds a way for any module, whether it runs from a source tree or a compiled build, to identify the package that owns it and the version that package declares.
17
-
18
- `findProjectRoot` moves from `@williamthorsen/toolbelt.filesystem` to `@williamthorsen/toolbelt.packaging`. Callers of `loadConfigCascade` must now state where its upward search stops, rather than relying on a project root the function found for them.
19
- <!-- /section:release-notes -->
5
+ <!-- section:release-notes --><!-- /section:release-notes -->
20
6
 
21
7
  ## Installation
22
8
 
@@ -103,20 +89,20 @@ A dual-format build leaves that file so the runtime parses `dist/cjs/` as Common
103
89
 
104
90
  A module belonging to no named package throws, rather than falling back to a directory that merely looks plausible, which is why the return is a bare string with no evidence to interpret. A manifest that is unreadable as JSON, or that parses to something other than an object, throws by name rather than being skipped: corruption is a defect, not an absence.
105
91
 
106
- ## `getSelfVersion`
92
+ ## `resolveSelfVersion`
107
93
 
108
94
  Candidate tier: imported from `@williamthorsen/toolbelt.packaging/candidate` rather than the package root, and subject to change.
109
95
 
110
96
  ```ts
111
- getSelfVersion(fromUrl: string): string;
97
+ resolveSelfVersion(fromUrl: string): string;
112
98
  ```
113
99
 
114
100
  Returns the version declared by the package that owns a module: the supported way for a CLI to report its own version without hand-rolling a manifest lookup.
115
101
 
116
102
  ```ts
117
- import { getSelfVersion } from '@williamthorsen/toolbelt.packaging/candidate';
103
+ import { resolveSelfVersion } from '@williamthorsen/toolbelt.packaging/candidate';
118
104
 
119
- console.log(`my-cli ${getSelfVersion(import.meta.url)}`);
105
+ console.log(`my-cli ${resolveSelfVersion(import.meta.url)}`);
120
106
  ```
121
107
 
122
108
  Ownership is resolved exactly as [`findPackageRoot`](#findpackageroot) resolves it, so a marker manifest is passed over here too. Without that, a dual-format build would read its version as `undefined` rather than raising, since the marker manifest declares none.
@@ -1,2 +1,2 @@
1
1
  export { findPackageRoot } from './findPackageRoot.js';
2
- export { getSelfVersion } from './getSelfVersion.js';
2
+ export { resolveSelfVersion } from './resolveSelfVersion.js';
@@ -1,2 +1,2 @@
1
1
  export { findPackageRoot } from "./findPackageRoot.js";
2
- export { getSelfVersion } from "./getSelfVersion.js";
2
+ export { resolveSelfVersion } from "./resolveSelfVersion.js";
@@ -0,0 +1 @@
1
+ export declare function resolveSelfVersion(fromUrl: string): string;
@@ -1,5 +1,5 @@
1
1
  import { resolveOwningManifest } from "../internal/resolveOwningManifest.js";
2
- export function getSelfVersion(fromUrl) {
2
+ export function resolveSelfVersion(fromUrl) {
3
3
  const { manifest, manifestPath } = resolveOwningManifest(fromUrl);
4
4
  if (typeof manifest.version !== 'string') {
5
5
  throw new TypeError(`Package manifest declares no string version: ${manifestPath}`);
package/package.json CHANGED
@@ -1,8 +1,16 @@
1
1
  {
2
2
  "name": "@williamthorsen/toolbelt.packaging",
3
- "version": "0.2.0",
3
+ "version": "0.3.1",
4
4
  "description": "Package and project layout utilities: where a package or project boundary begins, and what its manifest declares",
5
- "keywords": [],
5
+ "keywords": [
6
+ "esm",
7
+ "monorepo",
8
+ "package-json",
9
+ "toolbelt",
10
+ "typescript",
11
+ "utilities",
12
+ "workspace"
13
+ ],
6
14
  "homepage": "https://github.com/williamthorsen/toolbelt/tree/main/packages/packaging#readme",
7
15
  "bugs": {
8
16
  "url": "https://github.com/williamthorsen/toolbelt/issues"
@@ -14,6 +22,7 @@
14
22
  },
15
23
  "license": "ISC",
16
24
  "author": "William Thorsen <william@thorsen.dev> (https://github.com/williamthorsen)",
25
+ "sideEffects": false,
17
26
  "type": "module",
18
27
  "exports": {
19
28
  ".": {
@@ -34,7 +43,7 @@
34
43
  "CHANGELOG.md"
35
44
  ],
36
45
  "dependencies": {
37
- "@williamthorsen/toolbelt.filesystem": "0.3.0"
46
+ "@williamthorsen/toolbelt.filesystem": "0.4.1"
38
47
  },
39
48
  "engines": {
40
49
  "node": ">=24.0.0"
@@ -1 +0,0 @@
1
- export declare function getSelfVersion(fromUrl: string): string;