+
+
+
+
+
+
-
-
-
-
-
-
+
+
{{ $t('compare.packages.error') }}
+
-
- {{ $t('compare.facets.trends.title') }}
+
+
+
+
+ {{ $t('compare.packages.empty_title') }}
+
+ {{ $t('compare.packages.empty_description') }}
+
+
-
-
-
-
-
{{ $t('compare.packages.error') }}
-
-
-
-
-
-
-
- {{ $t('compare.packages.empty_title') }}
-
-
- {{ $t('compare.packages.empty_description') }}
-
-
+
+
+
+
{{ $t('compare.packages.loading') }}
+
+
+
+
+
diff --git a/i18n/locales/en.json b/i18n/locales/en.json
index b83fcc59b..b6b1a7e9e 100644
--- a/i18n/locales/en.json
+++ b/i18n/locales/en.json
@@ -6,6 +6,7 @@
"description": "a fast, modern browser for the npm registry. Search, browse, and explore packages with a modern interface."
}
},
+ "js_required": "This page requires JavaScript to function.",
"built_at": "built {0}",
"alt_logo": "npmx logo",
"tagline": "a fast, modern browser for the npm registry",
diff --git a/i18n/schema.json b/i18n/schema.json
index 47977f0b2..2b97e159e 100644
--- a/i18n/schema.json
+++ b/i18n/schema.json
@@ -22,6 +22,9 @@
},
"additionalProperties": false
},
+ "js_required": {
+ "type": "string"
+ },
"built_at": {
"type": "string"
},
diff --git a/lunaria/files/en-GB.json b/lunaria/files/en-GB.json
index 56f795555..0a9f62dcc 100644
--- a/lunaria/files/en-GB.json
+++ b/lunaria/files/en-GB.json
@@ -5,6 +5,7 @@
"description": "a fast, modern browser for the npm registry. Search, browse, and explore packages with a modern interface."
}
},
+ "js_required": "This page requires JavaScript to function.",
"built_at": "built {0}",
"alt_logo": "npmx logo",
"tagline": "a fast, modern browser for the npm registry",
diff --git a/lunaria/files/en-US.json b/lunaria/files/en-US.json
index d8666cdf5..1ce1a1e3b 100644
--- a/lunaria/files/en-US.json
+++ b/lunaria/files/en-US.json
@@ -5,6 +5,7 @@
"description": "a fast, modern browser for the npm registry. Search, browse, and explore packages with a modern interface."
}
},
+ "js_required": "This page requires JavaScript to function.",
"built_at": "built {0}",
"alt_logo": "npmx logo",
"tagline": "a fast, modern browser for the npm registry",
diff --git a/nuxt.config.ts b/nuxt.config.ts
index 3311ee081..c5cb98e70 100644
--- a/nuxt.config.ts
+++ b/nuxt.config.ts
@@ -139,6 +139,7 @@ export default defineNuxtConfig({
'/200.html': { prerender: true },
'/about': { prerender: true },
'/accessibility': { prerender: true },
+ '/compare': { prerender: true },
'/privacy': { prerender: true },
'/search': { isr: false, cache: false }, // never cache
'/settings': { prerender: true },
diff --git a/test/nuxt/components/compare/FacetRow.spec.ts b/test/nuxt/components/compare/FacetRow.spec.ts
index ff0765793..a5a94550e 100644
--- a/test/nuxt/components/compare/FacetRow.spec.ts
+++ b/test/nuxt/components/compare/FacetRow.spec.ts
@@ -45,7 +45,7 @@ describe('FacetRow', () => {
})
describe('value rendering', () => {
- it('renders null values as dash', async () => {
+ it('renders null values as skeleton', async () => {
const component = await mountSuspended(FacetRow, {
props: {
...baseProps,
@@ -54,7 +54,8 @@ describe('FacetRow', () => {
})
const cells = component.findAll('.comparison-cell')
expect(cells.length).toBe(2)
- expect(component.text()).toContain('-')
+ // Should render SkeletonInline component (check for skeleton class)
+ expect(component.findAll('.animate-skeleton-pulse').length).toBe(2)
})
it('renders facet values', async () => {
diff --git a/test/nuxt/composables/use-package-comparison.spec.ts b/test/nuxt/composables/use-package-comparison.spec.ts
index f1e47398e..e03a1ee07 100644
--- a/test/nuxt/composables/use-package-comparison.spec.ts
+++ b/test/nuxt/composables/use-package-comparison.spec.ts
@@ -23,7 +23,9 @@ async function usePackageComparisonInComponent(packageNames: string[]) {
// Sync values to captured refs
watchEffect(() => {
- capturedPackagesData.value = [...packagesData.value]
+ capturedPackagesData.value = Array.isArray(packagesData.value)
+ ? [...packagesData.value]
+ : []
capturedStatus.value = status.value
})
capturedGetFacetValues = getFacetValues