Skip to content

Commit

Permalink
fix: remove typedoc/node_modules/.bin from local typescript dep
Browse files Browse the repository at this point in the history
The generate-apidocs script has a workaround to remove local dependency
of TypeScript from typedoc module so that our version of TS will be used.
  • Loading branch information
raymondfeng committed Jan 28, 2018
1 parent b0f88c2 commit 877d6a5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/build/bin/generate-apidocs.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

function run(argv, dryRun) {
const utils = require('./utils');
const fs = require('fs');
const fs = require('fs-extra');
const path = require('path');
var tsPath;
try {
Expand All @@ -22,6 +22,8 @@ function run(argv, dryRun) {
// typescript version for our projects
try {
fs.renameSync(tsPath, tsPath + '.bak');
// Clean up the symbolic links (tsc & tsserver)
fs.removeSync(path.join(tsPath, '../.bin'));
} catch (e) {
// Ignore the error
}
Expand Down
11 changes: 11 additions & 0 deletions packages/build/test/integration/scripts.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,17 @@ describe('build', () => {
fs.existsSync(path.join(projectDir, 'api-docs')),
'api-docs should have been created'
);
var typedocDir = require.resolve('typedoc/package.json');
assert(
!fs.existsSync(path.join(typedocDir, '../node_modules/typescript')),
'typedoc local dependency of typescript should have been renamed'
);
assert(
!fs.existsSync(
path.join(typedocDir, '../node_modules/.bin'),
'typedoc local scripts from typescript should have been removed'
)
);
done();
});
});
Expand Down

0 comments on commit 877d6a5

Please sign in to comment.