From 4956e1abc0de3c68a55fa01c39d00bcc90d59155 Mon Sep 17 00:00:00 2001 From: Steve Faulkner Date: Tue, 4 Dec 2018 17:37:34 -0800 Subject: [PATCH] 2.1.1 (#204) By importing package.json to grab the version, Typescript changes the emitted folder structure so this change also fixes those issues --- package.json | 8 ++++---- src/common/constants.ts | 4 +++- tsconfig.json | 3 ++- tslint.json | 3 +++ webpack.config.js | 2 +- 5 files changed, 13 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 2821b42e..0bac6215 100644 --- a/package.json +++ b/package.json @@ -11,10 +11,10 @@ "database", "cloud" ], - "version": "2.1.0", + "version": "2.1.1", "author": "Microsoft Corporation", - "main": "./lib/index.js", - "types": "./lib/index.d.ts", + "main": "./lib/src/index.js", + "types": "./lib/src/index.d.ts", "engine": { "node": ">=6.0.0" }, @@ -31,7 +31,7 @@ "webpack-prod": "webpack -p", "build": "npm run clean && npm run check-format && npm run lint && npm run compile && npm run docs && npm run webpack", "build-prod": "npm run clean && npm run check-format && npm run lint && npm run compile-prod && npm run docs && npm run webpack-prod", - "test": "mocha -r ./src/test/common/setup.ts ./lib/test/ --recursive --timeout 100000 -i -g .*ignore.js", + "test": "mocha -r ./src/test/common/setup.ts ./lib/src/test/ --recursive --timeout 100000 -i -g .*ignore.js", "test-ts": "mocha -r ts-node/register -r ./src/test/common/setup.ts ./src/test/**/*.spec.ts --recursive --timeout 100000 -i -g .*ignore.js", "test-browser": "karma start ./karma.config.js --single-run", "ci": "npm run build && npm run test && node ts-test.js" diff --git a/src/common/constants.ts b/src/common/constants.ts index b836e556..33a82ad0 100644 --- a/src/common/constants.ts +++ b/src/common/constants.ts @@ -1,3 +1,5 @@ +import { version } from "../../package.json"; + export const Constants = { MediaTypes: { Any: "*/*", @@ -176,7 +178,7 @@ export const Constants = { CurrentVersion: "2018-06-18", SDKName: "azure-cosmos-js", - SDKVersion: "2.0.5", + SDKVersion: version, DefaultPrecisions: { DefaultNumberHashPrecision: 3, diff --git a/tsconfig.json b/tsconfig.json index f26d956e..36522c6e 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,7 +12,8 @@ "removeComments": false, "target": "es6", "sourceMap": true, - "newLine": "LF" + "newLine": "LF", + "resolveJsonModule": true }, "include": ["./src/**/*", "./test/**/*.spec.ts", "./samples/MultiRegionWrite/**.ts"], "exclude": ["node_modules", "samples"] diff --git a/tslint.json b/tslint.json index dbb873a8..19c995a4 100644 --- a/tslint.json +++ b/tslint.json @@ -8,5 +8,8 @@ "member-ordering": false, // TODO: might want to look at this eventually... "no-floating-promises": true, "import-blacklist": [true, "assert", "util"] + }, + "linterOptions": { + "exclude": ["*.json"] } } diff --git a/webpack.config.js b/webpack.config.js index 71518dc3..d43093b4 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -2,7 +2,7 @@ var path = require("path"); var webpack = require("webpack"); module.exports = (env, argv) => ({ - entry: "./lib/index.js", + entry: "./lib/src/index.js", node: { buffer: true, net: "mock",