Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Significant enhancements #12

Open
wants to merge 52 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
4f62e0d
Fixes
benjie Jan 4, 2019
1c39616
More fixes
benjie Jan 4, 2019
44da30d
More compatibility
benjie Jan 4, 2019
58a7389
Increased logging
benjie Jan 4, 2019
a8acccf
Only output stack when error occurs
benjie Jan 4, 2019
8e17ae9
More fixes, merge visitors
benjie Jan 4, 2019
630e6e7
More progress
benjie Jan 4, 2019
106c3ca
Better debugging
benjie Jan 4, 2019
d7a282d
More progress
benjie Jan 4, 2019
10348d9
Generics
benjie Jan 4, 2019
3788217
Add explicit prettier config, matching old formatting (roughly)
benjie Jan 5, 2019
d223168
Add prettier
benjie Jan 5, 2019
d9699a7
Autoformat with 'yarn prettier:fix'
benjie Jan 5, 2019
85fce70
Assert prettier
benjie Jan 5, 2019
fe6418d
Merge branch 'prettier'
benjie Jan 5, 2019
fde88fc
Resolve some TypeScript woes
benjie Jan 5, 2019
03a172d
Progress
benjie Jan 5, 2019
735953d
Tidy
benjie Jan 5, 2019
1d79f26
Fix exact
benjie Jan 5, 2019
9797737
Fix
benjie Jan 5, 2019
f2f8f8c
Disable ordered imports temporarily
benjie Jan 5, 2019
f2959c7
Fix
benjie Jan 5, 2019
131c5dd
Fix types
benjie Jan 5, 2019
ba238ae
InterfaceDeclaration
benjie Jan 5, 2019
61385d3
Reduce logging
benjie Jan 5, 2019
186cfb8
Reduce logging
benjie Jan 5, 2019
9b565d3
Add support for type spreads via intersections
benjie Jan 5, 2019
960d75d
Shorthand for object types that are only spreads
benjie Jan 5, 2019
63e9bf7
More complex function
benjie Jan 5, 2019
2cae956
Remove 'type' from exports
benjie Jan 5, 2019
77de757
Reproduce issue with missing parenthesis
benjie Jan 5, 2019
795f963
Merge remote-tracking branch 'upstream/master'
benjie Feb 13, 2019
6099bef
Upgrade deps
benjie Mar 12, 2019
4920570
Revert
benjie Mar 12, 2019
cef452c
Remove many @ts-ignore calls
benjie Mar 12, 2019
342b4ea
Lies
benjie Mar 12, 2019
7a6c42a
Fix more types
benjie Mar 12, 2019
3109589
Remove extra parens
benjie Mar 12, 2019
a198b01
Add comment on warnings
benjie Mar 12, 2019
8126796
rm console.dir
benjie Mar 12, 2019
df91804
rm noop files
benjie Mar 12, 2019
a9ca876
Parenthesize functions in union types
benjie Mar 12, 2019
7843d19
Copy comments across
benjie Mar 12, 2019
c29ec62
Add support for function rest params
benjie Mar 12, 2019
9915591
Copy comments
benjie Mar 12, 2019
c86c05b
Indexer comment test
benjie Mar 12, 2019
3963ffe
Better types
benjie Mar 12, 2019
798cb28
Remove whitespace config because we have prettier
benjie Mar 12, 2019
797c0d9
Manually dedupe @babel/types
benjie Mar 12, 2019
04ccd25
noImplicitAny
benjie Mar 12, 2019
329e351
Merge remote-tracking branch 'upstream/master'
benjie Sep 3, 2019
4f68ec9
Updatable tests (thanks @DylanVann)
benjie Sep 3, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 20 additions & 14 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
"build": "tsc",
"build:watch": "tsc -w",
"clean": "rm -rf ./dist",
"lint": "tslint src/**/*.ts",
"lint": "tslint src/**/*.ts && npm run prettier:check",
"prettier": "prettier 'src/**/*.[tj]s'",
"prettier:fix": "yarn prettier --write",
"prettier:check": "yarn prettier -l",
"prepublishOnly": "npm run clean && npm run lint && npm run build -- -d",
"pretest": "npm run build",
"tdd": "concurrently -k 'npm run build:watch' 'npm run test:watch'",
Expand All @@ -23,23 +26,26 @@
"test:watch": "ava -w"
},
"dependencies": {
"@babel/generator": "7.0.0-beta.38",
"@babel/traverse": "7.0.0-beta.38",
"@babel/types": "7.0.0-beta.38",
"glob": "^7.1.2",
"lodash": "^4.17.4",
"mz": "^2.7.0"
"@babel/generator": "7.2.2",
"@babel/parser": "7.2.3",
"@babel/traverse": "7.2.3",
"@babel/types": "7.2.2",
"glob": "^7.1.3",
"lodash": "^4.17.11",
"mz": "^2.7.0",
"stdin": "^0.0.1"
},
"devDependencies": {
"@types/glob": "^5.0.33",
"@types/lodash": "^4.14.86",
"@types/glob": "^7.1.1",
"@types/lodash": "^4.14.119",
"@types/minimist": "^1.2.0",
"@types/mz": "^0.0.32",
"ava": "^0.24.0",
"concurrently": "^3.5.1",
"flow-bin": "^0.59.0",
"tslint": "^5.8.0",
"typescript": "^2.6.2"
"ava": "^1.0.1",
"concurrently": "^4.1.0",
"flow-bin": "^0.89.0",
"prettier": "^1.15.3",
"tslint": "^5.12.0",
"typescript": "^3.2.2"
},
"ava": {
"files": [
Expand Down
6 changes: 6 additions & 0 deletions prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
printWidth: 80,
semi: false,
singleQuote: true,
trailingComma: 'none',
}
23 changes: 12 additions & 11 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,17 @@ import { resolve } from 'path'
import stdin = require('stdin')
import { compile } from './index'

main(minimist(process.argv.slice(2), {
alias: {
help: ['h'],
input: ['i'],
output: ['o']
}
}))
main(
minimist(process.argv.slice(2), {
alias: {
help: ['h'],
input: ['i'],
output: ['o']
}
})
)

async function main(argv: minimist.ParsedArgs) {

if (argv.help) {
printHelp()
process.exit(0)
Expand All @@ -29,10 +30,10 @@ async function main(argv: minimist.ParsedArgs) {
const ts = await compile(flow, argIn)
await writeOutput(ts, argOut)
} catch (e) {
process.stderr.write(e.message)
console.error(e)
//process.stderr.write(e.message)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Revert?

process.exit(1)
}

}

function readInput(argIn?: string) {
Expand All @@ -58,7 +59,7 @@ function printHelp() {
const pkg = require('../../package.json')

process.stdout.write(
`
`
${pkg.name} ${pkg.version}
Usage: flow2ts [--input, -i] [IN_FILE] [--output, -o] [OUT_FILE]

Expand Down
Loading