Skip to content

release: 1.2.0#83

Merged
Splines merged 2 commits into
mainfrom
next
Jun 7, 2026
Merged

release: 1.2.0#83
Splines merged 2 commits into
mainfrom
next

Conversation

@Splines
Copy link
Copy Markdown
Owner

@Splines Splines commented Jun 7, 2026

No description provided.

Splines added 2 commits June 7, 2026 03:38
This PR inits the setup for Playwright tests and adds tests that cover
the most important functionality of the app.
@Splines Splines temporarily deployed to testing-review June 7, 2026 01:45 — with GitHub Actions Inactive
@coderabbitai

This comment was marked as off-topic.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🧹 Nitpick comments (2)
tests/_support/office-mock.ts (1)

16-16: ⚡ Quick win

Make Office route matching resilient to URL variants.

Using an exact URL can miss query-string/cdn variations of office.js. Prefer a wildcard/glob pattern.

Suggested patch
-  await page.route("https://appsforoffice.microsoft.com/lib/1/hosted/office.js", async (route) => {
+  await page.route("**/lib/1/hosted/office.js*", async (route) => {
     await route.fulfill({ contentType: "application/javascript", body: await compileOfficeMock() });
   });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/_support/office-mock.ts` at line 16, The page.route call is matching
the exact office.js URL and will miss variants with query strings or CDN paths;
update the page.route invocation in tests/_support/office-mock.ts (the
page.route(...) handler and its async route callback) to use a resilient matcher
(a glob or RegExp) that matches any path ending with office.js (and optional
query) on appsforoffice.microsoft.com so the route will intercept variants like
query-string or CDN-modified URLs.
tests/_support/transpile-browser-mock.ts (1)

11-19: ⚡ Quick win

Fail fast on TypeScript transpilation diagnostics.

transpileModule diagnostics are ignored, which can hide broken mock sources until browser runtime. Throw on diagnostics during compilation.

Suggested patch
-  const output = ts.transpileModule(source, {
+  const result = ts.transpileModule(source, {
     compilerOptions: {
       module: ts.ModuleKind.ES2022,
       target: ts.ScriptTarget.ES2022,
       sourceMap: false,
     },
     fileName,
-  }).outputText;
+    reportDiagnostics: true,
+  });
+
+  if (result.diagnostics?.length) {
+    throw new Error(
+      ts.formatDiagnosticsWithColorAndContext(result.diagnostics, {
+        getCurrentDirectory: () => process.cwd(),
+        getCanonicalFileName: (f) => f,
+        getNewLine: () => "\n",
+      }),
+    );
+  }
+
+  const output = result.outputText;
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tests/_support/transpile-browser-mock.ts` around lines 11 - 19, The current
call to ts.transpileModule discards diagnostics; change the code to capture the
result (e.g., const result = ts.transpileModule(...)), inspect
result.diagnostics, and if any diagnostics exist throw an Error (including
fileName and formatted diagnostic messages) instead of returning outputText
blindly; then use result.outputText as the output variable. This ensures
ts.transpileModule, result.diagnostics, outputText and fileName are used to fail
fast on TypeScript transpilation errors.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/test.yml:
- Line 16: The workflow uses floating action refs (e.g., the uses line
referencing actions/checkout@v6) which should be pinned to full commit SHAs;
update every uses: entry (such as the actions/checkout reference) to the
corresponding full commit SHA instead of the tag, optionally leaving the
human-readable tag as an end-of-line comment (e.g., keep “@v6” in a comment) for
readability, and ensure each replacement is the exact commit SHA for that action
to harden the CI supply chain.

In `@tests/_support/browser-mocks/typst-state.ts`:
- Around line 27-29: The readiness predicate typstMockReady currently returns
true only when typstMockState.rendererInitOptions.length === 1 which can hang if
initialization runs more than once; change the predicate to check for length >=
1 (or replace with an explicit boolean latch) so waitUntilReady() becomes true
as soon as at least one init occurs—update the function typstMockReady to use >=
1 and ensure any tests relying on a single-init assumption are adjusted
accordingly.

---

Nitpick comments:
In `@tests/_support/office-mock.ts`:
- Line 16: The page.route call is matching the exact office.js URL and will miss
variants with query strings or CDN paths; update the page.route invocation in
tests/_support/office-mock.ts (the page.route(...) handler and its async route
callback) to use a resilient matcher (a glob or RegExp) that matches any path
ending with office.js (and optional query) on appsforoffice.microsoft.com so the
route will intercept variants like query-string or CDN-modified URLs.

In `@tests/_support/transpile-browser-mock.ts`:
- Around line 11-19: The current call to ts.transpileModule discards
diagnostics; change the code to capture the result (e.g., const result =
ts.transpileModule(...)), inspect result.diagnostics, and if any diagnostics
exist throw an Error (including fileName and formatted diagnostic messages)
instead of returning outputText blindly; then use result.outputText as the
output variable. This ensures ts.transpileModule, result.diagnostics, outputText
and fileName are used to fail fast on TypeScript transpilation errors.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 31b74c82-43c2-46be-a132-54455bdfcc1b

📥 Commits

Reviewing files that changed from the base of the PR and between 217ad06 and 4cd5e26.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (27)
  • .config/vite.config.js
  • .github/workflows/test.yml
  • .gitignore
  • .vscode/extensions.json
  • DEV.md
  • package.json
  • playwright.config.ts
  • tests/_support/browser-mocks/typst-memory-access-model.ts
  • tests/_support/browser-mocks/typst-options.ts
  • tests/_support/browser-mocks/typst-package-registry.ts
  • tests/_support/browser-mocks/typst-state-module.d.ts
  • tests/_support/browser-mocks/typst-state.ts
  • tests/_support/browser-mocks/typst-wasm-url.ts
  • tests/_support/browser-mocks/typst.ts
  • tests/_support/fixtures.ts
  • tests/_support/office-mock.ts
  • tests/_support/office/adapter.ts
  • tests/_support/office/document-model.ts
  • tests/_support/office/install.ts
  • tests/_support/office/office-primitives.ts
  • tests/_support/office/types.ts
  • tests/_support/transpile-browser-mock.ts
  • tests/_support/typst-mock.ts
  • tests/pages/powerpoint-page.ts
  • tests/powerpoint.spec.ts
  • tests/preview.spec.ts
  • tsconfig.json

Comment thread .github/workflows/test.yml
Comment thread tests/_support/browser-mocks/typst-state.ts
@Splines Splines merged commit 4373d2d into main Jun 7, 2026
4 checks passed
@Splines Splines deleted the next branch June 7, 2026 01:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant