@azure-tools/typespec-ts 0.54.2 → 0.55.0-dev.10

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 (345) hide show
  1. package/CHANGELOG.md +0 -9
  2. package/README.md +68 -105
  3. package/dist/src/framework/hooks/binder.d.ts +1 -1
  4. package/dist/src/framework/hooks/binder.d.ts.map +1 -1
  5. package/dist/src/framework/hooks/binder.js +3 -4
  6. package/dist/src/framework/hooks/binder.js.map +1 -1
  7. package/dist/src/framework/hooks/sdk-types.d.ts +2 -3
  8. package/dist/src/framework/hooks/sdk-types.d.ts.map +1 -1
  9. package/dist/src/framework/hooks/sdk-types.js +2 -3
  10. package/dist/src/framework/hooks/sdk-types.js.map +1 -1
  11. package/dist/src/framework/load-static-helpers.d.ts +4 -1
  12. package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
  13. package/dist/src/framework/load-static-helpers.js +26 -34
  14. package/dist/src/framework/load-static-helpers.js.map +1 -1
  15. package/dist/src/framework/sample.js +1 -1
  16. package/dist/src/framework/sample.js.map +1 -1
  17. package/dist/src/index.d.ts.map +1 -1
  18. package/dist/src/index.js +104 -170
  19. package/dist/src/index.js.map +1 -1
  20. package/dist/src/lib.d.ts +2 -18
  21. package/dist/src/lib.d.ts.map +1 -1
  22. package/dist/src/lib.js +30 -124
  23. package/dist/src/lib.js.map +1 -1
  24. package/dist/src/modular/build-classical-client.js +2 -2
  25. package/dist/src/modular/build-classical-client.js.map +1 -1
  26. package/dist/src/modular/build-client-context.d.ts.map +1 -1
  27. package/dist/src/modular/build-client-context.js +6 -15
  28. package/dist/src/modular/build-client-context.js.map +1 -1
  29. package/dist/src/modular/build-project-files.d.ts.map +1 -1
  30. package/dist/src/modular/build-project-files.js +4 -4
  31. package/dist/src/modular/build-project-files.js.map +1 -1
  32. package/dist/src/modular/build-restore-poller.js +2 -2
  33. package/dist/src/modular/build-restore-poller.js.map +1 -1
  34. package/dist/src/modular/build-root-index.d.ts.map +1 -1
  35. package/dist/src/modular/build-root-index.js +9 -13
  36. package/dist/src/modular/build-root-index.js.map +1 -1
  37. package/dist/src/modular/build-subpath-index.d.ts.map +1 -1
  38. package/dist/src/modular/build-subpath-index.js +4 -4
  39. package/dist/src/modular/build-subpath-index.js.map +1 -1
  40. package/dist/src/modular/emit-logger-file.d.ts.map +1 -1
  41. package/dist/src/modular/emit-logger-file.js +0 -3
  42. package/dist/src/modular/emit-logger-file.js.map +1 -1
  43. package/dist/src/modular/emit-models-options.js +2 -2
  44. package/dist/src/modular/emit-models-options.js.map +1 -1
  45. package/dist/src/modular/emit-models.d.ts.map +1 -1
  46. package/dist/src/modular/emit-models.js +7 -22
  47. package/dist/src/modular/emit-models.js.map +1 -1
  48. package/dist/src/modular/emit-samples.d.ts.map +1 -1
  49. package/dist/src/modular/emit-samples.js +10 -28
  50. package/dist/src/modular/emit-samples.js.map +1 -1
  51. package/dist/src/modular/emit-tests.d.ts +2 -1
  52. package/dist/src/modular/emit-tests.d.ts.map +1 -1
  53. package/dist/src/modular/emit-tests.js +21 -11
  54. package/dist/src/modular/emit-tests.js.map +1 -1
  55. package/dist/src/modular/helpers/client-helpers.d.ts.map +1 -1
  56. package/dist/src/modular/helpers/client-helpers.js +6 -16
  57. package/dist/src/modular/helpers/client-helpers.js.map +1 -1
  58. package/dist/src/modular/helpers/example-value-helpers.d.ts +1 -1
  59. package/dist/src/modular/helpers/example-value-helpers.d.ts.map +1 -1
  60. package/dist/src/modular/helpers/example-value-helpers.js +11 -28
  61. package/dist/src/modular/helpers/example-value-helpers.js.map +1 -1
  62. package/dist/src/modular/serialization/serialize-utils.js +2 -2
  63. package/dist/src/modular/serialization/serialize-utils.js.map +1 -1
  64. package/dist/src/rlc-common/helpers/imports-util.d.ts +3 -4
  65. package/dist/src/rlc-common/helpers/imports-util.d.ts.map +1 -1
  66. package/dist/src/rlc-common/helpers/imports-util.js +43 -56
  67. package/dist/src/rlc-common/helpers/imports-util.js.map +1 -1
  68. package/dist/src/rlc-common/helpers/name-constructors.d.ts +0 -9
  69. package/dist/src/rlc-common/helpers/name-constructors.d.ts.map +1 -1
  70. package/dist/src/rlc-common/helpers/name-constructors.js +1 -17
  71. package/dist/src/rlc-common/helpers/name-constructors.js.map +1 -1
  72. package/dist/src/rlc-common/index.d.ts +0 -18
  73. package/dist/src/rlc-common/index.d.ts.map +1 -1
  74. package/dist/src/rlc-common/index.js +0 -18
  75. package/dist/src/rlc-common/index.js.map +1 -1
  76. package/dist/src/rlc-common/interfaces.d.ts +2 -20
  77. package/dist/src/rlc-common/interfaces.d.ts.map +1 -1
  78. package/dist/src/rlc-common/interfaces.js.map +1 -1
  79. package/dist/src/rlc-common/metadata/build-api-extractor-config.d.ts +1 -1
  80. package/dist/src/rlc-common/metadata/build-api-extractor-config.d.ts.map +1 -1
  81. package/dist/src/rlc-common/metadata/build-api-extractor-config.js +5 -42
  82. package/dist/src/rlc-common/metadata/build-api-extractor-config.js.map +1 -1
  83. package/dist/src/rlc-common/metadata/build-es-lint-config.d.ts +2 -2
  84. package/dist/src/rlc-common/metadata/build-es-lint-config.d.ts.map +1 -1
  85. package/dist/src/rlc-common/metadata/build-es-lint-config.js +3 -41
  86. package/dist/src/rlc-common/metadata/build-es-lint-config.js.map +1 -1
  87. package/dist/src/rlc-common/metadata/build-package-file.d.ts.map +1 -1
  88. package/dist/src/rlc-common/metadata/build-package-file.js +25 -73
  89. package/dist/src/rlc-common/metadata/build-package-file.js.map +1 -1
  90. package/dist/src/rlc-common/metadata/build-readme-file.d.ts +2 -2
  91. package/dist/src/rlc-common/metadata/build-readme-file.d.ts.map +1 -1
  92. package/dist/src/rlc-common/metadata/build-readme-file.js +18 -108
  93. package/dist/src/rlc-common/metadata/build-readme-file.js.map +1 -1
  94. package/dist/src/rlc-common/metadata/build-sample-env-file.d.ts.map +1 -1
  95. package/dist/src/rlc-common/metadata/build-sample-env-file.js +1 -2
  96. package/dist/src/rlc-common/metadata/build-sample-env-file.js.map +1 -1
  97. package/dist/src/rlc-common/metadata/build-test-config.d.ts.map +1 -1
  98. package/dist/src/rlc-common/metadata/build-test-config.js +1 -4
  99. package/dist/src/rlc-common/metadata/build-test-config.js.map +1 -1
  100. package/dist/src/rlc-common/metadata/build-ts-config.d.ts +2 -2
  101. package/dist/src/rlc-common/metadata/build-ts-config.d.ts.map +1 -1
  102. package/dist/src/rlc-common/metadata/build-ts-config.js +19 -60
  103. package/dist/src/rlc-common/metadata/build-ts-config.js.map +1 -1
  104. package/dist/src/rlc-common/metadata/build-warp-config.d.ts +1 -1
  105. package/dist/src/rlc-common/metadata/build-warp-config.d.ts.map +1 -1
  106. package/dist/src/rlc-common/metadata/build-warp-config.js +0 -3
  107. package/dist/src/rlc-common/metadata/build-warp-config.js.map +1 -1
  108. package/dist/src/rlc-common/metadata/package-json/azure-package-common.d.ts +1 -38
  109. package/dist/src/rlc-common/metadata/package-json/azure-package-common.d.ts.map +1 -1
  110. package/dist/src/rlc-common/metadata/package-json/azure-package-common.js +1 -108
  111. package/dist/src/rlc-common/metadata/package-json/azure-package-common.js.map +1 -1
  112. package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.d.ts +0 -39
  113. package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.d.ts.map +1 -1
  114. package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.js +4 -20
  115. package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.js.map +1 -1
  116. package/dist/src/rlc-common/metadata/package-json/package-common.d.ts +1 -22
  117. package/dist/src/rlc-common/metadata/package-json/package-common.d.ts.map +1 -1
  118. package/dist/src/rlc-common/metadata/package-json/package-common.js +21 -98
  119. package/dist/src/rlc-common/metadata/package-json/package-common.js.map +1 -1
  120. package/dist/src/rlc-common/static/polling-content.d.ts +1 -1
  121. package/dist/src/rlc-common/static/polling-content.d.ts.map +1 -1
  122. package/dist/src/rlc-common/static/polling-content.js +1 -1
  123. package/dist/src/rlc-common/test/build-recorded-client.d.ts +1 -1
  124. package/dist/src/rlc-common/test/build-recorded-client.d.ts.map +1 -1
  125. package/dist/src/rlc-common/test/build-recorded-client.js +2 -5
  126. package/dist/src/rlc-common/test/build-recorded-client.js.map +1 -1
  127. package/dist/src/rlc-common/test/build-sample-test.d.ts +1 -1
  128. package/dist/src/rlc-common/test/build-sample-test.d.ts.map +1 -1
  129. package/dist/src/rlc-common/test/build-sample-test.js +2 -5
  130. package/dist/src/rlc-common/test/build-sample-test.js.map +1 -1
  131. package/dist/src/rlc-common/test/build-snippets.d.ts +1 -1
  132. package/dist/src/rlc-common/test/build-snippets.d.ts.map +1 -1
  133. package/dist/src/rlc-common/test/build-snippets.js +2 -6
  134. package/dist/src/rlc-common/test/build-snippets.js.map +1 -1
  135. package/dist/src/rlc-common/test/template.d.ts +3 -3
  136. package/dist/src/rlc-common/test/template.d.ts.map +1 -1
  137. package/dist/src/rlc-common/test/template.js +1 -35
  138. package/dist/src/rlc-common/test/template.js.map +1 -1
  139. package/dist/src/transform/transform-helper-function-details.d.ts +2 -2
  140. package/dist/src/transform/transform-helper-function-details.d.ts.map +1 -1
  141. package/dist/src/transform/transform-helper-function-details.js +1 -9
  142. package/dist/src/transform/transform-helper-function-details.js.map +1 -1
  143. package/dist/src/transform/transform-schemas.js +1 -1
  144. package/dist/src/transform/transform-schemas.js.map +1 -1
  145. package/dist/src/transform/transform.d.ts.map +1 -1
  146. package/dist/src/transform/transform.js +9 -16
  147. package/dist/src/transform/transform.js.map +1 -1
  148. package/dist/src/transform/transfrom-rlc-options.d.ts +2 -2
  149. package/dist/src/transform/transfrom-rlc-options.d.ts.map +1 -1
  150. package/dist/src/transform/transfrom-rlc-options.js +29 -94
  151. package/dist/src/transform/transfrom-rlc-options.js.map +1 -1
  152. package/dist/src/utils/client-utils.d.ts +1 -1
  153. package/dist/src/utils/client-utils.d.ts.map +1 -1
  154. package/dist/src/utils/client-utils.js +4 -5
  155. package/dist/src/utils/client-utils.js.map +1 -1
  156. package/dist/src/utils/emit-util.d.ts +0 -1
  157. package/dist/src/utils/emit-util.d.ts.map +1 -1
  158. package/dist/src/utils/emit-util.js +13 -24
  159. package/dist/src/utils/emit-util.js.map +1 -1
  160. package/dist/src/utils/file-system-utils.d.ts +4 -4
  161. package/dist/src/utils/file-system-utils.d.ts.map +1 -1
  162. package/dist/src/utils/file-system-utils.js +14 -16
  163. package/dist/src/utils/file-system-utils.js.map +1 -1
  164. package/dist/src/utils/import-helper.js +3 -3
  165. package/dist/src/utils/import-helper.js.map +1 -1
  166. package/dist/src/utils/model-utils.d.ts +1 -1
  167. package/dist/src/utils/model-utils.d.ts.map +1 -1
  168. package/dist/src/utils/model-utils.js +4 -11
  169. package/dist/src/utils/model-utils.js.map +1 -1
  170. package/dist/src/utils/resolve-project-root.d.ts +6 -4
  171. package/dist/src/utils/resolve-project-root.d.ts.map +1 -1
  172. package/dist/src/utils/resolve-project-root.js +11 -18
  173. package/dist/src/utils/resolve-project-root.js.map +1 -1
  174. package/dist/tsconfig.tsbuildinfo +1 -1
  175. package/package.json +44 -59
  176. package/src/framework/hooks/binder.ts +4 -5
  177. package/src/framework/hooks/sdk-types.ts +2 -3
  178. package/src/framework/load-static-helpers.ts +38 -41
  179. package/src/framework/sample.ts +1 -1
  180. package/src/index.ts +126 -204
  181. package/src/lib.ts +32 -143
  182. package/src/modular/build-classical-client.ts +2 -2
  183. package/src/modular/build-client-context.ts +6 -14
  184. package/src/modular/build-project-files.ts +11 -4
  185. package/src/modular/build-restore-poller.ts +2 -2
  186. package/src/modular/build-root-index.ts +9 -13
  187. package/src/modular/build-subpath-index.ts +4 -4
  188. package/src/modular/emit-logger-file.ts +0 -3
  189. package/src/modular/emit-models-options.ts +2 -2
  190. package/src/modular/emit-models.ts +7 -23
  191. package/src/modular/emit-samples.ts +10 -26
  192. package/src/modular/emit-tests.ts +28 -11
  193. package/src/modular/helpers/client-helpers.ts +7 -17
  194. package/src/modular/helpers/example-value-helpers.ts +11 -26
  195. package/src/modular/serialization/serialize-utils.ts +2 -2
  196. package/src/rlc-common/helpers/imports-util.ts +44 -56
  197. package/src/rlc-common/helpers/name-constructors.ts +1 -23
  198. package/src/rlc-common/index.ts +0 -18
  199. package/src/rlc-common/interfaces.ts +2 -23
  200. package/src/rlc-common/metadata/build-api-extractor-config.ts +5 -47
  201. package/src/rlc-common/metadata/build-es-lint-config.ts +3 -42
  202. package/src/rlc-common/metadata/build-package-file.ts +24 -86
  203. package/src/rlc-common/metadata/build-readme-file.ts +19 -121
  204. package/src/rlc-common/metadata/build-sample-env-file.ts +1 -4
  205. package/src/rlc-common/metadata/build-test-config.ts +1 -6
  206. package/src/rlc-common/metadata/build-ts-config.ts +30 -72
  207. package/src/rlc-common/metadata/build-warp-config.ts +0 -4
  208. package/src/rlc-common/metadata/package-json/azure-package-common.ts +2 -134
  209. package/src/rlc-common/metadata/package-json/build-azure-monorepo-package.ts +4 -24
  210. package/src/rlc-common/metadata/package-json/package-common.ts +22 -120
  211. package/src/rlc-common/static/polling-content.ts +1 -1
  212. package/src/rlc-common/test/build-recorded-client.ts +2 -5
  213. package/src/rlc-common/test/build-sample-test.ts +2 -5
  214. package/src/rlc-common/test/build-snippets.ts +2 -6
  215. package/src/rlc-common/test/template.ts +1 -35
  216. package/src/transform/transform-helper-function-details.ts +1 -10
  217. package/src/transform/transform-schemas.ts +1 -1
  218. package/src/transform/transform.ts +8 -19
  219. package/src/transform/transfrom-rlc-options.ts +29 -127
  220. package/src/utils/client-utils.ts +4 -5
  221. package/src/utils/emit-util.ts +14 -39
  222. package/src/utils/file-system-utils.ts +14 -15
  223. package/src/utils/import-helper.ts +3 -3
  224. package/src/utils/model-utils.ts +4 -17
  225. package/src/utils/resolve-project-root.ts +11 -24
  226. package/dist/src/rlc-common/build-client-definitions.d.ts +0 -6
  227. package/dist/src/rlc-common/build-client-definitions.d.ts.map +0 -1
  228. package/dist/src/rlc-common/build-client-definitions.js +0 -157
  229. package/dist/src/rlc-common/build-client-definitions.js.map +0 -1
  230. package/dist/src/rlc-common/build-client.d.ts +0 -9
  231. package/dist/src/rlc-common/build-client.d.ts.map +0 -1
  232. package/dist/src/rlc-common/build-client.js +0 -391
  233. package/dist/src/rlc-common/build-client.js.map +0 -1
  234. package/dist/src/rlc-common/build-index-file.d.ts +0 -6
  235. package/dist/src/rlc-common/build-index-file.d.ts.map +0 -1
  236. package/dist/src/rlc-common/build-index-file.js +0 -241
  237. package/dist/src/rlc-common/build-index-file.js.map +0 -1
  238. package/dist/src/rlc-common/build-is-unexpected-helper.d.ts +0 -6
  239. package/dist/src/rlc-common/build-is-unexpected-helper.d.ts.map +0 -1
  240. package/dist/src/rlc-common/build-is-unexpected-helper.js +0 -223
  241. package/dist/src/rlc-common/build-is-unexpected-helper.js.map +0 -1
  242. package/dist/src/rlc-common/build-logger.d.ts +0 -6
  243. package/dist/src/rlc-common/build-logger.d.ts.map +0 -1
  244. package/dist/src/rlc-common/build-logger.js +0 -31
  245. package/dist/src/rlc-common/build-logger.js.map +0 -1
  246. package/dist/src/rlc-common/build-method-shortcuts.d.ts +0 -5
  247. package/dist/src/rlc-common/build-method-shortcuts.d.ts.map +0 -1
  248. package/dist/src/rlc-common/build-method-shortcuts.js +0 -54
  249. package/dist/src/rlc-common/build-method-shortcuts.js.map +0 -1
  250. package/dist/src/rlc-common/build-object-types.d.ts +0 -29
  251. package/dist/src/rlc-common/build-object-types.d.ts.map +0 -1
  252. package/dist/src/rlc-common/build-object-types.js +0 -412
  253. package/dist/src/rlc-common/build-object-types.js.map +0 -1
  254. package/dist/src/rlc-common/build-paginate-helper.d.ts +0 -6
  255. package/dist/src/rlc-common/build-paginate-helper.d.ts.map +0 -1
  256. package/dist/src/rlc-common/build-paginate-helper.js +0 -27
  257. package/dist/src/rlc-common/build-paginate-helper.js.map +0 -1
  258. package/dist/src/rlc-common/build-parameter-types.d.ts +0 -14
  259. package/dist/src/rlc-common/build-parameter-types.d.ts.map +0 -1
  260. package/dist/src/rlc-common/build-parameter-types.js +0 -391
  261. package/dist/src/rlc-common/build-parameter-types.js.map +0 -1
  262. package/dist/src/rlc-common/build-polling-helper.d.ts +0 -6
  263. package/dist/src/rlc-common/build-polling-helper.d.ts.map +0 -1
  264. package/dist/src/rlc-common/build-polling-helper.js +0 -61
  265. package/dist/src/rlc-common/build-polling-helper.js.map +0 -1
  266. package/dist/src/rlc-common/build-response-types.d.ts +0 -6
  267. package/dist/src/rlc-common/build-response-types.d.ts.map +0 -1
  268. package/dist/src/rlc-common/build-response-types.js +0 -143
  269. package/dist/src/rlc-common/build-response-types.js.map +0 -1
  270. package/dist/src/rlc-common/build-samples.d.ts +0 -3
  271. package/dist/src/rlc-common/build-samples.d.ts.map +0 -1
  272. package/dist/src/rlc-common/build-samples.js +0 -30
  273. package/dist/src/rlc-common/build-samples.js.map +0 -1
  274. package/dist/src/rlc-common/build-schema-type.d.ts +0 -20
  275. package/dist/src/rlc-common/build-schema-type.d.ts.map +0 -1
  276. package/dist/src/rlc-common/build-schema-type.js +0 -71
  277. package/dist/src/rlc-common/build-schema-type.js.map +0 -1
  278. package/dist/src/rlc-common/build-serialize-helper.d.ts +0 -6
  279. package/dist/src/rlc-common/build-serialize-helper.d.ts.map +0 -1
  280. package/dist/src/rlc-common/build-serialize-helper.js +0 -36
  281. package/dist/src/rlc-common/build-serialize-helper.js.map +0 -1
  282. package/dist/src/rlc-common/build-top-level-index-file.d.ts +0 -6
  283. package/dist/src/rlc-common/build-top-level-index-file.d.ts.map +0 -1
  284. package/dist/src/rlc-common/build-top-level-index-file.js +0 -48
  285. package/dist/src/rlc-common/build-top-level-index-file.js.map +0 -1
  286. package/dist/src/rlc-common/helpers/package-util.d.ts +0 -7
  287. package/dist/src/rlc-common/helpers/package-util.d.ts.map +0 -1
  288. package/dist/src/rlc-common/helpers/package-util.js +0 -10
  289. package/dist/src/rlc-common/helpers/package-util.js.map +0 -1
  290. package/dist/src/rlc-common/helpers/path-utils.d.ts +0 -2
  291. package/dist/src/rlc-common/helpers/path-utils.d.ts.map +0 -1
  292. package/dist/src/rlc-common/helpers/path-utils.js +0 -10
  293. package/dist/src/rlc-common/helpers/path-utils.js.map +0 -1
  294. package/dist/src/rlc-common/helpers/shortcut-methods.d.ts +0 -4
  295. package/dist/src/rlc-common/helpers/shortcut-methods.d.ts.map +0 -1
  296. package/dist/src/rlc-common/helpers/shortcut-methods.js +0 -49
  297. package/dist/src/rlc-common/helpers/shortcut-methods.js.map +0 -1
  298. package/dist/src/rlc-common/helpers/value-generation-util.d.ts +0 -12
  299. package/dist/src/rlc-common/helpers/value-generation-util.d.ts.map +0 -1
  300. package/dist/src/rlc-common/helpers/value-generation-util.js +0 -161
  301. package/dist/src/rlc-common/helpers/value-generation-util.js.map +0 -1
  302. package/dist/src/rlc-common/metadata/build-rollup-config.d.ts +0 -6
  303. package/dist/src/rlc-common/metadata/build-rollup-config.d.ts.map +0 -1
  304. package/dist/src/rlc-common/metadata/build-rollup-config.js +0 -140
  305. package/dist/src/rlc-common/metadata/build-rollup-config.js.map +0 -1
  306. package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.d.ts +0 -8
  307. package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.d.ts.map +0 -1
  308. package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.js +0 -101
  309. package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.js.map +0 -1
  310. package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.d.ts +0 -57
  311. package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.d.ts.map +0 -1
  312. package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.js +0 -53
  313. package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.js.map +0 -1
  314. package/dist/src/rlc-common/transform-sample-groups.d.ts +0 -9
  315. package/dist/src/rlc-common/transform-sample-groups.d.ts.map +0 -1
  316. package/dist/src/rlc-common/transform-sample-groups.js +0 -313
  317. package/dist/src/rlc-common/transform-sample-groups.js.map +0 -1
  318. package/dist/src/utils/dirname.d.ts +0 -9
  319. package/dist/src/utils/dirname.d.ts.map +0 -1
  320. package/dist/src/utils/dirname.js +0 -12
  321. package/dist/src/utils/dirname.js.map +0 -1
  322. package/src/rlc-common/build-client-definitions.ts +0 -235
  323. package/src/rlc-common/build-client.ts +0 -490
  324. package/src/rlc-common/build-index-file.ts +0 -344
  325. package/src/rlc-common/build-is-unexpected-helper.ts +0 -248
  326. package/src/rlc-common/build-logger.ts +0 -43
  327. package/src/rlc-common/build-method-shortcuts.ts +0 -71
  328. package/src/rlc-common/build-object-types.ts +0 -603
  329. package/src/rlc-common/build-paginate-helper.ts +0 -31
  330. package/src/rlc-common/build-parameter-types.ts +0 -554
  331. package/src/rlc-common/build-polling-helper.ts +0 -83
  332. package/src/rlc-common/build-response-types.ts +0 -180
  333. package/src/rlc-common/build-samples.ts +0 -32
  334. package/src/rlc-common/build-schema-type.ts +0 -89
  335. package/src/rlc-common/build-serialize-helper.ts +0 -49
  336. package/src/rlc-common/build-top-level-index-file.ts +0 -58
  337. package/src/rlc-common/helpers/package-util.ts +0 -13
  338. package/src/rlc-common/helpers/path-utils.ts +0 -10
  339. package/src/rlc-common/helpers/shortcut-methods.ts +0 -58
  340. package/src/rlc-common/helpers/value-generation-util.ts +0 -234
  341. package/src/rlc-common/metadata/build-rollup-config.ts +0 -147
  342. package/src/rlc-common/metadata/package-json/build-azure-standalone-package.ts +0 -123
  343. package/src/rlc-common/metadata/package-json/build-flavorless-package.ts +0 -68
  344. package/src/rlc-common/transform-sample-groups.ts +0 -407
  345. package/src/utils/dirname.ts +0 -12
package/src/lib.ts CHANGED
@@ -3,7 +3,7 @@
3
3
 
4
4
  import { createTypeSpecLibrary, JSONSchemaType, paramMessage } from "@typespec/compiler";
5
5
  import { Options } from "prettier";
6
- import { DependencyInfo, PackageDetails, PackageFlavor, ServiceInfo } from "./rlc-common/index.js";
6
+ import { PackageDetails } from "./rlc-common/index.js";
7
7
 
8
8
  export interface EmitterOptions {
9
9
  /**
@@ -13,9 +13,6 @@ export interface EmitterOptions {
13
13
  * currently affected by this option.
14
14
  */
15
15
  "include-headers-in-response"?: boolean;
16
- "include-shortcuts"?: boolean;
17
- "multi-client"?: boolean;
18
- batch?: any[];
19
16
  "package-details"?: PackageDetails;
20
17
  "add-credentials"?: boolean;
21
18
  /** Three possible values:
@@ -42,19 +39,9 @@ export interface EmitterOptions {
42
39
  */
43
40
  "generate-test"?: boolean;
44
41
  "generate-sample"?: boolean;
45
- "azure-sdk-for-js"?: boolean;
46
- "azure-output-directory"?: string;
47
42
  "is-typespec-test"?: boolean;
48
- title?: string;
49
- "dependency-info"?: DependencyInfo;
50
- "product-doc-link"?: string;
51
- "service-info"?: ServiceInfo;
52
43
  "azure-arm"?: boolean;
53
- "source-from"?: "TypeSpec" | "Swagger";
54
- "is-modular-library"?: boolean;
55
- "module-kind"?: "esm";
56
44
  "enable-operation-group"?: boolean;
57
- flavor?: PackageFlavor;
58
45
  "enable-model-namespace"?: boolean;
59
46
  "hierarchy-client"?: boolean;
60
47
  "compatibility-mode"?: boolean;
@@ -63,10 +50,8 @@ export interface EmitterOptions {
63
50
  "clear-output-folder"?: boolean;
64
51
  "ignore-property-name-normalize"?: boolean;
65
52
  "compatibility-query-multi-format"?: boolean;
66
- branded?: boolean;
67
53
  "typespec-title-map"?: Record<string, string>;
68
54
  "ignore-enum-member-name-normalize"?: boolean;
69
- "default-value-object"?: boolean;
70
55
  //TODO should remove this after finish the release tool test
71
56
  "should-use-pnpm-dep"?: boolean;
72
57
  "ignore-nullable-on-optional"?: boolean;
@@ -93,7 +78,6 @@ export interface EmitterOptions {
93
78
  /**
94
79
  * When set to true, generates React Native build targets (tsconfig, warp target,
95
80
  * package.json exports). Defaults to `false`.
96
- * Only applicable when `azure-sdk-for-js` is `true`.
97
81
  */
98
82
  "generate-react-native-target"?: boolean;
99
83
  }
@@ -108,24 +92,6 @@ export const RLCOptionsSchema: JSONSchemaType<EmitterOptions> = {
108
92
  description:
109
93
  "This option is used to indicate whether to include response headers in the generated response type. When set to true, the generated response type will include response headers as properties.",
110
94
  },
111
- "include-shortcuts": {
112
- type: "boolean",
113
- nullable: true,
114
- description: "Deprecated option for RLC legacy generation.",
115
- },
116
- "multi-client": {
117
- type: "boolean",
118
- nullable: true,
119
- description: "Deprecated option for RLC legacy generation.",
120
- },
121
- batch: {
122
- type: "array",
123
- nullable: true,
124
- items: {
125
- type: "string",
126
- },
127
- description: "Deprecated option for RLC legacy generation.",
128
- },
129
95
  "package-details": {
130
96
  type: "object",
131
97
  additionalProperties: true,
@@ -145,18 +111,18 @@ export const RLCOptionsSchema: JSONSchemaType<EmitterOptions> = {
145
111
  "add-credentials": {
146
112
  type: "boolean",
147
113
  nullable: true,
148
- description: `
149
- We support two types of authentication: Azure Key Credential(AzureKey) and Token credential(AADToken), any other will need to be handled manually.
150
-
151
- There are two ways to set up our credential details
152
-
153
- - To use \`@useAuth\` decorator in TypeSpec
154
- - To config in yaml file
155
-
156
- Please notice defining in TypeSpec is recommended and also has higher priority than second one.
157
-
158
- To enable credential in \`tspconfig.yaml\` and we need to provide more details to let codegen know types.
159
- `,
114
+ description: [
115
+ "We support two types of authentication: Azure Key Credential(AzureKey) and Token credential(AADToken), any other will need to be handled manually.",
116
+ "",
117
+ "There are two ways to set up our credential details",
118
+ "",
119
+ "- To use `@useAuth` decorator in TypeSpec",
120
+ "- To config in yaml file",
121
+ "",
122
+ "Please notice defining in TypeSpec is recommended and also has higher priority than second one.",
123
+ "",
124
+ "To enable credential in `tspconfig.yaml` and we need to provide more details to let codegen know types.",
125
+ ].join("\n"),
160
126
  },
161
127
  "credential-scopes": {
162
128
  type: "array",
@@ -186,20 +152,18 @@ export const RLCOptionsSchema: JSONSchemaType<EmitterOptions> = {
186
152
  "generate-metadata": {
187
153
  type: "boolean",
188
154
  nullable: true,
189
- description: `
190
- Whether to generate metadata files which includes package.json, README.md and tsconfig.json etc. Defaults to \`undefined\`. If there's not a package.json under package-dir, defaults to \`true\`. but if you'd like to disable this feature you could set it as \`false\`.
191
- `,
155
+ description:
156
+ "Whether to generate metadata files which includes package.json, README.md and tsconfig.json etc. Defaults to `undefined`. If there's not a package.json under package-dir, defaults to `true`. but if you'd like to disable this feature you could set it as `false`.",
192
157
  },
193
158
  "generate-test": {
194
159
  type: "boolean",
195
160
  nullable: true,
196
- description: `
197
- Whether to generate test files, for basic testing of your generated sdks. Defaults to \`undefined\`.
198
- other cases:
199
- - If azure-sdk-for-js is \`false\`. Defaults to \`false\`.
200
- - If azure-sdk-for-js is \`true\` but there's a test folder under package-dir. Defaults to \`false\`.
201
- - If azure-sdk-for-js is \`true\` but there's not a test folder under package-dir. Defaults to \`true\`.
202
- `,
161
+ description: [
162
+ "Whether to generate test files, for basic testing of your generated sdks. Defaults to `undefined`.",
163
+ "other cases:",
164
+ "- If there's a test folder under package-dir. Defaults to `false`.",
165
+ "- If there's not a test folder under package-dir. Defaults to `true`.",
166
+ ].join("\n"),
203
167
  },
204
168
  "generate-sample": {
205
169
  type: "boolean",
@@ -207,70 +171,16 @@ export const RLCOptionsSchema: JSONSchemaType<EmitterOptions> = {
207
171
  description:
208
172
  "Whether to generate sample files, for basic samples of your generated sdks. Defaults to `undefined`. Management packages' default to `true`.",
209
173
  },
210
- "azure-sdk-for-js": {
211
- type: "boolean",
212
- nullable: true,
213
- description:
214
- "This is used to indicate your project is generated in [azure-sdk-for-js](https://github.com/Azure/azure-sdk-for-js) repo or not. If your package is located in that repo we'll leverage `dev-tool` to accelerate our building and testing, however if not we'll remove the dependency for that tool. Defaults to `undefined`. Services with Flavor equal to 'Azure' default to 'true'. ",
215
- },
216
- "azure-output-directory": {
217
- type: "string",
218
- nullable: true,
219
- description: "Deprecated option for RLC legacy generation",
220
- },
221
174
  "is-typespec-test": {
222
175
  type: "boolean",
223
176
  nullable: true,
224
177
  description: "Internal option for test",
225
178
  },
226
- title: {
227
- type: "string",
228
- nullable: true,
229
- description: "Deprecated option for RLC legacy generation.",
230
- },
231
- "dependency-info": {
232
- type: "object",
233
- additionalProperties: true,
234
- properties: {
235
- link: { type: "string", nullable: false },
236
- description: { type: "string", nullable: false },
237
- },
238
- required: [],
239
- nullable: true,
240
- description: "Deprecated option for RLC legacy generation.",
241
- },
242
- "product-doc-link": {
243
- type: "string",
244
- nullable: true,
245
- description: "Deprecated option for RLC legacy generation.",
246
- },
247
- "service-info": {
248
- type: "object",
249
- additionalProperties: true,
250
- properties: {
251
- title: { type: "string", nullable: true },
252
- description: { type: "string", nullable: true },
253
- },
254
- nullable: true,
255
- description: "Deprecated option for RLC legacy generation.",
256
- },
257
179
  "azure-arm": {
258
180
  type: "boolean",
259
181
  nullable: true,
260
182
  description: "Whether the package is an arm package.",
261
183
  },
262
- "source-from": {
263
- type: "string",
264
- nullable: true,
265
- description: "Internal option, the value is default for TypeSpec generation",
266
- },
267
- "is-modular-library": {
268
- type: "boolean",
269
- nullable: true,
270
- default: false,
271
- description:
272
- "Whether to generate a Modular library. Defaults to `false`. Arm packages default to `true`.",
273
- },
274
184
  "enable-operation-group": {
275
185
  type: "boolean",
276
186
  nullable: true,
@@ -289,23 +199,6 @@ export const RLCOptionsSchema: JSONSchemaType<EmitterOptions> = {
289
199
  description:
290
200
  "An option to organize the client in a hierarchical way as defined by `@clientInitialization`. This is true by default.",
291
201
  },
292
- branded: {
293
- type: "boolean",
294
- nullable: true,
295
- description: "A section of flavor",
296
- },
297
- flavor: {
298
- type: "string",
299
- nullable: true,
300
- description: "The flavor of the SDK.",
301
- },
302
- "module-kind": {
303
- type: "string",
304
- nullable: true,
305
- enum: ["esm"],
306
- default: "esm",
307
- description: "Internal option for test.",
308
- },
309
202
  "compatibility-mode": {
310
203
  type: "boolean",
311
204
  nullable: true,
@@ -347,11 +240,6 @@ export const RLCOptionsSchema: JSONSchemaType<EmitterOptions> = {
347
240
  description:
348
241
  "Whether to generate the backward-compatible code for query parameter serialization for array types in RLC. Defaults to `false`",
349
242
  },
350
- "default-value-object": {
351
- type: "boolean",
352
- nullable: true,
353
- description: "Deprecated option for RLC legacy generation.",
354
- },
355
243
  "typespec-title-map": {
356
244
  type: "object",
357
245
  additionalProperties: {
@@ -359,15 +247,16 @@ export const RLCOptionsSchema: JSONSchemaType<EmitterOptions> = {
359
247
  },
360
248
  required: [],
361
249
  nullable: true,
362
- description: `Only for Modular generation
363
- By default, code generation uses the titles specified in the \`@client\` and \`@service\` decorators in TypeSpec to name modular clients. If you need to override these names, you can configure the \`typespec-title-map\`. The map's keys represent the original client names from TypeSpec, and the values are the desired client names. This configuration supports renaming multiple clients.
364
-
365
- \`\`\`yaml
366
- typespec-title-map:
367
- AnomalyDetectorClient: AnomalyDetectorRest
368
- AnomalyDetectorClient2: AnomalyDetectorRest2
369
- \`\`\`
370
- `,
250
+ description: [
251
+ "Only for Modular generation",
252
+ "By default, code generation uses the titles specified in the `@client` and `@service` decorators in TypeSpec to name modular clients. If you need to override these names, you can configure the `typespec-title-map`. The map's keys represent the original client names from TypeSpec, and the values are the desired client names. This configuration supports renaming multiple clients.",
253
+ "",
254
+ "```yaml",
255
+ "typespec-title-map:",
256
+ " AnomalyDetectorClient: AnomalyDetectorRest",
257
+ " AnomalyDetectorClient2: AnomalyDetectorRest2",
258
+ "```",
259
+ ].join("\n"),
371
260
  },
372
261
  "should-use-pnpm-dep": {
373
262
  type: "boolean",
@@ -402,7 +291,7 @@ export const RLCOptionsSchema: JSONSchemaType<EmitterOptions> = {
402
291
  type: "boolean",
403
292
  nullable: true,
404
293
  description:
405
- "When set to true, generates React Native build targets (tsconfig, warp target, package.json exports). Only applicable when azure-sdk-for-js is true. Defaults to `false`.",
294
+ "When set to true, generates React Native build targets (tsconfig, warp target, package.json exports). Defaults to `false`.",
406
295
  },
407
296
  },
408
297
  required: [],
@@ -290,8 +290,8 @@ function buildClientOperationGroups(
290
290
  } else {
291
291
  // The `rawGroupName` is used to any places where we need normalized name twice so we need to keep the raw as PascalCase.
292
292
  const rawGroupName = normalizeName(prefixes[0] ?? "", NameType.Interface);
293
- const operationName = `_get${rawGroupName}Operations`;
294
- const propertyType = `${rawGroupName}Operations`;
293
+ const operationName = `_get${normalizeName(rawGroupName, NameType.OperationGroup)}Operations`;
294
+ const propertyType = `${normalizeName(rawGroupName, NameType.OperationGroup)}Operations`;
295
295
  // The `groupName` is used to any places where we don't need normalized name again
296
296
  const groupName = normalizeName(rawGroupName, NameType.Property);
297
297
  const existProperty = clientClass.getProperties().filter((p) => {
@@ -1,4 +1,4 @@
1
- import { NameType, isAzurePackage, normalizeName } from "../rlc-common/index.js";
1
+ import { NameType, normalizeName } from "../rlc-common/index.js";
2
2
  import {
3
3
  buildGetClientCredentialParam,
4
4
  buildGetClientEndpointParam,
@@ -164,13 +164,10 @@ export function buildClientContext(
164
164
  });
165
165
 
166
166
  // TODO use binder here
167
- // (for now) now logger for unbranded pkgs
168
- if (isAzurePackage(emitterOptions)) {
169
- clientContextFile.addImportDeclaration({
170
- moduleSpecifier: "../".repeat(hierarchy.length + 1) + "logger.js",
171
- namedImports: ["logger"],
172
- });
173
- }
167
+ clientContextFile.addImportDeclaration({
168
+ moduleSpecifier: "../".repeat(hierarchy.length + 1) + "logger.js",
169
+ namedImports: ["logger"],
170
+ });
174
171
 
175
172
  const factoryFunction = clientContextFile.addFunction({
176
173
  docs: getDocsFromDescription(client.doc),
@@ -241,15 +238,10 @@ export function buildClientContext(
241
238
  if (!apiVersionInEndpoint && apiVersionParam.clientDefaultValue) {
242
239
  apiVersionStatement += `const ${apiVersionParamName} = options.${apiVersionParamName};`;
243
240
  }
244
- } else if (isAzurePackage(emitterOptions)) {
245
- apiVersionStatement += `
246
- if (options.apiVersion) {
247
- logger.warning("This client does not support client api-version, please change it at the operation level");
248
- }`;
249
241
  } else {
250
242
  apiVersionStatement += `
251
243
  if (options.apiVersion) {
252
- console.warn("This client does not support client api-version, please change it at the operation level");
244
+ logger.warning("This client does not support client api-version, please change it at the operation level");
253
245
  }`;
254
246
  }
255
247
  factoryFunction.addStatements(apiVersionStatement);
@@ -1,6 +1,6 @@
1
1
  import { NameType } from "../rlc-common/index.js";
2
2
 
3
- import path from "path/posix";
3
+ import { getRelativePathFromDirectory, joinPaths } from "@typespec/compiler";
4
4
  import { useContext } from "../context-manager.js";
5
5
  import { getClientHierarchyMap, getModularClientOptions } from "../utils/client-utils.js";
6
6
  import { SdkContext } from "../utils/interfaces.js";
@@ -19,7 +19,10 @@ function getSourceRootPrefix(emitterOptions: ModularEmitterOptions, context: Sdk
19
19
  const rootDir = (context.generationPathDetail?.rootDir ?? "").replace(/\\/g, "/");
20
20
 
21
21
  if (rootDir && sourceRoot.startsWith(rootDir)) {
22
- const relativePath = path.relative(rootDir, sourceRoot).replace(/\\/g, "/");
22
+ const relativePath = getRelativePathFromDirectory(rootDir, sourceRoot, false).replace(
23
+ /\\/g,
24
+ "/",
25
+ );
23
26
  return `./${relativePath}`;
24
27
  }
25
28
 
@@ -95,7 +98,7 @@ export function getModuleExports(context: SdkContext, emitterOptions: ModularEmi
95
98
  function getModelSubpaths(emitterOptions: ModularEmitterOptions) {
96
99
  const outputProject = useContext("outputProject");
97
100
  const modelFiles = outputProject.getSourceFiles(
98
- path.join(emitterOptions.modularOptions.sourceRoot.replace(/\\/g, "/"), `models/**/*.ts`),
101
+ joinPaths(emitterOptions.modularOptions.sourceRoot.replace(/\\/g, "/"), `models/**/*.ts`),
99
102
  );
100
103
  const subpath = new Set<string>();
101
104
  for (const modelFile of modelFiles) {
@@ -104,7 +107,11 @@ function getModelSubpaths(emitterOptions: ModularEmitterOptions) {
104
107
  continue;
105
108
  }
106
109
  subpath.add(
107
- path.relative(emitterOptions.modularOptions.sourceRoot.replace(/\\/g, "/"), filepath),
110
+ getRelativePathFromDirectory(
111
+ emitterOptions.modularOptions.sourceRoot.replace(/\\/g, "/"),
112
+ filepath,
113
+ false,
114
+ ),
108
115
  );
109
116
  }
110
117
  return Array.from(subpath);
@@ -1,5 +1,5 @@
1
1
  import { SdkClientType, SdkServiceOperation } from "@azure-tools/typespec-client-generator-core";
2
- import path from "path";
2
+ import { joinPaths } from "@typespec/compiler";
3
3
  import { SourceFile } from "ts-morph";
4
4
  import { useContext } from "../context-manager.js";
5
5
  import { useDependencies } from "../framework/hooks/use-dependencies.js";
@@ -32,7 +32,7 @@ export function buildRestorePoller(
32
32
  return;
33
33
  }
34
34
  const srcPath = emitterOptions.modularOptions.sourceRoot;
35
- const filePath = path.join(
35
+ const filePath = joinPaths(
36
36
  `${srcPath}/${subfolder && subfolder !== "" ? subfolder + "/" : ""}restorePollerHelpers.ts`,
37
37
  );
38
38
  const restorePollerFile = project.createSourceFile(filePath, undefined, {
@@ -1,11 +1,10 @@
1
1
  import { SdkClientType, SdkServiceOperation } from "@azure-tools/typespec-client-generator-core";
2
- import { NoTarget } from "@typespec/compiler";
3
- import { join } from "path/posix";
2
+ import { joinPaths, NoTarget } from "@typespec/compiler";
4
3
  import { Project, SourceFile } from "ts-morph";
5
4
  import { useContext } from "../context-manager.js";
6
5
  import { resolveReference } from "../framework/reference.js";
7
6
  import { reportDiagnostic } from "../lib.js";
8
- import { isAzurePackage, NameType, normalizeName } from "../rlc-common/index.js";
7
+ import { NameType, normalizeName } from "../rlc-common/index.js";
9
8
  import { getModularClientOptions } from "../utils/client-utils.js";
10
9
  import { SdkContext } from "../utils/interfaces.js";
11
10
  import { getMethodHierarchiesMap } from "../utils/operation-util.js";
@@ -29,7 +28,7 @@ export function buildRootIndex(
29
28
  if (!clientMap) {
30
29
  // we still need to export the models if no client is provided
31
30
  exportModels(emitterOptions, rootIndexFile);
32
- exportRestErrorTypes(context, rootIndexFile);
31
+ exportRestErrorTypes(rootIndexFile);
33
32
  return;
34
33
  }
35
34
  const project = useContext("outputProject");
@@ -72,7 +71,7 @@ export function buildRootIndex(
72
71
  exportPagingTypes(context, rootIndexFile);
73
72
  exportFileContentsType(context, rootIndexFile);
74
73
  exportAzureCloudTypes(context, rootIndexFile);
75
- exportRestErrorTypes(context, rootIndexFile);
74
+ exportRestErrorTypes(rootIndexFile);
76
75
  }
77
76
 
78
77
  function exportModels(
@@ -106,10 +105,7 @@ function exportAzureCloudTypes(context: SdkContext, rootIndexFile: SourceFile) {
106
105
  }
107
106
  }
108
107
 
109
- function exportRestErrorTypes(context: SdkContext, rootIndexFile: SourceFile) {
110
- if (!isAzurePackage({ options: context.rlcOptions })) {
111
- return;
112
- }
108
+ function exportRestErrorTypes(rootIndexFile: SourceFile) {
113
109
  const existingExports = getExistingExports(rootIndexFile);
114
110
  const namedExports = ["RestError", "isRestError"].filter((name) => !existingExports.has(name));
115
111
  if (namedExports.length > 0) {
@@ -298,7 +294,7 @@ function exportModules(
298
294
  .getDirectories()
299
295
  .filter((dir) => {
300
296
  const formattedDir = dir.getPath().replace(/\\/g, "/");
301
- const targetPath = join(srcPath, subfolder, moduleName).replace(/\\/g, "/");
297
+ const targetPath = joinPaths(srcPath, subfolder, moduleName).replace(/\\/g, "/");
302
298
  return formattedDir.startsWith(targetPath);
303
299
  })
304
300
  .map((dir) => {
@@ -309,17 +305,17 @@ function exportModules(
309
305
  .getDirectories()
310
306
  .filter((dir) => {
311
307
  const formattedDir = dir.getPath().replace(/\\/g, "/");
312
- const targetPath = join(srcPath, subfolder, moduleName).replace(/\\/g, "/");
308
+ const targetPath = joinPaths(srcPath, subfolder, moduleName).replace(/\\/g, "/");
313
309
  return formattedDir.startsWith(targetPath);
314
310
  })
315
311
  .map((dir) => {
316
312
  return dir.getPath().replace(/\\/g, "/");
317
313
  });
318
314
  } else {
319
- folders = [join(srcPath, subfolder, moduleName).replace(/\\/g, "/")];
315
+ folders = [joinPaths(srcPath, subfolder, moduleName).replace(/\\/g, "/")];
320
316
  }
321
317
  for (const folder of folders) {
322
- const apiFilePattern = join(folder, "index.ts").replace(/\\/g, "/");
318
+ const apiFilePattern = joinPaths(folder, "index.ts").replace(/\\/g, "/");
323
319
  const modelsFile = project.getSourceFile(apiFilePattern);
324
320
  if (!modelsFile) {
325
321
  continue;
@@ -1,7 +1,7 @@
1
1
  import { SdkClientType, SdkServiceOperation } from "@azure-tools/typespec-client-generator-core";
2
+ import { joinPaths } from "@typespec/compiler";
2
3
  import { ModularEmitterOptions } from "./interfaces.js";
3
4
 
4
- import { join } from "path";
5
5
  import { Node, SourceFile } from "ts-morph";
6
6
  import { useContext } from "../context-manager.js";
7
7
  import { getModularClientOptions } from "../utils/client-utils.js";
@@ -29,7 +29,7 @@ export function buildSubpathIndexFile(
29
29
  .getDirectories()
30
30
  .filter((dir) => {
31
31
  const formattedDir = dir.getPath().replace(/\\/g, "/");
32
- const targetPath = join(srcPath, subfolder, subpath).replace(/\\/g, "/");
32
+ const targetPath = joinPaths(srcPath, subfolder, subpath).replace(/\\/g, "/");
33
33
  return (
34
34
  formattedDir.startsWith(targetPath) && !project.getSourceFile(`${formattedDir}/index.ts`)
35
35
  );
@@ -38,10 +38,10 @@ export function buildSubpathIndexFile(
38
38
  return dir.getPath().replace(/\\/g, "/");
39
39
  });
40
40
  } else {
41
- folders = [join(srcPath, subfolder, subpath).replace(/\\/g, "/")];
41
+ folders = [joinPaths(srcPath, subfolder, subpath).replace(/\\/g, "/")];
42
42
  }
43
43
  for (const folder of folders) {
44
- const apiFilePattern = subpath === "models" ? join(folder, "models.ts") : folder;
44
+ const apiFilePattern = subpath === "models" ? joinPaths(folder, "models.ts") : folder;
45
45
  const apiFiles = project.getSourceFiles().filter((file) => {
46
46
  if (subpath === "api" && options.recursive) {
47
47
  return file.getDirectoryPath().replace(/\\/g, "/") === apiFilePattern.replace(/\\/g, "/");
@@ -3,9 +3,6 @@ import { ModularEmitterOptions } from "./interfaces.js";
3
3
 
4
4
  export function emitLoggerFile(emitterOptions: ModularEmitterOptions, srcPath: string = "src") {
5
5
  const project = useContext("outputProject");
6
- if (emitterOptions.options.flavor !== "azure") {
7
- return;
8
- }
9
6
 
10
7
  const sourceFile = project.createSourceFile(`${srcPath}/logger.ts`, "", {
11
8
  overwrite: true,
@@ -1,4 +1,4 @@
1
- import * as path from "path";
1
+ import { joinPaths } from "@typespec/compiler";
2
2
 
3
3
  import { ModularEmitterOptions } from "./interfaces.js";
4
4
 
@@ -25,7 +25,7 @@ export function buildApiOptions(
25
25
  for (const [prefixKey, operations] of methodMap) {
26
26
  const prefixes = prefixKey.split("/");
27
27
  const modelOptionsFile = project.createSourceFile(
28
- path.join(
28
+ joinPaths(
29
29
  emitterOptions.modularOptions.sourceRoot,
30
30
  subfolder ?? "",
31
31
  `api`,
@@ -36,16 +36,15 @@ import {
36
36
  getMultipartFileTypeExpression,
37
37
  } from "./type-expressions/get-model-expression.js";
38
38
 
39
- import { getNamespaceFullName, NoTarget } from "@typespec/compiler";
39
+ import { getNamespaceFullName, joinPaths, NoTarget } from "@typespec/compiler";
40
40
  import { isMetadata, isOrExtendsHttpFile, Visibility } from "@typespec/http";
41
- import path from "path";
42
41
  import { useContext } from "../context-manager.js";
43
42
  import { addDeclaration } from "../framework/declaration.js";
44
43
  import {
45
44
  emitQueue,
46
45
  flattenPropertyModelMap,
47
46
  getAllOperationsFromClient,
48
- pagedModelsKeptPublic,
47
+ pagedModelsUsedInNonPagingOps,
49
48
  } from "../framework/hooks/sdk-types.js";
50
49
  import { refkey } from "../framework/refkey.js";
51
50
  import { reportDiagnostic } from "../lib.js";
@@ -304,7 +303,7 @@ export function getApiVersionEnum(context: SdkContext) {
304
303
  }
305
304
 
306
305
  export function getModelsPath(sourceRoot: string, modelNamespace: string[] = []): string {
307
- return path.join(
306
+ return joinPaths(
308
307
  ...[
309
308
  sourceRoot,
310
309
  "models",
@@ -842,7 +841,8 @@ export function normalizeModelName(
842
841
  }
843
842
  const namespacePrefix = context.rlcOptions?.enableModelNamespace ? segments.join("") : "";
844
843
  const internalModelPrefix =
845
- (isPagedResultModel(context, type) && !pagedModelsKeptPublic.has(type)) || type.isGeneratedName
844
+ (isPagedResultModel(context, type) && !pagedModelsUsedInNonPagingOps.has(type)) ||
845
+ type.isGeneratedName
846
846
  ? "_"
847
847
  : "";
848
848
  return `${internalModelPrefix}${normalizeName(namespacePrefix + type.name, nameType, true)}${unionSuffix}`;
@@ -932,7 +932,7 @@ export function visitPackageTypes(context: SdkContext) {
932
932
  const { sdkPackage } = context;
933
933
  emitQueue.clear();
934
934
  flattenPropertyModelMap.clear();
935
- pagedModelsKeptPublic.clear();
935
+ pagedModelsUsedInNonPagingOps.clear();
936
936
  // Add all models in the package to the emit queue
937
937
  for (const model of sdkPackage.models) {
938
938
  visitType(context, model);
@@ -1015,19 +1015,7 @@ function trackPagedModelInNonPagingMethod(
1015
1015
  if (method.kind !== "basic" && method.kind !== "lro") return;
1016
1016
  const respType = method.response.type;
1017
1017
  if (respType && isPagedResultModel(context, respType)) {
1018
- pagedModelsKeptPublic.add(respType);
1019
- }
1020
- }
1021
-
1022
- /**
1023
- * If a paged result model is used as a model property type, mark it so that
1024
- * normalizeModelName keeps it public (no "_" prefix).
1025
- */
1026
- function trackPagedModelUsedAsProperty(context: SdkContext, type: SdkType): void {
1027
- // Unwrap array types to check the element type
1028
- const resolved = type.kind === "array" ? type.valueType : type;
1029
- if (resolved && isPagedResultModel(context, resolved)) {
1030
- pagedModelsKeptPublic.add(resolved);
1018
+ pagedModelsUsedInNonPagingOps.add(respType);
1031
1019
  }
1032
1020
  }
1033
1021
 
@@ -1056,10 +1044,6 @@ function visitType(context: SdkContext, type: SdkType | undefined) {
1056
1044
  if (property.flatten && property.type.kind === "model") {
1057
1045
  flattenPropertyModelMap.set(property, type);
1058
1046
  }
1059
- // If a paged result model is used as a model property (not as a paging
1060
- // operation response), it must stay public (no "_" prefix) because users
1061
- // interact with it directly through the property.
1062
- trackPagedModelUsedAsProperty(context, property.type);
1063
1047
  }
1064
1048
  if (type.discriminatedSubtypes) {
1065
1049
  for (const subType of Object.values(type.discriminatedSubtypes)) {