Skip to content

portal toolkit package#4553

Merged
cdhanna merged 11 commits intomainfrom
portal-toolkit
Apr 1, 2026
Merged

portal toolkit package#4553
cdhanna merged 11 commits intomainfrom
portal-toolkit

Conversation

@cdhanna
Copy link
Copy Markdown
Collaborator

@cdhanna cdhanna commented Mar 26, 2026

No description provided.

Copilot AI review requested due to automatic review settings March 26, 2026 20:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR introduces a new @beamable/portal-toolkit package intended to support Beamable Portal extensions (plugin registration utilities + web component typings), updates the Portal extension template to reference the new typings, and tweaks release workflows.

Changes:

  • Fixes a Linux/macOS npm install invocation bug in the CLI Portal extension discovery service.
  • Adds the new beam-portal-toolkit package (build config, generated typings, sync script, metadata files).
  • Updates GitHub Actions workflows to compute versions and publish to npm (plus adds a new Portal Toolkit release workflow).

Reviewed changes

Copilot reviewed 11 out of 17 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
cli/cli/Services/PortalExtension/PortalExtensionDiscoveryService.cs Fixes npm command invocation for non-Windows installs.
cli/beamable.templates/templates/PortalExtensionApp/src/app.d.ts Adds Svelte type reference to Portal Toolkit.
beam-portal-toolkit/package.json Defines the new toolkit package metadata/exports/scripts.
beam-portal-toolkit/pnpm-lock.yaml Locks toolkit dependencies.
beam-portal-toolkit/tsconfig.json Toolkit TypeScript compiler configuration.
beam-portal-toolkit/tsdown.config.ts Toolkit build/type generation configuration.
beam-portal-toolkit/src/index.ts Toolkit entry point (re-exports + global augmentations import).
beam-portal-toolkit/src/portal.ts Portal plugin registration utility API.
beam-portal-toolkit/custom-elements.json Custom Elements Manifest used to generate typings/metadata.
beam-portal-toolkit/src/generated/globals.ts Generated HTMLElementTagNameMap and element interfaces.
beam-portal-toolkit/src/generated/svelte-elements.ts Generated Svelte element typings augmentation.
beam-portal-toolkit/src/generated/web-types.json Generated JetBrains web-types metadata.
beam-portal-toolkit/scripts/sync-components.mjs Script to regenerate manifest-derived typings/metadata.
beam-portal-toolkit/web-types.json Adds a second web-types file at package root (currently inconsistent with generated one).
beam-portal-toolkit/.gitignore Toolkit-local ignore rules.
.github/workflows/release-web.yml Adds computed versioning + npm publish step (with provenance).
.github/workflows/release-portal-toolkit.yml New workflow to publish @beamable/portal-toolkit to npm.
Files not reviewed (1)
  • beam-portal-toolkit/pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

// Portal plugin registration utilities.
// Import via: import { Portal } from '@beamable/portal-toolkit';

import { BeamBase } from "beamable-sdk";
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

In this new package, other files use single quotes for imports (e.g. src/index.ts, tsdown.config.ts), but this file uses double quotes. Please standardize quoting to match the package’s prevailing style to avoid churn in future diffs.

Suggested change
import { BeamBase } from "beamable-sdk";
import { BeamBase } from 'beamable-sdk';

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +8
* - web-types.json (JetBrains IDE autocomplete)
* - src/globals.ts (TypeScript HTMLElementTagNameMap augmentations)
* - src/svelte-elements.ts (Svelte SvelteHTMLElements augmentations)
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

The header comment lists outputs as web-types.json, src/globals.ts, and src/svelte-elements.ts, but the script actually writes into src/generated/*. Update the comment to match the real output paths so future maintainers don’t look for the generated files in the wrong place.

Suggested change
* - web-types.json (JetBrains IDE autocomplete)
* - src/globals.ts (TypeScript HTMLElementTagNameMap augmentations)
* - src/svelte-elements.ts (Svelte SvelteHTMLElements augmentations)
* - src/generated/web-types.json (JetBrains IDE autocomplete)
* - src/generated/globals.ts (TypeScript HTMLElementTagNameMap augmentations)
* - src/generated/svelte-elements.ts (Svelte SvelteHTMLElements augmentations)

Copilot uses AI. Check for mistakes.
Comment on lines +16 to +20
"files": [
"dist",
"custom-elements.json",
"src/generated"
],
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

files only publishes dist, custom-elements.json, and src/generated, but this package also defines an exports["./web-types.json"] entry. As-is, web-types.json at the package root won’t be included in the published tarball, so consumers will get a missing-file error when resolving that export. Either add web-types.json to files, or (preferably) update/remove the export and rely on the existing web-types field that already points at src/generated/web-types.json.

Copilot uses AI. Check for mistakes.
"types": "./dist/types/svelte-elements.d.ts"
},
"./custom-elements.json": "./custom-elements.json",
"./web-types.json": "./web-types.json"
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

exports["./web-types.json"] currently points to ./web-types.json, but the package’s web-types metadata points to src/generated/web-types.json (and that’s the one included via files). This mismatch will confuse consumers/tooling; align these by exporting the generated path (or drop the explicit export if it’s not needed).

Suggested change
"./web-types.json": "./web-types.json"
"./web-types.json": "./src/generated/web-types.json"

Copilot uses AI. Check for mistakes.
Comment on lines +1 to +7
{
"$schema": "https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json",
"name": "@beamable/portal-toolkit",
"version": "0.1.0",
"js-types-syntax": "typescript",
"description-markup": "markdown",
"contributions": {
Copy link

Copilot AI Mar 26, 2026

Choose a reason for hiding this comment

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

This web-types.json appears to be a stale/manual copy: it reports version 0.1.0 while the package is 0.1.1, and its element descriptions differ from the generated src/generated/web-types.json. Keeping both copies risks IDEs picking up the wrong metadata; remove this file or regenerate it from the same source/version as src/generated/web-types.json.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown
Contributor

Lightbeam link

@github-actions
Copy link
Copy Markdown
Contributor

Lightbeam link

chrisbeamable and others added 3 commits March 31, 2026 07:58
…on export path

- vite.ts / rollup.ts: compute SDK_GLOBAL dynamically from peerDependencies instead of hardcoding
- package.json: point ./web-types.json export to src/generated/web-types.json (was missing at root)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

Lightbeam link

@github-actions
Copy link
Copy Markdown
Contributor

Lightbeam link

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Lightbeam link

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Web SDK Sample Build link

@cdhanna cdhanna merged commit b0a5dfd into main Apr 1, 2026
21 checks passed
@cdhanna cdhanna deleted the portal-toolkit branch April 1, 2026 20:15
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 1, 2026

Lightbeam link

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