From 876293b56b553122ff27f9991ac049c84b3d30c3 Mon Sep 17 00:00:00 2001 From: Kiikurage Date: Sat, 14 Apr 2018 22:35:37 +0900 Subject: [PATCH] publish to npm --- README.md | 20 ++++---------------- package.json | 29 ++++++++++++++++++++++++++--- tsconfig.json | 2 +- 3 files changed, 31 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index 1dc7b6f..5bf0cc3 100644 --- a/README.md +++ b/README.md @@ -1,29 +1,18 @@ # babel-plugin-flow-to-typescript -**Work In Progress** - [Babel] plugin to convert [Flow] code into [TypeScript] ## How to use ```shell -#-------------------------------------------- -# 1. Clone and Build - -$ git clone https://github.com/Kiikurage/babel-plugin-flow-to-typescript -$ yarn install -$ yarn run build - -#-------------------------------------------- -# 2. Use with Babel - -$ yarn global add @babel/core @babel/cli +$ yarn global add @babel/cli +$ yarn add babel-plugin-flow-to-typescript # you must use babel@^7.x.x $ babel --version -> 7.0.0-beta.44 (@babel/core 7.0.0-beta.44) +7.0.0-beta.44 (@babel/core 7.0.0-beta.44) -$ babel --plugins ${ABS_PATH_TO_THIS_DIR}/dist ${SRC_FLOW_FILE} -o ${DEST_TS_FILE} +$ babel --plugins babel-plugin-flow-to-typescript ${SRC_FLOW_FILE} -o ${DEST_TS_FILE} ``` ## Implementation status @@ -51,7 +40,6 @@ $ babel --plugins ${ABS_PATH_TO_THIS_DIR}/dist ${SRC_FLOW_FILE} -o ${DEST_TS_FIL | ❎ | $ElementType| `$ElementType` | `T[k]` | - [ ] add CLI -- [ ] publish to npm [Babel]: https://github.com/babel/babel [Flow]: https://github.com/facebook/flow diff --git a/package.json b/package.json index 0f631c5..a70b466 100644 --- a/package.json +++ b/package.json @@ -1,14 +1,37 @@ { "name": "babel-plugin-flow-to-typescript", - "version": "0.0.1", + "description": "Babel plugin to convert Flow into TypeScript", + "author": { + "name": "Yuichiro Kikura", + "email": "y.kikura@gmail.com", + "url": "https://github.com/Kiikurage" + }, + "files": [ + "dist", + "README.md" + ], + "version": "0.1.0", "scripts": { - "test": "jest --watch", + "test": "jest", + "test-watch": "jest --watch", "build": "tsc" }, + "keywords": [ + "babel", + "flow", + "typescript" + ], + "main": "dist/index.js", + "repository": { + "type": "git", + "url": "https://github.com/Kiikurage/babel-plugin-flow-to-typescript.git" + }, "dependencies": { "@babel/core": "^7.0.0-beta.44", "@babel/traverse": "^7.0.0-beta.44", - "@babel/types": "^7.0.0-beta.44", + "@babel/types": "^7.0.0-beta.44" + }, + "devDependencies": { "@types/babel-core": "^6.25.3", "@types/babel-types": "^7.0.1", "@types/node": "^9.6.2", diff --git a/tsconfig.json b/tsconfig.json index e8389b4..438a6fd 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,6 +1,6 @@ { "compilerOptions": { - "declaration": false, + "declaration": true, "lib": [ "es2018", "dom"