Skip to content

Conversation

domdomegg
Copy link
Member

Summary

Implements the field restructuring discussed in PR #295 comments from @domdomegg:

  • Remove package_type field (redundant with registry_type)
  • Rename package_typeregistry_type (indicates HOW to download)
  • Rename registry_nameregistry_base_url (uses actual URLs for clarity)
  • Remove migrate-seed script (temporary tool no longer needed)

Changes

  • Updated all schema files and documentation
  • Modified Go models, services, and validation logic
  • Updated publisher tool and test files
  • Updated seed data to new format

New Structure

{
  "registry_type": "npm",
  "registry_base_url": "https://registry.npmjs.org", 
  "identifier": "@21st-dev/magic",
  "version": "1.0.0"
}

This provides clearer semantics where registry_type tells clients how to download packages while registry_base_url provides the actual endpoint URL.

@joan-anthropic Feel free to review and decide if you want to accept these changes into your branch, then @domdomegg can merge everything to main.

joan-anthropic and others added 23 commits August 21, 2025 11:48
- Add MCPB as a new registry_name option
- Add file_hashes field to Package model for integrity verification
- Implement URL validation restricting MCPB packages to GitHub/GitLab hosts
- Require SHA-256 hash for all MCPB packages
- Add example MCPB package in documentation
- Update schemas and OpenAPI specification

Implements Option 1 from issue #260 - MCPB as an additional package type
pointing to hosted .mcpb files with cryptographic verification.
- Add hash generation during publish (can be disabled with --no-hash)
- Add verify command to check existing hashes
- Add hash-gen command to generate/update hashes
- Support NPM and direct URL (MCPB) packages
- Document implementation in docs/file-hashes.md

The CLI tool now generates SHA-256 hashes at publish time.
Registry validates these hashes to ensure package integrity.
Resolved conflicts to integrate PackageLocation changes with new server wrapper format
- Add LegacyPackage type to migrate-seed tool to handle old package format
- Fix conversion from legacy registry_name/name to new PackageLocation format
- Fix test data in import_test.go to include packages in ServerResponse
- Fix field name typo: RuntimeHint -> RunTimeHint
- Remove unused server detail handlers in test
- Replace fmt.Print with log for console output
- Make 'docker' a constant (packageTypeDocker)
- Fix file permissions from 0644 to 0600
- Convert if-else chain to switch statement
- Fix indent-error-flow by removing unnecessary else
- Add nolint comment for Docker tag format (not a port)
- Fixed indentation issues in repository and version_detail blocks
- Corrected array/object closing brackets for packages and remotes
- Ensured consistent 2-space indentation throughout all examples
- All 9 examples now pass JSON validation
- Removed file hash generation from publisher tool
- Removed MCPB hash validation requirement from registry service
- Removed file-hashes.md implementation guide
- Kept file_hashes as optional field in schema for external tools
- Publisher tool now only handles schema changes (PackageLocation)
…entifier fields

- Replace overloaded registry_name and name fields with semantic package_type, registry, and identifier fields
- Update all JSON schemas and OpenAPI specifications to reflect new structure
- Convert all 396 seed.json entries to new format
- Update publisher tool to generate new structure
- Update all examples and documentation
- Fix all tests to use new field names
- Update validation logic for new structure
Preserve the original \u003c and \u003e Unicode escapes for < and > characters
- Update model to use RegistryName instead of Registry
- Update all code references to use the new field name
- Update JSON schemas and OpenAPI spec
- Update all examples and documentation
- Update seed.json to use registry_name
Resolved conflicts by:
- Combining imports in registry_service.go (both errors and fmt/url/strings)
- Keeping package validation while adding new versioning logic
- Preserving nolint directives for ireturn in auth providers
- Using main branch's URLs in examples.md
- Updating package structure to use new fields
Remove placeholder repository IDs that were added in this PR
Fix inconsistent indentation for version and nested fields in package objects
- Fix indentation for version fields on lines 243, 296, 443, 517, 561
- Fix indentation for registry_name field on line 294
- Remove extra closing braces and fix array/object structure
- Ensure all JSON examples are valid and properly formatted
- Fix indentation for entire environment_variables blocks
- Fix indentation for package_arguments blocks
- Fix closing brace indentation on line 406
- Ensure all JSON examples have consistent 2-space indentation
- Restore original structure in import_test.go while keeping schema changes
- Keep migrate-seed test files with only schema field updates
- Remove unnecessary nolint directives from auth providers
- Maintain only essential changes for PackageType/RegistryName/Identifier schema
- Add OldPackage type to represent legacy package format
- Convert from old schema (registry_name/name) to new (package_type/registry_name/identifier)
- Use zero timestamps for seed data to distinguish from published data
- Update test data files to match expected schema formats
…e_RegistryURL

The test was failing because the ServerResponse objects in the paginated endpoint
were missing Package data that the test assertions expected. Added the appropriate
package definitions to match the test expectations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Resolved merge conflicts:
- internal/service/registry_service.go: Combined package validation with remote URL validation
- tools/publisher/main.go: Added Schema field to ServerJSON struct

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
…e_url

- Remove package_type field (redundant with registry_type)
- Rename package_type → registry_type (indicates HOW to download)
- Rename registry_name → registry_base_url (uses actual URLs for clarity)
- Remove migrate-seed script (temporary tool no longer needed)
- Update all schemas, examples, tests, and API code

This provides clearer semantics: registry_type tells clients how to download
packages while registry_base_url provides the actual endpoint URL.
@domdomegg domdomegg closed this Aug 27, 2025
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