@iqual/nuxt-icms 1.5.22 → 1.6.0-rc.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.
@@ -35,8 +35,9 @@ const topicsLabel = computed(() => {
35
35
  )
36
36
  })
37
37
 
38
+ const teaserVariant = inject<Ref<TeaserVariant>>('teaserVariant')!
39
+
38
40
  const getComponent = () => {
39
- if (!teaserVariant.value) return 'feature'
40
41
  const components: Record<string, Component> = {
41
42
  teaser: DesignSystemOrganismsTeaserCard,
42
43
  feature: DesignSystemOrganismsFeatureCard,
@@ -47,6 +48,4 @@ const getComponent = () => {
47
48
  }
48
49
  return components[teaserVariant.value]
49
50
  }
50
-
51
- const teaserVariant = inject<TeaserVariant>('teaserVariant')
52
51
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iqual/nuxt-icms",
3
- "version": "1.5.22",
3
+ "version": "1.6.0-rc.1",
4
4
  "description": "ICMS Base",
5
5
  "type": "module",
6
6
  "private": false,
@@ -13,44 +13,44 @@
13
13
  },
14
14
  "dependencies": {
15
15
  "@blokkli/editor": "2.0.0-alpha.13",
16
- "@elastic/elasticsearch": "^8.18.2",
17
- "@iframe-resizer/child": "^5.4.6",
18
- "@iframe-resizer/vue": "^5.4.6",
19
- "@nuxt/image": "^1.10.0",
20
- "@nuxt/kit": "^4.1.1",
21
- "@nuxt/scripts": "^0.11.7",
22
- "@nuxt/schema": "^4.1.1",
23
- "@nuxt/ui": "^4.4.0",
24
- "@nuxtjs/color-mode": "^3.5.2",
16
+ "@elastic/elasticsearch": "~8.19.1",
17
+ "@iframe-resizer/child": "~5.5.9",
18
+ "@iframe-resizer/vue": "~5.5.9",
19
+ "@nuxt/image": "~1.11.0",
20
+ "@nuxt/kit": "~4.4.2",
21
+ "@nuxt/scripts": "~0.11.13",
22
+ "@nuxt/schema": "~4.4.2",
23
+ "@nuxt/ui": "~4.4.0",
24
+ "@nuxtjs/color-mode": "~3.5.2",
25
25
  "@nuxtjs/turnstile": "1.0.0",
26
- "@vueuse/core": "^12.8.2",
27
- "caniuse-lite": "^1.0.30001718",
28
- "clsx": "^2.1.1",
29
- "culori": "^4.0.2",
30
- "h3": "^1.14.1",
31
- "lucide-vue-next": "^0.469.0",
32
- "nitropack": "^2.13.3",
33
- "nuxt-easy-texts": "^2.1.1",
34
- "nuxt-graphql-middleware": "^5.4.0",
35
- "nuxt-language-negotiation": "^2.0.2",
36
- "nuxt-maplibre": "^1.2.2",
37
- "nuxt-multi-cache": "^4.0.3",
38
- "nuxt-page-dependencies": "^1.2.0",
39
- "nuxt-svg-icon-sprite": "^2.0.2",
40
- "nuxt-viewport": "^2.3.1",
41
- "ofetch": "^1.4.1",
42
- "patch-package": "^8.0.0",
43
- "svgo": "^3.3.2",
44
- "swiper": "^10.3.1",
45
- "tailwind-merge": "^2.6.0",
46
- "tailwind-variants": "^0.3.1",
47
- "tailwind-animate": "^0.2.10",
48
- "ufo": "^1.5.4",
49
- "unstorage": "^1.12.0",
26
+ "@vueuse/core": "~12.8.2",
27
+ "caniuse-lite": "~1.0.30001790",
28
+ "clsx": "~2.1.1",
29
+ "culori": "~4.0.2",
30
+ "h3": "~1.15.11",
31
+ "lucide-vue-next": "~0.469.0",
32
+ "nitropack": "~2.13.3",
33
+ "nuxt-easy-texts": "~2.1.2",
34
+ "nuxt-graphql-middleware": "~5.4.0",
35
+ "nuxt-language-negotiation": "~2.0.2",
36
+ "nuxt-maplibre": "~1.2.2",
37
+ "nuxt-multi-cache": "~4.0.3",
38
+ "nuxt-page-dependencies": "~1.2.0",
39
+ "nuxt-svg-icon-sprite": "~2.0.2",
40
+ "nuxt-viewport": "~2.3.1",
41
+ "ofetch": "~1.5.1",
42
+ "patch-package": "~8.0.1",
43
+ "svgo": "~3.3.2",
44
+ "swiper": "~10.3.1",
45
+ "tailwind-merge": "~2.6.1",
46
+ "tailwind-variants": "~0.3.1",
47
+ "tailwind-animate": "~0.2.10",
48
+ "ufo": "~1.6.3",
49
+ "unstorage": "~1.17.5",
50
50
  "vue3-carousel": "0.3.1",
51
- "vue3-click-away": "^1.2.4",
52
- "vuepal": "^3.0.5",
53
- "zod": "^4.3.6"
51
+ "vue3-click-away": "~1.2.4",
52
+ "vuepal": "~3.0.5",
53
+ "zod": "~4.3.6"
54
54
  },
55
55
  "devDependencies": {
56
56
  "@tailwindcss/postcss": "^4.1.18",
@@ -0,0 +1,38 @@
1
+ import { spawnSync } from 'node:child_process'
2
+ import { readFile } from 'node:fs/promises'
3
+
4
+ /**
5
+ * Updates all installed @iqual packages to the given NPM dist-tag,
6
+ * e.g. `rc` for testing ICMS release candidates.
7
+ *
8
+ * Usage (from the frontend root): bun run ./node_modules/@iqual/nuxt-icms/scripts/update-icms.ts <dist-tag>
9
+ */
10
+
11
+ function fail(message: string): never {
12
+ console.error(message)
13
+ process.exit(1)
14
+ }
15
+
16
+ const distTag = process.argv[2]
17
+ if (!distTag) {
18
+ fail('Usage: bun run update-icms.ts <dist-tag>')
19
+ }
20
+
21
+ const pkg = JSON.parse(await readFile('./package.json', 'utf-8'))
22
+
23
+ const pick = (dependencies?: Record<string, string>) =>
24
+ Object.entries(dependencies ?? {})
25
+ .filter(([name, constraint]) => name.startsWith('@iqual/') && !constraint.startsWith('workspace:'))
26
+ .map(([name]) => `${name}@${distTag}`)
27
+
28
+ const add = (packages: string[], flags: string[] = []) => {
29
+ if (packages.length === 0) return
30
+ console.log(`Updating ${packages.join(', ')}`)
31
+ const result = spawnSync('bun', ['add', ...flags, ...packages], { stdio: 'inherit' })
32
+ if (result.status !== 0) {
33
+ fail(`Failed to update ${packages.join(', ')}`)
34
+ }
35
+ }
36
+
37
+ add(pick(pkg.dependencies))
38
+ add(pick(pkg.devDependencies), ['--dev'])
@@ -27,9 +27,16 @@ function getSingleQueryValue(
27
27
 
28
28
  const config = useRuntimeConfig()
29
29
 
30
- export const client = new Client({
31
- node: config.elasticsearchUrl,
32
- })
30
+ let client: Client | undefined
31
+
32
+ function getClient(): Client | undefined {
33
+ if (!client && config.elasticsearchUrl) {
34
+ client = new Client({
35
+ node: config.elasticsearchUrl,
36
+ })
37
+ }
38
+ return client
39
+ }
33
40
 
34
41
  type ContentSearchItem = {
35
42
  id: string
@@ -76,6 +83,13 @@ function mapSearchItem(
76
83
  */
77
84
  export default defineEventHandler<Promise<ContentSearchItem[]>>(
78
85
  async (event) => {
86
+ const client = getClient()
87
+ if (!client) {
88
+ throw createError({
89
+ statusCode: 503,
90
+ statusMessage: 'Content search is not configured.',
91
+ })
92
+ }
79
93
  try {
80
94
  const query: QueryObject = getQuery(event)
81
95
  const text = getSingleQueryValue(query.text)