diff --git a/sdk/core/core-http-compat/config/tsconfig.src.browser.json b/sdk/core/core-http-compat/config/tsconfig.src.browser.json new file mode 100644 index 000000000000..429817e79b26 --- /dev/null +++ b/sdk/core/core-http-compat/config/tsconfig.src.browser.json @@ -0,0 +1,4 @@ +{ + "extends": "../../../../eng/tsconfigs/src.browser.json", + "include": ["../src/index.ts"] +} diff --git a/sdk/core/core-http-compat/config/tsconfig.src.react-native.json b/sdk/core/core-http-compat/config/tsconfig.src.react-native.json new file mode 100644 index 000000000000..931bc65e3b5f --- /dev/null +++ b/sdk/core/core-http-compat/config/tsconfig.src.react-native.json @@ -0,0 +1,4 @@ +{ + "extends": "../../../../eng/tsconfigs/src.react-native.json", + "include": ["../src/index.ts"] +} diff --git a/sdk/core/core-http-compat/config/tsconfig.test.browser.json b/sdk/core/core-http-compat/config/tsconfig.test.browser.json new file mode 100644 index 000000000000..c6e8d34ea255 --- /dev/null +++ b/sdk/core/core-http-compat/config/tsconfig.test.browser.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../../eng/tsconfigs/test.browser.json", + "compilerOptions": { + "paths": { + "@azure/core-http-compat": ["../src/index.ts"], + "@azure/core-http-compat/*": ["../src/*"], + "$internal/*": ["../src/*"] + } + } +} diff --git a/sdk/core/core-http-compat/config/tsconfig.test.react-native.json b/sdk/core/core-http-compat/config/tsconfig.test.react-native.json new file mode 100644 index 000000000000..d4a4a4403de0 --- /dev/null +++ b/sdk/core/core-http-compat/config/tsconfig.test.react-native.json @@ -0,0 +1,10 @@ +{ + "extends": "../../../../eng/tsconfigs/test.react-native.json", + "compilerOptions": { + "paths": { + "@azure/core-http-compat": ["../src/index.ts"], + "@azure/core-http-compat/*": ["../src/*"], + "$internal/*": ["../src/*"] + } + } +} diff --git a/sdk/core/core-http-compat/eslint.config.mjs b/sdk/core/core-http-compat/eslint.config.mjs new file mode 100644 index 000000000000..dac33e2cdf60 --- /dev/null +++ b/sdk/core/core-http-compat/eslint.config.mjs @@ -0,0 +1,14 @@ +import azsdkEslint from "@azure/eslint-plugin-azure-sdk"; + +export default [ + ...azsdkEslint.config([]), + { + files: ["src/**/*.ts", "src/**/*.mts", "test/**/*.ts"], + languageOptions: { + parserOptions: { + projectService: false, + project: "./config/tsconfig.lint.json", + }, + }, + }, +]; diff --git a/sdk/core/core-http-compat/package.json b/sdk/core/core-http-compat/package.json index 0d707d11e9d4..5104de3f84b5 100644 --- a/sdk/core/core-http-compat/package.json +++ b/sdk/core/core-http-compat/package.json @@ -52,7 +52,7 @@ "engines": { "node": ">=20.0.0" }, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/core-http-compat/README.md", + "homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-http-compat/", "sideEffects": false, "prettier": "@azure/eslint-plugin-azure-sdk/prettier.json", "scripts": { @@ -66,9 +66,9 @@ "lint": "eslint package.json src test", "lint:fix": "eslint package.json src test --fix --fix-type [problem,suggestion]", "pack": "pnpm pack 2>&1", - "test": "npm run test:node && npm run test:browser", - "test:browser": "npm run clean && dev-tool run build-package && dev-tool run build-test && dev-tool run test:vitest --no-test-proxy --browser", - "test:node": "dev-tool run build-test --no-browser-test && dev-tool run test:vitest --no-test-proxy", + "test": "tsc -b --noEmit && npm run test:node && npm run test:browser", + "test:browser": "dev-tool run test:vitest --no-test-proxy --browser", + "test:node": "dev-tool run test:vitest --no-test-proxy", "update-snippets": "dev-tool run update-snippets" }, "dependencies": { diff --git a/sdk/core/core-http-compat/tsconfig.browser.config.json b/sdk/core/core-http-compat/tsconfig.browser.config.json deleted file mode 100644 index dcff28d27cae..000000000000 --- a/sdk/core/core-http-compat/tsconfig.browser.config.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../../../tsconfig.browser.base.json", - "compilerOptions": { - "paths": { - "@azure/core-http-compat": ["./dist/browser/index.d.ts"], - "@azure/core-http-compat/*": ["./dist/browser/*"], - "$internal/*": ["./dist/browser/*"] - } - } -} diff --git a/sdk/core/core-http-compat/tsconfig.json b/sdk/core/core-http-compat/tsconfig.json index d466f1460665..5f3640a32e74 100644 --- a/sdk/core/core-http-compat/tsconfig.json +++ b/sdk/core/core-http-compat/tsconfig.json @@ -1,17 +1,13 @@ { "references": [ - { - "path": "./tsconfig.src.json" - }, - { - "path": "./tsconfig.samples.json" - }, - { - "path": "./tsconfig.test.json" - }, - { - "path": "./tsconfig.snippets.json" - } + { "path": "./config/tsconfig.src.esm.json" }, + { "path": "./config/tsconfig.src.browser.json" }, + { "path": "./config/tsconfig.src.react-native.json" }, + { "path": "./config/tsconfig.src.cjs.json" }, + { "path": "./config/tsconfig.test.node.json" }, + { "path": "./config/tsconfig.test.browser.json" }, + { "path": "./config/tsconfig.test.react-native.json" }, + { "path": "./config/tsconfig.snippets.json" } ], "files": [] } diff --git a/sdk/core/core-http-compat/tsconfig.samples.json b/sdk/core/core-http-compat/tsconfig.samples.json deleted file mode 100644 index bee57652d853..000000000000 --- a/sdk/core/core-http-compat/tsconfig.samples.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "extends": "../../../tsconfig.samples.base.json", - "compilerOptions": { - "paths": { - "@azure/core-http-compat": ["./dist/esm"] - } - } -} diff --git a/sdk/core/core-http-compat/tsconfig.snippets.json b/sdk/core/core-http-compat/tsconfig.snippets.json deleted file mode 100644 index 6f3148b5ed97..000000000000 --- a/sdk/core/core-http-compat/tsconfig.snippets.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["../../../tsconfig.snippets.base.json"] -} diff --git a/sdk/core/core-http-compat/tsconfig.src.json b/sdk/core/core-http-compat/tsconfig.src.json deleted file mode 100644 index bae70752dd38..000000000000 --- a/sdk/core/core-http-compat/tsconfig.src.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "../../../tsconfig.lib.json" -} diff --git a/sdk/core/core-http-compat/tsconfig.test.json b/sdk/core/core-http-compat/tsconfig.test.json deleted file mode 100644 index 42798ad68913..000000000000 --- a/sdk/core/core-http-compat/tsconfig.test.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "references": [ - { - "path": "./tsconfig.test.node.json" - }, - { - "path": "./tsconfig.browser.config.json" - } - ], - "compilerOptions": { - "composite": true - }, - "files": [] -} diff --git a/sdk/core/core-http-compat/tsconfig.test.node.json b/sdk/core/core-http-compat/tsconfig.test.node.json deleted file mode 100644 index 448a8da81ace..000000000000 --- a/sdk/core/core-http-compat/tsconfig.test.node.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": "../../../tsconfig.test.node.base.json", - "compilerOptions": { - "paths": { - "@azure/core-http-compat": ["./src/index.ts"], - "@azure/core-http-compat/*": ["./src/*"], - "$internal/*": ["./src/*"] - } - } -} diff --git a/sdk/core/core-http-compat/vitest.browser.config.ts b/sdk/core/core-http-compat/vitest.browser.config.ts index 0a70e125386f..3005cfd05093 100644 --- a/sdk/core/core-http-compat/vitest.browser.config.ts +++ b/sdk/core/core-http-compat/vitest.browser.config.ts @@ -1,6 +1,4 @@ // Copyright (c) Microsoft Corporation. // Licensed under the MIT License. -import viteConfig from "../../../vitest.browser.base.config.ts"; - -export default viteConfig; +export { default } from "../../../eng/vitestconfigs/browser.config.ts"; diff --git a/sdk/core/core-http-compat/warp.config.yml b/sdk/core/core-http-compat/warp.config.yml index 544a1a46ce20..4a31474ea2f4 100644 --- a/sdk/core/core-http-compat/warp.config.yml +++ b/sdk/core/core-http-compat/warp.config.yml @@ -1 +1,17 @@ extends: ../../../warp.base.config.yml + +targets: + - name: browser + tsconfig: "./config/tsconfig.src.browser.json" + + - name: react-native + tsconfig: "./config/tsconfig.src.react-native.json" + + - name: esm + condition: import + tsconfig: "./config/tsconfig.src.esm.json" + + - name: commonjs + condition: require + tsconfig: "./config/tsconfig.src.cjs.json" + moduleType: commonjs