Browse Source

Merge branch 'master' into fix/dashboard-channel-validation

Will Nahmens 2 days ago
parent
commit
f9a1e0bd58
4 changed files with 46 additions and 41 deletions
  1. 38 1
      .github/workflows/publish_docs.yml
  2. 4 4
      docs/package-lock.json
  3. 1 1
      docs/package.json
  4. 3 35
      docs/scripts/test-mdx.ts

+ 38 - 1
.github/workflows/publish_docs.yml

@@ -23,6 +23,8 @@ jobs:
     defaults:
       run:
         working-directory: docs
+    outputs:
+      version: ${{ steps.get-version.outputs.version }}
     steps:
       - name: Checkout
         uses: actions/checkout@v4
@@ -41,5 +43,40 @@ jobs:
       - name: Install dependencies
         run: npm install
 
+      - name: Generate version
+        id: get-version
+        run: |
+          VERSION="0.0.0-$(date +%Y%m%d%H%M)"
+          echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
+          echo "Publishing version: ${VERSION}"
+
       - name: Publish to NPM
-        run: npm run publish:local
+        run: |
+          npm version ${{ steps.get-version.outputs.version }} --no-git-tag-version
+          npm publish --tag latest
+
+  trigger-vendure-io-update:
+    needs: publish
+    runs-on: ubuntu-latest
+    steps:
+      - name: Generate token for vendure-io repo
+        uses: actions/create-github-app-token@v2
+        id: vendure-io-token
+        with:
+          app-id: ${{ secrets.CI_BOT_APP_ID }}
+          private-key: ${{ secrets.CI_BOT_APP_PRIVATE_KEY }}
+          owner: vendurehq
+          repositories: vendure-io
+
+      - name: Trigger docs update in vendure-io
+        uses: peter-evans/repository-dispatch@v3
+        with:
+          token: ${{ steps.vendure-io-token.outputs.token }}
+          repository: vendurehq/vendure-io
+          event-type: docs-package-update
+          client-payload: >-
+            {
+              "repository": "${{ github.repository }}",
+              "package": "@vendure/docs@${{ needs.publish.outputs.version }}",
+              "sha": "${{ github.sha }}"
+            }

+ 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) => {