feat(spec): version field (#85)

Adds a `version` field to the `jsonnetfile.json`, so that `jb` can automatically recognize too old / too new schema versions, instead of panicking.
This commit is contained in:
Matthias Loibl 2020-02-28 17:41:49 +01:00 committed by GitHub
parent efe0c9e864
commit bcd89fd33d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 454 additions and 102 deletions

View file

@ -28,8 +28,8 @@ import (
"github.com/pkg/errors"
"github.com/jsonnet-bundler/jsonnet-bundler/pkg/jsonnetfile"
"github.com/jsonnet-bundler/jsonnet-bundler/spec"
"github.com/jsonnet-bundler/jsonnet-bundler/spec/deps"
v1 "github.com/jsonnet-bundler/jsonnet-bundler/spec/v1"
"github.com/jsonnet-bundler/jsonnet-bundler/spec/v1/deps"
)
var (
@ -49,7 +49,7 @@ var (
//
// Finally, all unknown files and directories are removed from vendor/
// The full list of locked depedencies is returned
func Ensure(direct spec.JsonnetFile, vendorDir string, oldLocks map[string]deps.Dependency) (map[string]deps.Dependency, error) {
func Ensure(direct v1.JsonnetFile, vendorDir string, oldLocks map[string]deps.Dependency) (map[string]deps.Dependency, error) {
// ensure all required files are in vendor
// This is the actual installation
locks, err := ensure(direct.Dependencies, vendorDir, oldLocks)