Open WriteCoin opened 2 years ago
The error when using another template as a dependency occurs due to the pnpm package manager. https://pnpm.io/ This is a package manager to save disk space. It creates hard links to already installed dependencies. I would like to use it instead of the classic bulky npm, but in conjunction with Ceres I don't see it working yet. The only thing I've tried so far: `pnpm install --shamefully-hoist'.
Let's say the ts source code is compiled into an intermediate folder, for example, dist. There you also need to add the ts scripts themselves, and this should be done not only to search for lua files of the same name, but also to parse the ts files themselves. The so-called object interface preprocessor. For example:
declare class Timer {
getElapsed(): number
getRemaining(): number
getTimeout(): number
destroy(): this
pause(): this
resume(): this
start(timeout: number, periodic: boolean, handlerFunc: () => void): this
}
Such a code:
const timer = new Timer()
timer.start(1., false, () => {
print("Hello")
})
timer.destroy()
In this intermediate folder will turn into:
const timer = CreateTimer()
TimerStart(timer, 1., false, () => {
print("Hello")
})
DestroyTimer(timer)
API syntax similar to the Wurst language.
I have seen that when installing cerrie, compiled lua scripts lying next to ts appear immediately. How is this done and why? Compiled scripts could be stored in a separate folder, but then there is a problem with their assembly with Ceres. There is still a problem with this when I want to use the dependency as a reference:
npm link my_package
. Even if all scripts are compiled automatically when the package is published. I tried to use another way, by creating a killer configuration:In this case, however, cerrie does not compile. I also can't use another ceres-ts-template as a dependency. I get the following error when building: