Project create now supports typescript in nodejs #247
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change provides a more realistic way to support typescript in the
nodejs
runtime, rather than assuming there is aspecialized 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.