dotnet-websharper / core

WebSharper - Full-stack, functional, reactive web apps and microservices in F# and C#
https://websharper.com
Apache License 2.0
593 stars 52 forks source link

npm package name validation #1335

Open granicz opened 1 year ago

granicz commented 1 year ago

When using npm package-based imports, such as:

let QRCode = JS.Import("foo", "date-fns")

then raise an error, if the given npm package is not defined in the project file, say, using the femto convention:

<NpmDependencies>
    <NpmPackage Name="date-fns" Version="gt 1.30.0 lt 2.0.0" ResolutionStrategy="Max" />
</NpmDependencies>
Jand42 commented 1 year ago

@granicz First I am adding the possibility npm package-based imports.

I am modifying JS.Import to follow rules used by JS imports too: