Conversation
There was a problem hiding this comment.
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 installinvocation bug in the CLI Portal extension discovery service. - Adds the new
beam-portal-toolkitpackage (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.
beam-portal-toolkit/src/portal.ts
Outdated
| // Portal plugin registration utilities. | ||
| // Import via: import { Portal } from '@beamable/portal-toolkit'; | ||
|
|
||
| import { BeamBase } from "beamable-sdk"; |
There was a problem hiding this comment.
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.
| import { BeamBase } from "beamable-sdk"; | |
| import { BeamBase } from 'beamable-sdk'; |
| * - web-types.json (JetBrains IDE autocomplete) | ||
| * - src/globals.ts (TypeScript HTMLElementTagNameMap augmentations) | ||
| * - src/svelte-elements.ts (Svelte SvelteHTMLElements augmentations) |
There was a problem hiding this comment.
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.
| * - 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) |
| "files": [ | ||
| "dist", | ||
| "custom-elements.json", | ||
| "src/generated" | ||
| ], |
There was a problem hiding this comment.
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.
beam-portal-toolkit/package.json
Outdated
| "types": "./dist/types/svelte-elements.d.ts" | ||
| }, | ||
| "./custom-elements.json": "./custom-elements.json", | ||
| "./web-types.json": "./web-types.json" |
There was a problem hiding this comment.
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).
| "./web-types.json": "./web-types.json" | |
| "./web-types.json": "./src/generated/web-types.json" |
beam-portal-toolkit/web-types.json
Outdated
| { | ||
| "$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": { |
There was a problem hiding this comment.
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.
|
Lightbeam link |
|
Lightbeam link |
…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>
|
Lightbeam link |
|
Lightbeam link |
|
Lightbeam link |
|
Web SDK Sample Build link |
|
Lightbeam link |
No description provided.