mirror of
https://github.com/chenasraf/DefinitelyTyped-tools.git
synced 2026-05-18 01:49:03 +00:00
Misc fixes
This commit is contained in:
committed by
Andrew Branch
parent
ed5c192450
commit
8e23d27647
@@ -6,7 +6,9 @@
|
||||
"bin": {
|
||||
"publish-typings": "createSearchIndex.js"
|
||||
},
|
||||
"dependencies": {},
|
||||
"dependencies": {
|
||||
"rmdir": "^1.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^1.9.0-dev.20160331"
|
||||
},
|
||||
|
||||
@@ -5,8 +5,10 @@ var rmdir = require('rmdir');
|
||||
var outputPath = path.join(__dirname, '..', 'output');
|
||||
console.log('Clean ' + outputPath);
|
||||
fs.readdir(outputPath, function(err, dirs) {
|
||||
dirs.forEach(function (dir) {
|
||||
var p = path.join(outputPath, dir);
|
||||
rmdir(p);
|
||||
});
|
||||
if(dirs) {
|
||||
dirs.forEach(function (dir) {
|
||||
var p = path.join(outputPath, dir);
|
||||
rmdir(p);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
"scopeName": "types",
|
||||
"outputPath": "./output",
|
||||
"definitelyTypedPath": "../DefinitelyTyped",
|
||||
"sourceBranch": "types-2.0",
|
||||
"prereleaseTag": "alpha",
|
||||
"tag": "latest"
|
||||
}
|
||||
|
||||
@@ -20,6 +20,8 @@ export interface TypingsData {
|
||||
|
||||
// e.g. https://github.com/DefinitelyTyped
|
||||
sourceRepoURL: string;
|
||||
// e.g. 'master'
|
||||
sourceBranch: string;
|
||||
|
||||
// The name of the primary definition file, e.g. 'jquery.d.ts'
|
||||
definitionFilename: string;
|
||||
|
||||
@@ -2,7 +2,7 @@ import * as ts from 'typescript';
|
||||
import * as fs from 'fs';
|
||||
import * as path from 'path';
|
||||
|
||||
import { TypingsData, DefinitionFileKind, RejectionReason, TypingParseSucceedResult, TypingParseFailResult, computeHash } from './common';
|
||||
import { TypingsData, DefinitionFileKind, RejectionReason, TypingParseSucceedResult, TypingParseFailResult, computeHash, settings } from './common';
|
||||
|
||||
function stripQuotes(s: string) {
|
||||
return s.substr(1, s.length - 2);
|
||||
@@ -349,6 +349,7 @@ export function getTypingInfo(directory: string): TypingParseFailResult | Typing
|
||||
typingsPackageName: folderName.toLowerCase(),
|
||||
projectName,
|
||||
sourceRepoURL,
|
||||
sourceBranch: settings.sourceBranch,
|
||||
kind: DefinitionFileKind[fileKind],
|
||||
globals: Object.keys(globalSymbols).filter(k => !!(globalSymbols[k] & DeclarationFlags.Value)),
|
||||
declaredModules,
|
||||
|
||||
@@ -40,6 +40,7 @@ export function generatePackage(typing: TypingsData): { log: string[] } {
|
||||
|
||||
const outputPath = getOutputPath(typing);
|
||||
log.push(`Create output path ${outputPath}`);
|
||||
mkdir(path.dirname(outputPath));
|
||||
mkdir(outputPath);
|
||||
|
||||
log.push(`Clear out old files`);
|
||||
@@ -130,7 +131,7 @@ function createReadme(typing: TypingsData) {
|
||||
lines.push('');
|
||||
|
||||
lines.push('# Details');
|
||||
lines.push(`Typings were exported from ${typing.sourceRepoURL} in the ${typing.typingsPackageName} directory.`);
|
||||
lines.push(`Typings were exported from ${typing.sourceRepoURL}/tree/${typing.sourceBranch}/${typing.typingsPackageName}`);
|
||||
|
||||
lines.push('');
|
||||
lines.push(`Additional Details`)
|
||||
|
||||
3
packages/types-publisher/src/settings.d.ts
vendored
3
packages/types-publisher/src/settings.d.ts
vendored
@@ -7,6 +7,9 @@ interface PublishSettings {
|
||||
// e.g. '../DefinitelyTyped'
|
||||
definitelyTypedPath: string;
|
||||
|
||||
// The branch that DefinitelyTyped is sourced from
|
||||
sourceBranch: string;
|
||||
|
||||
// e.g. 'alpha'
|
||||
prereleaseTag?: string;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user