Giter Site home page Giter Site logo

maxim-mazurok / ez-vcard-ts-java-types Goto Github PK

View Code? Open in Web Editor NEW
0.0 3.0 0.0 1.35 MB

Generate Ezvcard type definitions for node-java with TypeScript

License: MIT License

TypeScript 100.00%
ezvcard node-java typescript type-definitions nodejs vcf

ez-vcard-ts-java-types's Introduction

Generate Ezvcard type definitions for node-java with TypeScript

Instructions for Windows 10:

  1. Install JDK 14

  2. Install Python 2

  3. Use node v6.17.1 (ts-java won't build on later versions)

  4. Add this to package.json:

    {
      "scripts": {
        "preinstall": "npm run npm-force-resolutions",
        "npm-force-resolutions": "npm-force-resolutions"
      },
      "resolutions": {
        "java": "github:joeferner/node-java#master",
        "find-java-home": "1.1.0"
      }
    }
  5. Remove node_modules and package-lock.json (just in case)

  6. Run npm i npm --save to upgrade to npm which understands package-lock.json

  7. Run npm i --ignore-scripts to generate package-lock.json

  8. Remove node_modules/java and node_modules/ts-java (to force reinstallation and re-running of build scripts)

  9. Run npm i --python=C:\Python27\python.exe

  10. In node_modules\ts-java\lib\ts-java-main.js remove classpath.push(rtJarPath); line. Instead, we'll download and add it to package.json. Make sure that it's a full and not stripped down version, use archive manager to look inside of jar, there should be a lot of folders. Or, grab one from this repo.

    {
      "ts-java": {
        "classpath": "rt.jar"
      }
    }
  11. Run node node_modules\ts-java\bin\ts-java.js and don't wait, go to the next step

  12. Don't wait for ts-java.js to finish, it will never finish for some reason. Instead, look for tsJavaModule.ts file to be created or updated. Once it's there - terminate script.

  13. ???

  14. Profit!

Usage with node-java instructions:

  1. See usage folder

  2. Make sure to replace

    var fullJarPath: string = path.join(__dirname, "", jarPath);
    _java.classpath.push(fullJarPath);

    with

    _java.classpath.push(jarPath);

    in case if you're using absolute paths to your jars.

  3. Don't forget to switch back to the latest NodeJS version (tested on v14.7.0) since we don't have to deal with outdated ts-java sources anymore

  4. Install deps from package.json

  5. Run npx ts-node .\index.ts

ez-vcard-ts-java-types's People

Watchers

 avatar  avatar  avatar

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.