Skip to content

Commit

Permalink
Fix issues in build-libs (#354)
Browse files Browse the repository at this point in the history
  • Loading branch information
toasted-nutbread authored Dec 11, 2023
1 parent e0c6cf2 commit 1ae752b
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dev/build-libs.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,11 @@ export async function buildLibs() {
const schemaDir = path.join(extDir, 'data/schemas/');
const schemaFileNames = fs.readdirSync(schemaDir);
const schemas = schemaFileNames.map((schemaFileName) => JSON.parse(fs.readFileSync(path.join(schemaDir, schemaFileName), {encoding: 'utf8'})));
const ajv = new Ajv({schemas: schemas, code: {source: true, esm: true}});
const ajv = new Ajv({
schemas,
code: {source: true, esm: true},
allowUnionTypes: true
});
const moduleCode = standaloneCode(ajv);

// https://github.com/ajv-validator/ajv/issues/2209
Expand Down
1 change: 1 addition & 0 deletions ext/data/schemas/dictionary-kanji-bank-v1-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"type": "array",
"description": "Information about a single kanji character.",
"minItems": 4,
"maxItems": 4,
"items": [
{
"type": "string",
Expand Down
1 change: 1 addition & 0 deletions ext/data/schemas/dictionary-kanji-bank-v3-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"type": "array",
"description": "Information about a single kanji character.",
"minItems": 6,
"maxItems": 6,
"additionalItems": false,
"items": [
{
Expand Down
1 change: 1 addition & 0 deletions ext/data/schemas/dictionary-kanji-meta-bank-v3-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"type": "array",
"description": "Metadata about a single kanji character.",
"minItems": 3,
"maxItems": 3,
"additionalItems": false,
"items": [
{
Expand Down
1 change: 1 addition & 0 deletions ext/data/schemas/dictionary-tag-bank-v3-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"type": "array",
"description": "Information about a single tag.",
"minItems": 5,
"maxItems": 5,
"additionalItems": false,
"items": [
{
Expand Down
1 change: 1 addition & 0 deletions ext/data/schemas/dictionary-term-bank-v1-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"type": "array",
"description": "Information about a single term.",
"minItems": 5,
"maxItems": 5,
"items": [
{
"type": "string",
Expand Down
1 change: 1 addition & 0 deletions ext/data/schemas/dictionary-term-bank-v3-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@
"type": "array",
"description": "Information about a single term.",
"minItems": 8,
"maxItems": 8,
"additionalItems": false,
"items": [
{
Expand Down
5 changes: 5 additions & 0 deletions ext/data/schemas/dictionary-term-meta-bank-v3-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
"type": "array",
"description": "Metadata about a single term.",
"minItems": 3,
"maxItems": 3,
"additionalItems": false,
"items": [
{
Expand All @@ -48,6 +49,8 @@
],
"oneOf": [
{
"minItems": 3,
"maxItems": 3,
"items": [
{},
{"const": "freq"},
Expand Down Expand Up @@ -80,6 +83,8 @@
]
},
{
"minItems": 3,
"maxItems": 3,
"items": [
{},
{"const": "pitch"},
Expand Down
2 changes: 2 additions & 0 deletions ext/data/schemas/options-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@
}
],
"items": {
"type": "object",
"required": [
"include",
"exclude",
Expand Down Expand Up @@ -776,6 +777,7 @@
"items": {
"type": "array",
"items": {
"type": "object",
"required": [
"pattern",
"ignoreCase",
Expand Down

0 comments on commit 1ae752b

Please sign in to comment.