webcomponents / webcomponents.org

Home of the web components community
https://www.webcomponents.org
Apache License 2.0
359 stars 95 forks source link

[catalog-server] Add Catalog.importPackage() method #1324

Closed justinfagnani closed 1 year ago

justinfagnani commented 1 year ago

Importing a package (without a version) needs to perform a number of checks and steps:

  1. Fetch the package info from the repository
  2. Check if the package was imported within the refresh interval (default to something like 5 min). Abort if so.
  3. Load the "packument" from the npm registry
  4. Compare dist-tags and versions. If the same, abort.
  5. Iterate through all changed dist tags a. Remove or add the dist-tag from PackageVersions and CustomElements as needed
  6. If "latest" dist tag has changed, and the version it points to is not imported, import that package version
  7. Write the new package info to the repository
justinfagnani commented 1 year ago

Fixed by #1329