@commonpub/layer 0.15.0 → 0.15.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.
@@ -20,12 +20,18 @@ export interface FeatureFlags {
20
20
 
21
21
  let hydrated = false;
22
22
 
23
+ const DEFAULT_FLAGS: FeatureFlags = {
24
+ content: true, social: true, hubs: true, docs: true, video: true,
25
+ contests: false, events: false, learning: true, explainers: true,
26
+ editorial: true, federation: false, admin: false, emailNotifications: false,
27
+ };
28
+
23
29
  export function useFeatures() {
24
30
  const config = useRuntimeConfig();
25
- const buildFlags = config.public.features as unknown as FeatureFlags;
31
+ const buildFlags = (config.public.features as unknown as FeatureFlags) ?? DEFAULT_FLAGS;
26
32
 
27
33
  // Shared reactive state — initialized from build-time config
28
- const flags = useState<FeatureFlags>('feature-flags', () => ({ ...buildFlags }));
34
+ const flags = useState<FeatureFlags>('feature-flags', () => ({ ...DEFAULT_FLAGS, ...buildFlags }));
29
35
 
30
36
  // On client, fetch dynamic features once to pick up DB overrides
31
37
  if (import.meta.client && !hydrated) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@commonpub/layer",
3
- "version": "0.15.0",
3
+ "version": "0.15.1",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "files": [
@@ -30,7 +30,7 @@
30
30
  "@aws-sdk/client-s3": "^3.1010.0",
31
31
  "@commonpub/explainer": "^0.7.11",
32
32
  "@commonpub/schema": "^0.13.0",
33
- "@commonpub/server": "^2.41.0",
33
+ "@commonpub/server": "^2.42.0",
34
34
  "@tiptap/core": "^2.11.0",
35
35
  "@tiptap/extension-bold": "^2.11.0",
36
36
  "@tiptap/extension-bullet-list": "^2.11.0",
@@ -55,10 +55,10 @@
55
55
  "zod": "^4.3.6",
56
56
  "@commonpub/auth": "0.5.1",
57
57
  "@commonpub/docs": "0.6.2",
58
+ "@commonpub/config": "0.10.0",
58
59
  "@commonpub/editor": "0.7.9",
59
- "@commonpub/protocol": "0.9.9",
60
60
  "@commonpub/learning": "0.5.0",
61
- "@commonpub/config": "0.10.0",
61
+ "@commonpub/protocol": "0.9.9",
62
62
  "@commonpub/ui": "0.8.5"
63
63
  },
64
64
  "devDependencies": {