mnfst 0.5.51 → 0.5.53

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/README.md CHANGED
@@ -6,7 +6,7 @@ Manifest is a frontend framework extending HTML for rapid, feature-rich website
6
6
  - A CSS library, compatible with Tailwind CSS
7
7
 
8
8
  **With Manifest:**
9
- - Skip the build steps
9
+ - Build steps optional
10
10
  - Use only what you need
11
11
  - Stack with other frameworks & libraries
12
12
 
@@ -990,9 +990,11 @@ function initializeAuthMagic() {
990
990
  'isTeamRenamable', 'hasTeamPermission', 'hasTeamPermissionSync', 'canManageRoles',
991
991
  'canInviteMembers', 'canUpdateMembers', 'canRemoveMembers', 'canRenameTeam',
992
992
  'canDeleteTeam', 'isRoleDeletable', 'isRoleBeingEdited', 'getCurrentTeamRoles',
993
- 'getUserRole', 'getUserRoles', 'getAllAvailablePermissions'
993
+ 'getUserRole', 'getUserRoles', 'getAllAvailablePermissions',
994
+ 'isActionDisabled', 'isInviteRoleSelected', 'teamCreatedAt', 'teamUpdatedAt',
995
+ 'getMemberDisplayName', 'getMemberEmail'
994
996
  ];
995
-
997
+
996
998
  if (convenienceMethodNames.includes(prop)) {
997
999
  // This should be a function but isn't - try to reinitialize synchronously
998
1000
  if (window.ManifestAppwriteAuthTeamsConvenience && window.ManifestAppwriteAuthTeamsConvenience.initialize) {
@@ -1013,6 +1015,9 @@ function initializeAuthMagic() {
1013
1015
  if (prop.startsWith('is') || prop.startsWith('can') || prop.startsWith('has')) {
1014
1016
  return () => false;
1015
1017
  }
1018
+ if (prop.startsWith('getAll')) {
1019
+ return () => Promise.resolve([]);
1020
+ }
1016
1021
  if (prop.startsWith('get')) {
1017
1022
  return () => null;
1018
1023
  }
@@ -1070,9 +1075,11 @@ function initializeAuthMagic() {
1070
1075
  'isTeamRenamable', 'hasTeamPermission', 'hasTeamPermissionSync', 'canManageRoles',
1071
1076
  'canInviteMembers', 'canUpdateMembers', 'canRemoveMembers', 'canRenameTeam',
1072
1077
  'canDeleteTeam', 'isRoleDeletable', 'isRoleBeingEdited', 'getCurrentTeamRoles',
1073
- 'getUserRole', 'getUserRoles', 'getAllAvailablePermissions'
1078
+ 'getUserRole', 'getUserRoles', 'getAllAvailablePermissions',
1079
+ 'isActionDisabled', 'isInviteRoleSelected', 'teamCreatedAt', 'teamUpdatedAt',
1080
+ 'getMemberDisplayName', 'getMemberEmail'
1074
1081
  ];
1075
-
1082
+
1076
1083
  if (typeof prop === 'string' && convenienceMethodNames.includes(prop)) {
1077
1084
  const currentStore = Alpine.store('auth');
1078
1085
  if (currentStore && (!currentStore[prop] || typeof currentStore[prop] !== 'function')) {
@@ -1094,6 +1101,17 @@ function initializeAuthMagic() {
1094
1101
  }
1095
1102
  }
1096
1103
  }
1104
+ // Safe fallback for convenience methods that failed to reinitialize
1105
+ if (prop.startsWith('is') || prop.startsWith('can') || prop.startsWith('has')) {
1106
+ return () => false;
1107
+ }
1108
+ if (prop.startsWith('getAll')) {
1109
+ return () => Promise.resolve([]);
1110
+ }
1111
+ if (prop.startsWith('get') || prop.startsWith('team')) {
1112
+ return () => null;
1113
+ }
1114
+ return () => ({ success: false, error: 'Method not initialized' });
1097
1115
  }
1098
1116
 
1099
1117
  // Special handling for computed properties
@@ -11720,6 +11720,30 @@ async function initializeDataSourcesPlugin() {
11720
11720
  filterFilesByScope // Export for use by getFilesForEntry
11721
11721
  };
11722
11722
 
11723
+ // Listen for manifest:dev-reload (fired by mnfst-run when a data file changes).
11724
+ // Re-fetches all local data sources and updates the Alpine store reactively.
11725
+ window.addEventListener('manifest:dev-reload', async () => {
11726
+ const manifest = await window.ManifestDataConfig.ensureManifest();
11727
+ if (!manifest?.data) return;
11728
+
11729
+ const locale = document.documentElement.lang ||
11730
+ (typeof Alpine !== 'undefined' && Alpine.store('locale')?.current) || 'en';
11731
+
11732
+ const { dataSourceCache, loadingPromises } = window.ManifestDataStore;
11733
+ const isAppwriteCollection = window.ManifestDataConfig.isAppwriteCollection;
11734
+
11735
+ for (const [name, source] of Object.entries(manifest.data)) {
11736
+ if (isAppwriteCollection(source)) continue;
11737
+ if (source && typeof source === 'object' && source.url) continue;
11738
+
11739
+ const cacheKey = `${name}:${locale}`;
11740
+ dataSourceCache.delete(cacheKey);
11741
+ loadingPromises.delete(cacheKey);
11742
+
11743
+ try { await loadDataSource(name, locale); } catch { /* skip failed sources */ }
11744
+ }
11745
+ });
11746
+
11723
11747
  // Initialize dataSources after magic method is registered
11724
11748
  if (window.ManifestDataStore.isInitializing || window.ManifestDataStore.initializationComplete) return;
11725
11749
  setIsInitializing(true);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mnfst",
3
- "version": "0.5.51",
3
+ "version": "0.5.53",
4
4
  "private": false,
5
5
  "workspaces": [
6
6
  "templates/starter",
@@ -17,14 +17,16 @@
17
17
  "clean": "rimraf src/scripts/manifest.js src/scripts/manifest.render.mjs src/styles/manifest.css src/styles/manifest.min.css src/styles/manifest.code.min.css lib",
18
18
  "build": "cd src && node scripts/build.mjs",
19
19
  "build:docs": "echo 'Docs is a static website - no build needed'",
20
- "start:src": "cd src && browser-sync start --config bs-config.js",
21
- "start:docs": "cd docs && browser-sync start --config bs-config.js",
22
- "start:starter": "cd templates/starter && browser-sync start --config bs-config.js --port 3001",
20
+ "start:src": "node packages/run/serve.mjs src",
21
+ "start:docs": "node packages/run/serve.mjs docs",
22
+ "start:starter": "node packages/run/serve.mjs templates/starter --port 3001",
23
+ "start:dist": "node packages/run/serve.mjs src/test-prerender --port 5003",
23
24
  "prerender": "node src/scripts/manifest.render.mjs --root src",
24
25
  "prerender:docs": "node src/scripts/manifest.render.mjs --root docs",
25
26
  "prerender:starter": "node src/scripts/manifest.render.mjs --root templates/starter",
26
27
  "render": "node src/scripts/manifest.render.mjs --root src",
27
28
  "publish:starter": "cd packages/create-starter && npm publish --auth-type=web",
29
+ "publish:run": "cd packages/run && npm publish --auth-type=web",
28
30
  "publish:render": "cd packages/render && npm publish --auth-type=web",
29
31
  "prepublishOnly": "npm run build",
30
32
  "test": "vitest run",
@@ -34,7 +36,6 @@
34
36
  "@rollup/plugin-commonjs": "^28.0.1",
35
37
  "@rollup/plugin-node-resolve": "^15.3.0",
36
38
  "@rollup/plugin-terser": "^0.4.4",
37
- "browser-sync": "^3.0.3",
38
39
  "cssnano": "^7.1.1",
39
40
  "glob": "^11.0.2",
40
41
  "puppeteer": "^24.15.0",