Skip to content

Toolbar take 3#1064

Open
ryanechternacht wants to merge 17 commits into
mainfrom
toolbar-take-3
Open

Toolbar take 3#1064
ryanechternacht wants to merge 17 commits into
mainfrom
toolbar-take-3

Conversation

@ryanechternacht
Copy link
Copy Markdown
Member

ryanechternacht and others added 12 commits January 29, 2026 14:11
…olbar package

Move DeveloperToolbar class out of the JS package into a new toolbar/ package
so it can be installed as a devDependency and never bundled into production.
The JS package now uses a dynamic import() to discover the toolbar at runtime,
falling back to a console.error if not installed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add vitest infrastructure to toolbar/ (config, setup, tsconfig, eslint)
- Add 22 unit tests for DeveloperToolbar class (initialize, cleanup, overrides)
- Add 11 integration tests to js/ for SDK toolbar integration points
- Add pull_request_toolbar.yml CI workflow (build/lint/test on PRs)
- Add deploy_toolbar.yml CI workflow (publish to npm on tag)
- Update publish-package.sh and release_candidate.yml to include toolbar

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…arDependencies locally

Removes js/src/schematic-dev-toolbar.d.ts which caused api-extractor to trace
source .ts files through its imports, failing with ae-wrong-input-file-type.
Replaces the stub with an inline type cast on the dynamic import.

Defines DeveloperToolbarDependencies locally in the toolbar package so it does
not depend on the unpublished type from @schematichq/schematic-js@1.3.0.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ryanechternacht ryanechternacht requested review from a team as code owners April 3, 2026 20:27
Comment thread js/vitest.config.ts

export default defineConfig({
define: {
__DEV__: true,
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.

How does this __DEV__ property get set/used?

Copy link
Copy Markdown
Member Author

@ryanechternacht ryanechternacht Apr 13, 2026

Choose a reason for hiding this comment

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

The build scripts in package.json

    "build:browser": "npx esbuild src/browser.ts --bundle --minify --outfile=dist/schematic.browser.js --platform=browser --define:__DEV__=false",
    "build:cjs:dev": "npx esbuild src/index.ts --bundle --format=cjs --outfile=dist/schematic.dev.cjs.js --define:__DEV__=true",
    "build:cjs:prod": "npx esbuild src/index.ts --bundle --format=cjs --outfile=dist/schematic.prod.cjs.js --define:__DEV__=false",
    "build:esm:dev": "npx esbuild src/index.ts --bundle --format=esm --outfile=dist/schematic.dev.esm.js --define:__DEV__=true",
    "build:esm:prod": "npx esbuild src/index.ts --bundle --format=esm --outfile=dist/schematic.prod.esm.js --define:__DEV__=false",

Open to a different approach if you have one. The goal is to include/exclude these code paths at build time

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.

This should work since it's only defined in a test config.

@ryanechternacht ryanechternacht requested a review from tenub April 13, 2026 03:36
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.

2 participants