-
-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Deno support #33
Comments
👋 If you want to have a go at adding deno support and open a PR, you are more than welcome to do it :) |
Hey @gvergnaud, Being able to write: import { assert, Equals } from "tsafe";
import { Evt, P } from "evt";
type Shape = Shape.Circle | Shape.Square;
namespace Shape {
export type Circle = {
type: "circle";
radius: number;
};
export type Square = {
type: "square";
sideLength: number;
};
}
const evtShape = Evt.create<Shape>();
evtShape.attach(
{ "type": "square", "sideLength": P.select() },
(sideLength, square) => {
assert<Equals<typeof sideLength, number>>();
assert<Equals<typeof square, Shape.Square>>();
}
); Instead of: evtShape.attach(
shape => shape.type !== "square" ? null : [shape.sideLenght],
sideLength => {
assert<Equals<typeof sideLength, number>>();
}
); Will truly be a killer feature for EVT! But I need
Yes you are right, if you don't mind tracking the So, let me open a PR for you. In hope you are still interested by publishing on deno.land/x. |
Deno now supports npm packages, so you should be able to do |
Hi @gvergnaud,
For library authors that would like to make I think the option suggested by @lilnasy was a good one. It's with much disappointment that I will commit to implementing my own protocol then. |
There's no reason .ts extension suffixes shouldn't be adopted nor any indication that it won't be, but it might take a few weeks. Typecript 5.0 releases in March. I don't expect ts-pattern to use it in stable sooner. Also, 5.0 would be mainlined into Deno a few weeks after, and that might become a blocker if ts-pattern uses new features (the ts-5 branch made good use of const parameters). If I were you, I would look into making a fork of ts-pattern with floating patches for the .ts extension. I did the same here, compare/main...lilnasy:ts-pattern:main. It should only be a couple of months at most. |
That said, the issue should be reopened. |
Hi @lilnasy, Waiting isn't a problem either, I can wait, it's just that I don't think it's in the roadmap of gvergnaud to implement your approach and release on Deno.land. |
Re-opening the issue then. |
I'm trying to use the
|
Typescript has supported importing with The bundler used by The two options are, switching out I am inclined towards |
@gvergnaud lets make this happen 💪 |
I'm using this on Deno 2.1 with |
@alexgleason Yes, starting with Deno 2. This issue was about making it work with Deno 1. This isue can be closed. |
Is your feature request related to a problem? Please describe.
It would be ideal to use ts-pattern on Deno via an official third party module.
Describe the solution you'd like
Ideally a Deno module could be generated via Github Actions using Denoify or a find and replace regex on import statements to include the
.ts
file extension which is required with Deno. (similar to what zod does)Describe alternatives you've considered
A fork could be maintained with Deno support and have a module on the Deno third party registry but would add complexity.
Additional context
N/A
The text was updated successfully, but these errors were encountered: