Parcourir la source

docs: Update docs-provider to 0.10.0 and use runAllTests

Upgrade @vendure-io/docs-provider from 0.9.0 to 0.10.0 and simplify the
test-mdx.ts script to use the new unified runAllTests function which
handles frontmatter, admonition, code language, and MDX validation.
David Höck il y a 1 jour
Parent
commit
b8e98cca8c
3 fichiers modifiés avec 8 ajouts et 40 suppressions
  1. 4 4
      docs/package-lock.json
  2. 1 1
      docs/package.json
  3. 3 35
      docs/scripts/test-mdx.ts

+ 4 - 4
docs/package-lock.json

@@ -8,7 +8,7 @@
             "name": "@vendure/docs",
             "version": "0.0.0-202601281114",
             "dependencies": {
-                "@vendure-io/docs-provider": "^0.9.0"
+                "@vendure-io/docs-provider": "^0.10.0"
             },
             "devDependencies": {
                 "@types/node": "^22.10.10",
@@ -602,9 +602,9 @@
             "license": "ISC"
         },
         "node_modules/@vendure-io/docs-provider": {
-            "version": "0.9.0",
-            "resolved": "https://registry.npmjs.org/@vendure-io/docs-provider/-/docs-provider-0.9.0.tgz",
-            "integrity": "sha512-GlcgXqaI/zYR8mF/dGT5Dpm6y81J12hk0EVPHXHktfDyBq+/BYICQLmYMERFut61ZcBwVFr5UTZ8K0oQxqj66Q==",
+            "version": "0.10.0",
+            "resolved": "https://registry.npmjs.org/@vendure-io/docs-provider/-/docs-provider-0.10.0.tgz",
+            "integrity": "sha512-DMGq4vh6KeUYKjzG3qBUjxl2l0OSo4rOfZ2fccKeWtKrxwd95V1Qw1pYta4c3iVi/UJKwJDZRyHm8ihlZ9NB4g==",
             "license": "MIT",
             "dependencies": {
                 "@mdx-js/mdx": "^3.0.0",

+ 1 - 1
docs/package.json

@@ -34,7 +34,7 @@
         "typecheck": "tsc --noEmit"
     },
     "dependencies": {
-        "@vendure-io/docs-provider": "^0.9.0"
+        "@vendure-io/docs-provider": "^0.10.0"
     },
     "devDependencies": {
         "@types/node": "^22.10.10",

+ 3 - 35
docs/scripts/test-mdx.ts

@@ -1,44 +1,12 @@
 import { manifest } from '../src/manifest.js';
-import {
-    testManifestMdx,
-    formatTestReport,
-    createProgressReporter,
-    validateAdmonitions,
-    formatAdmonitionReport,
-} from '@vendure-io/docs-provider/testing';
+import { runAllTests } from '@vendure-io/docs-provider/testing';
 
 async function main() {
     const verbose = process.argv.includes('--verbose');
-    let hasErrors = false;
 
-    // Validate admonition syntax
-    console.log('Validating admonition syntax...\n');
-    const admonitionReport = validateAdmonitions(manifest);
-
-    if (admonitionReport.errors.length > 0) {
-        console.log(formatAdmonitionReport(admonitionReport));
-        hasErrors = true;
-    } else {
-        console.log(`✓ All admonitions valid (${admonitionReport.filesScanned} files scanned)\n`);
-    }
-
-    // Test MDX compilation
-    console.log('Testing MDX files...\n');
-
-    const report = await testManifestMdx(manifest, {
-        onProgress: createProgressReporter(),
+    await runAllTests(manifest, {
+        verbose,
     });
-
-    console.log('\n');
-    console.log(formatTestReport(report, verbose));
-
-    if (report.failed > 0) {
-        hasErrors = true;
-    }
-
-    if (hasErrors) {
-        process.exit(1);
-    }
 }
 
 main().catch((error) => {