This change provides a more realistic way to support typescript in the nodejs runtime, rather than assuming there is a
specialized typescript runtime.
When you specify nim project create ... --language typescript the runtime kind is set to nodejs but the project is set up with additional material (package.json, tsconfig.json, .include, and src and lib folders) so that a simple action written in typescript will run. It should be easy to generalize this by adding source files, or adding dependencies, modifying generated .include accordingly.
Generalizing to multiple actions with shared material should also be easy but will need more validation and may result in some further changes. The basic structure can be relocated to lib and then the multiple source files are organized as needed under lib/src. The entire build runs under lib and then the individual actions consist only of .include files to tailer what goes into each action. The individual actions can also have a package.json (or not) for establishing the main function.
This change provides a more realistic way to support typescript in the
nodejs
runtime, rather than assuming there is a specialized typescript runtime.When you specify
nim project create ... --language typescript
the runtime kind is set tonodejs
but the project is set up with additional material (package.json
,tsconfig.json
,.include
, andsrc
andlib
folders) so that a simple action written in typescript will run. It should be easy to generalize this by adding source files, or adding dependencies, modifying generated.include
accordingly.Generalizing to multiple actions with shared material should also be easy but will need more validation and may result in some further changes. The basic structure can be relocated to
lib
and then the multiple source files are organized as needed underlib/src
. The entire build runs underlib
and then the individual actions consist only of.include
files to tailer what goes into each action. The individual actions can also have apackage.json
(or not) for establishing the main function.