stephenh / ts-poet

A code generator DSL for typescript
Apache License 2.0
103 stars 13 forks source link

Use standalone prettier #22

Closed ntkoopman closed 2 years ago

ntkoopman commented 2 years ago

This allows using ts-poet using one of the CDN repository mirrors. The reason is that Prettier uses the standalone version on those, and the standalone version doesn't include resolveConfig.

import("https://esm.sh/ts-poet").then(module => module.code("")) 
Uncaught (in promise) TypeError: K.resolveConfig is not a function

(mainly for Deno compatibility)

ntkoopman commented 2 years ago

The standard practice is to add dependencies to deno.land (https://deno.land/x), but that would need an extra build step.

If you want to document support it's probably easier to document usage from a browser, since that would imply that it works in Deno as well.

stephenh commented 2 years ago

Looks great, thanks @ntkoopman ! I published this to npm was version 4.9.0.