chore: import upstream snapshot with attribution
CI / E2E Tests (push) Has been cancelled
CI / Lint, Typecheck & Unit Tests (push) Has been cancelled
Docs Build / Build docs site (push) Has been cancelled
Publish @openmaic packages / Build, validate & publish (push) Has been cancelled

This commit is contained in:
wehub-resource-sync
2026-07-13 13:03:23 +08:00
commit c48612c494
1607 changed files with 341571 additions and 0 deletions
+79
View File
@@ -0,0 +1,79 @@
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main, feat/maic-editor-v0, feat/maic-editor-v1]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
check:
name: Lint, Typecheck & Unit Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Prettier
run: pnpm check
- name: ESLint
run: pnpm lint
- name: TypeScript
run: npx tsc --noEmit
- name: i18n Key Alignment
run: pnpm check:i18n-keys
- name: Unit Tests
run: pnpm test
- name: Unit Tests (importer)
run: pnpm --filter @openmaic/importer test
- name: Unit Tests (dsl)
run: pnpm --filter @openmaic/dsl test
- name: Unit Tests (storage)
run: pnpm --filter @openmaic/storage test
e2e:
name: E2E Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- name: Install Playwright browsers
run: pnpm exec playwright install chromium --with-deps
- name: Run e2e tests
run: pnpm exec playwright test
- uses: actions/upload-artifact@v4
if: failure()
with:
name: playwright-report
path: playwright-report/
retention-days: 7
+37
View File
@@ -0,0 +1,37 @@
name: Docs Build
on:
push:
branches: [main]
paths: ['packages/docs/**', '.github/workflows/docs-build.yml']
pull_request:
branches: [main]
paths: ['packages/docs/**', '.github/workflows/docs-build.yml']
concurrency:
group: docs-build-${{ github.ref }}
cancel-in-progress: true
jobs:
build:
name: Build docs site
runs-on: ubuntu-latest
defaults:
run:
working-directory: packages/docs
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
cache-dependency-path: packages/docs/pnpm-lock.yaml
# Excluded from the root pnpm workspace, so install it standalone.
- run: pnpm install --frozen-lockfile --ignore-workspace
- name: Build (next build + static export)
run: pnpm build
+104
View File
@@ -0,0 +1,104 @@
name: Publish @openmaic packages
# Publishes the @openmaic/* package family (dsl, renderer, importer) to npm.
#
# Scope is pinned to those three packages by name on purpose: the workspace also
# contains vendored forks (mathml2omml, pptxgenjs) whose names we do NOT own, so
# a recursive publish must never touch them.
#
# Triggers:
# - merge a change to one of the @openmaic/* package manifests on `main`
# (real publish). This is the normal path for version-bump releases.
# - push a tag like `@openmaic/dsl@0.1.0` (real publish). NOTE: any @openmaic/*
# tag runs `pnpm -r publish` over all three packages — pnpm skips versions
# already on the registry, so in steady state this is idempotent. The tag is a
# release marker, not a per-package gate: an unpublished version bump for a
# sibling package sitting in the repo will also be published by any tag. Bump
# only the package(s) you intend to release in the same change.
# - manual run via the Actions tab (dry-run by default; uncheck to publish)
#
# Prerequisites (one-time, see issue #778):
# - npm org `openmaic` created and owning the `@openmaic` scope
# - repo secret NPM_TOKEN: an automation/granular token with publish rights
# to @openmaic/*, 2FA set to "auth only" (not "auth and writes") so CI can publish
on:
push:
branches: [main]
tags:
- "@openmaic/*@*"
paths:
- "packages/@openmaic/dsl/package.json"
- "packages/@openmaic/renderer/package.json"
- "packages/@openmaic/importer/package.json"
workflow_dispatch:
inputs:
dry_run:
description: "Pack and validate only, do not publish"
type: boolean
default: true
concurrency:
group: publish-openmaic-${{ github.ref }}
cancel-in-progress: false
jobs:
publish:
name: Build, validate & publish
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write # required for npm provenance
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: pnpm
registry-url: https://registry.npmjs.org
- run: pnpm install --frozen-lockfile
# Build in dependency order (dsl first); renderer/importer resolve
# @openmaic/dsl through the workspace link.
- name: Build @openmaic packages
run: >-
pnpm -r
--filter "@openmaic/dsl"
--filter "@openmaic/renderer"
--filter "@openmaic/importer"
run build
# Gate BEFORE any publish: a failure here aborts before a single package
# reaches the registry. npm versions are immutable, so this prevents a
# partial release (e.g. dsl published, then a sibling's test fails).
- name: Test & typecheck (pre-publish gate)
run: |
pnpm --filter "@openmaic/dsl" --filter "@openmaic/importer" run test
pnpm --filter "@openmaic/dsl" --filter "@openmaic/renderer" run typecheck
# Always review tarball contents before any publish.
- name: Inspect tarball contents (dry-run pack)
run: |
for pkg in dsl renderer importer; do
echo "::group::@openmaic/$pkg"
( cd "packages/@openmaic/$pkg" && pnpm pack --dry-run )
echo "::endgroup::"
done
# Real publish. pnpm rewrites the workspace:* dep on @openmaic/dsl to the
# concrete published version and publishes in topological order.
- name: Publish to npm
if: github.event_name == 'push' || inputs.dry_run == false
run: >-
pnpm -r
--filter "@openmaic/dsl"
--filter "@openmaic/renderer"
--filter "@openmaic/importer"
publish --access public --provenance --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_CONFIG_PROVENANCE: "true"