* Use esModuleInterop, etc

* Add rollup config

* Depend on uglify-js

* Bump to v1.0.0

* Update to v1.0.0

* Update changelog

* Replace npmignore with pkg.files

* Update lockfile and typescript version

* Update ts-node

* Fix 'main' field
This commit is contained in:
Rikki Gibson 2018-10-04 14:50:00 -07:00 коммит произвёл GitHub
Родитель 059b674068
Коммит 2fb7c939fe
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
12 изменённых файлов: 166 добавлений и 3329 удалений

6
.gitignore поставляемый
Просмотреть файл

@ -87,7 +87,11 @@ output/*
.nyc_output/
coverage/
dist/
typings/
*.d.ts
*.d.ts.map
*.js
*.js.map
# Rollup
!rollup.config.js
*-stats.html

Просмотреть файл

@ -1,19 +0,0 @@
!dist/lib/**/*.js
!es/lib/**/*.js
!typings/lib/**/*.d.ts
.vscode/
.idea/
.nyc_output/
coverage/
samples/
lib/
test/
.travis.yml
.gitignore
gulpfile.js
.git
.DS_Store
tsconfig.json
tslint.json
webpack.config.ts
*.js.map

Просмотреть файл

@ -1,14 +1,23 @@
### 1.0.0 - 2018/10/04
- Moved to rollup for bundling
- Moved browser bundle from ./msRestAzureBundle.js to ./dist/msRestAzure.js (same bundle for nodejs and browser)
### 0.2.8 - 2017/04/02
- Updated ms-rest-js to 0.2.8
- Added CognitiveServicesCredentials
### 0.2.1 - 2017/10/25
- Updating the minimum version of dependency "ms-rest-js": "^0.2.3". This brings in the change (removal of "bodyAsStream" property) done to HttpOperationResponse class
### 0.2.0 - 2017/10/11
- Updating the minimum version of dependency "ms-rest-js": "^0.2.1". This also gets a strict dependency to "moment" version 2.18.1 as 2.19.0 has bugs.
### 0.1.0 - 2017/09/16
- Initial version of the isomorphic azure runtime along with type definitions that works in the browser as well as the node.js environment
- Supports polling for long running operations
- Provides definition of CloudError

3333
package-lock.json сгенерированный

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -5,7 +5,7 @@
"email": "azsdkteam@microsoft.com",
"url": "https://github.com/Azure/ms-rest-azure-js"
},
"version": "0.17.0",
"version": "1.0.0",
"description": "Isomorphic Azure client runtime for Typescript/node.js/browser javascript client libraries generated using AutoRest",
"tags": [
"isomorphic",
@ -25,12 +25,23 @@
"autorest",
"clientruntime"
],
"main": "./dist/lib/msRestAzure.js",
"main": "./dist/msRestAzure.js",
"browser": "./es/lib/msRestAzure.js",
"types": "./typings/lib/msRestAzure.d.ts",
"types": "./es/lib/msRestAzure.d.ts",
"files": [
"dist/**/*.js",
"dist/**/*.js.map",
"es/lib/**/*.js",
"es/lib/**/*.js.map",
"es/lib/**/*.d.ts",
"es/lib/**/*.d.ts.map",
"lib/**/*.ts",
"LICENSE",
"README.md"
],
"license": "MIT",
"dependencies": {
"ms-rest-js": "~0.22.422",
"ms-rest-js": "^1.0.439",
"tslib": "^1.9.2"
},
"devDependencies": {
@ -41,13 +52,15 @@
"mocha": "^5.2.0",
"npm-run-all": "^4.1.2",
"nyc": "^12.0.2",
"rollup": "^0.66.4",
"rollup-plugin-node-resolve": "^3.4.0",
"rollup-plugin-visualizer": "^0.9.2",
"shx": "^0.2.2",
"ts-loader": "^2.3.7",
"ts-node": "^5.0.1",
"ts-node": "^7.0.1",
"tslint": "^5.7.0",
"typescript": "^3.0.3",
"uglify-es": "^3.1.0",
"webpack": "^3.6.0",
"typescript": "^3.1.1",
"uglify-js": "^3.4.9",
"yarn": "^1.6.0"
},
"homepage": "https://github.com/Azure/ms-rest-azure-js",
@ -75,13 +88,12 @@
"all": true
},
"scripts": {
"build": "run-p build:scripts build:node build:es build:browser",
"build": "run-p build:scripts build:lib",
"build:scripts": "tsc -p ./.scripts/",
"build:node": "tsc",
"build:es": "tsc -p tsconfig.es.json",
"build:browser": "webpack && node node_modules/uglify-es/bin/uglifyjs --source-map -c -m -o msRestAzureBundle.min.js msRestAzureBundle.js",
"watch:node": "tsc -w",
"watch:browser": "webpack -w",
"build:lib": "run-s build:tsc build:rollup build:minify",
"build:tsc": "tsc -p tsconfig.es.json",
"build:rollup": "rollup -c rollup.config.js",
"build:minify": "uglifyjs -c -m --comments --source-map \"content='./dist/msRestAzure.js.map'\" -o ./dist/msRestAzure.min.js ./dist/msRestAzure.js",
"test": "run-p test:tslint test:unit",
"test:unit": "nyc mocha",
"test:tslint": "tslint -p . -c tslint.json --exclude test/**/*.ts",

31
rollup.config.js Normal file
Просмотреть файл

@ -0,0 +1,31 @@
import nodeResolve from "rollup-plugin-node-resolve";
import visualizer from "rollup-plugin-visualizer";
const banner = `/** @license ms-rest-azure-js
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*/`;
/**
* @type {import('rollup').RollupFileOptions}
*/
const config = {
input: './es/lib/msRestAzure.js',
external: ["ms-rest-js"],
output: {
file: "./dist/msRestAzure.js",
format: "umd",
name: "msRestAzure",
sourcemap: true,
globals: {
"ms-rest-js": "msRest"
},
banner
},
plugins: [
nodeResolve({ module: true }),
visualizer({ filename: "dist/node-stats.html", sourcemap: true })
]
}
export default config;

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
import * as assert from "assert";
import assert from "assert";
import { HttpHeaders, HttpOperationResponse, RequestOptionsBase, RestError, TokenCredentials, WebResource, OperationArguments, OperationSpec, Serializer } from "ms-rest-js";
import { AzureServiceClient, AzureServiceClientOptions, updateOptionsWithDefaultValues } from "../lib/azureServiceClient";
import * as msAssert from "./msAssert";

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
import * as assert from "assert";
import assert from "assert";
import { WebResource } from "ms-rest-js";
import { CognitiveServicesCredentials } from "../../lib/credentials/cognitiveServicesCredentials";
import * as msAssert from "../msAssert";

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
import * as assert from "assert";
import assert from "assert";
import { HttpHeaders, HttpOperationResponse, TokenCredentials, WebResource } from "ms-rest-js";
import { AzureServiceClient } from "../lib/azureServiceClient";
import { getDelayInSeconds } from "../lib/lroPollStrategy";

Просмотреть файл

@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
import * as assert from "assert";
import assert from "assert";
/**
* Assert that the provided syncFunction throws an Error. If the expectedError is undefined, then

Просмотреть файл

@ -12,8 +12,10 @@
"outDir": "dist",
"strict": true,
"declaration": true,
"declarationDir": "./typings",
"declarationMap": true,
"importHelpers": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"lib": [
"dom",
"dom.iterable",

Просмотреть файл

@ -1,45 +0,0 @@
const webpack = require('webpack');
const path = require('path');
module.exports = {
entry: './lib/msRestAzure.ts',
devtool: 'source-map',
output: {
filename: 'msRestAzureBundle.js',
path: __dirname,
libraryTarget: 'var',
library: 'msRestAzure'
},
plugins: [
new webpack.IgnorePlugin(/^\.\/locale$/, /moment$/)
],
module: {
rules: [
{
test: /\.tsx?$/,
loader: 'ts-loader',
exclude: /(node_modules|test)/,
options: { configFile: path.join(__dirname, './tsconfig.es.json') }
}
]
},
// ms-rest-js is a dependency of this project. Customer is expected to manually import/include
// this for browser javascript in a script tag. More info over here
// https://webpack.js.org/configuration/externals/ and https://webpack.js.org/guides/author-libraries/#add-externals.
externals: {
"ms-rest-js": "msRest"
},
resolve: {
extensions: [".tsx", ".ts", ".js"]
},
node: {
fs: false,
net: false,
path: false,
dns: false,
tls: false,
tty: false,
v8: false,
Buffer: false
}
};