Skip to content

Commit

Permalink
Clean up. Clean up README.md and transfered some documentation in .docs.
Browse files Browse the repository at this point in the history
  • Loading branch information
jnbdz committed Oct 30, 2024
1 parent 8e3efc7 commit 1300853
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 42 deletions.
13 changes: 13 additions & 0 deletions .docs/entity.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,3 +93,16 @@ _body:
_body:
title: Hello World!
```

### Create Entity
1. Create repository
2. Make a dot directory with the collection name at the root of the repository:
- `mkdir -p .<collection name>`
3. Make `.hery` configuration file with the collection name at the root of the repository
- `touch <collection name>.hery`
4. Make a `schema.json` configuration file in the `.<collection name>` directory
- `touch ./.<collection name>/schema.json`
5. Add the content in `.hery` configuration file and the `schema.json` [JSON-Schema](https://json-schema.org/)
6. Add it in git:
- `git add .`
- `git commit -m "Batman"`
22 changes: 20 additions & 2 deletions .docs/version.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,23 @@
# Version | Docs | HERY
The version numbering follows the same as [Golang's](https://go.dev/doc/modules/version-numbers) standard.

The versions are set in the tags in a Git repo. If no version is found then a pseudo-version number will be generated
just like in [Golang](https://go.dev/doc/modules/version-numbers#pseudo-version-number).
The versions are set in the tags in a Git repo. If no version is found then a pseudo-version number will be generated
just like in [Golang](https://go.dev/doc/modules/version-numbers#pseudo-version-number).

## Entity version numbering
HERY follows the same [versioning standard as Golang](https://go.dev/doc/modules/version-numbers).

| Version stage | Example | Description |
|---------------------------------------|----------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| In development | Automatic pseudo-version number `v0.0.0-20170915032832-14c0d48ead0c` | Indicates that the module is currently **in development and is considered unstable**. This release does not offer backward compatibility or stability assurances. |
| Major version | `v1.x.x` | Indicates **public API changes that are not backward-compatible**. This release does not guarantee compatibility with previous major versions. |
| Minor version | `vx.4.x` | Indicates **public API changes that are backward-compatible**. This release guarantees both backward compatibility and stability. |
| Patch version | `vx.x.1` | Indicates **changes that do not impact the module's public API or its dependencies**. This release ensures backward compatibility and stability. |
| Pre-release version (alpha, beta, rc) | `vx.x.x-beta.2` | Indicates that this is a **pre-release milestone, such as an alpha or beta version**. This release does not offer any stability guarantees. |

## Manage Tag Versioning
Steps to add a tag:
```bash
git tag -a v1.0.0-alpha.1
git push --tags
```
43 changes: 3 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ HERY does not require a lot of learning to get started. All you need to know is
commands and understand some of the basics of the query language.

### `.hery` File Format
The `.hery` file format is the same as a `.yml`/`.yaml` file. The reason the extension is different is so that `hery`
CLI is able to find it and so that IDEs can have better support.
The `.hery` file format is the same as a `.yml`/`.yaml` file format. The reason the extension is different is so that
`hery` CLI is able to find it and so that IDEs can have better support.

HERY format comes with four different reserved properties:
- `_meta` - For metadata for the relative entity
Expand Down Expand Up @@ -61,7 +61,7 @@ is ignored.
### Caching
Since the querying on YAML files would be a bit slow and resource demanding, SQLite is used to store all the entities.

Each entity has its own table and it is found: `~/.hery/collection/<collection name>/<collection name>.cache`.
Each entity has its own table, and it is found: `~/.hery/collection/<collection name>/<collection name>.cache`.

### Basic Commands
To verify that it was installed properly:
Expand Down Expand Up @@ -112,47 +112,10 @@ To get more details on the functioning and commands: [.docs](.docs).

       ![Atom icon](https://raw.githubusercontent.com/SiteNetSoft/resources/master/images/ide/x14/atom.png) [Atom](.editor/atom.yml) - ([GitHub](https://github.com/AmadlaOrg/hery-atom-editor-plugin))

### Create Entity
1. Create repository
2. Make a dot directory with the collection name at the root of the repository:
- `mkdir -p .<collection name>`
3. Make `.hery` configuration file with the collection name at the root of the repository
- `touch <collection name>.hery`
4. Make a `schema.json` configuration file in the `.<collection name>` directory
- `touch ./.<collection name>/schema.json`
5. Add the content in `.hery` configuration file and the `schema.json` [JSON-Schema](https://json-schema.org/)
6. Add it in git:
- `git add .`
- `git commit -m "Batman"`

### Manage Tag Versioning
Steps to add a tag:
```bash
git tag -a v1.0.0-alpha.1
git push --tags
```

### Entity version numbering
HERY follows the same [versioning standard as Golang](https://go.dev/doc/modules/version-numbers).

| Version stage | Example | Description |
|---------------------------------------|----------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| In development | Automatic pseudo-version number `v0.0.0-20170915032832-14c0d48ead0c` | Indicates that the module is currently **in development and is considered unstable**. This release does not offer backward compatibility or stability assurances. |
| Major version | `v1.x.x` | Indicates **public API changes that are not backward-compatible**. This release does not guarantee compatibility with previous major versions. |
| Minor version | `vx.4.x` | Indicates **public API changes that are backward-compatible**. This release guarantees both backward compatibility and stability. |
| Patch version | `vx.x.1` | Indicates **changes that do not impact the module's public API or its dependencies**. This release ensures backward compatibility and stability. |
| Pre-release version (alpha, beta, rc) | `vx.x.x-beta.2` | Indicates that this is a **pre-release milestone, such as an alpha or beta version**. This release does not offer any stability guarantees. |

### Giving Credit
The `.pairs` file is a great way to add details about the people that contributed to the entity. There is one used in
this repository that can be used as reference.

### Check dependencies
Useful to check that libraries for testing and development don't find themselves in the build version of the project:
```bash
go list -f '{{.Deps}}' ./main.go
```

> TODO: Create a script to blacklist certain libraries.
> Also useful for security.

Expand Down
12 changes: 12 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# TODO
[ ] Making pseudo versioning portable (will making caching a higher authority)
[ ] Pseudo version first part (v0.0.0) should this following the previous tagging version

## Notes
### Check dependencies
This would be good to have this in the pipeline.

Useful to check that libraries for testing and development don't find themselves in the build version of the project:
```bash
go list -f '{{.Deps}}' ./main.go
```
17 changes: 17 additions & 0 deletions entity/version/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,23 @@ type SVersion struct {
}

// Extract extracts the version from a go get URI.
//
// There are three types of versions that can be extracted:
// 1. Normal version (e.g.: v1.0.1, vx.x.x-beta.2)
// 2. Pseudo version (e.g.: v0.0.0-20240924093300-abcd1234efgh)
// 3. latest version (set or not set after the `@`)
//
// Normal version is detailed in the README at the root of the project and https://go.dev/doc/modules/version-numbers
// More information can also be found in: ./docs/version.md
//
// Pseudo version:
// - The first part will always contain: v0.0.0 // TODO: Golang seems the contain numbers at times... Maybe after a new commit following the most recent tagging of a version
// - The second part after the dash `-` is the date of when the entity was downloaded (for this reason it is "dynamic" and changing from one host to another) // TODO: Maybe this needs to be changed for the caching to be portable with pseudo versions. Second way: check the hash in the caching and then use the dating in the caching when it is re-downloaded (but this would make caching more of a higher authority)
// - The third part after the second dash `-` is a portion of the hash of the git commit that was downloaded (static and portable)
//
// The version type `latest` in two different ways:
// - If no version found the caller needs to check for the error type `ErrorExtractNoVersionFound` and determine if to set the entity version to `latest` or not
// - If it was set to then out put it as such
func (s *SVersion) Extract(url string) (string, error) {
versionAnnotationCount := strings.Count(url, "@")
if versionAnnotationCount > 1 {
Expand Down

0 comments on commit 1300853

Please sign in to comment.