sporeprotocol / spore-sdk

The Ultimate TypeScript SDK for Spore Protocol
https://docs.spore.pro
MIT License
12 stars 10 forks source link

Select default scripts by tags #65

Closed ShookLyngs closed 8 months ago

ShookLyngs commented 8 months ago

Currently we have specified a tags field in each version of the SporeScript, like the following:

{
  Spore: {
    versions: [
      {
        tags: ['v2', 'preview'],
        script: { ... },
        cellDep: { ... }
      },
      {
        tags: ['v1'],
        script: { ... },
        cellDep: { ... }
      },
    ]
  }
}

But no tag was used during the lifecycle of Spore/Cluster ... I'm planning to support filtering SporeScripts with tags, a draft:

getSporeScript(config, 'Spore') // select the latest Spore script
getSporeScriptWithTags(config, 'Spore', ['v1']) // select the latest v2 Spore script
getSporeScriptWithTags(config, 'Spore', ['preview']) // select the latest preview Spore script