-
Notifications
You must be signed in to change notification settings - Fork 94
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Report supports multiple external --all targets
The `lib/report` API can now receive additional arguments that allow it to pull in code from multiple directories even if those directories live outside of the invokers cwd. Additional bug fix: Fixed padding/new lines around source map urls (and added tests)
- Loading branch information
Showing
12 changed files
with
147 additions
and
32 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
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
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
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 @@ | ||
console.log("hi") |
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 @@ | ||
console.log("hi") |
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,12 @@ | ||
const Report = require('../../../lib/report') | ||
const report = new Report({ | ||
include: ['**/*.js'], | ||
exclude: [], | ||
reporter: ['text'], | ||
tempDirectory: './temp', | ||
omitRelative: true, | ||
all: true, | ||
src: ['../multidir1/', '../multidir2/'], | ||
allowExternal: true | ||
}) | ||
report.run() |
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,12 @@ | ||
const Report = require('../../../lib/report') | ||
const report = new Report({ | ||
include: ['**/*.js'], | ||
exclude: [], | ||
reporter: ['text'], | ||
tempDirectory: './temp', | ||
omitRelative: true, | ||
all: true, | ||
src: '../multidir1/', | ||
allowExternal: true | ||
}) | ||
report.run() |
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 @@ | ||
{"result":[]} |
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,10 @@ | ||
"use strict"; | ||
exports.__esModule = true; | ||
var loaded_1 = require("./loaded"); | ||
console.log(loaded_1["default"](0)); | ||
console.log(loaded_1["default"](1)); | ||
console.log(loaded_1["default"](-1)); | ||
//# sourceMappingURL=padded.js.map | ||
|
||
|
||
//ew extra whitespace ^ |
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
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
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,14 @@ | ||
/* global describe, it */ | ||
const getSourceMapFromFile = require('../lib/source-map-from-file') | ||
const assert = require('assert') | ||
const path = require('path') | ||
describe('source-map-from-file', () => { | ||
it('should parse source maps from compiled targets', () => { | ||
const sourceMap = getSourceMapFromFile('./test/fixtures/all/ts-compiled/main.js') | ||
assert.strictEqual(sourceMap, ['test', 'fixtures', 'all', 'ts-compiled', 'main.js.map'].join(path.sep)) | ||
}) | ||
it('should handle extra whitespace characters', () => { | ||
const sourceMap = getSourceMapFromFile('./test/fixtures/source-maps/padded.js') | ||
assert.strictEqual(sourceMap, ['test', 'fixtures', 'source-maps', 'padded.js.map'].join(path.sep)) | ||
}) | ||
}) |