Giter VIP home page Giter VIP logo

purescript-typescript-importer's Introduction

purescript-typescript-importer

Experiment of writing a typescript importer for purescript. Very early stage and ongoing development, don't use it yet!

The current state of typescript support can be seen in the testfiles folder. In testfiles/original are the typescript input files and in testfiles/golden the expected output of the typescript support that is currently passing.

Goals & non-goals

The goal of this project is to create a tool that generates useful and working purescript ffis from typescript type definitions. It is not meant to create a fully-fledged typescript to purescript transpiler, as I don't see much added value to this and it's also a whole different story scope-wise. It is also (currently) not a goal to go the other way around, i.e. from purescript to typescript.

Typescript <≡> Purescript type correspondence

See Typescript <≡> Purescript type correspondence.

Usage

WIP, run it using spago, pass arguments using --exec-args

# list modules with typescript type definitions
spago run --exec-args "list"
# import module
spago run --exec-args "import <NODE_MODULE>"

Maintainers

purescript-typescript-importer's People

Contributors

sigma-andex avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

purescript-typescript-importer's Issues

Make golden test framework generate a diff file in success case

Currently the diff file is only generated in the failure case. Therefore, if you make the test pass you will see the diff of the previous run when refreshing the browser.

It would be great if the diff file would also be generated in the success case, so that you can hit refresh and see that 'now it works'.

Format source code before comparing diffs

Currently the tests fail if the generated source files don't match 100% the expected source files. It would be nice if we would format the source code before sending them to the diff so we don't have to bother about the correct whitespaces all the time.

[ ] Purescript (using tidy)
[ ] Javascript (using some js formatter)

Generate purescript module names

Currently we get the filename as this in the codegen:
Filename: 'testfiles/original/person/person.ts'
We will need to extract a module name like this:
Person.Person
i.e. pascal case, special characters escaped and base folder path removed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.