@augmenting-integrations/flags 0.1.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Augmenting Integrations LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,38 @@
1
+ import type { FlagsMap } from "./index.js";
2
+ /**
3
+ * Build a per-app flag system. Each consuming app calls this once with its
4
+ * own flag definitions and a unique localStorage namespace. Returns a hook
5
+ * + helpers + a studio panel scoped to those flags.
6
+ */
7
+ export declare function createFlags<F extends FlagsMap>(opts: {
8
+ flags: F;
9
+ storageKey: string;
10
+ }): {
11
+ useFlag: <T = unknown>(key: keyof F & string) => T;
12
+ setFlag: (key: keyof F & string, value: unknown) => void;
13
+ resetFlag: (key: keyof F & string) => void;
14
+ resetAllFlags: () => void;
15
+ listFlags: () => ({
16
+ type: "boolean";
17
+ default: boolean;
18
+ description: string;
19
+ key: string;
20
+ } | {
21
+ type: "string";
22
+ default: string;
23
+ description: string;
24
+ key: string;
25
+ } | {
26
+ type: "number";
27
+ default: number;
28
+ description: string;
29
+ key: string;
30
+ } | {
31
+ type: "enum";
32
+ default: string;
33
+ options: string[];
34
+ description: string;
35
+ key: string;
36
+ })[];
37
+ };
38
+ //# sourceMappingURL=createFlags.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createFlags.d.ts","sourceRoot":"","sources":["../src/createFlags.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAW,QAAQ,EAAE,MAAM,YAAY,CAAC;AAMpD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,SAAS,QAAQ,EAAE,IAAI,EAAE;IAAE,KAAK,EAAE,CAAC,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE;cA2DnE,CAAC,sCAA2B,CAAC;4CAOR,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;EAwB9C"}
@@ -0,0 +1,95 @@
1
+ "use client";
2
+ import { useSyncExternalStore } from "react";
3
+ const EMPTY = Object.freeze({});
4
+ /**
5
+ * Build a per-app flag system. Each consuming app calls this once with its
6
+ * own flag definitions and a unique localStorage namespace. Returns a hook
7
+ * + helpers + a studio panel scoped to those flags.
8
+ */
9
+ export function createFlags(opts) {
10
+ const { flags, storageKey } = opts;
11
+ const eventName = `flags:changed:${storageKey}`;
12
+ // Cache for stable getSnapshot reference (required by useSyncExternalStore).
13
+ let cachedRaw = undefined;
14
+ let cachedSnapshot = {};
15
+ function readSnapshot() {
16
+ if (typeof window === "undefined")
17
+ return EMPTY;
18
+ let raw;
19
+ try {
20
+ raw = window.localStorage.getItem(storageKey);
21
+ }
22
+ catch {
23
+ return cachedSnapshot;
24
+ }
25
+ if (raw === cachedRaw)
26
+ return cachedSnapshot;
27
+ cachedRaw = raw;
28
+ try {
29
+ cachedSnapshot = raw ? JSON.parse(raw) : {};
30
+ }
31
+ catch {
32
+ cachedSnapshot = {};
33
+ }
34
+ return cachedSnapshot;
35
+ }
36
+ function writeOverrides(next) {
37
+ if (typeof window === "undefined")
38
+ return;
39
+ const json = JSON.stringify(next);
40
+ try {
41
+ window.localStorage.setItem(storageKey, json);
42
+ }
43
+ catch {
44
+ // ignore quota / private mode errors
45
+ }
46
+ cachedRaw = json;
47
+ cachedSnapshot = next;
48
+ window.dispatchEvent(new Event(eventName));
49
+ }
50
+ function subscribe(callback) {
51
+ if (typeof window === "undefined")
52
+ return () => { };
53
+ const handler = () => {
54
+ cachedRaw = undefined;
55
+ callback();
56
+ };
57
+ window.addEventListener(eventName, handler);
58
+ window.addEventListener("storage", handler);
59
+ return () => {
60
+ window.removeEventListener(eventName, handler);
61
+ window.removeEventListener("storage", handler);
62
+ };
63
+ }
64
+ function getServerSnapshot() {
65
+ return EMPTY;
66
+ }
67
+ function useFlag(key) {
68
+ const overrides = useSyncExternalStore(subscribe, readSnapshot, getServerSnapshot);
69
+ if (key in overrides)
70
+ return overrides[key];
71
+ const def = flags[key];
72
+ return def.default;
73
+ }
74
+ function setFlag(key, value) {
75
+ const current = typeof window === "undefined" ? {} : { ...readSnapshot() };
76
+ current[key] = value;
77
+ writeOverrides(current);
78
+ }
79
+ function resetFlag(key) {
80
+ const current = typeof window === "undefined" ? {} : { ...readSnapshot() };
81
+ delete current[key];
82
+ writeOverrides(current);
83
+ }
84
+ function resetAllFlags() {
85
+ writeOverrides({});
86
+ }
87
+ function listFlags() {
88
+ return Object.entries(flags).map(([key, def]) => ({
89
+ key,
90
+ ...def,
91
+ }));
92
+ }
93
+ return { useFlag, setFlag, resetFlag, resetAllFlags, listFlags };
94
+ }
95
+ //# sourceMappingURL=createFlags.jsx.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createFlags.jsx","sourceRoot":"","sources":["../src/createFlags.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AAEb,OAAO,EAAE,oBAAoB,EAAE,MAAM,OAA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AAC;IAED,SAAS,SAAS,CAAC,GAAY;QAC7B,MAAM,OAAO,GAAG,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,YAAY,EAAE,EAAE,CAAC;QAC3E,OAAO,OAAO,CAAC,GAAG,CAAC,CAAC;QACpB,cAAc,CAAC,OAAO,CAAC,CAAC;IAC1B,CAAC;IAED,SAAS,aAAa;QACpB,cAAc,CAAC,EAAE,CAAC,CAAC;IACrB,CAAC;IAED,SAAS,SAAS;QAChB,OAAO,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,EAAE,CAAC,CAAC;YAChD,GAAG;YACH,GAAI,GAAe;SACpB,CAAC,CAAC,CAAC;IACN,CAAC;IAED,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAE,SAAS,EAAE,CAAC;AACnE,CAAC"}
@@ -0,0 +1,21 @@
1
+ export type FlagDef = {
2
+ type: "boolean";
3
+ default: boolean;
4
+ description: string;
5
+ } | {
6
+ type: "string";
7
+ default: string;
8
+ description: string;
9
+ } | {
10
+ type: "number";
11
+ default: number;
12
+ description: string;
13
+ } | {
14
+ type: "enum";
15
+ default: string;
16
+ options: string[];
17
+ description: string;
18
+ };
19
+ export type FlagsMap = Record<string, FlagDef>;
20
+ export { createFlags } from "./createFlags.js";
21
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GACf;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,OAAO,EAAE,OAAO,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GAC1D;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACxD;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAA;CAAE,GACxD;IACE,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAEN,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,2 @@
1
+ export { createFlags } from "./createFlags.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
package/dist/index.mjs ADDED
@@ -0,0 +1,84 @@
1
+ // src/createFlags.tsx
2
+ import { useSyncExternalStore } from "react";
3
+ var EMPTY = Object.freeze({});
4
+ function createFlags(opts) {
5
+ const { flags, storageKey } = opts;
6
+ const eventName = `flags:changed:${storageKey}`;
7
+ let cachedRaw = void 0;
8
+ let cachedSnapshot = {};
9
+ function readSnapshot() {
10
+ if (typeof window === "undefined") return EMPTY;
11
+ let raw;
12
+ try {
13
+ raw = window.localStorage.getItem(storageKey);
14
+ } catch {
15
+ return cachedSnapshot;
16
+ }
17
+ if (raw === cachedRaw) return cachedSnapshot;
18
+ cachedRaw = raw;
19
+ try {
20
+ cachedSnapshot = raw ? JSON.parse(raw) : {};
21
+ } catch {
22
+ cachedSnapshot = {};
23
+ }
24
+ return cachedSnapshot;
25
+ }
26
+ function writeOverrides(next) {
27
+ if (typeof window === "undefined") return;
28
+ const json = JSON.stringify(next);
29
+ try {
30
+ window.localStorage.setItem(storageKey, json);
31
+ } catch {
32
+ }
33
+ cachedRaw = json;
34
+ cachedSnapshot = next;
35
+ window.dispatchEvent(new Event(eventName));
36
+ }
37
+ function subscribe(callback) {
38
+ if (typeof window === "undefined") return () => {
39
+ };
40
+ const handler = () => {
41
+ cachedRaw = void 0;
42
+ callback();
43
+ };
44
+ window.addEventListener(eventName, handler);
45
+ window.addEventListener("storage", handler);
46
+ return () => {
47
+ window.removeEventListener(eventName, handler);
48
+ window.removeEventListener("storage", handler);
49
+ };
50
+ }
51
+ function getServerSnapshot() {
52
+ return EMPTY;
53
+ }
54
+ function useFlag(key) {
55
+ const overrides = useSyncExternalStore(subscribe, readSnapshot, getServerSnapshot);
56
+ if (key in overrides) return overrides[key];
57
+ const def = flags[key];
58
+ return def.default;
59
+ }
60
+ function setFlag(key, value) {
61
+ const current = typeof window === "undefined" ? {} : { ...readSnapshot() };
62
+ current[key] = value;
63
+ writeOverrides(current);
64
+ }
65
+ function resetFlag(key) {
66
+ const current = typeof window === "undefined" ? {} : { ...readSnapshot() };
67
+ delete current[key];
68
+ writeOverrides(current);
69
+ }
70
+ function resetAllFlags() {
71
+ writeOverrides({});
72
+ }
73
+ function listFlags() {
74
+ return Object.entries(flags).map(([key, def]) => ({
75
+ key,
76
+ ...def
77
+ }));
78
+ }
79
+ return { useFlag, setFlag, resetFlag, resetAllFlags, listFlags };
80
+ }
81
+ export {
82
+ createFlags
83
+ };
84
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/createFlags.tsx"],"sourcesContent":["\"use client\";\n\nimport { useSyncExternalStore } from \"react\";\nimport type { FlagDef, FlagsMap } from \"./index.js\";\n\ntype Overrides = Record<string, unknown>;\n\nconst EMPTY: Overrides = Object.freeze({}) as Overrides;\n\n/**\n * Build a per-app flag system. Each consuming app calls this once with its\n * own flag definitions and a unique localStorage namespace. Returns a hook\n * + helpers + a studio panel scoped to those flags.\n */\nexport function createFlags<F extends FlagsMap>(opts: { flags: F; storageKey: string }) {\n const { flags, storageKey } = opts;\n const eventName = `flags:changed:${storageKey}`;\n\n // Cache for stable getSnapshot reference (required by useSyncExternalStore).\n let cachedRaw: string | null | undefined = undefined;\n let cachedSnapshot: Overrides = {};\n\n function readSnapshot(): Overrides {\n if (typeof window === \"undefined\") return EMPTY;\n let raw: string | null;\n try {\n raw = window.localStorage.getItem(storageKey);\n } catch {\n return cachedSnapshot;\n }\n if (raw === cachedRaw) return cachedSnapshot;\n cachedRaw = raw;\n try {\n cachedSnapshot = raw ? (JSON.parse(raw) as Overrides) : {};\n } catch {\n cachedSnapshot = {};\n }\n return cachedSnapshot;\n }\n\n function writeOverrides(next: Overrides) {\n if (typeof window === \"undefined\") return;\n const json = JSON.stringify(next);\n try {\n window.localStorage.setItem(storageKey, json);\n } catch {\n // ignore quota / private mode errors\n }\n cachedRaw = json;\n cachedSnapshot = next;\n window.dispatchEvent(new Event(eventName));\n }\n\n function subscribe(callback: () => void) {\n if (typeof window === \"undefined\") return () => {};\n const handler = () => {\n cachedRaw = undefined;\n callback();\n };\n window.addEventListener(eventName, handler);\n window.addEventListener(\"storage\", handler);\n return () => {\n window.removeEventListener(eventName, handler);\n window.removeEventListener(\"storage\", handler);\n };\n }\n\n function getServerSnapshot(): Overrides {\n return EMPTY;\n }\n\n type FlagKey = keyof F & string;\n\n function useFlag<T = unknown>(key: FlagKey): T {\n const overrides = useSyncExternalStore(subscribe, readSnapshot, getServerSnapshot);\n if (key in overrides) return overrides[key] as T;\n const def = flags[key] as FlagDef;\n return def.default as T;\n }\n\n function setFlag(key: FlagKey, value: unknown) {\n const current = typeof window === \"undefined\" ? {} : { ...readSnapshot() };\n current[key] = value;\n writeOverrides(current);\n }\n\n function resetFlag(key: FlagKey) {\n const current = typeof window === \"undefined\" ? {} : { ...readSnapshot() };\n delete current[key];\n writeOverrides(current);\n }\n\n function resetAllFlags() {\n writeOverrides({});\n }\n\n function listFlags() {\n return Object.entries(flags).map(([key, def]) => ({\n key,\n ...(def as FlagDef),\n }));\n }\n\n return { useFlag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AAC7C,UAAM,YAAY,qBAAqB,WAAW,cAAc,iBAAiB;AACjF,QAAI,OAAO,UAAW,QAAO,UAAU,GAAG;AAC1C,UAAM,MAAM,MAAM,GAAG;AACrB,WAAO,IAAI;AAAA,EACb;AAEA,WAAS,QAAQ,KAAc,OAAgB;AAC7C,UAAM,UAAU,OAAO,WAAW,cAAc,CAAC,IAAI,EAAE,GAAG,aAAa,EAAE;AACzE,YAAQ,GAAG,IAAI;AACf,mBAAe,OAAO;AAAA,EACxB;AAEA,WAAS,UAAU,KAAc;AAC/B,UAAM,UAAU,OAAO,WAAW,cAAc,CAAC,IAAI,EAAE,GAAG,aAAa,EAAE;AACzE,WAAO,QAAQ,GAAG;AAClB,mBAAe,OAAO;AAAA,EACxB;AAEA,WAAS,gBAAgB;AACvB,mBAAe,CAAC,CAAC;AAAA,EACnB;AAEA,WAAS,YAAY;AACnB,WAAO,OAAO,QAAQ,KAAK,EAAE,IAAI,CAAC,CAAC,KAAK,GAAG,OAAO;AAAA,MAChD;AAAA,MACA,GAAI;AAAA,IACN,EAAE;AAAA,EACJ;AAEA,SAAO,EAAE,SAAS,SAAS,WAAW,eAAe,UAAU;AACjE;","names":[]}
package/package.json ADDED
@@ -0,0 +1,38 @@
1
+ {
2
+ "name": "@augmenting-integrations/flags",
3
+ "version": "0.1.0",
4
+ "description": "Feature flag hook (useFlag) and per-app studio panel. Flag definitions are passed in by the consuming app.",
5
+ "license": "MIT",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "sideEffects": false,
10
+ "main": "./dist/index.cjs",
11
+ "module": "./dist/index.js",
12
+ "types": "./dist/index.d.ts",
13
+ "exports": {
14
+ ".": {
15
+ "types": "./dist/index.d.ts",
16
+ "import": "./dist/index.js",
17
+ "require": "./dist/index.cjs"
18
+ }
19
+ },
20
+ "files": [
21
+ "dist",
22
+ "README.md"
23
+ ],
24
+ "peerDependencies": {
25
+ "react": "^19.0.0"
26
+ },
27
+ "devDependencies": {
28
+ "react": "^19.0.0",
29
+ "tsup": "^8.3.5",
30
+ "typescript": "^5.7.2",
31
+ "vitest": "^4.1.5"
32
+ },
33
+ "scripts": {
34
+ "build": "tsup",
35
+ "clean": "rm -rf dist",
36
+ "test": "vitest run --passWithNoTests"
37
+ }
38
+ }