forked from jaredpalmer/tsdx
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add support for multiple entry files (#134)
closes #55
1 parent
fdcdbaa
commit 2651cd6
Showing
11 changed files
with
231 additions
and
50 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
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,60 @@ | ||
import * as shell from 'shelljs'; | ||
|
||
import * as util from '../utils/fixture'; | ||
import { execWithCache } from '../utils/shell'; | ||
|
||
shell.config.silent = false; | ||
|
||
const testDir = 'e2e'; | ||
const fixtureName = 'build-multipleEntries'; | ||
const stageName = `stage-${fixtureName}`; | ||
|
||
describe('dts build :: multiple entries', () => { | ||
beforeAll(() => { | ||
util.teardownStage(stageName); | ||
util.setupStageWithFixture(testDir, stageName, fixtureName); | ||
}); | ||
|
||
it('should compile files into a dist directory', () => { | ||
const output = execWithCache( | ||
[ | ||
'node ../dist/index.js build', | ||
'--entry src/index.ts', | ||
'--entry src/returnsFalse.ts', | ||
'--entry src/returnsTrue.ts', | ||
].join(' ') | ||
); | ||
|
||
expect(shell.test('-f', 'dist/index.js')).toBeTruthy(); | ||
expect(shell.test('-f', 'dist/index.cjs.development.js')).toBeTruthy(); | ||
expect(shell.test('-f', 'dist/index.cjs.production.min.js')).toBeTruthy(); | ||
expect(shell.test('-f', 'dist/index.esm.js')).toBeTruthy(); | ||
expect(shell.test('-f', 'dist/index.d.ts')).toBeTruthy(); | ||
|
||
expect(shell.test('-f', 'dist/returnsFalse.js')).toBeTruthy(); | ||
expect( | ||
shell.test('-f', 'dist/returnsFalse.cjs.development.js') | ||
).toBeTruthy(); | ||
expect( | ||
shell.test('-f', 'dist/returnsFalse.cjs.production.min.js') | ||
).toBeTruthy(); | ||
expect(shell.test('-f', 'dist/returnsFalse.esm.js')).toBeTruthy(); | ||
expect(shell.test('-f', 'dist/returnsFalse.d.ts')).toBeTruthy(); | ||
|
||
expect(shell.test('-f', 'dist/returnsTrue.js')).toBeTruthy(); | ||
expect( | ||
shell.test('-f', 'dist/returnsTrue.cjs.development.js') | ||
).toBeTruthy(); | ||
expect( | ||
shell.test('-f', 'dist/returnsTrue.cjs.production.min.js') | ||
).toBeTruthy(); | ||
expect(shell.test('-f', 'dist/returnsTrue.esm.js')).toBeTruthy(); | ||
expect(shell.test('-f', 'dist/returnsTrue.d.ts')).toBeTruthy(); | ||
|
||
expect(output.code).toBe(0); | ||
}); | ||
|
||
afterAll(() => { | ||
util.teardownStage(stageName); | ||
}); | ||
}); |
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,7 @@ | ||
{ | ||
"scripts": { | ||
"build": "dts build" | ||
}, | ||
"name": "build-multipleentries", | ||
"license": "MIT" | ||
} |
Oops, something went wrong.