Skip to content

Commit

Permalink
🔖 Release v1.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
ewen-lbh committed Apr 14, 2024
1 parent f87b3f3 commit 2326044
Show file tree
Hide file tree
Showing 12 changed files with 51 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [1.1.0] - 2024-04-14

### Added

- exporters: run custom shell commands before and after the build, and/or after each work is built.
Expand Down Expand Up @@ -53,10 +55,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Initial release

[Unreleased]: https://github.com/ortfo/db/compare/v1.0.0...HEAD
[1.1.0]: https://github.com/ortfo/db/-/releases/tag/v1.1.0
[1.0.0]: https://github.com/ortfo/db/compare/v0.3.2...v1.0.0
[0.3.2]: https://github.com/ortfo/db/compare/v0.3.1...v0.3.2
[0.3.1]: https://github.com/ortfo/db/compare/v0.3.0...v0.3.1
[0.3.0]: https://github.com/ortfo/db/compare/v0.2.0...v0.3.0
[0.2.0]: https://github.com/ortfo/db/releases/tag/v0.2.0

[//]: # (C3-2-DKAC:GGH:Rortfo/db:Tv{t})

[unreleased]: https://github.com/ortfo/db/-/compare/v1.1.0...main
2 changes: 1 addition & 1 deletion meta.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
package ortfodb

const Version = "1.0.0"
const Version = "1.1.0"
30 changes: 27 additions & 3 deletions packages/python/ortfodb/configuration.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import List, Any, TypeVar, Callable, Type, cast
from typing import List, Any, Dict, Optional, TypeVar, Callable, Type, cast


T = TypeVar("T")
Expand All @@ -24,6 +24,25 @@ def from_int(x: Any) -> int:
return x


def from_dict(f: Callable[[Any], T], x: Any) -> Dict[str, T]:
assert isinstance(x, dict)
return { k: f(v) for (k, v) in x.items() }


def from_none(x: Any) -> Any:
assert x is None
return x


def from_union(fs, x):
for f in fs:
try:
return f(x)
except:
pass
assert False


def to_class(c: Type[T], x: Any) -> dict:
assert isinstance(x, c)
return cast(Any, x).to_dict()
Expand Down Expand Up @@ -163,6 +182,7 @@ def to_dict(self) -> dict:

class Configuration:
build_metadata_file: str
exporters: Optional[Dict[str, Dict[str, Any]]]
extract_colors: ExtractColors
make_gifs: MakeGifs
make_thumbnails: MakeThumbnails
Expand All @@ -172,8 +192,9 @@ class Configuration:
tags: Tags
technologies: Technologies

def __init__(self, build_metadata_file: str, extract_colors: ExtractColors, make_gifs: MakeGifs, make_thumbnails: MakeThumbnails, media: Media, projects_at: str, scattered_mode_folder: str, tags: Tags, technologies: Technologies) -> None:
def __init__(self, build_metadata_file: str, exporters: Optional[Dict[str, Dict[str, Any]]], extract_colors: ExtractColors, make_gifs: MakeGifs, make_thumbnails: MakeThumbnails, media: Media, projects_at: str, scattered_mode_folder: str, tags: Tags, technologies: Technologies) -> None:
self.build_metadata_file = build_metadata_file
self.exporters = exporters
self.extract_colors = extract_colors
self.make_gifs = make_gifs
self.make_thumbnails = make_thumbnails
Expand All @@ -187,6 +208,7 @@ def __init__(self, build_metadata_file: str, extract_colors: ExtractColors, make
def from_dict(obj: Any) -> 'Configuration':
assert isinstance(obj, dict)
build_metadata_file = from_str(obj.get("build metadata file"))
exporters = from_union([lambda x: from_dict(lambda x: from_dict(lambda x: x, x), x), from_none], obj.get("exporters"))
extract_colors = ExtractColors.from_dict(obj.get("extract colors"))
make_gifs = MakeGifs.from_dict(obj.get("make gifs"))
make_thumbnails = MakeThumbnails.from_dict(obj.get("make thumbnails"))
Expand All @@ -195,11 +217,13 @@ def from_dict(obj: Any) -> 'Configuration':
scattered_mode_folder = from_str(obj.get("scattered mode folder"))
tags = Tags.from_dict(obj.get("tags"))
technologies = Technologies.from_dict(obj.get("technologies"))
return Configuration(build_metadata_file, extract_colors, make_gifs, make_thumbnails, media, projects_at, scattered_mode_folder, tags, technologies)
return Configuration(build_metadata_file, exporters, extract_colors, make_gifs, make_thumbnails, media, projects_at, scattered_mode_folder, tags, technologies)

def to_dict(self) -> dict:
result: dict = {}
result["build metadata file"] = from_str(self.build_metadata_file)
if self.exporters is not None:
result["exporters"] = from_union([lambda x: from_dict(lambda x: from_dict(lambda x: x, x), x), from_none], self.exporters)
result["extract colors"] = to_class(ExtractColors, self.extract_colors)
result["make gifs"] = to_class(MakeGifs, self.make_gifs)
result["make thumbnails"] = to_class(MakeThumbnails, self.make_thumbnails)
Expand Down
2 changes: 1 addition & 1 deletion packages/python/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ortfodb"
version = "1.0.0"
version = "1.1.0"
description = "ortfodb client library"
authors = ["Ewen Le Bihan <[email protected]>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion packages/rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ortfodb"
version = "1.0.0"
version = "1.1.0"
edition = "2021"
description = "An ortfodb (https://github.com/ortfo/db) client library for Rust."
license = "MIT"
Expand Down
3 changes: 3 additions & 0 deletions packages/rust/src/configuration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,15 @@
// }

use serde::{Serialize, Deserialize};
use std::collections::HashMap;

#[derive(Serialize, Deserialize)]
pub struct Configuration {
#[serde(rename = "build metadata file")]
pub build_metadata_file: String,

pub exporters: Option<HashMap<String, HashMap<String, Option<serde_json::Value>>>>,

#[serde(rename = "extract colors")]
pub extract_colors: ExtractColors,

Expand Down
2 changes: 1 addition & 1 deletion packages/typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ortfo/db",
"version": "1.0.0",
"version": "1.1.0",
"description": "ortfodb client library",
"scripts": {
"build": "tsc -p tsconfig.json --declaration --outDir dist"
Expand Down
2 changes: 2 additions & 0 deletions packages/typescript/src/configuration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@

export interface Configuration {
"build metadata file": string;
exporters?: { [key: string]: { [key: string]: any } };
"extract colors": ExtractColors;
"make gifs": MakeGifs;
"make thumbnails": MakeThumbnails;
Expand Down Expand Up @@ -216,6 +217,7 @@ function r(name: string) {
const typeMap: any = {
"Configuration": o([
{ json: "build metadata file", js: "build metadata file", typ: "" },
{ json: "exporters", js: "exporters", typ: u(undefined, m(m("any"))) },
{ json: "extract colors", js: "extract colors", typ: r("ExtractColors") },
{ json: "make gifs", js: "make gifs", typ: r("MakeGifs") },
{ json: "make thumbnails", js: "make thumbnails", typ: r("MakeThumbnails") },
Expand Down
8 changes: 7 additions & 1 deletion schemas/configuration.schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/ortfo/db/v1.0.0/schemas/configuration.schema.json",
"$id": "https://raw.githubusercontent.com/ortfo/db/v1.1.0/schemas/configuration.schema.json",
"$ref": "#/$defs/Configuration",
"$defs": {
"Configuration": {
Expand Down Expand Up @@ -58,6 +58,12 @@
},
"projects at": {
"type": "string"
},
"exporters": {
"additionalProperties": {
"type": "object"
},
"type": "object"
}
},
"additionalProperties": false,
Expand Down
2 changes: 1 addition & 1 deletion schemas/database.schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/ortfo/db/v1.0.0/schemas/database.schema.json",
"$id": "https://raw.githubusercontent.com/ortfo/db/v1.1.0/schemas/database.schema.json",
"$ref": "#/$defs/Database",
"$defs": {
"AnalyzedWork": {
Expand Down
2 changes: 1 addition & 1 deletion schemas/tags.schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/ortfo/db/v1.0.0/schemas/tags.schema.json",
"$id": "https://raw.githubusercontent.com/ortfo/db/v1.1.0/schemas/tags.schema.json",
"$ref": "#/$defs/tags",
"$defs": {
"Tag": {
Expand Down
2 changes: 1 addition & 1 deletion schemas/technologies.schema.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://raw.githubusercontent.com/ortfo/db/v1.0.0/schemas/technologies.schema.json",
"$id": "https://raw.githubusercontent.com/ortfo/db/v1.1.0/schemas/technologies.schema.json",
"$ref": "#/$defs/technologies",
"$defs": {
"Technology": {
Expand Down

0 comments on commit 2326044

Please sign in to comment.