build: add standard-version

This commit is contained in:
Lukas Obermann
2022-03-04 22:56:27 +01:00
parent 794824b643
commit 4e763c7bdc
5 changed files with 3765 additions and 51 deletions
+3
View File
@@ -0,0 +1,3 @@
{
"releaseCommitMessageFormat": "build(release): {{currentTag}}"
}
+6 -5
View File
@@ -1,6 +1,7 @@
// @ts-check
import { defaultRenderers, generate } from "optolith-tsjsonschemamd"
import { generate } from "optolith-tsjsonschemamd"
import { jsonSchema, markdown } from "optolith-tsjsonschemamd/renderers"
import { dirname, join } from "path"
import { fileURLToPath } from "url"
@@ -11,12 +12,12 @@ generate({
sourceDir: join(root, "src", "types"),
outputs: [
{
renderer: defaultRenderers.jsonSchema,
folder: join(root, "schema")
targetDir: join(root, "schema"),
renderer: jsonSchema,
},
{
renderer: defaultRenderers.markdown,
folder: join(root, "docs", "reference")
targetDir: join(root, "docs", "reference"),
renderer: markdown,
}
],
clean: true
+3744 -17
View File
File diff suppressed because it is too large Load Diff
+12 -4
View File
@@ -4,7 +4,10 @@
"description": "",
"main": "index.js",
"scripts": {
"build": "node src/generate.js",
"build:ts": "tsc",
"build:gen": "node ./build/generate.js",
"build": "npm run build:ts && npm run build:gen",
"release": "standard-version",
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Lukas Obermann",
@@ -14,9 +17,14 @@
"yaml": "^1.10.2"
},
"devDependencies": {
"@types/node": "^17.0.18",
"optolith-tsjsonschemamd": "^0.4.1",
"typescript": "^4.5.5"
"@types/node": "^17.0.21",
"optolith-tsjsonschemamd": "^0.5.1",
"standard-version": "^9.3.2",
"typescript": "^4.6.2"
},
"repository": "github:elyukai/optolith-database-schema",
"bugs": {
"url": "https://github.com/elyukai/optolith-database-schema/issues"
},
"type": "module"
}
-25
View File
@@ -1,25 +0,0 @@
export interface ReferencialIntegrityValidators {
checkLocaleId: (localeId: string) => boolean
}
export const getReferencialIntegrityErrors =
<T extends string | number>(ids: T[], check: (id: T) => boolean) =>
ids.filter(id => !check(id))
export const getReferencialIntegrityErrorsWith =
<T, U extends string | number>(elements: T[], transform: (element: T) => U, check: (id: U) => boolean) =>
elements.filter(element => !check(transform(element)))
interface Translatable<T> {
/**
* All translations for the entry, identified by IETF language tag (BCP47).
* @minProperties 1
*/
translations: {
[localeId: string]: T
}
}
export const getReferencialIntegrityErrorsForTranslatable =
<T>(translatable: Translatable<T>, checkLocaleId: (id: string) => boolean) =>
getReferencialIntegrityErrors(Object.keys(translatable.translations), checkLocaleId)