@williamthorsen/toolbelt.packaging 0.2.0 → 0.3.0
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 +14 -0
- package/README.md +7 -13
- package/dist/esm/3-candidate/index.d.ts +1 -1
- package/dist/esm/3-candidate/index.js +1 -1
- package/dist/esm/3-candidate/resolveSelfVersion.d.ts +1 -0
- package/dist/esm/3-candidate/{getSelfVersion.js → resolveSelfVersion.js} +1 -1
- package/package.json +2 -2
- package/dist/esm/3-candidate/getSelfVersion.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,20 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## 0.3.0 — 2026-08-12
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
- 🚨 **Breaking:** Rename get* functions by return kind and verb specificity (#119)
|
|
10
|
+
|
|
11
|
+
Renames thirteen functions across various packages to align with a consistent naming pattern.
|
|
12
|
+
|
|
13
|
+
### Refactoring
|
|
14
|
+
|
|
15
|
+
- Align stray modules with layout and TypeScript conventions (#118)
|
|
16
|
+
|
|
17
|
+
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.
|
|
18
|
+
|
|
5
19
|
## 0.2.0 — 2026-08-08
|
|
6
20
|
|
|
7
21
|
### Features
|
package/README.md
CHANGED
|
@@ -3,19 +3,13 @@
|
|
|
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
5
|
<!-- section:release-notes -->
|
|
6
|
-
## Release notes — v0.
|
|
6
|
+
## Release notes — v0.3.0 (2026-08-12)
|
|
7
7
|
|
|
8
8
|
### Features
|
|
9
9
|
|
|
10
|
-
-
|
|
10
|
+
- 🚨 **Breaking:** Rename get* functions by return kind and verb specificity (#119)
|
|
11
11
|
|
|
12
|
-
|
|
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.
|
|
12
|
+
Renames thirteen functions across various packages to align with a consistent naming pattern.
|
|
19
13
|
<!-- /section:release-notes -->
|
|
20
14
|
|
|
21
15
|
## Installation
|
|
@@ -103,20 +97,20 @@ A dual-format build leaves that file so the runtime parses `dist/cjs/` as Common
|
|
|
103
97
|
|
|
104
98
|
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
99
|
|
|
106
|
-
## `
|
|
100
|
+
## `resolveSelfVersion`
|
|
107
101
|
|
|
108
102
|
Candidate tier: imported from `@williamthorsen/toolbelt.packaging/candidate` rather than the package root, and subject to change.
|
|
109
103
|
|
|
110
104
|
```ts
|
|
111
|
-
|
|
105
|
+
resolveSelfVersion(fromUrl: string): string;
|
|
112
106
|
```
|
|
113
107
|
|
|
114
108
|
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
109
|
|
|
116
110
|
```ts
|
|
117
|
-
import {
|
|
111
|
+
import { resolveSelfVersion } from '@williamthorsen/toolbelt.packaging/candidate';
|
|
118
112
|
|
|
119
|
-
console.log(`my-cli ${
|
|
113
|
+
console.log(`my-cli ${resolveSelfVersion(import.meta.url)}`);
|
|
120
114
|
```
|
|
121
115
|
|
|
122
116
|
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 {
|
|
2
|
+
export { resolveSelfVersion } from './resolveSelfVersion.js';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { findPackageRoot } from "./findPackageRoot.js";
|
|
2
|
-
export {
|
|
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
|
|
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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@williamthorsen/toolbelt.packaging",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "Package and project layout utilities: where a package or project boundary begins, and what its manifest declares",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"homepage": "https://github.com/williamthorsen/toolbelt/tree/main/packages/packaging#readme",
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"CHANGELOG.md"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@williamthorsen/toolbelt.filesystem": "0.
|
|
37
|
+
"@williamthorsen/toolbelt.filesystem": "0.4.0"
|
|
38
38
|
},
|
|
39
39
|
"engines": {
|
|
40
40
|
"node": ">=24.0.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function getSelfVersion(fromUrl: string): string;
|