@homeflare/alchemy 0.58.0 → 0.59.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.
@@ -0,0 +1,20 @@
1
+ /**
2
+ * `@homeflare/alchemy/scope` — refuse a second resource claiming a logical id already taken in
3
+ * the same stack scope, instead of Alchemy's own `Resource()` silently treating it as the same
4
+ * resource re-referenced (see duplicate-id.ts for the measured incident and why the check has to
5
+ * run at registration time). Every `@homeflare/alchemy` resource export wrapped in
6
+ * `guardDuplicateIds` gets this for free; a stack's OWN custom resource types (declared directly
7
+ * with Alchemy's `Resource()`, the way homeflare-mini's `NixJobRetirement` is) get it too, by
8
+ * wrapping their export the same way:
9
+ *
10
+ * ```ts
11
+ * import { guardDuplicateIds } from '@homeflare/alchemy/scope';
12
+ *
13
+ * export const NixJobRetirement = guardDuplicateIds(Resource<NixJobRetirement>('Nix.JobRetirement'));
14
+ * ```
15
+ *
16
+ * docs/duplicate-resource-id.md has the full guide, the three test cases, and what this does and
17
+ * does not cover.
18
+ */
19
+ export { DuplicateResourceIdError, claimResourceId } from './duplicate-id.ts';
20
+ export { guardDuplicateIds } from './guard.ts';