Skip to content

Clarify stance on legacy support #328

@thomashoneyman

Description

@thomashoneyman

The PureScript registry is built to support packages using the new manifest format in a .purs.json file. However, we also support importing legacy packages from bower (#215), and the API supports adding new versions of legacy packages via the legacy flag:

https://github.com/purescript/registry/blob/d69c9baf804fb7040881a5c388c2926643393bb4/v1/Operation.dhall#L10-L11

However, the spec doesn't include any mention of what support we do and do not have for "legacy" (ie. Bower or Spago pre-registry) packages. We need to clarify this.

The registry will provide some support for legacy packages for at least the first year of operation. Registry support only means that we guarantee legacy packages can be added to the registry; we do not guarantee that registry packages remain compatible with legacy package managers like Bower. We do, however, guarantee support for older versions of Spago. In practice this means that we will preserve the existing package sets repository and continue publishing package sets usable with older versions of Spago there.

A legacy package is defined as a package that is published without a .purs.json manifest file, and it can be one of two things: a project containing a bower.json file, or a project containing a spago.dhall file and accompanying packages.dhall (ie. a Spago file using a configuration format pre-registry -- not the new proposed Spago format).

A legacy package can be uploaded to the registry via an Addition or Update operation by setting legacy: true. Setting the legacy flag means that the registry will:

  1. Attempt to parse the package's legacy package files, such as bower.json, spago.dhall, and packages.dhall files, in order to create a .purs.json manifest for the package
  2. Include the generated .purs.json file in the resulting package tarball
  3. Attempt to use the legacy package files to publish the package version to Pursuit (this will fail for Spago)
  4. Attempt to use the generated .purs.json file to publish the package version to the package sets

Legacy packages cannot use monorepo setups because their version is parsed from the ref provided in the addition or update operation. Attempting to upload legacy packages via a monorepo setup will fail.


@f-f I do need your help understanding exactly what has to happen to guarantee the packages.dhall file in the package-sets repo remains compatible with old Spago clients for the next year, even as we're publishing package sets using the new package sets format in the registry. This may need its own issue to track backwards-compatible mirroring from the registry to the package sets repo.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions