Skip to content

feat(mama): add LocatedManifestManager type and isLocated() type guard#420

Closed
intincrab wants to merge 2 commits into
NodeSecure:masterfrom
intincrab:located-manifest
Closed

feat(mama): add LocatedManifestManager type and isLocated() type guard#420
intincrab wants to merge 2 commits into
NodeSecure:masterfrom
intincrab:located-manifest

Conversation

@intincrab
Copy link
Copy Markdown
Contributor

@intincrab intincrab commented Jun 7, 2025

closes #418

Changes:

  • Added LocatedManifestManager type and isLocated static method.
  • Added tests to verify type guard functionality.

Comment thread workspaces/mama/test/ManifestManager.spec.ts Outdated
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Jun 8, 2025

⚠️ No Changeset found

Latest commit: 904e668

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@fraxken
Copy link
Copy Markdown
Member

fraxken commented Jun 8, 2025

Ideally we should use tsd to properly assert types, this can be another later contribution/PR.

We have examples in the RC workspace:

import type { Result } from "@openally/result";
import { expectAssignable } from "tsd";
// Import Internal Dependencies
import { read, write, type RC } from "../../dist/index.js";
expectAssignable<Promise<Result<RC, NodeJS.ErrnoException>>>(read());
expectAssignable<Promise<Result<void, NodeJS.ErrnoException>>>(write("test", {
payload: {},
partialUpdate: true
}));

"test:tsd": "npm run build && tsd",

@fraxken
Copy link
Copy Markdown
Member

fraxken commented Jun 8, 2025

And if you can push the changeset, thanks :)

@intincrab
Copy link
Copy Markdown
Contributor Author

@fraxken based on the RC workspace example, I'm planning to create a type test file that would:

  1. Import expectType from TSD
  2. Create test instances of ManifestManager with location
  3. Use expectType to verify type narrowing works correctly and test with custom metadata also

Is this the approach you had in mind for the type tests?

@fraxken
Copy link
Copy Markdown
Member

fraxken commented Jun 9, 2025

@fraxken based on the RC workspace example, I'm planning to create a type test file that would:

  1. Import expectType from TSD
  2. Create test instances of ManifestManager with location
  3. Use expectType to verify type narrowing works correctly and test with custom metadata also

Is this the approach you had in mind for the type tests?

Yes seems good

@intincrab intincrab closed this Jun 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

(mama workspace) Implement LocatedManifestManager

3 participants