|
1 | 1 | # Scriptify TypeScript |
2 | 2 | Adds TypeScript support to Scriptify. Uses ready-made implementations of [script-js-graalvm](https://github.com/Instancify/Scriptify/tree/master/script-js-graalvm) and [script-js-rhino](https://github.com/Instancify/Scriptify/tree/master/script-js-rhino), and transcompiles TypeScript using [swc4j](https://github.com/caoccao/swc4j) for evaluation. |
3 | 3 |
|
| 4 | +## TAKE NOTE |
| 5 | +> [!WARNING] |
| 6 | +> To run the SWC transpiler, you need to add a dependency for the needed operating system. |
| 7 | +### Example: |
| 8 | +```xml |
| 9 | +<dependency> |
| 10 | + <groupId>com.caoccao.javet</groupId> |
| 11 | + <artifactId>swc4j-linux-x86_64</artifactId> |
| 12 | + <version>1.6.0</version> |
| 13 | +</dependency> |
| 14 | +``` |
| 15 | +```groovy |
| 16 | +implementation 'com.caoccao.javet:swc4j-windows-x86_64:1.6.0' |
| 17 | +``` |
| 18 | + |
| 19 | +List of all dependencies: |
| 20 | +**https://github.com/caoccao/swc4j?tab=readme-ov-file#dependency** |
| 21 | + |
| 22 | +## Maven |
| 23 | +Adding repo: |
| 24 | +```xml |
| 25 | +<repositories> |
| 26 | + <repository> |
| 27 | + <id>instancify-repository-snapshots</id> |
| 28 | + <url>https://repo.instancify.app/snapshots</url> |
| 29 | + </repository> |
| 30 | +</repositories> |
| 31 | +``` |
| 32 | + |
| 33 | +For adding a library for GraalVM (SWC): |
| 34 | +```xml |
| 35 | +<dependency> |
| 36 | + <groupId>com.instancify.scriptify.ts</groupId> |
| 37 | + <artifactId>script-ts-swc-graalvm</artifactId> |
| 38 | + <version>1.0.0-SNAPSHOT</version> |
| 39 | +</dependency> |
| 40 | +``` |
| 41 | + |
| 42 | +For adding a library for Rhino (SWC): |
| 43 | +```xml |
| 44 | +<dependency> |
| 45 | + <groupId>com.instancify.scriptify.ts</groupId> |
| 46 | + <artifactId>script-ts-swc-rhino</artifactId> |
| 47 | + <version>1.0.0-SNAPSHOT</version> |
| 48 | +</dependency> |
| 49 | +``` |
| 50 | + |
| 51 | +## Gradle |
| 52 | +Adding repo: |
| 53 | +```groovy |
| 54 | +maven { |
| 55 | + name "instancifyRepositorySnapshots" |
| 56 | + url "https://repo.instancify.app/snapshots" |
| 57 | +} |
| 58 | +``` |
| 59 | + |
| 60 | +For adding a library for GraalVM (SWC): |
| 61 | +```groovy |
| 62 | +implementation "com.instancify.scriptify.ts:script-ts-swc-graalvm:1.0.0-SNAPSHOT" |
| 63 | +``` |
| 64 | + |
| 65 | +For adding a library for Rhino (SWC): |
| 66 | +```groovy |
| 67 | +implementation "com.instancify.scriptify.ts:script-ts-swc-rhino:1.0.0-SNAPSHOT" |
| 68 | +``` |
0 commit comments