Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.0/schema.json",
"changelog": [
"@changesets/changelog-github",
{ "repo": "level0x40/virtual-frame" }
],
"changelog": ["@changesets/changelog-github", { "repo": "level0x40/virtual-frame" }],
"commit": false,
"fixed": [],
"linked": [],
Expand Down
19 changes: 19 additions & 0 deletions .changeset/lazy-terms-invent.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
"@virtual-frame/analog": patch
"@virtual-frame/angular": patch
"virtual-frame": patch
"@virtual-frame/next": patch
"@virtual-frame/nuxt": patch
"@virtual-frame/react": patch
"@virtual-frame/react-router": patch
"@virtual-frame/react-server": patch
"@virtual-frame/solid": patch
"@virtual-frame/solid-start": patch
"@virtual-frame/store": patch
"@virtual-frame/svelte": patch
"@virtual-frame/sveltekit": patch
"@virtual-frame/tanstack-start": patch
"@virtual-frame/vue": patch
---

Initial publish
13 changes: 5 additions & 8 deletions .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: Setup
description: Install pnpm, set up Node.js with pnpm cache, and install dependencies (frozen lockfile).
description: Install Vite+ (vp), set up Node.js with dependency caching, and install dependencies (frozen lockfile).

inputs:
node-version:
Expand All @@ -10,15 +10,12 @@ inputs:
runs:
using: composite
steps:
- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
- name: Setup Vite+
uses: voidzero-dev/setup-vp@v1
with:
node-version: ${{ inputs.node-version }}
cache: pnpm
cache: true

- name: Install dependencies
shell: bash
run: pnpm install --frozen-lockfile
run: vp install --frozen-lockfile
34 changes: 34 additions & 0 deletions .github/codeql/codeql-config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: "virtual-frame CodeQL config"

# Preserve the query suite configured in the workflow — this file only
# narrows what gets reported, it does not choose the suite.

query-filters:
# Polynomial-regex detector flags any regex with an unbounded repetition
# that is evaluated against library input. Across virtual-frame's
# HTML-parsing regexes (e.g. `/<link\s[^>]*>/gi`) the pattern is always a
# single non-overlapping quantifier anchored by a literal — linear in
# input length with no ReDoS path. The rule's own description says it
# "*may* run slow" because it cannot prove otherwise; we have proved
# otherwise by construction. Suppressed globally.
- exclude:
id: js/polynomial-redos

paths-ignore:
# Dedicated security boundary. virtual-frame is a "virtual iframe" —
# its entire purpose is to embed HTML fetched from a caller-chosen
# remote origin (see SECURITY.md, "Security model for embedded
# content"). This file contains the narrow set of intentional HTML
# sinks; reviewing it by hand is the security model, so CodeQL's
# html-injection queries are deliberately excluded here. The rest of
# the workspace stays under full analysis — any html-injection pattern
# introduced outside this file is a real finding.
- "packages/**/src/internal/html-sink.ts"

# Tests and fixtures. Noise from fixture data outweighs signal.
- "**/*.test.ts"
- "**/*.test.tsx"
- "**/test/**"
- "**/__tests__/**"
- "e2e/**"
- "examples/**"
109 changes: 76 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
pull-requests: read
steps:
- name: Validate Conventional Commits format
uses: amannn/action-semantic-pull-request@v5
uses: amannn/action-semantic-pull-request@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
Expand Down Expand Up @@ -57,72 +57,107 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: ./.github/actions/setup

- name: Check formatting
run: pnpm format:check
run: vp run format:check

- name: Lint
run: pnpm lint
run: vp run lint

# ──────────────────────────────────────────────────────────────────────
# Type-check across the workspace. Today this is a real CI gap.
# Build all packages and examples. Uploads dist/ artifacts for
# downstream jobs (typecheck, test, e2e) so they don't rebuild.
# ──────────────────────────────────────────────────────────────────────
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v5
- uses: ./.github/actions/setup

- name: Build all packages
run: vp run build

- name: Upload build artifacts
uses: actions/upload-artifact@v5
with:
name: build-output
path: |
packages/*/dist
retention-days: 1

- name: Upload generated route files
uses: actions/upload-artifact@v5
with:
name: generated-routes
path: |
examples/*/src/routeTree.gen.ts
retention-days: 1

# ──────────────────────────────────────────────────────────────────────
# Type-check across the workspace.
# ──────────────────────────────────────────────────────────────────────
typecheck:
name: Typecheck
needs: [build]
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: ./.github/actions/setup

- name: Download build artifacts
uses: actions/download-artifact@v5
with:
name: build-output
path: packages

- name: Download generated route files
uses: actions/download-artifact@v5
with:
name: generated-routes
path: examples

- name: Typecheck all packages
run: pnpm typecheck
run: vp run typecheck

# ──────────────────────────────────────────────────────────────────────
# Unit + browser tests via vitest.
# ──────────────────────────────────────────────────────────────────────
test:
name: Unit Tests
needs: [build]
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: ./.github/actions/setup

- name: Download build artifacts
uses: actions/download-artifact@v5
with:
name: build-output
path: packages

- name: Install Playwright browsers
# vitest browser mode uses Playwright's chromium under the hood.
run: pnpm exec playwright install --with-deps chromium
run: npx playwright install --with-deps chromium

- name: Run vitest
run: pnpm test:run
run: vp run test:run

- name: Upload coverage
if: always()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: coverage
path: coverage/
if-no-files-found: ignore
retention-days: 14

# ──────────────────────────────────────────────────────────────────────
# Build all packages. Produces dist/ artifacts that e2e relies on
# implicitly (e2e prod-mode builds each example, which transitively
# consumes built packages).
# ──────────────────────────────────────────────────────────────────────
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup

- name: Build all packages
run: pnpm build

# ──────────────────────────────────────────────────────────────────────
# End-to-end Playwright suite — boots real example apps in dev and prod
# mode against a real browser. This is a required gate.
Expand All @@ -133,19 +168,27 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: ./.github/actions/setup

- name: Download build artifacts
uses: actions/download-artifact@v5
with:
name: build-output
path: packages

- name: Install Playwright browsers
working-directory: e2e
run: pnpm exec playwright install --with-deps chromium
run: npx playwright install --with-deps chromium

- name: Run E2E suite
run: pnpm test:e2e
run: vp run test:e2e
env:
VF_E2E_VERBOSE: "1"

- name: Upload Playwright report
if: failure()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: playwright-report
path: |
Expand All @@ -166,14 +209,14 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
# changeset status needs main as a comparison base.
fetch-depth: 0
- uses: ./.github/actions/setup

- name: Verify changeset present
run: pnpm changeset status --since=origin/${{ github.base_ref }}
run: vp run changeset status --since=origin/${{ github.base_ref }}

# ──────────────────────────────────────────────────────────────────────
# Aggregate gate — single status for branch protection to require.
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ jobs:
# queries; security-extended is a good balance for a runtime
# library.
queries: security-extended
# Path filters and per-rule suppressions live in a separate
# config file so the rationale is version-controlled alongside
# the exclusions.
config-file: ./.github/codeql/codeql-config.yml

- name: Autobuild
# JS/TS does not require a build step for analysis; autobuild is
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@ packages/*/LICENSE
**/.next
**/.nuxt
**/.output
**/.react-router
**/.react-server
**/.svelte-kit
**/build
**/@mf-types
.viteplus
*.local
.DS_Store
*.tsbuildinfo
**/__screenshots__
**/__screenshots__
**/routeTree.gen.ts
22 changes: 10 additions & 12 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Contributor Covenant Code of Conduct

## Our Pledge
Expand All @@ -11,19 +10,19 @@ We pledge to act and interact in ways that contribute to an open, welcoming, div

Examples of behavior that contributes to a positive environment for our community include:

* Demonstrating empathy and kindness toward other people
* Being respectful of differing opinions, viewpoints, and experiences
* Giving and gracefully accepting constructive feedback
* Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
* Focusing on what is best not just for us as individuals, but for the overall community
- Demonstrating empathy and kindness toward other people
- Being respectful of differing opinions, viewpoints, and experiences
- Giving and gracefully accepting constructive feedback
- Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
- Focusing on what is best not just for us as individuals, but for the overall community

Examples of unacceptable behavior include:

* The use of sexualized language or imagery, and sexual attention or advances of any kind
* Trolling, insulting or derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or email address, without their explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
- The use of sexualized language or imagery, and sexual attention or advances of any kind
- Trolling, insulting or derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or email address, without their explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting

## Enforcement Responsibilities

Expand Down Expand Up @@ -82,4 +81,3 @@ For answers to common questions about this code of conduct, see the FAQ at [http
[Mozilla CoC]: https://github.com/mozilla/diversity
[FAQ]: https://www.contributor-covenant.org/faq
[translations]: https://www.contributor-covenant.org/translations

5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,7 @@ npm install virtual-frame
import "virtual-frame/element";
</script>

<virtual-frame
src="https://other-team.example.com/widget"
isolate="open"
></virtual-frame>
<virtual-frame src="https://other-team.example.com/widget" isolate="open"></virtual-frame>
```

### React
Expand Down
Loading
Loading