Skip to content

Commit 3de1abe

Browse files
deyaaeldeenCopilot
andauthored
Add imports field to all warp-built packages (#38391)
## Summary Adds the `#platform/*` wildcard import subpath entry to `package.json` for all packages built with warp. This prepares packages for future migration to the new platform-specific imports pattern. ## Changes - **432 packages updated** with new `imports` field - Packages with browser/react-native targets: includes all three entries (react-native, browser, default) - Node-only packages: includes only the default entry - Already-migrated packages (18 with existing imports): skipped ## Example For packages with browser/RN support: ```json "imports": { "#platform/*": { "react-native": "./src/*-react-native.mts", "browser": "./src/*-browser.mts", "default": "./src/*.ts" } } ``` For Node-only packages: ```json "imports": { "#platform/*": { "default": "./src/*.ts" } } ``` ## Why This is a preparatory change that: 1. Establishes the import subpath pattern across all packages 2. Enables incremental migration to `#platform/*` imports 3. Has no runtime impact until packages start using the imports --------- Co-authored-by: Deyaa Eldeen <deyaaeldeen@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 98bbc31 commit 3de1abe

430 files changed

Lines changed: 2938 additions & 150 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

sdk/advisor/arm-advisor/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,5 +105,10 @@
105105
"default": "./dist/commonjs/index.js"
106106
}
107107
}
108+
},
109+
"imports": {
110+
"#platform/*": {
111+
"default": "./src/*.ts"
112+
}
108113
}
109114
}

sdk/agricultureplatform/arm-agricultureplatform/package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,5 +196,12 @@
196196
},
197197
"main": "./dist/commonjs/index.js",
198198
"types": "./dist/commonjs/index.d.ts",
199-
"module": "./dist/esm/index.js"
199+
"module": "./dist/esm/index.js",
200+
"imports": {
201+
"#platform/*": {
202+
"react-native": "./src/*-react-native.mts",
203+
"browser": "./src/*-browser.mts",
204+
"default": "./src/*.ts"
205+
}
206+
}
200207
}

sdk/agrifood/agrifood-farming-rest/package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,5 +124,12 @@
124124
"default": "./dist/commonjs/index.js"
125125
}
126126
}
127+
},
128+
"imports": {
129+
"#platform/*": {
130+
"react-native": "./src/*-react-native.mts",
131+
"browser": "./src/*-browser.mts",
132+
"default": "./src/*.ts"
133+
}
127134
}
128135
}

sdk/agrifood/arm-agrifood/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,10 @@
104104
"default": "./dist/commonjs/index.js"
105105
}
106106
}
107+
},
108+
"imports": {
109+
"#platform/*": {
110+
"default": "./src/*.ts"
111+
}
107112
}
108113
}

sdk/ai/ai-agents/package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,5 +142,12 @@
142142
"main": "./dist/commonjs/index.js",
143143
"types": "./dist/commonjs/index.d.ts",
144144
"module": "./dist/esm/index.js",
145-
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/ai/ai-agents/README.md"
145+
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/ai/ai-agents/README.md",
146+
"imports": {
147+
"#platform/*": {
148+
"react-native": "./src/*-react-native.mts",
149+
"browser": "./src/*-browser.mts",
150+
"default": "./src/*.ts"
151+
}
152+
}
146153
}

sdk/ai/ai-inference-rest/package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,5 +133,12 @@
133133
},
134134
"module": "./dist/esm/index.js",
135135
"browser": "./dist/browser/index.js",
136-
"react-native": "./dist/react-native/index.js"
136+
"react-native": "./dist/react-native/index.js",
137+
"imports": {
138+
"#platform/*": {
139+
"react-native": "./src/*-react-native.mts",
140+
"browser": "./src/*-browser.mts",
141+
"default": "./src/*.ts"
142+
}
143+
}
137144
}

sdk/ai/ai-projects/package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,5 +153,10 @@
153153
"main": "./dist/commonjs/index.js",
154154
"types": "./dist/commonjs/index.d.ts",
155155
"module": "./dist/esm/index.js",
156-
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/ai/ai-projects/README.md"
156+
"homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/ai/ai-projects/README.md",
157+
"imports": {
158+
"#platform/*": {
159+
"default": "./src/*.ts"
160+
}
161+
}
157162
}

sdk/alertprocessingrules/arm-alertprocessingrules/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,5 +172,10 @@
172172
],
173173
"disableDocsMs": true,
174174
"apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-alertprocessingrules?view=azure-node-preview"
175+
},
176+
"imports": {
177+
"#platform/*": {
178+
"default": "./src/*.ts"
179+
}
175180
}
176181
}

sdk/alertrulerecommendations/arm-alertrulerecommendations/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,5 +172,10 @@
172172
],
173173
"disableDocsMs": true,
174174
"apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-alertrulerecommendations?view=azure-node-preview"
175+
},
176+
"imports": {
177+
"#platform/*": {
178+
"default": "./src/*.ts"
179+
}
175180
}
176181
}

sdk/alertsmanagement/arm-alertsmanagement/package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,5 +190,10 @@
190190
],
191191
"disableDocsMs": true,
192192
"apiRefLink": "https://learn.microsoft.com/javascript/api/@azure/arm-alertsmanagement?view=azure-node-preview"
193+
},
194+
"imports": {
195+
"#platform/*": {
196+
"default": "./src/*.ts"
197+
}
193198
}
194199
}

0 commit comments

Comments
 (0)