Skip to content
This repository was archived by the owner on Apr 30, 2019. It is now read-only.

Commit a8bf217

Browse files
committed
Merge pull request #210 from Diullei/master
fix: #216 #193
2 parents 426a95b + 51118f2 commit a8bf217

File tree

15 files changed

+2262
-160
lines changed

15 files changed

+2262
-160
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@
108108
"source-map-support": "~0.2.6",
109109
"time-grunt": "^1.0.0",
110110
"tslint-path-formatter": "~0.1.1",
111-
"typescript": "^1.1.0-1",
111+
"typescript": "1.5.3",
112112
"dir-compare": "^0.0.2"
113113
}
114114
}

src/tsd/API.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,9 +220,12 @@ class API {
220220
var linker = new PackageLinker();
221221
var manager = new BundleManager(this.core.context.getTypingsDir());
222222

223+
var bundlePath = path.join(path.dirname(this.core.context.paths.configFile), this.core.context.config.toJSON().bundle);
224+
223225
return linker.scanDefinitions(baseDir).then((packages) => {
224226
return Promise.reduce(packages, (memo: PackageDefinition[], packaged) => {
225-
return manager.addToBundle(this.context.config.bundle, packaged.definitions, true).then((change) => {
227+
228+
return manager.addToBundle(bundlePath, packaged.definitions, true).then((change) => {
226229
if (change.someAdded()) {
227230
memo.push(packaged);
228231
}

src/tsd/data/Def.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import objectUtils = require('../../xm/objectUtils');
1010

1111
import DefVersion = require('./DefVersion');
1212

13-
var defExp = /^[a-z](?:[\._-]?[a-z0-9])*(?:\/[a-z](?:[\._-]?[a-z0-9])*)+\.d\.ts$/i;
13+
var defExp = /^[a-z_](?:[\._-]?[a-z0-9_])*(?:\/[a-z_](?:[\._-]?[a-z0-9_])*)+\.d\.ts$/i;
1414

1515
var versionEnd = /(?:-v?)(\d+(?:\.\d+)*)(-[a-z](?:[_-]?[a-z0-9])*(?:\.\d+)*)?$/i;
1616
var twoNums = /^\d+\.\d+$/;

src/tsd/data/DefIndex.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ class DefIndex {
8989

9090
var releases: Def[] = [];
9191

92-
Lazy(<Object>tree.tree).each((elem: GithubJSONTreeElem) => {
92+
(<any>Lazy(<Object>tree.tree)).each((elem: GithubJSONTreeElem) => {
9393
var char = elem.path.charAt(0);
94-
if (elem.type === 'blob' && char !== '.' && char !== '_' && Def.isDefPath(elem.path)) {
94+
if (elem.type === 'blob' && char !== '.' && Def.isDefPath(elem.path)) {
9595
def = this.procureDef(elem.path);
9696
if (!def) {
9797
return;
@@ -135,7 +135,7 @@ class DefIndex {
135135
def.history = [];
136136

137137
// TODO harden data validation
138-
Lazy(commitJsonArray).each((json) => {
138+
(<any>Lazy(commitJsonArray)).each((json) => {
139139
if (!json || !json.sha) {
140140
console.dir(json, 'weird: json no sha', 1);
141141
}

src/tsd/schema/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ var schema = Joi.object({
4242
.description('toggle stats tracking'),
4343
installed: Joi
4444
.object()
45-
.pattern(/^([a-z](?:[\._-]?[a-z0-9]+)*)(\/[a-z](?:[\._-]?[a-z0-9]+)*)+\.d\.ts$/i, Joi.object({
45+
.pattern(/^([a-z_](?:[\._-]?[a-z0-9_]+)*)(\/[a-z_](?:[\._-]?[a-z0-9_]+)*)+\.d\.ts$/i, Joi.object({
4646
commit: Joi.string()
4747
.required()
4848
.regex(/^[0-9a-f]{6,40}$/)

src/tsd/support/Bundle.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ class Bundle {
145145

146146
toArray(relative: boolean = false, canonical: boolean = false): string[] {
147147
var base = (relative ? path.dirname(this.target) : null);
148-
return Lazy(this.lines)
148+
return (<any>Lazy(this.lines))
149149
.filter(line => !!line.ref)
150150
.map(line => line.getRef(base, canonical))
151151
.toArray();

src/tsd/support/BundleManager.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class BundleManager {
2626
addToBundle(target: string, refs: string[], save: boolean): Promise<BundleChange> {
2727
return this.readBundle(target, true).then((bundle: Bundle) => {
2828
var change = new BundleChange(bundle);
29+
2930
refs.forEach((ref) => {
3031
change.add(bundle.append(ref));
3132
});
@@ -89,7 +90,7 @@ class BundleManager {
8990
target = path.resolve(target);
9091

9192
return this.cleanupBundle(target, false).then((change) => {
92-
return fileIO.glob('*/*.d.ts', {
93+
return fileIO.glob('*/*.d.ts', <any>{
9394
cwd: change.bundle.baseDir
9495
}).then((paths) => {
9596
paths.forEach((def) => {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
install _debugger --save -c 5937bd
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
2+
- _debugger / _debugger : 5937bd : 2015-07-22 00:07
3+
-> node > node
4+
5+
5937bd | 2015-07-22 00:07 | basarat @ basarat
6+
| feat(node) _debugger API
7+
8+
>> running install..
9+
10+
>> written 2 files:
11+
12+
- _debugger/_debugger.d.ts
13+
- node/node.d.ts
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"version": "v4",
3+
"repo": "borisyankov/DefinitelyTyped",
4+
"ref": "master",
5+
"path": "typings",
6+
"bundle": "typings/tsd.d.ts",
7+
"installed": {
8+
"_debugger/_debugger.d.ts": {
9+
"commit": "5937bdd91a0f45a6d4c2f8a5692990fbce573764"
10+
},
11+
"node/node.d.ts": {
12+
"commit": "273a567b0a0bcc34cbf2a2470b2febc95796b644"
13+
}
14+
}
15+
}

0 commit comments

Comments
 (0)