Skip to content

Commit

Permalink
Create ts-node-transpile-only bin script (#939)
Browse files Browse the repository at this point in the history
* Create `ts-transpile` bin script

* Rename `transpile` to `ts-node-transpile-only`

* Rename script.ts and transpile.ts to bin-* to clarify intent

* fix tests

Co-authored-by: Andrew Bradley <cspotcode@gmail.com>
  • Loading branch information
G-Rath and cspotcode committed Feb 15, 2020
1 parent d578e17 commit f3f61e2
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
"types": "dist/index.d.ts",
"bin": {
"ts-node": "dist/bin.js",
"ts-script": "dist/script.js"
"ts-script": "dist/bin-script.js",
"ts-node-transpile-only": "dist/bin-transpile.js"
},
"files": [
"dist/",
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions src/bin-transpile.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env node

import { main } from './bin'

main(['--transpile-only', ...process.argv.slice(2)])
2 changes: 1 addition & 1 deletion src/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { register, create, VERSION } from './index'
const TEST_DIR = join(__dirname, '../tests')
const PROJECT = join(TEST_DIR, 'tsconfig.json')
const BIN_EXEC = `node "${join(__dirname, '../dist/bin')}" --project "${PROJECT}"`
const SCRIPT_EXEC = `node "${join(__dirname, '../dist/script')}"`
const SCRIPT_EXEC = `node "${join(__dirname, '../dist/bin-script')}"`

const SOURCE_MAP_REGEXP = /\/\/# sourceMappingURL=data:application\/json;charset=utf\-8;base64,[\w\+]+=*$/

Expand Down

0 comments on commit f3f61e2

Please sign in to comment.