Skip to content

feat: enable auto-update of JSON schemas from https://schemas.elgato.com - #76

Merged
GeekyEggo merged 6 commits into
mainfrom
remove-pkg-manager
Aug 13, 2026
Merged

feat: enable auto-update of JSON schemas from https://schemas.elgato.com#76
GeekyEggo merged 6 commits into
mainfrom
remove-pkg-manager

Conversation

@GeekyEggo

@GeekyEggo GeekyEggo commented Aug 11, 2026

Copy link
Copy Markdown
Member
  • Replaced auto-update of schemas to use https://schemas.elgato.com.
    • When called within the CLI, the same update rules apply as before.
    • When called programmatically, an update check will occur every time.
  • Removed local package manager caching and management.
  • Included @elgato/schemas in the bundling.
  • Removed unused tar dependency.

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.

Pull request overview

This PR updates the Stream Deck plugin validation flow to load JSON schemas from https://schemas.elgato.com with a local cache fallback, while bundling @elgato/schemas for default schemas and removing the prior “local package manager” update mechanism.

Changes:

  • Introduces a schema store that can resolve schemas from bundled defaults, local cache, and remote (schemas.elgato.com) with version comparison.
  • Refactors plugin validation to accept schemas via options (instead of dynamic importing schemas inside validation).
  • Simplifies packaging by bundling @elgato/schemas and removing tar (and schema auto-update via npm install).

Reviewed changes

Copilot reviewed 11 out of 12 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/validation/plugin/schemas.ts Adds getJsonSchemas to load plugin schemas via schemaStore with optional update checks.
src/validation/plugin/plugin.ts Refactors plugin context creation to accept schemas via PluginValidationOptions.
src/validation/plugin/options.ts Introduces PluginValidationOptions (path + schemas).
src/validation/plugin/index.ts Updates validatePlugin to accept PluginValidationOptions.
src/json/store.ts Adds schema caching + remote fetch logic with version-based selection.
src/index.ts Keeps public validateStreamDeckPlugin(path) API, always performing update checks when called programmatically.
src/config.ts Splits config file path logic by introducing getFileStoreDir().
src/commands/validate.ts Switches CLI validation to fetch schemas via getJsonSchemas instead of npm-based updating.
src/package-manager.ts Removes package update/install logic, retaining only CLI version reporting.
rolldown.config.ts Bundles @elgato/schemas by removing it from external.
package.json Removes tar dependency.
package-lock.json Lockfile updates reflecting removal of tar and related transitive deps.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/validation/plugin/schemas.ts
Comment thread src/json/store.ts
Comment thread src/validation/plugin/index.ts

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.

Pull request overview

Copilot reviewed 12 out of 13 changed files in this pull request and generated no new comments.

Suppressed comments (3)

src/json/store.ts:96

  • Directory creation is outside the best-effort cache-write try block. If the config directory cannot be created (for example, under a read-only home directory), this rejection escapes schemaStore.get and prevents validation even though a usable remote schema was already loaded. Keep mkdir inside the same error boundary as writeFile.
	if (!existsSync(filePath)) {
		await mkdir(dirname(filePath), { recursive: true });

src/json/store.ts:118

  • This remote update check has no finite timeout, and the programmatic validation API invokes it on every call. A stalled schema service can therefore delay or hang validation instead of falling back to the cached/bundled schema as intended. Add an abort timeout (with the existing catch handling the fallback).
		const res = await fetch(url);

src/validation/plugin/schemas.ts:24

  • The two schema loads are independent, but these inline awaits serialize both cache reads and remote requests. Because the public API now checks remotely on every call, validation pays the sum of both request latencies; start both operations together with Promise.all.
export async function getJsonSchemas({ updateCheck }: Options): Promise<PluginJsonSchemas> {
	return {
		layout: await schemaStore.get({

@GeekyEggo
GeekyEggo merged commit 44190f8 into main Aug 13, 2026
4 checks passed
@GeekyEggo
GeekyEggo deleted the remove-pkg-manager branch August 13, 2026 09:50
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