Skip to content

refactor(canvas): establish TypeScript extension foundation - #51

Merged
lukasoppermann merged 2 commits into
mainfrom
lukasoppermann-canvas-typescript-foundation
Oct 22, 2026
Merged

lukasoppermann merged 2 commits into
mainfrom
lukasoppermann-canvas-typescript-foundation

Conversation

@lukasoppermann

Copy link
Copy Markdown
Contributor

Why

The canvas frontend already uses TypeScript, but the extension's Node modules remain JavaScript. This first layer of the migration establishes strict type checking without changing how people install or run the plugin.

What changes

Remote branch lookup now has TypeScript source and committed, generated JavaScript. The existing extension.mjs entry point, plugin installation, and browser assets stay unchanged. A declaration describes the command runner until its later conversion.

Hub's lint and type-check commands include migrated modules. The extension build compiles them before building browser assets, and the freshness check also detects stale generated Node modules outside the assets directory. The contributor guide explains which source to edit and how to rebuild it.

Convert remote branch lookup to strict TypeScript while retaining its generated JavaScript runtime. Include migrated modules in lint, type checks, and plugin freshness checks.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9d7306a9-9831-4c78-89e7-3c5b581c895e

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The command-runner declaration does not accurately describe all runtime failure results.

1 open issue
What changed in this PR

Establishes strict TypeScript checking for extension Node modules while preserving the existing plugin entry point and installation workflow.

Changes:

  • Adds typed remote-branch lookup source and committed JavaScript output.
  • Integrates module compilation, linting, and type checking into Hub commands.
  • Extends freshness checks beyond browser assets and documents the contributor workflow.
File Description
hub/​package.json Adds module compilation and extends checks.
hub/​eslint.config.ts Includes extension TypeScript in linting.
hub/​docs/​prototype-canvas.md Documents source editing and rebuilding.
eslint.config.mjs Adapts extension lint patterns for root use.
.github/​extensions/​replica-prototype/​tsconfig.json Defines strict extension compiler settings.
.github/​extensions/​replica-prototype/​run-command/​index.d.mts Declares the JavaScript command runner’s types.
.github/​extensions/​replica-prototype/​read-remote-branch/​index.mts Adds typed remote-branch lookup source.
.github/​extensions/​replica-prototype/​read-remote-branch/​index.mjs Commits generated runtime JavaScript.
.github/​extensions/​replica-prototype/​check-assets/​index.test.mjs Covers generated modules outside browser assets.
.github/​extensions/​replica-prototype/​check-assets/​index.mjs Expands freshness checks to the plugin directory.

Review effort: Max

@lukasoppermann
lukasoppermann added this pull request to stack #58 October 21, 2026 13:49
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9d7306a9-9831-4c78-89e7-3c5b581c895e
@lukasoppermann
lukasoppermann merged commit 1f4670d into main Oct 22, 2026
41 checks passed
@lukasoppermann
lukasoppermann deleted the lukasoppermann-canvas-typescript-foundation branch October 22, 2026 06:06
lukasoppermann added a commit that referenced this pull request Oct 22, 2026
<!-- Use a conventional commit-style title, such as "fix(hub): retain
prototype history". -->

## Why

<!-- Explain the problem and why this change matters in a short,
plain-English paragraph. Link the issue when applicable. -->

Continue the canvas extension's TypeScript migration on top of #51.
Shared command, storage, and repository helpers need compiler-checked
implementations before the remaining workflows can migrate without
relying on declarations for JavaScript behavior.

## What changes

<!-- Describe what becomes different for a first-time reader. Explain
necessary terms. Include accurate Mermaid diagrams when they clarify the
proposal, using before/after diagrams when helpful. Add screenshots for
meaningful UI changes. -->
<!-- Omit validation sections, checklists, and routine test/CI summaries
such as "CI is green" or "tests passed". Mention only known verification
gaps that affect the change, not disclaimers about drafting this
description. -->

Move command execution, private storage, state-file reads and writes,
and repository identity and context to strict TypeScript sources. Remove
the temporary command declaration and share a checked error-code reader.
Parsed storage data remains unknown until its consuming workflow checks
the fields it uses; this change does not introduce a new stored-data
format.

Keep the generated runnable `.mjs` modules committed, with the same host
entry point and no compiler or package installation required for plugin
consumers. The module build now formats every compiler-emitted runtime
file rather than naming a single module. Reuse Hub's locked Node types
and document the migration boundary. Hub clients, publishing and review
workflows, servers, browser assets, and SDK registration remain outside
this layer.

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 9d7306a9-9831-4c78-89e7-3c5b581c895e
Copilot-Session: 1aff284a-77f1-4bcf-8245-e30889a2f392
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.

3 participants