Skip to content

MPT-23439 Ship scss/md ambient shim with emitted type declarations - #107

Merged
d3rky merged 1 commit into
mainfrom
bugfix/MPT-23439/playground-frontend-type-build-does-not-ship-scss-md-ambient-shim-emitted-declarations
Jul 23, 2026
Merged

MPT-23439 Ship scss/md ambient shim with emitted type declarations#107
d3rky merged 1 commit into
mainfrom
bugfix/MPT-23439/playground-frontend-type-build-does-not-ship-scss-md-ambient-shim-emitted-declarations

Conversation

@jentyk

@jentyk jentyk commented Jul 22, 2026

Copy link
Copy Markdown
Member

🤖 AI-generated PR — Please review carefully.

What was done

The frontend type build (npm run build:types, tsc -p tsconfig.build.json with emitDeclarationOnly) emits .d.ts files into static/types/. TypeScript preserves side-effect imports such as import './AddPlugShowcase.scss' in the emitted declarations, but the ambient module shim frontend/src/globals.d.ts (declare module '*.scss' and the '*.md' declaration) was not part of the output. The generated tree therefore did not type-check standalone, and IDEs opening a generated .d.ts reported "Cannot find module './AddPlugShowcase.scss'".

This change makes build:types copy the shim into static/types/ after the tsc emit, so the emitted declarations resolve on their own.

Testing

  • make build scope=frontend — succeeds; static/types/globals.d.ts is now present in the output.
  • Standalone type-check of the emitted static/types/ tree inside the frontend container with skipLibCheck: false — no scss/md resolution errors. Negative control: removing the shim reproduces error TS2882: Cannot find module or type declarations for side-effect import of '../../style.scss'.
  • make check-all scope=frontend — checks pass, 8 test suites / 33 tests pass.

Jira: https://softwareone.atlassian.net/browse/MPT-23439

Closes MPT-23439

  • Updated build:types to copy globals.d.ts alongside emitted declarations.
  • Enables standalone type-checking and IDE resolution of .scss and .md module imports.
  • Validated with successful builds and passing frontend checks.

The type build (tsc -p tsconfig.build.json, emitDeclarationOnly) keeps
side-effect imports like `import './AddPlugShowcase.scss'` in the
emitted .d.ts files under static/types/, but the ambient module shim
frontend/src/globals.d.ts was not part of the output, so the generated
tree did not type-check standalone and IDEs reported unresolved
scss/md modules. Copy the shim into static/types/ as part of
build:types so the emitted declarations resolve on their own.

Refs MPT-23439.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@jentyk
jentyk requested a review from a team as a code owner July 22, 2026 12:50
@jentyk
jentyk requested review from alephsur and d3rky July 22, 2026 12:50
@github-actions

github-actions Bot commented Jul 22, 2026

Copy link
Copy Markdown

✅ Found Jira issue key in the title: MPT-23439

Generated by 🚫 dangerJS against f29172a

@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 06d7473a-40a1-4bf0-8743-3ee42a3c9f1a

📥 Commits

Reviewing files that changed from the base of the PR and between 8609380 and f29172a.

📒 Files selected for processing (1)
  • frontend/package.json
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • softwareone-platform/mpt-extension-skills (manual)
📜 Recent review details
⏰ Context from checks skipped due to timeout. (1)
  • GitHub Check: build
🧰 Additional context used
📓 Path-based instructions (1)
**/*

📄 CodeRabbit inference engine (AGENTS.md)

**/*: For any task, identify its type and select only the local repository files relevant to that task.
Read only the selected relevant local files before making changes.
If selected local files reference relevant shared standards or operational guidance, read those shared documents before proceeding.
Treat repository-local documents as repository-specific additions, restrictions, or overrides to shared guidance.
When repository-local rules conflict with shared rules, the repository-local rule takes precedence.
Treat Docker as the default local execution model for the repository.
For shared meanings of common make targets and validation flow, consult shared knowledge documents instead of inferring semantics from target names alone.

Files:

  • frontend/package.json

⚙️ CodeRabbit configuration file

**/*: For each subsequent commit in this PR, explicitly verify if previous review comments have been resolved

Files:

  • frontend/package.json
🔇 Additional comments (1)
frontend/package.json (1)

8-8: LGTM!


📝 Walkthrough

Walkthrough

Changes

Frontend type build

Layer / File(s) Summary
Type build output
frontend/package.json
The build:types script now copies src/globals.d.ts into ../static/types/ after running the TypeScript build.

Estimated code review effort: 1 (Trivial) | ~2 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Documentation Up To Date ⚠️ Warning build:types changed, but no matching docs were updated; repo docs still only say declarations go to static/types/ and omit the new shim copy. Update the workflow docs (likely docs/contributing.md and/or docs/deployment.md) to mention build:types now copies src/globals.d.ts into static/types/.
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Comment @coderabbitai help to get the list of available commands.

@sonarqubecloud

Copy link
Copy Markdown

@d3rky
d3rky merged commit 4f0aef7 into main Jul 23, 2026
7 checks passed
@d3rky
d3rky deleted the bugfix/MPT-23439/playground-frontend-type-build-does-not-ship-scss-md-ambient-shim-emitted-declarations branch July 23, 2026 09:44
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.

4 participants