| steps: | steps: | ||||
| - uses: actions/checkout@v3 | - uses: actions/checkout@v3 | ||||
| - name: Use Node.js ${{ matrix.node-version }} | |||||
| uses: actions/setup-node@v3 | |||||
| - uses: actions/setup-node@v3 | |||||
| with: | with: | ||||
| node-version: ${{ matrix.node-version }} | node-version: ${{ matrix.node-version }} | ||||
| cache: 'npm' | |||||
| cache-dependency-path: '**/package-lock.json' # https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-data | |||||
| # cache: 'npm' | |||||
| # cache-dependency-path: '**/package-lock.json' # https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#caching-packages-data | |||||
| - run: npm ci # this will also run `npm run prepare` which will build | - run: npm ci # this will also run `npm run prepare` which will build | ||||
| - run: npm run docs | |||||
| - run: npm run docs-all | |||||
| - run: mkdir _site | - run: mkdir _site | ||||
| - run: mv -t _site src docs dist examples README.md LICENSE index.html | - run: mv -t _site src docs dist examples README.md LICENSE index.html | ||||
| - run: mkdir -p _site/plugins | - run: mkdir -p _site/plugins |
| "serve-docs": "ws -d docs -p 8080", | "serve-docs": "ws -d docs -p 8080", | ||||
| "serve": "ws -d . -p 9229", | "serve": "ws -d . -p 9229", | ||||
| "docs": "npx typedoc && markdown-to-html", | "docs": "npx typedoc && markdown-to-html", | ||||
| "build-plugins": "node scripts/build-plugins.mjs", | |||||
| "docs-plugins": "node scripts/each-plugin.mjs run docs", | |||||
| "docs-all": "npm run docs && npm run docs-plugins", | |||||
| "build-plugins": "node scripts/each-plugin.mjs ci", | |||||
| "prepare": "npm run build && npm run compile && npm run build-plugins && npm run build-examples", | "prepare": "npm run build && npm run compile && npm run build-plugins && npm run build-examples", | ||||
| "update-version": "echo \"export const VERSION = '$npm_package_version'\" > src/viewer/version.ts" | "update-version": "echo \"export const VERSION = '$npm_package_version'\" > src/viewer/version.ts" | ||||
| }, | }, |
| import {execEachPlugin} from "./utils.mjs"; | |||||
| const command = process.argv.slice(2).join(' ') | |||||
| if(!command) throw new Error('Command is required') | |||||
| console.log(`Executing '${command}' in all plugins`) | |||||
| // Each plugin should have "prepare" that will also build the plugin | |||||
| execEachPlugin(`npm ${command}}`) // install dependencies |