Skip to content

Commit

Permalink
feat: remove source field
Browse files Browse the repository at this point in the history
  • Loading branch information
futrime committed Feb 2, 2024
1 parent 7e48014 commit aa33d7f
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 23 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Removed

- `source` field in `tooth.json`.

## [0.19.0] - 2024-01-20

### Added
Expand Down
7 changes: 2 additions & 5 deletions docs/tooth_json_file_reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ A tooth.json includes directives as shown in the following example. These are de
"tags": [
"example"
],
"avatar_url": "avatar.png",
"source": "github.com/lippkg/example"
"avatar_url": "avatar.png"
},
"asset_url": "https://github.com/tooth-hub/example/releases/download/v1.0.0/example-1.0.0.zip",
"commands": {
Expand Down Expand Up @@ -166,7 +165,6 @@ Provide information about your tooth in the form of a JSON object with the follo
- `author`: (required) the author of your tooth.
- `tags`: (required) an array of tags of your tooth.
- `avatar_url`: the URL of the tooth's avatar. If not set, the default avatar will be used. If a relative path is provided, it will be regarded as a path relative to **the source repository path**.
- `source`: the source repository of your tooth. If not set, the tooth repository path will be used.

### Examples

Expand All @@ -179,8 +177,7 @@ Provide information about your tooth in the form of a JSON object with the follo
"tags": [
"example"
],
"avartar_url": "",
"source": "github.com/lippkg/example"
"avartar_url": ""
}
}
```
Expand Down
1 change: 0 additions & 1 deletion docs/tutorials/create_a_lip_tooth.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ You can create a tooth.json like this:
"name": "Example World",
"description": "An example world",
"author": "Example User",
"source": "github.com/lippkg/example",
"tags": [
"ll", "llbds", "bds"
]
Expand Down
1 change: 0 additions & 1 deletion internal/cmd/cmdlipshow/cmdlipshow.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ func show(ctx *context.Context, toothRepoPath string,
{"Name", metadata.Info().Name},
{"Description", metadata.Info().Description},
{"Author", metadata.Info().Author},
{"Source", metadata.Info().Source},
{"Tags", strings.Join(metadata.Info().Tags, ", ")},
{"Version", metadata.Version().String()},
}...)
Expand Down
6 changes: 0 additions & 6 deletions internal/cmd/cmdliptoothinit/cmdliptoothinit.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ var metadataTemplate = tooth.RawMetadata{
Name: "",
Description: "",
Author: "",
Source: "",
Tags: []string{},
},
}
Expand Down Expand Up @@ -118,11 +117,6 @@ func initTooth(ctx *context.Context) error {
ans = scanner.Text()
rawMetadata.Info.Author = ans

log.Info("What is the source code repo path (leave empty if identical to tooth repo path)?")
scanner.Scan()
ans = scanner.Text()
rawMetadata.Info.Source = ans

metadata, err := tooth.MakeMetadataFromRaw(rawMetadata)
if err != nil {
return fmt.Errorf("failed to make metadata: %w", err)
Expand Down
3 changes: 0 additions & 3 deletions internal/tooth/jsonshema.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ const metadataJSONSchema = `{
},
"avatar_url": {
"type": "string"
},
"source": {
"type": "string"
}
},
"required": [
Expand Down
1 change: 0 additions & 1 deletion internal/tooth/metadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ type Info struct {
Description string
Author string
Tags []string
Source string
}
type Commands struct {
PreInstall []string
Expand Down
2 changes: 0 additions & 2 deletions internal/tooth/migration/v1tov2/v1tov2.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ type RawMetadataInfo struct {
Description string `json:"description"`
Author string `json:"author"`
Tags []string `json:"tags"`
Source string `json:"source,omitempty"`
}

type RawMetadataCommands struct {
Expand Down Expand Up @@ -228,7 +227,6 @@ func Migrate(jsonBytes []byte) ([]byte, error) {
Name: v1RawMetadata.Information.Name,
Description: v1RawMetadata.Information.Description,
Author: v1RawMetadata.Information.Author,
Source: "",
Tags: make([]string, 0),
},
Commands: RawMetadataCommands{
Expand Down
1 change: 0 additions & 1 deletion internal/tooth/rawmetadata.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ type RawMetadataInfo struct {
Description string `json:"description"`
Author string `json:"author"`
Tags []string `json:"tags"`
Source string `json:"source,omitempty"`
}

type RawMetadataCommands struct {
Expand Down
3 changes: 0 additions & 3 deletions schemas/tooth.v2.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,6 @@
},
"avatar_url": {
"type": "string"
},
"source": {
"type": "string"
}
},
"required": [
Expand Down

0 comments on commit aa33d7f

Please sign in to comment.