Skip to content

Commit 78869de

Browse files
author
Deyan Ginev
authored
Merge pull request #154 from EddyVerbruggen/package-pinning-and-iosTeamId-setting
Pin node modules & save the iOS Team ID
2 parents 1d675c3 + 1b05a63 commit 78869de

File tree

3 files changed

+43
-21
lines changed

3 files changed

+43
-21
lines changed

package.json

+19-15
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,25 @@
2626
"license": "SEE LICENSE IN LICENSE.txt",
2727
"dependencies": {
2828
"vscode-chrome-debug-core": "3.9.1",
29-
"node-ipc": "^8.9.2",
30-
"source-map": "^0.5.3",
29+
"node-ipc": "8.10.3",
30+
"source-map": "0.5.6",
3131
"xmlhttprequest": "https://github.com/telerik/node-XMLHttpRequest/tarball/master",
32-
"universal-analytics": "^0.4.6",
33-
"vscode-debugadapter": "^1.14.0",
34-
"vscode-debugprotocol": "^1.14.0"
32+
"universal-analytics": "0.4.13",
33+
"vscode-debugadapter": "1.19.0",
34+
"vscode-debugprotocol": "1.19.0"
3535
},
3636
"devDependencies": {
37-
"@types/es6-collections": "^0.5.29",
38-
"@types/es6-promise": "^0.0.32",
39-
"@types/mocha": "^2.2.32",
40-
"@types/node": "^6.0.46",
41-
"@types/source-map": "^0.1.29",
37+
"@types/es6-collections": "0.5.30",
38+
"@types/es6-promise": "0.0.32",
39+
"@types/mocha": "2.2.41",
40+
"@types/node": "6.0.46",
41+
"@types/source-map": "~0.1.0",
4242
"chrome-remote-debug-protocol": "git://github.com/roblourens/chrome-remote-debug-protocol.git",
43-
"mocha": "^2.4.5",
44-
"typescript": "^2.4.0",
45-
"vsce": "^1.18.0",
46-
"vscode": "^1.0.3",
47-
"vscode-debugadapter-testsupport": "^1.7.0"
43+
"mocha": "2.5.3",
44+
"typescript": "~2.4.0",
45+
"vsce": "1.22.0",
46+
"vscode": "1.1.0",
47+
"vscode-debugadapter-testsupport": "1.19.0"
4848
},
4949
"scripts": {
5050
"clean": "git clean -fdx",
@@ -75,6 +75,10 @@
7575
"type": "string",
7676
"default": "tns",
7777
"description": "Path to the NativeScript CLI executable."
78+
},
79+
"nativescript.iosTeamId": {
80+
"type": "string",
81+
"description": "The iOS development Team ID."
7882
}
7983
}
8084
},

src/debug-adapter/webKitDebugAdapter.ts

+1
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ export class WebKitDebugAdapter implements DebugProtocol.IDebugAdapter {
158158
if(selectedTeam) {
159159
// add the selected by the user Team Id
160160
tnsArgs = (tnsArgs || []).concat(['--teamId', selectedTeam.id]);
161+
Services.logger().log(`[NSDebugAdapter] Using iOS Team ID '${selectedTeam.id}', you can change this in the workspace settings.\n`, Tags.FrontendMessage);
161162
}
162163
}
163164
}

src/ipc/extensionServer.ts

+23-6
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import * as crypto from 'crypto';
55
import * as vscode from 'vscode';
66
import * as extProtocol from './extensionProtocol';
77
import {Services} from '../services/extensionHostServices';
8+
import {QuickPickItem} from "vscode";
89
let ipc = require('node-ipc');
910

1011
export class ExtensionServer {
@@ -70,21 +71,37 @@ export class ExtensionServer {
7071
return Services.analyticsService().runRunCommand(args.platform);
7172
}
7273

73-
public selectTeam() : Promise<{ id: string, name: string }> {
74+
public selectTeam(): Promise<{ id: string, name: string }> {
7475
return new Promise((resolve, reject) => {
76+
const workspaceTeamId = vscode.workspace.getConfiguration().get<string>("nativescript.iosTeamId");
77+
78+
if (workspaceTeamId) {
79+
resolve({
80+
id: workspaceTeamId,
81+
name: undefined // irrelevant
82+
});
83+
return;
84+
}
85+
7586
let developmentTeams = this.getDevelopmentTeams();
76-
if(developmentTeams.length > 1) {
77-
let quickPickItems = developmentTeams.map((team) => {
87+
if (developmentTeams.length > 1) {
88+
let quickPickItems: Array<QuickPickItem> = developmentTeams.map((team) => {
7889
return {
7990
label: team.name,
8091
description: team.id
8192
};
8293
});
83-
vscode.window.showQuickPick(quickPickItems)
84-
.then(val => resolve({
94+
vscode.window.showQuickPick(
95+
quickPickItems, {
96+
placeHolder: "Select your development team"
97+
})
98+
.then((val: QuickPickItem) => {
99+
vscode.workspace.getConfiguration().update("nativescript.iosTeamId", val.description);
100+
resolve({
85101
id: val.description,
86102
name: val.label
87-
}));
103+
})
104+
});
88105
} else {
89106
resolve();
90107
}

0 commit comments

Comments
 (0)