-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4bf7e50
commit d636070
Showing
11 changed files
with
464 additions
and
136 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,3 +65,4 @@ typings/ | |
## ====== | ||
|
||
dist/ | ||
build/ |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import path from 'path' | ||
import util from 'util' | ||
import { generateCode } from './src/main' | ||
|
||
function genCodeForTest(name: string) { | ||
const fixturesDir = path.resolve(__dirname, 'test') | ||
generateCode(path.resolve(fixturesDir, 'tlb', name + '.tlb'), 'test/generated_files/generated_' + name + '.ts') | ||
} | ||
|
||
genCodeForTest('block') | ||
genCodeForTest('test') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,7 @@ | |
module.exports = { | ||
preset: 'ts-jest', | ||
testEnvironment: 'node', | ||
testMatch: [ | ||
"**/?(*.)+(spec|test).[j]s?(x)" | ||
] | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env node | ||
import meow from 'meow'; | ||
import { generateCode } from './src/main'; | ||
|
||
const cli = meow(` | ||
Usage | ||
$ foo <tlbpath> | ||
Options | ||
--output, -o Output file, defult = tlbpath + ".tst" | ||
`, { | ||
flags: { | ||
output: { | ||
type: 'string', | ||
shortFlag: 'o' | ||
} | ||
} | ||
}); | ||
|
||
|
||
let input = cli.input.at(0) | ||
if (input) { | ||
generateCode(input, input + ".ts"); | ||
} |
Oops, something went wrong.