mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-21 16:13:12 +09:00
Output compiled validator to source tree as well
Output message_validate.js to both dist/src/data and src/data. This allows tools to directly consume the TypeScript sources in src/data without throwing an error due to message_validate being missing.
This commit is contained in:
1 parent
ceb7e48c99
commit
8b5c66d900
3 files changed
+9
-4
No files matched your search
@@ -0,0 +1 @@
|
|||||||
|
/src/data/message_validate.js
|
||||||
Whitespace-only changes.
@@ -22,7 +22,11 @@ const ajv = new Ajv({
|
|||||||
});
|
});
|
||||||
const validate = ajv.compile(Message.jsonSchema);
|
const validate = ajv.compile(Message.jsonSchema);
|
||||||
let moduleCode = standaloneCode(ajv, validate);
|
let moduleCode = standaloneCode(ajv, validate);
|
||||||
fs.outputFileSync(
|
function write(output) {
|
||||||
path.join(__dirname, "../dist/src/data/message_validate.js"),
|
fs.outputFileSync(
|
||||||
`// generated by scripts/compile_validator.js\n// @ts-nocheck\n/* eslint-disable */\n${moduleCode}`
|
path.join(__dirname, output),
|
||||||
);
|
`// generated by scripts/compile_validator.js\n// @ts-nocheck\n/* eslint-disable */\n${moduleCode}`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
write("../dist/src/data/message_validate.js");
|
||||||
|
write("../src/data/message_validate.js");
|
||||||
Reference in new issue
Block a user