Skip to content

Commit

Permalink
[core] Reinstate "browser" package.json field (#28961)
Browse files Browse the repository at this point in the history
### Describe the problem that is addressed by this PR

Re-adds "browser" field to `package.json` to support
older bundlers that do not have support for the more modern "exports"
field added in Node 14.
  • Loading branch information
timovv authored Mar 19, 2024
1 parent 38703fd commit 83c8b4a
Show file tree
Hide file tree
Showing 30 changed files with 41 additions and 10 deletions.
2 changes: 2 additions & 0 deletions sdk/core/abort-controller/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### Other Changes

- Add top-level `browser` field to `package.json` as fallback for legacy bundlers that do not support the `exports` field.

## 2.1.0 (2024-03-12)

### Other Changes
Expand Down
1 change: 1 addition & 0 deletions sdk/core/abort-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"sideEffects": false,
"type": "module",
"main": "./dist/commonjs/index.js",
"browser": "./dist/browser/index.js",
"exports": {
"./package.json": "./package.json",
".": {
Expand Down
3 changes: 3 additions & 0 deletions sdk/core/core-auth/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### Other Changes

- Add top-level `browser` field to `package.json` as fallback for legacy bundlers that do not support the `exports` field.

## 1.7.0 (2024-03-12)

### Other Changes
Expand All @@ -32,6 +34,7 @@
### Features Added

- Added `enableCae` option to `GetTokenOptions` to enable Continuous Access Evaluation in [PR #26614](https://github.com/Azure/azure-sdk-for-js/pull/26614).

## 1.4.0 (2022-08-04)

### Features Added
Expand Down
1 change: 1 addition & 0 deletions sdk/core/core-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
},
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"browser": "./dist/browser/index.js",
"files": [
"dist/",
"README.md",
Expand Down
2 changes: 2 additions & 0 deletions sdk/core/core-client-rest/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### Other Changes

- Add top-level `browser` field to `package.json` as fallback for legacy bundlers that do not support the `exports` field.

## 1.3.0 (2024-03-12)

### Features Added
Expand Down
1 change: 1 addition & 0 deletions sdk/core/core-client-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"type": "module",
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"browser": "./dist/browser/index.js",
"exports": {
"./package.json": "./package.json",
".": {
Expand Down
2 changes: 2 additions & 0 deletions sdk/core/core-client/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

### Other Changes

- Add top-level `browser` field to `package.json` as fallback for legacy bundlers that do not support the `exports` field.

## 1.9.0 (2024-03-12)

### Other Changes
Expand Down
1 change: 1 addition & 0 deletions sdk/core/core-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"type": "module",
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"browser": "./dist/browser/index.js",
"exports": {
"./package.json": "./package.json",
".": {
Expand Down
2 changes: 2 additions & 0 deletions sdk/core/core-http-compat/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### Other Changes

- Add top-level `browser` field to `package.json` as fallback for legacy bundlers that do not support the `exports` field.

## 2.1.0 (2024-03-12)

### Other Changes
Expand Down
1 change: 1 addition & 0 deletions sdk/core/core-http-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"type": "module",
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"browser": "./dist/browser/index.js",
"exports": {
"./package.json": "./package.json",
".": {
Expand Down
2 changes: 2 additions & 0 deletions sdk/core/core-lro/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### Other Changes

- Add top-level `browser` field to `package.json` as fallback for legacy bundlers that do not support the `exports` field.

## 2.7.0 (2024-03-12)

### Other Changes
Expand Down
5 changes: 1 addition & 4 deletions sdk/core/core-lro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
],
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"browser": "./dist/browser/index.js",
"tags": [
"isomorphic",
"browser",
Expand All @@ -56,10 +57,6 @@
"engines": {
"node": ">=18.0.0"
},
"browser": {
"os": false,
"process": false
},
"license": "MIT",
"homepage": "https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/core/core-lro/README.md",
"repository": "github:Azure/azure-sdk-for-js",
Expand Down
2 changes: 2 additions & 0 deletions sdk/core/core-paging/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### Other Changes

- Add top-level `browser` field to `package.json` as fallback for legacy bundlers that do not support the `exports` field.

## 1.6.0 (2024-03-12)

### Other Changes
Expand Down
1 change: 1 addition & 0 deletions sdk/core/core-paging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"type": "module",
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"browser": "./dist/browser/index.js",
"exports": {
"./package.json": "./package.json",
".": {
Expand Down
2 changes: 2 additions & 0 deletions sdk/core/core-rest-pipeline/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

### Other Changes

- Add top-level `browser` field to `package.json` as fallback for legacy bundlers that do not support the `exports` field.

## 1.15.0 (2024-03-12)

### Bugs Fixed
Expand Down
1 change: 1 addition & 0 deletions sdk/core/core-rest-pipeline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"sdk-type": "client",
"type": "module",
"main": "./dist/commonjs/index.js",
"browser": "./dist/browser/index.js",
"types": "./dist/commonjs/index.d.ts",
"exports": {
"./package.json": "./package.json",
Expand Down
2 changes: 0 additions & 2 deletions sdk/core/core-rest-pipeline/vitest.browser.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
// Licensed under the MIT license.

import { defineConfig } from "vitest/config";
import browserMap from "@azure-tools/vite-plugin-browser-test-map";

export default defineConfig({
define: {
"process.env": process.env,
},
plugins: [browserMap()],
test: {
reporters: ["basic", "junit"],
outputFile: {
Expand Down
2 changes: 2 additions & 0 deletions sdk/core/core-sse/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### Other Changes

- Add top-level `browser` field to `package.json` as fallback for legacy bundlers that do not support the `exports` field.

## 2.1.0 (2024-03-12)

### Other Changes
Expand Down
1 change: 1 addition & 0 deletions sdk/core/core-sse/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"type": "module",
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"browser": "./dist/browser/index.js",
"exports": {
"./package.json": "./package.json",
".": {
Expand Down
2 changes: 2 additions & 0 deletions sdk/core/core-tracing/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### Other Changes

- Add top-level `browser` field to `package.json` as fallback for legacy bundlers that do not support the `exports` field.

## 1.1.0 (2024-03-12)

### Other Changes
Expand Down
1 change: 1 addition & 0 deletions sdk/core/core-tracing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"type": "module",
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"browser": "./dist/browser/index.js",
"exports": {
"./package.json": "./package.json",
".": {
Expand Down
2 changes: 2 additions & 0 deletions sdk/core/core-util/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### Other Changes

- Add top-level `browser` field to `package.json` as fallback for legacy bundlers that do not support the `exports` field.

## 1.8.0 (2024-03-12)

### Other Changes
Expand Down
1 change: 1 addition & 0 deletions sdk/core/core-util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"type": "module",
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"browser": "./dist/browser/index.js",
"exports": {
"./package.json": "./package.json",
".": {
Expand Down
2 changes: 0 additions & 2 deletions sdk/core/core-util/vitest.browser.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@
// Licensed under the MIT license.

import { defineConfig } from "vitest/config";
import browserMap from "@azure-tools/vite-plugin-browser-test-map";

export default defineConfig({
plugins: [browserMap()],
define: {
"process.env": process.env,
},
Expand Down
2 changes: 2 additions & 0 deletions sdk/core/core-xml/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### Other Changes

- Add top-level `browser` field to `package.json` as fallback for legacy bundlers that do not support the `exports` field.

## 1.4.0 (2024-03-12)

### Other Changes
Expand Down
1 change: 1 addition & 0 deletions sdk/core/core-xml/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"type": "module",
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"browser": "./dist/browser/index.js",
"exports": {
"./package.json": "./package.json",
".": {
Expand Down
2 changes: 2 additions & 0 deletions sdk/core/logger/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

### Other Changes

- Add top-level `browser` field to `package.json` as fallback for legacy bundlers that do not support the `exports` field.

## 1.1.0 (2024-03-12)

### Other Changes
Expand Down
1 change: 1 addition & 0 deletions sdk/core/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"type": "module",
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"browser": "./dist/browser/index.js",
"exports": {
"./package.json": "./package.json",
".": {
Expand Down
1 change: 1 addition & 0 deletions sdk/core/ts-http-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"type": "module",
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"browser": "./dist/browser/index.js",
"exports": {
"./package.json": "./package.json",
".": {
Expand Down
2 changes: 0 additions & 2 deletions sdk/core/ts-http-runtime/vitest.browser.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@
// Licensed under the MIT license.

import { defineConfig } from "vitest/config";
import browserMap from "@azure-tools/vite-plugin-browser-test-map";

export default defineConfig({
define: {
"process.env": process.env,
},
plugins: [browserMap()],
test: {
reporters: ["basic", "junit"],
outputFile: {
Expand Down

0 comments on commit 83c8b4a

Please sign in to comment.