build: add standard-version
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"releaseCommitMessageFormat": "build(release): {{currentTag}}"
|
||||
}
|
||||
@@ -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
|
||||
Generated
+3744
-17
File diff suppressed because it is too large
Load Diff
+12
-4
@@ -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"
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
Reference in New Issue
Block a user