author
int64
658
755k
date
stringlengths
19
19
timezone
int64
-46,800
43.2k
hash
stringlengths
40
40
message
stringlengths
5
490
mods
list
language
stringclasses
20 values
license
stringclasses
3 values
repo
stringlengths
5
68
original_message
stringlengths
12
491
329,089
01.02.2022 19:44:09
28,800
1e56691066162fa8ed9e78ef361a7a3ad2590194
add test for trades stream also fix GlobalSymbolTest() by adding more exchange exceptions
[ { "change_type": "MODIFY", "old_path": "tests/ExchangeSharpTests/ExchangeTests.cs", "new_path": "tests/ExchangeSharpTests/ExchangeTests.cs", "diff": "@@ -14,6 +14,7 @@ using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\n+using System.Threading;\nusing System.Threading.Tasks;\nusing ExchangeSharp;\n@@ -100,7 +101,9 @@ namespace ExchangeSharpTests\nif (api is ExchangeUfoDexAPI || api is ExchangeOKExAPI || api is ExchangeHitBTCAPI || api is ExchangeKuCoinAPI ||\napi is ExchangeOKCoinAPI || api is ExchangeDigifinexAPI || api is ExchangeNDAXAPI || api is ExchangeBL3PAPI ||\napi is ExchangeBinanceUSAPI || api is ExchangeBinanceJerseyAPI || api is ExchangeBinanceDEXAPI ||\n- api is ExchangeBitMEXAPI || api is ExchangeBTSEAPI || api is ExchangeBybitAPI)\n+ api is ExchangeBitMEXAPI || api is ExchangeBTSEAPI || api is ExchangeBybitAPI ||\n+ api is ExchangeAquanowAPI || api is ExchangeBitfinexAPI || api is ExchangeBittrexAPI ||\n+ api is ExchangeFTXAPI || api is ExchangeFTXUSAPI || api is ExchangeGateIoAPI || api is ExchangeCoinmateAPI)\n{\n// WIP\ncontinue;\n@@ -146,5 +149,52 @@ namespace ExchangeSharpTests\n}\n}\n}\n+\n+ [TestMethod]\n+ public async Task TradesWebsocketTest()\n+ {\n+ foreach (IExchangeAPI api in await ExchangeAPI.GetExchangeAPIsAsync())\n+ {\n+\n+ if (api is ExchangeBinanceDEXAPI // volume too low\n+ || api is ExchangeBinanceJerseyAPI // ceased operations\n+ || api is ExchangeBittrexAPI // uses SignalR\n+ || api is ExchangeBL3PAPI // volume too low\n+ || api is ExchangeLivecoinAPI // defunct\n+ || api is ExchangeOKCoinAPI // volume appears to be too low\n+ ) { continue; }\n+ //if (api is ExchangeKrakenAPI)\n+ try\n+ {\n+ var delayCTS = new CancellationTokenSource();\n+ var marketSymbols = await api.GetMarketSymbolsAsync();\n+ string testSymbol = null;\n+ if (api is ExchangeKrakenAPI) testSymbol = \"XBTUSD\";\n+ if (testSymbol == null) testSymbol = marketSymbols.Where(s => // usually highest volume so we're not waiting around here\n+ (s.ToUpper().Contains(\"BTC\") || s.ToUpper().Contains(\"XBT\"))\n+ && s.ToUpper().Contains(\"USD\")\n+ && !(s.ToUpper().Contains(\"TBTC\") || s.ToUpper().Contains(\"WBTC\")\n+ || s.ToUpper().Contains(\"NHBTC\") || s.ToUpper().Contains(\"BTC3L\")\n+ || s.ToUpper().Contains(\"USDC\") || s.ToUpper().Contains(\"SUSD\")\n+ || s.ToUpper().Contains(\"BTC-TUSD\")))\n+ .FirstOrDefault();\n+ if (testSymbol == null) testSymbol = marketSymbols.First();\n+ bool thisExchangePassed = false;\n+ using (var socket = await api.GetTradesWebSocketAsync(async kvp =>\n+ {\n+ thisExchangePassed = true;\n+ delayCTS.Cancel(); // msg received. this exchange passes\n+ }, testSymbol))\n+ {\n+ socket.Disconnected += async s => Assert.Fail($\"disconnected by exchange {api.GetType().Name}\");\n+ await Task.Delay(100000, delayCTS.Token);\n+ if (!thisExchangePassed) Assert.Fail($\"No msgs recieved after 100 seconds for exchange {api.GetType().Name}\");\n+ }\n+ }\n+ catch (NotImplementedException) { } // no need to test exchanges where trades websocket is not implemented\n+ catch (TaskCanceledException) { } // if the delay task is cancelled\n+ catch (Exception ex) { Assert.Fail($\"For exchange {api.GetType().Name}, encountered exception {ex}\"); }\n+ }\n+ }\n}\n}\n" } ]
C#
MIT License
jjxtra/exchangesharp
add test for trades stream (#726) - also fix GlobalSymbolTest() by adding more exchange exceptions
329,089
02.02.2022 17:56:30
28,800
f576bf0107382826e381a61a3127107c2b181582
parse QuoteCurrency in NDAX MarketSymbolMetadata
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/NDAX/Models/Instrument.cs", "new_path": "src/ExchangeSharp/API/Exchanges/NDAX/Models/Instrument.cs", "diff": "@@ -63,6 +63,7 @@ namespace ExchangeSharp\nreturn new ExchangeMarket()\n{\nBaseCurrency = Product1Symbol,\n+ QuoteCurrency = Product2Symbol,\nIsActive = SessionStatus.Equals(\"running\", StringComparison.InvariantCultureIgnoreCase),\nMarginEnabled = false,\nMarketId = InstrumentId.ToStringInvariant(),\n" } ]
C#
MIT License
jjxtra/exchangesharp
parse QuoteCurrency in NDAX MarketSymbolMetadata (#727)
329,089
03.02.2022 17:50:30
28,800
fbcc1e38abe697e504cb1f86cfa6a2d6610df9e1
test time zone for trades stream
[ { "change_type": "MODIFY", "old_path": "tests/ExchangeSharpTests/ExchangeTests.cs", "new_path": "tests/ExchangeSharpTests/ExchangeTests.cs", "diff": "@@ -162,6 +162,7 @@ namespace ExchangeSharpTests\n|| api is ExchangeBL3PAPI // volume too low\n|| api is ExchangeLivecoinAPI // defunct\n|| api is ExchangeOKCoinAPI // volume appears to be too low\n+ || api is ExchangeNDAXAPI // volume too low for automated testing\n) { continue; }\n//if (api is ExchangeKrakenAPI)\ntry\n@@ -181,19 +182,26 @@ namespace ExchangeSharpTests\nif (testSymbol == null) testSymbol = marketSymbols.First();\nbool thisExchangePassed = false;\nusing (var socket = await api.GetTradesWebSocketAsync(async kvp =>\n+ {\n+ if (!kvp.Value.Flags.HasFlag(ExchangeTradeFlags.IsFromSnapshot))\n+ { // skip over any snapshot ones bc we cannot test time zone on those\n+ if (kvp.Value.Timestamp.Hour == DateTime.UtcNow.Hour)\n{\nthisExchangePassed = true;\ndelayCTS.Cancel(); // msg received. this exchange passes\n+ }\n+ else Assert.Fail($\"Trades are not in the UTC time zone for exchange {api.GetType().Name}.\");\n+ }\n}, testSymbol))\n{\nsocket.Disconnected += async s => Assert.Fail($\"disconnected by exchange {api.GetType().Name}\");\nawait Task.Delay(100000, delayCTS.Token);\n- if (!thisExchangePassed) Assert.Fail($\"No msgs recieved after 100 seconds for exchange {api.GetType().Name}\");\n+ if (!thisExchangePassed) Assert.Fail($\"No msgs recieved after 100 seconds for exchange {api.GetType().Name}.\");\n}\n}\ncatch (NotImplementedException) { } // no need to test exchanges where trades websocket is not implemented\ncatch (TaskCanceledException) { } // if the delay task is cancelled\n- catch (Exception ex) { Assert.Fail($\"For exchange {api.GetType().Name}, encountered exception {ex}\"); }\n+ catch (Exception ex) { Assert.Fail($\"For exchange {api.GetType().Name}, encountered exception {ex}.\"); }\n}\n}\n}\n" } ]
C#
MIT License
jjxtra/exchangesharp
test time zone for trades stream (#729)
329,089
05.02.2022 17:18:10
28,800
786de5e495b51a9c3b90608a794725525c9e04e5
change ExchangeMarket properties to nullable Not all exchanges provide every property. Instead of returning a value like decimal.MaxValue or 0, null should be returned instead. That way, the user cna decide how to handle it.
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/Coinbase/ExchangeCoinbaseAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/Coinbase/ExchangeCoinbaseAPI.cs", "diff": "@@ -210,7 +210,7 @@ namespace ExchangeSharp\nprotected override async Task<IEnumerable<string>> OnGetMarketSymbolsAsync()\n{\n- return (await GetMarketSymbolsMetadataAsync()).Where(market => market.IsActive).Select(market => market.MarketSymbol);\n+ return (await GetMarketSymbolsMetadataAsync()).Where(market => market.IsActive ?? true).Select(market => market.MarketSymbol);\n}\nprotected override async Task<IReadOnlyDictionary<string, ExchangeCurrency>> OnGetCurrenciesAsync()\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/_Base/ExchangeAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/_Base/ExchangeAPI.cs", "diff": "@@ -245,7 +245,9 @@ namespace ExchangeSharp\nprotected async Task<decimal> ClampOrderPrice(string marketSymbol, decimal outputPrice)\n{\nExchangeMarket? market = await GetExchangeMarketFromCacheAsync(marketSymbol);\n- return market == null ? outputPrice : CryptoUtility.ClampDecimal(market.MinPrice, market.MaxPrice, market.PriceStepSize, outputPrice);\n+ if (market.MinPrice == null || market.MaxPrice == null || market.PriceStepSize == null)\n+ throw new NotImplementedException($\"Exchange must return {nameof(market.MinPrice)} and {nameof(market.MaxPrice)} in order for {nameof(ClampOrderPrice)}() to work\");\n+ else return market == null ? outputPrice : CryptoUtility.ClampDecimal(market.MinPrice.Value, market.MaxPrice.Value, market.PriceStepSize, outputPrice);\n}\n/// <summary>\n@@ -257,7 +259,9 @@ namespace ExchangeSharp\nprotected async Task<decimal> ClampOrderQuantity(string marketSymbol, decimal outputQuantity)\n{\nExchangeMarket? market = await GetExchangeMarketFromCacheAsync(marketSymbol);\n- return market == null ? outputQuantity : CryptoUtility.ClampDecimal(market.MinTradeSize, market.MaxTradeSize, market.QuantityStepSize, outputQuantity);\n+ if (market.MinPrice == null || market.MaxPrice == null || market.PriceStepSize == null)\n+ throw new NotImplementedException($\"Exchange must return {nameof(market.MinPrice)} and {nameof(market.MaxPrice)} in order for {nameof(ClampOrderQuantity)}() to work\");\n+ else return market == null ? outputQuantity : CryptoUtility.ClampDecimal(market.MinTradeSize.Value, market.MaxTradeSize.Value, market.QuantityStepSize, outputQuantity);\n}\n/// <summary>\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/Model/ExchangeMarket.cs", "new_path": "src/ExchangeSharp/Model/ExchangeMarket.cs", "diff": "@@ -28,7 +28,7 @@ namespace ExchangeSharp\npublic string AltMarketSymbol2 { get; set; }\n/// <summary>A value indicating whether the market is active.</summary>\n- public bool IsActive { get; set; }\n+ public bool? IsActive { get; set; }\n/// <summary>In a pair like ZRX/BTC, BTC is the quote currency.</summary>\npublic string QuoteCurrency { get; set; }\n@@ -38,10 +38,10 @@ namespace ExchangeSharp\n/// <summary>The minimum size of the trade in the unit of \"BaseCurrency\". For example, in\n/// DOGE/BTC the MinTradeSize is currently 423.72881356 DOGE</summary>\n- public decimal MinTradeSize { get; set; }\n+ public decimal? MinTradeSize { get; set; }\n/// <summary>The maximum size of the trade in the unit of \"BaseCurrency\".</summary>\n- public decimal MaxTradeSize { get; set; } = decimal.MaxValue;\n+ public decimal? MaxTradeSize { get; set; }\n/// <summary>The minimum size of the trade in the unit of \"QuoteCurrency\". To determine an order's\n/// trade size in terms of the Quote Currency, you need to calculate: price * quantity\n@@ -54,10 +54,10 @@ namespace ExchangeSharp\npublic decimal? MaxTradeSizeInQuoteCurrency { get; set; }\n/// <summary>The minimum price of the pair.</summary>\n- public decimal MinPrice { get; set; }\n+ public decimal? MinPrice { get; set; }\n/// <summary>The maximum price of the pair.</summary>\n- public decimal MaxPrice { get; set; } = decimal.MaxValue;\n+ public decimal? MaxPrice { get; set; }\n/// <summary>Defines the intervals that a price can be increased/decreased by. The following\n/// must be true for price: Price % PriceStepSize == 0 Null if unknown or not applicable.</summary>\n@@ -71,7 +71,7 @@ namespace ExchangeSharp\n/// <summary>\n/// Margin trading enabled for this market\n/// </summary>\n- public bool MarginEnabled { get; set; }\n+ public bool? MarginEnabled { get; set; }\npublic override string ToString()\n{\n" } ]
C#
MIT License
jjxtra/exchangesharp
change ExchangeMarket properties to nullable (#730) - Not all exchanges provide every property. Instead of returning a value like decimal.MaxValue or 0, null should be returned instead. That way, the user cna decide how to handle it.
329,089
07.02.2022 21:09:07
28,800
8eda9c1d4e09b25f76e29abf5e751ff1efa6c603
find Korea timezone on Linux
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/Utility/CryptoUtility.cs", "new_path": "src/ExchangeSharp/Utility/CryptoUtility.cs", "diff": "@@ -37,7 +37,8 @@ namespace ExchangeSharp\ninternal static readonly DateTime UnixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);\ninternal static readonly DateTime UnixEpochLocal = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Local);\ninternal static readonly Encoding Utf8EncodingNoPrefix = new UTF8Encoding(false, true);\n- static string koreanZoneId = \"Korea Standard Time\";\n+ static bool isWindows = System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.Windows);\n+ static string koreanZoneId = isWindows ? \"Korea Standard Time\" : \"Asia/Seoul\";\nstatic TimeZoneInfo koreaZone = TimeZoneInfo.FindSystemTimeZoneById(koreanZoneId);\nprivate static Func<DateTime> utcNowFunc = UtcNowFuncImpl;\n" } ]
C#
MIT License
jjxtra/exchangesharp
find Korea timezone on Linux (#732)
329,089
09.02.2022 13:03:11
28,800
ddfb36e48f42fd11a7745f603a442264a5559f0c
renamed some remaining market symbols
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/Aquanow/ExchangeAquanowAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/Aquanow/ExchangeAquanowAPI.cs", "diff": "@@ -37,13 +37,13 @@ namespace ExchangeSharp\nprotected override async Task<IEnumerable<string>> OnGetMarketSymbolsAsync()\n{\n- List<string> symbols = new List<string>();\n+ List<string> marketSymbols = new List<string>();\nJToken token = await MakeJsonRequestAsync<JToken>(\"/availablesymbols\", MarketUrl);\n- foreach (string symbol in token)\n+ foreach (string marketSymbol in token)\n{\n- symbols.Add(symbol);\n+ marketSymbols.Add(marketSymbol);\n}\n- return symbols;\n+ return marketSymbols;\n}\n// NOT SUPPORTED\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/_Base/ExchangeAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/_Base/ExchangeAPI.cs", "diff": "@@ -288,7 +288,7 @@ namespace ExchangeSharp\n{\nif (string.IsNullOrEmpty(marketSymbol))\n{\n- throw new ArgumentException(\"Symbol must be non null and non empty\");\n+ throw new ArgumentException(\"Market symbol must be non null and non empty\");\n}\nstring[] pieces = marketSymbol.Split(separator);\nif (MarketSymbolIsReversed == false) //if reversed then put quote currency first\n@@ -582,7 +582,7 @@ namespace ExchangeSharp\n/// Normalize an exchange specific symbol. The symbol should already be in the correct order,\n/// this method just deals with casing and putting in the right separator.\n/// </summary>\n- /// <param name=\"marketSymbol\">Symbol</param>\n+ /// <param name=\"marketSymbol\">Market symbol</param>\n/// <returns>Normalized symbol</returns>\npublic virtual string NormalizeMarketSymbol(string? marketSymbol)\n{\n@@ -649,8 +649,8 @@ namespace ExchangeSharp\n/// <returns>Exchange market symbol</returns>\npublic virtual Task<string> CurrenciesToExchangeMarketSymbol(string baseCurrency, string quoteCurrency)\n{\n- string symbol = (MarketSymbolIsReversed ? $\"{quoteCurrency}{MarketSymbolSeparator}{baseCurrency}\" : $\"{baseCurrency}{MarketSymbolSeparator}{quoteCurrency}\");\n- return Task.FromResult(MarketSymbolIsUppercase ? symbol.ToUpperInvariant() : symbol);\n+ string marketSymbol = (MarketSymbolIsReversed ? $\"{quoteCurrency}{MarketSymbolSeparator}{baseCurrency}\" : $\"{baseCurrency}{MarketSymbolSeparator}{quoteCurrency}\");\n+ return Task.FromResult(MarketSymbolIsUppercase ? marketSymbol.ToUpperInvariant() : marketSymbol);\n}\n/// <summary>\n@@ -1070,7 +1070,7 @@ namespace ExchangeSharp\n/// <summary>\n/// Get open margin position\n/// </summary>\n- /// <param name=\"marketSymbol\">Symbol</param>\n+ /// <param name=\"marketSymbol\">Market symbol</param>\n/// <returns>Open margin position result</returns>\npublic virtual async Task<ExchangeMarginPositionResult> GetOpenPositionAsync(string marketSymbol)\n{\n@@ -1081,7 +1081,7 @@ namespace ExchangeSharp\n/// <summary>\n/// Close a margin position\n/// </summary>\n- /// <param name=\"marketSymbol\">Symbol</param>\n+ /// <param name=\"marketSymbol\">Market symbol</param>\n/// <returns>Close margin position result</returns>\npublic virtual async Task<ExchangeCloseMarginPositionResult> CloseMarginPositionAsync(string marketSymbol)\n{\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/_Base/ExchangeAPIExtensions.cs", "new_path": "src/ExchangeSharp/API/Exchanges/_Base/ExchangeAPIExtensions.cs", "diff": "@@ -244,7 +244,7 @@ namespace ExchangeSharp\n/// The order book is scanned until an amount of bids or asks that will fulfill the order is found and then the order is placed at the lowest bid or highest ask price multiplied\n/// by priceThreshold.\n/// </summary>\n- /// <param name=\"symbol\">Symbol to sell</param>\n+ /// <param name=\"marketSymbol\">Symbol to sell</param>\n/// <param name=\"amount\">Amount to sell</param>\n/// <param name=\"isBuy\">True for buy, false for sell</param>\n/// <param name=\"orderBookCount\">Amount of bids/asks to request in the order book</param>\n@@ -254,7 +254,7 @@ namespace ExchangeSharp\n/// This ensures that your order does not buy or sell at an extreme margin.</param>\n/// <param name=\"abortIfOrderBookTooSmall\">Whether to abort if the order book does not have enough bids or ask amounts to fulfill the order.</param>\n/// <returns>Order result</returns>\n- public static async Task<ExchangeOrderResult> PlaceSafeMarketOrderAsync(this ExchangeAPI api, string symbol, decimal amount, bool isBuy, int orderBookCount = 100, decimal priceThreshold = 0.9m,\n+ public static async Task<ExchangeOrderResult> PlaceSafeMarketOrderAsync(this ExchangeAPI api, string marketSymbol, decimal amount, bool isBuy, int orderBookCount = 100, decimal priceThreshold = 0.9m,\ndecimal thresholdToAbort = 0.75m, bool abortIfOrderBookTooSmall = false)\n{\nif (priceThreshold > 0.9m)\n@@ -270,10 +270,10 @@ namespace ExchangeSharp\n{\npriceThreshold = 1.0m / priceThreshold;\n}\n- ExchangeOrderBook book = await api.GetOrderBookAsync(symbol, orderBookCount);\n+ ExchangeOrderBook book = await api.GetOrderBookAsync(marketSymbol, orderBookCount);\nif (book == null || (isBuy && book.Asks.Count == 0) || (!isBuy && book.Bids.Count == 0))\n{\n- throw new APIException($\"Error getting order book for {symbol}\");\n+ throw new APIException($\"Error getting order book for {marketSymbol}\");\n}\ndecimal counter = 0m;\ndecimal highPrice = decimal.MinValue;\n@@ -306,11 +306,11 @@ namespace ExchangeSharp\n}\nif (abortIfOrderBookTooSmall && counter < amount)\n{\n- throw new APIException($\"{(isBuy ? \"Buy\" : \"Sell\") } order for {symbol} and amount {amount} cannot be fulfilled because the order book is too thin.\");\n+ throw new APIException($\"{(isBuy ? \"Buy\" : \"Sell\") } order for {marketSymbol} and amount {amount} cannot be fulfilled because the order book is too thin.\");\n}\nelse if (lowPrice / highPrice < thresholdToAbort)\n{\n- throw new APIException($\"{(isBuy ? \"Buy\" : \"Sell\")} order for {symbol} and amount {amount} would place for a price below threshold of {thresholdToAbort}, aborting.\");\n+ throw new APIException($\"{(isBuy ? \"Buy\" : \"Sell\")} order for {marketSymbol} and amount {amount} would place for a price below threshold of {thresholdToAbort}, aborting.\");\n}\nExchangeOrderRequest request = new ExchangeOrderRequest\n{\n@@ -319,7 +319,7 @@ namespace ExchangeSharp\nOrderType = OrderType.Limit,\nPrice = CryptoUtility.RoundAmount((isBuy ? highPrice : lowPrice) * priceThreshold),\nShouldRoundAmount = true,\n- MarketSymbol = symbol\n+ MarketSymbol = marketSymbol\n};\nExchangeOrderResult result = await api.PlaceOrderAsync(request);\n@@ -329,7 +329,7 @@ namespace ExchangeSharp\nfor (; i < maxTries; i++)\n{\nawait System.Threading.Tasks.Task.Delay(500);\n- result = await api.GetOrderDetailsAsync(result.OrderId, marketSymbol: symbol);\n+ result = await api.GetOrderDetailsAsync(result.OrderId, marketSymbol: marketSymbol);\nswitch (result.Result)\n{\ncase ExchangeAPIOrderResult.Filled:\n@@ -343,7 +343,7 @@ namespace ExchangeSharp\nif (i == maxTries)\n{\n- throw new APIException($\"{(isBuy ? \"Buy\" : \"Sell\")} order for {symbol} and amount {amount} timed out and may not have been fulfilled\");\n+ throw new APIException($\"{(isBuy ? \"Buy\" : \"Sell\")} order for {marketSymbol} and amount {amount} timed out and may not have been fulfilled\");\n}\nreturn result;\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/_Base/ExchangeLogger.cs", "new_path": "src/ExchangeSharp/API/Exchanges/_Base/ExchangeLogger.cs", "diff": "@@ -316,7 +316,7 @@ namespace ExchangeSharp\npublic IExchangeAPI API { get; private set; }\n/// <summary>\n- /// The symbol being logged\n+ /// The market symbol being logged\n/// </summary>\npublic string MarketSymbol { get; private set; }\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/_Base/IExchangeAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/_Base/IExchangeAPI.cs", "diff": "@@ -25,7 +25,7 @@ namespace ExchangeSharp\n#region Utility Methods\n/// <summary>\n- /// Normalize a symbol for use on this exchange.\n+ /// Normalize a market symbol for use on this exchange.\n/// </summary>\n/// <param name=\"marketSymbol\">Symbol</param>\n/// <returns>Normalized symbol</returns>\n" } ]
C#
MIT License
jjxtra/exchangesharp
renamed some remaining market symbols (#733)
329,089
13.02.2022 16:05:31
28,800
c1bd98520fa938befe9462803eecb9675655055d
fix KuCoin trade stream ID parsing Trade IDs in KuCoin are no longer hexadecimals - they are now strings which can incorporate any letter
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/_Base/ExchangeAPIExtensions.cs", "new_path": "src/ExchangeSharp/API/Exchanges/_Base/ExchangeAPIExtensions.cs", "diff": "@@ -604,8 +604,8 @@ namespace ExchangeSharp\n{\nvar trade = ParseTradeComponents<KuCoinTrade>(token, amountKey, priceKey, typeKey,\ntimestampKey, timestampType, idKey, typeKeyIsBuyValue);\n- trade.MakerOrderId = token[\"makerOrderId\"].ToStringInvariant().StringToByteArray();\n- trade.TakerOrderId = token[\"takerOrderId\"].ToStringInvariant().StringToByteArray();\n+ trade.MakerOrderId = token[\"makerOrderId\"].ToStringInvariant();\n+ trade.TakerOrderId = token[\"takerOrderId\"].ToStringInvariant();\nreturn trade;\n}\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/Utility/CryptoUtility.cs", "new_path": "src/ExchangeSharp/Utility/CryptoUtility.cs", "diff": "@@ -270,33 +270,6 @@ namespace ExchangeSharp\nreturn result;\n}\n- /// <summary>\n- /// Converts a hex string to a byte array\n- /// </summary>\n- /// <param name=\"hex\">hex string</param>\n- /// <returns>byte array representation of the same string</returns>\n- public static byte[] StringToByteArray(this string hex)\n- { // https://stackoverflow.com/questions/321370/how-can-i-convert-a-hex-string-to-a-byte-array\n- return Enumerable.Range(0, hex.Length / 2)\n- .Select(x => Convert\n- .ToByte(hex.Substring(x * 2, 2), 16))\n- .ToArray();\n- }\n-\n- public static string ToHexString(this byte[] bytes)\n- {\n- var sb = new StringBuilder();\n-\n- // Loop through each byte of the hashed data\n- // and format each one as a hexadecimal string.\n- for (int i = 0; i < bytes.Length; i++)\n- {\n- sb.Append(bytes[i].ToString(\"x2\"));\n- }\n-\n- return sb.ToString();\n- }\n-\n/// <summary>\n/// Covnert a secure string to a non-secure string\n/// </summary>\n" } ]
C#
MIT License
jjxtra/exchangesharp
fix KuCoin trade stream ID parsing (#736) - Trade IDs in KuCoin are no longer hexadecimals - they are now strings which can incorporate any letter
329,089
15.02.2022 12:27:13
28,800
fe0929c25358a1f78e1ab373f3303663997c58af
parse Bybit specific CrossSequence in Trades stream
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/Bybit/ExchangeBybitAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/Bybit/ExchangeBybitAPI.cs", "diff": "@@ -274,12 +274,12 @@ namespace ExchangeSharp\n{\nforeach (var dataRow in token)\n{\n- ExchangeTrade trade = dataRow.ParseTrade(\n+ var trade = dataRow.ParseTradeBybit(\namountKey: \"size\",\npriceKey: \"price\",\ntypeKey: \"side\",\n- timestampKey: \"timestamp\",\n- timestampType: TimestampType.Iso8601UTC,\n+ timestampKey: \"trade_time_ms\",\n+ timestampType: TimestampType.UnixMilliseconds,\nidKey: \"trade_id\");\nawait callback(new KeyValuePair<string, ExchangeTrade>(dataRow[\"symbol\"].ToStringInvariant(), trade));\n}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/ExchangeSharp/API/Exchanges/Bybit/Models/BybitTrade.cs", "diff": "+using System;\n+using System.Collections.Generic;\n+using System.Text;\n+\n+namespace ExchangeSharp.Bybit\n+{\n+ public class BybitTrade : ExchangeTrade\n+ {\n+ /// <summary>\n+ /// Cross sequence (internal value)\n+ /// </summary>\n+ public long CrossSequence { get; set; }\n+ public override string ToString()\n+ {\n+ return string.Format(\"{0},{1}\", base.ToString(), CrossSequence);\n+ }\n+\n+ }\n+}\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/_Base/ExchangeAPIExtensions.cs", "new_path": "src/ExchangeSharp/API/Exchanges/_Base/ExchangeAPIExtensions.cs", "diff": "@@ -24,6 +24,7 @@ using ExchangeSharp.KuCoin;\nusing Newtonsoft.Json.Linq;\nusing ExchangeSharp.NDAX;\nusing ExchangeSharp.API.Exchanges.FTX.Models;\n+using ExchangeSharp.Bybit;\nnamespace ExchangeSharp\n{\n@@ -540,6 +541,15 @@ namespace ExchangeSharp\nreturn trade;\n}\n+ internal static ExchangeTrade ParseTradeBybit(this JToken token, object amountKey, object priceKey, object typeKey,\n+ object timestampKey, TimestampType timestampType, object idKey, string typeKeyIsBuyValue = \"buy\")\n+ {\n+ var trade = ParseTradeComponents<BybitTrade>(token, amountKey, priceKey, typeKey,\n+ timestampKey, timestampType, idKey, typeKeyIsBuyValue);\n+ trade.CrossSequence = token[\"cross_seq\"].ConvertInvariant<long>();\n+ return trade;\n+ }\n+\ninternal static ExchangeTrade ParseTradeBinanceDEX(this JToken token, object amountKey, object priceKey, object typeKey,\nobject timestampKey, TimestampType timestampType, object idKey, string typeKeyIsBuyValue = \"buy\")\n{\n" } ]
C#
MIT License
jjxtra/exchangesharp
parse Bybit specific CrossSequence in Trades stream (#737)
329,089
16.02.2022 18:33:00
28,800
ae96858e7e36a82bb7efb7f6450763335d765e84
fix Poloniex trade stream simplified OnGetMarketSymbolsAsync() updated OnGetMarketSymbolsMetadataAsync() to use returnticker endpoint instead changed OnGetTradesWebSocketAsync() to send messageIds instead of symbol names also changed to using epoch_ms instead of timestamp for more precision
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/Poloniex/ExchangePoloniexAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/Poloniex/ExchangePoloniexAPI.cs", "diff": "@@ -326,29 +326,31 @@ namespace ExchangeSharp\nprotected override async Task<IEnumerable<string>> OnGetMarketSymbolsAsync()\n{\n- List<string> symbols = new List<string>();\n- var tickers = await GetTickersAsync();\n- foreach (var kv in tickers)\n- {\n- symbols.Add(kv.Key);\n- }\n- return symbols;\n+ return (await GetMarketSymbolsMetadataAsync()).Where(x => x.IsActive.Value).Select(x => x.MarketSymbol);\n}\nprotected internal override async Task<IEnumerable<ExchangeMarket>> OnGetMarketSymbolsMetadataAsync()\n{\n- //https://poloniex.com/public?command=returnOrderBook&currencyPair=all&depth=0\n+ //https://docs.poloniex.com/#returnticker\n/*\n- * \"BTC_CLAM\": {\n- \"asks\": [],\n- \"bids\": [],\n+ {\n+ \"BTC_BTS\": {\n+ \"id\": 14,\n+ \"last\": \"0.00000090\",\n+ \"lowestAsk\": \"0.00000091\",\n+ \"highestBid\": \"0.00000089\",\n+ \"percentChange\": \"-0.02173913\",\n+ \"baseVolume\": \"0.28698296\",\n+ \"quoteVolume\": \"328356.84081156\",\n\"isFrozen\": \"0\",\n- \"seq\": 37268918\n+ \"postOnly\": \"0\",\n+ \"high24hr\": \"0.00000093\",\n+ \"low24hr\": \"0.00000087\"\n},...\n*/\nvar markets = new List<ExchangeMarket>();\n- Dictionary<string, JToken> lookup = await MakeJsonRequestAsync<Dictionary<string, JToken>>(\"/public?command=returnOrderBook&currencyPair=all&depth=0\");\n+ Dictionary<string, JToken> lookup = await MakeJsonRequestAsync<Dictionary<string, JToken>>(\"/public?command=returnTicker\");\n// StepSize is 8 decimal places for both price and amount on everything at Polo\nconst decimal StepSize = 0.00000001m;\nconst decimal minTradeSize = 0.0001m;\n@@ -358,7 +360,8 @@ namespace ExchangeSharp\nvar market = new ExchangeMarket { MarketSymbol = kvp.Key, IsActive = false };\nstring isFrozen = kvp.Value[\"isFrozen\"].ToStringInvariant();\n- if (string.Equals(isFrozen, \"0\"))\n+ string postOnly = kvp.Value[\"postOnly\"].ToStringInvariant();\n+ if (string.Equals(isFrozen, \"0\") && string.Equals(postOnly, \"0\"))\n{\nmarket.IsActive = true;\n}\n@@ -366,6 +369,7 @@ namespace ExchangeSharp\nstring[] pairs = kvp.Key.Split('_');\nif (pairs.Length == 2)\n{\n+ market.MarketId = kvp.Value[\"id\"].ToStringLowerInvariant();\nmarket.QuoteCurrency = pairs[0];\nmarket.BaseCurrency = pairs[1];\nmarket.PriceStepSize = StepSize;\n@@ -440,10 +444,19 @@ namespace ExchangeSharp\nprotected override async Task<IWebSocket> OnGetTradesWebSocketAsync(Func<KeyValuePair<string, ExchangeTrade>, Task> callback, params string[] marketSymbols)\n{\n- Dictionary<int, Tuple<string, long>> messageIdToSymbol = new Dictionary<int, Tuple<string, long>>();\n+ Dictionary<int, string> messageIdToSymbol = new Dictionary<int, string>();\n+ Dictionary<string, int> symbolToMessageId = new Dictionary<string, int>();\n+ var symMeta = await GetMarketSymbolsMetadataAsync();\n+ foreach (var symbol in symMeta)\n+ {\n+ messageIdToSymbol.Add(int.Parse(symbol.MarketId), symbol.MarketSymbol);\n+ symbolToMessageId.Add(symbol.MarketSymbol, int.Parse(symbol.MarketId));\n+ }\nreturn await ConnectPublicWebSocketAsync(string.Empty, async (_socket, msg) =>\n{\nJToken token = JToken.Parse(msg.ToStringFromUTF8());\n+ if (token.Type == JTokenType.Object && token[\"error\"] != null)\n+ throw new APIException($\"Exchange returned error: {token[\"error\"].ToStringInvariant()}\");\nint msgId = token[0].ConvertInvariant<int>();\nif (msgId == 1010 || token.Count() == 2) // \"[7,2]\"\n@@ -459,18 +472,17 @@ namespace ExchangeSharp\nvar dataType = data[0].ToStringInvariant();\nif (dataType == \"i\")\n{\n- var marketInfo = data[1];\n- var market = marketInfo[\"currencyPair\"].ToStringInvariant();\n- messageIdToSymbol[msgId] = new Tuple<string, long>(market, 0);\n+ // can also populate messageIdToSymbol from here\n+ continue;\n}\nelse if (dataType == \"t\")\n{\n- if (messageIdToSymbol.TryGetValue(msgId, out Tuple<string, long> symbol))\n- { // 0 1 2 3 4 5\n- // [\"t\", \"<trade id>\", <1 for buy 0 for sell>, \"<price>\", \"<size>\", <timestamp>]\n- ExchangeTrade trade = data.ParseTrade(amountKey: 4, priceKey: 3, typeKey: 2, timestampKey: 5,\n- timestampType: TimestampType.UnixSeconds, idKey: 1, typeKeyIsBuyValue: \"1\");\n- await callback(new KeyValuePair<string, ExchangeTrade>(symbol.Item1, trade));\n+ if (messageIdToSymbol.TryGetValue(msgId, out string symbol))\n+ { // 0 1 2 3 4 5 6\n+ // [\"t\", \"<trade id>\", <1 for buy 0 for sell>, \"<price>\", \"<size>\", <timestamp>, \"<epoch_ms>\"]\n+ ExchangeTrade trade = data.ParseTrade(amountKey: 4, priceKey: 3, typeKey: 2, timestampKey: 6,\n+ timestampType: TimestampType.UnixMilliseconds, idKey: 1, typeKeyIsBuyValue: \"1\");\n+ await callback(new KeyValuePair<string, ExchangeTrade>(symbol, trade));\n}\n}\nelse if (dataType == \"o\")\n@@ -484,14 +496,19 @@ namespace ExchangeSharp\n}\n}, async (_socket) =>\n{\n+ IEnumerable<int> marketIDs = null;\nif (marketSymbols == null || marketSymbols.Length == 0)\n{\n- marketSymbols = (await GetMarketSymbolsAsync()).ToArray();\n+ marketIDs = messageIdToSymbol.Keys;\n+ }\n+ else\n+ {\n+ marketIDs = marketSymbols.Select(s => symbolToMessageId[s]);\n}\n// subscribe to order book and trades channel for each symbol\n- foreach (var sym in marketSymbols)\n+ foreach (var id in marketIDs)\n{\n- await _socket.SendMessageAsync(new { command = \"subscribe\", channel = NormalizeMarketSymbol(sym) });\n+ await _socket.SendMessageAsync(new { command = \"subscribe\", channel = id });\n}\n});\n}\n" } ]
C#
MIT License
jjxtra/exchangesharp
fix Poloniex trade stream (#738) - simplified OnGetMarketSymbolsAsync() - updated OnGetMarketSymbolsMetadataAsync() to use returnticker endpoint instead - changed OnGetTradesWebSocketAsync() to send messageIds instead of symbol names - also changed to using epoch_ms instead of timestamp for more precision
329,089
17.02.2022 20:10:35
28,800
063f646d6ed046df6aefd573e6102f66ba8f86a1
add trade stream to Gate.IO fixed ExchangeMarket.Active bug
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/GateIo/ExchangeGateIoAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/GateIo/ExchangeGateIoAPI.cs", "diff": "@@ -83,6 +83,7 @@ namespace ExchangeSharp\n{\nforeach (JToken token in obj)\n{\n+ if (token[\"trade_status\"].ToStringLowerInvariant() == \"tradable\")\nsymbols.Add(token[\"id\"].ToStringInvariant());\n}\n}\n@@ -117,7 +118,7 @@ namespace ExchangeSharp\nvar market = new ExchangeMarket\n{\nMarketSymbol = marketSymbolToken[\"id\"].ToStringUpperInvariant(),\n- IsActive = marketSymbolToken[\"trade_status\"].ToStringUpperInvariant() == \"tradable\",\n+ IsActive = marketSymbolToken[\"trade_status\"].ToStringLowerInvariant() == \"tradable\",\nQuoteCurrency = marketSymbolToken[\"quote\"].ToStringUpperInvariant(),\nBaseCurrency = marketSymbolToken[\"base\"].ToStringUpperInvariant(),\n};\n@@ -433,15 +434,15 @@ namespace ExchangeSharp\nawait MakeJsonRequestAsync<JToken>($\"/spot/orders/{orderId}?currency_pair={symbol}\", BaseUrl, payload, \"DELETE\");\n}\n+ string unixTimeInSeconds => ((long)CryptoUtility.UnixTimestampFromDateTimeSeconds(DateTime.Now)).ToStringInvariant();\nprotected override async Task ProcessRequestAsync(IHttpWebRequest request, Dictionary<string, object>? payload)\n{\nif (CanMakeAuthenticatedRequest(payload))\n{\npayload.Remove(\"nonce\");\n- var timestamp = ((long)CryptoUtility.UnixTimestampFromDateTimeSeconds(DateTime.Now)).ToStringInvariant();\nrequest.AddHeader(\"KEY\", PublicApiKey!.ToUnsecureString());\n- request.AddHeader(\"Timestamp\", timestamp);\n+ request.AddHeader(\"Timestamp\", unixTimeInSeconds);\nvar privateApiKey = PrivateApiKey!.ToUnsecureString();\n@@ -453,7 +454,7 @@ namespace ExchangeSharp\nvar hashBytes = sha512Hash.ComputeHash(sourceBytes);\nvar bodyHash = BitConverter.ToString(hashBytes).Replace(\"-\", \"\").ToLowerInvariant();\nvar queryString = string.IsNullOrEmpty(request.RequestUri.Query) ? \"\" : request.RequestUri.Query.Substring(1);\n- var signatureString = $\"{request.Method}\\n{request.RequestUri.AbsolutePath}\\n{queryString}\\n{bodyHash}\\n{timestamp}\";\n+ var signatureString = $\"{request.Method}\\n{request.RequestUri.AbsolutePath}\\n{queryString}\\n{bodyHash}\\n{unixTimeInSeconds}\";\nusing (HMACSHA512 hmac = new HMACSHA512(Encoding.UTF8.GetBytes(privateApiKey)))\n{\n@@ -469,5 +470,52 @@ namespace ExchangeSharp\nawait base.ProcessRequestAsync(request, payload);\n}\n}\n+\n+ protected override async Task<IWebSocket> OnGetTradesWebSocketAsync(Func<KeyValuePair<string, ExchangeTrade>, Task> callback, params string[] marketSymbols)\n+ {\n+ if (marketSymbols == null || marketSymbols.Length == 0)\n+ {\n+ marketSymbols = (await GetMarketSymbolsAsync(true)).ToArray();\n+ }\n+ return await ConnectPublicWebSocketAsync(null, messageCallback: async (_socket, msg) =>\n+ {\n+ JToken parsedMsg = JToken.Parse(msg.ToStringFromUTF8());\n+\n+ if (parsedMsg[\"channel\"].ToStringInvariant().Equals(\"spot.trades\"))\n+ {\n+ if (parsedMsg[\"error\"] != null)\n+ throw new APIException($\"Exchange returned error: {parsedMsg[\"error\"].ToStringInvariant()}\");\n+ else if (parsedMsg[\"result\"][\"status\"].ToStringInvariant().Equals(\"success\"))\n+ {\n+ // successfully subscribed to trade stream\n+ }\n+ else\n+ {\n+ var exchangeTrade = parsedMsg[\"result\"].ParseTrade(\"amount\", \"price\", \"side\", \"create_time_ms\", TimestampType.UnixMillisecondsDouble, \"id\");\n+\n+ await callback(new KeyValuePair<string, ExchangeTrade>(parsedMsg[\"result\"][\"currency_pair\"].ToStringInvariant(), exchangeTrade));\n+ }\n+ }\n+ }, connectCallback: async (_socket) =>\n+ {/*{ \"time\": int(time.time()),\n+ \"channel\": \"spot.trades\",\n+ \"event\": \"subscribe\", # \"unsubscribe\" for unsubscription\n+ \"payload\": [\"BTC_USDT\"]\n+ }*/\n+\n+ // this doesn't work for some reason\n+ //await _socket.SendMessageAsync(new\n+ //{\n+ // time = unixTimeInSeconds,\n+ // channel = \"spot.trades\",\n+ // @event = \"subscribe\",\n+ // payload = marketSymbols,\n+ //});\n+ var quotedSymbols = marketSymbols.Select(s => $\"\\\"{s}\\\"\");\n+ var combinedString = string.Join(\",\", quotedSymbols);\n+ await _socket.SendMessageAsync(\n+ $\"{{ \\\"time\\\": {unixTimeInSeconds},\\\"channel\\\": \\\"spot.trades\\\",\\\"event\\\": \\\"subscribe\\\",\\\"payload\\\": [{combinedString}] }}\");\n+ });\n+ }\n}\n}\n" } ]
C#
MIT License
jjxtra/exchangesharp
add trade stream to Gate.IO (#739) - fixed ExchangeMarket.Active bug
329,089
18.02.2022 14:10:22
28,800
01b98e63c5988ddbfaa4613cae05894eb14885b8
add trade stream for Bitflyer
[ { "change_type": "ADD", "old_path": null, "new_path": "src/ExchangeSharp/API/Exchanges/Bitflyer/ExchangeBitflyerApi.cs", "diff": "+using Newtonsoft.Json.Linq;\n+using SocketIOClient;\n+using System;\n+using System.Collections.Generic;\n+using System.Linq;\n+using System.Text;\n+using System.Threading;\n+using System.Threading.Tasks;\n+\n+namespace ExchangeSharp\n+{\n+ public sealed partial class ExchangeBitflyerApi : ExchangeAPI\n+ {\n+ public override string BaseUrl { get; set; } = \"https://api.bitflyer.com\";\n+ public override string BaseUrlWebSocket { get; set; } = \"https://io.lightstream.bitflyer.com\";\n+\n+ public ExchangeBitflyerApi()\n+ {\n+ //NonceStyle = new guid\n+ //NonceOffset not needed\n+ // WebSocketOrderBookType = not implemented\n+ MarketSymbolSeparator = \"_\";\n+ MarketSymbolIsUppercase = true;\n+ // ExchangeGlobalCurrencyReplacements[] not implemented\n+ }\n+\n+ protected override async Task<IEnumerable<string>> OnGetMarketSymbolsAsync()\n+ {\n+ /*\n+ [\n+ {\n+ \"product_code\": \"BTC_JPY\",\n+ \"market_type\": \"Spot\"\n+ },\n+ {\n+ \"product_code\": \"XRP_JPY\",\n+ \"market_type\": \"Spot\"\n+ },\n+ {\n+ \"product_code\": \"ETH_JPY\",\n+ \"market_type\": \"Spot\"\n+ },\n+ {\n+ \"product_code\": \"XLM_JPY\",\n+ \"market_type\": \"Spot\"\n+ },\n+ {\n+ \"product_code\": \"MONA_JPY\",\n+ \"market_type\": \"Spot\"\n+ },\n+ {\n+ \"product_code\": \"ETH_BTC\",\n+ \"market_type\": \"Spot\"\n+ },\n+ {\n+ \"product_code\": \"BCH_BTC\",\n+ \"market_type\": \"Spot\"\n+ },\n+ {\n+ \"product_code\": \"FX_BTC_JPY\",\n+ \"market_type\": \"FX\"\n+ },\n+ {\n+ \"product_code\": \"BTCJPY12MAR2021\",\n+ \"alias\": \"BTCJPY_MAT1WK\",\n+ \"market_type\": \"Futures\"\n+ },\n+ {\n+ \"product_code\": \"BTCJPY19MAR2021\",\n+ \"alias\": \"BTCJPY_MAT2WK\",\n+ \"market_type\": \"Futures\"\n+ },\n+ {\n+ \"product_code\": \"BTCJPY26MAR2021\",\n+ \"alias\": \"BTCJPY_MAT3M\",\n+ \"market_type\": \"Futures\"\n+ }\n+ ]\n+ */\n+ JToken instruments = await MakeJsonRequestAsync<JToken>(\"v1/getmarkets\");\n+ var markets = new List<ExchangeMarket>();\n+ foreach (JToken instrument in instruments)\n+ {\n+ markets.Add(new ExchangeMarket\n+ {\n+ MarketSymbol = instrument[\"product_code\"].ToStringUpperInvariant(),\n+ AltMarketSymbol = instrument[\"alias\"].ToStringInvariant(),\n+ AltMarketSymbol2 = instrument[\"market_type\"].ToStringInvariant(),\n+ });\n+ }\n+ return markets.Select(m => m.MarketSymbol);\n+ }\n+ protected override async Task<IWebSocket> OnGetTradesWebSocketAsync(Func<KeyValuePair<string, ExchangeTrade>, Task> callback, params string[] marketSymbols)\n+ {\n+ if (marketSymbols == null || marketSymbols.Length == 0)\n+ {\n+ marketSymbols = (await GetMarketSymbolsAsync()).ToArray();\n+ }\n+ var client = new SocketIOWrapper(BaseUrlWebSocket);\n+\n+ foreach (var marketSymbol in marketSymbols)\n+ { // {product_code} can be obtained from the market list. It cannot be an alias.\n+ // BTC/JPY (Spot): lightning_executions_BTC_JPY\n+ client.socketIO.On($\"lightning_executions_{marketSymbol}\", response =>\n+ { /* [[ {\n+ \"id\": 39361,\n+ \"side\": \"SELL\",\n+ \"price\": 35100,\n+ \"size\": 0.01,\n+ \"exec_date\": \"2015-07-07T10:44:33.547Z\",\n+ \"buy_child_order_acceptance_id\": \"JRF20150707-014356-184990\",\n+ \"sell_child_order_acceptance_id\": \"JRF20150707-104433-186048\"\n+ } ]] */\n+ var token = JToken.Parse(response.ToStringInvariant());\n+ foreach (var tradeToken in token[0])\n+ {\n+ var trade = tradeToken.ParseTradeBitflyer(\"size\", \"price\", \"side\", \"exec_date\", TimestampType.Iso8601UTC, \"id\");\n+\n+ // If it is executed during an Itayose, it will be an empty string.\n+ if (string.IsNullOrWhiteSpace(tradeToken[\"side\"].ToStringInvariant()))\n+ trade.Flags |= ExchangeTradeFlags.HasNoSide;\n+\n+ callback(new KeyValuePair<string, ExchangeTrade>(marketSymbol, trade)).Wait();\n+ }\n+ });\n+ }\n+\n+ client.socketIO.OnConnected += async (sender, e) =>\n+ {\n+ foreach (var marketSymbol in marketSymbols)\n+ { // {product_code} can be obtained from the market list. It cannot be an alias.\n+ // BTC/JPY (Spot): lightning_executions_BTC_JPY\n+ await client.socketIO.EmitAsync(\"subscribe\", $\"lightning_executions_{marketSymbol}\");\n+ }\n+ };\n+ await client.socketIO.ConnectAsync();\n+ return client;\n+ }\n+ }\n+\n+ class SocketIOWrapper : IWebSocket\n+ {\n+ public SocketIO socketIO;\n+ public SocketIOWrapper(string url)\n+ {\n+ socketIO = new SocketIO(url);\n+ socketIO.Options.Transport = SocketIOClient.Transport.TransportProtocol.WebSocket;\n+ socketIO.OnConnected += (s, e) => Connected?.Invoke(this);\n+ socketIO.OnDisconnected += (s, e) => Disconnected?.Invoke(this);\n+ }\n+\n+ public TimeSpan ConnectInterval\n+ { get => socketIO.Options.ConnectionTimeout; set => socketIO.Options.ConnectionTimeout = value; }\n+\n+ public TimeSpan KeepAlive\n+ { get => throw new NotSupportedException(); set => throw new NotSupportedException(); }\n+\n+ public event WebSocketConnectionDelegate Connected;\n+ public event WebSocketConnectionDelegate Disconnected;\n+\n+ public Task<bool> SendMessageAsync(object message) => throw new NotImplementedException();\n+\n+ public void Dispose() => socketIO.Dispose();\n+ }\n+\n+ public partial class ExchangeName { public const string Bitflyer = \"Bitflyer\"; }\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "src/ExchangeSharp/API/Exchanges/Bitflyer/Models/BitflyerTrade.cs", "diff": "+using System;\n+using System.Collections.Generic;\n+using System.Text;\n+\n+namespace ExchangeSharp.Bitflyer\n+{\n+ public class BitflyerTrade : ExchangeTrade\n+ {\n+ public string BuyChildOrderAcceptanceId { get; set; }\n+ public string SellChildOrderAcceptanceId { get; set; }\n+\n+ public override string ToString()\n+ {\n+ return string.Format(\"{0},{1}, {2}\", base.ToString(), BuyChildOrderAcceptanceId, SellChildOrderAcceptanceId);\n+ }\n+ }\n+}\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/_Base/ExchangeAPIExtensions.cs", "new_path": "src/ExchangeSharp/API/Exchanges/_Base/ExchangeAPIExtensions.cs", "diff": "@@ -25,6 +25,7 @@ using Newtonsoft.Json.Linq;\nusing ExchangeSharp.NDAX;\nusing ExchangeSharp.API.Exchanges.FTX.Models;\nusing ExchangeSharp.Bybit;\n+using ExchangeSharp.Bitflyer;\nnamespace ExchangeSharp\n{\n@@ -541,6 +542,16 @@ namespace ExchangeSharp\nreturn trade;\n}\n+ internal static ExchangeTrade ParseTradeBitflyer(this JToken token, object amountKey, object priceKey, object typeKey,\n+ object timestampKey, TimestampType timestampType, object idKey, string typeKeyIsBuyValue = \"buy\")\n+ {\n+ var trade = ParseTradeComponents<BitflyerTrade>(token, amountKey, priceKey, typeKey,\n+ timestampKey, timestampType, idKey, typeKeyIsBuyValue);\n+ trade.BuyChildOrderAcceptanceId = token[\"buy_child_order_acceptance_id\"].ConvertInvariant<string>();\n+ trade.SellChildOrderAcceptanceId = token[\"sell_child_order_acceptance_id\"].ConvertInvariant<string>();\n+ return trade;\n+ }\n+\ninternal static ExchangeTrade ParseTradeBybit(this JToken token, object amountKey, object priceKey, object typeKey,\nobject timestampKey, TimestampType timestampType, object idKey, string typeKeyIsBuyValue = \"buy\")\n{\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/ExchangeSharp.csproj", "new_path": "src/ExchangeSharp/ExchangeSharp.csproj", "diff": "<PackageReference Include=\"Microsoft.CodeAnalysis.Analyzers\" Version=\"2.9.7\" />\n<PackageReference Include=\"Newtonsoft.Json\" Version=\"11.0.2\" />\n<PackageReference Include=\"NLog\" Version=\"4.5.10\" />\n+ <PackageReference Include=\"SocketIOClient\" Version=\"3.0.5\" />\n<PackageReference Include=\"System.Configuration.ConfigurationManager\" Version=\"4.5.0\" />\n</ItemGroup>\n" } ]
C#
MIT License
jjxtra/exchangesharp
add trade stream for Bitflyer (#740)
329,089
19.02.2022 21:13:48
28,800
9e14991c57fbd66c9b376b14f0330baa429cbe7c
add trade stream to LBank
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/LBank/ExchangeLBankAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/LBank/ExchangeLBankAPI.cs", "diff": "@@ -39,6 +39,8 @@ namespace ExchangeSharp\n/// </summary>\npublic override string BaseUrl { get; set; } = \"https://api.lbank.info/v1\";\n+ public override string BaseUrlWebSocket { get; set; } = \"wss://www.lbkex.net/ws/V2/\";\n+\n/// <summary>\n/// Gets the name of the API.\n/// </summary>\n@@ -539,6 +541,63 @@ namespace ExchangeSharp\n#endregion PARSERS PrivateAPI\n+ #region Websockets\n+ protected override async Task<IWebSocket> OnGetTradesWebSocketAsync(Func<KeyValuePair<string, ExchangeTrade>, Task> callback, params string[] marketSymbols)\n+ {\n+ if (marketSymbols == null || marketSymbols.Length == 0)\n+ {\n+ marketSymbols = (await GetMarketSymbolsAsync()).ToArray();\n+ }\n+ return await ConnectPublicWebSocketAsync(\"\", async (_socket, msg) =>\n+ {\n+ /* {\n+ \"trade\":{\n+ \"volume\":6.3607,\n+ \"amount\":77148.9303,\n+ \"price\":12129,\n+ \"direction\":\"sell\",\n+ \"TS\":\"2019-06-28T19:55:49.460\"\n+ },\n+ \"type\":\"trade\",\n+ \"pair\":\"btc_usdt\",\n+ \"SERVER\":\"V2\",\n+ \"TS\":\"2019-06-28T19:55:49.466\"\n+ }*/\n+ JToken token = JToken.Parse(msg.ToStringFromUTF8());\n+ if (token[\"status\"].ToStringInvariant() == \"error\")\n+ {\n+ if (token[\"message\"].ToStringInvariant().Contains(\"Invalid order pairs\"))\n+ {\n+ // ignore, bc invalid order pairs are normal in LBank\n+ }\n+ else throw new APIException(token[\"message\"].ToStringInvariant());\n+ }\n+ else if (token[\"type\"].ToStringInvariant() == \"trade\")\n+ {\n+ var trade = token[\"trade\"].ParseTrade(\"amount\", \"price\", \"direction\", \"TS\", TimestampType.Iso8601China, null);\n+ string marketSymbol = token[\"pair\"].ToStringInvariant();\n+ await callback(new KeyValuePair<string, ExchangeTrade>(marketSymbol, trade));\n+ }\n+ }, async (_socket) =>\n+ { /* {\n+ \"action\":\"subscribe\",\n+ \"subscribe\":\"trade\",\n+ \"pair\":\"eth_btc\"\n+ }*/\n+ foreach (var marketSymbol in marketSymbols)\n+ {\n+ var subscribeRequest = new\n+ {\n+ action = \"subscribe\",\n+ subscribe = \"trade\",\n+ pair = marketSymbol,\n+ };\n+ await _socket.SendMessageAsync(subscribeRequest);\n+ }\n+ });\n+ }\n+ #endregion\n+\n#region HELPERS\nprotected override async Task ProcessRequestAsync(IHttpWebRequest request, Dictionary<string, object> payload)\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/Utility/CryptoUtility.cs", "new_path": "src/ExchangeSharp/Utility/CryptoUtility.cs", "diff": "@@ -38,6 +38,8 @@ namespace ExchangeSharp\ninternal static readonly DateTime UnixEpochLocal = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Local);\ninternal static readonly Encoding Utf8EncodingNoPrefix = new UTF8Encoding(false, true);\nstatic bool isWindows = System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(OSPlatform.Windows);\n+ static string chinaZoneId = isWindows ? \"China Standard Time\" : \"Asia/Shanghai\";\n+ static TimeZoneInfo chinaZone = TimeZoneInfo.FindSystemTimeZoneById(chinaZoneId);\nstatic string koreanZoneId = isWindows ? \"Korea Standard Time\" : \"Asia/Seoul\";\nstatic TimeZoneInfo koreaZone = TimeZoneInfo.FindSystemTimeZoneById(koreanZoneId);\n@@ -188,7 +190,7 @@ namespace ExchangeSharp\n{\n/// <summary> time zone is specifically specified in string </summary>\nAsSpecified,\n- Local, Korea, UTC\n+ Local, China, Korea, UTC,\n}\n/// <summary>\n/// Convert object to a UTC DateTime\n@@ -215,6 +217,8 @@ namespace ExchangeSharp\nthrow new NotImplementedException(); // TODO: implement this when needed\ncase SourceTimeZone.Local:\nreturn DateTime.SpecifyKind(dt, DateTimeKind.Local).ToUniversalTime(); // convert to UTC\n+ case SourceTimeZone.China:\n+ return TimeZoneInfo.ConvertTime(dt, chinaZone, TimeZoneInfo.Utc); // convert to UTC\ncase SourceTimeZone.Korea:\nreturn TimeZoneInfo.ConvertTime(dt, koreaZone, TimeZoneInfo.Utc); // convert to UTC\ncase SourceTimeZone.UTC:\n@@ -693,6 +697,9 @@ namespace ExchangeSharp\ncase TimestampType.Iso8601Local:\nreturn value.ToDateTimeInvariant(SourceTimeZone.Local);\n+ case TimestampType.Iso8601China:\n+ return value.ToDateTimeInvariant(SourceTimeZone.China);\n+\ncase TimestampType.Iso8601Korea:\nreturn value.ToDateTimeInvariant(SourceTimeZone.Korea);\n@@ -1481,6 +1488,11 @@ namespace ExchangeSharp\n/// </summary>\nIso8601Local,\n+ /// <summary>\n+ /// ISO 8601 in china Standard Time\n+ /// </summary>\n+ Iso8601China,\n+\n/// <summary>\n/// ISO 8601 in Korea Standard Time\n/// </summary>\n" } ]
C#
MIT License
jjxtra/exchangesharp
add trade stream to LBank (#741)
329,089
20.02.2022 20:16:39
28,800
ccaafde25e24413fcabe2df242ce9b19bd99fb92
update Huobi trade stream
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/Huobi/ExchangeHuobiAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/Huobi/ExchangeHuobiAPI.cs", "diff": "@@ -228,23 +228,24 @@ namespace ExchangeSharp\n{\"id\":\"id1\",\"status\":\"ok\",\"subbed\":\"market.btcusdt.trade.detail\",\"ts\":1527574853489}\n-{{\n+{\n\"ch\":\"market.btcusdt.trade.detail\",\n- \"ts\": 1527574905759,\n+ \"ts\":1630994963175,\n\"tick\":{\n- \"id\": 8232977476,\n- \"ts\": 1527574905623,\n+ \"id\":137005445109,\n+ \"ts\":1630994963173,\n\"data\":[\n{\n- \"amount\": 0.3066,\n- \"ts\": 1527574905623,\n- \"id\": 82329774765058180723,\n- \"price\": 7101.81,\n+ \"id\":137005445109359286410323766,\n+ \"ts\":1630994963173,\n+ \"tradeId\":102523573486,\n+ \"amount\":0.006754,\n+ \"price\":52648.62,\n\"direction\":\"buy\"\n}\n]\n}\n-}}\n+}\n*/\nvar str = msg.ToStringFromUTF8Gzip();\nJToken token = JToken.Parse(str);\n@@ -266,7 +267,6 @@ namespace ExchangeSharp\nvar marketSymbol = sArray[1];\nvar tick = token[\"tick\"];\n- var id = tick[\"id\"].ConvertInvariant<long>();\nvar data = tick[\"data\"];\nvar trades = ParseTradesWebSocket(data);\n@@ -919,7 +919,7 @@ namespace ExchangeSharp\nvar trades = new List<ExchangeTrade>();\nforeach (var t in token)\n{\n- trades.Add(t.ParseTrade(\"amount\", \"price\", \"direction\", \"ts\", TimestampType.UnixMilliseconds, \"id\"));\n+ trades.Add(t.ParseTrade(\"amount\", \"price\", \"direction\", \"ts\", TimestampType.UnixMilliseconds, \"tradeId\"));\n}\nreturn trades;\n" } ]
C#
MIT License
jjxtra/exchangesharp
update Huobi trade stream (#742)
329,089
22.02.2022 15:13:43
28,800
7d2ced134f584b48d8baf81e1cf6ecfee0ff2fb5
add trade stream for Dydx
[ { "change_type": "ADD", "old_path": null, "new_path": "src/ExchangeSharp/API/Exchanges/Dydx/ExchangeDydxApi.cs", "diff": "+using Newtonsoft.Json.Linq;\n+using System;\n+using System.Collections.Generic;\n+using System.Linq;\n+using System.Text;\n+using System.Threading.Tasks;\n+\n+namespace ExchangeSharp\n+{\n+ public sealed partial class ExchangeDydxApi : ExchangeAPI\n+ {\n+ public override string BaseUrl { get; set; } = \"https://api.dydx.exchange\";\n+ public override string BaseUrlWebSocket { get; set; } = \"wss://api.dydx.exchange/v3/ws\";\n+\n+ public ExchangeDydxApi()\n+ {\n+ NonceStyle = NonceStyle.Iso8601;\n+ NonceOffset = TimeSpan.FromSeconds(0.1);\n+ // WebSocketOrderBookType = not implemented\n+ MarketSymbolSeparator = \"-\";\n+ MarketSymbolIsUppercase = true;\n+ // ExchangeGlobalCurrencyReplacements[] not implemented\n+ }\n+\n+ protected override async Task<IEnumerable<string>> OnGetMarketSymbolsAsync()\n+ {\n+ /*{\n+ \"markets\": {\n+ \"LINK-USD\": {\n+ \"market\": \"LINK-USD\",\n+ \"status\": \"ONLINE\",\n+ \"baseAsset\": \"LINK\",\n+ \"quoteAsset\": \"USD\",\n+ \"stepSize\": \"0.1\",\n+ \"tickSize\": \"0.01\",\n+ \"indexPrice\": \"12\",\n+ \"oraclePrice\": \"101\",\n+ \"priceChange24H\": \"0\",\n+ \"nextFundingRate\": \"0.0000125000\",\n+ \"nextFundingAt\": \"2021-03-01T18:00:00.000Z\",\n+ \"minOrderSize\": \"1\",\n+ \"type\": \"PERPETUAL\",\n+ \"initialMarginFraction\": \"0.10\",\n+ \"maintenanceMarginFraction\": \"0.05\",\n+ \"baselinePositionSize\": \"1000\",\n+ \"incrementalPositionSize\": \"1000\",\n+ \"incrementalInitialMarginFraction\": \"0.2\",\n+ \"volume24H\": \"0\",\n+ \"trades24H\": \"0\",\n+ \"openInterest\": \"0\",\n+ \"maxPositionSize\": \"10000\",\n+ \"assetResolution\": \"10000000\",\n+ \"syntheticAssetId\": \"0x4c494e4b2d37000000000000000000\",\n+ },\n+ ...\n+ }*/\n+ var instruments = await MakeJsonRequestAsync<JToken>(\"v3/markets\");\n+ var markets = new List<ExchangeMarket>();\n+ foreach (JToken instrument in instruments[\"markets\"])\n+ {\n+ markets.Add(new ExchangeMarket\n+ {\n+ MarketSymbol = instrument.ElementAt(0)[\"market\"].ToStringInvariant(),\n+ QuoteCurrency = instrument.ElementAt(0)[\"quoteAsset\"].ToStringInvariant(),\n+ BaseCurrency = instrument.ElementAt(0)[\"baseAsset\"].ToStringInvariant(),\n+ });\n+ }\n+ return markets.Select(m => m.MarketSymbol);\n+ }\n+\n+ protected override async Task<IWebSocket> OnGetTradesWebSocketAsync(Func<KeyValuePair<string, ExchangeTrade>, Task> callback, params string[] marketSymbols)\n+ {\n+ if (marketSymbols == null || marketSymbols.Length == 0)\n+ {\n+ marketSymbols = (await GetMarketSymbolsAsync()).ToArray();\n+ }\n+ return await ConnectPublicWebSocketAsync(\"\", async (_socket, msg) =>\n+ {\n+ /*Example initial response:\n+ {\n+ \"type\": \"subscribed\",\n+ \"id\": \"BTC-USD\",\n+ \"connection_id\": \"e2a6c717-6f77-4c1c-ac22-72ce2b7ed77d\",\n+ \"channel\": \"v3_trades\",\n+ \"message_id\": 1,\n+ \"contents\": {\n+ \"trades\": [\n+ {\n+ \"side\": \"BUY\",\n+ \"size\": \"100\",\n+ \"price\": \"4000\",\n+ \"createdAt\": \"2020-10-29T00:26:30.759Z\"\n+ },\n+ {\n+ \"side\": \"BUY\",\n+ \"size\": \"100\",\n+ \"price\": \"4000\",\n+ \"createdAt\": \"2020-11-02T19:45:42.886Z\"\n+ },\n+ {\n+ \"side\": \"BUY\",\n+ \"size\": \"100\",\n+ \"price\": \"4000\",\n+ \"createdAt\": \"2020-10-29T00:26:57.382Z\"\n+ }\n+ ]\n+ }\n+ }*/\n+ /* Example subsequent response\n+ {\n+ \"type\": \"channel_data\",\n+ \"id\": \"BTC-USD\",\n+ \"connection_id\": \"e2a6c717-6f77-4c1c-ac22-72ce2b7ed77d\",\n+ \"channel\": \"v3_trades\",\n+ \"message_id\": 2,\n+ \"contents\": {\n+ \"trades\": [\n+ {\n+ \"side\": \"BUY\",\n+ \"size\": \"100\",\n+ \"price\": \"4000\",\n+ \"createdAt\": \"2020-11-29T00:26:30.759Z\"\n+ },\n+ {\n+ \"side\": \"SELL\",\n+ \"size\": \"100\",\n+ \"price\": \"4000\",\n+ \"createdAt\": \"2020-11-29T14:00:03.382Z\"\n+ }\n+ ]\n+ }\n+ } */\n+ JToken token = JToken.Parse(msg.ToStringFromUTF8());\n+ if (token[\"type\"].ToStringInvariant() == \"error\")\n+ {\n+ throw new APIException(token[\"message\"].ToStringInvariant());\n+ }\n+ else if (token[\"channel\"].ToStringInvariant() == \"v3_trades\")\n+ {\n+ var tradesArray = token[\"contents\"][\"trades\"].ToArray();\n+ for (int i = 0; i < tradesArray.Length; i++)\n+ {\n+ var trade = tradesArray[i].ParseTrade(\"size\", \"price\", \"side\", \"createdAt\", TimestampType.Iso8601UTC, null);\n+ string marketSymbol = token[\"id\"].ToStringInvariant();\n+ if (token[\"type\"].ToStringInvariant() == \"subscribed\" || token[\"message_id\"].ToObject<int>() == 1)\n+ {\n+ trade.Flags |= ExchangeTradeFlags.IsFromSnapshot;\n+ if (i == tradesArray.Length - 1)\n+ trade.Flags |= ExchangeTradeFlags.IsLastFromSnapshot;\n+ }\n+ await callback(new KeyValuePair<string, ExchangeTrade>(marketSymbol, trade));\n+ }\n+ }\n+ }, async (_socket) =>\n+ {\n+ foreach (var marketSymbol in marketSymbols)\n+ {\n+ var subscribeRequest = new\n+ {\n+ type = \"subscribe\",\n+ channel = \"v3_trades\",\n+ id = marketSymbol,\n+ };\n+ await _socket.SendMessageAsync(subscribeRequest);\n+ }\n+ });\n+ }\n+ }\n+ public partial class ExchangeName { public const string Dydx = \"Dydx\"; }\n+}\n" } ]
C#
MIT License
jjxtra/exchangesharp
add trade stream for Dydx (#744)
329,089
24.02.2022 13:46:41
28,800
34794b4baeefbba2d1f7541cf73aa11b8b379158
add trade stream for Crypto.com exchange
[ { "change_type": "ADD", "old_path": null, "new_path": "src/ExchangeSharp/API/Exchanges/CryptoCom/ExchangeCryptoComApi.cs", "diff": "+using Newtonsoft.Json.Linq;\n+using System;\n+using System.Collections.Generic;\n+using System.Linq;\n+using System.Text;\n+using System.Threading.Tasks;\n+\n+namespace ExchangeSharp\n+{\n+ public sealed partial class ExchangeCryptoComApi : ExchangeAPI\n+ {\n+ public override string BaseUrl { get; set; } = \"https://api.crypto.com/v2\";\n+ public override string BaseUrlWebSocket { get; set; } = \"wss://stream.crypto.com/v2\";\n+\n+ public ExchangeCryptoComApi()\n+ {\n+ NonceStyle = NonceStyle.UnixMilliseconds;\n+ NonceOffset = TimeSpan.FromSeconds(0.1);\n+ // WebSocketOrderBookType = not implemented\n+ MarketSymbolSeparator = \"_\";\n+ MarketSymbolIsUppercase = true;\n+ // ExchangeGlobalCurrencyReplacements[] not implemented\n+ }\n+\n+ protected override async Task<IEnumerable<string>> OnGetMarketSymbolsAsync()\n+ {\n+ var instruments = await MakeJsonRequestAsync<JToken>(\"public/get-instruments\");\n+ var markets = new List<ExchangeMarket>();\n+ foreach (JToken instrument in instruments[\"instruments\"])\n+ {\n+ markets.Add(new ExchangeMarket\n+ {\n+ MarketSymbol = instrument[\"instrument_name\"].ToStringUpperInvariant(),\n+ QuoteCurrency = instrument[\"quote_currency\"].ToStringInvariant(),\n+ BaseCurrency = instrument[\"base_currency\"].ToStringInvariant(),\n+ });\n+ }\n+ return markets.Select(m => m.MarketSymbol);\n+ }\n+\n+ protected override async Task<IWebSocket> OnGetTradesWebSocketAsync(Func<KeyValuePair<string, ExchangeTrade>, Task> callback, params string[] marketSymbols)\n+ {\n+ if (marketSymbols == null || marketSymbols.Length == 0)\n+ {\n+ marketSymbols = new string[] { \"\" };\n+ }\n+ return await ConnectPublicWebSocketAsync(\"/market\", async (_socket, msg) =>\n+ {\n+ /*{\n+ {{\n+ \"code\": 0,\n+ \"method\": \"subscribe\",\n+ \"result\": {\n+ \"instrument_name\": \"YFI_BTC\",\n+ \"subscription\": \"trade.YFI_BTC\",\n+ \"channel\": \"trade\",\n+ \"data\": [\n+ {\n+ \"dataTime\": 1645139769555,\n+ \"d\": 2258312914797956554,\n+ \"s\": \"BUY\",\n+ \"p\": 0.5541,\n+ \"q\": 1E-06,\n+ \"t\": 1645139769539,\n+ \"i\": \"YFI_BTC\"\n+ }\n+ ]\n+ }\n+ }}\n+ } */\n+ JToken token = JToken.Parse(msg.ToStringFromUTF8());\n+ if (token[\"method\"].ToStringInvariant() == \"ERROR\" || token[\"method\"].ToStringInvariant() == \"unknown\")\n+ {\n+ throw new APIException(token[\"code\"].ToStringInvariant() + \": \" + token[\"message\"].ToStringInvariant());\n+ }\n+ else if (token[\"method\"].ToStringInvariant() == \"public/heartbeat\")\n+ {\n+ if (token[\"message\"].ToStringInvariant() == \"server did not receive any client heartbeat, going to disconnect soon\")\n+ throw new APIException(token[\"code\"].ToStringInvariant() + \": \" + token[\"message\"].ToStringInvariant());\n+ }\n+ else if (token[\"method\"].ToStringInvariant() == \"subscribe\" && token[\"result\"] != null)\n+ {\n+ var result = token[\"result\"];\n+ var dataArray = result[\"data\"].ToArray();\n+ for (int i = 0; i < dataArray.Length; i++)\n+ {\n+ JToken data = dataArray[i];\n+ var trade = data.ParseTrade(\"q\", \"p\", \"s\", \"t\", TimestampType.UnixMilliseconds, \"d\");\n+ string marketSymbol = data[\"i\"].ToStringInvariant();\n+ if (dataArray.Length == 100) // initial snapshot contains 100 trades\n+ {\n+ trade.Flags |= ExchangeTradeFlags.IsFromSnapshot;\n+ if (i == dataArray.Length - 1)\n+ trade.Flags |= ExchangeTradeFlags.IsLastFromSnapshot;\n+ }\n+ await callback(new KeyValuePair<string, ExchangeTrade>(marketSymbol, trade));\n+ }\n+ }\n+ }, async (_socket) =>\n+ { /* We recommend adding a 1-second sleep after establishing the websocket connection, and before requests are sent.\n+ * This will avoid occurrences of rate-limit (`TOO_MANY_REQUESTS`) errors, as the websocket rate limits are pro-rated based on the calendar-second that the websocket connection was opened.\n+ */\n+ await Task.Delay(1000);\n+\n+ /*\n+ {\n+ \"id\": 11,\n+ \"method\": \"subscribe\",\n+ \"params\": {\n+ \"channels\": [\"trade.ETH_CRO\"]\n+ },\n+ \"nonce\": 1587523073344\n+ }\n+ */\n+ var subscribeRequest = new\n+ {\n+ // + consider using id field in the future to differentiate between requests\n+ method = \"subscribe\",\n+ @params = new\n+ {\n+ channels = marketSymbols.Select(s => string.IsNullOrWhiteSpace(s) ? \"trade\" : $\"trade.{s}\").ToArray(),\n+ },\n+ nonce = await GenerateNonceAsync(),\n+ };\n+ await _socket.SendMessageAsync(subscribeRequest);\n+ });\n+ }\n+ }\n+ public partial class ExchangeName { public const string CryptoCom = \"CryptoCom\"; }\n+}\n" } ]
C#
MIT License
jjxtra/exchangesharp
add trade stream for Crypto.com exchange (#746)
329,089
25.02.2022 14:25:56
28,800
0e8112071a6c2663923022966bbad5a11d69947d
update Digifinex urls also, their trades stream doesn't support subscribing to more than 30 symbols
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/Digifinex/ExchangeDigifinexAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/Digifinex/ExchangeDigifinexAPI.cs", "diff": "@@ -14,7 +14,7 @@ namespace ExchangeSharp\nprivate string[] Urls =\n{\n\"openapi.digifinex.com\",\n- \"openapi.digifinex.vip\",\n+ \"openapi.digifinex.vip\", // these other URLs don't work anymore\n\"openapi.digifinex.xyz\",\n};\n@@ -22,8 +22,8 @@ namespace ExchangeSharp\nprivate int failedUrlCount;\nprivate int successUrlCount;\n- public override string BaseUrl { get; set; } = \"https://openapi.digifinex.vip/v3\";\n- public override string BaseUrlWebSocket { get; set; } = \"wss://openapi.digifinex.vip/ws/v1/\";\n+ public override string BaseUrl { get; set; } = \"https://openapi.digifinex.com/v3\";\n+ public override string BaseUrlWebSocket { get; set; } = \"wss://openapi.digifinex.com/ws/v1/\";\nprivate int websocketMessageId = 0;\nprivate string timeWindow;\nprivate TaskCompletionSource<int> inited = new TaskCompletionSource<int>();\n@@ -41,30 +41,31 @@ namespace ExchangeSharp\nprivate void GetFastestUrl()\n{\n- var client = new HttpClient();\n- foreach (var url in Urls)\n- {\n- var u = url;\n- client.GetAsync($\"https://{u}\").ContinueWith((t) =>\n- {\n- if (t.Exception != null)\n- {\n- var count = Interlocked.Increment(ref failedUrlCount);\n- if (count == Urls.Length)\n- inited.SetException(new APIException(\"All digifinex URLs failed.\"));\n- return;\n- }\n- if (Interlocked.Increment(ref successUrlCount) == 1)\n- {\n- fastestUrl = u;\n- //Console.WriteLine($\"Fastest url {GetHashCode()}: {u}\");\n- BaseUrl = $\"https://{u}/v3\";\n- BaseUrlWebSocket = $\"wss://{u}/ws/v1/\";\n+ //var client = new HttpClient();\n+ //foreach (var url in Urls)\n+ //{\n+ // var u = url;\n+ // client.GetAsync($\"https://{u}\").ContinueWith((t) =>\n+ // {\n+ // if (t.Exception != null)\n+ // {\n+ // var count = Interlocked.Increment(ref failedUrlCount);\n+ // if (count == Urls.Length)\n+ // inited.SetException(new APIException(\"All digifinex URLs failed.\"));\n+ // return;\n+ // }\n+ // if (Interlocked.Increment(ref successUrlCount) == 1)\n+ // {\n+ // fastestUrl = u;\n+ // //Console.WriteLine($\"Fastest url {GetHashCode()}: {u}\");\n+ // BaseUrl = $\"https://{u}/v3\";\n+ // BaseUrlWebSocket = $\"wss://{u}/ws/v1/\";\n+ // inited.SetResult(1);\n+ // }\n+ // });\n+ //}\ninited.SetResult(1);\n}\n- });\n- }\n- }\n#region ProcessRequest\n@@ -463,7 +464,8 @@ namespace ExchangeSharp\n}\nelse if (marketSymbols == null || marketSymbols.Length == 0)\n{\n- marketSymbols = (await GetMarketSymbolsAsync()).ToArray();\n+ marketSymbols = (await GetMarketSymbolsAsync()).Take(30).ToArray();\n+ Logger.Warn(\"subscribing to the first 30 symbols\");\n}\nreturn await ConnectPublicWebSocketAsync(string.Empty, async (_socket, msg) =>\n{\n@@ -486,6 +488,7 @@ namespace ExchangeSharp\n// \"id\": null\n// }\nJToken token = JToken.Parse(CryptoUtility.DecompressDeflate((new ArraySegment<byte>(msg, 2, msg.Length - 2)).ToArray()).ToStringFromUTF8());\n+ // doesn't send error msgs - just disconnects\nif (token[\"method\"].ToStringLowerInvariant() == \"trades.update\")\n{\nvar args = token[\"params\"];\n" } ]
C#
MIT License
jjxtra/exchangesharp
update Digifinex urls (#747) - also, their trades stream doesn't support subscribing to more than 30 symbols
329,089
26.02.2022 15:13:21
28,800
ac674fd3d522f051358ef8fa53d892343debe357
add trade stream for ApolloX
[ { "change_type": "ADD", "old_path": null, "new_path": "src/ExchangeSharp/API/Exchanges/ApolloX/ExchangeApolloXApi.cs", "diff": "+using ExchangeSharp.BinanceGroup;\n+using Newtonsoft.Json.Linq;\n+using System;\n+using System.Collections.Generic;\n+using System.Linq;\n+using System.Text;\n+using System.Threading.Tasks;\n+\n+namespace ExchangeSharp\n+{\n+ public sealed partial class ExchangeApolloXApi : BinanceGroupCommon\n+ {\n+ public override string BaseUrl { get; set; } = \"https://fapi.apollox.finance\";\n+ public override string BaseUrlWebSocket { get; set; } = \"wss://fstream.apollox.finance\";\n+\n+ public override string BaseUrlApi => $\"{BaseUrl}/fapi/v1\";\n+ }\n+\n+ public partial class ExchangeName { public const string ApolloX = \"ApolloX\"; }\n+}\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs", "new_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs", "diff": "@@ -22,7 +22,7 @@ namespace ExchangeSharp.BinanceGroup\n{\npublic abstract class BinanceGroupCommon : ExchangeAPI\n{\n- public string BaseUrlApi => $\"{BaseUrl}/api/v3\";\n+ public virtual string BaseUrlApi => $\"{BaseUrl}/api/v3\";\npublic string BaseUrlSApi => $\"{BaseUrl}/sapi/v1\";\n@@ -53,6 +53,7 @@ namespace ExchangeSharp.BinanceGroup\nNonceStyle = NonceStyle.UnixMilliseconds;\nNonceOffset = TimeSpan.FromSeconds(15); // 15 seconds are deducted from current UTCTime as base of the request time window\nMarketSymbolSeparator = string.Empty;\n+ MarketSymbolIsUppercase = false;\nWebSocketOrderBookType = WebSocketOrderBookType.DeltasOnly;\nExchangeGlobalCurrencyReplacements[\"BCC\"] = \"BCH\";\n}\n" } ]
C#
MIT License
jjxtra/exchangesharp
add trade stream for ApolloX (#748)
329,089
27.02.2022 15:26:33
28,800
f22271c4a1400065bec6363d7c3fa051f67b4edc
parse error in FTX trade stream
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/FTX/FTXGroupCommon.cs", "new_path": "src/ExchangeSharp/API/Exchanges/FTX/FTXGroupCommon.cs", "diff": "@@ -404,7 +404,11 @@ namespace ExchangeSharp\n{\nJToken parsedMsg = JToken.Parse(msg.ToStringFromUTF8());\n- if (parsedMsg[\"channel\"].ToStringInvariant().Equals(\"trades\")\n+ if (parsedMsg[\"type\"].ToStringInvariant() == \"error\")\n+ {\n+ throw new APIException(parsedMsg[\"msg\"].ToStringInvariant());\n+ }\n+ else if (parsedMsg[\"channel\"].ToStringInvariant().Equals(\"trades\")\n&& !parsedMsg[\"type\"].ToStringInvariant().Equals(\"subscribed\"))\n{\nforeach (var data in parsedMsg[\"data\"])\n@@ -424,7 +428,7 @@ namespace ExchangeSharp\n{\nop = \"subscribe\",\nmarket = marketSymbols[i],\n- channel = \"trades\"\n+ channel = \"trades\",\n});\n}\n});\n" } ]
C#
MIT License
jjxtra/exchangesharp
parse error in FTX trade stream (#749)
329,089
28.02.2022 12:42:27
28,800
f0f9b20638c87c340b8c8cb930d21f6699a5eef1
update readme and tests with new exchanges added during this cycle
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -22,18 +22,20 @@ Feel free to visit the discord channel at https://discord.gg/58ktxXuTVK and chat\n### Exchanges\nThe following cryptocurrency exchanges are supported:\n-(Web socket key: T = tickers, R = trades, B = order book, O = private orders, U = user data)\n+(Web socket key: T = tickers, R = trades, B = orderbook / delta orderbook, O = private orders, U = user data)\n| Exchange Name | Public REST | Private REST | Web Socket | Notes |\n| -------------- | ----------- | ------------ | ---------- | ---------------------------------------- |\n+| ApolloX | x | x | T R B O U |\n| Aquanow | wip | x | |\n-| Binance | x | x | T R B U |\n-| Binance Jersey | x | x | T R B U |\n-| Binance.US | x | x | T R B U |\n+| Binance | x | x | T R B O U |\n+| Binance Jersey | x | x | T R B O U | Ceased operations\n+| Binance.US | x | x | T R B O U |\n| Binance DEX | | | R |\n| Bitbank | x | x | |\n| Bitfinex | x | x | T R O |\n-| Bithumb | x | | |\n+| Bitflyer | | | R |\n+| Bithumb | x | | R |\n| BitMEX | x | x | R O |\n| Bitstamp | x | x | R |\n| Bittrex | x | x | T R |\n@@ -41,17 +43,20 @@ The following cryptocurrency exchanges are supported:\n| Bleutrade | x | x | |\n| BTSE | x | x | |\n| Bybit | x | x | R | Has public method for Websocket Positions\n-| Coinbase | x | x | T R U |\n+| Coinbase | x | x | T R O U |\n| Coinmate | x | x | |\n+| Crypto.com | | | R |\n| Digifinex | x | x | R B |\n-| FTX | x | x | T |\n-| gate.io | x | x | |\n+| Dydx | | | R |\n+| FTX | x | x | T R |\n+| FTX.us | x | x | T R |\n+| gate.io | x | x | R |\n| Gemini | x | x | T R B |\n| HitBTC | x | x | R |\n| Huobi | x | x | R B |\n| Kraken | x | x | R | Dark order symbols not supported |\n| KuCoin | x | x | T R |\n-| LBank | x | x | |\n+| LBank | x | x | R |\n| Livecoin | x | x | |\n| NDAX | x | x | T R |\n| OKCoin | x | x | R B |\n@@ -66,7 +71,7 @@ The following cryptocurrency services are supported:\nExchange constructors are private, to get access to an exchange in code use:\n-`ExchangeAPI.GetExchangeAPIAsync`.\n+`ExchangeAPI.GetExchangeAPIAsync<>()`.\n### Installing the CLI\n" }, { "change_type": "MODIFY", "old_path": "tests/ExchangeSharpTests/ExchangeTests.cs", "new_path": "tests/ExchangeSharpTests/ExchangeTests.cs", "diff": "@@ -98,12 +98,15 @@ namespace ExchangeSharpTests\n{\ntry\n{\n- if (api is ExchangeUfoDexAPI || api is ExchangeOKExAPI || api is ExchangeHitBTCAPI || api is ExchangeKuCoinAPI ||\n- api is ExchangeOKCoinAPI || api is ExchangeDigifinexAPI || api is ExchangeNDAXAPI || api is ExchangeBL3PAPI ||\n- api is ExchangeBinanceUSAPI || api is ExchangeBinanceJerseyAPI || api is ExchangeBinanceDEXAPI ||\n+ if (api is ExchangeUfoDexAPI || api is ExchangeOKExAPI || api is ExchangeHitBTCAPI ||\n+ api is ExchangeKuCoinAPI || api is ExchangeOKCoinAPI || api is ExchangeDigifinexAPI ||\n+ api is ExchangeNDAXAPI || api is ExchangeBL3PAPI || api is ExchangeBinanceUSAPI ||\n+ api is ExchangeBinanceJerseyAPI || api is ExchangeBinanceDEXAPI || api is ExchangeBinanceAPI ||\napi is ExchangeBitMEXAPI || api is ExchangeBTSEAPI || api is ExchangeBybitAPI ||\napi is ExchangeAquanowAPI || api is ExchangeBitfinexAPI || api is ExchangeBittrexAPI ||\n- api is ExchangeFTXAPI || api is ExchangeFTXUSAPI || api is ExchangeGateIoAPI || api is ExchangeCoinmateAPI)\n+ api is ExchangeFTXAPI || api is ExchangeFTXUSAPI || api is ExchangeGateIoAPI ||\n+ api is ExchangeCoinmateAPI || api is ExchangeBitflyerApi || api is ExchangeDydxApi ||\n+ api is ExchangeCryptoComApi || api is ExchangeApolloXApi)\n{\n// WIP\ncontinue;\n@@ -160,6 +163,7 @@ namespace ExchangeSharpTests\n|| api is ExchangeBinanceJerseyAPI // ceased operations\n|| api is ExchangeBittrexAPI // uses SignalR\n|| api is ExchangeBL3PAPI // volume too low\n+ || api is ExchangeFTXUSAPI // volume too low. rely on FTX test\n|| api is ExchangeLivecoinAPI // defunct\n|| api is ExchangeOKCoinAPI // volume appears to be too low\n|| api is ExchangeNDAXAPI // volume too low for automated testing\n@@ -177,7 +181,7 @@ namespace ExchangeSharpTests\n&& !(s.ToUpper().Contains(\"TBTC\") || s.ToUpper().Contains(\"WBTC\")\n|| s.ToUpper().Contains(\"NHBTC\") || s.ToUpper().Contains(\"BTC3L\")\n|| s.ToUpper().Contains(\"USDC\") || s.ToUpper().Contains(\"SUSD\")\n- || s.ToUpper().Contains(\"BTC-TUSD\")))\n+ || s.ToUpper().Contains(\"BTC-TUSD\") || s.ToUpper().Contains(\"RENBTC_USDT\")))\n.FirstOrDefault();\nif (testSymbol == null) testSymbol = marketSymbols.First();\nbool thisExchangePassed = false;\n" } ]
C#
MIT License
jjxtra/exchangesharp
update readme and tests (#750) - with new exchanges added during this cycle
329,089
19.03.2022 21:36:31
25,200
7a7aadc79b212d79f701f7e8ea9be69e7019744f
new NuGet 1.0.0 removed LangVersion updated ExchangeSharpTests to net6.0
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -110,11 +110,11 @@ See [`WebSocket4NetClientWebSocket.cs`][websocket4net] for implementation detail\n#### dotnet CLI\n-[`dotnet add package DigitalRuby.ExchangeSharp --version 0.9.2`][nuget]\n+[`dotnet add package DigitalRuby.ExchangeSharp --version 1.0.0`][nuget]\n#### Package Manager on VS\n-[`PM> Install-Package DigitalRuby.ExchangeSharp -Version 0.9.2`][nuget]\n+[`PM> Install-Package DigitalRuby.ExchangeSharp -Version 1.0.0`][nuget]\n### Examples\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp.Forms/ExchangeSharp.Forms.csproj", "new_path": "src/ExchangeSharp.Forms/ExchangeSharp.Forms.csproj", "diff": "<TargetFramework>net6.0-windows</TargetFramework>\n<DefineConstants>HAS_WINDOWS_FORMS</DefineConstants>\n<NeutralLanguage>en</NeutralLanguage>\n- <LangVersion>8</LangVersion>\n<UseWindowsForms>true</UseWindowsForms>\n</PropertyGroup>\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/ExchangeSharp.csproj", "new_path": "src/ExchangeSharp/ExchangeSharp.csproj", "diff": "<LangVersion>8</LangVersion>\n<PackageId>DigitalRuby.ExchangeSharp</PackageId>\n<Title>ExchangeSharp - C# API for cryptocurrency exchanges</Title>\n- <PackageVersion>0.9.2</PackageVersion>\n+ <PackageVersion>1.0.0</PackageVersion>\n<Authors>jjxtra</Authors>\n<Description>ExchangeSharp is a C# API for working with various cryptocurrency exchanges. Web sockets are also supported for some exchanges.</Description>\n<Summary>Supported exchanges: Binance BitMEX Bitfinex Bithumb Bitstamp Bittrex BL3P Bleutrade BTSE Cryptopia Coinbase(GDAX) Digifinex Gemini Gitbtc Huobi Kraken Kucoin Livecoin NDAX OKCoin OKEx Poloniex TuxExchange Yobit ZBcom. Pull requests welcome.</Summary>\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/Properties/AssemblyInfo.cs", "new_path": "src/ExchangeSharp/Properties/AssemblyInfo.cs", "diff": "@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;\n//\n// You can specify all the values or you can default the Build and Revision Numbers\n// by using the '*' as shown below:\n-[assembly: AssemblyVersion(\"0.9.2\")]\n-[assembly: AssemblyFileVersion(\"0.9.2\")]\n+[assembly: AssemblyVersion(\"1.0.0\")]\n+[assembly: AssemblyFileVersion(\"1.0.0\")]\n[assembly: InternalsVisibleTo(\"ExchangeSharpTests\")]\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharpConsole/ExchangeSharpConsole.csproj", "new_path": "src/ExchangeSharpConsole/ExchangeSharpConsole.csproj", "diff": "<AssemblyName>exchange-sharp</AssemblyName>\n<TargetFramework>net6.0</TargetFramework>\n<NeutralLanguage>en</NeutralLanguage>\n- <LangVersion>8</LangVersion>\n- <AssemblyVersion>0.9.2</AssemblyVersion>\n- <FileVersion>0.9.2</FileVersion>\n+ <AssemblyVersion>1.0.0</AssemblyVersion>\n+ <FileVersion>1.0.0</FileVersion>\n</PropertyGroup>\n<ItemGroup>\n" } ]
C#
MIT License
jjxtra/exchangesharp
new NuGet 1.0.0 (#752) - removed LangVersion - updated ExchangeSharpTests to net6.0
329,120
24.03.2022 01:25:21
0
6992680e8d927a902f3218f3278ecb49632b3d38
Set MarketSymbolIsUppercase to true in ExchangeBinanceAPI
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/ExchangeBinanceAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/ExchangeBinanceAPI.cs", "diff": "@@ -18,6 +18,11 @@ namespace ExchangeSharp\n{\npublic override string BaseUrl { get; set; } = \"https://api.binance.com\";\npublic override string BaseUrlWebSocket { get; set; } = \"wss://stream.binance.com:9443\";\n+\n+ private ExchangeBinanceAPI()\n+ {\n+ MarketSymbolIsUppercase = true;\n+ }\n}\npublic partial class ExchangeName { public const string Binance = \"Binance\"; }\n" } ]
C#
MIT License
jjxtra/exchangesharp
Set MarketSymbolIsUppercase to true in ExchangeBinanceAPI (#754)
329,089
30.03.2022 15:53:53
25,200
985e28a582bd40e5db19819906dcf12addb93c5b
set RateLimit for Coinbase
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/Coinbase/ExchangeCoinbaseAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/Coinbase/ExchangeCoinbaseAPI.cs", "diff": "@@ -45,6 +45,11 @@ namespace ExchangeSharp\nNonceEndPointField = \"iso\";\nNonceEndPointStyle = NonceStyle.Iso8601;\nWebSocketOrderBookType = WebSocketOrderBookType.FullBookFirstThenDeltas;\n+ /* Rate limits from Coinbase Pro webpage\n+ * Public endpoints - We throttle public endpoints by IP: 10 requests per second, up to 15 requests per second in bursts. Some endpoints may have custom rate limits.\n+ * Private endpoints - We throttle private endpoints by profile ID: 15 requests per second, up to 30 requests per second in bursts. Some endpoints may have custom rate limits.\n+ * fills endpoint has a custom rate limit of 10 requests per second, up to 20 requests per second in bursts. */\n+ RateLimit = new RateGate(9, TimeSpan.FromSeconds(1)); // set to 9 to be safe\n}\n" } ]
C#
MIT License
jjxtra/exchangesharp
set RateLimit for Coinbase (#756)
329,089
31.03.2022 18:35:00
25,200
0eed42a7a034247c3320ab3f4736081b5cacb1bd
fixed JSON deserialization in Coinbase with new SerializerSettings added test for Coinbase Match fixed compilation error in ExchangeBinanceAPITests.cs
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Common/BaseAPI.cs", "new_path": "src/ExchangeSharp/API/Common/BaseAPI.cs", "diff": "@@ -29,6 +29,7 @@ using System.Threading.Tasks;\nusing Newtonsoft.Json;\nusing Newtonsoft.Json.Linq;\n+using Newtonsoft.Json.Serialization;\nnamespace ExchangeSharp\n{\n@@ -246,6 +247,16 @@ namespace ExchangeSharp\n/// </summary>\npublic Dictionary<string, TimeSpan> MethodCachePolicy { get; } = new Dictionary<string, TimeSpan>();\n+ public static JsonSerializerSettings SerializerSettings { get; } = new JsonSerializerSettings\n+ {\n+ FloatParseHandling = FloatParseHandling.Decimal,\n+ NullValueHandling = NullValueHandling.Ignore,\n+ ContractResolver = new DefaultContractResolver\n+ {\n+ NamingStrategy = new SnakeCaseNamingStrategy()\n+ },\n+ };\n+\nprivate ICache cache = new MemoryCache();\n/// <summary>\n/// Get or set the current cache. Defaults to MemoryCache.\n@@ -503,7 +514,7 @@ namespace ExchangeSharp\nawait new SynchronizationContextRemover();\nstring stringResult = await MakeRequestAsync(url, baseUrl: baseUrl, payload: payload, method: requestMethod);\n- T jsonResult = JsonConvert.DeserializeObject<T>(stringResult);\n+ T jsonResult = JsonConvert.DeserializeObject<T>(stringResult, SerializerSettings);\nif (jsonResult is JToken token)\n{\nreturn (T)(object)CheckJsonResponse(token);\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/Coinbase/ExchangeCoinbaseAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/Coinbase/ExchangeCoinbaseAPI.cs", "diff": "@@ -316,7 +316,7 @@ namespace ExchangeSharp\nif (message.Contains(@\"\"\"l2update\"\"\"))\n{\n// parse delta update\n- var delta = JsonConvert.DeserializeObject<Level2>(message);\n+ var delta = JsonConvert.DeserializeObject<Level2>(message, SerializerSettings);\nbook.MarketSymbol = delta.ProductId;\nbook.SequenceId = delta.Time.Ticks;\nforeach (string[] change in delta.Changes)\n@@ -336,7 +336,7 @@ namespace ExchangeSharp\nelse if (message.Contains(@\"\"\"snapshot\"\"\"))\n{\n// parse snapshot\n- var snapshot = JsonConvert.DeserializeObject<Snapshot>(message);\n+ var snapshot = JsonConvert.DeserializeObject<Snapshot>(message, SerializerSettings);\nbook.MarketSymbol = snapshot.ProductId;\nforeach (decimal[] ask in snapshot.Asks)\n{\n@@ -451,11 +451,11 @@ namespace ExchangeSharp\nreturn await ConnectPublicWebSocketAsync(\"/\", async (_socket, msg) =>\n{\nvar token = msg.ToStringFromUTF8();\n- var response = JsonConvert.DeserializeObject<BaseMessage>(token);\n+ var response = JsonConvert.DeserializeObject<BaseMessage>(token, SerializerSettings);\nswitch (response.Type)\n{\ncase ResponseType.Subscriptions:\n- var subscription = JsonConvert.DeserializeObject<Subscription>(token);\n+ var subscription = JsonConvert.DeserializeObject<Subscription>(token, SerializerSettings);\nif (subscription.Channels == null || !subscription.Channels.Any())\n{\nTrace.WriteLine($\"{nameof(OnUserDataWebSocketAsync)}() no channels subscribed\");\n@@ -473,37 +473,37 @@ namespace ExchangeSharp\ncase ResponseType.L2Update:\nthrow new NotImplementedException($\"Not expecting type {response.Type} in {nameof(OnUserDataWebSocketAsync)}()\");\ncase ResponseType.Heartbeat:\n- var heartbeat = JsonConvert.DeserializeObject<Heartbeat>(token);\n+ var heartbeat = JsonConvert.DeserializeObject<Heartbeat>(token, SerializerSettings);\nTrace.WriteLine($\"{nameof(OnUserDataWebSocketAsync)}() heartbeat received {heartbeat}\");\nbreak;\ncase ResponseType.Received:\n- var received = JsonConvert.DeserializeObject<Received>(token);\n+ var received = JsonConvert.DeserializeObject<Received>(token, SerializerSettings);\ncallback(received.ExchangeOrderResult);\nbreak;\ncase ResponseType.Open:\n- var open = JsonConvert.DeserializeObject<Open>(token);\n+ var open = JsonConvert.DeserializeObject<Open>(token, SerializerSettings);\ncallback(open.ExchangeOrderResult);\nbreak;\ncase ResponseType.Done:\n- var done = JsonConvert.DeserializeObject<Done>(token);\n+ var done = JsonConvert.DeserializeObject<Done>(token, SerializerSettings);\ncallback(done.ExchangeOrderResult);\nbreak;\ncase ResponseType.Match:\n- var match = JsonConvert.DeserializeObject<Match>(token);\n+ var match = JsonConvert.DeserializeObject<Match>(token, SerializerSettings);\ncallback(match.ExchangeOrderResult);\nbreak;\ncase ResponseType.LastMatch:\n//var lastMatch = JsonConvert.DeserializeObject<LastMatch>(token);\nthrow new NotImplementedException($\"Not expecting type {response.Type} in {nameof(OnUserDataWebSocketAsync)}()\");\ncase ResponseType.Error:\n- var error = JsonConvert.DeserializeObject<Error>(token);\n+ var error = JsonConvert.DeserializeObject<Error>(token, SerializerSettings);\nthrow new APIException($\"{error.Reason}: {error.Message}\");\ncase ResponseType.Change:\n- var change = JsonConvert.DeserializeObject<Change>(token);\n+ var change = JsonConvert.DeserializeObject<Change>(token, SerializerSettings);\ncallback(change.ExchangeOrderResult);\nbreak;\ncase ResponseType.Activate:\n- var activate = JsonConvert.DeserializeObject<Activate>(token);\n+ var activate = JsonConvert.DeserializeObject<Activate>(token, SerializerSettings);\ncallback(activate.ExchangeOrderResult);\nbreak;\ncase ResponseType.Status:\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/Coinbase/Models/Response/Messages.cs", "new_path": "src/ExchangeSharp/API/Exchanges/Coinbase/Models/Response/Messages.cs", "diff": "@@ -40,7 +40,7 @@ namespace ExchangeSharp.Coinbase\nOrderId = OrderId.ToString(),\nClientOrderId = null, // not provided here\nResult = ExchangeAPIOrderResult.PendingOpen, // order has just been activated (so it starts in PendingOpen)\n- Message = null, // can use for something in the future if needed\n+ Message = null, // + can use for something in the future if needed\nAmount = Size,\nAmountFilled = 0, // just activated, so none filled\nPrice = null, // not specified here (only StopPrice is)\n@@ -78,7 +78,7 @@ namespace ExchangeSharp.Coinbase\nAmountFilled = null, // not specified here\nPrice = Price,\nAveragePrice = null, // not specified here\n- // OrderDate - unclear if the Time in the Change msg is the new OrderDate or whether that is unchanged\n+ OrderDate = Time, // + unclear if the Time in the Change msg is the new OrderDate or whether that is unchanged\nCompletedDate = null, // order is active\nMarketSymbol = ProductId,\nIsBuy = Side == OrderSide.Buy,\n@@ -132,7 +132,7 @@ namespace ExchangeSharp.Coinbase\npublic long LastTradeId { get; set; }\npublic string ProductId { get; set; }\npublic long Sequence { get; set; }\n- public System.DateTimeOffset Time { get; set; }\n+ public DateTimeOffset Time { get; set; }\npublic override string ToString()\n{\nreturn $\"Heartbeat: Last TID {LastTradeId}, Product Id {ProductId}, Sequence {Sequence}, Time {Time}\";\n@@ -185,7 +185,7 @@ namespace ExchangeSharp.Coinbase\nAveragePrice = Price, // not specified here\n// OrderDate - not provided here. ideally would be null but ExchangeOrderResult.OrderDate is not nullable\nCompletedDate = null, // order not necessarily fullly filled at this point\n- TradeDate = Time.ToDateTimeInvariant(),\n+ TradeDate = Time.UtcDateTime,\nMarketSymbol = ProductId,\nIsBuy = Side == OrderSide.Buy,\nFees = (MakerFeeRate ?? TakerFeeRate) * Price * Size,\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/_Base/ExchangeAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/_Base/ExchangeAPI.cs", "diff": "@@ -15,7 +15,6 @@ using System.Collections.Concurrent;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\n-using System.Text.RegularExpressions;\nusing System.Threading;\nusing System.Threading.Tasks;\n" }, { "change_type": "MODIFY", "old_path": "tests/ExchangeSharpTests/ExchangeBinanceAPITests.cs", "new_path": "tests/ExchangeSharpTests/ExchangeBinanceAPITests.cs", "diff": "@@ -52,7 +52,7 @@ namespace ExchangeSharpTests\n]\n]\n}\";\n- var diff = JsonConvert.DeserializeObject<MarketDepthDiffUpdate>(toParse);\n+ var diff = JsonConvert.DeserializeObject<MarketDepthDiffUpdate>(toParse, BaseAPI.SerializerSettings);\nValidateDiff(diff);\n}\n@@ -82,7 +82,7 @@ namespace ExchangeSharpTests\n}\n}\";\n- var multistream = JsonConvert.DeserializeObject<MultiDepthStream>(toParse);\n+ var multistream = JsonConvert.DeserializeObject<MultiDepthStream>(toParse, BaseAPI.SerializerSettings);\nmultistream.Stream.Should().Be(\"bnbbtc@depth\");\nValidateDiff(multistream.Data);\n}\n@@ -92,7 +92,7 @@ namespace ExchangeSharpTests\n{\nstring real =\n\"{\\\"stream\\\":\\\"bnbbtc@depth\\\",\\\"data\\\":{\\\"e\\\":\\\"depthUpdate\\\",\\\"E\\\":1527540113575,\\\"s\\\":\\\"BNBBTC\\\",\\\"U\\\":77730662,\\\"u\\\":77730663,\\\"b\\\":[[\\\"0.00167300\\\",\\\"0.00000000\\\",[]],[\\\"0.00165310\\\",\\\"16.44000000\\\",[]]],\\\"a\\\":[]}}\";\n- var diff = JsonConvert.DeserializeObject<MultiDepthStream>(real);\n+ var diff = JsonConvert.DeserializeObject<MultiDepthStream>(real, BaseAPI.SerializerSettings);\ndiff.Data.EventTime.Should().Be(1527540113575);\n}\n@@ -100,8 +100,9 @@ namespace ExchangeSharpTests\npublic async Task CurrenciesParsedCorrectly()\n{\nvar requestMaker = Substitute.For<IAPIRequestMaker>();\n- requestMaker.MakeRequestAsync(\"/capital/config/getall\", new ExchangeBinanceAPI().BaseUrlSApi).Returns(Resources.BinanceGetAllAssets);\n- var binance = new ExchangeBinanceAPI { RequestMaker = requestMaker };\n+ var binance = await ExchangeAPI.GetExchangeAPIAsync<ExchangeBinanceAPI>();\n+ binance.RequestMaker = requestMaker;\n+ requestMaker.MakeRequestAsync(\"/capital/config/getall\", ((ExchangeBinanceAPI)binance).BaseUrlSApi).Returns(Resources.BinanceGetAllAssets);\nIReadOnlyDictionary<string, ExchangeCurrency> currencies = await binance.GetCurrenciesAsync();\ncurrencies.Should().HaveCount(3);\ncurrencies.TryGetValue(\"bnb\", out ExchangeCurrency bnb).Should().BeTrue();\n" }, { "change_type": "ADD", "old_path": null, "new_path": "tests/ExchangeSharpTests/ExchangeCoinbaseAPITests.cs", "diff": "+using ExchangeSharp;\n+using ExchangeSharp.Coinbase;\n+using FluentAssertions;\n+using Microsoft.VisualStudio.TestTools.UnitTesting;\n+using Newtonsoft.Json;\n+using System;\n+using System.Collections.Generic;\n+using System.Linq;\n+using System.Text;\n+using System.Threading.Tasks;\n+\n+namespace ExchangeSharpTests\n+{\n+ [TestClass]\n+ public sealed class ExchangeCoinbaseAPITests\n+ {\n+ private async Task<ExchangeCoinbaseAPI> MakeMockRequestMaker(string response = null)\n+ {\n+ var requestMaker = new MockAPIRequestMaker();\n+ if (response != null)\n+ {\n+ requestMaker.GlobalResponse = response;\n+ }\n+ var api = (await ExchangeAPI.GetExchangeAPIAsync(ExchangeName.Coinbase) as ExchangeCoinbaseAPI)!;\n+ api.RequestMaker = requestMaker;\n+ return api;\n+ }\n+\n+ [TestMethod]\n+ public void DeserializeUserMatch()\n+ {\n+ string toParse = \"{\\r\\n \\\"type\\\": \\\"match\\\",\\r\\n \\\"trade_id\\\": 10,\\r\\n \\\"sequence\\\": 50,\\r\\n \\\"maker_order_id\\\": \\\"ac928c66-ca53-498f-9c13-a110027a60e8\\\",\\r\\n \\\"taker_order_id\\\": \\\"132fb6ae-456b-4654-b4e0-d681ac05cea1\\\",\\r\\n \\\"time\\\": \\\"2014-11-07T08:19:27.028459Z\\\",\\r\\n \\\"product_id\\\": \\\"BTC-USD\\\",\\r\\n \\\"size\\\": \\\"5.23512\\\",\\r\\n \\\"price\\\": \\\"400.23\\\",\\r\\n \\\"side\\\": \\\"sell\\\"\\r\\n,\\r\\n \\\"taker_user_id\\\": \\\"5844eceecf7e803e259d0365\\\",\\r\\n \\\"user_id\\\": \\\"5844eceecf7e803e259d0365\\\",\\r\\n \\\"taker_profile_id\\\": \\\"765d1549-9660-4be2-97d4-fa2d65fa3352\\\",\\r\\n \\\"profile_id\\\": \\\"765d1549-9660-4be2-97d4-fa2d65fa3352\\\",\\r\\n \\\"taker_fee_rate\\\": \\\"0.005\\\"\\r\\n}\";\n+\n+ var usermatch = JsonConvert.DeserializeObject<Match>(toParse, BaseAPI.SerializerSettings);\n+ usermatch.MakerOrderId.Should().Be(\"ac928c66-ca53-498f-9c13-a110027a60e8\");\n+ usermatch.ExchangeOrderResult.OrderId.Should().Be(\"132fb6ae-456b-4654-b4e0-d681ac05cea1\");\n+ }\n+ }\n+}\n" }, { "change_type": "MODIFY", "old_path": "tests/ExchangeSharpTests/ExchangeTests.cs", "new_path": "tests/ExchangeSharpTests/ExchangeTests.cs", "diff": "@@ -91,7 +91,7 @@ namespace ExchangeSharpTests\nstring globalMarketSymbol = \"ETH-BTC\"; //1 ETH is worth 0.0192 BTC...\nstring globalMarketSymbolAlt = \"BTC-KRW\"; // WTF Bitthumb... //1 BTC worth 9,783,000 won\n- Dictionary<string, string[]> allSymbols = JsonConvert.DeserializeObject<Dictionary<string, string[]>>(System.IO.File.ReadAllText(\"TestData/AllSymbols.json\"));\n+ Dictionary<string, string[]> allSymbols = JsonConvert.DeserializeObject<Dictionary<string, string[]>>(System.IO.File.ReadAllText(\"TestData/AllSymbols.json\"), ExchangeAPI.SerializerSettings);\n// sanity test that all exchanges return the same global symbol when converted back and forth\nforeach (IExchangeAPI api in await ExchangeAPI.GetExchangeAPIsAsync())\n" } ]
C#
MIT License
jjxtra/exchangesharp
fixed JSON deserialization in Coinbase with new SerializerSettings (#757) - added test for Coinbase Match - fixed compilation error in ExchangeBinanceAPITests.cs
329,089
01.04.2022 15:52:03
25,200
209d7f271347a5ad963e7c2650aaf2954dbfce28
Set MarketSymbolIsUppercase to true for all Binance based exchanges extends by also in this PR: - limit Trade stream to 400 symbols - use SerializerSettings
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs", "new_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs", "diff": "@@ -53,7 +53,7 @@ namespace ExchangeSharp.BinanceGroup\nNonceStyle = NonceStyle.UnixMilliseconds;\nNonceOffset = TimeSpan.FromSeconds(15); // 15 seconds are deducted from current UTCTime as base of the request time window\nMarketSymbolSeparator = string.Empty;\n- MarketSymbolIsUppercase = false;\n+ MarketSymbolIsUppercase = true;\nWebSocketOrderBookType = WebSocketOrderBookType.DeltasOnly;\nExchangeGlobalCurrencyReplacements[\"BCC\"] = \"BCH\";\n}\n@@ -275,6 +275,11 @@ namespace ExchangeSharp.BinanceGroup\n{\nmarketSymbols = (await GetMarketSymbolsAsync()).ToArray();\n}\n+ if (marketSymbols.Length > 400)\n+ {\n+ marketSymbols = marketSymbols.Take(400).ToArray();\n+ Logger.Warn(\"subscribing to the first 400 symbols\"); // binance does not allow subscribing to more than 400 symbols at a time\n+ }\nstring url = await GetWebSocketStreamUrlForSymbolsAsync(\"@aggTrade\", marketSymbols);\nreturn await ConnectPublicWebSocketAsync(url, messageCallback: async (_socket, msg) =>\n{\n@@ -302,7 +307,7 @@ namespace ExchangeSharp.BinanceGroup\nreturn await ConnectPublicWebSocketAsync($\"/stream?streams={combined}\", (_socket, msg) =>\n{\nstring json = msg.ToStringFromUTF8();\n- var update = JsonConvert.DeserializeObject<MultiDepthStream>(json);\n+ var update = JsonConvert.DeserializeObject<MultiDepthStream>(json, SerializerSettings);\nstring marketSymbol = update.Data.MarketSymbol;\nExchangeOrderBook book = new ExchangeOrderBook { SequenceId = update.Data.FinalUpdate, MarketSymbol = marketSymbol, LastUpdatedUtc = CryptoUtility.UnixTimeStampToDateTimeMilliseconds(update.Data.EventTime) };\nforeach (List<object> ask in update.Data.Asks)\n@@ -1091,7 +1096,7 @@ namespace ExchangeSharp.BinanceGroup\n{\ncase \"executionReport\": // systematically check to make sure we are dealing with expected cases here\n{\n- var update = JsonConvert.DeserializeObject<ExecutionReport>(token.ToStringInvariant());\n+ var update = JsonConvert.DeserializeObject<ExecutionReport>(token.ToStringInvariant(), SerializerSettings);\nswitch (update.CurrentExecutionType)\n{\ncase \"NEW \": // The order has been accepted into the engine.\n@@ -1115,7 +1120,7 @@ namespace ExchangeSharp.BinanceGroup\nthrow new NotImplementedException(\"has been removed (per binance 2021-01-01)\");\ncase \"outboundAccountPosition\":\n{\n- var update = JsonConvert.DeserializeObject<OutboundAccount>(token.ToStringInvariant());\n+ var update = JsonConvert.DeserializeObject<OutboundAccount>(token.ToStringInvariant(), SerializerSettings);\ncallback(new ExchangeBalances()\n{\nEventTime = CryptoUtility.UnixTimeStampToDateTimeMilliseconds(update.EventTime),\n@@ -1138,7 +1143,7 @@ namespace ExchangeSharp.BinanceGroup\n}\ncase \"balanceUpdate\":\n{\n- var update = JsonConvert.DeserializeObject<BalanceUpdate>(token.ToStringInvariant());\n+ var update = JsonConvert.DeserializeObject<BalanceUpdate>(token.ToStringInvariant(), SerializerSettings);\ncallback(new ExchangeBalances()\n{\nEventTime = CryptoUtility.UnixTimeStampToDateTimeMilliseconds(update.EventTime),\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/ExchangeBinanceAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/ExchangeBinanceAPI.cs", "diff": "@@ -18,11 +18,6 @@ namespace ExchangeSharp\n{\npublic override string BaseUrl { get; set; } = \"https://api.binance.com\";\npublic override string BaseUrlWebSocket { get; set; } = \"wss://stream.binance.com:9443\";\n-\n- private ExchangeBinanceAPI()\n- {\n- MarketSymbolIsUppercase = true;\n- }\n}\npublic partial class ExchangeName { public const string Binance = \"Binance\"; }\n" } ]
C#
MIT License
jjxtra/exchangesharp
Set MarketSymbolIsUppercase to true for all Binance based exchanges (#758) - extends #754 by @ExchangeSharp - also in this PR: - limit Trade stream to 400 symbols - use SerializerSettings
329,089
03.04.2022 12:38:02
25,200
658b4f5263373dd5df535a4bb460c7676de03c3a
upgrade Huobi MarketSymbolsMetadata to V2
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/Huobi/ExchangeHuobiAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/Huobi/ExchangeHuobiAPI.cs", "diff": "@@ -25,6 +25,7 @@ namespace ExchangeSharp\n{\npublic override string BaseUrl { get; set; } = \"https://api.huobipro.com\";\npublic string BaseUrlV1 { get; set; } = \"https://api.huobipro.com/v1\";\n+ public string BaseUrlV2 { get; set; } = \"https://api.huobipro.com/v2\";\npublic override string BaseUrlWebSocket { get; set; } = \"wss://api.huobipro.com/ws\";\npublic string PrivateUrlV1 { get; set; } = \"https://api.huobipro.com/v1\";\n@@ -123,43 +124,64 @@ namespace ExchangeSharp\nprotected internal override async Task<IEnumerable<ExchangeMarket>> OnGetMarketSymbolsMetadataAsync()\n{\n- /*\n+ /*{\n+ \"status\":\"ok\",\n+ \"data\":[\n{\n- \"status\"\n- :\n- \"ok\", \"data\"\n- :\n- [{\n- \"base-currency\": \"btc\",\n- \"quote-currency\": \"usdt\",\n- \"price-precision\": 2,\n- \"amount-precision\": 4,\n- \"symbol-partition\": \"main\"\n- }, {\n- \"base-currency\": \"bch\",\n- \"quote-currency\": \"usdt\",\n- \"price-precision\": 2,\n- \"amount-precision\": 4,\n- \"symbol-partition\": \"main\"\n- },\n-\n- */\n+ \"tags\": \"\",\n+ \"state\": \"online\",\n+ \"wr\": \"1.5\",\n+ \"sc\": \"ethusdt\",\n+ \"p\": [\n+ {\n+ \"id\": 9,\n+ \"name\": \"Grayscale\",\n+ \"weight\": 91\n+ }\n+ ],\n+ \"bcdn\": \"ETH\",\n+ \"qcdn\": \"USDT\",\n+ \"elr\": null,\n+ \"tpp\": 2,\n+ \"tap\": 4,\n+ \"fp\": 8,\n+ \"smlr\": null,\n+ \"flr\": null,\n+ \"whe\": false,\n+ \"cd\": false,\n+ \"te\": true,\n+ \"sp\": \"main\",\n+ \"d\": null,\n+ \"bc\": \"eth\",\n+ \"qc\": \"usdt\",\n+ \"toa\": 1514779200000,\n+ \"ttp\": 8,\n+ \"w\": 999400000,\n+ \"lr\": 5,\n+ \"dn\": \"ETH/USDT\"\n+ }\n+ ],\n+ \"ts\":\"1641870869718\",\n+ \"full\":1\n+ }*/\nList<ExchangeMarket> markets = new List<ExchangeMarket>();\n- JToken allMarketSymbols = await MakeJsonRequestAsync<JToken>(\"/common/symbols\", BaseUrlV1, null);\n+ JToken allMarketSymbols = await MakeJsonRequestAsync<JToken>(\"/settings/common/symbols\", BaseUrlV2, null);\nforeach (var marketSymbol in allMarketSymbols)\n{\n- var baseCurrency = marketSymbol[\"base-currency\"].ToStringLowerInvariant();\n- var quoteCurrency = marketSymbol[\"quote-currency\"].ToStringLowerInvariant();\n- var pricePrecision = marketSymbol[\"price-precision\"].ConvertInvariant<double>();\n+ var baseCurrency = marketSymbol[\"bc\"].ToStringLowerInvariant();\n+ var quoteCurrency = marketSymbol[\"qc\"].ToStringLowerInvariant();\n+ var symbolCode = marketSymbol[\"sc\"].ToStringLowerInvariant();\n+ var pricePrecision = marketSymbol[\"tpp\"].ConvertInvariant<double>();\nvar priceStepSize = Math.Pow(10, -pricePrecision).ConvertInvariant<decimal>();\n- var amountPrecision = marketSymbol[\"amount-precision\"].ConvertInvariant<double>();\n+ var amountPrecision = marketSymbol[\"tap\"].ConvertInvariant<double>();\nvar quantityStepSize = Math.Pow(10, -amountPrecision).ConvertInvariant<decimal>();\n+ var state = marketSymbol[\"state\"].ToStringLowerInvariant();\nvar market = new ExchangeMarket\n{\nBaseCurrency = baseCurrency,\nQuoteCurrency = quoteCurrency,\n- MarketSymbol = baseCurrency + quoteCurrency,\n- IsActive = true,\n+ MarketSymbol = symbolCode,\n+ IsActive = state == \"online\",\nPriceStepSize = priceStepSize,\nQuantityStepSize = quantityStepSize,\nMinPrice = priceStepSize,\n@@ -278,7 +300,7 @@ namespace ExchangeSharp\n{\nif (marketSymbols == null || marketSymbols.Length == 0)\n{\n- marketSymbols = (await GetMarketSymbolsAsync()).ToArray();\n+ marketSymbols = (await GetMarketSymbolsMetadataAsync()).Where(s => s.IsActive.Value).Select(s => s.MarketSymbol).ToArray();\n}\nforeach (string marketSymbol in marketSymbols)\n{\n" } ]
C#
MIT License
jjxtra/exchangesharp
upgrade Huobi MarketSymbolsMetadata to V2 (#759)
329,089
04.04.2022 18:30:05
25,200
6cc2d2c20561275b32a1fa125e71fc73843e9aae
fix Crypto.com trade stream errors respond to heartbeat turn off KeepAlive warn instead of throwing exception
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/CryptoCom/ExchangeCryptoComApi.cs", "new_path": "src/ExchangeSharp/API/Exchanges/CryptoCom/ExchangeCryptoComApi.cs", "diff": "@@ -44,7 +44,7 @@ namespace ExchangeSharp\n{\nmarketSymbols = new string[] { \"\" };\n}\n- return await ConnectPublicWebSocketAsync(\"/market\", async (_socket, msg) =>\n+ var ws = await ConnectPublicWebSocketAsync(\"/market\", async (_socket, msg) =>\n{\n/*{\n{{\n@@ -74,9 +74,17 @@ namespace ExchangeSharp\nthrow new APIException(token[\"code\"].ToStringInvariant() + \": \" + token[\"message\"].ToStringInvariant());\n}\nelse if (token[\"method\"].ToStringInvariant() == \"public/heartbeat\")\n+ { /* For websocket connections, the system will send a heartbeat message to the client every 30 seconds.\n+ * The client must respond back with the public/respond-heartbeat method, using the same matching id, within 5 seconds, or the connection will break. */\n+ var hrResponse = new\n{\n+ id = token[\"id\"].ConvertInvariant<long>(),\n+ method = \"public/respond-heartbeat\",\n+ };\n+ await _socket.SendMessageAsync(hrResponse);\n+\nif (token[\"message\"].ToStringInvariant() == \"server did not receive any client heartbeat, going to disconnect soon\")\n- throw new APIException(token[\"code\"].ToStringInvariant() + \": \" + token[\"message\"].ToStringInvariant());\n+ Logger.Warn(token[\"code\"].ToStringInvariant() + \": \" + token[\"message\"].ToStringInvariant());\n}\nelse if (token[\"method\"].ToStringInvariant() == \"subscribe\" && token[\"result\"] != null)\n{\n@@ -115,6 +123,7 @@ namespace ExchangeSharp\nvar subscribeRequest = new\n{\n// + consider using id field in the future to differentiate between requests\n+ //id = new Random().Next(),\nmethod = \"subscribe\",\n@params = new\n{\n@@ -124,6 +133,8 @@ namespace ExchangeSharp\n};\nawait _socket.SendMessageAsync(subscribeRequest);\n});\n+ ws.KeepAlive = new TimeSpan(0); // cryptocom throws bad request empty content msgs w/ keepalives\n+ return ws;\n}\n}\npublic partial class ExchangeName { public const string CryptoCom = \"CryptoCom\"; }\n" } ]
C#
MIT License
jjxtra/exchangesharp
fix Crypto.com trade stream errors (#760) - respond to heartbeat - turn off KeepAlive - warn instead of throwing exception
329,089
07.04.2022 19:19:08
25,200
e0c2582c682917ac11440157a67dadf13566cfe8
fix symbol parsing in Bithumb trade stream
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/Bithumb/ExchangeBithumbAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/Bithumb/ExchangeBithumbAPI.cs", "diff": "@@ -214,7 +214,7 @@ namespace ExchangeSharp\n{\nvar exchangeTrade = data.ParseTrade(\"contQty\", \"contPrice\", \"buySellGb\", \"contDtm\", TimestampType.Iso8601Korea, null, typeKeyIsBuyValue: \"2\");\n- await callback(new KeyValuePair<string, ExchangeTrade>(parsedMsg[\"market\"].ToStringInvariant(), exchangeTrade));\n+ await callback(new KeyValuePair<string, ExchangeTrade>(data[\"symbol\"].ToStringInvariant(), exchangeTrade));\n}\n}\n}, connectCallback: async (_socket) =>\n" } ]
C#
MIT License
jjxtra/exchangesharp
fix symbol parsing in Bithumb trade stream (#761)
329,089
08.04.2022 11:41:25
25,200
a87fb8b430755e4ccfc3e1255274b55c482b0e1d
add trade stream for Coincheck
[ { "change_type": "ADD", "old_path": null, "new_path": "src/ExchangeSharp/API/Exchanges/Coincheck/ExchangeCoincheckAPI.cs", "diff": "+using Newtonsoft.Json.Linq;\n+using System;\n+using System.Collections.Generic;\n+using System.Linq;\n+using System.Text;\n+using System.Threading.Tasks;\n+\n+namespace ExchangeSharp\n+{\n+ public sealed partial class ExchangeCoincheckAPI : ExchangeAPI\n+ {\n+ public override string BaseUrl { get; set; } = \"https://coincheck.com\";\n+ public override string BaseUrlWebSocket { get; set; } = \"wss://ws-api.coincheck.com\";\n+\n+ public ExchangeCoincheckAPI()\n+ {\n+ NonceStyle = NonceStyle.UnixSeconds;\n+ NonceOffset = TimeSpan.FromSeconds(0.1);\n+ // WebSocketOrderBookType = not implemented\n+ MarketSymbolSeparator = \"_\";\n+ MarketSymbolIsUppercase = false;\n+ // ExchangeGlobalCurrencyReplacements[] not implemented\n+ }\n+\n+ protected override async Task<IEnumerable<string>> OnGetMarketSymbolsAsync()\n+ { // unclear, but appears like this is all they have available, at least for trade stream (from their poor documentation)\n+ return new[] { \"btc_jpy\", \"etc_jpy\", \"fct_jpy\", \"mona_jpy\", \"plt_jpy\", };\n+ }\n+\n+ protected override async Task<IWebSocket> OnGetTradesWebSocketAsync(Func<KeyValuePair<string, ExchangeTrade>, Task> callback, params string[] marketSymbols)\n+ {\n+ if (marketSymbols == null || marketSymbols.Length == 0)\n+ {\n+ marketSymbols = (await GetMarketSymbolsAsync()).ToArray();\n+ }\n+ return await ConnectPublicWebSocketAsync(\"\", async (_socket, msg) =>\n+ { /*[\n+ 2357062, // 0 \"ID\",\n+ \"[pair]\", // 1 \"Currency pair\"\n+ \"148638.0\", // 2 \"Order rate\"\n+ \"5.0\", // 3 \"Order amount\"\n+ \"sell\" // 4 \"Specify order_type.\"\n+ ]*/\n+ JToken token = JToken.Parse(msg.ToStringFromUTF8());\n+ // no error msgs provided\n+ if (token.Type == JTokenType.Array)\n+ {\n+ var trade = token.ParseTrade(3, 2, 4, null, TimestampType.None, 0);\n+ string marketSymbol = token[1].ToStringInvariant();\n+ await callback(new KeyValuePair<string, ExchangeTrade>(marketSymbol, trade));\n+ }\n+ else Logger.Warn($\"Unexpected token type {token.Type}\");\n+ }, async (_socket) =>\n+ { /*{\n+ \"type\": \"subscribe\",\n+ \"channel\": \"[pair]-trades\"\n+ }*/\n+ foreach (var marketSymbol in marketSymbols)\n+ {\n+ var subscribeRequest = new\n+ {\n+ type = \"subscribe\",\n+ channel = $\"{marketSymbol}-trades\",\n+ };\n+ await _socket.SendMessageAsync(subscribeRequest);\n+ }\n+ });\n+ }\n+ }\n+ public partial class ExchangeName { public const string Coincheck = \"Coincheck\"; }\n+}\n" } ]
C#
MIT License
jjxtra/exchangesharp
add trade stream for Coincheck (#762)
329,089
08.04.2022 14:25:23
25,200
686e9d7c1a6054ca3925d482a44ca89591b26121
fix setting ConnectInterval on Bitflyer
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/Bitflyer/ExchangeBitflyerApi.cs", "new_path": "src/ExchangeSharp/API/Exchanges/Bitflyer/ExchangeBitflyerApi.cs", "diff": "@@ -150,7 +150,8 @@ namespace ExchangeSharp\n}\npublic TimeSpan ConnectInterval\n- { get => socketIO.Options.ConnectionTimeout; set => socketIO.Options.ConnectionTimeout = value; }\n+ { get => throw new NotSupportedException();\n+ set => socketIO.Options.Reconnection = value > TimeSpan.Zero; }\npublic TimeSpan KeepAlive\n{ get => throw new NotSupportedException(); set => throw new NotSupportedException(); }\n" } ]
C#
MIT License
jjxtra/exchangesharp
fix setting ConnectInterval on Bitflyer (#763)
329,089
08.04.2022 18:32:32
25,200
b5662dfd81424498f4718f2f33ddab2b686986e0
respong to ping on LBank trades stream ping pong
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/LBank/ExchangeLBankAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/LBank/ExchangeLBankAPI.cs", "diff": "@@ -572,6 +572,24 @@ namespace ExchangeSharp\n}\nelse throw new APIException(token[\"message\"].ToStringInvariant());\n}\n+ if (token[\"action\"].ToStringInvariant() == \"ping\")\n+ {/* # ping\n+ {\n+ \"action\":\"ping\",\n+ \"ping\":\"0ca8f854-7ba7-4341-9d86-d3327e52804e\"\n+ }\n+ # pong\n+ {\n+ \"action\":\"pong\",\n+ \"pong\":\"0ca8f854-7ba7-4341-9d86-d3327e52804e\"\n+ } */\n+ var pong = new\n+ {\n+ action = \"pong\",\n+ pong = token[\"ping\"].ToStringInvariant(),\n+ };\n+ await _socket.SendMessageAsync(pong);\n+ }\nelse if (token[\"type\"].ToStringInvariant() == \"trade\")\n{\nvar trade = token[\"trade\"].ParseTrade(\"amount\", \"price\", \"direction\", \"TS\", TimestampType.Iso8601China, null);\n" } ]
C#
MIT License
jjxtra/exchangesharp
respong to ping on LBank trades stream (#764) - ping pong
329,089
09.04.2022 17:21:45
25,200
5b55dd0401820c023b32398faefee8d654c88ffb
new NuGet 1.0.1 added Coincheck and UPbit to README.md
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -44,6 +44,7 @@ The following cryptocurrency exchanges are supported:\n| BTSE | x | x | |\n| Bybit | x | x | R | Has public method for Websocket Positions\n| Coinbase | x | x | T R O U |\n+| Coincheck | | | R |\n| Coinmate | x | x | |\n| Crypto.com | | | R |\n| Digifinex | x | x | R B |\n@@ -62,6 +63,7 @@ The following cryptocurrency exchanges are supported:\n| OKCoin | x | x | R B |\n| OKEx | x | x | T R B O |\n| Poloniex | x | x | T R B |\n+| UPbit | | | R |\n| YoBit | x | x | |\n| ZB.com | wip | | R |\n@@ -110,11 +112,11 @@ See [`WebSocket4NetClientWebSocket.cs`][websocket4net] for implementation detail\n#### dotnet CLI\n-[`dotnet add package DigitalRuby.ExchangeSharp --version 1.0.0`][nuget]\n+[`dotnet add package DigitalRuby.ExchangeSharp --version 1.0.1`][nuget]\n#### Package Manager on VS\n-[`PM> Install-Package DigitalRuby.ExchangeSharp -Version 1.0.0`][nuget]\n+[`PM> Install-Package DigitalRuby.ExchangeSharp -Version 1.0.1`][nuget]\n### Examples\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/ExchangeSharp.csproj", "new_path": "src/ExchangeSharp/ExchangeSharp.csproj", "diff": "<LangVersion>8</LangVersion>\n<PackageId>DigitalRuby.ExchangeSharp</PackageId>\n<Title>ExchangeSharp - C# API for cryptocurrency exchanges</Title>\n- <PackageVersion>1.0.0</PackageVersion>\n+ <PackageVersion>1.0.1</PackageVersion>\n<Authors>jjxtra</Authors>\n<Description>ExchangeSharp is a C# API for working with various cryptocurrency exchanges. Web sockets are also supported for some exchanges.</Description>\n<Summary>Supported exchanges: Binance BitMEX Bitfinex Bithumb Bitstamp Bittrex BL3P Bleutrade BTSE Cryptopia Coinbase(GDAX) Digifinex Gemini Gitbtc Huobi Kraken Kucoin Livecoin NDAX OKCoin OKEx Poloniex TuxExchange Yobit ZBcom. Pull requests welcome.</Summary>\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/Properties/AssemblyInfo.cs", "new_path": "src/ExchangeSharp/Properties/AssemblyInfo.cs", "diff": "@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;\n//\n// You can specify all the values or you can default the Build and Revision Numbers\n// by using the '*' as shown below:\n-[assembly: AssemblyVersion(\"1.0.0\")]\n-[assembly: AssemblyFileVersion(\"1.0.0\")]\n+[assembly: AssemblyVersion(\"1.0.1\")]\n+[assembly: AssemblyFileVersion(\"1.0.1\")]\n[assembly: InternalsVisibleTo(\"ExchangeSharpTests\")]\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharpConsole/ExchangeSharpConsole.csproj", "new_path": "src/ExchangeSharpConsole/ExchangeSharpConsole.csproj", "diff": "<AssemblyName>exchange-sharp</AssemblyName>\n<TargetFramework>net6.0</TargetFramework>\n<NeutralLanguage>en</NeutralLanguage>\n- <AssemblyVersion>1.0.0</AssemblyVersion>\n- <FileVersion>1.0.0</FileVersion>\n+ <AssemblyVersion>1.0.1</AssemblyVersion>\n+ <FileVersion>1.0.1</FileVersion>\n</PropertyGroup>\n<ItemGroup>\n" }, { "change_type": "MODIFY", "old_path": "tests/ExchangeSharpTests/ExchangeSharpTests.csproj", "new_path": "tests/ExchangeSharpTests/ExchangeSharpTests.csproj", "diff": "<TargetFramework>net6.0</TargetFramework>\n<IsPackable>false</IsPackable>\n<NeutralLanguage>en</NeutralLanguage>\n- <AssemblyVersion>1.0.0</AssemblyVersion>\n- <FileVersion>1.0.0</FileVersion>\n+ <AssemblyVersion>1.0.1</AssemblyVersion>\n+ <FileVersion>1.0.1</FileVersion>\n<NoWin32Manifest>true</NoWin32Manifest>\n</PropertyGroup>\n" } ]
C#
MIT License
jjxtra/exchangesharp
new NuGet 1.0.1 (#766) - added Coincheck and UPbit to README.md
329,089
16.04.2022 16:24:39
25,200
00621397ed29fcfa20c1c5713c5e5a64b51abb2e
fix post only order placement in Binance
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs", "new_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs", "diff": "@@ -547,7 +547,7 @@ namespace ExchangeSharp.BinanceGroup\nreturn balances;\n}\n- protected override async Task<ExchangeOrderResult> OnPlaceOrderAsync(ExchangeOrderRequest order)\n+ protected override async Task<ExchangeOrderResult?> OnPlaceOrderAsync(ExchangeOrderRequest order)\n{\nif (order.Price == null && order.OrderType != OrderType.Market) throw new ArgumentNullException(nameof(order.Price));\n@@ -575,8 +575,9 @@ namespace ExchangeSharp.BinanceGroup\nif (order.OrderType != OrderType.Market)\n{\ndecimal outputPrice = await ClampOrderPrice(order.MarketSymbol, order.Price.Value);\n- payload[\"timeInForce\"] = \"GTC\";\npayload[\"price\"] = outputPrice;\n+ if (order.IsPostOnly != true)\n+ payload[\"timeInForce\"] = \"GTC\";\n}\norder.ExtraParameters.CopyTo(payload);\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/_Base/ExchangeAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/_Base/ExchangeAPI.cs", "diff": "@@ -192,7 +192,7 @@ namespace ExchangeSharp\nthrow new NotImplementedException();\nprotected virtual Task<Dictionary<string, decimal>> OnGetAmountsAvailableToTradeAsync() =>\nthrow new NotImplementedException();\n- protected virtual Task<ExchangeOrderResult> OnPlaceOrderAsync(ExchangeOrderRequest order) =>\n+ protected virtual Task<ExchangeOrderResult?> OnPlaceOrderAsync(ExchangeOrderRequest order) =>\nthrow new NotImplementedException();\nprotected virtual Task<ExchangeOrderResult[]> OnPlaceOrdersAsync(params ExchangeOrderRequest[] order) =>\nthrow new NotImplementedException();\n" } ]
C#
MIT License
jjxtra/exchangesharp
fix post only order placement in Binance (#767)
329,089
24.04.2022 16:17:35
25,200
b4fda0445e0d130c348aeaf63aa6d6771eea64d6
refactored binance symbol stream limit to apply to all websocket streams
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs", "new_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs", "diff": "@@ -32,6 +32,11 @@ namespace ExchangeSharp.BinanceGroup\n{\nmarketSymbols = (await GetMarketSymbolsAsync()).ToArray();\n}\n+ if (marketSymbols.Length > 400)\n+ {\n+ marketSymbols = marketSymbols.Take(400).ToArray();\n+ Logger.Warn(\"subscribing to the first 400 symbols\"); // binance does not allow subscribing to more than 400 symbols at a time\n+ }\nStringBuilder streams = new StringBuilder(\"/stream?streams=\");\nfor (int i = 0; i < marketSymbols.Length; i++)\n@@ -234,9 +239,15 @@ namespace ExchangeSharp.BinanceGroup\nreturn tickers;\n}\n- protected override Task<IWebSocket> OnGetTickersWebSocketAsync(Action<IReadOnlyCollection<KeyValuePair<string, ExchangeTicker>>> callback, params string[] symbols)\n+ protected override async Task<IWebSocket> OnGetTickersWebSocketAsync(Action<IReadOnlyCollection<KeyValuePair<string, ExchangeTicker>>> callback, params string[] symbols)\n{\n- return ConnectPublicWebSocketAsync(\"/stream?streams=!ticker@arr\", async (_socket, msg) =>\n+ string url = null;\n+ if (symbols == null || symbols.Length == 0)\n+ {\n+ url = \"/stream?streams=!ticker@arr\";\n+ }\n+ else url = await GetWebSocketStreamUrlForSymbolsAsync(\"@ticker\", symbols);\n+ return await ConnectPublicWebSocketAsync(url, async (_socket, msg) =>\n{\nJToken token = JToken.Parse(msg.ToStringFromUTF8());\nList<KeyValuePair<string, ExchangeTicker>> tickerList = new List<KeyValuePair<string, ExchangeTicker>>();\n@@ -275,11 +286,6 @@ namespace ExchangeSharp.BinanceGroup\n{\nmarketSymbols = (await GetMarketSymbolsAsync()).ToArray();\n}\n- if (marketSymbols.Length > 400)\n- {\n- marketSymbols = marketSymbols.Take(400).ToArray();\n- Logger.Warn(\"subscribing to the first 400 symbols\"); // binance does not allow subscribing to more than 400 symbols at a time\n- }\nstring url = await GetWebSocketStreamUrlForSymbolsAsync(\"@aggTrade\", marketSymbols);\nreturn await ConnectPublicWebSocketAsync(url, messageCallback: async (_socket, msg) =>\n{\n" } ]
C#
MIT License
jjxtra/exchangesharp
refactored binance symbol stream limit (#769) - to apply to all websocket streams
329,089
27.04.2022 17:20:15
25,200
846171d729b0f3d6e5082eff80e6238bb65ae94e
fix AmountFilled in Binance user stream different for trade vs order
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/Models/UserDataStream.cs", "new_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/Models/UserDataStream.cs", "diff": "@@ -88,7 +88,7 @@ namespace ExchangeSharp.BinanceGroup\nResult = status,\nResultCode = CurrentOrderStatus,\nMessage = OrderRejectReason, // can use for multiple things in the future if needed\n- Amount = CumulativeFilledQuantity,\n+ AmountFilled = TradeId != null ? LastExecutedQuantity : CumulativeFilledQuantity,\nPrice = OrderPrice,\nAveragePrice = CumulativeQuoteAssetTransactedQuantity / CumulativeFilledQuantity, // Average price can be found by doing Z divided by z.\nOrderDate = CryptoUtility.UnixTimeStampToDateTimeMilliseconds(OrderCreationTime),\n" } ]
C#
MIT License
jjxtra/exchangesharp
fix AmountFilled in Binance user stream (#770) - different for trade vs order
329,089
29.04.2022 15:20:51
25,200
7df21d111f4a33163a98bf5e48dffff875faaf6e
provide HTTPHeaderDate when placing Coinbase orders
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Common/APIRequestMaker.cs", "new_path": "src/ExchangeSharp/API/Common/APIRequestMaker.cs", "diff": "@@ -162,7 +162,7 @@ namespace ExchangeSharp\n/// The encoding of payload is API dependant but is typically json.</param>\n/// <param name=\"method\">Request method or null for default. Example: 'GET' or 'POST'.</param>\n/// <returns>Raw response</returns>\n- public async Task<string> MakeRequestAsync(string url, string? baseUrl = null, Dictionary<string, object>? payload = null, string? method = null)\n+ public async Task<IAPIRequestMaker.RequestResult<string>> MakeRequestAsync(string url, string? baseUrl = null, Dictionary<string, object>? payload = null, string? method = null)\n{\nawait new SynchronizationContextRemover();\nawait api.RateLimit.WaitToProceedAsync();\n@@ -225,7 +225,7 @@ namespace ExchangeSharp\n{\nresponse?.Dispose();\n}\n- return responseString;\n+ return new IAPIRequestMaker.RequestResult<string>() { Response = responseString, HTTPHeaderDate = response.Headers.Date };\n}\n/// <summary>\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Common/BaseAPI.cs", "new_path": "src/ExchangeSharp/API/Common/BaseAPI.cs", "diff": "@@ -498,7 +498,7 @@ namespace ExchangeSharp\n/// The encoding of payload is API dependant but is typically json.\n/// <param name=\"method\">Request method or null for default</param>\n/// <returns>Raw response</returns>\n- public Task<string> MakeRequestAsync(string url, string? baseUrl = null, Dictionary<string, object>? payload = null, string? method = null) => requestMaker.MakeRequestAsync(url, baseUrl: baseUrl, payload: payload, method: method);\n+ public async Task<IAPIRequestMaker.RequestResult<string>> MakeRequestAsync(string url, string? baseUrl = null, Dictionary<string, object>? payload = null, string? method = null) => await requestMaker.MakeRequestAsync(url, baseUrl: baseUrl, payload: payload, method: method);\n/// <summary>\n/// Make a JSON request to an API end point\n@@ -509,17 +509,28 @@ namespace ExchangeSharp\n/// <param name=\"payload\">Payload, can be null. For private API end points, the payload must contain a 'nonce' key set to GenerateNonce value.</param>\n/// <param name=\"requestMethod\">Request method or null for default</param>\n/// <returns>Result decoded from JSON response</returns>\n- public async Task<T> MakeJsonRequestAsync<T>(string url, string? baseUrl = null, Dictionary<string, object>? payload = null, string? requestMethod = null)\n+ public async Task<T> MakeJsonRequestAsync<T>(string url, string? baseUrl = null, Dictionary<string, object>? payload = null, string? requestMethod = null) => (await MakeJsonRequestFullAsync<T>(url, baseUrl: baseUrl, payload: payload, requestMethod: requestMethod)).Response;\n+\n+ /// <summary>\n+ /// Make a JSON request to an API end point, with full retun result\n+ /// </summary>\n+ /// <typeparam name=\"T\">Type of object to parse JSON as</typeparam>\n+ /// <param name=\"url\">Path and query</param>\n+ /// <param name=\"baseUrl\">Override the base url, null for the default BaseUrl</param>\n+ /// <param name=\"payload\">Payload, can be null. For private API end points, the payload must contain a 'nonce' key set to GenerateNonce value.</param>\n+ /// <param name=\"requestMethod\">Request method or null for default</param>\n+ /// <returns>full return result, including result decoded from JSON response</returns>\n+ public async Task<IAPIRequestMaker.RequestResult<T>> MakeJsonRequestFullAsync<T>(string url, string? baseUrl = null, Dictionary<string, object>? payload = null, string? requestMethod = null)\n{\nawait new SynchronizationContextRemover();\n- string stringResult = await MakeRequestAsync(url, baseUrl: baseUrl, payload: payload, method: requestMethod);\n+ string stringResult = (await MakeRequestAsync(url, baseUrl: baseUrl, payload: payload, method: requestMethod)).Response;\nT jsonResult = JsonConvert.DeserializeObject<T>(stringResult, SerializerSettings);\nif (jsonResult is JToken token)\n{\n- return (T)(object)CheckJsonResponse(token);\n+ return new IAPIRequestMaker.RequestResult<T>() { Response = (T)(object)CheckJsonResponse(token) };\n}\n- return jsonResult;\n+ return new IAPIRequestMaker.RequestResult<T>() { Response = jsonResult };\n}\n/// <summary>\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Common/IAPIRequestMaker.cs", "new_path": "src/ExchangeSharp/API/Common/IAPIRequestMaker.cs", "diff": "@@ -43,6 +43,15 @@ namespace ExchangeSharp\n/// </summary>\npublic interface IAPIRequestMaker\n{\n+ public class RequestResult<T>\n+ {\n+ /// <summary> request response </summary>\n+ public T Response { get; set; }\n+\n+ /// <summary> raw HTTP header date </summary>\n+ public DateTimeOffset? HTTPHeaderDate { get; set; }\n+ }\n+\n/// <summary>\n/// Make a request to a path on the API\n/// </summary>\n@@ -53,7 +62,7 @@ namespace ExchangeSharp\n/// <param name=\"method\">Request method or null for default</param>\n/// <returns>Raw response</returns>\n/// <exception cref=\"System.Exception\">Request fails</exception>\n- Task<string> MakeRequestAsync(string url, string? baseUrl = null, Dictionary<string, object>? payload = null, string? method = null);\n+ Task<RequestResult<string>> MakeRequestAsync(string url, string? baseUrl = null, Dictionary<string, object>? payload = null, string? method = null);\n/// <summary>\n/// An action to execute when a request has been made (this request and state and object (response or exception))\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/BL3P/ExchangeBL3PAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/BL3P/ExchangeBL3PAPI.cs", "diff": "@@ -264,13 +264,10 @@ namespace ExchangeSharp\nthrow new NotSupportedException($\"{order.OrderType} is not supported\");\n}\n- var resultBody = await MakeRequestAsync(\n+ var result = (await MakeJsonRequestAsync<BL3POrderAddResponse>(\n$\"/{order.MarketSymbol}/money/order/add\",\npayload: data\n- );\n-\n- var result = JsonConvert.DeserializeObject<BL3POrderAddResponse>(resultBody)\n- .Except();\n+ )).Except();\nvar orderDetails = await GetOrderDetailsAsync(result.OrderId, marketSymbol: order.MarketSymbol);\n@@ -282,9 +279,7 @@ namespace ExchangeSharp\nif (string.IsNullOrWhiteSpace(marketSymbol))\nthrow new ArgumentException(\"Value cannot be null or whitespace.\", nameof(marketSymbol));\n- var resultBody = await MakeRequestAsync($\"/{marketSymbol}/money/depth/full\");\n-\n- var bl3pOrderBook = JsonConvert.DeserializeObject<BL3PReponseFullOrderBook>(resultBody)\n+ var bl3pOrderBook = (await MakeJsonRequestAsync<BL3PReponseFullOrderBook>($\"/{marketSymbol}/money/depth/full\"))\n.Except();\nbl3pOrderBook.MarketSymbol??= marketSymbol;\n@@ -298,16 +293,13 @@ namespace ExchangeSharp\nthrow new ArgumentException(\"Value cannot be null or whitespace.\", nameof(marketSymbol));\nif (isClientOrderId) throw new NotSupportedException(\"Cancelling by client order ID is not supported in ExchangeSharp. Please submit a PR if you are interested in this feature\");\n- var resultBody = await MakeRequestAsync(\n+ (await MakeJsonRequestAsync<BL3PEmptyResponse>(\n$\"/{marketSymbol}/money/order/cancel\",\npayload: new Dictionary<string, object>\n{\n{\"order_id\", orderId}\n}\n- );\n-\n- JsonConvert.DeserializeObject<BL3PEmptyResponse>(resultBody)\n- .Except();\n+ )).Except();\n}\nprotected override async Task<ExchangeOrderResult> OnGetOrderDetailsAsync(string orderId, string marketSymbol = null, bool isClientOrderId = false)\n@@ -321,14 +313,10 @@ namespace ExchangeSharp\n{\"order_id\", orderId}\n};\n- var resultBody = await MakeRequestAsync(\n+ var result = (await MakeJsonRequestAsync<BL3POrderResultResponse>(\n$\"/{marketSymbol}/money/order/result\",\npayload: data\n- );\n-\n-\n- var result = JsonConvert.DeserializeObject<BL3POrderResultResponse>(resultBody)\n- .Except();\n+ )).Except();\nreturn new ExchangeOrderResult\n{\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/Bybit/ExchangeBybitAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/Bybit/ExchangeBybitAPI.cs", "diff": "@@ -81,7 +81,7 @@ namespace ExchangeSharp\n{\nawait new SynchronizationContextRemover();\n- string stringResult = await MakeRequestAsync(url, baseUrl, payload, requestMethod);\n+ string stringResult = (await MakeRequestAsync(url, baseUrl, payload, requestMethod)).Response;\nreturn JsonConvert.DeserializeObject<T>(stringResult);\n}\n#nullable disable\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/Coinbase/ExchangeCoinbaseAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/Coinbase/ExchangeCoinbaseAPI.cs", "diff": "@@ -738,8 +738,10 @@ namespace ExchangeSharp\n}\norder.ExtraParameters.CopyTo(payload);\n- JToken result = await MakeJsonRequestAsync<JToken>(\"/orders\", null, payload, \"POST\");\n- return ParseOrder(result);\n+ var result = await MakeJsonRequestFullAsync<JToken>(\"/orders\", null, payload, \"POST\");\n+ var resultOrder = ParseOrder(result.Response);\n+ resultOrder.HTTPHeaderDate = result.HTTPHeaderDate.Value.UtcDateTime;\n+ return resultOrder;\n}\nprotected override async Task<ExchangeOrderResult> OnGetOrderDetailsAsync(string orderId, string marketSymbol = null, bool isClientOrderId = false)\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/Gemini/ExchangeGeminiAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/Gemini/ExchangeGeminiAPI.cs", "diff": "@@ -102,7 +102,7 @@ namespace ExchangeSharp\ntry\n{\n- string html = await RequestMaker.MakeRequestAsync(\"/rest-api\", \"https://docs.gemini.com\");\n+ string html = (await RequestMaker.MakeRequestAsync(\"/rest-api\", \"https://docs.gemini.com\")).Response;\nint startPos = html.IndexOf(\"<h1 id=\\\"symbols-and-minimums\\\">Symbols and minimums</h1>\");\nif (startPos < 0)\n{\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/Model/ExchangeOrderResult.cs", "new_path": "src/ExchangeSharp/Model/ExchangeOrderResult.cs", "diff": "@@ -46,7 +46,10 @@ namespace ExchangeSharp\n/// </summary>\npublic decimal Amount { get; set; }\n- /// <summary>Amount filled in the market currency. May be null if not provided by exchange</summary>\n+ /// <summary>\n+ /// In the market currency. May be null if not provided by exchange\n+ /// If this is a Trade, then this is the amount filled in the trade. If it is an order, this is the cumulative amount filled in the order so far.\n+ /// </summary>\npublic decimal? AmountFilled { get; set; }\n/// <summary>\n@@ -67,6 +70,9 @@ namespace ExchangeSharp\n/// <summary>Order datetime in UTC</summary>\npublic DateTime OrderDate { get; set; }\n+ /// <summary> raw HTTP header date </summary>\n+ public DateTime? HTTPHeaderDate { get; set; }\n+\n/// <summary>datetime in UTC order was completed (could be filled, cancelled, expired, rejected, etc...). Null if still open.</summary>\npublic DateTime? CompletedDate { get; set; }\n" }, { "change_type": "MODIFY", "old_path": "tests/ExchangeSharpTests/ExchangeBinanceAPITests.cs", "new_path": "tests/ExchangeSharpTests/ExchangeBinanceAPITests.cs", "diff": "@@ -102,7 +102,7 @@ namespace ExchangeSharpTests\nvar requestMaker = Substitute.For<IAPIRequestMaker>();\nvar binance = await ExchangeAPI.GetExchangeAPIAsync<ExchangeBinanceAPI>();\nbinance.RequestMaker = requestMaker;\n- requestMaker.MakeRequestAsync(\"/capital/config/getall\", ((ExchangeBinanceAPI)binance).BaseUrlSApi).Returns(Resources.BinanceGetAllAssets);\n+ requestMaker.MakeRequestAsync(\"/capital/config/getall\", ((ExchangeBinanceAPI)binance).BaseUrlSApi).Returns(new IAPIRequestMaker.RequestResult<string>() { Response = Resources.BinanceGetAllAssets });\nIReadOnlyDictionary<string, ExchangeCurrency> currencies = await binance.GetCurrenciesAsync();\ncurrencies.Should().HaveCount(3);\ncurrencies.TryGetValue(\"bnb\", out ExchangeCurrency bnb).Should().BeTrue();\n" } ]
C#
MIT License
jjxtra/exchangesharp
provide HTTPHeaderDate when placing Coinbase orders (#771)
329,089
30.04.2022 17:06:58
25,200
0af5d5b3abb1546efd59d45c74bca954640d5a23
add trade stream for BtcTurk
[ { "change_type": "ADD", "old_path": null, "new_path": "src/ExchangeSharp/API/Exchanges/BtcTurk/ExchangeBtcTurkAPI.cs", "diff": "+using Newtonsoft.Json.Linq;\n+using System;\n+using System.Collections.Generic;\n+using System.Linq;\n+using System.Text;\n+using System.Threading.Tasks;\n+\n+namespace ExchangeSharp\n+{\n+ public sealed partial class ExchangeBtcTurkAPI : ExchangeAPI\n+ {\n+ public override string BaseUrl { get; set; } = \"https://api.btcturk.com\";\n+ public override string BaseUrlWebSocket { get; set; } = \"wss://ws-feed-pro.btcturk.com\";\n+\n+ public ExchangeBtcTurkAPI()\n+ {\n+ NonceStyle = NonceStyle.UnixMilliseconds;\n+ NonceOffset = TimeSpan.FromSeconds(0.1);\n+ // WebSocketOrderBookType = not implemented\n+ MarketSymbolSeparator = \"\";\n+ MarketSymbolIsUppercase = true;\n+ // ExchangeGlobalCurrencyReplacements[] not implemented\n+ }\n+\n+ protected internal override async Task<IEnumerable<ExchangeMarket>> OnGetMarketSymbolsMetadataAsync()\n+ { /*{\n+ \"data\": {\n+ \"timeZone\": \"UTC\",\n+ \"serverTime\": 1645091654418,\n+ \"symbols\": [\n+ {\n+ \"id\": 1,\n+ \"name\": \"BTCTRY\",\n+ \"nameNormalized\": \"BTC_TRY\",\n+ \"status\": \"TRADING\",\n+ \"numerator\": \"BTC\",\n+ \"denominator\": \"TRY\",\n+ \"numeratorScale\": 8,\n+ \"denominatorScale\": 2,\n+ \"hasFraction\": false,\n+ \"filters\": [\n+ {\n+ \"filterType\": \"PRICE_FILTER\",\n+ \"minPrice\": \"0.0000000000001\",\n+ \"maxPrice\": \"10000000\",\n+ \"tickSize\": \"10\",\n+ \"minExchangeValue\": \"99.91\",\n+ \"minAmount\": null,\n+ \"maxAmount\": null\n+ }\n+ ],\n+ \"orderMethods\": [\n+ \"MARKET\",\n+ \"LIMIT\",\n+ \"STOP_MARKET\",\n+ \"STOP_LIMIT\"\n+ ],\n+ \"displayFormat\": \"#,###\",\n+ \"commissionFromNumerator\": false,\n+ \"order\": 1000,\n+ \"priceRounding\": false,\n+ \"isNew\": false,\n+ \"marketPriceWarningThresholdPercentage\": 0.2500000000000000,\n+ \"maximumOrderAmount\": null,\n+ \"maximumLimitOrderPrice\": 5895000.0000000000000000,\n+ \"minimumLimitOrderPrice\": 58950.0000000000000000\n+ }\n+ }*/\n+ var instruments = await MakeJsonRequestAsync<JToken>(\"api/v2/server/exchangeinfo\");\n+ var markets = new List<ExchangeMarket>();\n+ foreach (JToken instrument in instruments[\"symbols\"])\n+ {\n+ markets.Add(new ExchangeMarket\n+ {\n+ MarketSymbol = instrument[\"name\"].ToStringUpperInvariant(),\n+ QuoteCurrency = instrument[\"denominator\"].ToStringInvariant(),\n+ BaseCurrency = instrument[\"numerator\"].ToStringInvariant(),\n+ });\n+ }\n+ return markets;\n+ }\n+\n+ protected override async Task<IWebSocket> OnGetTradesWebSocketAsync(Func<KeyValuePair<string, ExchangeTrade>, Task> callback, params string[] marketSymbols)\n+ {\n+ if (marketSymbols == null || marketSymbols.Length == 0)\n+ {\n+ marketSymbols = (await GetMarketSymbolsMetadataAsync()).Select(m => m.MarketSymbol).ToArray();\n+ }\n+ return await ConnectPublicWebSocketAsync(\"/market\", async (_socket, msg) =>\n+ { /* {[\n+ 991,\n+ {\n+ \"type\": 991,\n+ \"current\": \"5.1.0\",\n+ \"min\": \"2.3.0\"\n+ }\n+ ]}*/\n+\n+ /* {[\n+ 451,\n+ {\n+ \"type\": 451,\n+ \"pairId\": 0,\n+ \"symbol\": \"BTCTRY\",\n+ \"id\": 0,\n+ \"method\": 0,\n+ \"userId\": 0,\n+ \"orderType\": 0,\n+ \"price\": \"0\",\n+ \"amount\": \"0\",\n+ \"numLeft\": \"0.00\",\n+ \"denomLeft\": \"0\",\n+ \"newOrderClientId\": null\n+ }\n+ ]}] */\n+ JToken token = JToken.Parse(msg.ToStringFromUTF8());\n+ if (token[0].ToObject<int>() == 991)\n+ {\n+ // no need to do anything with this\n+ }\n+ //else if (token[\"method\"].ToStringInvariant() == \"ERROR\" || token[\"method\"].ToStringInvariant() == \"unknown\")\n+ //{\n+ // throw new APIException(token[\"code\"].ToStringInvariant() + \": \" + token[\"message\"].ToStringInvariant());\n+ //}\n+ else if (token[0].ToObject<int>() == 451)\n+ {\n+ // channel 451 OrderInsert. Ignore.\n+ }\n+ else if (token[0].ToObject<int>() == 100)\n+ { /*\n+ {[\n+ 100,\n+ {\n+ \"ok\": true,\n+ \"message\": \"join|trade:BTCTRY\",\n+ \"type\": 100\n+ }\n+ ]}\n+ */\n+ // successfully joined\n+ }\n+ else if (token[0].ToObject<int>() == 421)\n+ { /*\n+ {[\n+ 421,\n+ {\n+ \"symbol\": \"BTCTRY\",\n+ \"items\": [\n+ {\n+ \"D\": \"1651204111661\",\n+ \"I\": \"100163785789620803\",\n+ \"A\": \"0.0072834700\",\n+ \"P\": \"586484.0000000000\",\n+ \"S\": 0\n+ },\n+ {\n+ \"D\": \"1651202811844\",\n+ \"I\": \"100163785789620737\",\n+ \"A\": \"0.0004123600\",\n+ \"P\": \"585778.0000000000\",\n+ \"S\": 1\n+ }\n+ ],\n+ \"channel\": \"trade\",\n+ \"event\": \"BTCTRY\",\n+ \"type\": 421\n+ }\n+ ]} */\n+ var data = token[1];\n+ var dataArray = data[\"items\"].ToArray();\n+ for (int i = 0; i < dataArray.Length; i++)\n+ {\n+ var trade = dataArray[i].ParseTrade(\"A\", \"P\", \"S\", \"D\", TimestampType.UnixMilliseconds, \"I\", \"0\");\n+ string marketSymbol = data[\"symbol\"].ToStringInvariant();\n+ trade.Flags |= ExchangeTradeFlags.IsFromSnapshot;\n+ if (i == dataArray.Length - 1)\n+ trade.Flags |= ExchangeTradeFlags.IsLastFromSnapshot;\n+ await callback(new KeyValuePair<string, ExchangeTrade>(marketSymbol, trade));\n+ }\n+ }\n+ else if (token[0].ToObject<int>() == 422)\n+ { /* {[\n+ 422,\n+ {\n+ \"D\": \"1651204593830\",\n+ \"I\": \"100163785789620825\",\n+ \"A\": \"0.0008777700\",\n+ \"P\": \"586950.0000000000\",\n+ \"PS\": \"BTCTRY\",\n+ \"S\": 1,\n+ \"channel\": \"trade\",\n+ \"event\": \"BTCTRY\",\n+ \"type\": 422\n+ }\n+ ]} */\n+ var data = token[1];\n+ var trade = data.ParseTrade(\"A\", \"P\", \"S\", \"D\", TimestampType.UnixMilliseconds, \"I\", \"0\");\n+ string marketSymbol = data[\"PS\"].ToStringInvariant();\n+ await callback(new KeyValuePair<string, ExchangeTrade>(marketSymbol, trade));\n+ }\n+ else Logger.Warn($\"Unexpected channel {token[0].ToObject<int>()}\");\n+ }, async (_socket) =>\n+ { /*\n+ [\n+ 151,\n+ {\n+ \"type\": 151,\n+ \"channel\": 'CHANNEL_NAME_HERE',\n+ \"event\": 'PAIR_NAME_HERE',\n+ \"join\": True\n+ }\n+ ]\n+ */\n+ foreach (var marketSymbol in marketSymbols)\n+ {\n+ var subscribeRequest = new List<object>();\n+ subscribeRequest.Add(151);\n+ subscribeRequest.Add(new\n+ {\n+ type = 151,\n+ channel = \"trade\",\n+ @event = marketSymbol,\n+ join = true, // If true, it means that you want to subscribe, if false, you can unsubscribe.\n+ });\n+ await _socket.SendMessageAsync(subscribeRequest.ToArray());\n+ }\n+ });\n+ }\n+\n+ }\n+ public partial class ExchangeName { public const string BtcTurk = \"BtcTurk\"; }\n+}\n" } ]
C#
MIT License
jjxtra/exchangesharp
add trade stream for BtcTurk (#772)
329,089
02.05.2022 16:12:22
25,200
96dcb45d6022fad9e90da6bfa8398a3bedcbaa46
new NuGet 1.0.2 changed link from jjxtra/ES to DigitalRuby/ES added BtcTurk to readme
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -41,6 +41,7 @@ The following cryptocurrency exchanges are supported:\n| Bittrex | x | x | T R |\n| BL3P | x | x | R B | Trades stream does not send trade's ids. |\n| Bleutrade | x | x | |\n+| BtcTurk | | | R |\n| BTSE | x | x | |\n| Bybit | x | x | R | Has public method for Websocket Positions\n| Coinbase | x | x | T R O U |\n@@ -112,11 +113,11 @@ See [`WebSocket4NetClientWebSocket.cs`][websocket4net] for implementation detail\n#### dotnet CLI\n-[`dotnet add package DigitalRuby.ExchangeSharp --version 1.0.1`][nuget]\n+[`dotnet add package DigitalRuby.ExchangeSharp --version 1.0.2`][nuget]\n#### Package Manager on VS\n-[`PM> Install-Package DigitalRuby.ExchangeSharp -Version 1.0.1`][nuget]\n+[`PM> Install-Package DigitalRuby.ExchangeSharp -Version 1.0.2`][nuget]\n### Examples\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/BitMEX/ExchangeBitMEXAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/BitMEX/ExchangeBitMEXAPI.cs", "diff": "@@ -88,15 +88,17 @@ namespace ExchangeSharp\nprotected internal override async Task<IEnumerable<ExchangeMarket>> OnGetMarketSymbolsMetadataAsync()\n{\n/*\n- {{\n- \"symbol\": \".XRPXBT\",\n- \"rootSymbol\": \"XRP\",\n- \"state\": \"Unlisted\",\n- \"typ\": \"MRCXXX\",\n- \"listing\": null,\n- \"front\": null,\n- \"expiry\": null,\n- \"settle\": null,\n+[\n+ {\n+ \"symbol\": \"XBTZ14\",\n+ \"rootSymbol\": \"XBT\",\n+ \"state\": \"Settled\",\n+ \"typ\": \"FXXXS\",\n+ \"listing\": \"2014-11-21T20:00:00.000Z\",\n+ \"front\": \"2014-11-28T12:00:00.000Z\",\n+ \"expiry\": \"2014-12-26T12:00:00.000Z\",\n+ \"settle\": \"2014-12-26T12:00:00.000Z\",\n+ \"listedSettle\": \"2014-12-26T12:00:00.000Z\",\n\"relistInterval\": null,\n\"inverseLeg\": \"\",\n\"sellLeg\": \"\",\n@@ -106,37 +108,37 @@ namespace ExchangeSharp\n\"optionStrikePrice\": null,\n\"optionMultiplier\": null,\n\"positionCurrency\": \"\",\n- \"underlying\": \"XRP\",\n- \"quoteCurrency\": \"XBT\",\n- \"underlyingSymbol\": \"XRPXBT=\",\n- \"reference\": \"PLNX\",\n- \"referenceSymbol\": \"BTC_XRP\",\n+ \"underlying\": \"XBT\",\n+ \"quoteCurrency\": \"USD\",\n+ \"underlyingSymbol\": \"XBT=\",\n+ \"reference\": \"BMEX\",\n+ \"referenceSymbol\": \".XBT2H\",\n\"calcInterval\": null,\n- \"publishInterval\": \"2000-01-01T00:01:00Z\",\n+ \"publishInterval\": null,\n\"publishTime\": null,\n- \"maxOrderQty\": null,\n- \"maxPrice\": null,\n- \"lotSize\": null,\n- \"tickSize\": 1E-08,\n- \"multiplier\": null,\n- \"settlCurrency\": \"\",\n+ \"maxOrderQty\": 10000000,\n+ \"maxPrice\": 1000000,\n+ \"lotSize\": 1,\n+ \"tickSize\": 0.01,\n+ \"multiplier\": 1000,\n+ \"settlCurrency\": \"XBt\",\n\"underlyingToPositionMultiplier\": null,\n- \"underlyingToSettleMultiplier\": null,\n+ \"underlyingToSettleMultiplier\": 100000000,\n\"quoteToSettleMultiplier\": null,\n- \"isQuanto\": false,\n+ \"isQuanto\": true,\n\"isInverse\": false,\n- \"initMargin\": null,\n- \"maintMargin\": null,\n- \"riskLimit\": null,\n- \"riskStep\": null,\n- \"limit\": null,\n+ \"initMargin\": 0.3,\n+ \"maintMargin\": 0.2,\n+ \"riskLimit\": 25000000000,\n+ \"riskStep\": 5000000000,\n+ \"limit\": 0.2,\n\"capped\": false,\n\"taxed\": false,\n\"deleverage\": false,\n- \"makerFee\": null,\n- \"takerFee\": null,\n- \"settlementFee\": null,\n- \"insuranceFee\": null,\n+ \"makerFee\": 0.00005,\n+ \"takerFee\": 0.00005,\n+ \"settlementFee\": 0.00005,\n+ \"insuranceFee\": 0.00015,\n\"fundingBaseSymbol\": \"\",\n\"fundingQuoteSymbol\": \"\",\n\"fundingPremiumSymbol\": \"\",\n@@ -146,30 +148,32 @@ namespace ExchangeSharp\n\"indicativeFundingRate\": null,\n\"rebalanceTimestamp\": null,\n\"rebalanceInterval\": null,\n- \"openingTimestamp\": null,\n- \"closingTimestamp\": null,\n- \"sessionInterval\": null,\n- \"prevClosePrice\": null,\n- \"limitDownPrice\": null,\n- \"limitUpPrice\": null,\n+ \"openingTimestamp\": \"2014-12-26T12:00:00.000Z\",\n+ \"closingTimestamp\": \"2014-12-26T12:00:00.000Z\",\n+ \"sessionInterval\": \"2000-01-01T08:00:00.000Z\",\n+ \"prevClosePrice\": 319,\n+ \"limitDownPrice\": 255.2,\n+ \"limitUpPrice\": 382.8,\n\"bankruptLimitDownPrice\": null,\n\"bankruptLimitUpPrice\": null,\n- \"prevTotalVolume\": null,\n- \"totalVolume\": null,\n- \"volume\": null,\n- \"volume24h\": null,\n- \"prevTotalTurnover\": null,\n- \"totalTurnover\": null,\n- \"turnover\": null,\n- \"turnover24h\": null,\n- \"prevPrice24h\": 7.425E-05,\n+ \"prevTotalVolume\": 323564,\n+ \"totalVolume\": 348271,\n+ \"volume\": 0,\n+ \"volume24h\": 0,\n+ \"prevTotalTurnover\": 0,\n+ \"totalTurnover\": 0,\n+ \"turnover\": 0,\n+ \"turnover24h\": 0,\n+ \"homeNotional24h\": 0,\n+ \"foreignNotional24h\": 0,\n+ \"prevPrice24h\": 323.33,\n\"vwap\": null,\n\"highPrice\": null,\n\"lowPrice\": null,\n- \"lastPrice\": 7.364E-05,\n- \"lastPriceProtected\": null,\n- \"lastTickDirection\": \"MinusTick\",\n- \"lastChangePcnt\": -0.0082,\n+ \"lastPrice\": 323.33,\n+ \"lastPriceProtected\": 323.33,\n+ \"lastTickDirection\": \"PlusTick\",\n+ \"lastChangePcnt\": 0,\n\"bidPrice\": null,\n\"midPrice\": null,\n\"askPrice\": null,\n@@ -181,16 +185,17 @@ namespace ExchangeSharp\n\"openValue\": 0,\n\"fairMethod\": \"\",\n\"fairBasisRate\": null,\n- \"fairBasis\": null,\n- \"fairPrice\": null,\n+ \"fairBasis\": 0,\n+ \"fairPrice\": 323.33,\n\"markMethod\": \"LastPrice\",\n- \"markPrice\": 7.364E-05,\n+ \"markPrice\": 323.33,\n\"indicativeTaxRate\": null,\n- \"indicativeSettlePrice\": null,\n+ \"indicativeSettlePrice\": 323.33,\n\"optionUnderlyingPrice\": null,\n- \"settledPrice\": null,\n- \"timestamp\": \"2018-07-05T13:27:15Z\"\n-}}\n+ \"settledPriceAdjustmentRate\": null,\n+ \"settledPrice\": 323.33,\n+ \"timestamp\": \"2014-11-21T21:00:02.409Z\"\n+ },\n*/\nList<ExchangeMarket> markets = new List<ExchangeMarket>();\n@@ -209,11 +214,23 @@ namespace ExchangeSharp\n{\nmarket.PriceStepSize = marketSymbolToken[\"tickSize\"].ConvertInvariant<decimal>();\nmarket.MaxPrice = marketSymbolToken[\"maxPrice\"].ConvertInvariant<decimal>();\n- //market.MinPrice = symbol[\"minPrice\"].ConvertInvariant<decimal>();\n+ //market.MinPrice = symbol[\"minPrice\"].ConvertInvariant<decimal>(); - BitMex does not provide min price\nmarket.MaxTradeSize = marketSymbolToken[\"maxOrderQty\"].ConvertInvariant<decimal>();\n- //market.MinTradeSize = symbol[\"minQty\"].ConvertInvariant<decimal>();\n- //market.QuantityStepSize = symbol[\"stepSize\"].ConvertInvariant<decimal>();\n+ var underlyingToPositionMultiplier = marketSymbolToken[\"underlyingToPositionMultiplier\"].Type == JTokenType.Null ? 1 : marketSymbolToken[\"underlyingToPositionMultiplier\"].ConvertInvariant<decimal>();\n+ var contractSize = 1 / underlyingToPositionMultiplier;\n+ var lotSize = marketSymbolToken[\"lotSize\"].ConvertInvariant<decimal>();\n+ var minTradeAmt = contractSize * lotSize;\n+ var positionCurrency = marketSymbolToken[\"positionCurrency\"]?.ToStringUpperInvariant();\n+ if (positionCurrency == market.BaseCurrency)\n+ {\n+ market.MinTradeSize = market.QuantityStepSize = minTradeAmt;\n+ }\n+ else if (positionCurrency == market.QuoteCurrency)\n+ {\n+ market.MinTradeSizeInQuoteCurrency = minTradeAmt;\n+ }\n+ // else positionCurrency is probably null and the intrument is not active\n}\ncatch\n{\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/ExchangeSharp.csproj", "new_path": "src/ExchangeSharp/ExchangeSharp.csproj", "diff": "<LangVersion>8</LangVersion>\n<PackageId>DigitalRuby.ExchangeSharp</PackageId>\n<Title>ExchangeSharp - C# API for cryptocurrency exchanges</Title>\n- <PackageVersion>1.0.1</PackageVersion>\n+ <PackageVersion>1.0.2</PackageVersion>\n<Authors>jjxtra</Authors>\n<Description>ExchangeSharp is a C# API for working with various cryptocurrency exchanges. Web sockets are also supported for some exchanges.</Description>\n<Summary>Supported exchanges: Binance BitMEX Bitfinex Bithumb Bitstamp Bittrex BL3P Bleutrade BTSE Cryptopia Coinbase(GDAX) Digifinex Gemini Gitbtc Huobi Kraken Kucoin Livecoin NDAX OKCoin OKEx Poloniex TuxExchange Yobit ZBcom. Pull requests welcome.</Summary>\n<PackageIcon>icon.png</PackageIcon>\n<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>\n- <PackageProjectUrl>https://github.com/jjxtra/ExchangeSharp</PackageProjectUrl>\n+ <PackageProjectUrl>https://github.com/DigitalRuby/ExchangeSharp</PackageProjectUrl>\n<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>\n- <PackageReleaseNotes>https://github.com/jjxtra/ExchangeSharp/releases</PackageReleaseNotes>\n+ <PackageReleaseNotes>https://github.com/DigitalRuby/ExchangeSharp/releases</PackageReleaseNotes>\n<PackageReadmeFile>README.md</PackageReadmeFile>\n<PackageTags>C# crypto cryptocurrency trade trader exchange sharp socket web socket websocket signalr secure API Binance BitMEX Bitfinex Bithumb Bitstamp Bittrex BL3P Bleutrade BTSE Cryptopia Coinbase GDAX Digifinex Gemini Gitbtc Huobi Kraken Kucoin Livecoin NDAX OKCoin OKEx Poloniex TuxExchange Yobit ZBcom</PackageTags>\n- <RepositoryUrl>https://github.com/jjxtra/ExchangeSharp</RepositoryUrl>\n+ <RepositoryUrl>https://github.com/DigitalRuby/ExchangeSharp</RepositoryUrl>\n<RepositoryType>git</RepositoryType>\n<AllowUnsafeBlocks>true</AllowUnsafeBlocks>\n</PropertyGroup>\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/Properties/AssemblyInfo.cs", "new_path": "src/ExchangeSharp/Properties/AssemblyInfo.cs", "diff": "@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;\n//\n// You can specify all the values or you can default the Build and Revision Numbers\n// by using the '*' as shown below:\n-[assembly: AssemblyVersion(\"1.0.1\")]\n-[assembly: AssemblyFileVersion(\"1.0.1\")]\n+[assembly: AssemblyVersion(\"1.0.2\")]\n+[assembly: AssemblyFileVersion(\"1.0.2\")]\n[assembly: InternalsVisibleTo(\"ExchangeSharpTests\")]\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharpConsole/ExchangeSharpConsole.csproj", "new_path": "src/ExchangeSharpConsole/ExchangeSharpConsole.csproj", "diff": "<AssemblyName>exchange-sharp</AssemblyName>\n<TargetFramework>net6.0</TargetFramework>\n<NeutralLanguage>en</NeutralLanguage>\n- <AssemblyVersion>1.0.1</AssemblyVersion>\n- <FileVersion>1.0.1</FileVersion>\n+ <AssemblyVersion>1.0.2</AssemblyVersion>\n+ <FileVersion>1.0.2</FileVersion>\n</PropertyGroup>\n<ItemGroup>\n" }, { "change_type": "MODIFY", "old_path": "tests/ExchangeSharpTests/ExchangeSharpTests.csproj", "new_path": "tests/ExchangeSharpTests/ExchangeSharpTests.csproj", "diff": "<TargetFramework>net6.0</TargetFramework>\n<IsPackable>false</IsPackable>\n<NeutralLanguage>en</NeutralLanguage>\n- <AssemblyVersion>1.0.1</AssemblyVersion>\n- <FileVersion>1.0.1</FileVersion>\n+ <AssemblyVersion>1.0.2</AssemblyVersion>\n+ <FileVersion>1.0.2</FileVersion>\n<NoWin32Manifest>true</NoWin32Manifest>\n</PropertyGroup>\n" } ]
C#
MIT License
jjxtra/exchangesharp
new NuGet 1.0.2 (#773) - changed link from jjxtra/ES to DigitalRuby/ES - added BtcTurk to readme
329,089
03.05.2022 16:11:57
25,200
c1c188521feca9358a38ab5d7bea264c2138956c
add release-drafter workflow another (different) file named release-drafter.yml, but in the workflow folder
[ { "change_type": "ADD", "old_path": null, "new_path": ".github/workflows/release-drafter.yml", "diff": "+name: Release Drafter\n+\n+on:\n+ push:\n+ # branches to consider in the event; optional, defaults to all\n+ branches:\n+ - master\n+ # pull_request event is required only for autolabeler\n+ pull_request:\n+ # Only following types are handled by the action, but one can default to all as well\n+ types: [opened, reopened, synchronize]\n+ # pull_request_target event is required for autolabeler to support PRs from forks\n+ # pull_request_target:\n+ # types: [opened, reopened, synchronize]\n+\n+jobs:\n+ update_release_draft:\n+ runs-on: ubuntu-latest\n+ steps:\n+ # (Optional) GitHub Enterprise requires GHE_HOST variable set\n+ #- name: Set GHE_HOST\n+ # run: |\n+ # echo \"GHE_HOST=${GITHUB_SERVER_URL##https:\\/\\/}\" >> $GITHUB_ENV\n+\n+ # Drafts your next Release notes as Pull Requests are merged into \"master\"\n+ - uses: release-drafter/release-drafter@v5\n+ # (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml\n+ # with:\n+ # config-name: my-config.yml\n+ # disable-autolabeler: true\n+ env:\n+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n\\ No newline at end of file\n" } ]
C#
MIT License
jjxtra/exchangesharp
add release-drafter workflow (#774) - another (different) file named release-drafter.yml, but in the workflow folder
329,089
06.05.2022 12:11:27
25,200
d6a37936dcd0d23de358bec0e10e2e42fceb99fc
fix HTTPHeaderDate in BaseAPI pass through HTTPHeaderDate in BaseAPI.MakeJsonRequestFullAsync<T>()
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Common/BaseAPI.cs", "new_path": "src/ExchangeSharp/API/Common/BaseAPI.cs", "diff": "@@ -524,13 +524,13 @@ namespace ExchangeSharp\n{\nawait new SynchronizationContextRemover();\n- string stringResult = (await MakeRequestAsync(url, baseUrl: baseUrl, payload: payload, method: requestMethod)).Response;\n- T jsonResult = JsonConvert.DeserializeObject<T>(stringResult, SerializerSettings);\n+ var result = await MakeRequestAsync(url, baseUrl: baseUrl, payload: payload, method: requestMethod);\n+ T jsonResult = JsonConvert.DeserializeObject<T>(result.Response, SerializerSettings);\nif (jsonResult is JToken token)\n{\nreturn new IAPIRequestMaker.RequestResult<T>() { Response = (T)(object)CheckJsonResponse(token) };\n}\n- return new IAPIRequestMaker.RequestResult<T>() { Response = jsonResult };\n+ return new IAPIRequestMaker.RequestResult<T>() { Response = jsonResult, HTTPHeaderDate = result.HTTPHeaderDate };\n}\n/// <summary>\n" } ]
C#
MIT License
jjxtra/exchangesharp
fix HTTPHeaderDate in BaseAPI (#775) - pass through HTTPHeaderDate in BaseAPI.MakeJsonRequestFullAsync<T>()
329,089
06.05.2022 14:45:55
25,200
c3936b15f9a10095ec86087b79706f6c381082b5
skip tests and add pack/push to Azure pipleline push to Azure artifacts updated .net sdk to 6.x updated ubuntu to latest
[ { "change_type": "MODIFY", "old_path": "azure-pipelines.yml", "new_path": "azure-pipelines.yml", "diff": "@@ -50,14 +50,32 @@ jobs:\ncommand: 'build'\nconfiguration: $(BuildConfiguration)\nprojects: 'src/ExchangeSharpConsole/ExchangeSharpConsole.csproj'\n+ #- task: DotNetCoreCLI@2\n+ # displayName: 'Tests'\n+ # inputs:\n+ # command: 'test'\n+ # configuration: $(BuildConfiguration)\n+ # projects: 'tests/*/*.csproj'\n+ # publishTestResults: true\n+ # testRunTitle: 'All tests'\n- task: DotNetCoreCLI@2\n- displayName: 'Tests'\n+ displayName: 'NuGet Pack'\ninputs:\n- command: 'test'\n- configuration: $(BuildConfiguration)\n- projects: 'tests/*/*.csproj'\n- publishTestResults: true\n- testRunTitle: 'All tests'\n+ command: pack\n+ packagesToPack: '**/*.csproj'\n+ packDestination: '$(Build.ArtifactStagingDirectory)'\n+ versioningScheme: byPrereleaseNumber\n+ majorVersion: '$(Major)'\n+ minorVersion: '$(Minor)'\n+ patchVersion: '$(Patch)'\n+ - task: NuGetAuthenticate@0\n+ displayName: 'NuGet Authenticate'\n+ - task: NuGetCommand@2\n+ displayName: 'NuGet push'\n+ inputs:\n+ command: push\n+ publishVstsFeed: 'PublicProject/DigitalRuby'\n+ allowPackageConflicts: true\n- job: build_tag\ndisplayName: Build console app\ntimeoutInMinutes: 5\n@@ -83,7 +101,7 @@ jobs:\ncondition: eq(variables['Agent.OS'], 'Darwin')\ninputs:\npackageType: sdk\n- version: 3.0.100\n+ version: 6.x\ninstallationPath: $(Agent.ToolsDirectory)/dotnet\n- task: DotNetCoreCLI@2\ndisplayName: \"Publish console executable\"\n@@ -114,7 +132,7 @@ jobs:\ndependsOn: build_tag\ncontinueOnError: false\npool:\n- vmImage: ubuntu-18.04\n+ vmImage: ubuntu-latest\ncondition: or(eq(variables['Build.Reason'], 'Schedule'), startsWith(variables['Build.SourceBranch'], 'refs/tags'))\nsteps:\n- bash: echo \"##vso[task.setvariable variable=TAG;isOutput=true]$(git describe --tags --exact-match)\"\n" } ]
C#
MIT License
jjxtra/exchangesharp
skip tests and add pack/push to Azure pipleline (#776) - push to Azure artifacts - updated .net sdk to 6.x - updated ubuntu to latest
329,089
17.05.2022 17:14:43
25,200
55b11a63dab42f2bc2807301ec79e11ca5d26c92
futher HTTPHeaderDate fix pass through HTTPHeaderDate in JToken case in BaseAPI.MakeJsonRequestFullAsync<T>()
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Common/BaseAPI.cs", "new_path": "src/ExchangeSharp/API/Common/BaseAPI.cs", "diff": "@@ -528,7 +528,7 @@ namespace ExchangeSharp\nT jsonResult = JsonConvert.DeserializeObject<T>(result.Response, SerializerSettings);\nif (jsonResult is JToken token)\n{\n- return new IAPIRequestMaker.RequestResult<T>() { Response = (T)(object)CheckJsonResponse(token) };\n+ return new IAPIRequestMaker.RequestResult<T>() { Response = (T)(object)CheckJsonResponse(token), HTTPHeaderDate = result.HTTPHeaderDate };\n}\nreturn new IAPIRequestMaker.RequestResult<T>() { Response = jsonResult, HTTPHeaderDate = result.HTTPHeaderDate };\n}\n" } ]
C#
MIT License
jjxtra/exchangesharp
futher HTTPHeaderDate fix (#781) - pass through HTTPHeaderDate in JToken case in BaseAPI.MakeJsonRequestFullAsync<T>()
329,111
29.07.2022 01:15:02
-10,800
054218b0ff5b7ec97813fc6540af6b5f162f83dc
Order fees added
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/Bitstamp/ExchangeBitstampAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/Bitstamp/ExchangeBitstampAPI.cs", "diff": "@@ -286,7 +286,10 @@ namespace ExchangeSharp\n}\nstring _symbol = $\"{baseCurrency}-{quoteCurrency}\";\n- decimal amountFilled = 0, spentQuoteCurrency = 0, price = 0;\n+ decimal amountFilled = 0;\n+ decimal spentQuoteCurrency = 0;\n+ decimal price = 0;\n+ decimal fees = 0;\nforeach (var t in transactions)\n{\n@@ -294,6 +297,7 @@ namespace ExchangeSharp\nif (type != 2) { continue; }\nspentQuoteCurrency += t[quoteCurrency].ConvertInvariant<decimal>();\namountFilled += t[baseCurrency].ConvertInvariant<decimal>();\n+ fees += t[\"fee\"].ConvertInvariant<decimal>();\n//set price only one time\nif (price == 0)\n{\n@@ -309,6 +313,8 @@ namespace ExchangeSharp\nMarketSymbol = _symbol,\nAveragePrice = spentQuoteCurrency / amountFilled,\nPrice = price,\n+ Fees = fees,\n+ FeesCurrency = quoteCurrency,\nResult = status,\nResultCode = statusCode\n};\n" } ]
C#
MIT License
jjxtra/exchangesharp
Order fees added (#782)
329,089
17.08.2022 15:52:02
36,000
c09ca6b346e5d30dd321b2ac1ad261947655ca05
added rate limiter for BinanceGroupCommon
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs", "new_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs", "diff": "@@ -61,6 +61,14 @@ namespace ExchangeSharp.BinanceGroup\nMarketSymbolIsUppercase = true;\nWebSocketOrderBookType = WebSocketOrderBookType.DeltasOnly;\nExchangeGlobalCurrencyReplacements[\"BCC\"] = \"BCH\";\n+ /* Binance rate limits are a combination of 3 things:\n+ * - 1200 request weights per 1 minute\n+ * - 100 orders per 10 seconds\n+ * - 200,000 orders per 1 day\n+ * - 5,000 raw requests per 5 min\n+ * Since the most restrictive is the 100 orders per 10 seconds, and OCO orders count for 2, we can conservatively do a little less than 50 per 10 seconds\n+ */\n+ RateLimit = new RateGate(40, TimeSpan.FromSeconds(10)); // set to 9 to be safe\n}\npublic override Task<string> ExchangeMarketSymbolToGlobalMarketSymbolAsync(string marketSymbol)\n" } ]
C#
MIT License
jjxtra/exchangesharp
added rate limiter for BinanceGroupCommon (#784)
329,148
22.09.2022 19:16:21
21,600
756e1fbefbc7a7aa73f8e39ec52b6c48909c7a53
Fix for Binance currencies
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs", "new_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs", "diff": "@@ -101,7 +101,8 @@ namespace ExchangeSharp.BinanceGroup\nprotected override async Task<IReadOnlyDictionary<string, ExchangeCurrency>> OnGetCurrenciesAsync()\n{\n- var result = await MakeJsonRequestAsync<List<Currency>>(\"/capital/config/getall\", BaseUrlSApi);\n+ Dictionary<string, object> payload = await GetNoncePayloadAsync();\n+ var result = await MakeJsonRequestAsync<List<Currency>>(\"/capital/config/getall\", BaseUrlSApi, payload);\nreturn result.ToDictionary(x => x.AssetCode, x => new ExchangeCurrency\n{\n" }, { "change_type": "RENAME", "old_path": "src/ExchangeSharp/API/UPbit/ExchangeUPbitAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/UPbit/ExchangeUPbitAPI.cs", "diff": "" } ]
C#
MIT License
jjxtra/exchangesharp
Fix for Binance currencies (#786)
329,099
23.09.2022 04:17:59
-10,800
b1a2a8247424417d8d75ee37177c7fdb08ea9298
fix Binance OnGetTickersAsync Fix for
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs", "new_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs", "diff": "@@ -242,9 +242,16 @@ namespace ExchangeSharp.BinanceGroup\nJToken obj = await MakeJsonRequestAsync<JToken>(\"/ticker/24hr\", BaseUrlApi);\nforeach (JToken child in obj)\n{\n- string marketSymbol = child[\"symbol\"].ToStringInvariant();\n+ var marketSymbol = child[\"symbol\"].ToStringInvariant();\n+ try\n+ {\ntickers.Add(new KeyValuePair<string, ExchangeTicker>(marketSymbol, await ParseTickerAsync(marketSymbol, child)));\n}\n+ catch\n+ {\n+ // ignored\n+ }\n+ }\nreturn tickers;\n}\n" } ]
C#
MIT License
jjxtra/exchangesharp
fix Binance OnGetTickersAsync (#787) Fix for #785
329,089
06.10.2022 09:46:00
25,200
ce0e6031e342c512db23236b47445af1dccaa53f
new NuGet 1.0.3
[ { "change_type": "MODIFY", "old_path": "README.md", "new_path": "README.md", "diff": "@@ -113,11 +113,11 @@ See [`WebSocket4NetClientWebSocket.cs`][websocket4net] for implementation detail\n#### dotnet CLI\n-[`dotnet add package DigitalRuby.ExchangeSharp --version 1.0.2`][nuget]\n+[`dotnet add package DigitalRuby.ExchangeSharp --version 1.0.3`][nuget]\n#### Package Manager on VS\n-[`PM> Install-Package DigitalRuby.ExchangeSharp -Version 1.0.2`][nuget]\n+[`PM> Install-Package DigitalRuby.ExchangeSharp -Version 1.0.3`][nuget]\n### Examples\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs", "new_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs", "diff": "@@ -68,7 +68,7 @@ namespace ExchangeSharp.BinanceGroup\n* - 5,000 raw requests per 5 min\n* Since the most restrictive is the 100 orders per 10 seconds, and OCO orders count for 2, we can conservatively do a little less than 50 per 10 seconds\n*/\n- RateLimit = new RateGate(40, TimeSpan.FromSeconds(10)); // set to 9 to be safe\n+ RateLimit = new RateGate(40, TimeSpan.FromSeconds(10));\n}\npublic override Task<string> ExchangeMarketSymbolToGlobalMarketSymbolAsync(string marketSymbol)\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/ExchangeSharp.csproj", "new_path": "src/ExchangeSharp/ExchangeSharp.csproj", "diff": "<LangVersion>8</LangVersion>\n<PackageId>DigitalRuby.ExchangeSharp</PackageId>\n<Title>ExchangeSharp - C# API for cryptocurrency exchanges</Title>\n- <VersionPrefix>1.0.2</VersionPrefix>\n+ <VersionPrefix>1.0.3</VersionPrefix>\n<Authors>jjxtra</Authors>\n<Description>ExchangeSharp is a C# API for working with various cryptocurrency exchanges. Web sockets are also supported for some exchanges.</Description>\n<Summary>Supported exchanges: Binance BitMEX Bitfinex Bithumb Bitstamp Bittrex BL3P Bleutrade BTSE Cryptopia Coinbase(GDAX) Digifinex Gemini Gitbtc Huobi Kraken Kucoin Livecoin NDAX OKCoin OKEx Poloniex TuxExchange Yobit ZBcom. Pull requests welcome.</Summary>\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/Properties/AssemblyInfo.cs", "new_path": "src/ExchangeSharp/Properties/AssemblyInfo.cs", "diff": "@@ -31,6 +31,6 @@ using System.Runtime.InteropServices;\n//\n// You can specify all the values or you can default the Build and Revision Numbers\n// by using the '*' as shown below:\n-[assembly: AssemblyVersion(\"1.0.2\")]\n-[assembly: AssemblyFileVersion(\"1.0.2\")]\n+[assembly: AssemblyVersion(\"1.0.3\")]\n+[assembly: AssemblyFileVersion(\"1.0.3\")]\n[assembly: InternalsVisibleTo(\"ExchangeSharpTests\")]\n" }, { "change_type": "MODIFY", "old_path": "src/ExchangeSharpConsole/ExchangeSharpConsole.csproj", "new_path": "src/ExchangeSharpConsole/ExchangeSharpConsole.csproj", "diff": "<AssemblyName>exchange-sharp</AssemblyName>\n<TargetFramework>net6.0</TargetFramework>\n<NeutralLanguage>en</NeutralLanguage>\n- <AssemblyVersion>1.0.2</AssemblyVersion>\n- <FileVersion>1.0.2</FileVersion>\n+ <AssemblyVersion>1.0.3</AssemblyVersion>\n+ <FileVersion>1.0.3</FileVersion>\n</PropertyGroup>\n<ItemGroup>\n" }, { "change_type": "MODIFY", "old_path": "tests/ExchangeSharpTests/ExchangeSharpTests.csproj", "new_path": "tests/ExchangeSharpTests/ExchangeSharpTests.csproj", "diff": "<TargetFramework>net6.0</TargetFramework>\n<IsPackable>false</IsPackable>\n<NeutralLanguage>en</NeutralLanguage>\n- <AssemblyVersion>1.0.2</AssemblyVersion>\n- <FileVersion>1.0.2</FileVersion>\n+ <AssemblyVersion>1.0.3</AssemblyVersion>\n+ <FileVersion>1.0.3</FileVersion>\n<NoWin32Manifest>true</NoWin32Manifest>\n</PropertyGroup>\n" } ]
C#
MIT License
jjxtra/exchangesharp
new NuGet 1.0.3 (#790)
329,099
31.10.2022 06:11:39
-7,200
a23becb4d1c58fd36ee2d59e34edbc2be7dab463
fix KuCoin override CheckJsonResponse
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/KuCoin/ExchangeKuCoinAPI.cs", "new_path": "src/ExchangeSharp/API/Exchanges/KuCoin/ExchangeKuCoinAPI.cs", "diff": "@@ -62,6 +62,21 @@ namespace ExchangeSharp\n}\n}\n+ protected override JToken CheckJsonResponse(JToken result)\n+ {\n+ if (result == null)\n+ {\n+ throw new APIException(\"No result from server\");\n+ }\n+\n+ if (!string.IsNullOrWhiteSpace(result[\"msg\"].ToStringInvariant()))\n+ {\n+ throw new APIException(result.ToStringInvariant());\n+ }\n+\n+ return base.CheckJsonResponse(result);\n+ }\n+\n#region ProcessRequest\nprotected override async Task ProcessRequestAsync(IHttpWebRequest request, Dictionary<string, object> payload)\n" } ]
C#
MIT License
jjxtra/exchangesharp
fix KuCoin override CheckJsonResponse (#792)
329,127
11.01.2023 23:30:06
-28,800
1686831b7645e222c7d9faa212769ab8424c9abf
fix binance ticker websocket with symbol
[ { "change_type": "MODIFY", "old_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs", "new_path": "src/ExchangeSharp/API/Exchanges/BinanceGroup/BinanceGroupCommon.cs", "diff": "@@ -269,11 +269,21 @@ namespace ExchangeSharp.BinanceGroup\nJToken token = JToken.Parse(msg.ToStringFromUTF8());\nList<KeyValuePair<string, ExchangeTicker>> tickerList = new List<KeyValuePair<string, ExchangeTicker>>();\nExchangeTicker ticker;\n- foreach (JToken childToken in token[\"data\"])\n+\n+ // if it is the tickers stream, data will be an array, else it is an direct item.\n+ var data = token[\"data\"];\n+ if (data is JArray)\n+ foreach (JToken childToken in data)\n{\nticker = await ParseTickerWebSocketAsync(childToken);\ntickerList.Add(new KeyValuePair<string, ExchangeTicker>(ticker.MarketSymbol, ticker));\n}\n+ else\n+ {\n+ ticker = await ParseTickerWebSocketAsync(data);\n+ tickerList.Add(new KeyValuePair<string, ExchangeTicker>(ticker.MarketSymbol, ticker));\n+ }\n+\nif (tickerList.Count != 0)\n{\ncallback(tickerList);\n" } ]
C#
MIT License
jjxtra/exchangesharp
fix binance ticker websocket with symbol (#794)
410,209
23.01.2017 17:12:38
28,800
35358291f3bdbc7eb74bb301d23f9c6e83b549c5
Add JSX, TSX and TSConfig file templates to Node projects
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Nodejs.csproj", "new_path": "Nodejs/Product/Nodejs/Nodejs.csproj", "diff": "<ZipItem Include=\"Templates\\Files\\EmptyJson\\EmptyJson.vstemplate\" />\n<ZipItem Include=\"Templates\\Files\\EmptyJs\\EmptyJs.js\" />\n<ZipItem Include=\"Templates\\Files\\EmptyJs\\EmptyJs.vstemplate\" />\n+ <ZipItem Include=\"Templates\\Files\\EmptyJsx\\EmptyJsx.jsx\" />\n+ <ZipItem Include=\"Templates\\Files\\EmptyJsx\\EmptyJsx.vstemplate\" />\n<ZipItem Include=\"Templates\\Files\\EmptyLess\\EmptyLess.vstemplate\" />\n<ZipItem Include=\"Templates\\Files\\EmptyPug\\EmptyPug.vstemplate\" />\n<ZipItem Include=\"Templates\\Files\\EmptyTs\\EmptyTs.vstemplate\" />\n<ZipProject Include=\"ProjectTemplates\\AzureExpress4App\\setup_web.cmd\" />\n<ZipProject Include=\"ProjectTemplates\\AzureExpress4App\\Web.config\" />\n<ZipProject Include=\"ProjectTemplates\\AzureExpress4App\\Web.Debug.config\" />\n+ <ZipItem Include=\"Templates\\Files\\TypeScriptJSX\\EmptyTsx.tsx\" />\n+ <ZipItem Include=\"Templates\\Files\\TypeScriptJSX\\EmptyTsx.vstemplate\" />\n<ZipItem Include=\"Templates\\Files\\TapeUnitTest\\UnitTest.js\" />\n<ZipItem Include=\"Templates\\Files\\TapeUnitTest\\UnitTest.vstemplate\" />\n<ZipItem Include=\"Templates\\Files\\TypeScriptTapeUnitTest\\UnitTest.vstemplate\" />\n<ZipItem Include=\"Templates\\Files\\TypeScriptTapeUnitTest\\UnitTest.ts\" />\n+ <ZipItem Include=\"Templates\\Files\\TypeScriptTsConfig\\tsconfig.json\" />\n+ <ZipItem Include=\"Templates\\Files\\TypeScriptTsConfig\\tsconfig.vstemplate\" />\n<None Include=\"app.config\" />\n<TypeScriptProject Include=\"ProjectTemplates\\TypeScriptExpressApp\\express-serve-static-core.typings.json\" />\n<TypeScriptProject Include=\"ProjectTemplates\\TypeScriptExpressApp\\express.typings.json\" />\n" }, { "change_type": "ADD", "old_path": null, "new_path": "Nodejs/Product/Nodejs/Templates/Files/EmptyJsx/EmptyJsx.vstemplate", "diff": "+<VSTemplate Version=\"3.0.0\" Type=\"Item\" xmlns=\"http://schemas.microsoft.com/developer/vstemplate/2005\">\n+ <TemplateData>\n+ <Name Package=\"{2ffe45c4-5c73-493c-b187-f2e955ff875e}\" ID=\"1036\"/>\n+ <Description Package=\"{2ffe45c4-5c73-493c-b187-f2e955ff875e}\" ID=\"1037\"/>\n+ <!-- pulled from the asp.net v5 package -->\n+ <Icon Package=\"{AAB75614-2F8F-4DA6-B0A6-763C6DBB2969}\" ID=\"2300\"/>\n+ <ProjectType>Node.js</ProjectType>\n+ <DefaultName>file.jsx</DefaultName>\n+ <SortOrder>120</SortOrder>\n+ </TemplateData>\n+ <TemplateContent>\n+ <ProjectItem SubType=\"Code\" TargetFileName=\"$fileinputname$.jsx\" ReplaceParameters=\"true\">EmptyJsx.jsx</ProjectItem>\n+ </TemplateContent>\n+</VSTemplate>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Templates/Files/EmptyTs/EmptyTs.vstemplate", "new_path": "Nodejs/Product/Nodejs/Templates/Files/EmptyTs/EmptyTs.vstemplate", "diff": "<SortOrder>200</SortOrder>\n</TemplateData>\n<TemplateContent>\n- <ProjectItem SubType=\"Code\" TargetFileName=\"$fileinputname$.$fileinputextension$\" ReplaceParameters=\"true\">EmptyTs.ts</ProjectItem>\n+ <ProjectItem SubType=\"Code\" ItemType=\"TypeScriptCompile\" TargetFileName=\"$fileinputname$.$fileinputextension$\" ReplaceParameters=\"true\">EmptyTs.ts</ProjectItem>\n</TemplateContent>\n</VSTemplate>\n" }, { "change_type": "ADD", "old_path": null, "new_path": "Nodejs/Product/Nodejs/Templates/Files/TypeScriptJSX/EmptyTsx.vstemplate", "diff": "+<VSTemplate Version=\"3.0.0\" Type=\"Item\" xmlns=\"http://schemas.microsoft.com/developer/vstemplate/2005\">\n+ <TemplateData>\n+ <Name Package=\"{2ffe45c4-5c73-493c-b187-f2e955ff875e}\" ID=\"1027\"/>\n+ <Description Package=\"{2ffe45c4-5c73-493c-b187-f2e955ff875e}\" ID=\"1028\"/>\n+ <Icon Package=\"{2ffe45c4-5c73-493c-b187-f2e955ff875e}\" ID=\"3\"></Icon>\n+ <ProjectType>Node.js</ProjectType>\n+ <DefaultName>file.tsx</DefaultName>\n+ <SortOrder>230</SortOrder>\n+ </TemplateData>\n+ <TemplateContent>\n+ <ProjectItem SubType=\"Code\" ItemType=\"TypeScriptCompile\" TargetFileName=\"$fileinputname$.tsx\" ReplaceParameters=\"true\">EmptyTsx.tsx</ProjectItem>\n+ </TemplateContent>\n+</VSTemplate>\n" }, { "change_type": "ADD", "old_path": null, "new_path": "Nodejs/Product/Nodejs/Templates/Files/TypeScriptTsConfig/tsconfig.json", "diff": "+{\n+ \"compilerOptions\": {\n+ \"noImplicitAny\": false,\n+ \"noEmitOnError\": true,\n+ \"removeComments\": false,\n+ \"sourceMap\": true,\n+ \"target\": \"es5\"\n+ },\n+ \"exclude\": [\n+ \"node_modules\",\n+ \"wwwroot\"\n+ ]\n+}\n" }, { "change_type": "ADD", "old_path": null, "new_path": "Nodejs/Product/Nodejs/Templates/Files/TypeScriptTsConfig/tsconfig.vstemplate", "diff": "+<VSTemplate Version=\"3.0.0\" Type=\"Item\" xmlns=\"http://schemas.microsoft.com/developer/vstemplate/2005\">\n+ <TemplateData>\n+ <Name Package=\"{2ffe45c4-5c73-493c-b187-f2e955ff875e}\" ID=\"1024\"/>\n+ <Description Package=\"{2ffe45c4-5c73-493c-b187-f2e955ff875e}\" ID=\"1025\"/>\n+ <!-- pulled from the asp.net v5 package -->\n+ <Icon Package=\"{AAB75614-2F8F-4DA6-B0A6-763C6DBB2969}\" ID=\"2200\"/>\n+ <DefaultName>tsconfig.json</DefaultName>\n+ <TemplateID>Node.tsconfig</TemplateID>\n+ <ProjectType>Node.js</ProjectType>\n+ <SortOrder>370</SortOrder>\n+ </TemplateData>\n+ <TemplateContent>\n+ <ProjectItem SubType=\"Code\" ReplaceParameters=\"true\">tsconfig.json</ProjectItem>\n+ </TemplateContent>\n+</VSTemplate>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Setup/NodejsTools/NodejsToolsFiles.proj", "new_path": "Nodejs/Setup/NodejsTools/NodejsToolsFiles.proj", "diff": "ItemTemplates\\JavaScript\\EmptyHtml.zip;\nItemTemplates\\JavaScript\\EmptyJs.zip;\nItemTemplates\\JavaScript\\EmptyJson.zip;\n+ ItemTemplates\\JavaScript\\EmptyJsx.zip;\nItemTemplates\\JavaScript\\EmptyLess.zip;\nItemTemplates\\JavaScript\\EmptyPug.zip;\nItemTemplates\\JavaScript\\EmptyTs.zip;\nItemTemplates\\JavaScript\\EmptyXml.zip;\nItemTemplates\\JavaScript\\MochaUnitTest.zip;\nItemTemplates\\JavaScript\\TapeUnitTest.zip;\n+ ItemTemplates\\JavaScript\\TypeScriptJSX.zip;\nItemTemplates\\JavaScript\\TypeScriptMochaUnitTest.zip;\nItemTemplates\\JavaScript\\TypeScriptTapeUnitTest.zip;\n+ ItemTemplates\\JavaScript\\TypeScriptTsConfig.zip;\nItemTemplates\\JavaScript\\TypeScriptUnitTest.zip;\nItemTemplates\\JavaScript\\UnitTest.zip;\"/>\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Add JSX, TSX and TSConfig file templates to Node projects
410,209
24.01.2017 14:28:56
28,800
8c1c2997ebd3069c115078a42597d809f58f2ddf
PR suggestions on Adding Templates
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Templates/Files/EmptyTs/EmptyTs.vstemplate", "new_path": "Nodejs/Product/Nodejs/Templates/Files/EmptyTs/EmptyTs.vstemplate", "diff": "<SortOrder>200</SortOrder>\n</TemplateData>\n<TemplateContent>\n- <ProjectItem SubType=\"Code\" ItemType=\"TypeScriptCompile\" TargetFileName=\"$fileinputname$.$fileinputextension$\" ReplaceParameters=\"true\">EmptyTs.ts</ProjectItem>\n+ <ProjectItem SubType=\"Code\" TargetFileName=\"$fileinputname$.$fileinputextension$\" ReplaceParameters=\"true\">EmptyTs.ts</ProjectItem>\n</TemplateContent>\n</VSTemplate>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Templates/Files/TypeScriptJSX/EmptyTsx.vstemplate", "new_path": "Nodejs/Product/Nodejs/Templates/Files/TypeScriptJSX/EmptyTsx.vstemplate", "diff": "<SortOrder>230</SortOrder>\n</TemplateData>\n<TemplateContent>\n- <ProjectItem SubType=\"Code\" ItemType=\"TypeScriptCompile\" TargetFileName=\"$fileinputname$.tsx\" ReplaceParameters=\"true\">EmptyTsx.tsx</ProjectItem>\n+ <ProjectItem SubType=\"Code\" TargetFileName=\"$fileinputname$.tsx\" ReplaceParameters=\"true\">EmptyTsx.tsx</ProjectItem>\n</TemplateContent>\n</VSTemplate>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Templates/Files/TypeScriptTsConfig/tsconfig.json", "new_path": "Nodejs/Product/Nodejs/Templates/Files/TypeScriptTsConfig/tsconfig.json", "diff": "{\n\"compilerOptions\": {\n\"noImplicitAny\": false,\n+ \"module\": \"commonjs\",\n\"noEmitOnError\": true,\n\"removeComments\": false,\n\"sourceMap\": true,\n\"target\": \"es5\"\n},\n\"exclude\": [\n- \"node_modules\",\n- \"wwwroot\"\n+ \"node_modules\"\n]\n}\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
PR suggestions on Adding Templates
410,223
26.01.2017 20:16:56
28,800
b53e42fa039c32685f4c61fc42e47f5c28ddb1ae
cleanup js express
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Nodejs.csproj", "new_path": "Nodejs/Product/Nodejs/Nodejs.csproj", "diff": "<ZipProject Include=\"ProjectTemplates\\FromExistingCode\\FromExistingCode.vstemplate\">\n<SubType>Designer</SubType>\n</ZipProject>\n- <ZipProject Include=\"ProjectTemplates\\AzureExpress4App\\typings.json\" />\n<TypeScriptProject Include=\"ProjectTemplates\\TypeScriptConsoleApp\\package.json\" />\n<TypeScriptProject Include=\"ProjectTemplates\\TypeScriptConsoleApp\\tsconfig.json\" />\n<TypeScriptProject Include=\"ProjectTemplates\\TypeScriptConsoleApp\\README.md\" />\n<ZipProject Include=\"ProjectTemplates\\Express4App\\ExpressApp.vstemplate\">\n<SubType>Designer</SubType>\n</ZipProject>\n- <ZipProject Include=\"ProjectTemplates\\Express4App\\typings.json\" />\n<ZipProject Include=\"ProjectTemplates\\Express4App\\index.js\" />\n<ZipProject Include=\"ProjectTemplates\\Express4App\\Preview.png\" />\n<ZipProject Include=\"ProjectTemplates\\Express4App\\users.js\" />\n<ZipProject Include=\"ProjectTemplates\\AzureExpress4App\\index.js\" />\n<ZipProject Include=\"ProjectTemplates\\AzureExpress4App\\Preview.png\" />\n<ZipProject Include=\"ProjectTemplates\\AzureExpress4App\\users.js\" />\n- <TypeScriptProject Include=\"ProjectTemplates\\TypeScriptExpressApp\\express.d.ts\" />\n<TypeScriptProject Include=\"ProjectTemplates\\TypeScriptExpressApp\\user.ts\" />\n<TypeScriptProject Include=\"ProjectTemplates\\TypeScriptExpressApp\\app.ts\" />\n<TypeScriptProject Include=\"ProjectTemplates\\TypeScriptExpressApp\\ExpressApp.vstemplate\">\n<ItemGroup>\n<Folder Include=\"RemoteDebug\\\" />\n</ItemGroup>\n- <ItemGroup>\n- <TypeScriptProject Include=\"ProjectTemplates\\TypeScriptExpressApp\\express-serve-static-core.d.ts\" />\n- <TypeScriptProject Include=\"ProjectTemplates\\TypeScriptExpressApp\\serve-static.d.ts\" />\n- </ItemGroup>\n- <ItemGroup>\n- <TypeScriptProject Include=\"ProjectTemplates\\TypeScriptExpressApp\\mime.d.ts\" />\n- </ItemGroup>\n- <ItemGroup>\n- <TypeScriptProject Include=\"ProjectTemplates\\TypeScriptAzureExpressApp\\express-serve-static-core.d.ts\" />\n- </ItemGroup>\n- <ItemGroup>\n- <TypeScriptProject Include=\"ProjectTemplates\\TypeScriptAzureExpressApp\\express.d.ts\" />\n- </ItemGroup>\n- <ItemGroup>\n- <TypeScriptProject Include=\"ProjectTemplates\\TypeScriptAzureExpressApp\\serve-static.d.ts\" />\n- </ItemGroup>\n- <ItemGroup>\n- <TypeScriptProject Include=\"ProjectTemplates\\TypeScriptAzureExpressApp\\mime.d.ts\" />\n- </ItemGroup>\n<ItemGroup>\n<ZipItem Include=\"Templates\\Files\\EmptyTs\\EmptyTs.ts\" />\n</ItemGroup>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/ProjectTemplates/AzureExpress4App/ExpressApp.njsproj", "new_path": "Nodejs/Product/Nodejs/ProjectTemplates/AzureExpress4App/ExpressApp.njsproj", "diff": "<Content Include=\"package.json\" />\n<Content Include=\"public\\stylesheets\\main.css\" />\n<Content Include=\"README.md\" />\n-$if$ ($dev14$ == true)\n- <Content Include=\"typings.json\" />\n-$endif$\n<Content Include=\"views\\index.pug\" />\n<Content Include=\"views\\layout.pug\" />\n<Content Include=\"views\\error.pug\" />\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/ProjectTemplates/AzureExpress4App/ExpressApp.vstemplate", "new_path": "Nodejs/Product/Nodejs/ProjectTemplates/AzureExpress4App/ExpressApp.vstemplate", "diff": "<ProjectItem OpenInEditor=\"true\">app.js</ProjectItem>\n<ProjectItem ReplaceParameters=\"true\">package.json</ProjectItem>\n<ProjectItem ReplaceParameters=\"true\">README.md</ProjectItem>\n- <ProjectItem>typings.json</ProjectItem>\n</Project>\n</TemplateContent>\n<WizardExtension>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/ProjectTemplates/AzureExpress4App/package.json", "new_path": "Nodejs/Product/Nodejs/ProjectTemplates/AzureExpress4App/package.json", "diff": "\"serve-favicon\": \"^2.3.0\"\n},\n\"devDependencies\": {\n- \"@types/node\": \"^4.2.1\"\n+ \"@types/express\": \"^4.0.35\",\n+ \"@types/express-serve-static-core\": \"^4.0.40\",\n+ \"@types/node\": \"^4.2.1\",\n+ \"@types/mime\": \"0.0.29\",\n+ \"@types/serve-static\": \"^1.7.31\"\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "Nodejs/Product/Nodejs/ProjectTemplates/AzureExpress4App/typings.json", "new_path": null, "diff": "-{\n- \"globalDependencies\": {\n- \"body-parser\": \"registry:dt/body-parser#0.0.0+20160317120654\",\n- \"cookie-parser\": \"registry:dt/cookie-parser#1.3.4+20160316155526\",\n- \"debug\": \"registry:dt/debug#0.0.0+20160317120654\",\n- \"express\": \"registry:dt/express#4.0.0+20160317120654\",\n- \"express-serve-static-core\": \"registry:dt/express-serve-static-core#0.0.0+20160602151406\",\n- \"mime\": \"registry:dt/mime#0.0.0+20160316155526\",\n- \"morgan\": \"registry:dt/morgan#1.7.0+20160524142355\",\n- \"serve-favicon\": \"registry:dt/serve-favicon#0.0.0+20160316155526\",\n- \"serve-static\": \"registry:dt/serve-static#0.0.0+20160606155157\"\n- }\n-}\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/ProjectTemplates/Express4App/ExpressApp.njsproj", "new_path": "Nodejs/Product/Nodejs/ProjectTemplates/Express4App/ExpressApp.njsproj", "diff": "<Content Include=\"package.json\" />\n<Content Include=\"public\\stylesheets\\main.css\" />\n<Content Include=\"README.md\" />\n-$if$ ($dev14$ == true)\n- <Content Include=\"typings.json\" />\n-$endif$\n<Content Include=\"views\\index.pug\" />\n<Content Include=\"views\\layout.pug\" />\n<Content Include=\"views\\error.pug\" />\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/ProjectTemplates/Express4App/ExpressApp.vstemplate", "new_path": "Nodejs/Product/Nodejs/ProjectTemplates/Express4App/ExpressApp.vstemplate", "diff": "<ProjectItem OpenInEditor=\"true\">app.js</ProjectItem>\n<ProjectItem ReplaceParameters=\"true\">package.json</ProjectItem>\n<ProjectItem ReplaceParameters=\"true\">README.md</ProjectItem>\n- <ProjectItem>typings.json</ProjectItem>\n</Project>\n</TemplateContent>\n<WizardExtension>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/ProjectTemplates/Express4App/package.json", "new_path": "Nodejs/Product/Nodejs/ProjectTemplates/Express4App/package.json", "diff": "\"serve-favicon\": \"^2.3.0\"\n},\n\"devDependencies\": {\n- \"@types/node\": \"^4.2.1\"\n+ \"@types/express\": \"^4.0.35\",\n+ \"@types/express-serve-static-core\": \"^4.0.40\",\n+ \"@types/node\": \"^4.2.1\",\n+ \"@types/mime\": \"0.0.29\",\n+ \"@types/serve-static\": \"^1.7.31\"\n}\n}\n\\ No newline at end of file\n" }, { "change_type": "DELETE", "old_path": "Nodejs/Product/Nodejs/ProjectTemplates/Express4App/typings.json", "new_path": null, "diff": "-{\n- \"globalDependencies\": {\n- \"body-parser\": \"registry:dt/body-parser#0.0.0+20160317120654\",\n- \"cookie-parser\": \"registry:dt/cookie-parser#1.3.4+20160316155526\",\n- \"debug\": \"registry:dt/debug#0.0.0+20160317120654\",\n- \"express\": \"registry:dt/express#4.0.0+20160317120654\",\n- \"express-serve-static-core\": \"registry:dt/express-serve-static-core#0.0.0+20160602151406\",\n- \"mime\": \"registry:dt/mime#0.0.0+20160316155526\",\n- \"morgan\": \"registry:dt/morgan#1.7.0+20160524142355\",\n- \"serve-favicon\": \"registry:dt/serve-favicon#0.0.0+20160316155526\",\n- \"serve-static\": \"registry:dt/serve-static#0.0.0+20160606155157\"\n- }\n-}\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/ProjectTemplates/TypeScriptAzureExpressApp/TypeScriptExpressApp.vstemplate", "new_path": "Nodejs/Product/Nodejs/ProjectTemplates/TypeScriptAzureExpressApp/TypeScriptExpressApp.vstemplate", "diff": "<ProjectItem>index.pug</ProjectItem>\n<ProjectItem>layout.pug</ProjectItem>\n</Folder>\n- <Folder Name=\"typings\">\n- <Folder Name=\"globals\">\n- <Folder Name=\"express\">\n- <ProjectItem TargetFileName=\"index.d.ts\">express.d.ts</ProjectItem>\n- <ProjectItem TargetFileName=\"typings.json\">express.typings.json</ProjectItem>\n- </Folder>\n- <Folder Name=\"express-serve-static-core\">\n- <ProjectItem TargetFileName=\"index.d.ts\">express-serve-static-core.d.ts</ProjectItem>\n- <ProjectItem TargetFileName=\"typings.json\">express-serve-static-core.typings.json</ProjectItem>\n- </Folder>\n- <Folder Name=\"mime\">\n- <ProjectItem TargetFileName=\"index.d.ts\">mime.d.ts</ProjectItem>\n- <ProjectItem TargetFileName=\"typings.json\">mine.typings.json</ProjectItem>\n- </Folder>\n- <Folder Name=\"serve-static\">\n- <ProjectItem TargetFileName=\"index.d.ts\">serve-static.d.ts</ProjectItem>\n- <ProjectItem TargetFileName=\"typings.json\">serve-static.typings.json</ProjectItem>\n- </Folder>\n- </Folder>\n- </Folder>\n<ProjectItem OpenInEditor=\"true\">app.ts</ProjectItem>\n<ProjectItem ReplaceParameters=\"true\">package.json</ProjectItem>\n<ProjectItem ReplaceParameters=\"true\">tsconfig.json</ProjectItem>\n<ProjectItem TargetFileName=\"bin\\setup_web.cmd\">setup_web.cmd</ProjectItem>\n<ProjectItem TargetFileName=\"bin\\node.cmd\">node.cmd</ProjectItem>\n<ProjectItem TargetFileName=\"bin\\www\">www</ProjectItem>\n- <ProjectItem>typings.json</ProjectItem>\n</Project>\n</TemplateContent>\n<WizardExtension>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/ProjectTemplates/TypeScriptExpressApp/ExpressApp.njsproj", "new_path": "Nodejs/Product/Nodejs/ProjectTemplates/TypeScriptExpressApp/ExpressApp.njsproj", "diff": "<Content Include=\"tsconfig.json\" />\n<Content Include=\"public\\stylesheets\\main.css\" />\n<Content Include=\"README.md\" />\n-$if$ ($dev14$ == true)\n- <Content Include=\"typings.json\" />\n-$endif$\n<Content Include=\"views\\index.pug\" />\n<Content Include=\"views\\layout.pug\" />\n</ItemGroup>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/ProjectTemplates/TypeScriptExpressApp/ExpressApp.vstemplate", "new_path": "Nodejs/Product/Nodejs/ProjectTemplates/TypeScriptExpressApp/ExpressApp.vstemplate", "diff": "<ProjectItem>index.pug</ProjectItem>\n<ProjectItem>layout.pug</ProjectItem>\n</Folder>\n- <Folder Name=\"typings\">\n- <Folder Name=\"globals\">\n- <Folder Name=\"express\">\n- <ProjectItem TargetFileName=\"index.d.ts\">express.d.ts</ProjectItem>\n- <ProjectItem TargetFileName=\"typings.json\">express.typings.json</ProjectItem>\n- </Folder>\n- <Folder Name=\"express-serve-static-core\">\n- <ProjectItem TargetFileName=\"index.d.ts\">express-serve-static-core.d.ts</ProjectItem>\n- <ProjectItem TargetFileName=\"typings.json\">express-serve-static-core.typings.json</ProjectItem>\n- </Folder>\n- <Folder Name=\"mime\">\n- <ProjectItem TargetFileName=\"index.d.ts\">mime.d.ts</ProjectItem>\n- <ProjectItem TargetFileName=\"typings.json\">mine.typings.json</ProjectItem>\n- </Folder>\n- <Folder Name=\"serve-static\">\n- <ProjectItem TargetFileName=\"index.d.ts\">serve-static.d.ts</ProjectItem>\n- <ProjectItem TargetFileName=\"typings.json\">serve-static.typings.json</ProjectItem>\n- </Folder>\n- </Folder>\n- </Folder>\n<ProjectItem OpenInEditor=\"true\">app.ts</ProjectItem>\n<ProjectItem ReplaceParameters=\"true\">package.json</ProjectItem>\n<ProjectItem ReplaceParameters=\"true\">tsconfig.json</ProjectItem>\n<ProjectItem ReplaceParameters=\"true\">README.md</ProjectItem>\n- <ProjectItem>typings.json</ProjectItem>\n</Project>\n</TemplateContent>\n<WizardExtension>\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
cleanup js express @types
410,223
26.01.2017 21:21:19
28,800
4929c938576e64af6317cc8ee6baea77dbc7782a
lint TypeScript projects
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/ProjectTemplates/TypeScriptAzureExpressApp/app.ts", "new_path": "Nodejs/Product/Nodejs/ProjectTemplates/TypeScriptAzureExpressApp/app.ts", "diff": "@@ -4,7 +4,7 @@ import path = require('path');\nimport routes from './routes/index';\nimport users from './routes/user';\n-var app = express();\n+const app = express();\n// view engine setup\napp.set('views', path.join(__dirname, 'views'));\n@@ -17,8 +17,8 @@ app.use('/users', users);\n// catch 404 and forward to error handler\napp.use(function(req, res, next) {\n- var err = new Error('Not Found');\n- err['status'] = 404;\n+ const err: any = new Error('Not Found');\n+ err.status = 404;\nnext(err);\n});\n@@ -28,10 +28,10 @@ app.use(function (req, res, next) {\n// will print stacktrace\nif (app.get('env') === 'development') {\napp.use((err: any, req, res, next) => {\n- res.status(err['status'] || 500);\n+ res.status(err.status || 500);\nres.render('error', {\n+ error: err,\nmessage: err.message,\n- error: err\n});\n});\n}\n@@ -41,10 +41,9 @@ if (app.get('env') === 'development') {\napp.use((err: any, req, res, next) => {\nres.status(err.status || 500);\nres.render('error', {\n+ error: {},\nmessage: err.message,\n- error: {}\n});\n});\n-\nmodule.exports = app;\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/ProjectTemplates/TypeScriptExpressApp/app.ts", "new_path": "Nodejs/Product/Nodejs/ProjectTemplates/TypeScriptExpressApp/app.ts", "diff": "@@ -4,7 +4,7 @@ import path = require('path');\nimport routes from './routes/index';\nimport users from './routes/user';\n-var app = express();\n+const app = express();\n// view engine setup\napp.set('views', path.join(__dirname, 'views'));\n@@ -17,8 +17,8 @@ app.use('/users', users);\n// catch 404 and forward to error handler\napp.use(function (req, res, next) {\n- var err = new Error('Not Found');\n- err['status'] = 404;\n+ const err: any = new Error('Not Found');\n+ err.status = 404;\nnext(err);\n});\n@@ -28,10 +28,10 @@ app.use(function (req, res, next) {\n// will print stacktrace\nif (app.get('env') === 'development') {\napp.use((err: any, req, res, next) => {\n- res.status(err['status'] || 500);\n+ res.status(err.status || 500);\nres.render('error', {\n+ error: err,\nmessage: err.message,\n- error: err\n});\n});\n}\n@@ -41,10 +41,9 @@ if (app.get('env') === 'development') {\napp.use((err: any, req, res, next) => {\nres.status(err.status || 500);\nres.render('error', {\n+ error: {},\nmessage: err.message,\n- error: {}\n});\n});\n-\nmodule.exports = app;\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
lint TypeScript projects
410,223
31.01.2017 16:32:05
28,800
8f06a2634f25eaf37a405c30aff82f3c065621c2
update logger verbosity on UI thread
[ { "change_type": "MODIFY", "old_path": "Common/Product/SharedProject/IDEBuildLogger.cs", "new_path": "Common/Product/SharedProject/IDEBuildLogger.cs", "diff": "@@ -457,8 +457,6 @@ namespace Microsoft.VisualStudioTools.Project {\n// If importance is too low for current settings, ignore the event\nbool logIt = false;\n- this.SetVerbosity();\n-\nswitch (this.Verbosity) {\ncase LoggerVerbosity.Quiet:\nlogIt = false;\n@@ -507,11 +505,13 @@ namespace Microsoft.VisualStudioTools.Project {\n/// <summary>\n/// Sets the verbosity level.\n/// </summary>\n- private void SetVerbosity() {\n+ public void SetVerbosity() {\nif (!this.haveCachedVerbosity) {\nthis.Verbosity = LoggerVerbosity.Normal;\ntry {\n+ serviceProvider.GetUIThread().MustBeCalledFromUIThread();\n+\nvar settings = new ShellSettingsManager(serviceProvider);\nvar store = settings.GetReadOnlySettingsStore(SettingsScope.UserSettings);\nif (store.CollectionExists(GeneralCollection) && store.PropertyExists(GeneralCollection, BuildVerbosityProperty)) {\n" }, { "change_type": "MODIFY", "old_path": "Common/Product/SharedProject/ProjectNode.cs", "new_path": "Common/Product/SharedProject/ProjectNode.cs", "diff": "@@ -179,7 +179,7 @@ namespace Microsoft.VisualStudioTools.Project {\n/// </summary>\nprivate MSBuild.ProjectCollection buildEngine;\n- private Microsoft.Build.Utilities.Logger buildLogger;\n+ private IDEBuildLogger buildLogger;\nprivate bool useProvidedLogger;\n@@ -750,7 +750,7 @@ namespace Microsoft.VisualStudioTools.Project {\n/// <summary>\n/// Gets or sets the build logger.\n/// </summary>\n- protected Microsoft.Build.Utilities.Logger BuildLogger {\n+ protected IDEBuildLogger BuildLogger {\nget {\nreturn this.buildLogger;\n}\n@@ -2458,6 +2458,8 @@ namespace Microsoft.VisualStudioTools.Project {\n} else {\n((IDEBuildLogger)this.BuildLogger).OutputWindowPane = output;\n}\n+\n+ this.buildLogger.SetVerbosity();\n}\n/// <summary>\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
update logger verbosity on UI thread
410,223
31.01.2017 17:28:59
28,800
b5f9d696d6b2ea3b8b2446bca9ef9412b111882f
simplify cache invalidation I observed a 1-1 correspondence between the cache invalidation call and the Set/Refresh method, so I removed the spurious invalidation mechanism.
[ { "change_type": "MODIFY", "old_path": "Common/Product/SharedProject/IDEBuildLogger.cs", "new_path": "Common/Product/SharedProject/IDEBuildLogger.cs", "diff": "@@ -49,7 +49,6 @@ namespace Microsoft.VisualStudioTools.Project {\nprivate IVsHierarchy hierarchy;\nprivate IServiceProvider serviceProvider;\nprivate Dispatcher dispatcher;\n- private bool haveCachedVerbosity = false;\n// Queues to manage Tasks and Error output plus message logging\nprivate ConcurrentQueue<Func<ErrorTask>> taskQueue;\n@@ -170,7 +169,6 @@ namespace Microsoft.VisualStudioTools.Project {\n/// </summary>\nprotected virtual void BuildStartedHandler(object sender, BuildStartedEventArgs buildEvent) {\n// NOTE: This may run on a background thread!\n- ClearCachedVerbosity();\nClearQueuedOutput();\nClearQueuedTasks();\n@@ -505,19 +503,23 @@ namespace Microsoft.VisualStudioTools.Project {\n/// <summary>\n/// Sets the verbosity level.\n/// </summary>\n- public void SetVerbosity() {\n- if (!this.haveCachedVerbosity) {\n+ public void RefreshVerbosity()\n+ {\nthis.Verbosity = LoggerVerbosity.Normal;\n- try {\n+ try\n+ {\nserviceProvider.GetUIThread().MustBeCalledFromUIThread();\nvar settings = new ShellSettingsManager(serviceProvider);\nvar store = settings.GetReadOnlySettingsStore(SettingsScope.UserSettings);\n- if (store.CollectionExists(GeneralCollection) && store.PropertyExists(GeneralCollection, BuildVerbosityProperty)) {\n+ if (store.CollectionExists(GeneralCollection) && store.PropertyExists(GeneralCollection, BuildVerbosityProperty))\n+ {\nthis.Verbosity = (LoggerVerbosity)store.GetInt32(GeneralCollection, BuildVerbosityProperty, (int)LoggerVerbosity.Normal);\n}\n- } catch (Exception ex) {\n+ }\n+ catch (Exception ex)\n+ {\nvar message = string.Format(\n\"Unable to read verbosity option from the registry.{0}{1}\",\nEnvironment.NewLine,\n@@ -525,16 +527,6 @@ namespace Microsoft.VisualStudioTools.Project {\n);\nthis.QueueOutputText(MessageImportance.High, message);\n}\n-\n- this.haveCachedVerbosity = true;\n- }\n- }\n-\n- /// <summary>\n- /// Clear the cached verbosity, so that it will be re-evaluated from the build verbosity registry key.\n- /// </summary>\n- private void ClearCachedVerbosity() {\n- this.haveCachedVerbosity = false;\n}\n#endregion helpers\n" }, { "change_type": "MODIFY", "old_path": "Common/Product/SharedProject/ProjectNode.cs", "new_path": "Common/Product/SharedProject/ProjectNode.cs", "diff": "@@ -2459,7 +2459,7 @@ namespace Microsoft.VisualStudioTools.Project {\n((IDEBuildLogger)this.BuildLogger).OutputWindowPane = output;\n}\n- this.buildLogger.SetVerbosity();\n+ this.buildLogger.RefreshVerbosity();\n}\n/// <summary>\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
simplify cache invalidation I observed a 1-1 correspondence between the cache invalidation call and the Set/Refresh method, so I removed the spurious invalidation mechanism.
410,217
02.02.2017 16:19:27
28,800
e52691cb591d4f374633c59bf2bfa43f5aa05187
Make sure whe have the right name for the Express 4 JS template. The Id is pulled from the vspackage.resx file (and the matching localized files)
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/ProjectTemplates/Express4App/ExpressApp.vstemplate", "new_path": "Nodejs/Product/Nodejs/ProjectTemplates/Express4App/ExpressApp.vstemplate", "diff": "<VSTemplate Version=\"3.0.0\" Type=\"Project\" xmlns=\"http://schemas.microsoft.com/developer/vstemplate/2005\">\n<TemplateData>\n- <Name Package=\"{FE8A8C3D-328A-476D-99F9-2A24B75F8C7F}\" ID=\"3067\"/>\n+ <Name Package=\"{FE8A8C3D-328A-476D-99F9-2A24B75F8C7F}\" ID=\"3066\"/>\n<Description Package=\"{FE8A8C3D-328A-476D-99F9-2A24B75F8C7F}\" ID=\"3068\"/>\n<Icon Package=\"{FE8A8C3D-328A-476D-99F9-2A24B75F8C7F}\" ID=\"406\"/>\n<ProjectType>JavaScript</ProjectType>\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Make sure whe have the right name for the Express 4 JS template. The Id is pulled from the vspackage.resx file (and the matching localized files)
410,217
23.02.2017 11:38:43
28,800
9e71319fadc6e79a7dfd712c56e00d87278699d7
Correctly escape script when using inspect
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Debugger/NodeDebugger.cs", "new_path": "Nodejs/Product/Nodejs/Debugger/NodeDebugger.cs", "diff": "@@ -120,7 +120,7 @@ namespace Microsoft.NodejsTools.Debugger {\nvar debuggerPortOrDefault = debuggerPort ?? GetDebuggerPort();\n// Node usage: node [options] [ -e script | script.js ] [arguments]\n- string allArgs = $\"--debug-brk={debuggerPortOrDefault} --nolazy {interpreterOptions} {script}\";\n+ string allArgs = $\"--inspect={debuggerPortOrDefault} --debug-brk --nolazy {interpreterOptions} \\\"{script}\\\"\";\nreturn StartNodeProcess(exe, dir, env, debugOptions, debuggerPortOrDefault, allArgs, createNodeWindow);\n}\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/NodejsProjectLauncher.cs", "new_path": "Nodejs/Product/Nodejs/Project/NodejsProjectLauncher.cs", "diff": "@@ -41,6 +41,9 @@ namespace Microsoft.NodejsTools.Project {\nprivate readonly NodejsProjectNode _project;\nprivate int? _testServerPort;\n+ private static readonly Guid WebkitDebuggerGuid = Guid.Parse(\"4cc6df14-0ab5-4a91-8bb4-eb0bf233d0fe\");\n+ private static readonly Guid WebkitPortSupplierGuid = Guid.Parse(\"4103f338-2255-40c0-acf5-7380e2bea13d\");\n+\npublic NodejsProjectLauncher(NodejsProjectNode project) {\n_project = project;\n@@ -90,6 +93,7 @@ namespace Microsoft.NodejsTools.Project {\nprivate void StartAndAttachDebugger(string file, string nodePath) {\n+ // start the node process\nstring workingDir = _project.GetWorkingDirectory();\nstring env = \"\";\nvar interpreterOptions = _project.GetProjectProperty(NodeProjectProperty.NodeExeArguments);\n@@ -98,20 +102,18 @@ namespace Microsoft.NodejsTools.Project {\nprocess.Start();\n// setup debug info and attach\n- var webkitDebuggerGuid = Guid.Parse(\"4cc6df14-0ab5-4a91-8bb4-eb0bf233d0fe\");\n- var webkitPortSupplierGuid = Guid.Parse(\"4103f338-2255-40c0-acf5-7380e2bea13d\");\nvar debugUri = $\"http://127.0.0.1:{process.DebuggerPort}\";\nvar dbgInfo = new VsDebugTargetInfo4();\ndbgInfo.dlo = (uint)DEBUG_LAUNCH_OPERATION.DLO_AlreadyRunning;\ndbgInfo.LaunchFlags = (uint)__VSDBGLAUNCHFLAGS.DBGLAUNCH_DetachOnStop;\n- dbgInfo.guidLaunchDebugEngine = webkitDebuggerGuid;\n+ dbgInfo.guidLaunchDebugEngine = WebkitDebuggerGuid;\ndbgInfo.dwDebugEngineCount = 1;\n- var enginesPtr = MarshalDebugEngines(new[] { webkitDebuggerGuid });\n+ var enginesPtr = MarshalDebugEngines(new[] { WebkitDebuggerGuid });\ndbgInfo.pDebugEngines = enginesPtr;\n- dbgInfo.guidPortSupplier = webkitPortSupplierGuid;\n+ dbgInfo.guidPortSupplier = WebkitPortSupplierGuid;\ndbgInfo.bstrPortName = debugUri;\n// we connect through a URI, so no need to set the process,\n@@ -124,13 +126,13 @@ namespace Microsoft.NodejsTools.Project {\nprivate void AttachDebugger(VsDebugTargetInfo4 dbgInfo) {\nvar serviceProvider = _project.Site;\n- var launchResults = new VsDebugTargetProcessInfo[1];\nvar debugger = serviceProvider.GetService(typeof(SVsShellDebugger)) as IVsDebugger4;\nif (debugger == null) {\n- throw new InvalidOperationException();\n+ throw new InvalidOperationException(\"Failed to get the debugger service.\");\n}\n+ var launchResults = new VsDebugTargetProcessInfo[1];\ndebugger.LaunchDebugTargets4(1, new[] { dbgInfo }, launchResults);\n}\n@@ -351,7 +353,7 @@ namespace Microsoft.NodejsTools.Project {\n}\n}\n- //Environemnt variables should be passed as a\n+ //Environment variables should be passed as a\n//null-terminated block of null-terminated strings.\n//Each string is in the following form:name=value\\0\nStringBuilder buf = new StringBuilder();\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Correctly escape script when using inspect
410,217
23.02.2017 17:22:30
28,800
9e03b4c63544f26c3d8d77aae76f6b49cc45f9f5
Finish up options to use when starting the Node process
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Debugger/DebugEngine/AD7Engine.cs", "new_path": "Nodejs/Product/Nodejs/Debugger/DebugEngine/AD7Engine.cs", "diff": "@@ -85,11 +85,6 @@ namespace Microsoft.NodejsTools.Debugger.DebugEngine {\n/// </summary>\npublic const string WaitOnNormalExitSetting = \"WAIT_ON_NORMAL_EXIT\";\n- /// <summary>\n- /// Specifies if the output should be redirected to the visual studio output window.\n- /// </summary>\n- public const string RedirectOutputSetting = \"REDIRECT_OUTPUT\";\n-\n/// <summary>\n/// Specifies options which should be passed to the Node runtime before the script. If\n/// the interpreter options should include a semicolon then it should be escaped as a double\n@@ -517,11 +512,6 @@ namespace Microsoft.NodejsTools.Debugger.DebugEngine {\ndebugOptions |= NodeDebugOptions.WaitOnNormalExit;\n}\nbreak;\n- case RedirectOutputSetting:\n- if (Boolean.TryParse(setting[1], out value) && value) {\n- debugOptions |= NodeDebugOptions.RedirectOutput;\n- }\n- break;\ncase DirMappingSetting:\nstring[] dirs = setting[1].Split('|');\nif (dirs.Length == 2) {\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Debugger/NodeDebugOptions.cs", "new_path": "Nodejs/Product/Nodejs/Debugger/NodeDebugOptions.cs", "diff": "@@ -29,15 +29,5 @@ namespace Microsoft.NodejsTools.Debugger {\n/// Passing this flag to the debugger will cause it to wait for input on a normal (zero) exit code.\n/// </summary>\nWaitOnNormalExit = 0x02,\n- /// <summary>\n- /// Passing this flag will cause output to standard out to be redirected via the debugger\n- /// so it can be outputted in the Visual Studio debug output window.\n- /// </summary>\n- RedirectOutput = 0x04,\n-\n- /// <summary>\n- /// Set if you do not want to create a window\n- /// </summary>\n- CreateNoWindow = 0x40\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Debugger/NodeDebugger.cs", "new_path": "Nodejs/Product/Nodejs/Debugger/NodeDebugger.cs", "diff": "@@ -151,8 +151,6 @@ namespace Microsoft.NodejsTools.Debugger {\ndebuggerPort: debuggerPortOrDefault);\n}\n-\n-\n#region Public Process API\npublic int Id => _id != null ? _id.Value : _process.Id;\n@@ -244,7 +242,7 @@ namespace Microsoft.NodejsTools.Debugger {\n// We need to get the backtrace before we break, so we request the backtrace\n// and follow up with firing the appropriate event for the break\ntokenSource = new CancellationTokenSource(_timeout);\n- bool running = await PerformBacktraceAsync(tokenSource.Token).ConfigureAwait(false);\n+ var running = await PerformBacktraceAsync(tokenSource.Token).ConfigureAwait(false);\nDebug.Assert(!running);\n// Fallback to firing step complete event\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Logging/LiveLogger.cs", "new_path": "Nodejs/Product/Nodejs/Logging/LiveLogger.cs", "diff": "//\n//*********************************************************//\n-using Microsoft.NodejsTools.Options;\n-using Microsoft.VisualStudioTools.Project;\nusing System;\nusing System.Diagnostics;\nusing System.Globalization;\n+using Microsoft.NodejsTools.Options;\n+using Microsoft.VisualStudioTools.Project;\nnamespace Microsoft.NodejsTools.Logging {\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/NodejsProjectLauncher.cs", "new_path": "Nodejs/Product/Nodejs/Project/NodejsProjectLauncher.cs", "diff": "@@ -94,11 +94,12 @@ namespace Microsoft.NodejsTools.Project {\nprivate void StartAndAttachDebugger(string file, string nodePath) {\n// start the node process\n- string workingDir = _project.GetWorkingDirectory();\n- string env = \"\";\n+ var workingDir = _project.GetWorkingDirectory();\n+ var env = \"\";\nvar interpreterOptions = _project.GetProjectProperty(NodeProjectProperty.NodeExeArguments);\n+ var debugOptions = this.GetDebugOptions();\n- var process = NodeDebugger.StartNodeProcessWithInspect(exe: nodePath, script: file, dir: workingDir, env: env, interpreterOptions: interpreterOptions, debugOptions: NodeDebugOptions.None);\n+ var process = NodeDebugger.StartNodeProcessWithInspect(exe: nodePath, script: file, dir: workingDir, env: env, interpreterOptions: interpreterOptions, debugOptions: debugOptions);\nprocess.Start();\n// setup debug info and attach\n@@ -106,7 +107,7 @@ namespace Microsoft.NodejsTools.Project {\nvar dbgInfo = new VsDebugTargetInfo4();\ndbgInfo.dlo = (uint)DEBUG_LAUNCH_OPERATION.DLO_AlreadyRunning;\n- dbgInfo.LaunchFlags = (uint)__VSDBGLAUNCHFLAGS.DBGLAUNCH_DetachOnStop;\n+ dbgInfo.LaunchFlags = (uint)__VSDBGLAUNCHFLAGS.DBGLAUNCH_StopDebuggingOnEnd;\ndbgInfo.guidLaunchDebugEngine = WebkitDebuggerGuid;\ndbgInfo.dwDebugEngineCount = 1;\n@@ -115,6 +116,7 @@ namespace Microsoft.NodejsTools.Project {\ndbgInfo.pDebugEngines = enginesPtr;\ndbgInfo.guidPortSupplier = WebkitPortSupplierGuid;\ndbgInfo.bstrPortName = debugUri;\n+ dbgInfo.fSendToOutputWindow = 0;\n// we connect through a URI, so no need to set the process,\n// we need to set the process id to '1' so the debugger is able to attach\n@@ -123,6 +125,22 @@ namespace Microsoft.NodejsTools.Project {\nAttachDebugger(dbgInfo);\n}\n+ private NodeDebugOptions GetDebugOptions() {\n+\n+ var debugOptions = NodeDebugOptions.None;\n+\n+ if (NodejsPackage.Instance.GeneralOptionsPage.WaitOnAbnormalExit) {\n+ debugOptions |= NodeDebugOptions.WaitOnAbnormalExit;\n+ }\n+\n+ if (NodejsPackage.Instance.GeneralOptionsPage.WaitOnNormalExit) {\n+ debugOptions |= NodeDebugOptions.WaitOnNormalExit;\n+ }\n+\n+\n+ return debugOptions;\n+ }\n+\nprivate void AttachDebugger(VsDebugTargetInfo4 dbgInfo) {\nvar serviceProvider = _project.Site;\n@@ -155,7 +173,7 @@ namespace Microsoft.NodejsTools.Project {\n}\nprivate void StartNodeProcess(string file, string nodePath, bool startBrowser) {\n- //TODO: looks like this duplicates a ton of code in NodeDebugger\n+ //TODO: looks like this duplicates a bunch of code in NodeDebugger\nvar psi = new ProcessStartInfo() {\nUseShellExecute = false,\n@@ -228,7 +246,7 @@ namespace Microsoft.NodejsTools.Project {\n}\n}\n- internal static string GetFullUrl(string host, int port) {\n+ private static string GetFullUrl(string host, int port) {\nUriBuilder builder;\nUri uri;\nif (Uri.TryCreate(host, UriKind.Absolute, out uri)) {\n@@ -332,10 +350,19 @@ namespace Microsoft.NodejsTools.Project {\n}\ndbgInfo.fSendStdoutToOutputWindow = 0;\n+ dbgInfo.bstrEnv = GetEnvironmentVariablesString(url);\n+\n+ // Set the Node debugger\n+ dbgInfo.clsidCustom = AD7Engine.DebugEngineGuid;\n+ dbgInfo.grfLaunch = (uint)__VSDBGLAUNCHFLAGS.DBGLAUNCH_StopDebuggingOnEnd;\n+ return true;\n+ }\n+\n+ private string GetEnvironmentVariablesString(string url) {\nvar env = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);\nif (!String.IsNullOrWhiteSpace(url)) {\n- Uri webUrl = new Uri(url);\n+ var webUrl = new Uri(url);\nenv[\"PORT\"] = webUrl.Port.ToString();\n}\n@@ -347,7 +374,7 @@ namespace Microsoft.NodejsTools.Project {\n// add any inherited env vars\nvar variables = Environment.GetEnvironmentVariables();\nforeach (var key in variables.Keys) {\n- string strKey = (string)key;\n+ var strKey = (string)key;\nif (!env.ContainsKey(strKey)) {\nenv.Add(strKey, (string)variables[key]);\n}\n@@ -356,18 +383,15 @@ namespace Microsoft.NodejsTools.Project {\n//Environment variables should be passed as a\n//null-terminated block of null-terminated strings.\n//Each string is in the following form:name=value\\0\n- StringBuilder buf = new StringBuilder();\n+ var buf = new StringBuilder();\nforeach (var entry in env) {\nbuf.AppendFormat(\"{0}={1}\\0\", entry.Key, entry.Value);\n}\nbuf.Append(\"\\0\");\n- dbgInfo.bstrEnv = buf.ToString();\n+ return buf.ToString();\n}\n- // Set the Node debugger\n- dbgInfo.clsidCustom = AD7Engine.DebugEngineGuid;\n- dbgInfo.grfLaunch = (uint)__VSDBGLAUNCHFLAGS.DBGLAUNCH_StopDebuggingOnEnd;\n- return true;\n+ return null;\n}\nprivate bool ShouldStartBrowser() {\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Finish up options to use when starting the Node process
410,217
24.02.2017 14:18:46
28,800
ecc16d5dd87e26df6187b784cf0ce86232060c3d
PR feedback and fix build break
[ { "change_type": "MODIFY", "old_path": "Common/Product/SharedProject/CommonUtils.cs", "new_path": "Common/Product/SharedProject/CommonUtils.cs", "diff": "@@ -46,7 +46,6 @@ namespace Microsoft.VisualStudioTools {\n}\nreturn new Uri(path, kind);\n-\n} catch (UriFormatException ex) {\nthrow new ArgumentException(\"Path was invalid\", throwParameterName, ex);\n} catch (ArgumentException ex) {\n@@ -62,6 +61,13 @@ namespace Microsoft.VisualStudioTools {\nreturn null;\n}\n+ const string MdhaPrefix = \"mdha:\";\n+\n+ // webkit debugger prepends with 'mdha'\n+ if (path.StartsWith(MdhaPrefix, StringComparison.OrdinalIgnoreCase)) {\n+ path = path.Substring(MdhaPrefix.Length);\n+ }\n+\nvar uri = MakeUri(path, false, UriKind.RelativeOrAbsolute);\nif (uri.IsAbsoluteUri) {\nif (uri.IsFile) {\n" }, { "change_type": "MODIFY", "old_path": "Common/Product/SharedProject/ProjectNode.cs", "new_path": "Common/Product/SharedProject/ProjectNode.cs", "diff": "@@ -5596,10 +5596,6 @@ If the files in the existing folder have the same names as files in the folder y\ninternal HierarchyNode FindNodeByFullPath(string name) {\nSite.GetUIThread().MustBeCalledFromUIThread();\n- if (name.StartsWith(\"mdha:\", StringComparison.OrdinalIgnoreCase)) {\n- return default(HierarchyNode);\n- }\n-\nDebug.Assert(Path.IsPathRooted(name));\nHierarchyNode node;\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/NodejsProjectLauncher.cs", "new_path": "Nodejs/Product/Nodejs/Project/NodejsProjectLauncher.cs", "diff": "@@ -247,7 +247,7 @@ namespace Microsoft.NodejsTools.Project {\n}\n}\n- private static string GetFullUrl(string host, int port) {\n+ internal static string GetFullUrl(string host, int port) {\nUriBuilder builder;\nUri uri;\nif (Uri.TryCreate(host, UriKind.Absolute, out uri)) {\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
PR feedback and fix build break
410,217
28.02.2017 16:57:05
28,800
3fb4c47c26bb2428387c8917d4ba8e9dfeab75b0
Make sure scripts are properly quoted when sending to the debugger.
[ { "change_type": "MODIFY", "old_path": "Common/Product/SharedProject/CommonProjectNode.cs", "new_path": "Common/Product/SharedProject/CommonProjectNode.cs", "diff": "@@ -1549,7 +1549,7 @@ namespace Microsoft.VisualStudioTools.Project {\n/// Returns resolved value of the current working directory property.\n/// </summary>\npublic string GetWorkingDirectory() {\n- string workDir = CommonUtils.UnquotePath(GetProjectProperty(CommonConstants.WorkingDirectory, resetCache: false));\n+ var workDir = CommonUtils.UnquotePath(GetProjectProperty(CommonConstants.WorkingDirectory, resetCache: false));\nreturn CommonUtils.GetAbsoluteDirectoryPath(ProjectHome, workDir);\n}\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Debugger/NodeDebugger.cs", "new_path": "Nodejs/Product/Nodejs/Debugger/NodeDebugger.cs", "diff": "@@ -126,7 +126,7 @@ namespace Microsoft.NodejsTools.Debugger {\nvar debuggerPortOrDefault = debuggerPort ?? GetDebuggerPort();\n// Node usage: node [options] [ -e script | script.js ] [arguments]\n- var allArgs = $\"--debug-brk={debuggerPortOrDefault} --nolazy {interpreterOptions} \\\"{script}\\\"\";\n+ var allArgs = $\"--debug-brk={debuggerPortOrDefault} --nolazy {interpreterOptions} \\\"{CommonUtils.UnquotePath(script)}\\\"\"; /* unquote the path so we can safely add quotes */\nreturn StartNodeProcess(exe, dir, env, debugOptions, debuggerPortOrDefault, allArgs, createNodeWindow);\n}\n@@ -144,7 +144,7 @@ namespace Microsoft.NodejsTools.Debugger {\nvar debuggerPortOrDefault = debuggerPort ?? GetDebuggerPort();\n// Node usage: node [options] [ -e script | script.js ] [arguments]\n- string allArgs = $\"--inspect={debuggerPortOrDefault} --debug-brk --nolazy {interpreterOptions} \\\"{script}\\\"\";\n+ var allArgs = $\"--inspect={debuggerPortOrDefault} --debug-brk --nolazy {interpreterOptions} \\\"{CommonUtils.UnquotePath(script)}\\\"\"; /* unquote the path so we can safely add quotes */\nreturn StartNodeProcess(exe, dir, env, debugOptions, debuggerPortOrDefault, allArgs, createNodeWindow);\n}\n@@ -169,7 +169,7 @@ namespace Microsoft.NodejsTools.Debugger {\nvar envValues = env.Split('\\0');\nforeach (var curValue in envValues) {\nvar nameValue = curValue.Split(new[] { '=' }, 2);\n- if (nameValue.Length == 2 && !String.IsNullOrWhiteSpace(nameValue[0])) {\n+ if (nameValue.Length == 2 && !string.IsNullOrWhiteSpace(nameValue[0])) {\npsi.EnvironmentVariables[nameValue[0]] = nameValue[1];\n}\n}\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Make sure scripts are properly quoted when sending to the debugger.
410,218
01.03.2017 23:52:38
28,800
314f91b9a9ad0d3ee257dd4206bf182ab9a76d36
Ensure expected settings for TypeScript powered intellisense is present on Dev14
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsPage.cs", "new_path": "Nodejs/Product/Nodejs/Options/NodejsIntellisenseOptionsPage.cs", "diff": "@@ -84,6 +84,10 @@ namespace Microsoft.NodejsTools.Options {\n}\n// Save settings.\n+#if DEV14\n+ // This setting needs to be present for the TypeScript editor to handle .js files in NTVS\n+ SaveString(\"AnalysisLevel\", \"Preview\");\n+#endif\nSaveBool(EnableAutomaticTypingsAcquisitionSetting, EnableAutomaticTypingsAcquisition);\nSaveBool(ShowTypingsInfoBarSetting, ShowTypingsInfoBar);\nSaveBool(SaveChangesToConfigFileSetting, SaveChangesToConfigFile);\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Ensure expected settings for TypeScript powered intellisense is present on Dev14
410,217
07.03.2017 11:05:44
28,800
ac29c69dc1b3091fdce10e6bc9cadfd188930fca
Update Nuget pkgs to latest version
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Nodejs.csproj", "new_path": "Nodejs/Product/Nodejs/Nodejs.csproj", "diff": "</VSTemplate>\n</ItemDefinitionGroup>\n<ItemGroup>\n+ <Reference Include=\"Microsoft.ApplicationInsights, Version=2.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL\">\n+ <HintPath>..\\..\\packages\\Microsoft.ApplicationInsights.2.2.0\\lib\\net46\\Microsoft.ApplicationInsights.dll</HintPath>\n+ </Reference>\n+ <Reference Include=\"Microsoft.ApplicationInsights.PersistenceChannel, Version=1.2.3.490, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL\">\n+ <HintPath>..\\..\\packages\\Microsoft.ApplicationInsights.PersistenceChannel.1.2.3\\lib\\net45\\Microsoft.ApplicationInsights.PersistenceChannel.dll</HintPath>\n+ </Reference>\n<Reference Include=\"Microsoft.VisualStudio.ImageCatalog, Version=$(VSTarget).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\" />\n<Reference Include=\"Microsoft.VisualStudio.Imaging, Version=$(VSTarget).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\" />\n<!--\n<Reference Include=\"Microsoft.VisualStudio.TextManager.Interop.12.0, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n<EmbedInteropTypes>True</EmbedInteropTypes>\n</Reference>\n+ <Reference Include=\"Microsoft.VisualStudio.Validation, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n+ <HintPath>..\\..\\packages\\Microsoft.VisualStudio.Validation.15.0.82\\lib\\net45\\Microsoft.VisualStudio.Validation.dll</HintPath>\n+ <Private>True</Private>\n+ </Reference>\n+ <Reference Include=\"Microsoft.VisualStudio.Workspace, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n+ <HintPath>..\\..\\packages\\Microsoft.VisualStudio.Workspaces.15.0.215-pre\\lib\\net46\\Microsoft.VisualStudio.Workspace.dll</HintPath>\n+ <Private>True</Private>\n+ </Reference>\n+ <Reference Include=\"Microsoft.VisualStudio.Workspace.Extensions, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n+ <HintPath>..\\..\\packages\\Microsoft.VisualStudio.Workspaces.15.0.215-pre\\lib\\net46\\Microsoft.VisualStudio.Workspace.Extensions.dll</HintPath>\n+ <Private>True</Private>\n+ </Reference>\n+ <Reference Include=\"Microsoft.VisualStudio.Workspace.Extensions.VS, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n+ <HintPath>..\\..\\packages\\Microsoft.VisualStudio.Workspaces.15.0.215-pre\\lib\\net46\\Microsoft.VisualStudio.Workspace.Extensions.VS.dll</HintPath>\n+ <Private>True</Private>\n+ </Reference>\n<Reference Include=\"Newtonsoft.Json, Version=8.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL\">\n<SpecificVersion>False</SpecificVersion>\n<HintPath>..\\..\\packages\\Newtonsoft.Json.8.0.3\\lib\\net45\\Newtonsoft.Json.dll</HintPath>\n</ItemGroup>\n<ItemGroup>\n<Reference Include=\"Microsoft.VisualStudio.Shell.Framework, Version=$(VSTarget).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n- <Reference Include=\"Microsoft.VisualStudio.Validation, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n- <HintPath>..\\..\\packages\\Microsoft.VisualStudio.Validation.15.0.55-pre\\lib\\net45\\Microsoft.VisualStudio.Validation.dll</HintPath>\n- <Private>True</Private>\n- </Reference>\n- <Reference Include=\"Microsoft.VisualStudio.Workspace, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n- <HintPath>..\\..\\packages\\Microsoft.VisualStudio.Workspaces.15.0.100-pre\\lib\\net46\\Microsoft.VisualStudio.Workspace.dll</HintPath>\n- <Private>True</Private>\n- </Reference>\n- <Reference Include=\"Microsoft.VisualStudio.Workspace.Extensions, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n- <HintPath>..\\..\\packages\\Microsoft.VisualStudio.Workspaces.15.0.100-pre\\lib\\net46\\Microsoft.VisualStudio.Workspace.Extensions.dll</HintPath>\n- <Private>True</Private>\n- </Reference>\n- <Reference Include=\"Microsoft.VisualStudio.Workspace.Extensions.VS, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n- <HintPath>..\\..\\packages\\Microsoft.VisualStudio.Workspaces.15.0.100-pre\\lib\\net46\\Microsoft.VisualStudio.Workspace.Extensions.VS.dll</HintPath>\n- <Private>True</Private>\n- </Reference>\n</ItemGroup>\n<ItemGroup>\n<OutputBinariesToSign Include=\"Microsoft.NodejsTools.Telemetry.$(VSTarget).dll\" />\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/app.config", "new_path": "Nodejs/Product/Nodejs/app.config", "diff": "<assemblyIdentity name=\"Microsoft.Build\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n<bindingRedirect oldVersion=\"0.0.0.0-15.1.0.0\" newVersion=\"15.1.0.0\" />\n</dependentAssembly>\n+ <dependentAssembly>\n+ <assemblyIdentity name=\"Microsoft.ApplicationInsights\" publicKeyToken=\"31bf3856ad364e35\" culture=\"neutral\" />\n+ <bindingRedirect oldVersion=\"0.0.0.0-2.2.0.0\" newVersion=\"2.2.0.0\" />\n+ </dependentAssembly>\n</assemblyBinding>\n</runtime>\n</configuration>\n\\ No newline at end of file\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Update Nuget pkgs to latest version
410,217
13.03.2017 15:05:06
25,200
904bbf8b6dac0b0ce5a352702ee7588770145f29
Include Telemetry symbols.
[ { "change_type": "MODIFY", "old_path": ".gitignore", "new_path": ".gitignore", "diff": "@@ -38,6 +38,8 @@ x64/\n*.vspscc\n*.vssscc\n.builds\n+#Include the telemetry pdb\n+!Nodejs/Common/Telemetry/*.*\n# Visual C++ cache files\nipch/\n" }, { "change_type": "ADD", "old_path": "Nodejs/Common/Telemetry/Microsoft.NodejsTools.Telemetry.15.0.pdb", "new_path": "Nodejs/Common/Telemetry/Microsoft.NodejsTools.Telemetry.15.0.pdb", "diff": "Binary files /dev/null and b/Nodejs/Common/Telemetry/Microsoft.NodejsTools.Telemetry.15.0.pdb differ\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Include Telemetry symbols.
410,217
14.03.2017 12:58:26
25,200
2ca101f8793fd2a875c65ce6122967bbefb8a75d
Fix node version in option string.
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Options/NodejsGeneralOptionsControl.en.resx", "new_path": "Nodejs/Product/Nodejs/Options/NodejsGeneralOptionsControl.en.resx", "diff": "<value>5</value>\n</data>\n<data name=\"_webkitDebugger.Text\" xml:space=\"preserve\">\n- <value>Use the new NodeJs debugger protocol (experimental since v6.8)</value>\n+ <value>Use the new NodeJs debugger protocol (experimental since v7.0)</value>\n</data>\n<data name=\"&gt;&gt;_webkitDebugger.Name\" xml:space=\"preserve\">\n<value>_webkitDebugger</value>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Options/NodejsGeneralOptionsControl.resx", "new_path": "Nodejs/Product/Nodejs/Options/NodejsGeneralOptionsControl.resx", "diff": "<value>5</value>\n</data>\n<data name=\"_webkitDebugger.Text\" xml:space=\"preserve\">\n- <value>Use the new NodeJs debugger protocol (experimental since v6.8)</value>\n+ <value>Use the new NodeJs debugger protocol (experimental since v7.0)</value>\n</data>\n<data name=\"&gt;&gt;_webkitDebugger.Name\" xml:space=\"preserve\">\n<value>_webkitDebugger</value>\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Fix node version in option string.
410,217
15.03.2017 13:34:45
25,200
8523ef704978677ef41a587abb76fcdc11fabf3c
Remove sqllite binary
[ { "change_type": "DELETE", "old_path": "Nodejs/Common/SQLite/sqlite3.dll", "new_path": "Nodejs/Common/SQLite/sqlite3.dll", "diff": "Binary files a/Nodejs/Common/SQLite/sqlite3.dll and /dev/null differ\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/NpmUI/ErrorHelper.cs", "new_path": "Nodejs/Product/Nodejs/NpmUI/ErrorHelper.cs", "diff": "// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\nusing System;\n+using System.Globalization;\nusing System.Text;\nusing System.Windows;\nusing Microsoft.NodejsTools.Npm;\n-using System.Globalization;\nnamespace Microsoft.NodejsTools.NpmUI\n{\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Setup/NodejsTools/NodejsToolsFiles.proj", "new_path": "Nodejs/Setup/NodejsTools/NodejsToolsFiles.proj", "diff": "<!-- Support Files -->\n<File Include=\"Newtonsoft.Json.dll\"/>\n- <File Include=\"sqlite3.dll\" />\n<File Include=\"visualstudio_nodejs_repl.js\"/>\n<File Include=\"Credits.txt\"/>\n<File Include=\"NoSurveyNewsFeed.html\"/>\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Remove sqllite binary
410,217
15.03.2017 16:23:07
25,200
c08a36afcc5cf5afda0c13d20feaaab7a3e3556f
Remove TypeScript version check
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/NodejsPackage.cs", "new_path": "Nodejs/Product/Nodejs/NodejsPackage.cs", "diff": "@@ -83,17 +83,6 @@ namespace Microsoft.NodejsTools\n// after the initialization\nprivate List<EnvDTE.CommandEvents> _subscribedCommandEvents = new List<EnvDTE.CommandEvents>();\n- private static readonly Version _minRequiredTypescriptVersion = new Version(\"1.8\");\n-\n- private readonly Lazy<bool> _hasRequiredTypescriptVersion = new Lazy<bool>(() =>\n- {\n- Version version;\n- var versionString = GetTypeScriptToolsVersion();\n- return !string.IsNullOrEmpty(versionString)\n- && Version.TryParse(versionString, out version)\n- && version.CompareTo(_minRequiredTypescriptVersion) > -1;\n- });\n-\n/// <summary>\n/// Default constructor of the package.\n/// Inside this method you can place any initialization code that does not require\n@@ -129,15 +118,6 @@ namespace Microsoft.NodejsTools\nDebug.WriteLine(string.Format(CultureInfo.CurrentCulture, \"Entering Initialize() of: {0}\", this.ToString()));\nbase.Initialize();\n- if (!this._hasRequiredTypescriptVersion.Value)\n- {\n- MessageBox.Show(\n- string.Format(CultureInfo.CurrentCulture, Resources.TypeScriptMinVersionNotInstalled, _minRequiredTypescriptVersion.ToString()),\n- Project.SR.ProductName,\n- MessageBoxButtons.OK,\n- MessageBoxIcon.Error);\n- }\n-\nSubscribeToVsCommandEvents(\n(int)VSConstants.VSStd97CmdID.AddNewProject,\ndelegate { NewProjectFromExistingWizard.IsAddNewProjectCmd = true; },\n@@ -560,53 +540,6 @@ namespace Microsoft.NodejsTools\n{\nVsUtilities.NavigateTo(Instance, filename, Guid.Empty, pos);\n}\n-\n- private static string GetTypeScriptToolsVersion()\n- {\n- var toolsVersion = string.Empty;\n- try\n- {\n- object installDirAsObject = null;\n- var shell = NodejsPackage.Instance.GetService(typeof(SVsShell)) as IVsShell;\n- if (shell != null)\n- {\n- shell.GetProperty((int)__VSSPROPID.VSSPROPID_InstallDirectory, out installDirAsObject);\n- }\n-\n- var idePath = CommonUtils.NormalizeDirectoryPath((string)installDirAsObject) ?? string.Empty;\n- if (string.IsNullOrEmpty(idePath))\n- {\n- return toolsVersion;\n- }\n-\n- var typeScriptServicesPath = Path.Combine(idePath, @\"CommonExtensions\\Microsoft\\TypeScript\\typescriptServices.js\");\n- if (!File.Exists(typeScriptServicesPath))\n- {\n- return toolsVersion;\n- }\n-\n- var regex = new Regex(@\"toolsVersion = \"\"(?<version>\\d.\\d?)\"\";\");\n- var fileText = File.ReadAllText(typeScriptServicesPath);\n- var match = regex.Match(fileText);\n-\n- var version = match.Groups[\"version\"].Value;\n- if (!string.IsNullOrWhiteSpace(version))\n- {\n- toolsVersion = version;\n- }\n- }\n- catch (Exception ex)\n- {\n- if (ex.IsCriticalException())\n- {\n- throw;\n- }\n-\n- Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, \"Failed to obtain TypeScript tools version: {0}\", ex.ToString()));\n- }\n-\n- return toolsVersion;\n- }\n}\n}\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Remove TypeScript version check
410,217
16.03.2017 11:29:30
25,200
5f033cbe24758085d85f4565359f049e0b826218
Update supported Node version to 7.0
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Options/NodejsGeneralOptionsControl.de.resx", "new_path": "Nodejs/Product/Nodejs/Options/NodejsGeneralOptionsControl.de.resx", "diff": "<value>5</value>\n</data>\n<data name=\"_webkitDebugger.Text\" xml:space=\"preserve\">\n- <value>Verwenden Sie das neue NodeJs-Debuggerprotokoll (experimentell seit Version 6.8).</value>\n+ <value>Verwenden Sie das neue NodeJs-Debuggerprotokoll (experimentell seit Version 7.0).</value>\n</data>\n<data name=\"&gt;&gt;_webkitDebugger.Name\" xml:space=\"preserve\">\n<value>_webkitDebugger</value>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Options/NodejsGeneralOptionsControl.it.resx", "new_path": "Nodejs/Product/Nodejs/Options/NodejsGeneralOptionsControl.it.resx", "diff": "<value>5</value>\n</data>\n<data name=\"_webkitDebugger.Text\" xml:space=\"preserve\">\n- <value>Usa il protocollo del nuovo debugger NodeJS (sperimentale a partire dalla versione 6.8)</value>\n+ <value>Usa il protocollo del nuovo debugger NodeJS (sperimentale a partire dalla versione 7.0)</value>\n</data>\n<data name=\"&gt;&gt;_webkitDebugger.Name\" xml:space=\"preserve\">\n<value>_webkitDebugger</value>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Options/NodejsGeneralOptionsControl.pt-BR.resx", "new_path": "Nodejs/Product/Nodejs/Options/NodejsGeneralOptionsControl.pt-BR.resx", "diff": "<value>5</value>\n</data>\n<data name=\"_webkitDebugger.Text\" xml:space=\"preserve\">\n- <value>Use o novo protocolo do depurador do NodeJs (experimental desde a v6.8)</value>\n+ <value>Use o novo protocolo do depurador do NodeJs (experimental desde a v7.0)</value>\n</data>\n<data name=\"&gt;&gt;_webkitDebugger.Name\" xml:space=\"preserve\">\n<value>_webkitDebugger</value>\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Update supported Node version to 7.0
410,226
27.03.2017 11:11:15
25,200
29bda4cf67a1407fe6620727c1b8ce7b689342b9
Replace the dynamic TypeScript version check with a package prerequisite
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/NodejsPackage.cs", "new_path": "Nodejs/Product/Nodejs/NodejsPackage.cs", "diff": "@@ -110,16 +110,6 @@ namespace Microsoft.NodejsTools {\n// after the initialization\nprivate List<EnvDTE.CommandEvents> _subscribedCommandEvents = new List<EnvDTE.CommandEvents>();\n- private static readonly Version _minRequiredTypescriptVersion = new Version(\"1.8\");\n-\n- private readonly Lazy<bool> _hasRequiredTypescriptVersion = new Lazy<bool>(() => {\n- Version version;\n- var versionString = GetTypeScriptToolsVersion();\n- return !string.IsNullOrEmpty(versionString)\n- && Version.TryParse(versionString, out version)\n- && version.CompareTo(_minRequiredTypescriptVersion) > -1;\n- });\n-\n/// <summary>\n/// Default constructor of the package.\n/// Inside this method you can place any initialization code that does not require\n@@ -175,14 +165,6 @@ namespace Microsoft.NodejsTools {\nDebug.WriteLine(string.Format(CultureInfo.CurrentCulture, \"Entering Initialize() of: {0}\", this.ToString()));\nbase.Initialize();\n- if (!_hasRequiredTypescriptVersion.Value) {\n- MessageBox.Show(\n- string.Format(CultureInfo.CurrentCulture, Resources.TypeScriptMinVersionNotInstalled, _minRequiredTypescriptVersion.ToString()),\n- Project.SR.ProductName,\n- MessageBoxButtons.OK,\n- MessageBoxIcon.Error);\n- }\n-\nSubscribeToVsCommandEvents(\n(int)VSConstants.VSStd97CmdID.AddNewProject,\ndelegate { NewProjectFromExistingWizard.IsAddNewProjectCmd = true; },\n@@ -549,43 +531,5 @@ namespace Microsoft.NodejsTools {\ninternal static void NavigateTo(string filename, int pos) {\nVsUtilities.NavigateTo(Instance, filename, Guid.Empty, pos);\n}\n-\n- private static string GetTypeScriptToolsVersion() {\n- var toolsVersion = string.Empty;\n- try {\n- object installDirAsObject = null;\n- var shell = NodejsPackage.Instance.GetService(typeof(SVsShell)) as IVsShell;\n- if (shell != null) {\n- shell.GetProperty((int)__VSSPROPID.VSSPROPID_InstallDirectory, out installDirAsObject);\n- }\n-\n- var idePath = CommonUtils.NormalizeDirectoryPath((string)installDirAsObject) ?? string.Empty;\n- if (string.IsNullOrEmpty(idePath)) {\n- return toolsVersion;\n- }\n-\n- var typeScriptServicesPath = Path.Combine(idePath, @\"CommonExtensions\\Microsoft\\TypeScript\\typescriptServices.js\");\n- if (!File.Exists(typeScriptServicesPath)) {\n- return toolsVersion;\n- }\n-\n- var regex = new Regex(@\"toolsVersion = \"\"(?<version>\\d.\\d?)\"\";\");\n- var fileText = File.ReadAllText(typeScriptServicesPath);\n- var match = regex.Match(fileText);\n-\n- var version = match.Groups[\"version\"].Value;\n- if (!string.IsNullOrWhiteSpace(version)) {\n- toolsVersion = version;\n- }\n- } catch (Exception ex) {\n- if (ex.IsCriticalException()) {\n- throw;\n- }\n-\n- Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, \"Failed to obtain TypeScript tools version: {0}\", ex.ToString()));\n- }\n-\n- return toolsVersion;\n- }\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Resources.Designer.cs", "new_path": "Nodejs/Product/Nodejs/Resources.Designer.cs", "diff": "@@ -1423,15 +1423,6 @@ namespace Microsoft.NodejsTools {\n}\n}\n- /// <summary>\n- /// Looks up a localized string similar to Node.js Tools requires TypeScript for Visual Studio {0} or higher. Please ensure TypeScript is installed.\n- /// </summary>\n- public static string TypeScriptMinVersionNotInstalled {\n- get {\n- return ResourceManager.GetString(\"TypeScriptMinVersionNotInstalled\", resourceCulture);\n- }\n- }\n-\n/// <summary>\n/// Looks up a localized string similar to Node.js IntelliSense added a .\n/// </summary>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/source.extension.vsixmanifest", "new_path": "Nodejs/Product/Nodejs/source.extension.vsixmanifest", "diff": "</Dependencies>\n<Prerequisites>\n<Prerequisite Id=\"Microsoft.VisualStudio.Component.CoreEditor\" Version=\"[15.0,16.0)\" DisplayName=\"Visual Studio core editor\" />\n+ <Prerequisite Id=\"Microsoft.VisualStudio.Component.JavaScript.TypeScript\" Version=\"[15.0,16.0)\" DisplayName=\"JavaScript and TypeScript language support\" />\n</Prerequisites>\n<Assets>\n<Asset Type=\"Microsoft.VisualStudio.Package\" Path=\"|%CurrentProject%|\" d:Source=\"Project\" d:ProjectName=\"%CurrentProject%\" />\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Replace the dynamic TypeScript version check with a package prerequisite
410,226
28.03.2017 17:15:01
25,200
b25959ebb402640943c462c68a3c6b1259c76201
Put removed code behind dev14-only flag
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/NodejsPackage.cs", "new_path": "Nodejs/Product/Nodejs/NodejsPackage.cs", "diff": "@@ -110,6 +110,18 @@ namespace Microsoft.NodejsTools {\n// after the initialization\nprivate List<EnvDTE.CommandEvents> _subscribedCommandEvents = new List<EnvDTE.CommandEvents>();\n+#if DEV14\n+ private static readonly Version _minRequiredTypescriptVersion = new Version(\"1.8\");\n+\n+ private readonly Lazy<bool> _hasRequiredTypescriptVersion = new Lazy<bool>(() => {\n+ Version version;\n+ var versionString = GetTypeScriptToolsVersion();\n+ return !string.IsNullOrEmpty(versionString)\n+ && Version.TryParse(versionString, out version)\n+ && version.CompareTo(_minRequiredTypescriptVersion) > -1;\n+ });\n+#endif\n+\n/// <summary>\n/// Default constructor of the package.\n/// Inside this method you can place any initialization code that does not require\n@@ -165,6 +177,16 @@ namespace Microsoft.NodejsTools {\nDebug.WriteLine(string.Format(CultureInfo.CurrentCulture, \"Entering Initialize() of: {0}\", this.ToString()));\nbase.Initialize();\n+#if DEV14\n+ if (!_hasRequiredTypescriptVersion.Value) {\n+ MessageBox.Show(\n+ string.Format(CultureInfo.CurrentCulture, Resources.TypeScriptMinVersionNotInstalled, _minRequiredTypescriptVersion.ToString()),\n+ Project.SR.ProductName,\n+ MessageBoxButtons.OK,\n+ MessageBoxIcon.Error);\n+ }\n+#endif\n+\nSubscribeToVsCommandEvents(\n(int)VSConstants.VSStd97CmdID.AddNewProject,\ndelegate { NewProjectFromExistingWizard.IsAddNewProjectCmd = true; },\n@@ -531,5 +553,45 @@ namespace Microsoft.NodejsTools {\ninternal static void NavigateTo(string filename, int pos) {\nVsUtilities.NavigateTo(Instance, filename, Guid.Empty, pos);\n}\n+\n+#if DEV14\n+ private static string GetTypeScriptToolsVersion() {\n+ var toolsVersion = string.Empty;\n+ try {\n+ object installDirAsObject = null;\n+ var shell = NodejsPackage.Instance.GetService(typeof(SVsShell)) as IVsShell;\n+ if (shell != null) {\n+ shell.GetProperty((int)__VSSPROPID.VSSPROPID_InstallDirectory, out installDirAsObject);\n+ }\n+\n+ var idePath = CommonUtils.NormalizeDirectoryPath((string)installDirAsObject) ?? string.Empty;\n+ if (string.IsNullOrEmpty(idePath)) {\n+ return toolsVersion;\n+ }\n+\n+ var typeScriptServicesPath = Path.Combine(idePath, @\"CommonExtensions\\Microsoft\\TypeScript\\typescriptServices.js\");\n+ if (!File.Exists(typeScriptServicesPath)) {\n+ return toolsVersion;\n+ }\n+\n+ var regex = new Regex(@\"toolsVersion = \"\"(?<version>\\d.\\d?)\"\";\");\n+ var fileText = File.ReadAllText(typeScriptServicesPath);\n+ var match = regex.Match(fileText);\n+\n+ var version = match.Groups[\"version\"].Value;\n+ if (!string.IsNullOrWhiteSpace(version)) {\n+ toolsVersion = version;\n+ }\n+ } catch (Exception ex) {\n+ if (ex.IsCriticalException()) {\n+ throw;\n+ }\n+\n+ Debug.WriteLine(string.Format(CultureInfo.CurrentCulture, \"Failed to obtain TypeScript tools version: {0}\", ex.ToString()));\n+ }\n+\n+ return toolsVersion;\n+ }\n+#endif\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Resources.Designer.cs", "new_path": "Nodejs/Product/Nodejs/Resources.Designer.cs", "diff": "@@ -1423,6 +1423,17 @@ namespace Microsoft.NodejsTools {\n}\n}\n+#if DEV14\n+ /// <summary>\n+ /// Looks up a localized string similar to Node.js Tools requires TypeScript for Visual Studio {0} or higher. Please ensure TypeScript is installed.\n+ /// </summary>\n+ public static string TypeScriptMinVersionNotInstalled {\n+ get {\n+ return ResourceManager.GetString(\"TypeScriptMinVersionNotInstalled\", resourceCulture);\n+ }\n+ }\n+#endif\n+\n/// <summary>\n/// Looks up a localized string similar to Node.js IntelliSense added a .\n/// </summary>\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Put removed code behind dev14-only flag
410,218
30.03.2017 13:56:40
25,200
6db039a5ceabb6d6bfc24c7f4e040da5f06cf9e4
Fix resources on Dev14
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Nodejs.csproj", "new_path": "Nodejs/Product/Nodejs/Nodejs.csproj", "diff": "<StartProgram>$(DevEnvDir)devenv.exe</StartProgram>\n<StartArguments>/rootSuffix Exp /Log</StartArguments>\n<SolutionDir Condition=\"$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'\">..\\..\\</SolutionDir>\n- <UICulture>en</UICulture>\n+ <!--\n+ Setting the UICulture places the resources in satellite assemblies, so only do this for Dev15 and later\n+ For details on WPF localization, see https://msdn.microsoft.com/en-us/library/ms788718(v=vs.110).aspx\n+ -->\n+ <UICulture Condition=\"'$(VSTarget)'=='15.0'\">en</UICulture>\n</PropertyGroup>\n<PropertyGroup Condition=\" '$(Platform)' == 'x86' \">\n<PlatformTarget>x86</PlatformTarget>\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Fix resources on Dev14
410,218
30.03.2017 16:18:32
25,200
294eca5ea01b30ee2e08cadcdded4eb6f5b91d65
Fix typings installer for most modules
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/TypingsAcquisitionTool/bin/install_typings", "new_path": "Nodejs/Product/Nodejs/TypingsAcquisitionTool/bin/install_typings", "diff": "@@ -18,13 +18,6 @@ var argv = minimist(process.argv.slice(2), {\nvar emitter = new events.EventEmitter();\n-var options = {\n- save: argv.save,\n- global: true,\n- emitter: emitter,\n- cwd: argv.cwd || process.cwd()\n-};\n-\nvar packagesToInstall = argv._;\nif (!packagesToInstall.length) {\n@@ -32,6 +25,12 @@ if (!packagesToInstall.length) {\ntypingsTool.installTypingsForProject(options)\n} else {\ntypingsTool.runAll(packagesToInstall.map(function (name) {\n+ var options = {\n+ save: argv.save,\n+ emitter: emitter,\n+ global: name === \"node\", // Assume everything else refers to a CommonJS module\n+ cwd: argv.cwd || process.cwd()\n+ };\nreturn typingsTool.installTypingsForPackage(name, options);\n}));\n}\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Fix typings installer for most modules
410,217
04.04.2017 10:07:40
25,200
b0d94e4dc904819fb5b65c75cc05318043e87be7
Fix build break for VS 2017
[ { "change_type": "MODIFY", "old_path": "Nodejs/Setup/BuildRelease.ps1", "new_path": "Nodejs/Setup/BuildRelease.ps1", "diff": "@@ -166,7 +166,7 @@ $symbol_contacts = \"$env:username;dinov;smortaz;jinglou\"\n$vcs_contact = \"ntvscore\"\n# These options are passed to all MSBuild processes\n-$global_msbuild_options = @(\"/v:m\", \"/m\", \"/nologo\", \"/flp:verbosity=detailed\")\n+$global_msbuild_options = @(\"/v:q\", \"/m\", \"/nologo\", \"/flp:verbosity=detailed\")\nif ($skiptests) {\n$global_msbuild_options += \"/p:IncludeTests=false\"\n@@ -217,6 +217,7 @@ function msbuild-exe($target) {\n# signed_bindir Output directory for signed binaries\n# signed_msidir Output directory for signed installers\n# signed_unsigned_msidir Output directory for unsigned installers containing signed binaries\n+# signed_swix_logfile Log file for vsman project\nfunction msbuild-options($target) {\n@(\n\"/p:VSTarget=$($target.VSTarget)\",\n@@ -546,6 +547,7 @@ try {\n$i.signed_msidir = mkdir \"$($i.destdir)\\SignedMsi\" -Force\n$i.final_msidir = $i.signed_msidir\n$i.signed_logfile = \"$logdir\\BuildRelease_Signed.$config.$($_.number).log\"\n+ $i.signed_swix_logfile = \"$logdir\\BuildRelease_Swix_Signed.$config.$($_.number).log\"\n} else {\n$i.final_msidir = $i.unsigned_msidir\n}\n@@ -633,7 +635,7 @@ try {\n$setup_project\n& $target_msbuild_exe $global_msbuild_options $target_msbuild_options `\n- /fl /flp:logfile=$($i.signed_logfile) `\n+ /fl /flp:logfile=$($i.signed_swix_logfile) `\n/p:SignedBinariesPath=$($i.signed_bindir) `\n/p:RezipVSIXFiles=true `\n$setup_swix_project\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Fix build break for VS 2017
410,217
04.04.2017 10:49:02
25,200
a049122725c38cd8c2481a6f7f09a0fc9deac77a
Remove project to narrow down issue in build
[ { "change_type": "MODIFY", "old_path": "Nodejs/Setup/setup-swix.proj", "new_path": "Nodejs/Setup/setup-swix.proj", "diff": "<ItemGroup>\n<ProjectFile Include=\"swix\\Microsoft.VisualStudio.NodejsTools.Targets.swixproj\"/>\n<ProjectFile Include=\"swix\\NodejsTools.vsmanproj\"/>\n- <ProjectFile Include=\"swix\\NodejsTools.Profiling.vsmanproj\" />\n+ <!--<ProjectFile Include=\"swix\\NodejsTools.Profiling.vsmanproj\" />-->\n</ItemGroup>\n<Import Project=\"$(TargetsPath)\\Common.Build.Traversal.targets\" />\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Setup/swix/NodejsTools.vsmanproj", "new_path": "Nodejs/Setup/swix/NodejsTools.vsmanproj", "diff": "<MergeManifest Include=\"$(BuildOutputRoot)\\Binaries\\InteractiveWindow\\Microsoft.VisualStudio.NodeJsTools.InteractiveWindow.json\" />\n<MergeManifest Include=\"$(BuildOutputRoot)\\Binaries\\NodeJs\\Microsoft.VisualStudio.NodejsTools.NodejsTools.json\" />\n- <MergeManifest Include=\"$(BuildOutputRoot)\\Setup\\Microsoft.VisualStudio.NodejsTools.Targets.json\" />\n+ <!--<MergeManifest Include=\"$(BuildOutputRoot)\\Setup\\Microsoft.VisualStudio.NodejsTools.Targets.json\" />-->\n</ItemGroup>\n<Import Project=\"$(PackagesPath)\\MicroBuild.Core.0.2.0\\build\\MicroBuild.Core.targets\"/>\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Remove project to narrow down issue in build
410,217
04.04.2017 11:07:31
25,200
eb43bc39d0be6440a32fb1488c497907ae288816
Update swix build tools
[ { "change_type": "MODIFY", "old_path": "Nodejs/Setup/swix/packages.config", "new_path": "Nodejs/Setup/swix/packages.config", "diff": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<packages>\n<package id=\"MicroBuild.Core\" version=\"0.2.0\"/>\n- <package id=\"MicroBuild.Plugins.SwixBuild\" version=\"1.0.101\"/>\n+ <package id=\"MicroBuild.Plugins.SwixBuild\" version=\"1.0.115\"/>\n</packages>\n\\ No newline at end of file\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Update swix build tools
410,217
04.04.2017 13:23:48
25,200
9b8c636a827c22afae8cc79c587d867032927d01
Set diagnostic to sane logging
[ { "change_type": "MODIFY", "old_path": "Nodejs/Setup/BuildRelease.ps1", "new_path": "Nodejs/Setup/BuildRelease.ps1", "diff": "@@ -166,7 +166,7 @@ $symbol_contacts = \"$env:username;dinov;smortaz;jinglou\"\n$vcs_contact = \"ntvscore\"\n# These options are passed to all MSBuild processes\n-$global_msbuild_options = @(\"/v:q\", \"/m\", \"/nologo\", \"/flp:verbosity=diagnostic\")\n+$global_msbuild_options = @(\"/v:q\", \"/m\", \"/nologo\", \"/flp:verbosity=detailed\")\nif ($skiptests) {\n$global_msbuild_options += \"/p:IncludeTests=false\"\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Set diagnostic to sane logging
410,217
04.04.2017 16:36:10
25,200
f4673ee412132668276d45952ecf43d10ee62347
Don't build the profiles in the vsmanproj
[ { "change_type": "MODIFY", "old_path": "Nodejs/Setup/swix/NodejsTools.Profiling.vsmanproj", "new_path": "Nodejs/Setup/swix/NodejsTools.Profiling.vsmanproj", "diff": "<OutputPath>$(BinDirectory)\\$(Configuration)\\</OutputPath>\n</PropertyGroup>\n- <ItemGroup>\n- <ProjectReference Include=\"..\\..\\Product\\Profiling\\Profiling.csproj\" />\n- </ItemGroup>\n-\n<ItemGroup>\n<MergeManifest Include=\"$(BuildOutputRoot)\\Binaries\\Profiling\\Microsoft.VisualStudio.NodejsTools.Profiling.json\"/>\n</ItemGroup>\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Don't build the profiles in the vsmanproj
410,217
05.04.2017 13:32:11
25,200
167a447eeb5d16c82a917a350c45d8123addc738
Fix null ref in string.format
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Debugger/Communication/DebuggerClient.cs", "new_path": "Nodejs/Product/Nodejs/Debugger/Communication/DebuggerClient.cs", "diff": "@@ -195,7 +195,7 @@ namespace Microsoft.NodejsTools.Debugger.Communication {\nif (messageId != null && _messages.TryGetValue((int)messageId, out promise)) {\npromise.SetResult(message);\n} else {\n- Debug.Fail(string.Format(CultureInfo.CurrentCulture, \"Invalid response identifier '{0}'\", messageId));\n+ Debug.Fail(string.Format(CultureInfo.CurrentCulture, \"Invalid response identifier '{0}'\", messageId ?? \"<null>\"));\n}\n}\n}\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Fix null ref in string.format
410,217
07.04.2017 12:56:42
25,200
70e57a0c7daf57cc2e4525536f99b80e1e94d289
Node V8 debugger support Check the version of the node binary and either force Webkit protocol (VS 2017), or block debugging with Message (VS 2015).
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Nodejs.cs", "new_path": "Nodejs/Product/Nodejs/Nodejs.cs", "diff": "//*********************************************************//\nusing System;\n+using System.Diagnostics;\nusing System.IO;\n#if !NO_WINDOWS\nusing System.Windows.Forms;\n@@ -30,6 +31,21 @@ namespace Microsoft.NodejsTools {\nprivate const string NodejsRegPath = \"Software\\\\Node.js\";\nprivate const string InstallPath = \"InstallPath\";\n+ public static Version GetNodeVersion(string path)\n+ {\n+ if (string.IsNullOrEmpty(path)) {\n+ throw new ArgumentException(\"\\'path\\' is not set\", \"path\");\n+ }\n+\n+ var versionString = FileVersionInfo.GetVersionInfo(path).ProductVersion;\n+ Version version;\n+ if (Version.TryParse(versionString, out version)) {\n+ return version;\n+ }\n+\n+ return default(Version);\n+ }\n+\npublic static string NodeExePath {\nget {\nreturn GetPathToNodeExecutableFromEnvironment();\n@@ -137,6 +153,16 @@ namespace Microsoft.NodejsTools {\nMessageBoxIcon.Error\n);\n}\n+#if !DEV15\n+ public static void ShowNodeVersionNotSupported() {\n+ MessageBox.Show(\n+ SR.GetString(SR.NodejsNotInstalled),\n+ SR.ProductName,\n+ MessageBoxButtons.OK,\n+ MessageBoxIcon.Error\n+ );\n+ }\n+#endif\n#endif\n}\n}\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/NodejsProjectLauncher.cs", "new_path": "Nodejs/Product/Nodejs/Project/NodejsProjectLauncher.cs", "diff": "@@ -68,18 +68,27 @@ namespace Microsoft.NodejsTools.Project {\nprivate int Start(string file, bool debug) {\nvar nodePath = GetNodePath();\n+\nif (nodePath == null) {\nNodejs.ShowNodejsNotInstalled();\nreturn VSConstants.S_OK;\n}\n- bool startBrowser = ShouldStartBrowser();\n+ var chromeProtocolRequired = Nodejs.GetNodeVersion(nodePath) >= new Version(8, 0);\n+\n#if !DEV15\n+ if (chromeProtocolRequired) {\n+ Nodejs.ShowNodeVersionNotSupported();\n+ return VSConstants.S_OK;\n+ }\n+\nbool useWebKitDebugger = false;\n#else\n- bool useWebKitDebugger = NodejsPackage.Instance.GeneralOptionsPage.UseWebKitDebugger;\n+ bool useWebKitDebugger = chromeProtocolRequired || NodejsPackage.Instance.GeneralOptionsPage.UseWebKitDebugger;\n#endif\n+ bool startBrowser = ShouldStartBrowser();\n+\nif (debug && !useWebKitDebugger) {\nStartWithDebugger(file);\n} else if (debug && useWebKitDebugger) {\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/ProjectResources.cs", "new_path": "Nodejs/Product/Nodejs/Project/ProjectResources.cs", "diff": "@@ -25,6 +25,9 @@ namespace Microsoft.NodejsTools.Project {\ninternal const string NodeExeDoesntExist = \"NodeExeDoesntExist\";\ninternal const string NodejsNotInstalled = \"NodejsNotInstalled\";\n+#if !DEV15\n+ internal const string NodejsNotInstalled = \"NodejsVersionNotSupported\";\n+#endif\ninternal const string TestFramework = \"TestFramework\";\nprivate static readonly Lazy<ResourceManager> _manager = new Lazy<ResourceManager>(\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Resources.Designer.cs", "new_path": "Nodejs/Product/Nodejs/Resources.Designer.cs", "diff": "@@ -660,7 +660,16 @@ namespace Microsoft.NodejsTools {\nreturn ResourceManager.GetString(\"NodejsToolsForVisualStudio\", resourceCulture);\n}\n}\n-\n+#if !DEV15\n+ /// <summary>\n+ /// Looks up a localized string similar to Your project is configured to use Node V8 or newer. Debugging Node V8 is not supported in VS 2015, please upgrade to VS 2017..\n+ /// </summary>\n+ public static string NodejsVersionNotSupported {\n+ get {\n+ return ResourceManager.GetString(\"NodejsVersionNotSupported\", resourceCulture);\n+ }\n+ }\n+#endif\n/// <summary>\n/// Looks up a localized string similar to Unable to parse {0} from your project. Please fix any errors and try again..\n/// </summary>\n@@ -1422,8 +1431,7 @@ namespace Microsoft.NodejsTools {\nreturn ResourceManager.GetString(\"TestFrameworkDescription\", resourceCulture);\n}\n}\n-\n-#if DEV14\n+#if !DEV15\n/// <summary>\n/// Looks up a localized string similar to Node.js Tools requires TypeScript for Visual Studio {0} or higher. Please ensure TypeScript is installed.\n/// </summary>\n@@ -1433,7 +1441,6 @@ namespace Microsoft.NodejsTools {\n}\n}\n#endif\n-\n/// <summary>\n/// Looks up a localized string similar to Node.js IntelliSense added a .\n/// </summary>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Resources.resx", "new_path": "Nodejs/Product/Nodejs/Resources.resx", "diff": "@@ -620,4 +620,7 @@ Error retrieving websocket debug proxy information from web.config.</value>\n<data name=\"ErrorInvalidLaunchUrl\" xml:space=\"preserve\">\n<value>Launch url '{0}' is not valid </value>\n</data>\n+ <data name=\"NodejsVersionNotSupported\" xml:space=\"preserve\">\n+ <value>Your project is configured to use Node V8 or newer. Debugging Node V8 is not supported in VS 2015, please upgrade to VS 2017.</value>\n+ </data>\n</root>\n\\ No newline at end of file\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Node V8 debugger support Check the version of the node binary and either force Webkit protocol (VS 2017), or block debugging with Message (VS 2015).
410,217
07.04.2017 13:15:39
25,200
2e1c83364f4e2d18892932425c3513dfbfedf492
Fix VS 2015 build break.
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Nodejs.cs", "new_path": "Nodejs/Product/Nodejs/Nodejs.cs", "diff": "@@ -156,7 +156,7 @@ namespace Microsoft.NodejsTools {\n#if !DEV15\npublic static void ShowNodeVersionNotSupported() {\nMessageBox.Show(\n- SR.GetString(SR.NodejsNotInstalled),\n+ SR.GetString(SR.NodejsVersionNotSupported),\nSR.ProductName,\nMessageBoxButtons.OK,\nMessageBoxIcon.Error\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/ProjectResources.cs", "new_path": "Nodejs/Product/Nodejs/Project/ProjectResources.cs", "diff": "@@ -26,7 +26,7 @@ namespace Microsoft.NodejsTools.Project {\ninternal const string NodeExeDoesntExist = \"NodeExeDoesntExist\";\ninternal const string NodejsNotInstalled = \"NodejsNotInstalled\";\n#if !DEV15\n- internal const string NodejsNotInstalled = \"NodejsVersionNotSupported\";\n+ internal const string NodejsVersionNotSupported = \"NodejsVersionNotSupported\";\n#endif\ninternal const string TestFramework = \"TestFramework\";\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Fix VS 2015 build break.
410,217
07.04.2017 16:24:40
25,200
76c31f4b78861ce186e166e6aadd96cb14042f8f
Update Buildnumber used for drop location
[ { "change_type": "MODIFY", "old_path": "Nodejs/Setup/BuildRelease.ps1", "new_path": "Nodejs/Setup/BuildRelease.ps1", "diff": "@@ -461,7 +461,12 @@ if ([int]::Parse([regex]::Match($buildnumber, '^[0-9]+').Value) -ge 65535) {\n$msi_version = \"$release_version.$buildnumber\"\nif ($internal -or $release -or $mockrelease) {\n+ $serverBuildNumber = Get-ChildItem ENV:Build_BuildNumber\n+ if (-not $serverBuildNumber) {\n$outdir = \"$outdir\\$buildnumber\"\n+ } else {\n+ $outdir = \"$outdir\\$serverBuildNumber\"\n+ }\n}\nImport-Module -Force $buildroot\\Build\\VisualStudioHelpers.psm1\n@@ -481,7 +486,7 @@ if ($name) {\n}\nWrite-Output \"Output Dir: $outdir\"\nif ($mockrelease) {\n- Write-Output \"Auto-generated release outdir: $base_outdir\\$release_version\\$buildnumber\"\n+ Write-Output \"Auto-generated release outdir: $outdir\"\n}\nWrite-Output \"\"\nWrite-Output \"Product version: $assembly_version.`$(VS version)\"\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Update Buildnumber used for drop location
410,217
07.04.2017 16:33:29
25,200
4bb3c5d3cdc58c84695bf1491f8be89c4fb16dd6
actually get the value of the environment variable
[ { "change_type": "MODIFY", "old_path": "Nodejs/Setup/BuildRelease.ps1", "new_path": "Nodejs/Setup/BuildRelease.ps1", "diff": "@@ -461,7 +461,7 @@ if ([int]::Parse([regex]::Match($buildnumber, '^[0-9]+').Value) -ge 65535) {\n$msi_version = \"$release_version.$buildnumber\"\nif ($internal -or $release -or $mockrelease) {\n- $serverBuildNumber = Get-ChildItem ENV:Build_BuildNumber\n+ $serverBuildNumber = ${ENV:Build_BuildNumber}\nif (-not $serverBuildNumber) {\n$outdir = \"$outdir\\$buildnumber\"\n} else {\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
actually get the value of the environment variable
410,217
07.04.2017 17:48:07
25,200
5e1e526a70906dbd2f3ab7dc0102cbcd0f1b7267
Make sure the buildindex is correct
[ { "change_type": "MODIFY", "old_path": "Nodejs/Setup/BuildRelease.ps1", "new_path": "Nodejs/Setup/BuildRelease.ps1", "diff": "@@ -440,9 +440,17 @@ if (-not $outdir) {\n$outdir = $base_outdir\n}\n-$buildnumber = '{0}{1:MMdd}.{2:D2}' -f (((Get-Date).Year - $base_year), (Get-Date), 0)\n+$serverBuildNumber = ${ENV:Build_BuildNumber}\n+if (-not $serverBuildNumber) {\n+ $buildindex = 0\n+} else {\n+ $buildindex = \"$serverBuildNumber\".Split(\".\")[1]\n+}\n+\n+$buildnumber = '{0}{1:MMdd}.{2:D2}' -f (((Get-Date).Year - $base_year), (Get-Date), $buildindex)\n+\nif ($release -or $mockrelease -or $internal) {\n- for ($buildindex = 0; $buildindex -lt 10000; $buildindex += 1) {\n+ for (; $buildindex -lt 10000; $buildindex += 1) {\n$buildnumber = '{0}{1:MMdd}.{2:D2}' -f (((Get-Date).Year - $base_year), (Get-Date), $buildindex)\nif (-not (Test-Path $outdir\\$buildnumber)) {\nbreak\n@@ -461,7 +469,7 @@ if ([int]::Parse([regex]::Match($buildnumber, '^[0-9]+').Value) -ge 65535) {\n$msi_version = \"$release_version.$buildnumber\"\nif ($internal -or $release -or $mockrelease) {\n- $serverBuildNumber = ${ENV:Build_BuildNumber}\n+\nif (-not $serverBuildNumber) {\n$outdir = \"$outdir\\$buildnumber\"\n} else {\n@@ -492,7 +500,6 @@ Write-Output \"\"\nWrite-Output \"Product version: $assembly_version.`$(VS version)\"\nWrite-Output \"MSI version: $msi_version\"\nWrite-Output \"Building for $([String]::Join(\", \", ($target_versions | % { $_.name })))\"\n-Write-Output \"\"\nWrite-Output \"============================================================\"\nWrite-Output \"\"\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Make sure the buildindex is correct
410,217
10.04.2017 16:21:29
25,200
724b638cdd27d7df0a6d9cd15fd3c9446277f133
Correctly include script arguments when starting node for debugging
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Debugger/NodeDebugger.cs", "new_path": "Nodejs/Product/Nodejs/Debugger/NodeDebugger.cs", "diff": "@@ -113,7 +113,7 @@ namespace Microsoft.NodejsTools.Debugger {\nreturn debuggerPortOrDefault;\n}\n- public static NodeProcess StartNodeProcessWithDebug(\n+ private static NodeProcess StartNodeProcessWithDebug(\nstring exe,\nstring script,\nstring dir,\n@@ -126,7 +126,7 @@ namespace Microsoft.NodejsTools.Debugger {\nvar debuggerPortOrDefault = debuggerPort ?? GetDebuggerPort();\n// Node usage: node [options] [ -e script | script.js ] [arguments]\n- var allArgs = $\"--debug-brk={debuggerPortOrDefault} --nolazy {interpreterOptions} \\\"{CommonUtils.UnquotePath(script)}\\\"\"; /* unquote the path so we can safely add quotes */\n+ var allArgs = $\"--debug-brk={debuggerPortOrDefault} --nolazy {interpreterOptions} {script}\"; // script includes the arguments for the script, so we can't quote it here\nreturn StartNodeProcess(exe, dir, env, debugOptions, debuggerPortOrDefault, allArgs, createNodeWindow);\n}\n@@ -144,7 +144,7 @@ namespace Microsoft.NodejsTools.Debugger {\nvar debuggerPortOrDefault = debuggerPort ?? GetDebuggerPort();\n// Node usage: node [options] [ -e script | script.js ] [arguments]\n- var allArgs = $\"--inspect={debuggerPortOrDefault} --debug-brk --nolazy {interpreterOptions} \\\"{CommonUtils.UnquotePath(script)}\\\"\"; /* unquote the path so we can safely add quotes */\n+ var allArgs = $\"--inspect={debuggerPortOrDefault} --debug-brk --nolazy {interpreterOptions} {script}\"; // script includes the arguments for the script, so we can't quote it here\nreturn StartNodeProcess(exe, dir, env, debugOptions, debuggerPortOrDefault, allArgs, createNodeWindow);\n}\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/NodejsProjectLauncher.cs", "new_path": "Nodejs/Product/Nodejs/Project/NodejsProjectLauncher.cs", "diff": "@@ -104,8 +104,9 @@ namespace Microsoft.NodejsTools.Project {\nvar env = GetEnvironmentVariablesString(url);\nvar interpreterOptions = _project.GetProjectProperty(NodeProjectProperty.NodeExeArguments);\nvar debugOptions = this.GetDebugOptions();\n+ var script = GetFullArguments(file, includeNodeArgs: false);\n- var process = NodeDebugger.StartNodeProcessWithInspect(exe: nodePath, script: file, dir: workingDir, env: env, interpreterOptions: interpreterOptions, debugOptions: debugOptions);\n+ var process = NodeDebugger.StartNodeProcessWithInspect(exe: nodePath, script: script, dir: workingDir, env: env, interpreterOptions: interpreterOptions, debugOptions: debugOptions);\nprocess.Start();\n// setup debug info and attach\n@@ -184,7 +185,7 @@ namespace Microsoft.NodejsTools.Project {\nUseShellExecute = false,\nFileName = nodePath,\n- Arguments = GetFullArguments(file),\n+ Arguments = GetFullArguments(file, includeNodeArgs: true),\nWorkingDirectory = _project.GetWorkingDirectory()\n};\n@@ -216,7 +217,7 @@ namespace Microsoft.NodejsTools.Project {\n}\n}\n- private string GetFullArguments(string file, bool includeNodeArgs = true) {\n+ private string GetFullArguments(string file, bool includeNodeArgs) {\nstring res = String.Empty;\nif (includeNodeArgs) {\nvar nodeArgs = _project.GetProjectProperty(NodeProjectProperty.NodeExeArguments);\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Correctly include script arguments when starting node for debugging
410,217
11.04.2017 15:09:10
25,200
1fa539aeb087d8f2849f9ab4e5611b9878a65b3d
Update app.js comment out debug statement
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/ProjectTemplates/AzureExpress4App/app.js", "new_path": "Nodejs/Product/Nodejs/ProjectTemplates/AzureExpress4App/app.js", "diff": "@@ -60,5 +60,5 @@ app.use(function (err, req, res, next) {\napp.set('port', process.env.PORT || 3000);\nvar server = app.listen(app.get('port'), function () {\n- debug('Express server listening on port ' + server.address().port);\n+ //debug('Express server listening on port ' + server.address().port);\n});\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Update app.js comment out debug statement
410,217
12.04.2017 12:47:21
25,200
7df89557672fe2a0affbae2bc2de9a3d2e9005fd
Some more clean up and fixes encountered while debugging.
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/ProjectTemplates/CloudService/CloudService.vstemplate", "new_path": "Nodejs/Product/Nodejs/ProjectTemplates/CloudService/CloudService.vstemplate", "diff": "-<VSTemplate Version=\"3.0.0\" Type=\"Project\" xmlns=\"http://schemas.microsoft.com/developer/vstemplate/2005\"> <TemplateData> <Name Package=\"{FE8A8C3D-328A-476D-99F9-2A24B75F8C7F}\" ID=\"3065\"/> <Description Package=\"{FE8A8C3D-328A-476D-99F9-2A24B75F8C7F}\" ID=\"3066\"/> <ProjectType>JavaScript</ProjectType> <TemplateGroupID>CloudServiceProject</TemplateGroupID> <TemplateID>Microsoft.CloudServiceProject.CloudService_js</TemplateID> <RequiredFrameworkVersion>3.5</RequiredFrameworkVersion> <SortOrder>30</SortOrder> <NumberOfParentCategoriesToRollUp>1</NumberOfParentCategoriesToRollUp> <CreateNewFolder>true</CreateNewFolder> <DefaultName>AzureCloudService</DefaultName> <ProvideDefaultName>true</ProvideDefaultName> <Icon>cloudservice.ico</Icon> <PromptForSaveOnCreation>true</PromptForSaveOnCreation> <LocationField>Enabled</LocationField> <EnableLocationBrowseButton>true</EnableLocationBrowseButton> </TemplateData> <TemplateContent> <Project File=\"CloudService.ccproj\" ReplaceParameters=\"true\"> <ProjectItem ReplaceParameters=\"true\">ServiceDefinition.csdef</ProjectItem> <ProjectItem ReplaceParameters=\"true\">ServiceConfiguration.Local.cscfg</ProjectItem> <ProjectItem ReplaceParameters=\"true\">ServiceConfiguration.Cloud.cscfg</ProjectItem> </Project> </TemplateContent> <WizardExtension> <Assembly>Microsoft.NodejsTools.ProjectWizard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly> <FullClassName>Microsoft.NodejsTools.ProjectWizard.CloudServiceWizard</FullClassName> </WizardExtension> </VSTemplate>\n\\ No newline at end of file\n+<VSTemplate Version=\"3.0.0\" Type=\"Project\" xmlns=\"http://schemas.microsoft.com/developer/vstemplate/2005\">\n+ <TemplateData>\n+ <Name Package=\"{FE8A8C3D-328A-476D-99F9-2A24B75F8C7F}\" ID=\"3065\"/>\n+ <Description Package=\"{FE8A8C3D-328A-476D-99F9-2A24B75F8C7F}\" ID=\"3067\"/>\n+ <ProjectType>JavaScript</ProjectType>\n+ <TemplateGroupID>CloudServiceProject</TemplateGroupID>\n+ <TemplateID>Microsoft.CloudServiceProject.CloudService_js</TemplateID>\n+ <RequiredFrameworkVersion>3.5</RequiredFrameworkVersion>\n+ <SortOrder>30</SortOrder>\n+ <NumberOfParentCategoriesToRollUp>1</NumberOfParentCategoriesToRollUp>\n+ <CreateNewFolder>true</CreateNewFolder>\n+ <DefaultName>AzureCloudService</DefaultName>\n+ <ProvideDefaultName>true</ProvideDefaultName>\n+ <Icon>cloudservice.ico</Icon>\n+ <PromptForSaveOnCreation>true</PromptForSaveOnCreation>\n+ <LocationField>Enabled</LocationField>\n+ <EnableLocationBrowseButton>true</EnableLocationBrowseButton>\n+ </TemplateData>\n+ <TemplateContent>\n+ <Project File=\"CloudService.ccproj\" ReplaceParameters=\"true\">\n+ <ProjectItem ReplaceParameters=\"true\">ServiceDefinition.csdef</ProjectItem>\n+ <ProjectItem ReplaceParameters=\"true\">ServiceConfiguration.Local.cscfg</ProjectItem>\n+ <ProjectItem ReplaceParameters=\"true\">ServiceConfiguration.Cloud.cscfg</ProjectItem>\n+ </Project>\n+ </TemplateContent>\n+ <WizardExtension>\n+ <Assembly>Microsoft.NodejsTools.ProjectWizard, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</Assembly>\n+ <FullClassName>Microsoft.NodejsTools.ProjectWizard.CloudServiceWizard</FullClassName>\n+ </WizardExtension>\n+</VSTemplate>\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/ProjectTemplates/Express4App/ExpressApp.vstemplate", "new_path": "Nodejs/Product/Nodejs/ProjectTemplates/Express4App/ExpressApp.vstemplate", "diff": "<VSTemplate Version=\"3.0.0\" Type=\"Project\" xmlns=\"http://schemas.microsoft.com/developer/vstemplate/2005\">\n<TemplateData>\n- <Name Package=\"{FE8A8C3D-328A-476D-99F9-2A24B75F8C7F}\" ID=\"3067\"/>\n+ <Name Package=\"{FE8A8C3D-328A-476D-99F9-2A24B75F8C7F}\" ID=\"3066\"/>\n<Description Package=\"{FE8A8C3D-328A-476D-99F9-2A24B75F8C7F}\" ID=\"3068\"/>\n<Icon Package=\"{FE8A8C3D-328A-476D-99F9-2A24B75F8C7F}\" ID=\"406\"/>\n<ProjectType>JavaScript</ProjectType>\n<ProjectItem>layout.pug</ProjectItem>\n<ProjectItem>error.pug</ProjectItem>\n</Folder>\n- <Folder Name=\"bin\">\n- <ProjectItem ReplaceParameters=\"true\">www</ProjectItem>\n- </Folder>\n<ProjectItem OpenInEditor=\"true\">app.js</ProjectItem>\n<ProjectItem ReplaceParameters=\"true\">package.json</ProjectItem>\n<ProjectItem ReplaceParameters=\"true\">README.md</ProjectItem>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/ProjectTemplates/Express4App/package.json", "new_path": "Nodejs/Product/Nodejs/ProjectTemplates/Express4App/package.json", "diff": "\"version\": \"0.0.0\",\n\"private\": true,\n\"scripts\": {\n- \"start\": \"node ./bin/www\"\n+ \"start\": \"node app\"\n},\n\"description\": \"$projectname$\",\n\"author\": {\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/ProjectTemplates/TypeScriptExpressApp/ExpressApp.njsproj", "new_path": "Nodejs/Product/Nodejs/ProjectTemplates/TypeScriptExpressApp/ExpressApp.njsproj", "diff": "<TypeScriptCompile Include=\"typings\\globals\\express-serve-static-core\\index.d.ts\" />\n<TypeScriptCompile Include=\"typings\\globals\\mime\\index.d.ts\" />\n<TypeScriptCompile Include=\"typings\\globals\\serve-static\\index.d.ts\" />\n- <Compile Include=\"bin\\www\" />\n<Content Include=\"package.json\" />\n<Content Include=\"public\\stylesheets\\main.css\" />\n<Content Include=\"README.md\" />\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/ProjectTemplates/TypeScriptExpressApp/ExpressApp.vstemplate", "new_path": "Nodejs/Product/Nodejs/ProjectTemplates/TypeScriptExpressApp/ExpressApp.vstemplate", "diff": "</TemplateData>\n<TemplateContent>\n<Project File=\"ExpressApp.njsproj\" ReplaceParameters=\"true\">\n- <Folder Name=\"bin\">\n- <ProjectItem ReplaceParameters=\"true\">www</ProjectItem>\n- </Folder>\n<Folder Name=\"public\">\n<Folder Name=\"images\"/>\n<Folder Name=\"javascripts\"/>\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Some more clean up and fixes encountered while debugging.
410,218
12.04.2017 22:19:44
25,200
a44207834946843f696b18e281299db730430a9e
Explicitly load the VS assemblies on Dev15
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/TestAdapter/TestExecutor.cs", "new_path": "Nodejs/Product/TestAdapter/TestExecutor.cs", "diff": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics;\n+using System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Net.NetworkInformation;\n+using System.Reflection;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing System.Threading;\n@@ -30,9 +32,9 @@ using Microsoft.VisualStudio.TestPlatform.ObjectModel.Logging;\nusing Microsoft.VisualStudioTools;\nusing Microsoft.VisualStudioTools.Project;\nusing MSBuild = Microsoft.Build.Evaluation;\n-using System.Globalization;\n-namespace Microsoft.NodejsTools.TestAdapter {\n+namespace Microsoft.NodejsTools.TestAdapter\n+{\n[ExtensionUri(TestExecutor.ExecutorUriString)]\nclass TestExecutor : ITestExecutor {\npublic const string ExecutorUriString = \"executor://NodejsTestExecutor/v1\";\n@@ -158,6 +160,24 @@ namespace Microsoft.NodejsTools.TestAdapter {\nreturn;\n}\n+#if DEV15\n+ // VS 2017 doesn't install some assemblies to the GAC that are needed to work with the\n+ // debugger, and as the tests don't execute in the devenv.exe process, those assemblies\n+ // fail to load - so load them manually from PublicAssemblies.\n+\n+ var currentProc = Process.GetCurrentProcess().MainModule.FileName;\n+ if(Path.GetFileName(currentProc).ToLowerInvariant().Equals(\"vstest.executionengine.x86.exe\"))\n+ {\n+ string baseDir = Path.GetDirectoryName(currentProc);\n+ string publicAssemblies = Path.Combine(baseDir, \"..\\\\..\\\\..\\\\PublicAssemblies\");\n+\n+ Assembly.LoadFrom(Path.Combine(publicAssemblies, \"Microsoft.VisualStudio.OLE.Interop.dll\"));\n+ Assembly.LoadFrom(Path.Combine(publicAssemblies, \"envdte90.dll\"));\n+ Assembly.LoadFrom(Path.Combine(publicAssemblies, \"envdte80.dll\"));\n+ Assembly.LoadFrom(Path.Combine(publicAssemblies, \"envdte.dll\"));\n+ }\n+#endif\n+\nNodejsTestInfo testInfo = new NodejsTestInfo(test.FullyQualifiedName);\nList<string> args = new List<string>();\nint port = 0;\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Explicitly load the VS assemblies on Dev15
410,217
17.04.2017 10:53:52
25,200
ee63258db5c8e775a729117351c8a67f70ac6fb3
Move to 1.4 for VS 2017
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/AssemblyInfoCommon.cs", "new_path": "Nodejs/Product/AssemblyInfoCommon.cs", "diff": "@@ -8,6 +8,6 @@ using System.Reflection;\n// (See also AssemblyVersion.cs in this same directory.)\n[assembly: AssemblyCompany(\"Microsoft\")]\n[assembly: AssemblyProduct(\"Node.js Tools for Visual Studio\")]\n-[assembly: AssemblyCopyright(\"Copyright \\u00A9 Microsoft 2013\")]\n+[assembly: AssemblyCopyright(\"Copyright \\u00A9 Microsoft\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/AssemblyVersion.cs", "new_path": "Nodejs/Product/AssemblyVersion.cs", "diff": "@@ -21,20 +21,14 @@ internal class AssemblyVersionInfo\n// This version string (and the comment for Version) should be updated\n// manually between minor releases (e.g. from 1.0 to 1.1).\n// Servicing branches and prereleases should retain the value.\n- public const string FileVersion = \"1.3\";\n+ public const string FileVersion = \"1.4\";\n// This version should never change from \"4100.00\"; BuildRelease.ps1\n// will replace it with a generated value.\npublic const string BuildNumber = \"4100.00\";\n-#if DEV14\n- public const string VSMajorVersion = \"14\";\n- const string VSVersionSuffix = \"2015\";\n-#elif DEV15\n+\npublic const string VSMajorVersion = \"15\";\n- private const string VSVersionSuffix = \"15\";\n-#else\n-#error Unrecognized VS Version.\n-#endif\n+ private const string VSVersionSuffix = \"2017\";\npublic const string VSVersion = VSMajorVersion + \".0\";\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Setup/BuildRelease.ps1", "new_path": "Nodejs/Setup/BuildRelease.ps1", "diff": "@@ -140,7 +140,7 @@ Write-Output \"Build Root: $buildroot\"\n# This value is used to determine the most significant digit of the build number.\n-$base_year = 2012\n+$base_year = 2016\n# This value is used to automatically generate outdir for -release and -internal builds\n$base_outdir = \"\\\\pytools\\Release\\Nodejs\"\n@@ -180,20 +180,7 @@ if ($release -or $mockrelease) {\n# Get the path to msbuild for a configuration\nfunction msbuild-exe($target) {\n- if ($target.VSTarget -eq \"15.0\") {\nreturn \"$($target.vsroot)\\MSBuild\\$($target.VSTarget)\\Bin\\msbuild.exe\"\n- } else {\n- $msbuild_reg = Get-ItemProperty -Path \"HKLM:\\Software\\Wow6432Node\\Microsoft\\MSBuild\\ToolsVersions\\$($target.VSTarget)\" -EA 0\n- if (-not $msbuild_reg) {\n- Throw \"Visual Studio build tools $($target.VSTarget) not found.\"\n- }\n-\n- $target_exe = $msbuild_reg.MSBuildToolsPath + \"msbuild.exe\"\n- if (-not (Test-Path -Path $target_exe)) {\n- Throw \"Visual Studio build tools $($target.VSTarget) not found.\"\n- }\n- return $target_exe\n- }\n}\n# This function is used to get options for each configuration\n@@ -343,15 +330,13 @@ $managed_files = (\n\"Microsoft.NodejsTools.Npm.dll\",\n\"Microsoft.NodejsTools.TestAdapter.dll\",\n\"Microsoft.NodejsTools.PressAnyKey.exe\",\n- \"Microsoft.NodejsTools.Telemetry.14.0.dll\",\n\"Microsoft.NodejsTools.Telemetry.15.0.dll\"\n)\n$native_files = @()\n$supported_vs_versions = (\n- @{number=\"15.0\"; name=\"VS 2017\"; build_by_default=$true},\n- @{number=\"14.0\"; name=\"VS 2015\"; build_by_default=$true}\n+ @{number=\"15.0\"; name=\"VS 2017\"; build_by_default=$true}\n)\n# #############################################################################\n@@ -611,8 +596,7 @@ try {\n$project_name $project_url \"$project_name $($i.VSName) - native code\" $project_keywords `\n\"authenticode\"\n- # we only loc Dev 15\n- if ($i.VSTarget -eq \"15.0\") {\n+\nforeach ($loc in $locales) {\n$jobs += begin_sign_files `\n@($localized_files | %{@{path=\"$($i.unsigned_bindir)\\$loc\\$_\"; name=$_}} | ?{Test-Path $_.path}) `\n@@ -622,7 +606,6 @@ try {\n-delaysigned\n}\n}\n- }\nend_sign_files $jobs\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Move to 1.4 for VS 2017
410,217
17.04.2017 11:51:32
25,200
ecf16a35e6b3a660ae1e925ea1b0575f6babe38e
make version check more robust don't use no longer suppoted cmd line argument
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Debugger/NodeDebugger.cs", "new_path": "Nodejs/Product/Nodejs/Debugger/NodeDebugger.cs", "diff": "@@ -144,7 +144,7 @@ namespace Microsoft.NodejsTools.Debugger {\nvar debuggerPortOrDefault = debuggerPort ?? GetDebuggerPort();\n// Node usage: node [options] [ -e script | script.js ] [arguments]\n- var allArgs = $\"--inspect={debuggerPortOrDefault} --debug-brk --nolazy {interpreterOptions} {script}\"; // script includes the arguments for the script, so we can't quote it here\n+ var allArgs = $\"--inspect-brk={debuggerPortOrDefault} --nolazy {interpreterOptions} {script}\"; // script includes the arguments for the script, so we can't quote it here\nreturn StartNodeProcess(exe, dir, env, debugOptions, debuggerPortOrDefault, allArgs, createNodeWindow);\n}\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Nodejs.cs", "new_path": "Nodejs/Product/Nodejs/Nodejs.cs", "diff": "@@ -35,12 +35,8 @@ namespace Microsoft.NodejsTools {\n{\nif (!string.IsNullOrEmpty(path))\n{\n- var versionString = FileVersionInfo.GetVersionInfo(path).ProductVersion;\n- Version version;\n- if (Version.TryParse(versionString, out version))\n- {\n- return version;\n- }\n+ var version = FileVersionInfo.GetVersionInfo(path);\n+ return new Version(version.ProductMajorPart, version.ProductMinorPart);\n}\nreturn default(Version);\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
make version check more robust don't use no longer suppoted cmd line argument
410,218
18.04.2017 23:21:30
25,200
a931fc42ff8b48eb202aa776f2c5de9e6de7a3a0
Simplified test execution code
[ { "change_type": "MODIFY", "old_path": "Common/Product/SharedProject/ProcessOutput.cs", "new_path": "Common/Product/SharedProject/ProcessOutput.cs", "diff": "@@ -58,6 +58,15 @@ namespace Microsoft.VisualStudioTools.Project {\n/// </summary>\npublic virtual void ShowAndActivate() {\n}\n+\n+ /// <summary>\n+ /// Called to determine if stdin should be closed for a redirected process.\n+ /// The default is true.\n+ /// </summary>\n+ public virtual bool CloseStandardInput()\n+ {\n+ return true;\n+ }\n}\nsealed class TeeRedirector : Redirector, IDisposable {\n@@ -423,14 +432,20 @@ namespace Microsoft.VisualStudioTools.Project {\nif (_process.StartInfo.RedirectStandardInput) {\n// Close standard input so that we don't get stuck trying to read input from the user.\n- try {\n+ if (_redirector == null || (_redirector != null && _redirector.CloseStandardInput()))\n+ {\n+ try\n+ {\n_process.StandardInput.Close();\n- } catch (InvalidOperationException) {\n+ }\n+ catch (InvalidOperationException)\n+ {\n// StandardInput not available\n}\n}\n}\n}\n+ }\nprivate void OnOutputDataReceived(object sender, DataReceivedEventArgs e) {\nif (_isDisposed) {\n@@ -557,6 +572,20 @@ namespace Microsoft.VisualStudioTools.Project {\nget { return _redirector; }\n}\n+ /// <summary>\n+ /// Writes a line to stdin. A redirector must have been provided that indicates not\n+ /// to close the StandardInput stream.\n+ /// </summary>\n+ /// <param name=\"line\"></param>\n+ public void WriteInputLine(string line)\n+ {\n+ if (IsStarted && _redirector != null && !_redirector.CloseStandardInput())\n+ {\n+ _process.StandardInput.WriteLine(line);\n+ _process.StandardInput.Flush();\n+ }\n+ }\n+\nprivate void FlushAndCloseOutput() {\nif (_process == null) {\nreturn;\n" }, { "change_type": "MODIFY", "old_path": "Common/Product/TestAdapter/VisualStudioApp.cs", "new_path": "Common/Product/TestAdapter/VisualStudioApp.cs", "diff": "using System;\nusing System.Collections.Generic;\nusing System.Diagnostics.CodeAnalysis;\n+using System.IO;\nusing System.Linq;\n+using System.Reflection;\nusing System.Runtime.InteropServices;\nusing EnvDTE;\nusing Microsoft.VisualStudio.OLE.Interop;\n@@ -75,7 +77,34 @@ namespace Microsoft.VisualStudioTools {\nreturn dte;\n}\n+#if DEV15\n+ private static bool DTELoaded = false;\n+#endif\n+\nprivate static DTE GetDTE(int processId) {\n+#if DEV15\n+ // VS 2017 doesn't install some assemblies to the GAC that are needed to work with the\n+ // debugger, and as the tests don't execute in the devenv.exe process, those assemblies\n+ // fail to load - so load them manually from PublicAssemblies.\n+\n+ // Use the executable name, as this is only needed for the out of proc test execution\n+ // that may interact with the debugger (vstest.executionengine.x86.exe).\n+ if (!DTELoaded)\n+ {\n+ string currentProc = Process.GetCurrentProcess().MainModule.FileName;\n+ if (Path.GetFileName(currentProc).ToLowerInvariant().Equals(\"vstest.executionengine.x86.exe\"))\n+ {\n+ string baseDir = Path.GetDirectoryName(currentProc);\n+ string publicAssemblies = Path.Combine(baseDir, \"..\\\\..\\\\..\\\\PublicAssemblies\");\n+\n+ Assembly.LoadFrom(Path.Combine(publicAssemblies, \"Microsoft.VisualStudio.OLE.Interop.dll\"));\n+ Assembly.LoadFrom(Path.Combine(publicAssemblies, \"envdte90.dll\"));\n+ Assembly.LoadFrom(Path.Combine(publicAssemblies, \"envdte80.dll\"));\n+ Assembly.LoadFrom(Path.Combine(publicAssemblies, \"envdte.dll\"));\n+ }\n+ DTELoaded = true;\n+ }\n+#endif\nMessageFilter.Register();\nvar prefix = Process.GetProcessById(processId).ProcessName;\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/TestFrameworks/ExportRunner/exportrunner.js", "new_path": "Nodejs/Product/Nodejs/TestFrameworks/ExportRunner/exportrunner.js", "diff": "@@ -83,8 +83,8 @@ var run_tests = function (testCases, callback) {\n});\ntry {\nvar testCase = require(test.testFile);\n- testCase[test.testName]();\nresult.title = test.testName;\n+ testCase[test.testName]();\nresult.passed = true;\n} catch (err) {\nresult.passed = false;\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/TestFrameworks/mocha/mocha.js", "new_path": "Nodejs/Product/Nodejs/TestFrameworks/mocha/mocha.js", "diff": "@@ -104,6 +104,7 @@ var run_tests = function (testCases, callback) {\nprocess.exit(code);\n});\n+ // See events available at https://github.com/mochajs/mocha/blob/8cae7a34f0b6eafeb16567beb8852b827cc5956b/lib/runner.js#L47-L57\nrunner.on('suite', function (suite) {\npost({\ntype: 'suite start',\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/TestAdapter/TestExecutor.cs", "new_path": "Nodejs/Product/TestAdapter/TestExecutor.cs", "diff": "@@ -20,6 +20,7 @@ using System.Diagnostics;\nusing System.IO;\nusing System.Linq;\nusing System.Net.NetworkInformation;\n+using System.Reflection;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing System.Threading;\n@@ -31,9 +32,31 @@ using Microsoft.VisualStudioTools;\nusing Microsoft.VisualStudioTools.Project;\nusing MSBuild = Microsoft.Build.Evaluation;\nusing Newtonsoft.Json;\n-using System.Globalization;\nnamespace Microsoft.NodejsTools.TestAdapter {\n+ class TestExecutionRedirector : Redirector\n+ {\n+ Action<string> writer;\n+ public TestExecutionRedirector(Action<string> onWriteLine)\n+ {\n+ writer = onWriteLine;\n+ }\n+ public override void WriteErrorLine(string line)\n+ {\n+ writer(line);\n+ }\n+\n+ public override void WriteLine(string line)\n+ {\n+ writer(line);\n+ }\n+\n+ public override bool CloseStandardInput()\n+ {\n+ return false;\n+ }\n+ }\n+\n[ExtensionUri(TestExecutor.ExecutorUriString)]\nclass TestExecutor : ITestExecutor {\npublic const string ExecutorUriString = \"executor://NodejsTestExecutor/v1\";\n@@ -44,8 +67,7 @@ namespace Microsoft.NodejsTools.TestAdapter {\nprivate readonly ManualResetEvent _cancelRequested = new ManualResetEvent(false);\nprivate static readonly char[] _needToBeQuoted = new[] { ' ', '\"' };\n- private ProcessStartInfo _psi;\n- private Process _nodeProcess;\n+ private ProcessOutput _nodeProcess;\nprivate object _syncObject = new object();\nprivate List<TestCase> _currentTests;\nprivate IFrameworkHandle _frameworkHandle;\n@@ -59,25 +81,34 @@ namespace Microsoft.NodejsTools.TestAdapter {\n_cancelRequested.Set();\n}\n- private void ProcessTestEvent(object sender, DataReceivedEventArgs e) {\n- try {\n- if (e.Data != null) {\n- TestEvent testEvent = JsonConvert.DeserializeObject<TestEvent>(e.Data);\n+ private void ProcessTestRunnerEmit(string line)\n+ {\n+ try\n+ {\n+ TestEvent testEvent = JsonConvert.DeserializeObject<TestEvent>(line);\n// Extract test from list of tests\nvar test = _currentTests.Where(n => n.DisplayName == testEvent.title);\n- if (test.Count() > 0) {\n- if (testEvent.type == \"test start\") {\n+ if (test.Count() > 0)\n+ {\n+ if (testEvent.type == \"test start\")\n+ {\n_currentResult = new TestResult(test.First());\n_currentResult.StartTime = DateTimeOffset.Now;\n_frameworkHandle.RecordStart(test.First());\n- } else if (testEvent.type == \"result\") {\n+ }\n+ else if (testEvent.type == \"result\")\n+ {\nRecordEnd(_frameworkHandle, test.First(), _currentResult, testEvent.result);\n}\n- } else if (testEvent.type == \"suite end\") {\n+ }\n+ else if (testEvent.type == \"suite end\")\n+ {\n_currentResultObject = testEvent.result;\n}\n}\n- } catch (Exception) { }\n+ catch (JsonReaderException) {\n+ // Often lines emitted while running tests are not test results, and thus will fail to parse above\n+ }\n}\n/// <summary>\n@@ -100,49 +131,8 @@ namespace Microsoft.NodejsTools.TestAdapter {\nif (_cancelRequested.WaitOne(0)) {\nreturn;\n}\n- // May be null, but this is handled by RunTestCase if it matters.\n- // No VS instance just means no debugging, but everything else is\n- // okay.\n- using (var app = VisualStudioApp.FromEnvironmentVariable(NodejsConstants.NodeToolsProcessIdEnvironmentVariable)) {\n- // .ts file path -> project settings\n- var fileToTests = new Dictionary<string, List<TestCase>>();\n- var sourceToSettings = new Dictionary<string, NodejsProjectSettings>();\n- NodejsProjectSettings settings = null;\n- // put tests into dictionary where key is their source file\n- foreach (var test in receiver.Tests) {\n- if (!fileToTests.ContainsKey(test.CodeFilePath)) {\n- fileToTests[test.CodeFilePath] = new List<TestCase>();\n- }\n- fileToTests[test.CodeFilePath].Add(test);\n- }\n-\n- // where key is the file and value is a list of tests\n- foreach (KeyValuePair<string, List<TestCase>> entry in fileToTests) {\n- List<string> args = new List<string>();\n- TestCase firstTest = entry.Value.ElementAt(0);\n- if (!sourceToSettings.TryGetValue(firstTest.Source, out settings)) {\n- sourceToSettings[firstTest.Source] = settings = LoadProjectSettings(firstTest.Source);\n- }\n- int port = 0;\n- if (runContext.IsBeingDebugged && app != null) {\n- app.GetDTE().Debugger.DetachAll();\n- args.AddRange(GetDebugArgs(settings, out port));\n- }\n-\n- _currentTests = entry.Value;\n- _frameworkHandle = frameworkHandle;\n-\n- args.AddRange(GetInterpreterArgs(firstTest, settings.WorkingDir, settings.ProjectRootDir));\n-\n- // launch node process\n- LaunchNodeProcess(settings.WorkingDir, settings.NodeExePath, args);\n- // Run all test cases in a given file\n- RunTestCases(entry.Value, runContext, frameworkHandle, settings);\n- // dispose node process\n- _nodeProcess.Dispose();\n- }\n- }\n+ RunTests(receiver.Tests, runContext, frameworkHandle);\n}\n/// <summary>\n@@ -151,51 +141,42 @@ namespace Microsoft.NodejsTools.TestAdapter {\n/// <param name=\"tests\">The list of TestCases selected to run</param>\n/// <param name=\"runContext\">Defines the settings related to the current run</param>\n/// <param name=\"frameworkHandle\">Handle to framework. Used for recording results</param>\n- public void RunTests(IEnumerable<TestCase> tests, IRunContext runContext, IFrameworkHandle frameworkHandle) {\n+ public void RunTests(IEnumerable<TestCase> tests, IRunContext runContext, IFrameworkHandle frameworkHandle)\n+ {\nValidateArg.NotNull(tests, \"tests\");\nValidateArg.NotNull(runContext, \"runContext\");\nValidateArg.NotNull(frameworkHandle, \"frameworkHandle\");\n_cancelRequested.Reset();\n- using (var app = VisualStudioApp.FromEnvironmentVariable(NodejsConstants.NodeToolsProcessIdEnvironmentVariable)) {\n// .ts file path -> project settings\nvar fileToTests = new Dictionary<string, List<TestCase>>();\nvar sourceToSettings = new Dictionary<string, NodejsProjectSettings>();\nNodejsProjectSettings settings = null;\n// put tests into dictionary where key is their source file\n- foreach (var test in tests) {\n- if (!fileToTests.ContainsKey(test.CodeFilePath)) {\n+ foreach (var test in tests)\n+ {\n+ if (!fileToTests.ContainsKey(test.CodeFilePath))\n+ {\nfileToTests[test.CodeFilePath] = new List<TestCase>();\n}\nfileToTests[test.CodeFilePath].Add(test);\n}\n// where key is the file and value is a list of tests\n- foreach (KeyValuePair<string, List<TestCase>> entry in fileToTests) {\n- List<string> args = new List<string>();\n+ foreach (KeyValuePair<string, List<TestCase>> entry in fileToTests)\n+ {\nTestCase firstTest = entry.Value.ElementAt(0);\n- if (!sourceToSettings.TryGetValue(firstTest.Source, out settings)) {\n+ if (!sourceToSettings.TryGetValue(firstTest.Source, out settings))\n+ {\nsourceToSettings[firstTest.Source] = settings = LoadProjectSettings(firstTest.Source);\n}\n- int port = 0;\n- if (runContext.IsBeingDebugged && app != null) {\n- app.GetDTE().Debugger.DetachAll();\n- args.AddRange(GetDebugArgs(settings, out port));\n- }\n_currentTests = entry.Value;\n_frameworkHandle = frameworkHandle;\n- args.AddRange(GetInterpreterArgs(firstTest, settings.WorkingDir, settings.ProjectRootDir));\n-\n- // launch node process\n- LaunchNodeProcess(settings.WorkingDir, settings.NodeExePath, args);\n// Run all test cases in a given file\nRunTestCases(entry.Value, runContext, frameworkHandle, settings);\n- // dispose node process\n- _nodeProcess.Dispose();\n- }\n}\n}\n@@ -203,12 +184,27 @@ namespace Microsoft.NodejsTools.TestAdapter {\n// May be null, but this is handled by RunTestCase if it matters.\n// No VS instance just means no debugging, but everything else is\n// okay.\n+ if (tests.Count() == 0)\n+ {\n+ return;\n+ }\nusing (var app = VisualStudioApp.FromEnvironmentVariable(NodejsConstants.NodeToolsProcessIdEnvironmentVariable)) {\nint port = 0;\n+ List<string> nodeArgs = new List<string>();\n// .njsproj file path -> project settings\nvar sourceToSettings = new Dictionary<string, NodejsProjectSettings>();\n- TestCaseObject testObject;\nList<TestCaseObject> testObjects = new List<TestCaseObject>();\n+\n+ if (!File.Exists(settings.NodeExePath))\n+ {\n+ frameworkHandle.SendMessage(TestMessageLevel.Error, \"Interpreter path does not exist: \" + settings.NodeExePath);\n+ return;\n+ }\n+\n+ // All tests being run are for the same test file, so just use the first test listed to get the working dir\n+ NodejsTestInfo testInfo = new NodejsTestInfo(tests.First().FullyQualifiedName);\n+ var workingDir = Path.GetDirectoryName(CommonUtils.GetAbsoluteFilePath(settings.WorkingDir, testInfo.ModulePath));\n+\nforeach (var test in tests) {\nif (_cancelRequested.WaitOne(0)) {\nbreak;\n@@ -221,54 +217,44 @@ namespace Microsoft.NodejsTools.TestAdapter {\nframeworkHandle.RecordEnd(test, TestOutcome.Failed);\n}\n- NodejsTestInfo testInfo = new NodejsTestInfo(test.FullyQualifiedName);\nList<string> args = new List<string>();\n- if (runContext.IsBeingDebugged && app != null) {\n- app.GetDTE().Debugger.DetachAll();\n- args.AddRange(GetDebugArgs(settings, out port));\n- }\n-\n- var workingDir = Path.GetDirectoryName(CommonUtils.GetAbsoluteFilePath(settings.WorkingDir, testInfo.ModulePath));\nargs.AddRange(GetInterpreterArgs(test, workingDir, settings.ProjectRootDir));\n- //Debug.Fail(\"attach debugger\");\n- if (!File.Exists(settings.NodeExePath)) {\n- frameworkHandle.SendMessage(TestMessageLevel.Error, \"Interpreter path does not exist: \" + settings.NodeExePath);\n- return;\n- }\n- testObject = new TestCaseObject(args[1], args[2], args[3], args[4], args[5]);\n- testObjects.Add(testObject);\n+ // Fetch the run_tests argument for starting node.exe if not specified yet\n+ if(nodeArgs.Count == 0 && args.Count > 0)\n+ {\n+ nodeArgs.Add(args[0]);\n}\n- if (!_nodeProcess.HasExited) {\n- // send testcases to run_tests.js\n- _nodeProcess.StandardInput.WriteLine(JsonConvert.SerializeObject(testObjects));\n- _nodeProcess.StandardInput.Close();\n- _nodeProcess.WaitForExit();\n+ testObjects.Add(new TestCaseObject(args[1], args[2], args[3], args[4], args[5]));\n}\n- // Automatically fail tests that haven't been run by this point (failures in before() hooks)\n- foreach(TestCase notRunTest in _currentTests) {\n- TestResult result = new TestResult(notRunTest);\n- result.Outcome = TestOutcome.Failed;\n- if(_currentResultObject != null) {\n- result.Messages.Add(new TestResultMessage(TestResultMessage.StandardOutCategory, _currentResultObject.stdout));\n- result.Messages.Add(new TestResultMessage(TestResultMessage.StandardErrorCategory, _currentResultObject.stderr));\n- }\n- frameworkHandle.RecordResult(result);\n- frameworkHandle.RecordEnd(notRunTest, TestOutcome.Failed);\n+ if (runContext.IsBeingDebugged && app != null)\n+ {\n+ app.GetDTE().Debugger.DetachAll();\n+ // Ensure that --debug-brk is the first argument\n+ nodeArgs.InsertRange(0, GetDebugArgs(out port));\n}\n+ _nodeProcess = ProcessOutput.Run(\n+ settings.NodeExePath,\n+ nodeArgs,\n+ settings.WorkingDir,\n+ /* env */ null,\n+ /* visible */ false,\n+ /* redirector */ new TestExecutionRedirector(this.ProcessTestRunnerEmit),\n+ /* quote args */ false);\n+\nif (runContext.IsBeingDebugged && app != null) {\ntry {\n//the '#ping=0' is a special flag to tell VS node debugger not to connect to the port,\n//because a connection carries the consequence of setting off --debug-brk, and breakpoints will be missed.\nstring qualifierUri = string.Format(\"tcp://localhost:{0}#ping=0\", port);\n- //while (!app.AttachToProcess(_nodeProcess, NodejsRemoteDebugPortSupplierUnsecuredId, qualifierUri)) {\n- // if (_nodeProcess.Wait(TimeSpan.FromMilliseconds(500))) {\n- // break;\n- // }\n- //}\n+ while (!app.AttachToProcess(_nodeProcess, NodejsRemoteDebugPortSupplierUnsecuredId, qualifierUri)) {\n+ if (_nodeProcess.Wait(TimeSpan.FromMilliseconds(500))) {\n+ break;\n+ }\n+ }\n#if DEBUG\n} catch (COMException ex) {\nframeworkHandle.SendMessage(TestMessageLevel.Error, \"Error occurred connecting to debuggee.\");\n@@ -282,6 +268,21 @@ namespace Microsoft.NodejsTools.TestAdapter {\n}\n#endif\n}\n+ // Send the process the list of tests to run and wait for it to complete\n+ _nodeProcess.WriteInputLine(JsonConvert.SerializeObject(testObjects));\n+ _nodeProcess.Wait();\n+\n+ // Automatically fail tests that haven't been run by this point (failures in before() hooks)\n+ foreach(TestCase notRunTest in _currentTests) {\n+ TestResult result = new TestResult(notRunTest);\n+ result.Outcome = TestOutcome.Failed;\n+ if(_currentResultObject != null) {\n+ result.Messages.Add(new TestResultMessage(TestResultMessage.StandardOutCategory, _currentResultObject.stdout));\n+ result.Messages.Add(new TestResultMessage(TestResultMessage.StandardErrorCategory, _currentResultObject.stderr));\n+ }\n+ frameworkHandle.RecordResult(result);\n+ frameworkHandle.RecordEnd(notRunTest, TestOutcome.Failed);\n+ }\n}\n}\n@@ -306,30 +307,15 @@ namespace Microsoft.NodejsTools.TestAdapter {\nreturn discover.Get(testInfo.TestFramework).ArgumentsToRunTests(testInfo.TestName, testInfo.ModulePath, workingDir, projectRootDir);\n}\n- private static IEnumerable<string> GetDebugArgs(NodejsProjectSettings settings, out int port) {\n+ private static IEnumerable<string> GetDebugArgs(out int port) {\nport = GetFreePort();\n+ // TODO: Need to use --inspect-brk on Node.js 8 or later\nreturn new[] {\n\"--debug-brk=\" + port.ToString()\n};\n}\n- private void LaunchNodeProcess(string workingDir, string nodeExePath, List<string> args) {\n- _psi = new ProcessStartInfo(\"cmd.exe\") {\n- Arguments = string.Format(@\"/S /C pushd {0} & {1} {2}\",\n- ProcessOutput.QuoteSingleArgument(workingDir),\n- ProcessOutput.QuoteSingleArgument(nodeExePath),\n- ProcessOutput.GetArguments(args, true)),\n- CreateNoWindow = true,\n- UseShellExecute = false\n- };\n- _psi.RedirectStandardInput = true;\n- _psi.RedirectStandardOutput = true;\n- _nodeProcess = Process.Start(_psi);\n- _nodeProcess.BeginOutputReadLine();\n- _nodeProcess.OutputDataReceived += ProcessTestEvent;\n- }\n-\nprivate NodejsProjectSettings LoadProjectSettings(string projectFile) {\nvar env = new Dictionary<string, string>();\n#if DEV15\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Simplified test execution code
410,218
20.04.2017 01:35:45
25,200
5cfb3e2e1e5075b52f0b87350ad046e6a7524ff2
Fixed tape runner
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/TestFrameworks/Tape/tape.js", "new_path": "Nodejs/Product/Nodejs/TestFrameworks/Tape/tape.js", "diff": "@@ -57,59 +57,74 @@ function run_tests(testInfo, callback) {\nreturn;\n}\n- var harness = tape.getHarness();\n-\n- testInfo.forEach(function (info) {\n- runTest(info, harness, function (result) {\n- callback(result);\n+ var harness = tape.getHarness({objectMode: true});\n+ var capture = false; // Only capture between 'test' and 'end' events to avoid skipped test events.\n+ harness.createStream({ objectMode: true }).on('data', function (evt){\n+ switch (evt.type) {\n+ case 'test':\n+ capture = true;\n+ // Test is starting. Reset the result object. Send a \"test start\" event.\n+ result = {\n+ 'title': evt.name,\n+ 'passed': true,\n+ 'stdOut': '',\n+ 'stdErr': ''\n+ };\n+ callback({\n+ 'type': 'test start',\n+ 'title': result.title,\n+ 'result': result\n});\n+ break;\n+ case 'assert':\n+ if (!capture) break;\n+ // Correlate the success/failure asserts for this test. There may be multiple per test\n+ var msg = \"Operator: \" + evt.operator + \". Expected: \" + evt.expected + \". Actual: \" + evt.actual + \"\\n\";\n+ if (evt.ok) {\n+ result.stdOut += msg;\n+ } else {\n+ result.stdErr += msg + (evt.error.stack || evt.error.message) + \"\\n\";\n+ result.passed = false;\n+ }\n+ break;\n+ case 'end':\n+ if (!capture) break;\n+ // Test is done. Send a \"result\" event.\n+ callback({\n+ 'type': 'result',\n+ 'title': result.title,\n+ 'result': result\n});\n-\n- tape.onFinish(function () {\n- // executes when all tests are done running\n+ capture = false;\n+ break;\n+ default:\n+ break;\n+ }\n});\n- function runTest(testInfo, harness, done) {\n- var stream = harness.createStream({ objectMode: true });\n- var title = testInfo.testName;\n+ loadTestCases(testInfo[0].testFile);\n- stream.on(('data'), function (result) {\n- if (result.type === 'test') {\n- done({\n- type: 'test start',\n- title: title\n- });\n+ // Skip those not selected to run. The rest will start running on the next tick.\n+ harness['_tests'].forEach(function(test){\n+ if( !testInfo.some( function(ti){ return ti.testName == test.name; }) ) {\n+ test._skip = true;\n}\n});\n- try {\n- var htest = tape.test(title, {}, function (result) {\n- done({\n- type: 'result',\n- title: title,\n- result: {\n- 'title': title,\n- 'passed': result._ok,\n- 'stdOut': '',\n- 'stdErr': ''\n- }\n+ harness.onFinish(function () {\n+ // TODO: This still doesn't seem to handle async tests with plan issues.\n+ if (capture) {\n+ // Something didn't finish. Finish it now.\n+ result.passed = false;\n+ callback({\n+ 'type': 'result',\n+ 'title': result.title,\n+ 'result': result\n});\n- });\n- } catch (e) {\n- console.error('NTVS_ERROR:', e);\n- done({\n- type: 'result',\n- title: title,\n- result: {\n- 'title': title,\n- 'passed': false,\n- 'stdOut': '',\n- 'stdErr': e.message\n}\n+ process.exit(0);\n});\n}\n- }\n-}\nmodule.exports.run_tests = run_tests;\nfunction loadTestCases(testFile) {\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Fixed tape runner
410,217
20.04.2017 12:36:00
25,200
7d9fa91beac9d51a750a0c4c8e77955381662478
Fix tab-order in nodejs tools options
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Options/NodejsGeneralOptionsControl.Designer.cs", "new_path": "Nodejs/Product/Nodejs/Options/NodejsGeneralOptionsControl.Designer.cs", "diff": "//\n// _topOptionsPanel\n//\n- this._topOptionsPanel.Controls.Add(this._checkForLongPaths);\n- this._topOptionsPanel.Controls.Add(this._editAndContinue);\n- this._topOptionsPanel.Controls.Add(this._waitOnNormalExit);\n+\n+ // due to a bug in winforms the order you add controls to the parent collection\n+ // actually affects the Tab-Order...\n+ // so make sure you keep the order:\n+ // * this._waitOnAbnormalExit\n+ // * this._waitOnNormalExit\n+ // * this._editAndContinue\n+ // * this._checkForLongPaths\n+\nthis._topOptionsPanel.Controls.Add(this._waitOnAbnormalExit);\n+ this._topOptionsPanel.Controls.Add(this._waitOnNormalExit);\n+ this._topOptionsPanel.Controls.Add(this._editAndContinue);\n+ this._topOptionsPanel.Controls.Add(this._checkForLongPaths);\n+\nresources.ApplyResources(this._topOptionsPanel, \"_topOptionsPanel\");\nthis._topOptionsPanel.Name = \"_topOptionsPanel\";\n//\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Fix tab-order in nodejs tools options
410,217
21.04.2017 14:12:29
25,200
7b948a38a8704beaee3ea21907124a01cabb4093
Correctly implement the IPropertyPage interface This way the property page scrolls to keep the focused control visible.
[ { "change_type": "MODIFY", "old_path": "Common/Product/SharedProject/CommonPropertyPage.cs", "new_path": "Common/Product/SharedProject/CommonPropertyPage.cs", "diff": "@@ -19,9 +19,9 @@ namespace Microsoft.VisualStudioTools.Project\n/// </summary>\npublic abstract class CommonPropertyPage : IPropertyPage\n{\n- private IPropertyPageSite _site;\n- private bool _dirty, _loading;\n+ private IPropertyPageSite site;\nprivate CommonProjectNode _project;\n+ private bool dirty;\npublic abstract Control Control\n{\n@@ -236,32 +236,22 @@ namespace Microsoft.VisualStudioTools.Project\nnewGroup.AddProperty(propertyName, propertyValue);\n}\n- public bool Loading\n- {\n- get\n- {\n- return this._loading;\n- }\n- set\n- {\n- this._loading = value;\n- }\n- }\n+ public bool Loading { get; set; }\npublic bool IsDirty\n{\nget\n{\n- return this._dirty;\n+ return this.dirty;\n}\nset\n{\n- if (this._dirty != value && !this.Loading)\n+ if (this.dirty != value && !this.Loading)\n{\n- this._dirty = value;\n- if (this._site != null)\n+ this.dirty = value;\n+ if (this.site != null)\n{\n- this._site.OnStatusChange((uint)(this._dirty ? PropPageStatus.Dirty : PropPageStatus.Clean));\n+ this.site.OnStatusChange((uint)(this.dirty ? PropPageStatus.Dirty : PropPageStatus.Clean));\n}\n}\n}\n@@ -269,7 +259,25 @@ namespace Microsoft.VisualStudioTools.Project\nvoid IPropertyPage.Activate(IntPtr hWndParent, RECT[] pRect, int bModal)\n{\n- NativeMethods.SetParent(this.Control.Handle, hWndParent);\n+ this.Control.Visible = false;\n+\n+ // suspend to reduce flashing\n+ this.Control.SuspendLayout();\n+\n+ try\n+ {\n+ var parent = Control.FromHandle(hWndParent);\n+ this.Control.Parent = parent;\n+\n+ // move to final location\n+ ((IPropertyPage)this).Move(pRect);\n+ }\n+ finally\n+ {\n+ this.Control.ResumeLayout();\n+ this.Control.Visible = true;\n+ this.Control.Focus();\n+ }\n}\nint IPropertyPage.Apply()\n@@ -309,6 +317,7 @@ namespace Microsoft.VisualStudioTools.Project\nvoid IPropertyPage.Help(string pszHelpDir)\n{\n+ // not implemented\n}\nint IPropertyPage.IsPageDirty()\n@@ -374,14 +383,24 @@ namespace Microsoft.VisualStudioTools.Project\nvoid IPropertyPage.SetPageSite(IPropertyPageSite pPageSite)\n{\n- this._site = pPageSite;\n+ this.site = pPageSite;\n}\nvoid IPropertyPage.Show(uint nCmdShow)\n{\n- this.Control.Visible = true; // TODO: pass SW_SHOW* flags through\n+ const int SW_HIDE = 0;\n+\n+ if (nCmdShow != SW_HIDE)\n+ {\n+ this.Control.Visible = true;\nthis.Control.Show();\n}\n+ else\n+ {\n+ this.Control.Visible = false;\n+ this.Control.Hide();\n+ }\n+ }\nint IPropertyPage.TranslateAccelerator(MSG[] pMsg)\n{\n@@ -389,12 +408,20 @@ namespace Microsoft.VisualStudioTools.Project\nvar msg = pMsg[0];\n- if ((msg.message < NativeMethods.WM_KEYFIRST || msg.message > NativeMethods.WM_KEYLAST) && (msg.message < NativeMethods.WM_MOUSEFIRST || msg.message > NativeMethods.WM_MOUSELAST))\n+ var message = Message.Create(msg.hwnd, (int)msg.message, msg.wParam, msg.lParam);\n+\n+ var target = Control.FromChildHandle(message.HWnd);\n+ if (target != null && target.PreProcessMessage(ref message))\n{\n- return VSConstants.S_FALSE;\n+ // handled the message\n+ pMsg[0].message = (uint)message.Msg;\n+ pMsg[0].wParam = message.WParam;\n+ pMsg[0].lParam = message.LParam;\n+\n+ return VSConstants.S_OK;\n}\n- return (NativeMethods.IsDialogMessageA(this.Control.Handle, ref msg)) ? VSConstants.S_OK : VSConstants.S_FALSE;\n+ return VSConstants.S_FALSE;\n}\n}\n}\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Correctly implement the IPropertyPage interface This way the property page scrolls to keep the focused control visible.
410,217
19.04.2017 14:41:28
25,200
71424b133546e2f07d2f61d39e8436709eb12ea0
Set Name property correctly for controls. Set the name property correctly for controls by pointing them to the associated label.
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Nodejs.csproj", "new_path": "Nodejs/Product/Nodejs/Nodejs.csproj", "diff": "<Reference Include=\"Microsoft.ApplicationInsights.PersistenceChannel, Version=1.2.3.490, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL\">\n<HintPath>..\\..\\packages\\Microsoft.ApplicationInsights.PersistenceChannel.1.2.3\\lib\\net45\\Microsoft.ApplicationInsights.PersistenceChannel.dll</HintPath>\n</Reference>\n- <Reference Include=\"Microsoft.VisualStudio.ImageCatalog, Version=$(VSTarget).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\" />\n- <Reference Include=\"Microsoft.VisualStudio.Imaging, Version=$(VSTarget).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\" />\n+ <Reference Include=\"Microsoft.VisualStudio.ImageCatalog, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\" />\n+ <Reference Include=\"Microsoft.VisualStudio.Imaging, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\" />\n<!--\nTemporarily freeze versions of some interop assemblies\nTODO: https://github.com/Microsoft/nodejstools/issues/759\n<Reference Include=\"Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n<EmbedInteropTypes>True</EmbedInteropTypes>\n</Reference>\n- <Reference Include=\"Microsoft.VisualStudio.Utilities, Version=$(VSTarget).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\" />\n+ <Reference Include=\"Microsoft.VisualStudio.Utilities, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\" />\n</ItemGroup>\n<ItemGroup>\n<Reference Include=\"envdte, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\">\n<Reference Include=\"Microsoft.CSharp\" />\n<Reference Include=\"Microsoft.JScript\" />\n<Reference Include=\"Microsoft.NodejsTools.Telemetry\">\n- <HintPath>..\\..\\Common\\Telemetry\\Microsoft.NodejsTools.Telemetry.$(VSTarget).dll</HintPath>\n+ <HintPath>..\\..\\Common\\Telemetry\\Microsoft.NodejsTools.Telemetry.15.0.dll</HintPath>\n</Reference>\n<Reference Include=\"microsoft.msxml, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n<EmbedInteropTypes>False</EmbedInteropTypes>\n<Reference Include=\"Microsoft.VisualStudio.Text.UI, Version=$(VSTarget).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\" />\n<Reference Include=\"Microsoft.VisualStudio.Text.UI.Wpf, Version=$(VSTarget).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\" />\n<Reference Include=\"Microsoft.VisualStudio.TextManager.Interop\" />\n- <Reference Include=\"Microsoft.VisualStudio.Shell.$(VSTarget), Version=$(VSTarget).0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\" />\n+ <Reference Include=\"Microsoft.VisualStudio.Shell.15.0, Version=15.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\" />\n<Reference Include=\"Microsoft.VisualStudio.TextManager.Interop.8.0, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a\" />\n<Reference Include=\"Microsoft.VisualStudio.WindowsAzure.CommonAzureTools.Contracts\">\n<SpecificVersion>False</SpecificVersion>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/NpmUI/NpmPackageInstallWindow.xaml.cs", "new_path": "Nodejs/Product/Nodejs/NpmUI/NpmPackageInstallWindow.xaml.cs", "diff": "@@ -5,6 +5,7 @@ using System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Input;\nusing Microsoft.NodejsTools.Npm;\n+using Microsoft.VisualStudio.PlatformUI;\nusing Microsoft.VisualStudioTools;\nnamespace Microsoft.NodejsTools.NpmUI\n@@ -12,7 +13,7 @@ namespace Microsoft.NodejsTools.NpmUI\n/// <summary>\n/// Interaction logic for NpmPackageInstallWindow.xaml\n/// </summary>\n- internal sealed partial class NpmPackageInstallWindow : DialogWindowVersioningWorkaround, IDisposable\n+ public sealed partial class NpmPackageInstallWindow : DialogWindow, IDisposable\n{\nprivate readonly NpmPackageInstallViewModel viewModel;\n@@ -120,8 +121,8 @@ namespace Microsoft.NodejsTools.NpmUI\nthis.DependencyComboBox.SelectedIndex = (int)DependencyType.Standard;\nthis.SaveToPackageJsonCheckbox.IsChecked = true;\n- this.ArgumentsTextBox.Text = string.Empty;\n- this.ArgumentsTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();\n+ this.OtherNpmArgumentsTextBox.Text = string.Empty;\n+ this.OtherNpmArgumentsTextBox.GetBindingExpression(TextBox.TextProperty).UpdateSource();\n}\nprivate void SelectedVersionComboBox_OnSelectionChanged(object sender, SelectionChangedEventArgs e)\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Set Name property correctly for controls. Set the name property correctly for controls by pointing them to the associated label.
410,217
21.04.2017 14:32:14
25,200
4f0e99630610f46305c2d5fcf33a207e4044d6ed
Add accessible name to browse buttons
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.cs.resx", "new_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.cs.resx", "diff": "<data name=\"_browsePath.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browsePath.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for node.exe</value>\n+ </data>\n<data name=\"&gt;&gt;_browsePath.Name\" xml:space=\"preserve\">\n<value>_browsePath</value>\n</data>\n<data name=\"_browseDirectory.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browseDirectory.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for working directory</value>\n+ </data>\n<data name=\"&gt;&gt;_browseDirectory.Name\" xml:space=\"preserve\">\n<value>_browseDirectory</value>\n</data>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.de.resx", "new_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.de.resx", "diff": "<data name=\"_browsePath.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browsePath.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for node.exe</value>\n+ </data>\n<data name=\"&gt;&gt;_browsePath.Name\" xml:space=\"preserve\">\n<value>_browsePath</value>\n</data>\n<data name=\"_browseDirectory.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browseDirectory.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for working directory</value>\n+ </data>\n<data name=\"&gt;&gt;_browseDirectory.Name\" xml:space=\"preserve\">\n<value>_browseDirectory</value>\n</data>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.en.resx", "new_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.en.resx", "diff": "<data name=\"_browsePath.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browsePath.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for node.exe</value>\n+ </data>\n<data name=\"&gt;&gt;_browsePath.Name\" xml:space=\"preserve\">\n<value>_browsePath</value>\n</data>\n<data name=\"_browseDirectory.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browseDirectory.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for working directory</value>\n+ </data>\n<data name=\"&gt;&gt;_browseDirectory.Name\" xml:space=\"preserve\">\n<value>_browseDirectory</value>\n</data>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.es.resx", "new_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.es.resx", "diff": "<data name=\"_browsePath.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browsePath.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for node.exe</value>\n+ </data>\n<data name=\"&gt;&gt;_browsePath.Name\" xml:space=\"preserve\">\n<value>_browsePath</value>\n</data>\n<data name=\"_browseDirectory.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browseDirectory.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for working directory</value>\n+ </data>\n<data name=\"&gt;&gt;_browseDirectory.Name\" xml:space=\"preserve\">\n<value>_browseDirectory</value>\n</data>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.fr.resx", "new_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.fr.resx", "diff": "<data name=\"_browsePath.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browsePath.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for node.exe</value>\n+ </data>\n<data name=\"&gt;&gt;_browsePath.Name\" xml:space=\"preserve\">\n<value>_browsePath</value>\n</data>\n<data name=\"_browseDirectory.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browseDirectory.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for working directory</value>\n+ </data>\n<data name=\"&gt;&gt;_browseDirectory.Name\" xml:space=\"preserve\">\n<value>_browseDirectory</value>\n</data>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.it.resx", "new_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.it.resx", "diff": "<data name=\"_browsePath.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browsePath.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for node.exe</value>\n+ </data>\n<data name=\"&gt;&gt;_browsePath.Name\" xml:space=\"preserve\">\n<value>_browsePath</value>\n</data>\n<data name=\"_browseDirectory.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browseDirectory.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for working directory</value>\n+ </data>\n<data name=\"&gt;&gt;_browseDirectory.Name\" xml:space=\"preserve\">\n<value>_browseDirectory</value>\n</data>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.ja.resx", "new_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.ja.resx", "diff": "<data name=\"_browsePath.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browsePath.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for node.exe</value>\n+ </data>\n<data name=\"&gt;&gt;_browsePath.Name\" xml:space=\"preserve\">\n<value>_browsePath</value>\n</data>\n<data name=\"_browseDirectory.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browseDirectory.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for working directory</value>\n+ </data>\n<data name=\"&gt;&gt;_browseDirectory.Name\" xml:space=\"preserve\">\n<value>_browseDirectory</value>\n</data>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.ko.resx", "new_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.ko.resx", "diff": "<data name=\"_browsePath.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browsePath.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for node.exe</value>\n+ </data>\n<data name=\"&gt;&gt;_browsePath.Name\" xml:space=\"preserve\">\n<value>_browsePath</value>\n</data>\n<data name=\"_browseDirectory.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browseDirectory.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for working directory</value>\n+ </data>\n<data name=\"&gt;&gt;_browseDirectory.Name\" xml:space=\"preserve\">\n<value>_browseDirectory</value>\n</data>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.pl.resx", "new_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.pl.resx", "diff": "<data name=\"_browsePath.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browsePath.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for node.exe</value>\n+ </data>\n<data name=\"&gt;&gt;_browsePath.Name\" xml:space=\"preserve\">\n<value>_browsePath</value>\n</data>\n<data name=\"_browseDirectory.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browseDirectory.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for working directory</value>\n+ </data>\n<data name=\"&gt;&gt;_browseDirectory.Name\" xml:space=\"preserve\">\n<value>_browseDirectory</value>\n</data>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.pt-BR.resx", "new_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.pt-BR.resx", "diff": "<data name=\"_browsePath.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browsePath.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for node.exe</value>\n+ </data>\n<data name=\"&gt;&gt;_browsePath.Name\" xml:space=\"preserve\">\n<value>_browsePath</value>\n</data>\n<data name=\"_browseDirectory.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browseDirectory.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for working directory</value>\n+ </data>\n<data name=\"&gt;&gt;_browseDirectory.Name\" xml:space=\"preserve\">\n<value>_browseDirectory</value>\n</data>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.ru.resx", "new_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.ru.resx", "diff": "<data name=\"_browsePath.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browsePath.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for node.exe</value>\n+ </data>\n<data name=\"&gt;&gt;_browsePath.Name\" xml:space=\"preserve\">\n<value>_browsePath</value>\n</data>\n<data name=\"_browseDirectory.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browseDirectory.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for working directory</value>\n+ </data>\n<data name=\"&gt;&gt;_browseDirectory.Name\" xml:space=\"preserve\">\n<value>_browseDirectory</value>\n</data>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.tr.resx", "new_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.tr.resx", "diff": "<data name=\"_browsePath.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browsePath.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for node.exe</value>\n+ </data>\n<data name=\"&gt;&gt;_browsePath.Name\" xml:space=\"preserve\">\n<value>_browsePath</value>\n</data>\n<data name=\"_browseDirectory.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browseDirectory.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for working directory</value>\n+ </data>\n<data name=\"&gt;&gt;_browseDirectory.Name\" xml:space=\"preserve\">\n<value>_browseDirectory</value>\n</data>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.zh-Hans.resx", "new_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.zh-Hans.resx", "diff": "<data name=\"_browsePath.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browsePath.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for node.exe</value>\n+ </data>\n<data name=\"&gt;&gt;_browsePath.Name\" xml:space=\"preserve\">\n<value>_browsePath</value>\n</data>\n<data name=\"_browseDirectory.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browseDirectory.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for working directory</value>\n+ </data>\n<data name=\"&gt;&gt;_browseDirectory.Name\" xml:space=\"preserve\">\n<value>_browseDirectory</value>\n</data>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.zh-Hant.resx", "new_path": "Nodejs/Product/Nodejs/Project/NodejsGeneralPropertyPageControl.zh-Hant.resx", "diff": "<data name=\"_browsePath.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browsePath.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for node.exe</value>\n+ </data>\n<data name=\"&gt;&gt;_browsePath.Name\" xml:space=\"preserve\">\n<value>_browsePath</value>\n</data>\n<data name=\"_browseDirectory.Text\" xml:space=\"preserve\">\n<value>...</value>\n</data>\n+ <data name=\"_browseDirectory.AccessibleName\" xml:space=\"preserve\">\n+ <value>Browse for working directory</value>\n+ </data>\n<data name=\"&gt;&gt;_browseDirectory.Name\" xml:space=\"preserve\">\n<value>_browseDirectory</value>\n</data>\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Add accessible name to browse buttons
410,217
21.04.2017 17:18:51
25,200
ac0d7d1d0b3f033b3fbb0855ca4c08d8aaaeb4b2
Fix narrator and tab order issues in Install NPM UI
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/NpmUI/NpmPackageInstallWindow.xaml", "new_path": "Nodejs/Product/Nodejs/NpmUI/NpmPackageInstallWindow.xaml", "diff": "<DataTemplate x:Key=\"PackageInfoTemplate\">\n<StackPanel x:Name=\"PackageInfo\">\n-\n- <TextBlock Margin=\"0\" x:Name=\"NpmPackageLabel\">\n+ <TextBlock Margin=\"0\" x:Name=\"NpmPackageLabel\" KeyboardNavigation.TabIndex=\"5\">\n<Run Text=\"{Binding Path=Name, Mode=OneWay}\" FontSize=\"15pt\" FontWeight=\"Bold\" />\n<Run Text=\"{Binding Path=Version, Mode=OneWay}\" />\n</TextBlock>\nTextWrapping=\"Wrap\"\nOpacity=\"0.5\" />\n- <StackPanel Orientation=\"Horizontal\" Margin=\"0 4 0 4\" x:Name=\"AuthorBlock\" Visibility=\"{Binding Path=AuthorVisibility, Mode=OneWay}\">\n+ <TextBlock Margin=\"0 4 0 4\" TextWrapping=\"Wrap\" x:Name=\"DescriptionBlock\" Visibility=\"{Binding Path=DescriptionVisibility, Mode=OneWay}\" KeyboardNavigation.TabIndex=\"6\">\n+ <Run FontWeight=\"Bold\" xml:space=\"preserve\" Text=\"{x:Static resx:NpmInstallWindowResources.DescriptionLabel}\" />\n+ <Run Text=\"{Binding Path=Description, Mode=OneWay}\"/>\n+ </TextBlock>\n+\n+ <StackPanel Orientation=\"Horizontal\" Margin=\"0 4 0 4\" x:Name=\"AuthorBlock\" Visibility=\"{Binding Path=AuthorVisibility, Mode=OneWay}\" KeyboardNavigation.TabIndex=\"7\">\n<TextBlock Margin=\"0\" FontWeight=\"Bold\" xml:space=\"preserve\" Text=\"{x:Static resx:NpmInstallWindowResources.AuthorLabel}\" />\n<TextBlock Text=\"{Binding Path=Author, Mode=OneWay}\"/>\n</StackPanel>\nContent=\"{Binding Mode=OneWay}\"\nCommand=\"{x:Static npmUi:NpmPackageInstallViewModel.OpenHomepageCommand}\"\nCommandParameter=\"{Binding}\"\n- KeyboardNavigation.IsTabStop=\"False\"\n+ KeyboardNavigation.TabIndex=\"8\"\nMargin=\"0\"\nPadding=\"0\"/>\n</DataTemplate>\n</ItemsControl.ItemTemplate>\n</ItemsControl>\n</StackPanel>\n-\n- <TextBlock Margin=\"0 4 0 4\" TextWrapping=\"Wrap\" x:Name=\"DescriptionBlock\" Visibility=\"{Binding Path=DescriptionVisibility, Mode=OneWay}\">\n- <Run FontWeight=\"Bold\" xml:space=\"preserve\" Text=\"{x:Static resx:NpmInstallWindowResources.DescriptionLabel}\" />\n- <Run Text=\"{Binding Path=Description, Mode=OneWay}\"/>\n- </TextBlock>\n</StackPanel>\n</DataTemplate>\nGrid.Column=\"1\"\nCommand=\"ApplicationCommands.Close\"\nIsCancel=\"True\"\n- KeyboardNavigation.TabIndex=\"10\"\n+ TabIndex=\"15\"\nContent=\"{x:Static resx:NpmInstallWindowResources.CloseButtonContent}\" />\n</Grid>\nHeight=\"24\"\nText=\"{Binding FilterText,UpdateSourceTrigger=PropertyChanged}\"\nPreviewKeyDown=\"FilterTextBox_PreviewKeyDown\"\n- KeyboardNavigation.TabIndex=\"0\"\n+ TabIndex=\"0\"\nAutomationProperties.Name=\"{x:Static resx:NpmInstallWindowResources.SearchForPackagesLabel}\" />\n<TextBlock IsEnabled=\"False\" Background=\"{x:Null}\"\nFocusable=\"False\"\nHorizontalContentAlignment=\"Stretch\"\nScrollViewer.HorizontalScrollBarVisibility=\"Disabled\"\nMinHeight=\"0\"\n- KeyboardNavigation.TabIndex=\"1\"\n+ TabIndex=\"2\"\nVisibility=\"{Binding PackageFilterState, Converter={wpf:Lambda '(NpmPackageInstallViewModel.FilterState b) => NpmPackageInstallViewModel.FilterState.ResultsAvailable == b ? Visibility.Visible : Visibility.Hidden'}}\" />\n<Border BorderBrush=\"{Binding ElementName=packageList, Path=BorderBrush}\"\nBorderThickness=\"{Binding ElementName=packageList,Path=BorderThickness}\">\n</Grid>\n</Border>\n</Grid>\n- <GridSplitter Grid.Column=\"1\" Grid.Row=\"0\" Grid.RowSpan=\"3\" Width=\"6\" Background=\"Transparent\" VerticalAlignment=\"Stretch\" HorizontalAlignment=\"Center\" ShowsPreview=\"True\" />\n+ <GridSplitter Grid.Column=\"1\" Grid.Row=\"0\" Grid.RowSpan=\"3\" Width=\"6\" Background=\"Transparent\" VerticalAlignment=\"Stretch\" HorizontalAlignment=\"Center\" ShowsPreview=\"True\" IsTabStop=\"False\" />\n<Grid Grid.Column=\"2\" Grid.RowSpan=\"2\" Margin=\"8 0 0 0\" >\n<Grid.RowDefinitions>\n</Grid.Style>\n<ScrollViewer VerticalScrollBarVisibility=\"Auto\"\nContent=\"{Binding Path=SelectedPackage}\"\n- ContentTemplate=\"{StaticResource PackageInfoTemplate}\" />\n+ ContentTemplate=\"{StaticResource PackageInfoTemplate}\"\n+ IsTabStop=\"True\" AutomationProperties.Name=\"{Binding Path=SelectedPackage.Name}\"\n+ TabIndex=\"3\" />\n<StackPanel Grid.Row=\"1\"\nOrientation=\"Vertical\"\n<TextBlock Grid.Row=\"1\" FontWeight=\"Bold\" Margin=\"0 4 0 4\" Text=\"{x:Static resx:NpmInstallWindowResources.OptionsLabel}\" />\n<Label Grid.Row=\"5\" HorizontalAlignment=\"Right\" VerticalAlignment=\"Center\" Content=\"{x:Static resx:NpmInstallWindowResources.OtherNpmArgumentsLabel}\" Name=\"OtherNpmArgumentsLabel\" />\n- <TextBox x:Name=\"OtherNpmArgumentsTextBox\" Grid.Column=\"1\" Grid.Row=\"5\" HorizontalAlignment=\"Stretch\" Text=\"{Binding Arguments}\" Margin=\"4\" TabIndex=\"6\">\n+ <TextBox x:Name=\"OtherNpmArgumentsTextBox\" Grid.Column=\"1\" Grid.Row=\"5\" HorizontalAlignment=\"Stretch\" Text=\"{Binding Arguments}\" Margin=\"4\" TabIndex=\"12\">\n<AutomationProperties.LabeledBy>\n<Binding ElementName=\"OtherNpmArgumentsLabel\" />\n</AutomationProperties.LabeledBy>\n</TextBox>\n<Label Grid.Row=\"3\" HorizontalAlignment=\"Right\" VerticalAlignment=\"Center\" Content=\"{x:Static resx:NpmInstallWindowResources.AddToPackageJsonLabel}\" x:Name=\"AddToPackageJsonLabel\"/>\n<CheckBox x:Name=\"SaveToPackageJsonCheckbox\" Grid.Column=\"1\" Grid.Row=\"3\" VerticalAlignment=\"Center\" HorizontalAlignment=\"Left\"\n- IsChecked=\"{Binding SaveToPackageJson}\" Margin=\"4\" TabIndex=\"4\" Content=\"{x:Static resx:NpmInstallWindowResources.AddToPackageJsonCheckboxLabel}\">\n+ IsChecked=\"{Binding SaveToPackageJson}\" Margin=\"4\" TabIndex=\"10\" Content=\"{x:Static resx:NpmInstallWindowResources.AddToPackageJsonCheckboxLabel}\">\n<AutomationProperties.LabeledBy>\n<Binding ElementName=\"AddToPackageJsonLabel\" />\n</AutomationProperties.LabeledBy>\nWidth=\"100\"\nMaxHeight=\"24\"\nMargin=\"4\"\n- KeyboardNavigation.TabIndex=\"3\" SelectedIndex=\"{Binding SelectedDependencyTypeIndex}\"\n+ KeyboardNavigation.TabIndex=\"9\" SelectedIndex=\"{Binding SelectedDependencyTypeIndex}\"\nHorizontalAlignment=\"Left\">\n<AutomationProperties.LabeledBy>\n<Binding ElementName=\"DependencyTypeLabel\" />\nGrid.Column=\"1\"\nSelectedItem=\"{Binding Path=SelectedVersion}\"\nSelectedIndex=\"0\"\n- KeyboardNavigation.TabIndex=\"5\"\n+ KeyboardNavigation.TabIndex=\"11\"\nSelectionChanged=\"SelectedVersionComboBox_OnSelectionChanged\"\nMargin=\"4\">\n<AutomationProperties.LabeledBy>\nHorizontalAlignment=\"Left\"\nCommand=\"{x:Static npmUi:NpmPackageInstallViewModel.InstallCommand}\"\nCommandParameter=\"{Binding SelectedPackage}\"\n- KeyboardNavigation.TabIndex=\"6\"\n+ KeyboardNavigation.TabIndex=\"13\"\nIsDefault=\"True\"\nContent=\"{x:Static resx:NpmInstallWindowResources.InstallPackageButtonLabel}\" />\n<Button Style=\"{StaticResource NavigationButton}\" VerticalAlignment=\"Center\" Margin=\"5 0 0 0\"\n- Click=\"ResetOptionsButton_Click\" KeyboardNavigation.TabIndex=\"7\"\n+ Click=\"ResetOptionsButton_Click\" KeyboardNavigation.TabIndex=\"14\"\nContent=\"{x:Static resx:NpmInstallWindowResources.ResetOptionsButtonLabel}\" />\n</StackPanel>\n</StackPanel>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/NpmUI/PackageCatalogEntryViewModel.cs", "new_path": "Nodejs/Product/Nodejs/NpmUI/PackageCatalogEntryViewModel.cs", "diff": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\n-using System.Windows;\nusing Microsoft.NodejsTools.Npm;\nnamespace Microsoft.NodejsTools.NpmUI\n@@ -26,10 +25,10 @@ namespace Microsoft.NodejsTools.NpmUI\n{\nthis.Name = name;\nthis.version = version;\n- this.AvailableVersions = availableVersions != null ? availableVersions.ToList() : new List<SemverVersion>();\n+ this.AvailableVersions = availableVersions ?? Enumerable.Empty<SemverVersion>();\nthis.Author = author;\nthis.Description = description;\n- this.Homepages = homepages != null ? homepages.ToList() : new List<string>();\n+ this.Homepages = homepages ?? Enumerable.Empty<string>();\nthis.Keywords = keywords;\nthis.localVersion = localVersion;\n}\n@@ -40,6 +39,11 @@ namespace Microsoft.NodejsTools.NpmUI\npublic string Description { get; }\npublic IEnumerable<string> Homepages { get; }\npublic string Keywords { get; }\n+\n+ public override string ToString()\n+ {\n+ return this.Name;\n+ }\n}\ninternal class ReadOnlyPackageCatalogEntryViewModel : PackageCatalogEntryViewModel\n@@ -49,7 +53,7 @@ namespace Microsoft.NodejsTools.NpmUI\npackage.Name ?? string.Empty,\npackage.Version,\npackage.AvailableVersions,\n- package.Author == null ? string.Empty : package.Author.ToString(),\n+ package.Author?.ToString() ?? string.Empty,\npackage.Description ?? string.Empty,\npackage.Homepages,\n(package.Keywords != null && package.Keywords.Any())\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Fix narrator and tab order issues in Install NPM UI
410,217
24.04.2017 11:46:34
25,200
928096f94844c506dc4053de41bc581bfcf7d7a1
Remove the options page for the diagnostics pane. We previously removed the diagnostics pane, now removing the options too.
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Logging/LiveLogger.cs", "new_path": "Nodejs/Product/Nodejs/Logging/LiveLogger.cs", "diff": "using System;\nusing System.Diagnostics;\nusing System.Globalization;\n-using Microsoft.NodejsTools.Options;\n-using Microsoft.VisualStudioTools.Project;\nnamespace Microsoft.NodejsTools.Logging\n{\n/// <summary>\n/// An efficient logger that logs diagnostic messages using Debug.WriteLine.\n- /// Additionally logs messages to the NTVS Diagnostics task pane if option is enabled.\n/// </summary>\ninternal sealed class LiveLogger\n{\nprivate static readonly LiveLogger Instance = new LiveLogger();\nprivate static readonly object _loggerLock = new object();\n- private NodejsDiagnosticsOptionsPage _diagnosticsOptions;\n-\nprivate LiveLogger()\n{\n}\n- private NodejsDiagnosticsOptionsPage DiagnosticsOptions\n- {\n- get\n- {\n- if (this._diagnosticsOptions == null && NodejsPackage.Instance != null)\n- {\n- this._diagnosticsOptions = NodejsPackage.Instance.DiagnosticsOptionsPage;\n- }\n- return this._diagnosticsOptions;\n- }\n- }\n-\npublic static void WriteLine(string message, Type category)\n{\nWriteLine(\"{0}: {1}\", category.Name, message);\n@@ -53,4 +36,3 @@ namespace Microsoft.NodejsTools.Logging\n}\n}\n}\n-\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Nodejs.csproj", "new_path": "Nodejs/Product/Nodejs/Nodejs.csproj", "diff": "<Compile Include=\"Logging\\NodejsToolsLogEvent.cs\" />\n<Compile Include=\"Logging\\NodejsToolsLogger.cs\" />\n<Compile Include=\"NodejsPackage.Debugger.cs\" />\n+ <Compile Include=\"NpmUI\\LastRefreshedMessageProvider.cs\" />\n<Compile Include=\"NpmUI\\NpmInstallOutputWindowResources.Designer.cs\">\n<AutoGen>True</AutoGen>\n<DesignTime>True</DesignTime>\n</Compile>\n<Compile Include=\"NpmUI\\PackageCatalogEntryViewModel.cs\" />\n<Compile Include=\"Options\\TypeScriptRegistrySwitches.cs\" />\n- <Compile Include=\"Options\\NodejsDiagnosticsOptionsPage.cs\">\n- <SubType>Component</SubType>\n- </Compile>\n<Compile Include=\"Options\\NodejsNpmOptionsPage.cs\">\n<SubType>Component</SubType>\n</Compile>\n<Compile Include=\"NodejsProjectConfig.cs\" />\n<Compile Include=\"NodejsToolsInstallPath.cs\" />\n<Compile Include=\"NpmUI\\ErrorHelper.cs\" />\n- <Compile Include=\"NpmUI\\LastRefreshedMessageProvider.cs\" />\n<Compile Include=\"Options\\NodejsDialogPage.cs\">\n<SubType>Component</SubType>\n</Compile>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/NodejsPackage.cs", "new_path": "Nodejs/Product/Nodejs/NodejsPackage.cs", "diff": "@@ -8,9 +8,6 @@ using System.Globalization;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.InteropServices;\n-using System.Text.RegularExpressions;\n-using System.Threading;\n-using System.Web.Script.Serialization;\nusing System.Windows.Forms;\nusing Microsoft.NodejsTools.Commands;\nusing Microsoft.NodejsTools.Debugger.DebugEngine;\n@@ -95,11 +92,9 @@ namespace Microsoft.NodejsTools\nInstance = this;\n}\n- public NodejsGeneralOptionsPage GeneralOptionsPage => (NodejsGeneralOptionsPage)GetDialogPage(typeof(NodejsGeneralOptionsPage));\n+ public NodejsGeneralOptionsPage GeneralOptionsPage => GetDialogPage<NodejsGeneralOptionsPage>();\n- public NodejsNpmOptionsPage NpmOptionsPage => (NodejsNpmOptionsPage)GetDialogPage(typeof(NodejsNpmOptionsPage));\n-\n- public NodejsDiagnosticsOptionsPage DiagnosticsOptionsPage => (NodejsDiagnosticsOptionsPage)GetDialogPage(typeof(NodejsDiagnosticsOptionsPage));\n+ public NodejsNpmOptionsPage NpmOptionsPage => GetDialogPage<NodejsNpmOptionsPage>();\npublic EnvDTE.DTE DTE => (EnvDTE.DTE)GetService(typeof(EnvDTE.DTE));\n@@ -310,6 +305,11 @@ namespace Microsoft.NodejsTools\nreturn base.GetService(serviceType);\n}\n+ private T GetDialogPage<T>() where T : NodejsDialogPage\n+ {\n+ return (T)GetDialogPage(typeof(T));\n+ }\n+\npublic string BrowseForDirectory(IntPtr owner, string initialDirectory = null)\n{\nvar uiShell = GetService(typeof(SVsUIShell)) as IVsUIShell;\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/NpmUI/NpmPackageInstallViewModel.cs", "new_path": "Nodejs/Product/Nodejs/NpmUI/NpmPackageInstallViewModel.cs", "diff": "@@ -11,7 +11,6 @@ using System.Windows;\nusing System.Windows.Input;\nusing System.Windows.Threading;\nusing Microsoft.NodejsTools.Npm;\n-using Microsoft.NodejsTools.Project;\nnamespace Microsoft.NodejsTools.NpmUI\n{\n" }, { "change_type": "DELETE", "old_path": "Nodejs/Product/Nodejs/Options/NodejsDiagnosticsOptionsPage.cs", "new_path": null, "diff": "-// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.\n-\n-namespace Microsoft.NodejsTools.Options\n-{\n- internal class NodejsDiagnosticsOptionsPage : NodejsDialogPage\n- {\n- private bool _isLiveDiagnosticsEnabled;\n- private const string IsLiveDiagnosticsEnabledSetting = \"IsLiveDiagnosticsEnabled\";\n-\n- public NodejsDiagnosticsOptionsPage() : base(\"Diagnostics\")\n- {\n- this._isLiveDiagnosticsEnabled = !NodejsPackage.Instance.Zombied && (LoadBool(IsLiveDiagnosticsEnabledSetting) ?? false);\n- }\n-\n- public bool IsLiveDiagnosticsEnabled\n- {\n- get\n- {\n- return !NodejsPackage.Instance.Zombied && this._isLiveDiagnosticsEnabled;\n- }\n- set\n- {\n- this._isLiveDiagnosticsEnabled = value;\n- SaveBool(IsLiveDiagnosticsEnabledSetting, value);\n- }\n- }\n- }\n-}\n-\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Remove the options page for the diagnostics pane. We previously removed the diagnostics pane, now removing the options too.
410,217
24.04.2017 14:50:20
25,200
c39ef640d46a79503fd5e2a6fc6bfc08273ad975
Replace packages.config with project.json This way we can use a wildcard for the version, which helps prevent issues when referencing MicroBuild packages.
[ { "change_type": "MODIFY", "old_path": "EnvironmentSetup.ps1", "new_path": "EnvironmentSetup.ps1", "diff": "@@ -68,7 +68,7 @@ if ($microbuild -or ($vstarget -eq \"15.0\" -and -not $skipRestore)) {\nWrite-Output \"\"\nWrite-Output \"Installing Nuget MicroBuild packages\"\n- & \"$rootdir\\Nodejs\\.nuget\\nuget.exe\" restore \"$rootdir\\Nodejs\\Setup\\swix\\packages.config\" -PackagesDirectory \"$packagedir\"\n+ & \"$rootdir\\Nodejs\\.nuget\\nuget.exe\" restore \"$rootdir\\Nodejs\\Setup\\swix\\project.json\" -PackagesDirectory \"$packagedir\" -ConfigFile \"$rootdir\\Nodejs\\.nuget\\nuget.config\"\n# If using the -microbuild switch, ONLY do the microbuild restore (this behavior is expected by the build servers).\nif($microbuild) {\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Setup/swix/Microsoft.VisualStudio.NodejsTools.Targets.swixproj", "new_path": "Nodejs/Setup/swix/Microsoft.VisualStudio.NodejsTools.Targets.swixproj", "diff": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n+\n+ <PropertyGroup>\n+ <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>\n+ </PropertyGroup>\n+\n<Import Project=\"..\\SetupProjectBefore.settings\" />\n<Import Project=\"$(PackagesPath)\\MicroBuild.Core.0.2.0\\build\\MicroBuild.Core.props\" />\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Setup/swix/NodejsTools.Profiling.vsmanproj", "new_path": "Nodejs/Setup/swix/NodejsTools.Profiling.vsmanproj", "diff": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"15.0\" DefaultTargets=\"Build\"\nxmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n+\n+ <PropertyGroup>\n+ <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>\n+ </PropertyGroup>\n+\n<Import Project=\"..\\SetupProjectBefore.settings\" />\n<PropertyGroup>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Setup/swix/NodejsTools.vsmanproj", "new_path": "Nodejs/Setup/swix/NodejsTools.vsmanproj", "diff": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<Project ToolsVersion=\"15.0\" DefaultTargets=\"Build\"\nxmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n+\n+ <PropertyGroup>\n+ <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>\n+ </PropertyGroup>\n+\n<Import Project=\"..\\SetupProjectBefore.settings\" />\n<PropertyGroup>\n" }, { "change_type": "DELETE", "old_path": "Nodejs/Setup/swix/packages.config", "new_path": null, "diff": "-<?xml version=\"1.0\" encoding=\"utf-8\"?>\n-<packages>\n- <package id=\"MicroBuild.Core\" version=\"0.2.0\"/>\n- <package id=\"MicroBuild.Plugins.SwixBuild\" version=\"1.0.115\"/>\n-</packages>\n\\ No newline at end of file\n" }, { "change_type": "ADD", "old_path": null, "new_path": "Nodejs/Setup/swix/project.json", "diff": "+{\n+ \"dependencies\": {\n+ \"MicroBuild.Core\": \"0.2.0\",\n+ \"MicroBuild.Plugins.SwixBuild\": \"1.0.*\"\n+ },\n+ \"frameworks\": {\n+ \"net461\": {}\n+ },\n+ \"runtimes\": {\n+ \"win\": {}\n+ }\n+}\n\\ No newline at end of file\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Replace packages.config with project.json This way we can use a wildcard for the version, which helps prevent issues when referencing MicroBuild packages.
410,217
25.04.2017 14:06:06
25,200
a9be2edb0cc90b96494d15a2f8e4394abf55cdea
Include an option to force the use of the chrome debugging protocol. This is to enable the chrome protocol on Node 7.5
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/NodejsProjectLauncher.cs", "new_path": "Nodejs/Product/Nodejs/Project/NodejsProjectLauncher.cs", "diff": "@@ -16,6 +16,7 @@ using System.Web;\nusing System.Windows.Forms;\nusing Microsoft.NodejsTools.Debugger;\nusing Microsoft.NodejsTools.Debugger.DebugEngine;\n+using Microsoft.NodejsTools.Options;\nusing Microsoft.NodejsTools.TypeScript;\nusing Microsoft.VisualStudio;\nusing Microsoft.VisualStudio.Shell;\n@@ -68,7 +69,7 @@ namespace Microsoft.NodejsTools.Project\nreturn VSConstants.S_OK;\n}\n- var chromeProtocolRequired = Nodejs.GetNodeVersion(nodePath) >= new Version(8, 0);\n+ var chromeProtocolRequired = Nodejs.GetNodeVersion(nodePath) >= new Version(8, 0) || CheckDebugProtocolOption();\nvar startBrowser = ShouldStartBrowser();\nif (debug && !chromeProtocolRequired)\n@@ -87,6 +88,13 @@ namespace Microsoft.NodejsTools.Project\nreturn VSConstants.S_OK;\n}\n+ private static bool CheckDebugProtocolOption()\n+ {\n+ var optionString = NodejsDialogPage.LoadString(name: \"DebugProtocol\", cat: \"Debugging\");\n+\n+ return StringComparer.OrdinalIgnoreCase.Equals(optionString, \"chrome\");\n+ }\n+\nprivate void StartAndAttachDebugger(string file, string nodePath)\n{\n// start the node process\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Include an option to force the use of the chrome debugging protocol. This is to enable the chrome protocol on Node 7.5
410,204
27.04.2017 16:04:49
25,200
c7339a9dfbe33908315830243f0536bd39c0aea0
Added support for WebKit V2 Debugger
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Nodejs.csproj", "new_path": "Nodejs/Product/Nodejs/Nodejs.csproj", "diff": "<Reference Include=\"Microsoft.VisualStudio.Imaging.Interop.14.0.DesignTime, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n<EmbedInteropTypes>True</EmbedInteropTypes>\n</Reference>\n+ <Reference Include=\"Microsoft.VisualStudio.Setup.Configuration.Interop, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n+ <HintPath>..\\..\\packages\\Microsoft.VisualStudio.Setup.Configuration.Interop.1.11.110\\lib\\net35\\Microsoft.VisualStudio.Setup.Configuration.Interop.dll</HintPath>\n+ <EmbedInteropTypes>True</EmbedInteropTypes>\n+ </Reference>\n<Reference Include=\"Microsoft.VisualStudio.Shell.Interop.14.0.DesignTime, Version=14.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL\">\n<EmbedInteropTypes>True</EmbedInteropTypes>\n</Reference>\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/NodejsProjectLauncher.cs", "new_path": "Nodejs/Product/Nodejs/Project/NodejsProjectLauncher.cs", "diff": "@@ -19,9 +19,11 @@ using Microsoft.NodejsTools.Debugger.DebugEngine;\nusing Microsoft.NodejsTools.Options;\nusing Microsoft.NodejsTools.TypeScript;\nusing Microsoft.VisualStudio;\n+using Microsoft.VisualStudio.Setup.Configuration;\nusing Microsoft.VisualStudio.Shell;\nusing Microsoft.VisualStudio.Shell.Interop;\nusing Microsoft.VisualStudioTools.Project;\n+using Newtonsoft.Json.Linq;\nnamespace Microsoft.NodejsTools.Project\n{\n@@ -32,6 +34,15 @@ namespace Microsoft.NodejsTools.Project\nprivate static readonly Guid WebkitDebuggerGuid = Guid.Parse(\"4cc6df14-0ab5-4a91-8bb4-eb0bf233d0fe\");\nprivate static readonly Guid WebkitPortSupplierGuid = Guid.Parse(\"4103f338-2255-40c0-acf5-7380e2bea13d\");\n+ private static readonly Guid WebKitDebuggerV2Guid = Guid.Parse(\"30d423cc-6d0b-4713-b92d-6b2a374c3d89\");\n+ private static readonly string PathToNode2DebugAdapterRuntime = Environment.ExpandEnvironmentVariables(@\"\"\"%ALLUSERSPROFILE%\\\" +\n+ $@\"Microsoft\\VisualStudio\\NodeAdapter\\{GetVisualStudioInstallationInstanceID()}\\out\\src\\nodeDebug.js\"\"\");\n+\n+ private static string GetVisualStudioInstallationInstanceID()\n+ {\n+ SetupConfiguration configuration = new SetupConfiguration();\n+ return configuration.GetInstanceForCurrentProcess().GetInstanceId();\n+ }\npublic NodejsProjectLauncher(NodejsProjectNode project)\n{\n@@ -46,7 +57,6 @@ namespace Microsoft.NodejsTools.Project\n}\n#region IProjectLauncher Members\n-\npublic int LaunchProject(bool debug)\n{\nNodejsPackage.Instance.Logger.LogEvent(Logging.NodejsToolsLogEvent.Launch, debug ? 1 : 0);\n@@ -77,9 +87,16 @@ namespace Microsoft.NodejsTools.Project\nStartWithDebugger(file);\n}\nelse if (debug && chromeProtocolRequired)\n+ {\n+ if (CheckUseNewChromeDebugProtocolOption())\n+ {\n+ StartWithChromeV2Debugger(file);\n+ }\n+ else\n{\nStartAndAttachDebugger(file, nodePath);\n}\n+ }\nelse\n{\nStartNodeProcess(file, nodePath, startBrowser);\n@@ -88,6 +105,13 @@ namespace Microsoft.NodejsTools.Project\nreturn VSConstants.S_OK;\n}\n+ private static bool CheckUseNewChromeDebugProtocolOption()\n+ {\n+ var optionString = NodejsDialogPage.LoadString(name: \"DebugProtocol\", cat: \"ChromeDebuggingVersion\");\n+\n+ return StringComparer.OrdinalIgnoreCase.Equals(optionString, \"V2\");\n+ }\n+\nprivate static bool CheckDebugProtocolOption()\n{\nvar optionString = NodejsDialogPage.LoadString(name: \"DebugProtocol\", cat: \"Debugging\");\n@@ -315,13 +339,45 @@ namespace Microsoft.NodejsTools.Project\n{\nvar dbgInfo = new VsDebugTargetInfo();\ndbgInfo.cbSize = (uint)Marshal.SizeOf(dbgInfo);\n-\nif (SetupDebugInfo(ref dbgInfo, startupFile))\n{\nLaunchDebugger(this._project.Site, dbgInfo);\n}\n}\n+ private void StartWithChromeV2Debugger(string program)\n+ {\n+ string cwd = Path.GetDirectoryName(program);\n+ JObject configuration = new JObject(\n+ new JProperty(\"name\", \"Debug Node.js program from Visual Studio\"),\n+ new JProperty(\"type\", \"node2\"),\n+ new JProperty(\"request\", \"launch\"),\n+ new JProperty(\"program\", program),\n+ new JProperty(\"cwd\", cwd),\n+ new JProperty(\"diagnosticLogging\", true),\n+ new JProperty(\"sourceMaps\", true),\n+ new JProperty(\"stopOnEntry\", true),\n+ new JProperty(\"$adapter\", PathToNode2DebugAdapterRuntime),\n+ new JProperty(\"$adapterRuntime\", \"node\"));\n+\n+ string jsonContent = configuration.ToString();\n+\n+ VsDebugTargetInfo4[] debugTargets = new VsDebugTargetInfo4[] {\n+ new VsDebugTargetInfo4() {\n+ dlo = (uint)DEBUG_LAUNCH_OPERATION.DLO_CreateProcess,\n+ guidLaunchDebugEngine = WebKitDebuggerV2Guid,\n+ bstrExe = program,\n+ bstrOptions = jsonContent\n+ }\n+ };\n+\n+ VsDebugTargetProcessInfo[] processInfo = new VsDebugTargetProcessInfo[debugTargets.Length];\n+\n+ var serviceProvider = _project.Site;\n+ var debugger = serviceProvider.GetService(typeof(SVsShellDebugger)) as IVsDebugger4;\n+ debugger.LaunchDebugTargets4(1, debugTargets, processInfo);\n+ }\n+\nprivate void LaunchDebugger(IServiceProvider provider, VsDebugTargetInfo dbgInfo)\n{\nif (!Directory.Exists(dbgInfo.bstrCurDir))\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/app.config", "new_path": "Nodejs/Product/Nodejs/app.config", "diff": "<assemblyIdentity name=\"Microsoft.ApplicationInsights\" publicKeyToken=\"31bf3856ad364e35\" culture=\"neutral\" />\n<bindingRedirect oldVersion=\"0.0.0.0-2.2.0.0\" newVersion=\"2.2.0.0\" />\n</dependentAssembly>\n+ <dependentAssembly>\n+ <assemblyIdentity name=\"Microsoft.VisualStudio.Validation\" publicKeyToken=\"b03f5f7f11d50a3a\" culture=\"neutral\" />\n+ <bindingRedirect oldVersion=\"0.0.0.0-15.0.0.0\" newVersion=\"15.0.0.0\" />\n+ </dependentAssembly>\n</assemblyBinding>\n</runtime>\n</configuration>\n\\ No newline at end of file\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/packages.config", "new_path": "Nodejs/Product/Nodejs/packages.config", "diff": "<packages>\n<package id=\"Microsoft.ApplicationInsights\" version=\"2.2.0\" targetFramework=\"net46\" />\n<package id=\"Microsoft.ApplicationInsights.PersistenceChannel\" version=\"1.2.3\" targetFramework=\"net46\" />\n+ <package id=\"Microsoft.VisualStudio.Setup.Configuration.Interop\" version=\"1.11.110\" targetFramework=\"net46\" developmentDependency=\"true\" />\n<package id=\"Microsoft.VisualStudio.Validation\" version=\"15.0.82\" targetFramework=\"net46\" />\n<package id=\"Microsoft.VisualStudio.Workspaces\" version=\"15.0.215-pre\" targetFramework=\"net46\" />\n<package id=\"Newtonsoft.Json\" version=\"8.0.3\" targetFramework=\"net46\" />\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Added support for WebKit V2 Debugger
410,217
28.04.2017 14:55:54
25,200
5d301325ee1d4365b5aed922684f159705dcc23b
Remove no longer needed projects.
[ { "change_type": "MODIFY", "old_path": "Nodejs/Setup/BuildRelease.ps1", "new_path": "Nodejs/Setup/BuildRelease.ps1", "diff": "@@ -148,7 +148,6 @@ $base_outdir = \"\\\\pytools\\Release\\Nodejs\"\n$version_file = gi \"$buildroot\\Nodejs\\Product\\AssemblyVersion.cs\"\n$build_project = gi \"$buildroot\\Nodejs\\dirs.proj\"\n-$setup_project = gi \"$buildroot\\Nodejs\\Setup\\setup.proj\"\n$setup_swix_project = gi \"$buildroot\\Nodejs\\Setup\\setup-swix.proj\"\n# Project metadata\n@@ -623,11 +622,6 @@ try {\nWrite-Output \"Begin Setup build for $($i.VSName)\"\n$target_msbuild_exe = msbuild-exe $i\n$target_msbuild_options = msbuild-options $i\n- & $target_msbuild_exe $global_msbuild_options $target_msbuild_options `\n- /fl /flp:logfile=$($i.signed_logfile) `\n- /p:SignedBinariesPath=$($i.signed_bindir) `\n- /p:RezipVSIXFiles=false `\n- $setup_project\n& $target_msbuild_exe $global_msbuild_options $target_msbuild_options `\n/fl /flp:logfile=$($i.signed_swix_logfile) `\n" }, { "change_type": "MODIFY", "old_path": "Nodejs/Setup/dirs.proj", "new_path": "Nodejs/Setup/dirs.proj", "diff": "<ItemGroup>\n<ProjectFile Include=\"..\\Product\\dirs.proj\"/>\n- <ProjectFile Include=\"setup.proj\"/>\n<ProjectFile Condition=\"$(VSTarget)=='15.0'\" Include=\"setup-swix.proj\"/>\n</ItemGroup>\n" }, { "change_type": "DELETE", "old_path": "Nodejs/Setup/setup.proj", "new_path": null, "diff": "-<Project DefaultTargets=\"Build\" xmlns=\"http://schemas.microsoft.com/developer/msbuild/2003\">\n-\n- <Import Project=\"SetupProjectBefore.settings\" />\n-\n- <!--\n- These properties are set in Common.Build.settings, but may be overridden on\n- the command line.\n-\n- <PropertyGroup>\n- <Configuration Condition=\"$(Configuration)==''\">Debug</Configuration>\n- <WixVersion Condition=\"$(WixVersion)==''\">0.7.4100.000</WixVersion>\n- <VSTarget Condition=\"$(VSTarget)==''\">10.0</VSTarget>\n- </PropertyGroup>\n- -->\n-\n- <ItemGroup>\n- <ProjectFile Include=\"InteractiveWindow\\InteractiveWindow.wixproj\"/>\n- <ProjectFile Include=\"Profiling\\Profiling.wixproj\"/>\n- <ProjectFile Include=\"NodejsTools\\NodejsTools.wixproj\"/>\n- <ProjectFile Include=\"NodejsToolsInstaller\\NodejsToolsInstaller.wixproj\"/>\n- </ItemGroup>\n-\n- <Import Project=\"$(TargetsPath)\\Common.Build.Traversal.targets\" />\n-\n- <Import Project=\"$(TargetsPath)\\Common.Build.VSSDK.targets\" Condition=\"'$(SignedBinariesPath)' != ''\"/>\n-</Project>\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Remove no longer needed projects.
410,217
28.04.2017 15:04:18
25,200
e513fac7a1fedadbda4f55c7b55d01c00873e798
Make sure we get the SetupConfiguration.
[ { "change_type": "MODIFY", "old_path": "Nodejs/Product/Nodejs/Project/NodejsProjectLauncher.cs", "new_path": "Nodejs/Product/Nodejs/Project/NodejsProjectLauncher.cs", "diff": "@@ -348,7 +348,7 @@ namespace Microsoft.NodejsTools.Project\n{\nvar serviceProvider = _project.Site;\n- var setupConfiguration = serviceProvider.GetService(typeof(SetupConfiguration)) as ISetupConfiguration2;\n+ var setupConfiguration = new SetupConfiguration();\nvar visualStudioInstallationInstanceID = setupConfiguration.GetInstanceForCurrentProcess().GetInstanceId();\n" } ]
C#
Apache License 2.0
microsoft/nodejstools
Make sure we get the SetupConfiguration.