@htlkg/astro 0.0.24 → 0.0.26

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.
@@ -2,6 +2,8 @@
2
2
  import { Amplify } from "aws-amplify";
3
3
  import { htlkgConfig } from "virtual:htlkg";
4
4
  function setupVueApp(app) {
5
+ console.log("[htlkg vue-app-setup] Setting up Vue app...");
6
+ console.log("[htlkg vue-app-setup] htlkgConfig:", htlkgConfig);
5
7
  if (import.meta.env.DEV && typeof window !== "undefined") {
6
8
  try {
7
9
  import("@nanostores/vue/devtools").then(({ devtools }) => {
@@ -13,12 +15,15 @@ function setupVueApp(app) {
13
15
  }
14
16
  try {
15
17
  const { amplifyConfig } = htlkgConfig;
18
+ console.log("[htlkg vue-app-setup] amplifyConfig:", amplifyConfig);
16
19
  if (!amplifyConfig) {
17
20
  console.warn("[htlkg] No Amplify configuration provided");
18
21
  return;
19
22
  }
20
23
  if ("auth" in amplifyConfig || "data" in amplifyConfig || "storage" in amplifyConfig) {
24
+ console.log("[htlkg vue-app-setup] Configuring Amplify with full config...");
21
25
  Amplify.configure(amplifyConfig, { ssr: true });
26
+ console.log("[htlkg vue-app-setup] Amplify configured successfully!");
22
27
  } else {
23
28
  const { userPoolId, userPoolClientId, region } = amplifyConfig;
24
29
  if (userPoolId && userPoolClientId) {
@@ -31,7 +36,9 @@ function setupVueApp(app) {
31
36
  }
32
37
  }
33
38
  };
39
+ console.log("[htlkg vue-app-setup] Configuring Amplify with legacy config...");
34
40
  Amplify.configure(config, { ssr: true });
41
+ console.log("[htlkg vue-app-setup] Amplify configured successfully!");
35
42
  } else {
36
43
  console.error(
37
44
  "[htlkg] Missing required Amplify configuration (userPoolId, userPoolClientId)"
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/vue-app-setup.ts"],"sourcesContent":["/**\n * Vue App Setup for htlkg Integration\n *\n * This file is automatically loaded by the Vue integration when vueAppSetup is enabled.\n * It configures AWS Amplify for client-side authentication in all Vue components.\n * It also sets up nanostores devtools integration for Vue DevTools.\n */\n\n/// <reference types=\"vite/client\" />\n\nimport type { App } from \"vue\";\nimport type { ResourcesConfig } from \"aws-amplify\";\nimport { Amplify } from \"aws-amplify\";\nimport { htlkgConfig } from \"virtual:htlkg\";\n\n/**\n * Setup function called by Astro's Vue integration\n * Configures Amplify for client-side authentication and nanostores devtools\n */\nexport default function setupVueApp(app: App): void {\n\t// Setup nanostores devtools in development\n\t// The devtools plugin will automatically detect stores used in components\n\tif (import.meta.env.DEV && typeof window !== 'undefined') {\n\t\ttry {\n\t\t\t// Dynamically import devtools plugin (only in browser)\n\t\t\timport('@nanostores/vue/devtools').then(({ devtools }) => {\n\t\t\t\t// Install devtools plugin - it will detect stores automatically\n\t\t\t\tapp.use(devtools, {});\n\t\t\t}).catch(() => {\n\t\t\t\t// Silently ignore - devtools are optional\n\t\t\t});\n\t\t} catch {\n\t\t\t// Silently ignore - devtools are optional\n\t\t}\n\t}\n\n\t// Setup Amplify\n\ttry {\n\t\tconst { amplifyConfig } = htlkgConfig;\n\t\tif (!amplifyConfig) {\n\t\t\tconsole.warn(\"[htlkg] No Amplify configuration provided\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Check if this is a full amplify_outputs.json config\n\t\tif (\n\t\t\t\"auth\" in amplifyConfig ||\n\t\t\t\"data\" in amplifyConfig ||\n\t\t\t\"storage\" in amplifyConfig\n\t\t) {\n\t\t\tAmplify.configure(amplifyConfig as ResourcesConfig, { ssr: true });\n\t\t} else {\n\t\t\t// Legacy individual config properties\n\t\t\tconst { userPoolId, userPoolClientId, region } = amplifyConfig as {\n\t\t\t\tuserPoolId?: string;\n\t\t\t\tuserPoolClientId?: string;\n\t\t\t\tregion?: string;\n\t\t\t};\n\n\t\t\tif (userPoolId && userPoolClientId) {\n\t\t\t\tconst config: ResourcesConfig = {\n\t\t\t\t\tAuth: {\n\t\t\t\t\t\tCognito: {\n\t\t\t\t\t\t\tuserPoolId,\n\t\t\t\t\t\t\tuserPoolClientId,\n\t\t\t\t\t\t\t...(region && { region }),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tAmplify.configure(config, { ssr: true });\n\t\t\t} else {\n\t\t\t\tconsole.error(\n\t\t\t\t\t\"[htlkg] Missing required Amplify configuration (userPoolId, userPoolClientId)\",\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t} catch (error) {\n\t\tconsole.error(\"[htlkg] Failed to setup Vue app:\", error);\n\t\t// Don't throw - allow app to continue even if Amplify setup fails\n\t}\n}\n"],"mappings":";AAYA,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAMb,SAAR,YAA6B,KAAgB;AAGnD,MAAI,YAAY,IAAI,OAAO,OAAO,WAAW,aAAa;AACzD,QAAI;AAEH,aAAO,0BAA0B,EAAE,KAAK,CAAC,EAAE,SAAS,MAAM;AAEzD,YAAI,IAAI,UAAU,CAAC,CAAC;AAAA,MACrB,CAAC,EAAE,MAAM,MAAM;AAAA,MAEf,CAAC;AAAA,IACF,QAAQ;AAAA,IAER;AAAA,EACD;AAGA,MAAI;AACH,UAAM,EAAE,cAAc,IAAI;AAC1B,QAAI,CAAC,eAAe;AACnB,cAAQ,KAAK,2CAA2C;AACxD;AAAA,IACD;AAGA,QACC,UAAU,iBACV,UAAU,iBACV,aAAa,eACZ;AACD,cAAQ,UAAU,eAAkC,EAAE,KAAK,KAAK,CAAC;AAAA,IAClE,OAAO;AAEN,YAAM,EAAE,YAAY,kBAAkB,OAAO,IAAI;AAMjD,UAAI,cAAc,kBAAkB;AACnC,cAAM,SAA0B;AAAA,UAC/B,MAAM;AAAA,YACL,SAAS;AAAA,cACR;AAAA,cACA;AAAA,cACA,GAAI,UAAU,EAAE,OAAO;AAAA,YACxB;AAAA,UACD;AAAA,QACD;AAEA,gBAAQ,UAAU,QAAQ,EAAE,KAAK,KAAK,CAAC;AAAA,MACxC,OAAO;AACN,gBAAQ;AAAA,UACP;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD,SAAS,OAAO;AACf,YAAQ,MAAM,oCAAoC,KAAK;AAAA,EAExD;AACD;","names":[]}
1
+ {"version":3,"sources":["../src/vue-app-setup.ts"],"sourcesContent":["/**\n * Vue App Setup for htlkg Integration\n *\n * This file is automatically loaded by the Vue integration when vueAppSetup is enabled.\n * It configures AWS Amplify for client-side authentication in all Vue components.\n * It also sets up nanostores devtools integration for Vue DevTools.\n */\n\n/// <reference types=\"vite/client\" />\n\nimport type { App } from \"vue\";\nimport type { ResourcesConfig } from \"aws-amplify\";\nimport { Amplify } from \"aws-amplify\";\nimport { htlkgConfig } from \"virtual:htlkg\";\n\n/**\n * Setup function called by Astro's Vue integration\n * Configures Amplify for client-side authentication and nanostores devtools\n */\nexport default function setupVueApp(app: App): void {\n\tconsole.log(\"[htlkg vue-app-setup] Setting up Vue app...\");\n\tconsole.log(\"[htlkg vue-app-setup] htlkgConfig:\", htlkgConfig);\n\n\t// Setup nanostores devtools in development\n\t// The devtools plugin will automatically detect stores used in components\n\tif (import.meta.env.DEV && typeof window !== 'undefined') {\n\t\ttry {\n\t\t\t// Dynamically import devtools plugin (only in browser)\n\t\t\timport('@nanostores/vue/devtools').then(({ devtools }) => {\n\t\t\t\t// Install devtools plugin - it will detect stores automatically\n\t\t\t\tapp.use(devtools, {});\n\t\t\t}).catch(() => {\n\t\t\t\t// Silently ignore - devtools are optional\n\t\t\t});\n\t\t} catch {\n\t\t\t// Silently ignore - devtools are optional\n\t\t}\n\t}\n\n\t// Setup Amplify\n\ttry {\n\t\tconst { amplifyConfig } = htlkgConfig;\n\t\tconsole.log(\"[htlkg vue-app-setup] amplifyConfig:\", amplifyConfig);\n\n\t\tif (!amplifyConfig) {\n\t\t\tconsole.warn(\"[htlkg] No Amplify configuration provided\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Check if this is a full amplify_outputs.json config\n\t\tif (\n\t\t\t\"auth\" in amplifyConfig ||\n\t\t\t\"data\" in amplifyConfig ||\n\t\t\t\"storage\" in amplifyConfig\n\t\t) {\n\t\t\tconsole.log(\"[htlkg vue-app-setup] Configuring Amplify with full config...\");\n\t\t\tAmplify.configure(amplifyConfig as ResourcesConfig, { ssr: true });\n\t\t\tconsole.log(\"[htlkg vue-app-setup] Amplify configured successfully!\");\n\t\t} else {\n\t\t\t// Legacy individual config properties\n\t\t\tconst { userPoolId, userPoolClientId, region } = amplifyConfig as {\n\t\t\t\tuserPoolId?: string;\n\t\t\t\tuserPoolClientId?: string;\n\t\t\t\tregion?: string;\n\t\t\t};\n\n\t\t\tif (userPoolId && userPoolClientId) {\n\t\t\t\tconst config: ResourcesConfig = {\n\t\t\t\t\tAuth: {\n\t\t\t\t\t\tCognito: {\n\t\t\t\t\t\t\tuserPoolId,\n\t\t\t\t\t\t\tuserPoolClientId,\n\t\t\t\t\t\t\t...(region && { region }),\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t};\n\n\t\t\t\tconsole.log(\"[htlkg vue-app-setup] Configuring Amplify with legacy config...\");\n\t\t\t\tAmplify.configure(config, { ssr: true });\n\t\t\t\tconsole.log(\"[htlkg vue-app-setup] Amplify configured successfully!\");\n\t\t\t} else {\n\t\t\t\tconsole.error(\n\t\t\t\t\t\"[htlkg] Missing required Amplify configuration (userPoolId, userPoolClientId)\",\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t} catch (error) {\n\t\tconsole.error(\"[htlkg] Failed to setup Vue app:\", error);\n\t\t// Don't throw - allow app to continue even if Amplify setup fails\n\t}\n}\n"],"mappings":";AAYA,SAAS,eAAe;AACxB,SAAS,mBAAmB;AAMb,SAAR,YAA6B,KAAgB;AACnD,UAAQ,IAAI,6CAA6C;AACzD,UAAQ,IAAI,sCAAsC,WAAW;AAI7D,MAAI,YAAY,IAAI,OAAO,OAAO,WAAW,aAAa;AACzD,QAAI;AAEH,aAAO,0BAA0B,EAAE,KAAK,CAAC,EAAE,SAAS,MAAM;AAEzD,YAAI,IAAI,UAAU,CAAC,CAAC;AAAA,MACrB,CAAC,EAAE,MAAM,MAAM;AAAA,MAEf,CAAC;AAAA,IACF,QAAQ;AAAA,IAER;AAAA,EACD;AAGA,MAAI;AACH,UAAM,EAAE,cAAc,IAAI;AAC1B,YAAQ,IAAI,wCAAwC,aAAa;AAEjE,QAAI,CAAC,eAAe;AACnB,cAAQ,KAAK,2CAA2C;AACxD;AAAA,IACD;AAGA,QACC,UAAU,iBACV,UAAU,iBACV,aAAa,eACZ;AACD,cAAQ,IAAI,+DAA+D;AAC3E,cAAQ,UAAU,eAAkC,EAAE,KAAK,KAAK,CAAC;AACjE,cAAQ,IAAI,wDAAwD;AAAA,IACrE,OAAO;AAEN,YAAM,EAAE,YAAY,kBAAkB,OAAO,IAAI;AAMjD,UAAI,cAAc,kBAAkB;AACnC,cAAM,SAA0B;AAAA,UAC/B,MAAM;AAAA,YACL,SAAS;AAAA,cACR;AAAA,cACA;AAAA,cACA,GAAI,UAAU,EAAE,OAAO;AAAA,YACxB;AAAA,UACD;AAAA,QACD;AAEA,gBAAQ,IAAI,iEAAiE;AAC7E,gBAAQ,UAAU,QAAQ,EAAE,KAAK,KAAK,CAAC;AACvC,gBAAQ,IAAI,wDAAwD;AAAA,MACrE,OAAO;AACN,gBAAQ;AAAA,UACP;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,EACD,SAAS,OAAO;AACf,YAAQ,MAAM,oCAAoC,KAAK;AAAA,EAExD;AACD;","names":[]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@htlkg/astro",
3
- "version": "0.0.24",
3
+ "version": "0.0.26",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -65,8 +65,8 @@
65
65
  "@nanostores/vue": "^1.0.1",
66
66
  "nanostores": "^1.0.1",
67
67
  "vue": "^3.5.22",
68
- "@htlkg/components": "0.0.14",
69
- "@htlkg/core": "0.0.13"
68
+ "@htlkg/components": "0.0.11",
69
+ "@htlkg/core": "0.0.14"
70
70
  },
71
71
  "peerDependencies": {
72
72
  "astro": "^5.0.0",
@@ -62,7 +62,7 @@ const finalRedirectUrl = searchParams.get("redirect") || redirectUrl;
62
62
  >
63
63
  <div class="max-w-md w-full space-y-8">
64
64
  <LoginForm
65
- client:only="vue"
65
+ client:load
66
66
  redirectUrl={finalRedirectUrl}
67
67
  logo={logo}
68
68
  title={title}
@@ -65,17 +65,10 @@ interface SidebarProps {
65
65
  openByDefault?: boolean;
66
66
  }
67
67
 
68
- interface ProfileMenuItem {
69
- name: string;
70
- id: string;
71
- href: string;
72
- }
73
-
74
68
  interface TopbarProps {
75
69
  actions?: TopbarAction[];
76
70
  selectItems?: SelectItem[];
77
71
  selectedItem?: SelectItem;
78
- profileMenuItems?: ProfileMenuItem[];
79
72
  }
80
73
 
81
74
  interface Props {
@@ -104,7 +97,6 @@ const {
104
97
  actions: topbarActions = [],
105
98
  selectItems = [],
106
99
  selectedItem = { name: "", id: "" },
107
- profileMenuItems = [],
108
100
  } = topbar || {};
109
101
 
110
102
  // Initialize user nanostore (server-side)
@@ -180,7 +172,6 @@ import { ClientRouter } from "astro:transitions";
180
172
  selectItems={selectItems}
181
173
  selectedItem={selectedItem}
182
174
  productsSidebar={productsSidebar}
183
- profileMenuItems={profileMenuItems}
184
175
  sidebarOpenByDefault={sidebarOpenByDefault}
185
176
  >
186
177
  <!-- View Header with breadcrumbs, title, and optional button -->
@@ -18,6 +18,9 @@ import { htlkgConfig } from "virtual:htlkg";
18
18
  * Configures Amplify for client-side authentication and nanostores devtools
19
19
  */
20
20
  export default function setupVueApp(app: App): void {
21
+ console.log("[htlkg vue-app-setup] Setting up Vue app...");
22
+ console.log("[htlkg vue-app-setup] htlkgConfig:", htlkgConfig);
23
+
21
24
  // Setup nanostores devtools in development
22
25
  // The devtools plugin will automatically detect stores used in components
23
26
  if (import.meta.env.DEV && typeof window !== 'undefined') {
@@ -37,6 +40,8 @@ export default function setupVueApp(app: App): void {
37
40
  // Setup Amplify
38
41
  try {
39
42
  const { amplifyConfig } = htlkgConfig;
43
+ console.log("[htlkg vue-app-setup] amplifyConfig:", amplifyConfig);
44
+
40
45
  if (!amplifyConfig) {
41
46
  console.warn("[htlkg] No Amplify configuration provided");
42
47
  return;
@@ -48,7 +53,9 @@ export default function setupVueApp(app: App): void {
48
53
  "data" in amplifyConfig ||
49
54
  "storage" in amplifyConfig
50
55
  ) {
56
+ console.log("[htlkg vue-app-setup] Configuring Amplify with full config...");
51
57
  Amplify.configure(amplifyConfig as ResourcesConfig, { ssr: true });
58
+ console.log("[htlkg vue-app-setup] Amplify configured successfully!");
52
59
  } else {
53
60
  // Legacy individual config properties
54
61
  const { userPoolId, userPoolClientId, region } = amplifyConfig as {
@@ -68,7 +75,9 @@ export default function setupVueApp(app: App): void {
68
75
  },
69
76
  };
70
77
 
78
+ console.log("[htlkg vue-app-setup] Configuring Amplify with legacy config...");
71
79
  Amplify.configure(config, { ssr: true });
80
+ console.log("[htlkg vue-app-setup] Amplify configured successfully!");
72
81
  } else {
73
82
  console.error(
74
83
  "[htlkg] Missing required Amplify configuration (userPoolId, userPoolClientId)",