typenative 0.0.7 → 0.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/bin/transpiler.js +1 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,9 +4,9 @@ Build native applications using Typescript.
|
|
|
4
4
|
|
|
5
5
|
## Get Started
|
|
6
6
|
|
|
7
|
-
- Write a file `test.ts` with content `console.log('Hello World!')
|
|
7
|
+
- Write a file `test.ts` with content `console.log('Hello World!');` or any other message
|
|
8
8
|
- Run `npx typenative --source test.ts`
|
|
9
|
-
- Run
|
|
9
|
+
- Run `dist/native.exe` in terminal and see your message
|
|
10
10
|
|
|
11
11
|
## Todo
|
|
12
12
|
|
package/bin/transpiler.js
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
2
|
export function transpileToC(code) {
|
|
3
3
|
const sourceFile = ts.createSourceFile('main.ts', code, ts.ScriptTarget.ES2020, true, ts.ScriptKind.TS);
|
|
4
|
-
return
|
|
5
|
-
#define console.log(message) printf(message)
|
|
6
|
-
|
|
7
|
-
#include <stdio.h>
|
|
4
|
+
return `#include <stdio.h>
|
|
8
5
|
#include <string.h>
|
|
9
6
|
|
|
10
|
-
|
|
11
7
|
int main() {
|
|
12
8
|
${visit(sourceFile)}
|
|
13
9
|
return 0;
|