Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

renamed lib to src for core-http #7507

Merged
merged 4 commits into from
Feb 26, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions sdk/core/core-http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,27 @@
"clientruntime"
],
"main": "./dist/coreHttp.node.js",
"module": "./es/lib/coreHttp.js",
"types": "./es/lib/coreHttp.d.ts",
"module": "./es/src/coreHttp.js",
"types": "./es/src/coreHttp.d.ts",
"files": [
"dist/**/*.node.js",
"dist/**/*.node.js.map",
"dom-shim.d.ts",
"es/lib/**/*.js",
"es/lib/**/*.js.map",
"es/lib/**/*.d.ts",
"es/lib/**/*.d.ts.map",
"lib/**/*.ts",
"es/src/**/*.js",
"es/src/**/*.js.map",
"es/src/**/*.d.ts",
"es/src/**/*.d.ts.map",
"src/**/*.ts",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's drop this line

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed this line "src/**/*.ts", Is that all?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're actually supposed to include the TS files in the package:
https://azure.github.io/azure-sdk/typescript_design.html#ts-config-sourceMap

Be sure to include your original TypeScript sources in the package.

"LICENSE",
"README.md"
],
"browser": {
"./es/lib/policies/msRestUserAgentPolicy.js": "./es/lib/policies/msRestUserAgentPolicy.browser.js",
"./es/lib/policies/proxyPolicy.js": "./es/lib/policies/proxyPolicy.browser.js",
"./es/lib/util/base64.js": "./es/lib/util/base64.browser.js",
"./es/lib/util/xml.js": "./es/lib/util/xml.browser.js",
"./es/lib/defaultHttpClient.js": "./es/lib/defaultHttpClient.browser.js",
"./es/lib/util/inspect.js": "./es/lib/util/inspect.browser.js"
"./es/src/policies/msRestUserAgentPolicy.js": "./es/src/policies/msRestUserAgentPolicy.browser.js",
"./es/src/policies/proxyPolicy.js": "./es/src/policies/proxyPolicy.browser.js",
"./es/src/util/base64.js": "./es/src/util/base64.browser.js",
"./es/src/util/xml.js": "./es/src/util/xml.browser.js",
"./es/src/defaultHttpClient.js": "./es/src/defaultHttpClient.browser.js",
"./es/src/util/inspect.js": "./es/src/util/inspect.browser.js"
},
"license": "MIT",
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/master/sdk/core/core-http",
Expand All @@ -66,15 +66,15 @@
"build:tsc": "tsc -p tsconfig.es.json",
"build:rollup": "rollup -c 2>&1",
"build:test-browser": "rollup -c rollup.test.config.js 2>&1",
"check-format": "prettier --list-different --config ../../.prettierrc.json \"lib/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"check-format": "prettier --list-different --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"clean": "rimraf ./es ./dist ./dist-test",
"execute:samples": "echo skipped",
"format": "prettier --write --config ../../.prettierrc.json \"lib/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"format": "prettier --write --config ../../.prettierrc.json \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"integration-test:browser": "echo skipped",
"integration-test:node": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
"lint:fix": "eslint package.json tsconfig.json \"lib/**/*.ts\" \"test/**/*.ts\" --fix --fix-type [problem,suggestion]",
"lint": "eslint package.json tsconfig.json lib test --ext .ts -f html -o core-http-lintReport.html || exit 0",
"lint:fix": "eslint package.json tsconfig.json \"src/**/*.ts\" \"test/**/*.ts\" --fix --fix-type [problem,suggestion]",
"lint": "eslint package.json tsconfig.json src test --ext .ts -f html -o core-http-lintReport.html || exit 0",
"pack": "npm pack 2>&1",
"prebuild": "npm run clean",
"test:browser": "npm run build:test && npm run unit-test:browser && npm run integration-test:browser",
Expand Down Expand Up @@ -112,7 +112,7 @@
"//metadata": {
"constantPaths": [
{
"path": "lib/util/constants.ts",
"path": "src/util/constants.ts",
"prefix": "coreHttpVersion"
}
]
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-http/rollup.base.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import viz from "rollup-plugin-visualizer";
const pkg = require("./package.json");
const depNames = Object.keys(pkg.dependencies);
const devDepNames = Object.keys(pkg.devDependencies);
const input = "./es/lib/coreHttp.js";
const input = "./es/src/coreHttp.js";
const production = process.env.NODE_ENV === "production";

export function nodeConfig(test = false) {
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-http/samples/node-sample.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

"use strict";

import * as coreHttp from "../lib/coreHttp";
import * as coreHttp from "../src/coreHttp";
const clientOptions: coreHttp.ServiceClientOptions = {
requestPolicyFactories: [coreHttp.logPolicy()]
};
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions sdk/core/core-http/test/credentialTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Licensed under the MIT License.

import "chai/register-should";
import * as msRest from "../lib/coreHttp";
import * as base64 from "../lib/util/base64";
import * as msRest from "../src/coreHttp";
import * as base64 from "../src/util/base64";
const BasicAuthenticationCredentials = msRest.BasicAuthenticationCredentials;
const ApiKeyCredentials = msRest.ApiKeyCredentials;
const fakeScheme = "fake-auth-scheme";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

"use strict";

import * as msRest from "../../../../lib/coreHttp";
import * as msRest from "../../../../src/coreHttp";
import { Mappers } from "./models/mappers";

/**
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-http/test/defaultHttpClientTests.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import "chai/register-should";

import { DefaultHttpClient } from "../lib/defaultHttpClient";
import { WebResource, TransferProgressEvent } from "../lib/webResource";
import { DefaultHttpClient } from "../src/defaultHttpClient";
import { WebResource, TransferProgressEvent } from "../src/webResource";
import { getHttpMock, HttpMockFacade } from "./mockHttp";

describe("defaultHttpClient (browser)", function() {
Expand Down
6 changes: 3 additions & 3 deletions sdk/core/core-http/test/defaultHttpClientTests.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@ import "chai/register-should";
import * as http from "http";
import { createReadStream } from "fs";

import { DefaultHttpClient } from "../lib/defaultHttpClient";
import { WebResource, TransferProgressEvent } from "../lib/webResource";
import { DefaultHttpClient } from "../src/defaultHttpClient";
import { WebResource, TransferProgressEvent } from "../src/webResource";
import { getHttpMock, HttpMockFacade } from "./mockHttp";
import { PassThrough } from "stream";
import { ReportTransform } from "../lib/fetchHttpClient";
import { ReportTransform } from "../src/fetchHttpClient";

describe("defaultHttpClient (node)", function() {
let httpMock: HttpMockFacade;
Expand Down
6 changes: 3 additions & 3 deletions sdk/core/core-http/test/defaultHttpClientTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { assert, AssertionError } from "chai";
import { AbortController } from "@azure/abort-controller";
import "chai/register-should";

import { DefaultHttpClient } from "../lib/defaultHttpClient";
import { RestError } from "../lib/restError";
import { WebResource, TransferProgressEvent } from "../lib/webResource";
import { DefaultHttpClient } from "../src/defaultHttpClient";
import { RestError } from "../src/restError";
import { WebResource, TransferProgressEvent } from "../src/webResource";
import { getHttpMock, HttpMockFacade } from "./mockHttp";

describe("defaultHttpClient", function() {
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-http/test/expiringAccessTokenCacheTests.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { assert } from "chai";
import { ExpiringAccessTokenCache } from "../lib/credentials/accessTokenCache";
import { ExpiringAccessTokenCache } from "../src/credentials/accessTokenCache";

function mockToken(expirationDeltaMs: number) {
return {
Expand Down
10 changes: 5 additions & 5 deletions sdk/core/core-http/test/logFilterTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// Licensed under the MIT License.

import { assert } from "chai";
import { HttpHeaders, RawHttpHeaders } from "../lib/httpHeaders";
import { HttpOperationResponse } from "../lib/httpOperationResponse";
import { LogPolicy, LogPolicyOptions } from "../lib/policies/logPolicy";
import { RequestPolicy, RequestPolicyOptions } from "../lib/policies/requestPolicy";
import { WebResource } from "../lib/webResource";
import { HttpHeaders, RawHttpHeaders } from "../src/httpHeaders";
import { HttpOperationResponse } from "../src/httpOperationResponse";
import { LogPolicy, LogPolicyOptions } from "../src/policies/logPolicy";
import { RequestPolicy, RequestPolicyOptions } from "../src/policies/requestPolicy";
import { WebResource } from "../src/webResource";
import { getLogLevel, setLogLevel, AzureLogLevel, Debugger } from "@azure/logger";

function getNextPolicy(responseHeaders?: RawHttpHeaders): RequestPolicy {
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-http/test/mockHttp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

import xhrMock, { proxy } from "xhr-mock";
import { isNode, HttpMethods } from "../lib/coreHttp";
import { isNode, HttpMethods } from "../src/coreHttp";
import fetchMock, * as fetch from "fetch-mock";
import { Readable } from "stream";

Expand Down
8 changes: 4 additions & 4 deletions sdk/core/core-http/test/msRestUserAgentPolicyTests.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

import "chai/register-should";

import { HttpOperationResponse } from "../lib/httpOperationResponse";
import { RequestPolicy, RequestPolicyOptions } from "../lib/policies/requestPolicy";
import { WebResource } from "../lib/webResource";
import { userAgentPolicy } from "../lib/policies/userAgentPolicy";
import { HttpOperationResponse } from "../src/httpOperationResponse";
import { RequestPolicy, RequestPolicyOptions } from "../src/policies/requestPolicy";
import { WebResource } from "../src/webResource";
import { userAgentPolicy } from "../src/policies/userAgentPolicy";

describe("MsRestUserAgentPolicy (browser)", () => {
describe("for browser", function() {
Expand Down
10 changes: 5 additions & 5 deletions sdk/core/core-http/test/msRestUserAgentPolicyTests.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

import "chai/register-should";

import { HttpOperationResponse } from "../lib/httpOperationResponse";
import { RequestPolicy, RequestPolicyOptions } from "../lib/policies/requestPolicy";
import { Constants } from "../lib/util/constants";
import { WebResource } from "../lib/webResource";
import { userAgentPolicy } from "../lib/policies/userAgentPolicy";
import { HttpOperationResponse } from "../src/httpOperationResponse";
import { RequestPolicy, RequestPolicyOptions } from "../src/policies/requestPolicy";
import { Constants } from "../src/util/constants";
import { WebResource } from "../src/webResource";
import { userAgentPolicy } from "../src/policies/userAgentPolicy";

const userAgentHeaderKey = Constants.HeaderConstants.USER_AGENT;

Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-http/test/operationParameterTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// Licensed under the MIT License.

import { assert } from "chai";
import { getPathStringFromParameter, OperationParameter } from "../lib/operationParameter";
import { getPathStringFromParameter, OperationParameter } from "../src/operationParameter";

describe("getParameterPathString()", () => {
it("should throw when given undefined", () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@

import { assert } from "chai";
import { fake } from "sinon";
import { OperationSpec } from "../../lib/operationSpec";
import { OperationSpec } from "../../src/operationSpec";
import { TokenCredential, GetTokenOptions, AccessToken } from "@azure/core-auth";
import { RequestPolicy, RequestPolicyOptions } from "../../lib/policies/requestPolicy";
import { Constants } from "../../lib/util/constants";
import { HttpOperationResponse } from "../../lib/httpOperationResponse";
import { HttpHeaders } from "../../lib/httpHeaders";
import { WebResource } from "../../lib/webResource";
import { BearerTokenAuthenticationPolicy } from "../../lib/policies/bearerTokenAuthenticationPolicy";
import { RequestPolicy, RequestPolicyOptions } from "../../src/policies/requestPolicy";
import { Constants } from "../../src/util/constants";
import { HttpOperationResponse } from "../../src/httpOperationResponse";
import { HttpHeaders } from "../../src/httpHeaders";
import { WebResource } from "../../src/webResource";
import { BearerTokenAuthenticationPolicy } from "../../src/policies/bearerTokenAuthenticationPolicy";
import {
ExpiringAccessTokenCache,
TokenRefreshBufferMs
} from "../../lib/credentials/accessTokenCache";
} from "../../src/credentials/accessTokenCache";

describe("BearerTokenAuthenticationPolicy", function() {
const mockPolicy: RequestPolicy = {
Expand Down
12 changes: 6 additions & 6 deletions sdk/core/core-http/test/policies/deserializationPolicyTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
// Licensed under the MIT License.

import { assert } from "chai";
import { HttpHeaders } from "../../lib/httpHeaders";
import { HttpOperationResponse } from "../../lib/httpOperationResponse";
import { HttpClient, OperationSpec, Serializer, CompositeMapper } from "../../lib/coreHttp";
import { HttpHeaders } from "../../src/httpHeaders";
import { HttpOperationResponse } from "../../src/httpOperationResponse";
import { HttpClient, OperationSpec, Serializer, CompositeMapper } from "../../src/coreHttp";
import {
DeserializationPolicy,
deserializationPolicy,
deserializeResponseBody,
defaultJsonContentTypes,
defaultXmlContentTypes
} from "../../lib/policies/deserializationPolicy";
import { RequestPolicy, RequestPolicyOptions } from "../../lib/policies/requestPolicy";
import { WebResource } from "../../lib/webResource";
} from "../../src/policies/deserializationPolicy";
import { RequestPolicy, RequestPolicyOptions } from "../../src/policies/requestPolicy";
import { WebResource } from "../../src/webResource";

describe("deserializationPolicy", function() {
const mockPolicy: RequestPolicy = {
Expand Down
10 changes: 5 additions & 5 deletions sdk/core/core-http/test/policies/proxyPolicyTests.browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@

import "chai/register-should";
import { should } from "chai";
import { ProxySettings } from "../../lib/serviceClient";
import { RequestPolicyOptions } from "../../lib/policies/requestPolicy";
import { WebResource } from "../../lib/webResource";
import { HttpHeaders } from "../../lib/httpHeaders";
import { ProxyPolicy, getDefaultProxySettings } from "../../lib/policies/proxyPolicy";
import { ProxySettings } from "../../src/serviceClient";
import { RequestPolicyOptions } from "../../src/policies/requestPolicy";
import { WebResource } from "../../src/webResource";
import { HttpHeaders } from "../../src/httpHeaders";
import { ProxyPolicy, getDefaultProxySettings } from "../../src/policies/proxyPolicy";

describe("ProxyPolicy (browser)", function() {
const proxySettings: ProxySettings = {
Expand Down
12 changes: 6 additions & 6 deletions sdk/core/core-http/test/policies/proxyPolicyTests.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@

import "chai/register-should";
import { should } from "chai";
import { ProxySettings } from "../../lib/serviceClient";
import { RequestPolicyOptions } from "../../lib/policies/requestPolicy";
import { WebResource } from "../../lib/webResource";
import { HttpHeaders } from "../../lib/httpHeaders";
import { proxyPolicy, ProxyPolicy, getDefaultProxySettings } from "../../lib/policies/proxyPolicy";
import { Constants } from "../../lib/coreHttp";
import { ProxySettings } from "../../src/serviceClient";
import { RequestPolicyOptions } from "../../src/policies/requestPolicy";
import { WebResource } from "../../src/webResource";
import { HttpHeaders } from "../../src/httpHeaders";
import { proxyPolicy, ProxyPolicy, getDefaultProxySettings } from "../../src/policies/proxyPolicy";
import { Constants } from "../../src/coreHttp";

describe("ProxyPolicy (node)", function() {
const proxySettings: ProxySettings = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

import { assert, AssertionError } from "chai";
import sinon from "sinon";
import { ThrottlingRetryPolicy } from "../../lib/policies/throttlingRetryPolicy";
import { WebResource } from "../../lib/webResource";
import { HttpOperationResponse } from "../../lib/httpOperationResponse";
import { HttpHeaders, RequestPolicyOptions } from "../../lib/coreHttp";
import { ThrottlingRetryPolicy } from "../../src/policies/throttlingRetryPolicy";
import { WebResource } from "../../src/webResource";
import { HttpOperationResponse } from "../../src/httpOperationResponse";
import { HttpHeaders, RequestPolicyOptions } from "../../src/coreHttp";

describe("ThrottlingRetryPolicy", () => {
class PassThroughPolicy {
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-http/test/policies/tracingPolicyTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import {
HttpOperationResponse,
HttpHeaders,
RequestPolicyOptions
} from "../../lib/coreHttp";
} from "../../src/coreHttp";
import { SpanOptions, SpanContext, TraceFlags } from "@opentelemetry/types";
import { setTracer, NoOpTracer, NoOpSpan } from "@azure/core-tracing";
import { tracingPolicy } from "../../lib/policies/tracingPolicy";
import { tracingPolicy } from "../../src/policies/tracingPolicy";

class MockSpan extends NoOpSpan {
private _endCalled = false;
Expand Down
10 changes: 5 additions & 5 deletions sdk/core/core-http/test/proxyAgent.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { should } from "chai";
import tunnel from "tunnel";
import https from "https";

import { HttpHeaders } from "../lib/coreHttp";
import { createProxyAgent, createTunnel } from "../lib/proxyAgent";
import { HttpHeaders } from "../src/coreHttp";
import { createProxyAgent, createTunnel } from "../src/proxyAgent";

describe("proxyAgent", () => {
describe("createProxyAgent", () => {
Expand Down Expand Up @@ -97,9 +97,9 @@ describe("proxyAgent", () => {
createProxyAgent("http://example.com", proxySettings);
};
fn.should.throw(
testCase.expectInvalidHostError?
"Expecting a non-empty host in proxy settings." :
"Expecting a valid port number in the range of [0, 65535] in proxy settings."
testCase.expectInvalidHostError
? "Expecting a non-empty host in proxy settings."
: "Expecting a valid port number in the range of [0, 65535] in proxy settings."
);
done();
});
Expand Down
8 changes: 4 additions & 4 deletions sdk/core/core-http/test/restError.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
// Licensed under the MIT License.

import { assert } from "chai";
import { RestError } from "../lib/restError";
import { WebResource } from "../lib/webResource";
import { HttpOperationResponse } from "../lib/httpOperationResponse";
import { RestError } from "../src/restError";
import { WebResource } from "../src/webResource";
import { HttpOperationResponse } from "../src/httpOperationResponse";
import { inspect } from "util";
import { HttpHeaders } from "../lib/coreHttp";
import { HttpHeaders } from "../src/coreHttp";

describe("RestError", function() {
it("serializes properly in node", function() {
Expand Down
4 changes: 2 additions & 2 deletions sdk/core/core-http/test/serializationTests.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

import "chai/register-should";

import { TestClient } from "./data/TestClient/lib/testClient";
import { Mappers } from "./data/TestClient/lib/models/mappers";
import { TestClient } from "./data/TestClient/src/testClient";
import { Mappers } from "./data/TestClient/src/models/mappers";

describe("msrest (node)", function() {
describe("deserialize", function() {
Expand Down
Loading