@azure-tools/typespec-ts 0.56.0-dev.14 → 0.56.0-dev.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (376) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/README.md +8 -9
  3. package/dist/src/context-manager.d.ts +6 -6
  4. package/dist/src/context-manager.d.ts.map +1 -1
  5. package/dist/src/context-manager.js +1 -0
  6. package/dist/src/context-manager.js.map +1 -1
  7. package/dist/src/framework/declaration.d.ts +1 -1
  8. package/dist/src/framework/declaration.d.ts.map +1 -1
  9. package/dist/src/framework/declaration.js +2 -1
  10. package/dist/src/framework/declaration.js.map +1 -1
  11. package/dist/src/framework/hooks/binder.d.ts +2 -5
  12. package/dist/src/framework/hooks/binder.d.ts.map +1 -1
  13. package/dist/src/framework/hooks/binder.js +2 -29
  14. package/dist/src/framework/hooks/binder.js.map +1 -1
  15. package/dist/src/framework/hooks/sdk-types.d.ts +3 -3
  16. package/dist/src/framework/hooks/sdk-types.d.ts.map +1 -1
  17. package/dist/src/framework/hooks/sdk-types.js.map +1 -1
  18. package/dist/src/framework/hooks/use-dependencies.d.ts +1 -1
  19. package/dist/src/framework/hooks/use-dependencies.d.ts.map +1 -1
  20. package/dist/src/framework/load-static-helpers.d.ts +2 -2
  21. package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
  22. package/dist/src/framework/load-static-helpers.js +1 -13
  23. package/dist/src/framework/load-static-helpers.js.map +1 -1
  24. package/dist/src/framework/reference.js.map +1 -1
  25. package/dist/src/framework/source-file-batch.d.ts +1 -1
  26. package/dist/src/framework/source-file-batch.d.ts.map +1 -1
  27. package/dist/src/framework/source-file-batch.js +1 -1
  28. package/dist/src/framework/source-file-batch.js.map +1 -1
  29. package/dist/src/index.d.ts +4 -4
  30. package/dist/src/index.d.ts.map +1 -1
  31. package/dist/src/index.js +14 -17
  32. package/dist/src/index.js.map +1 -1
  33. package/dist/src/interfaces.d.ts +0 -1
  34. package/dist/src/interfaces.d.ts.map +1 -1
  35. package/dist/src/lib.d.ts +3 -3
  36. package/dist/src/lib.d.ts.map +1 -1
  37. package/dist/src/lib.js +0 -1
  38. package/dist/src/lib.js.map +1 -1
  39. package/dist/src/meta-tree.d.ts +2 -2
  40. package/dist/src/meta-tree.d.ts.map +1 -1
  41. package/dist/src/metadata/build-api-extractor-config.d.ts +1 -1
  42. package/dist/src/metadata/build-api-extractor-config.d.ts.map +1 -1
  43. package/dist/src/metadata/build-changelog-file.d.ts +1 -1
  44. package/dist/src/metadata/build-changelog-file.d.ts.map +1 -1
  45. package/dist/src/metadata/build-es-lint-config.d.ts +1 -1
  46. package/dist/src/metadata/build-es-lint-config.d.ts.map +1 -1
  47. package/dist/src/metadata/build-package-file.d.ts +3 -5
  48. package/dist/src/metadata/build-package-file.d.ts.map +1 -1
  49. package/dist/src/metadata/build-package-file.js +10 -45
  50. package/dist/src/metadata/build-package-file.js.map +1 -1
  51. package/dist/src/metadata/build-readme-file.d.ts +1 -1
  52. package/dist/src/metadata/build-readme-file.d.ts.map +1 -1
  53. package/dist/src/metadata/build-readme-file.js +3 -3
  54. package/dist/src/metadata/build-readme-file.js.map +1 -1
  55. package/dist/src/metadata/build-sample-env-file.d.ts +1 -1
  56. package/dist/src/metadata/build-sample-env-file.d.ts.map +1 -1
  57. package/dist/src/metadata/build-test-config.d.ts +1 -1
  58. package/dist/src/metadata/build-test-config.d.ts.map +1 -1
  59. package/dist/src/metadata/build-ts-config.d.ts +11 -5
  60. package/dist/src/metadata/build-ts-config.d.ts.map +1 -1
  61. package/dist/src/metadata/build-ts-config.js +36 -8
  62. package/dist/src/metadata/build-ts-config.js.map +1 -1
  63. package/dist/src/metadata/build-vitest-config.d.ts +1 -1
  64. package/dist/src/metadata/build-vitest-config.d.ts.map +1 -1
  65. package/dist/src/metadata/build-warp-config.d.ts +1 -3
  66. package/dist/src/metadata/build-warp-config.d.ts.map +1 -1
  67. package/dist/src/metadata/build-warp-config.js +0 -2
  68. package/dist/src/metadata/build-warp-config.js.map +1 -1
  69. package/dist/src/metadata/package-json/azure-package-common.d.ts +1 -1
  70. package/dist/src/metadata/package-json/azure-package-common.d.ts.map +1 -1
  71. package/dist/src/metadata/package-json/build-azure-monorepo-package.d.ts +1 -2
  72. package/dist/src/metadata/package-json/build-azure-monorepo-package.d.ts.map +1 -1
  73. package/dist/src/metadata/package-json/build-azure-monorepo-package.js +2 -16
  74. package/dist/src/metadata/package-json/build-azure-monorepo-package.js.map +1 -1
  75. package/dist/src/metadata/package-json/package-common.d.ts.map +1 -1
  76. package/dist/src/metadata/package-json/package-common.js +0 -15
  77. package/dist/src/metadata/package-json/package-common.js.map +1 -1
  78. package/dist/src/metadata/test/build-recorded-client.d.ts +1 -1
  79. package/dist/src/metadata/test/build-recorded-client.d.ts.map +1 -1
  80. package/dist/src/metadata/test/build-sample-test.d.ts +1 -1
  81. package/dist/src/metadata/test/build-sample-test.d.ts.map +1 -1
  82. package/dist/src/metadata/test/build-snippets.d.ts +1 -1
  83. package/dist/src/metadata/test/build-snippets.d.ts.map +1 -1
  84. package/dist/src/metadata/utils.d.ts +1 -1
  85. package/dist/src/metadata/utils.d.ts.map +1 -1
  86. package/dist/src/modular/build-classical-client.d.ts +3 -3
  87. package/dist/src/modular/build-classical-client.d.ts.map +1 -1
  88. package/dist/src/modular/build-classical-client.js +1 -1
  89. package/dist/src/modular/build-classical-client.js.map +1 -1
  90. package/dist/src/modular/build-classical-operation-groups.d.ts +3 -3
  91. package/dist/src/modular/build-classical-operation-groups.d.ts.map +1 -1
  92. package/dist/src/modular/build-classical-operation-groups.js +1 -0
  93. package/dist/src/modular/build-classical-operation-groups.js.map +1 -1
  94. package/dist/src/modular/build-client-context.d.ts +3 -3
  95. package/dist/src/modular/build-client-context.d.ts.map +1 -1
  96. package/dist/src/modular/build-client-context.js +1 -0
  97. package/dist/src/modular/build-client-context.js.map +1 -1
  98. package/dist/src/modular/build-modular-options.d.ts +2 -2
  99. package/dist/src/modular/build-modular-options.d.ts.map +1 -1
  100. package/dist/src/modular/build-operations.d.ts +5 -5
  101. package/dist/src/modular/build-operations.d.ts.map +1 -1
  102. package/dist/src/modular/build-operations.js +7 -4
  103. package/dist/src/modular/build-operations.js.map +1 -1
  104. package/dist/src/modular/build-project-files.d.ts +2 -2
  105. package/dist/src/modular/build-project-files.d.ts.map +1 -1
  106. package/dist/src/modular/build-restore-poller.d.ts +3 -3
  107. package/dist/src/modular/build-restore-poller.d.ts.map +1 -1
  108. package/dist/src/modular/build-restore-poller.js +1 -0
  109. package/dist/src/modular/build-restore-poller.js.map +1 -1
  110. package/dist/src/modular/build-root-index.d.ts +3 -3
  111. package/dist/src/modular/build-root-index.d.ts.map +1 -1
  112. package/dist/src/modular/build-root-index.js +4 -3
  113. package/dist/src/modular/build-root-index.js.map +1 -1
  114. package/dist/src/modular/build-subpath-index.d.ts +2 -2
  115. package/dist/src/modular/build-subpath-index.d.ts.map +1 -1
  116. package/dist/src/modular/build-subpath-index.js +1 -1
  117. package/dist/src/modular/build-subpath-index.js.map +1 -1
  118. package/dist/src/modular/emit-logger-file.d.ts +1 -1
  119. package/dist/src/modular/emit-logger-file.d.ts.map +1 -1
  120. package/dist/src/modular/emit-models-options.d.ts +3 -3
  121. package/dist/src/modular/emit-models-options.d.ts.map +1 -1
  122. package/dist/src/modular/emit-models-options.js.map +1 -1
  123. package/dist/src/modular/emit-models.d.ts +3 -3
  124. package/dist/src/modular/emit-models.d.ts.map +1 -1
  125. package/dist/src/modular/emit-models.js +1 -1
  126. package/dist/src/modular/emit-models.js.map +1 -1
  127. package/dist/src/modular/emit-samples.d.ts +1 -1
  128. package/dist/src/modular/emit-samples.d.ts.map +1 -1
  129. package/dist/src/modular/emit-samples.js +1 -1
  130. package/dist/src/modular/emit-samples.js.map +1 -1
  131. package/dist/src/modular/emit-tests.d.ts +1 -1
  132. package/dist/src/modular/emit-tests.d.ts.map +1 -1
  133. package/dist/src/modular/emit-tests.js +1 -0
  134. package/dist/src/modular/emit-tests.js.map +1 -1
  135. package/dist/src/modular/external-dependencies.d.ts +1 -1
  136. package/dist/src/modular/external-dependencies.d.ts.map +1 -1
  137. package/dist/src/modular/external-dependencies.js +10 -0
  138. package/dist/src/modular/external-dependencies.js.map +1 -1
  139. package/dist/src/modular/helpers/classical-operation-helpers.d.ts +3 -3
  140. package/dist/src/modular/helpers/classical-operation-helpers.d.ts.map +1 -1
  141. package/dist/src/modular/helpers/classical-operation-helpers.js +1 -1
  142. package/dist/src/modular/helpers/classical-operation-helpers.js.map +1 -1
  143. package/dist/src/modular/helpers/client-helpers.d.ts +6 -6
  144. package/dist/src/modular/helpers/client-helpers.d.ts.map +1 -1
  145. package/dist/src/modular/helpers/client-helpers.js +24 -7
  146. package/dist/src/modular/helpers/client-helpers.js.map +1 -1
  147. package/dist/src/modular/helpers/client-option-helpers.d.ts +1 -1
  148. package/dist/src/modular/helpers/client-option-helpers.d.ts.map +1 -1
  149. package/dist/src/modular/helpers/example-value-helpers.d.ts +3 -3
  150. package/dist/src/modular/helpers/example-value-helpers.d.ts.map +1 -1
  151. package/dist/src/modular/helpers/example-value-helpers.js +1 -0
  152. package/dist/src/modular/helpers/example-value-helpers.js.map +1 -1
  153. package/dist/src/modular/helpers/naming-helpers.d.ts +7 -4
  154. package/dist/src/modular/helpers/naming-helpers.d.ts.map +1 -1
  155. package/dist/src/modular/helpers/naming-helpers.js +44 -5
  156. package/dist/src/modular/helpers/naming-helpers.js.map +1 -1
  157. package/dist/src/modular/helpers/operation-helpers.d.ts +7 -7
  158. package/dist/src/modular/helpers/operation-helpers.d.ts.map +1 -1
  159. package/dist/src/modular/helpers/operation-helpers.js +24 -21
  160. package/dist/src/modular/helpers/operation-helpers.js.map +1 -1
  161. package/dist/src/modular/helpers/type-helpers.d.ts +3 -3
  162. package/dist/src/modular/helpers/type-helpers.d.ts.map +1 -1
  163. package/dist/src/modular/interfaces.d.ts +1 -1
  164. package/dist/src/modular/interfaces.d.ts.map +1 -1
  165. package/dist/src/modular/serialization/build-deserializer-function.d.ts +4 -4
  166. package/dist/src/modular/serialization/build-deserializer-function.d.ts.map +1 -1
  167. package/dist/src/modular/serialization/build-deserializer-function.js.map +1 -1
  168. package/dist/src/modular/serialization/build-serializer-function.d.ts +4 -4
  169. package/dist/src/modular/serialization/build-serializer-function.d.ts.map +1 -1
  170. package/dist/src/modular/serialization/build-serializer-function.js.map +1 -1
  171. package/dist/src/modular/serialization/build-xml-serializer-function.d.ts +4 -4
  172. package/dist/src/modular/serialization/build-xml-serializer-function.d.ts.map +1 -1
  173. package/dist/src/modular/serialization/build-xml-serializer-function.js.map +1 -1
  174. package/dist/src/modular/serialization/serialize-utils.d.ts +1 -1
  175. package/dist/src/modular/serialization/serialize-utils.d.ts.map +1 -1
  176. package/dist/src/modular/static-helpers-metadata.d.ts +0 -12
  177. package/dist/src/modular/static-helpers-metadata.d.ts.map +1 -1
  178. package/dist/src/modular/static-helpers-metadata.js +0 -12
  179. package/dist/src/modular/static-helpers-metadata.js.map +1 -1
  180. package/dist/src/modular/type-expressions/get-credential-expression.d.ts +1 -1
  181. package/dist/src/modular/type-expressions/get-credential-expression.d.ts.map +1 -1
  182. package/dist/src/modular/type-expressions/get-enum-expression.d.ts +3 -3
  183. package/dist/src/modular/type-expressions/get-enum-expression.d.ts.map +1 -1
  184. package/dist/src/modular/type-expressions/get-enum-expression.js.map +1 -1
  185. package/dist/src/modular/type-expressions/get-model-expression.d.ts +3 -3
  186. package/dist/src/modular/type-expressions/get-model-expression.d.ts.map +1 -1
  187. package/dist/src/modular/type-expressions/get-nullable-expression.d.ts +3 -3
  188. package/dist/src/modular/type-expressions/get-nullable-expression.d.ts.map +1 -1
  189. package/dist/src/modular/type-expressions/get-nullable-expression.js.map +1 -1
  190. package/dist/src/modular/type-expressions/get-type-expression.d.ts +2 -2
  191. package/dist/src/modular/type-expressions/get-type-expression.d.ts.map +1 -1
  192. package/dist/src/modular/type-expressions/get-union-expression.d.ts +3 -3
  193. package/dist/src/modular/type-expressions/get-union-expression.d.ts.map +1 -1
  194. package/dist/src/modular/type-expressions/get-union-expression.js.map +1 -1
  195. package/dist/src/modular/type-expressions/utils.d.ts +1 -1
  196. package/dist/src/modular/type-expressions/utils.d.ts.map +1 -1
  197. package/dist/src/transform/transform-api-version-info.d.ts +3 -3
  198. package/dist/src/transform/transform-api-version-info.d.ts.map +1 -1
  199. package/dist/src/transform/transform-api-version-info.js +1 -1
  200. package/dist/src/transform/transform-api-version-info.js.map +1 -1
  201. package/dist/src/transform/transform-client-options.d.ts +4 -4
  202. package/dist/src/transform/transform-client-options.d.ts.map +1 -1
  203. package/dist/src/transform/transform-client-options.js +1 -3
  204. package/dist/src/transform/transform-client-options.js.map +1 -1
  205. package/dist/src/transform/transform-helper-function-details.d.ts +3 -3
  206. package/dist/src/transform/transform-helper-function-details.d.ts.map +1 -1
  207. package/dist/src/transform/transform-helper-function-details.js +1 -1
  208. package/dist/src/transform/transform-helper-function-details.js.map +1 -1
  209. package/dist/src/transform/transform-parameters.d.ts +4 -4
  210. package/dist/src/transform/transform-parameters.d.ts.map +1 -1
  211. package/dist/src/transform/transform-parameters.js.map +1 -1
  212. package/dist/src/transform/transform-paths.d.ts +3 -3
  213. package/dist/src/transform/transform-paths.d.ts.map +1 -1
  214. package/dist/src/transform/transform-paths.js +1 -1
  215. package/dist/src/transform/transform-paths.js.map +1 -1
  216. package/dist/src/transform/transform-responses.d.ts +3 -3
  217. package/dist/src/transform/transform-responses.d.ts.map +1 -1
  218. package/dist/src/transform/transform-responses.js +1 -1
  219. package/dist/src/transform/transform-responses.js.map +1 -1
  220. package/dist/src/transform/transform-schemas.d.ts +2 -2
  221. package/dist/src/transform/transform-schemas.d.ts.map +1 -1
  222. package/dist/src/transform/transform-schemas.js +2 -2
  223. package/dist/src/transform/transform-schemas.js.map +1 -1
  224. package/dist/src/transform/transform-telemetry-info.d.ts +2 -2
  225. package/dist/src/transform/transform-telemetry-info.d.ts.map +1 -1
  226. package/dist/src/transform/transform.d.ts +3 -3
  227. package/dist/src/transform/transform.d.ts.map +1 -1
  228. package/dist/src/utils/api-version-util.d.ts +1 -1
  229. package/dist/src/utils/api-version-util.d.ts.map +1 -1
  230. package/dist/src/utils/client-utils.d.ts +4 -4
  231. package/dist/src/utils/client-utils.d.ts.map +1 -1
  232. package/dist/src/utils/credential-utils.d.ts +3 -3
  233. package/dist/src/utils/credential-utils.d.ts.map +1 -1
  234. package/dist/src/utils/credential-utils.js.map +1 -1
  235. package/dist/src/utils/cross-language-def.d.ts +1 -1
  236. package/dist/src/utils/cross-language-def.d.ts.map +1 -1
  237. package/dist/src/utils/emit-util.d.ts +2 -2
  238. package/dist/src/utils/emit-util.d.ts.map +1 -1
  239. package/dist/src/utils/emit-util.js +2 -2
  240. package/dist/src/utils/emit-util.js.map +1 -1
  241. package/dist/src/utils/file-system-utils.d.ts +1 -1
  242. package/dist/src/utils/file-system-utils.d.ts.map +1 -1
  243. package/dist/src/utils/file-system-utils.js.map +1 -1
  244. package/dist/src/utils/import-helper.js +1 -0
  245. package/dist/src/utils/import-helper.js.map +1 -1
  246. package/dist/src/utils/imports-util.d.ts +1 -1
  247. package/dist/src/utils/imports-util.d.ts.map +1 -1
  248. package/dist/src/utils/imports-util.js +2 -1
  249. package/dist/src/utils/imports-util.js.map +1 -1
  250. package/dist/src/utils/interfaces.d.ts +3 -3
  251. package/dist/src/utils/interfaces.d.ts.map +1 -1
  252. package/dist/src/utils/interfaces.js +2 -1
  253. package/dist/src/utils/interfaces.js.map +1 -1
  254. package/dist/src/utils/model-utils.d.ts +4 -4
  255. package/dist/src/utils/model-utils.d.ts.map +1 -1
  256. package/dist/src/utils/name-constructors.d.ts +1 -1
  257. package/dist/src/utils/name-constructors.d.ts.map +1 -1
  258. package/dist/src/utils/namespace-utils.d.ts +2 -2
  259. package/dist/src/utils/namespace-utils.d.ts.map +1 -1
  260. package/dist/src/utils/namespace-utils.js +1 -1
  261. package/dist/src/utils/namespace-utils.js.map +1 -1
  262. package/dist/src/utils/operation-helpers.d.ts +2 -2
  263. package/dist/src/utils/operation-helpers.d.ts.map +1 -1
  264. package/dist/src/utils/operation-helpers.js.map +1 -1
  265. package/dist/src/utils/operation-util.d.ts +5 -5
  266. package/dist/src/utils/operation-util.d.ts.map +1 -1
  267. package/dist/src/utils/operation-util.js +1 -1
  268. package/dist/src/utils/operation-util.js.map +1 -1
  269. package/dist/src/utils/parameter-utils.d.ts +3 -3
  270. package/dist/src/utils/parameter-utils.d.ts.map +1 -1
  271. package/dist/src/utils/parameter-utils.js.map +1 -1
  272. package/dist/src/utils/schema-helpers.d.ts +1 -1
  273. package/dist/src/utils/schema-helpers.d.ts.map +1 -1
  274. package/dist/src/utils/schema-helpers.js +1 -1
  275. package/dist/src/utils/schema-helpers.js.map +1 -1
  276. package/dist/src/utils/type-util.d.ts +1 -1
  277. package/dist/src/utils/type-util.d.ts.map +1 -1
  278. package/dist/tsconfig.tsbuildinfo +1 -1
  279. package/package.json +41 -38
  280. package/src/context-manager.ts +6 -6
  281. package/src/framework/declaration.ts +7 -6
  282. package/src/framework/hooks/binder.ts +5 -33
  283. package/src/framework/hooks/sdk-types.ts +8 -8
  284. package/src/framework/hooks/use-dependencies.ts +1 -1
  285. package/src/framework/load-static-helpers.ts +3 -18
  286. package/src/framework/reference.ts +2 -2
  287. package/src/framework/sample.ts +2 -2
  288. package/src/framework/source-file-batch.ts +2 -2
  289. package/src/index.ts +23 -27
  290. package/src/interfaces.ts +0 -1
  291. package/src/lib.ts +3 -4
  292. package/src/meta-tree.ts +2 -2
  293. package/src/metadata/build-api-extractor-config.ts +1 -1
  294. package/src/metadata/build-changelog-file.ts +1 -1
  295. package/src/metadata/build-es-lint-config.ts +1 -1
  296. package/src/metadata/build-package-file.ts +11 -49
  297. package/src/metadata/build-readme-file.ts +4 -4
  298. package/src/metadata/build-sample-env-file.ts +1 -1
  299. package/src/metadata/build-test-config.ts +1 -1
  300. package/src/metadata/build-ts-config.ts +38 -9
  301. package/src/metadata/build-vitest-config.ts +1 -1
  302. package/src/metadata/build-warp-config.ts +1 -3
  303. package/src/metadata/package-json/azure-package-common.ts +1 -1
  304. package/src/metadata/package-json/build-azure-monorepo-package.ts +3 -20
  305. package/src/metadata/package-json/package-common.ts +0 -15
  306. package/src/metadata/test/build-recorded-client.ts +1 -1
  307. package/src/metadata/test/build-sample-test.ts +1 -1
  308. package/src/metadata/test/build-snippets.ts +1 -1
  309. package/src/metadata/utils.ts +1 -1
  310. package/src/modular/build-classical-client.ts +6 -6
  311. package/src/modular/build-classical-operation-groups.ts +6 -3
  312. package/src/modular/build-client-context.ts +3 -3
  313. package/src/modular/build-modular-options.ts +2 -2
  314. package/src/modular/build-operations.ts +12 -9
  315. package/src/modular/build-project-files.ts +2 -2
  316. package/src/modular/build-restore-poller.ts +6 -3
  317. package/src/modular/build-root-index.ts +9 -10
  318. package/src/modular/build-subpath-index.ts +5 -2
  319. package/src/modular/emit-logger-file.ts +1 -1
  320. package/src/modular/emit-models-options.ts +6 -3
  321. package/src/modular/emit-models.ts +23 -33
  322. package/src/modular/emit-samples.ts +11 -11
  323. package/src/modular/emit-tests.ts +3 -3
  324. package/src/modular/external-dependencies.ts +11 -1
  325. package/src/modular/helpers/classical-operation-helpers.ts +10 -7
  326. package/src/modular/helpers/client-helpers.ts +36 -19
  327. package/src/modular/helpers/client-option-helpers.ts +1 -1
  328. package/src/modular/helpers/example-value-helpers.ts +9 -9
  329. package/src/modular/helpers/naming-helpers.ts +55 -7
  330. package/src/modular/helpers/operation-helpers.ts +46 -44
  331. package/src/modular/helpers/type-helpers.ts +3 -3
  332. package/src/modular/interfaces.ts +1 -1
  333. package/src/modular/serialization/build-deserializer-function.ts +9 -9
  334. package/src/modular/serialization/build-serializer-function.ts +9 -9
  335. package/src/modular/serialization/build-xml-serializer-function.ts +7 -7
  336. package/src/modular/serialization/serialize-utils.ts +1 -1
  337. package/src/modular/static-helpers-metadata.ts +0 -13
  338. package/src/modular/type-expressions/get-credential-expression.ts +1 -1
  339. package/src/modular/type-expressions/get-enum-expression.ts +3 -3
  340. package/src/modular/type-expressions/get-model-expression.ts +3 -3
  341. package/src/modular/type-expressions/get-nullable-expression.ts +3 -3
  342. package/src/modular/type-expressions/get-type-expression.ts +2 -2
  343. package/src/modular/type-expressions/get-union-expression.ts +3 -3
  344. package/src/modular/type-expressions/utils.ts +1 -1
  345. package/src/transform/transform-api-version-info.ts +8 -3
  346. package/src/transform/transform-client-options.ts +5 -7
  347. package/src/transform/transform-helper-function-details.ts +6 -3
  348. package/src/transform/transform-parameters.ts +15 -11
  349. package/src/transform/transform-paths.ts +10 -4
  350. package/src/transform/transform-responses.ts +11 -8
  351. package/src/transform/transform-schemas.ts +7 -4
  352. package/src/transform/transform-telemetry-info.ts +3 -3
  353. package/src/transform/transform.ts +11 -11
  354. package/src/utils/api-version-util.ts +1 -1
  355. package/src/utils/client-utils.ts +8 -8
  356. package/src/utils/credential-utils.ts +3 -3
  357. package/src/utils/cross-language-def.ts +1 -1
  358. package/src/utils/emit-util.ts +9 -3
  359. package/src/utils/file-system-utils.ts +1 -1
  360. package/src/utils/imports-util.ts +2 -2
  361. package/src/utils/interfaces.ts +3 -3
  362. package/src/utils/model-utils.ts +23 -23
  363. package/src/utils/name-constructors.ts +1 -1
  364. package/src/utils/namespace-utils.ts +8 -2
  365. package/src/utils/operation-helpers.ts +11 -7
  366. package/src/utils/operation-util.ts +23 -16
  367. package/src/utils/parameter-utils.ts +4 -4
  368. package/src/utils/schema-helpers.ts +7 -1
  369. package/src/utils/type-util.ts +1 -1
  370. package/static/static-helpers/multipartHelpers.ts +2 -6
  371. package/static/static-helpers/platform-types-browser.mts +0 -5
  372. package/static/static-helpers/platform-types-react-native.mts +0 -5
  373. package/static/static-helpers/platform-types.ts +0 -7
  374. package/static/static-helpers/serialization/get-binary-stream-response-browser.mts +0 -22
  375. package/static/static-helpers/serialization/get-binary-stream-response-react-native.mts +0 -1
  376. package/static/static-helpers/serialization/get-binary-stream-response.ts +0 -22
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure-tools/typespec-ts",
3
- "version": "0.56.0-dev.14",
3
+ "version": "0.56.0-dev.15",
4
4
  "description": "A TypeSpec emitter for TypeScript",
5
5
  "main": "dist/src/index.js",
6
6
  "type": "module",
@@ -17,50 +17,53 @@
17
17
  "author": "Jose Heredia <joheredi@microsoft.com>",
18
18
  "license": "MIT",
19
19
  "devDependencies": {
20
- "@azure-rest/core-client": "^2.3.1",
21
- "@typespec/http-specs": "^0.1.0-alpha.38 || >=0.1.0-alpha.39-dev <0.1.0-alpha.39",
22
- "@typespec/spector": "^0.1.0-alpha.25 || >=0.1.0-alpha.26-dev <0.1.0-alpha.26",
23
- "@typespec/spec-api": "^0.1.0-alpha.14 || >=0.1.0-alpha.15-dev <0.1.0-alpha.15",
24
- "@typespec/tspd": "^0.75.0 || >=0.76.0-dev <0.76.0",
25
- "@azure-tools/azure-http-specs": "^0.1.0-alpha.42 || >=0.1.0-alpha.43-dev <0.1.0-alpha.43",
26
- "@azure-tools/typespec-autorest": "^0.69.1 || >=0.70.0-dev <0.70.0",
27
- "@azure-tools/typespec-azure-core": "^0.69.0 || >=0.70.0-dev <0.70.0",
28
- "@azure-tools/typespec-azure-resource-manager": "^0.69.2 || >=0.70.0-dev <0.70.0",
29
- "@azure-tools/typespec-client-generator-core": "^0.69.2 || >=0.70.0-dev <0.70.0",
20
+ "@azure-rest/core-client": "^2.7.0",
21
+ "@azure-tools/azure-http-specs": "^0.1.0-alpha.43 || >= 0.1.0-alpha.44-dev.6",
22
+ "@azure-tools/typespec-autorest": "^0.70.1 || >= 0.71.0-dev.4",
23
+ "@azure-tools/typespec-azure-core": "^0.70.0 || >= 0.71.0-dev.7",
24
+ "@azure-tools/typespec-azure-resource-manager": "^0.70.0 || >= 0.71.0-dev.14",
25
+ "@azure-tools/typespec-client-generator-core": "^0.70.0 || >= 0.71.0-dev.13",
30
26
  "@azure/abort-controller": "^2.1.2",
31
27
  "@azure/core-auth": "^1.6.0",
32
28
  "@azure/core-lro": "^3.1.0",
33
29
  "@azure/core-paging": "^1.5.0",
34
- "@azure/core-rest-pipeline": "^1.14.0",
30
+ "@azure/core-rest-pipeline": "^1.24.0",
35
31
  "@azure/core-util": "^1.4.0",
36
32
  "@azure/logger": "^1.0.4",
37
- "@typespec/compiler": "^1.13.0",
38
- "@typespec/http": "^1.13.0",
39
- "@typespec/openapi": "^1.13.0",
40
- "@typespec/rest": "^0.83.0 || >=0.84.0-dev <0.84.0",
41
- "@typespec/versioning": "^0.83.0 || >=0.84.0-dev <0.84.0",
42
- "@typespec/xml": "^0.83.0 || >=0.84.0-dev <0.84.0",
43
- "@typespec/ts-http-runtime": "0.3.6",
33
+ "@typespec/ts-http-runtime": "0.3.7",
44
34
  "cross-env": "^10.1.0",
45
- "concurrently": "^10.0.0",
35
+ "concurrently": "^10.0.4",
46
36
  "vitest": "^4.1.3",
47
- "vite": "^8.0.8",
37
+ "vite": "^8.1.2",
48
38
  "@vitest/coverage-v8": "^4.1.3",
49
39
  "@microsoft/api-extractor": "^7.58.1",
50
- "yaml": "^2.8.3"
40
+ "@types/pluralize": "^0.0.33",
41
+ "yaml": "^2.8.3",
42
+ "@azure-tools/spector-runner": "^0.1.0",
43
+ "@typespec/http-specs": "^0.1.0-alpha.40",
44
+ "@typespec/spector": "^0.1.0-alpha.27",
45
+ "@typespec/tspd": "^0.76.0",
46
+ "@typespec/compiler": "^1.14.0",
47
+ "@typespec/spec-api": "^0.1.0-alpha.15",
48
+ "@typespec/http": "^1.14.0",
49
+ "@typespec/versioning": "^0.84.0",
50
+ "@typespec/xml": "^0.84.0",
51
+ "@typespec/rest": "^0.84.0",
52
+ "@typespec/openapi": "^1.14.0"
51
53
  },
52
54
  "peerDependencies": {
53
- "@azure-tools/typespec-azure-core": "^0.69.0 || >=0.70.0-dev <0.70.0",
54
- "@azure-tools/typespec-client-generator-core": "^0.69.2 || >=0.70.0-dev <0.70.0",
55
- "@typespec/compiler": "^1.13.0",
56
- "@typespec/http": "^1.13.0",
57
- "@typespec/rest": "^0.83.0 || >=0.84.0-dev <0.84.0",
58
- "@typespec/versioning": "^0.83.0 || >=0.84.0-dev <0.84.0",
59
- "@typespec/xml": "^0.83.0 || >=0.84.0-dev <0.84.0"
55
+ "@azure-tools/typespec-azure-core": "^0.70.0 || >= 0.71.0-dev.7",
56
+ "@azure-tools/typespec-client-generator-core": "^0.70.0 || >= 0.71.0-dev.13",
57
+ "@typespec/compiler": "^1.14.0",
58
+ "@typespec/rest": "^0.84.0",
59
+ "@typespec/http": "^1.14.0",
60
+ "@typespec/versioning": "^0.84.0",
61
+ "@typespec/xml": "^0.84.0"
60
62
  },
61
63
  "dependencies": {
62
- "fast-xml-parser": "^5.7.0",
63
- "prettier": "^3.8.1",
64
+ "fast-xml-parser": "^5.10.1",
65
+ "pluralize": "^8.0.0",
66
+ "prettier": "^3.9.5",
64
67
  "ts-morph": "^23.0.0",
65
68
  "tslib": "^2.3.1"
66
69
  },
@@ -85,23 +88,23 @@
85
88
  "test-next:coverage": "vitest run --project test-next --coverage",
86
89
  "clean": "rimraf ./dist ./typespec-output",
87
90
  "build": "tsc -p .",
88
- "test": "npm run test-next && npm run unit-test && npm run integration-test-ci",
91
+ "test": "pnpm test-next && pnpm unit-test && pnpm integration-test-ci",
89
92
  "lint": "oxlint . --deny-warnings",
90
93
  "lint:fix": "oxlint . --fix",
91
94
  "check:tree": "node ./test/commands/check-clean-tree.ts",
92
- "integration-test-ci": "npm run copy:typespec && npm run spector-test",
93
- "spector-test": "concurrently --kill-others --success first \"npm:start-test-server\" \"npm:generate-and-run\"",
95
+ "integration-test-ci": "pnpm copy:typespec && pnpm spector-test",
96
+ "spector-test": "concurrently --kill-others --success first \"pnpm start-test-server\" \"pnpm generate-and-run\"",
94
97
  "start-test-server": "node ./test/commands/start-test-server.js",
95
98
  "copy:typespec": "node ./test/commands/copy-typespec.ts",
96
- "generate-and-run": "npm run generate-tsp-only:client && concurrently --kill-others-on-fail \"npm:integration-test:alone\" \"npm:generate-tsp-only:declarations\" && npm run stop-test-server -- -p 3002",
99
+ "generate-and-run": "pnpm generate-tsp-only:client && concurrently --kill-others-on-fail \"pnpm integration-test:alone\" \"pnpm generate-tsp-only:declarations\" && pnpm stop-test-server",
97
100
  "generate-tsp-only": "node ./test/commands/gen-spector.js",
98
101
  "generate-tsp-only:client": "node ./test/commands/gen-spector.js --phase=client",
99
102
  "generate-tsp-only:declarations": "node ./test/commands/gen-spector.js --phase=declarations",
100
- "regen-test-baselines": "npm run generate-tsp-only",
103
+ "regen-test-baselines": "pnpm generate-tsp-only",
101
104
  "integration-test:alone": "vitest run --project integration-azure-modular",
102
- "stop-test-server": "npx tsp-spector server stop",
105
+ "stop-test-server": "pnpm exec tsp-spector server stop -p 3002",
103
106
  "unit-test": "cross-env NODE_OPTIONS=--max-old-space-size=1024 vitest run --project unit-modular",
104
107
  "gen:scenario-suites": "node ./test/commands/gen-scenario-suites.ts",
105
- "regen-docs": "npm run build && tspd doc . --enable-experimental --output-dir ../../website/src/content/docs/docs/emitters/clients/typespec-ts/reference --skip-js"
108
+ "regen-docs": "pnpm build && tspd doc . --enable-experimental --output-dir ../../website/src/content/docs/docs/emitters/clients/typespec-ts/reference --skip-js"
106
109
  }
107
110
  }
@@ -1,10 +1,10 @@
1
- import { SdkContext } from "@azure-tools/typespec-client-generator-core";
2
- import { EmitContext } from "@typespec/compiler";
1
+ import type { SdkContext } from "@azure-tools/typespec-client-generator-core";
2
+ import type { EmitContext } from "@typespec/compiler";
3
3
  import { Project, SourceFile } from "ts-morph";
4
- import { ExternalDependencies } from "./framework/dependency.js";
5
- import { Binder } from "./framework/hooks/binder.js";
6
- import { SdkTypeContext } from "./framework/hooks/sdk-types.js";
7
- import { ClientTypeMetaTree } from "./meta-tree.js";
4
+ import type { ExternalDependencies } from "./framework/dependency.js";
5
+ import type { Binder } from "./framework/hooks/binder.js";
6
+ import type { SdkTypeContext } from "./framework/hooks/sdk-types.js";
7
+ import type { ClientTypeMetaTree } from "./meta-tree.js";
8
8
 
9
9
  /**
10
10
  * Contexts Object Guidelines
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  ClassDeclaration,
3
- ClassDeclarationStructure,
3
+ type ClassDeclarationStructure,
4
4
  EnumDeclaration,
5
- EnumDeclarationStructure,
5
+ type EnumDeclarationStructure,
6
6
  FunctionDeclaration,
7
- FunctionDeclarationStructure,
7
+ type FunctionDeclarationStructure,
8
8
  InterfaceDeclaration,
9
- InterfaceDeclarationStructure,
9
+ type InterfaceDeclarationStructure,
10
10
  SourceFile,
11
- StatementStructures,
11
+ type StatementStructures,
12
12
  StructureKind,
13
13
  TypeAliasDeclaration,
14
- TypeAliasDeclarationStructure,
14
+ type TypeAliasDeclarationStructure,
15
15
  } from "ts-morph";
16
16
  import { useBinder } from "./hooks/binder.js";
17
17
  import { refkey as getRefKey } from "./refkey.js";
@@ -81,6 +81,7 @@ export function addDeclaration(
81
81
 
82
82
  // Update the declaration name to be unique
83
83
  const trackedDeclaration = { ...declaration, name: trackedDeclarationName };
84
+ trackedDeclaration.leadingTrivia ??= "\n";
84
85
 
85
86
  // Skip empty type aliases (they have no body to emit). Done before
86
87
  // dispatching so behaviour is identical whether batching or not.
@@ -1,15 +1,15 @@
1
1
  import { joinPaths, normalizePath } from "@typespec/compiler";
2
2
  import {
3
- ImportDeclarationStructure,
4
- ImportSpecifierStructure,
3
+ type ImportDeclarationStructure,
4
+ type ImportSpecifierStructure,
5
5
  Project,
6
6
  SourceFile,
7
7
  StructureKind,
8
8
  } from "ts-morph";
9
9
  import { provideContext, useContext } from "../../context-manager.js";
10
10
  import { generateLocallyUniqueName } from "../../modular/helpers/naming-helpers.js";
11
- import { ReferenceableSymbol } from "../dependency.js";
12
- import { SourceFileSymbol, StaticHelperMetadata } from "../load-static-helpers.js";
11
+ import type { ReferenceableSymbol } from "../dependency.js";
12
+ import { SourceFileSymbol, type StaticHelperMetadata } from "../load-static-helpers.js";
13
13
  import { refkey } from "../refkey.js";
14
14
  import { provideDependencies, useDependencies } from "./use-dependencies.js";
15
15
 
@@ -22,9 +22,6 @@ export interface DeclarationInfo {
22
22
  export interface BinderOptions {
23
23
  staticHelpers?: Map<string, StaticHelperMetadata>;
24
24
  dependencies?: Record<string, ReferenceableSymbol>;
25
- /** When true, use #platform/ subpath imports for static helpers with platform variants.
26
- * Should be true for warp packages; false for tshy packages. */
27
- useSubpathImports?: boolean;
28
25
  }
29
26
 
30
27
  export interface Binder {
@@ -50,7 +47,6 @@ class BinderImp implements Binder {
50
47
  private project: Project;
51
48
  private dependencies: Record<string, ReferenceableSymbol>;
52
49
  private staticHelpers: Map<string, StaticHelperMetadata>;
53
- private useSubpathImports: boolean;
54
50
 
55
51
  constructor(project: Project, options: BinderOptions = {}) {
56
52
  this.project = project;
@@ -58,7 +54,6 @@ class BinderImp implements Binder {
58
54
  provideDependencies(options.dependencies);
59
55
  this.staticHelpers = options.staticHelpers ?? new Map();
60
56
  this.dependencies = useDependencies();
61
- this.useSubpathImports = options.useSubpathImports ?? false;
62
57
  }
63
58
 
64
59
  trackDeclaration(refkey: unknown, name: string, sourceFile: SourceFile): string {
@@ -185,27 +180,6 @@ class BinderImp implements Binder {
185
180
  return importSpecifier;
186
181
  }
187
182
 
188
- /**
189
- * Returns the #platform/ subpath import specifier for a static helper file
190
- * that has a polyfill variant (-browser.mts or -react-native.mts sibling),
191
- * or undefined if subpath imports are disabled or no variant exists.
192
- * e.g. "src/static-helpers/serialization/get-binary-response.ts"
193
- * -> "#platform/static-helpers/serialization/get-binary-response"
194
- */
195
- private getPlatformImportSpecifier(declarationSourceFile: SourceFile): string | undefined {
196
- if (!this.useSubpathImports) return undefined;
197
- const filePath = declarationSourceFile.getFilePath();
198
- const srcIndex = filePath.indexOf("/src/");
199
- if (srcIndex === -1) return undefined;
200
- // Check if a -browser.mts or -react-native.mts sibling exists
201
- const basePath = filePath.replace(/\.ts$/, "");
202
- const hasBrowserVariant = this.project.getSourceFile(basePath + "-browser.mts");
203
- const hasReactNativeVariant = this.project.getSourceFile(basePath + "-react-native.mts");
204
- if (!hasBrowserVariant && !hasReactNativeVariant) return undefined;
205
- const relativePath = filePath.substring(srcIndex + "/src/".length);
206
- return "#platform/" + relativePath.replace(/\.ts$/, "");
207
- }
208
-
209
183
  /**
210
184
  * Applies all tracked imports to their respective source files.
211
185
  */
@@ -316,9 +290,7 @@ class BinderImp implements Binder {
316
290
 
317
291
  if (file !== declarationSourceFile) {
318
292
  this.trackReference(declarationKey, file);
319
- // Use #platform/ subpath import specifier for static helpers in warp packages
320
- const platformSpecifier = this.getPlatformImportSpecifier(declarationSourceFile);
321
- const importTarget = platformSpecifier ?? declarationSourceFile;
293
+ const importTarget = declarationSourceFile;
322
294
  const importDec = this.addImport(file, importTarget, name);
323
295
  name = importDec.alias ?? name;
324
296
  }
@@ -1,20 +1,20 @@
1
1
  import {
2
- SdkClientType,
3
- SdkHttpOperation,
4
- SdkModelPropertyType,
5
- SdkModelType,
6
- SdkServiceMethod,
7
- SdkType,
2
+ type SdkClientType,
3
+ type SdkHttpOperation,
4
+ type SdkModelPropertyType,
5
+ type SdkModelType,
6
+ type SdkServiceMethod,
7
+ type SdkType,
8
8
  getClientType,
9
9
  } from "@azure-tools/typespec-client-generator-core";
10
- import { Operation, Type, getNamespaceFullName } from "@typespec/compiler";
10
+ import { type Operation, type Type, getNamespaceFullName } from "@typespec/compiler";
11
11
  import { provideContext, useContext } from "../../context-manager.js";
12
12
 
13
13
  import { reportDiagnostic } from "../../lib.js";
14
14
  import { visitPackageTypes } from "../../modular/emit-models.js";
15
15
  import { getAllAncestors, getAllProperties } from "../../modular/helpers/operation-helpers.js";
16
16
  import { normalizeModelPropertyName } from "../../modular/type-expressions/get-type-expression.js";
17
- import { SdkContext } from "../../utils/interfaces.js";
17
+ import type { SdkContext } from "../../utils/interfaces.js";
18
18
  import { NameType, normalizeName } from "../../utils/name-utils.js";
19
19
 
20
20
  export const emitQueue: Set<SdkType> = new Set<SdkType>();
@@ -1,6 +1,6 @@
1
1
  import { provideContext, useContext } from "../../context-manager.js";
2
2
  import { DefaultCoreDependencies } from "../../modular/external-dependencies.js";
3
- import { ExternalDependencies } from "../dependency.js";
3
+ import type { ExternalDependencies } from "../dependency.js";
4
4
 
5
5
  export function provideDependencies(customDependencies: Partial<ExternalDependencies> = {}) {
6
6
  const dependencies = {
@@ -1,4 +1,4 @@
1
- import { type CompilerHost, joinPaths, NoTarget, Program } from "@typespec/compiler";
1
+ import { type CompilerHost, joinPaths, NoTarget, type Program } from "@typespec/compiler";
2
2
  import {
3
3
  ClassDeclaration,
4
4
  EnumDeclaration,
@@ -9,10 +9,11 @@ import {
9
9
  TypeAliasDeclaration,
10
10
  } from "ts-morph";
11
11
  import { reportDiagnostic } from "../lib.js";
12
- import { ModularEmitterOptions } from "../modular/interfaces.js";
12
+ import type { ModularEmitterOptions } from "../modular/interfaces.js";
13
13
  import { resolveProjectRoot } from "../utils/resolve-project-root.js";
14
14
  import { refkey } from "./refkey.js";
15
15
  export const SourceFileSymbol = Symbol("SourceFile");
16
+
16
17
  export interface StaticHelperMetadata {
17
18
  name: string;
18
19
  kind: "function" | "interface" | "typeAlias" | "class" | "enum";
@@ -94,22 +95,6 @@ export async function loadStaticHelpers(
94
95
  const addedFile = project.createSourceFile(targetPath, contents, {
95
96
  overwrite: true,
96
97
  });
97
- addedFile.getImportDeclarations().map((i) => {
98
- // Rewrite relative platform-types imports to #platform/ specifiers
99
- // so that browser/react-native variants are resolved via subpath imports.
100
- // Only rewrite imports to the default variant (not -browser/-react-native variants
101
- // which are already platform-specific direct imports).
102
- const specifier = i.getModuleSpecifierValue();
103
- if (
104
- specifier.startsWith(".") &&
105
- specifier.includes("platform-types") &&
106
- !specifier.includes("-browser") &&
107
- !specifier.includes("-react-native")
108
- ) {
109
- i.setModuleSpecifier("#platform/static-helpers/platform-types");
110
- }
111
- });
112
-
113
98
  for (const entry of Object.values(helpers)) {
114
99
  if (!addedFile.getFilePath().endsWith(entry.location)) {
115
100
  continue;
@@ -1,6 +1,6 @@
1
- import { ReferenceableSymbol } from "./dependency.js";
1
+ import type { ReferenceableSymbol } from "./dependency.js";
2
2
  import { useBinder } from "./hooks/binder.js";
3
- import { SourceFileSymbol, StaticHelperMetadata } from "./load-static-helpers.js";
3
+ import { SourceFileSymbol, type StaticHelperMetadata } from "./load-static-helpers.js";
4
4
  import { refkey as getRefkey } from "./refkey.js";
5
5
 
6
6
  export function resolveReference(refkey: unknown): string {
@@ -1,6 +1,6 @@
1
1
  import {
2
- FunctionDeclarationStructure,
3
- InterfaceDeclarationStructure,
2
+ type FunctionDeclarationStructure,
3
+ type InterfaceDeclarationStructure,
4
4
  Project,
5
5
  StructureKind,
6
6
  } from "ts-morph";
@@ -1,7 +1,7 @@
1
1
  import {
2
- ExportDeclarationStructure,
2
+ type ExportDeclarationStructure,
3
3
  SourceFile,
4
- StatementStructures,
4
+ type StatementStructures,
5
5
  StructureKind,
6
6
  } from "ts-morph";
7
7
 
package/src/index.ts CHANGED
@@ -2,13 +2,13 @@
2
2
  // Licensed under the MIT License.
3
3
 
4
4
  import {
5
- EmitContext,
6
- Program,
5
+ type CompilerHost,
6
+ type EmitContext,
7
+ type Program,
7
8
  getBaseFileName,
8
9
  getDirectoryPath,
9
10
  joinPaths,
10
11
  resolvePath,
11
- type CompilerHost,
12
12
  } from "@typespec/compiler";
13
13
  import { clearContexts, provideContext, useContext } from "./context-manager.js";
14
14
  import { buildRootIndex, buildSubClientIndexFile } from "./modular/build-root-index.js";
@@ -23,7 +23,6 @@ import {
23
23
  CreateRecorderHelpers,
24
24
  MultipartHelpers,
25
25
  PagingHelpers,
26
- PlatformTypeHelpers,
27
26
  PollingHelpers,
28
27
  SerializationHelpers,
29
28
  SimplePollerHelpers,
@@ -33,11 +32,11 @@ import {
33
32
  } from "./modular/static-helpers-metadata.js";
34
33
  import { emitContentByBuilder } from "./utils/emit-util.js";
35
34
  import { clearDirectory, emptyDir, pathExists } from "./utils/file-system-utils.js";
36
- import { GenerationDirDetail, SdkContext } from "./utils/interfaces.js";
35
+ import type { GenerationDirDetail, SdkContext } from "./utils/interfaces.js";
37
36
 
38
37
  import {
39
- SdkClientType,
40
- SdkServiceOperation,
38
+ type SdkClientType,
39
+ type SdkServiceOperation,
41
40
  createSdkContext,
42
41
  listAllServiceNamespaces,
43
42
  } from "@azure-tools/typespec-client-generator-core";
@@ -45,8 +44,8 @@ import { Project } from "ts-morph";
45
44
  import { provideBinder } from "./framework/hooks/binder.js";
46
45
  import { provideSdkTypes, resetSdkTypesState } from "./framework/hooks/sdk-types.js";
47
46
  import { loadStaticHelpers } from "./framework/load-static-helpers.js";
48
- import { ClientModel, ClientOptions } from "./interfaces.js";
49
- import { EmitterOptions } from "./lib.js";
47
+ import type { ClientModel, ClientOptions } from "./interfaces.js";
48
+ import type { EmitterOptions } from "./lib.js";
50
49
  import { buildApiExtractorConfig } from "./metadata/build-api-extractor-config.js";
51
50
  import { buildChangelogFile } from "./metadata/build-changelog-file.js";
52
51
  import { buildEsLintConfig } from "./metadata/build-es-lint-config.js";
@@ -76,7 +75,7 @@ import { buildSampleTest } from "./metadata/test/build-sample-test.js";
76
75
  import { buildSnippets } from "./metadata/test/build-snippets.js";
77
76
  import { buildClassicalClient } from "./modular/build-classical-client.js";
78
77
  import { buildClassicOperationFiles } from "./modular/build-classical-operation-groups.js";
79
- import { buildClientContext, getClientContextPath } from "./modular/build-client-context.js";
78
+ import { buildClientContext } from "./modular/build-client-context.js";
80
79
  import { transformModularEmitterOptions } from "./modular/build-modular-options.js";
81
80
  import { buildOperationFiles } from "./modular/build-operations.js";
82
81
  import { getModuleExports } from "./modular/build-project-files.js";
@@ -88,7 +87,7 @@ import { emitNonModelResponseTypes, emitTypes } from "./modular/emit-models.js";
88
87
  import { emitSamples } from "./modular/emit-samples.js";
89
88
  import { emitTests } from "./modular/emit-tests.js";
90
89
  import { getClassicalClientName } from "./modular/helpers/naming-helpers.js";
91
- import { ModularEmitterOptions } from "./modular/interfaces.js";
90
+ import type { ModularEmitterOptions } from "./modular/interfaces.js";
92
91
  import { packageUsesXmlSerialization } from "./modular/serialization/build-xml-serializer-function.js";
93
92
  import { transformClientOptions } from "./transform/transform-client-options.js";
94
93
  import { transformClientModel } from "./transform/transform.js";
@@ -139,7 +138,6 @@ export async function $onEmit(context: EmitContext) {
139
138
  ...SimplePollerHelpers,
140
139
  ...UrlTemplateHelpers,
141
140
  ...MultipartHelpers,
142
- ...PlatformTypeHelpers,
143
141
  ...CloudSettingHelpers,
144
142
  ...XmlHelpers,
145
143
  ...(resolvedEmitterOptions.generateTest ? CreateRecorderHelpers : {}),
@@ -165,7 +163,6 @@ export async function $onEmit(context: EmitContext) {
165
163
  dependencies: {
166
164
  ...extraDependencies,
167
165
  },
168
- useSubpathImports: true,
169
166
  });
170
167
  provideSdkTypes(dpgContext);
171
168
 
@@ -455,19 +452,18 @@ export async function $onEmit(context: EmitContext) {
455
452
  modularPackageInfo = {
456
453
  ...modularPackageInfo,
457
454
  dependencies,
458
- clientContextPaths: getRelativeContextPaths(context, modularEmitterOptions),
459
455
  };
460
456
  }
461
457
  commonBuilders.push((model) => buildPackageFile(model, modularPackageInfo));
462
458
  // Generate warp.config.yml for Azure monorepo ESM packages
463
459
  commonBuilders.push((model) => buildWarpConfig(model, modularPackageInfo));
464
460
  commonBuilders.push(buildTsConfig);
465
- commonBuilders.push(buildTsSrcEsmConfig);
466
- commonBuilders.push(buildTsSrcBrowserConfig);
461
+ commonBuilders.push(() => buildTsSrcEsmConfig(modularPackageInfo["exports"]));
462
+ commonBuilders.push(() => buildTsSrcBrowserConfig(modularPackageInfo["exports"]));
467
463
  if (option.generateReactNativeTarget) {
468
- commonBuilders.push(buildTsSrcReactNativeConfig);
464
+ commonBuilders.push(() => buildTsSrcReactNativeConfig(modularPackageInfo["exports"]));
469
465
  }
470
- commonBuilders.push(buildTsSrcCjsConfig);
466
+ commonBuilders.push(() => buildTsSrcCjsConfig(modularPackageInfo["exports"]));
471
467
  if (option.generateSample) {
472
468
  commonBuilders.push(buildTsSampleConfig);
473
469
  }
@@ -508,14 +504,13 @@ export async function $onEmit(context: EmitContext) {
508
504
  }
509
505
  const modularPackageInfo = {
510
506
  exports: getModuleExports(context, modularEmitterOptions),
511
- clientContextPaths: getRelativeContextPaths(context, modularEmitterOptions),
512
507
  ...(Object.keys(additionalDependencies).length > 0 && {
513
508
  dependencies: additionalDependencies,
514
509
  }),
515
510
  };
516
511
 
517
512
  // Always update package.json (adds #platform/* imports) along with
518
- // exports, clientContextPaths and LRO deps.
513
+ // exports and LRO deps.
519
514
  {
520
515
  // Read package.json content via host and pass parsed object
521
516
  const pkgSourceFile = await host.readFile(existingPackageFilePath);
@@ -533,6 +528,14 @@ export async function $onEmit(context: EmitContext) {
533
528
  // Update warp.config.yml for Azure monorepo packages
534
529
  updateBuilders.push((model: ClientModel) => buildWarpConfig(model, modularPackageInfo));
535
530
 
531
+ // Re-sync tsconfig.src.*.json `include` with the warp exports
532
+ updateBuilders.push(() => buildTsSrcEsmConfig(modularPackageInfo["exports"]));
533
+ updateBuilders.push(() => buildTsSrcBrowserConfig(modularPackageInfo["exports"]));
534
+ if (option.generateReactNativeTarget) {
535
+ updateBuilders.push(() => buildTsSrcReactNativeConfig(modularPackageInfo["exports"]));
536
+ }
537
+ updateBuilders.push(() => buildTsSrcCjsConfig(modularPackageInfo["exports"]));
538
+
536
539
  // If the client name changed, regenerate the README and snippets completely;
537
540
  // otherwise update only the API reference link in-place.
538
541
  if (hasReadmeFile) {
@@ -580,13 +583,6 @@ export async function $onEmit(context: EmitContext) {
580
583
  );
581
584
  }
582
585
  }
583
-
584
- function getRelativeContextPaths(context: SdkContext, options: ModularEmitterOptions) {
585
- const clientMap = getClientHierarchyMap(context);
586
- return Array.from(clientMap)
587
- .map((subClient) => getClientContextPath(subClient, options))
588
- .map((path) => path.substring(path.indexOf("src")));
589
- }
590
586
  }
591
587
 
592
588
  export async function createContextWithDefaultOptions(
package/src/interfaces.ts CHANGED
@@ -334,7 +334,6 @@ export interface PackageDetails {
334
334
  nameWithoutScope?: string;
335
335
  description?: string;
336
336
  version?: string;
337
- isVersionUserProvided?: boolean;
338
337
  }
339
338
  export interface OperationParameter {
340
339
  operationGroup: string;
package/src/lib.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
 
4
- import { createTypeSpecLibrary, JSONSchemaType, paramMessage } from "@typespec/compiler";
5
- import { Options } from "prettier";
6
- import { PackageDetails } from "./interfaces.js";
4
+ import { createTypeSpecLibrary, type JSONSchemaType, paramMessage } from "@typespec/compiler";
5
+ import type { Options } from "prettier";
6
+ import type { PackageDetails } from "./interfaces.js";
7
7
 
8
8
  export interface EmitterOptions {
9
9
  /**
@@ -137,7 +137,6 @@ export const EmitterOptionsSchema: JSONSchemaType<EmitterOptions> = {
137
137
  nameWithoutScope: { type: "string", nullable: true },
138
138
  description: { type: "string", nullable: true },
139
139
  version: { type: "string", nullable: true },
140
- isVersionUserProvided: { type: "boolean", nullable: true },
141
140
  },
142
141
  required: ["name"],
143
142
  nullable: true,
package/src/meta-tree.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { Type } from "@typespec/compiler";
2
- import { Schema } from "./interfaces.js";
1
+ import type { Type } from "@typespec/compiler";
2
+ import type { Schema } from "./interfaces.js";
3
3
 
4
4
  export interface ClientTypeMetadata {
5
5
  clientType: Schema;
@@ -2,7 +2,7 @@
2
2
  // Licensed under the MIT License.
3
3
 
4
4
  import { Project } from "ts-morph";
5
- import { ClientModel } from "../interfaces.js";
5
+ import type { ClientModel } from "../interfaces.js";
6
6
 
7
7
  export function buildApiExtractorConfig(_model: ClientModel) {
8
8
  const project = new Project({ useInMemoryFileSystem: true });
@@ -1,7 +1,7 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
3
 
4
- import { ClientModel } from "../interfaces.js";
4
+ import type { ClientModel } from "../interfaces.js";
5
5
 
6
6
  function getPackageVersion(model: ClientModel): string {
7
7
  return model.options?.packageDetails?.version ?? "1.0.0-beta.1";
@@ -2,7 +2,7 @@
2
2
  // Licensed under the MIT License.
3
3
 
4
4
  import { Project } from "ts-morph";
5
- import { ClientModel } from "../interfaces.js";
5
+ import type { ClientModel } from "../interfaces.js";
6
6
 
7
7
  const esLintConfigEsmAzureSdk = `import azsdkEslint from "@azure/eslint-plugin-azure-sdk";
8
8