Skip to content

The generator now output a node package, and the generated code can have depedencies.#1

Merged
olivier-spinelli merged 2 commits intodevelopfrom
feature/generated-package
Sep 28, 2022
Merged

The generator now output a node package, and the generated code can have depedencies.#1
olivier-spinelli merged 2 commits intodevelopfrom
feature/generated-package

Conversation

@Kuinox
Copy link
Copy Markdown
Member

@Kuinox Kuinox commented Aug 2, 2022

Added a LibraryImport readonly struct type.
"EnsureImportFromLibrary" now take it in parameter, instead of a string for the library name.
The ITSFileImportSection now exposes a IReadOnlyDictionary<string, LibraryImport> LibraryImports { get; }. You can get the library imports from a TypeScriptFilebeause it expose aITSFileImportSection. The root TypeScriptFolderwill generate apackage.json`, with the dependencies listed in the files.

If there is multiple imports of the same library, a simple conflict resolution is made:
If the version mismatch, that's an error.
The dependencyKind get upgraded, in the following order devDependencies => dependencies => peerDependencies.

The package name is fixed to @signature/generated.
If a package library is produced, and depend on the generated package with the name abc, the dependent must have the generated code with the name abc, if it generate def instaed, the node resolution will fail.

This feature is package-manager neutral, it follow the node package.json format, it's up to the package manager that depends on the package to do the job.

@olivier-spinelli olivier-spinelli merged commit 8377bfd into develop Sep 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants