Hi,
I just tried to create a new generator for our custom DSL.
I first followed the "build a custom generator" lab but than tried to move to typescript in order to re-use the code from the existing generators.
After solving all the path or naming issue, I'm stuck with a few errors left on the diascript_generator.ts (pasted below).
Currently it's mostly a mix of the lua and the javascript generator with little to no modification but I can provide the files if needed.
In order to retrieve the variables real names, I suppose that I need the namesDb and given that the names modules (and others in the xxx_generator.ts files) are not exported, I cannot reach them.
The last error is not about a missing dependency but and is rather cryptic to me but I haven't investigated much on that side
so far.
Am I doing something wrong? Should I follow another method for custom generators?
Thanks for any advice that could help me unlock that.
Regards,
Bertrand
error log:
Compiled with problems:
×ERROR in ./src/generators/diascript/diascript_generator.ts 14:0-61
Module not found: Error: Package path ./core/inputs/input_types is not exported from package C:\Users\bet\diascriptTest\node_modules\blockly (see exports field in C:\Users\bet\diascriptTest\node_modules\blockly\package.json)
ERROR in ./src/generators/diascript/diascript_generator.ts 15:0-43
Module not found: Error: Package path ./core/names is not exported from package C:\Users\bet\diascriptTest\node_modules\blockly (see exports field in C:\Users\bet\diascriptTest\node_modules\blockly\package.json)
ERROR in ./src/generators/diascript/diascript_generator.ts 16:0-57
Module not found: Error: Package path ./core/utils/string is not exported from package C:\Users\bet\diascriptTest\node_modules\blockly (see exports field in C:\Users\bet\diascriptTest\node_modules\blockly\package.json)
ERROR in ./src/generators/diascript.ts (C:\Users\bet\diascriptTest\src\generators\diascript.ts) 35:38-54
[tsl] ERROR in C:\Users\bet\diascriptTest\src\generators\diascript.ts(35,39)
TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{ variables_get_dynamic: (block: Block, generator: DiascriptGenerator) => [string, Order]; variables_set_dynamic: (block: Block, generator: DiascriptGenerator) => string; ... 23 more ...; controls_ifelse: (block: Block, generator: DiascriptGenerator) => string; }'.
No index signature with a parameter of type 'string' was found on type '{ variables_get_dynamic: (block: Block, generator: DiascriptGenerator) => [string, Order]; variables_set_dynamic: (block: Block, generator: DiascriptGenerator) => string; ... 23 more ...; controls_ifelse: (block: Block, generator: DiascriptGenerator) => string; }'.