This repository has been archived by the owner on Feb 12, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Standalone typings are generated on build into the 'standalone-typings' folder. The folder is contributed to the parser NPM package.
- Loading branch information
1 parent
c97edb0
commit 925cb47
Showing
5 changed files
with
43 additions
and
3 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,35 @@ | ||
import fsutil = require("../util/fsutil"); | ||
import path = require("path"); | ||
import fs = require('fs'); | ||
import util = require("../util/index"); | ||
|
||
|
||
const rootPath = path.join(__dirname, "../../"); | ||
const npmIgnorePath = path.resolve(rootPath,".npmignore"); | ||
const npmIgnore = fs.readFileSync(npmIgnorePath,"utf-8"); | ||
const ignoredPaths = npmIgnore.split("\n").filter(x=>{ | ||
return util.stringStartsWith(x,"/dist"); | ||
}).map(x=>x.substring(1)); | ||
|
||
const destination = path.resolve(rootPath,"standalone-typings"); | ||
const source = path.resolve(rootPath,"dist"); | ||
|
||
fsutil.removeDirSyncRecursive(destination); | ||
fsutil.copyDirSyncRecursive( | ||
destination, | ||
source,null, | ||
p=>{ | ||
let rel = path.relative(rootPath,p).replace(/\\/g,"/"); | ||
if(util.stringStartsWith(rel,"./")){ | ||
rel = rel.substring(2); | ||
} | ||
for(let ip of ignoredPaths){ | ||
if(util.stringStartsWith(rel,ip)){ | ||
return false; | ||
} | ||
} | ||
if(!fs.lstatSync(p).isDirectory() && !util.stringEndsWith(rel,".d.ts")){ | ||
return false; | ||
} | ||
return true; | ||
}); |
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 |
---|---|---|
|
@@ -12,6 +12,7 @@ | |
}, | ||
"exclude": [ | ||
"node_modules", | ||
"typings" | ||
"typings", | ||
"standalone-typings" | ||
] | ||
} |