@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.
- package/CHANGELOG.md +0 -9
- package/README.md +68 -105
- package/dist/src/framework/hooks/binder.d.ts +1 -1
- package/dist/src/framework/hooks/binder.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.js +3 -4
- package/dist/src/framework/hooks/binder.js.map +1 -1
- package/dist/src/framework/hooks/sdk-types.d.ts +2 -3
- package/dist/src/framework/hooks/sdk-types.d.ts.map +1 -1
- package/dist/src/framework/hooks/sdk-types.js +2 -3
- package/dist/src/framework/hooks/sdk-types.js.map +1 -1
- package/dist/src/framework/load-static-helpers.d.ts +4 -1
- package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
- package/dist/src/framework/load-static-helpers.js +26 -34
- package/dist/src/framework/load-static-helpers.js.map +1 -1
- package/dist/src/framework/sample.js +1 -1
- package/dist/src/framework/sample.js.map +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +104 -170
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +2 -18
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +30 -124
- package/dist/src/lib.js.map +1 -1
- package/dist/src/modular/build-classical-client.js +2 -2
- package/dist/src/modular/build-classical-client.js.map +1 -1
- package/dist/src/modular/build-client-context.d.ts.map +1 -1
- package/dist/src/modular/build-client-context.js +6 -15
- package/dist/src/modular/build-client-context.js.map +1 -1
- package/dist/src/modular/build-project-files.d.ts.map +1 -1
- package/dist/src/modular/build-project-files.js +4 -4
- package/dist/src/modular/build-project-files.js.map +1 -1
- package/dist/src/modular/build-restore-poller.js +2 -2
- package/dist/src/modular/build-restore-poller.js.map +1 -1
- package/dist/src/modular/build-root-index.d.ts.map +1 -1
- package/dist/src/modular/build-root-index.js +9 -13
- package/dist/src/modular/build-root-index.js.map +1 -1
- package/dist/src/modular/build-subpath-index.d.ts.map +1 -1
- package/dist/src/modular/build-subpath-index.js +4 -4
- package/dist/src/modular/build-subpath-index.js.map +1 -1
- package/dist/src/modular/emit-logger-file.d.ts.map +1 -1
- package/dist/src/modular/emit-logger-file.js +0 -3
- package/dist/src/modular/emit-logger-file.js.map +1 -1
- package/dist/src/modular/emit-models-options.js +2 -2
- package/dist/src/modular/emit-models-options.js.map +1 -1
- package/dist/src/modular/emit-models.d.ts.map +1 -1
- package/dist/src/modular/emit-models.js +7 -22
- package/dist/src/modular/emit-models.js.map +1 -1
- package/dist/src/modular/emit-samples.d.ts.map +1 -1
- package/dist/src/modular/emit-samples.js +10 -28
- package/dist/src/modular/emit-samples.js.map +1 -1
- package/dist/src/modular/emit-tests.d.ts +2 -1
- package/dist/src/modular/emit-tests.d.ts.map +1 -1
- package/dist/src/modular/emit-tests.js +21 -11
- package/dist/src/modular/emit-tests.js.map +1 -1
- package/dist/src/modular/helpers/client-helpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/client-helpers.js +6 -16
- package/dist/src/modular/helpers/client-helpers.js.map +1 -1
- package/dist/src/modular/helpers/example-value-helpers.d.ts +1 -1
- package/dist/src/modular/helpers/example-value-helpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/example-value-helpers.js +11 -28
- package/dist/src/modular/helpers/example-value-helpers.js.map +1 -1
- package/dist/src/modular/serialization/serialize-utils.js +2 -2
- package/dist/src/modular/serialization/serialize-utils.js.map +1 -1
- package/dist/src/rlc-common/helpers/imports-util.d.ts +3 -4
- package/dist/src/rlc-common/helpers/imports-util.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/imports-util.js +43 -56
- package/dist/src/rlc-common/helpers/imports-util.js.map +1 -1
- package/dist/src/rlc-common/helpers/name-constructors.d.ts +0 -9
- package/dist/src/rlc-common/helpers/name-constructors.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/name-constructors.js +1 -17
- package/dist/src/rlc-common/helpers/name-constructors.js.map +1 -1
- package/dist/src/rlc-common/index.d.ts +0 -18
- package/dist/src/rlc-common/index.d.ts.map +1 -1
- package/dist/src/rlc-common/index.js +0 -18
- package/dist/src/rlc-common/index.js.map +1 -1
- package/dist/src/rlc-common/interfaces.d.ts +2 -20
- package/dist/src/rlc-common/interfaces.d.ts.map +1 -1
- package/dist/src/rlc-common/interfaces.js.map +1 -1
- package/dist/src/rlc-common/metadata/build-api-extractor-config.d.ts +1 -1
- package/dist/src/rlc-common/metadata/build-api-extractor-config.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/build-api-extractor-config.js +5 -42
- package/dist/src/rlc-common/metadata/build-api-extractor-config.js.map +1 -1
- package/dist/src/rlc-common/metadata/build-es-lint-config.d.ts +2 -2
- package/dist/src/rlc-common/metadata/build-es-lint-config.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/build-es-lint-config.js +3 -41
- package/dist/src/rlc-common/metadata/build-es-lint-config.js.map +1 -1
- package/dist/src/rlc-common/metadata/build-package-file.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/build-package-file.js +25 -73
- package/dist/src/rlc-common/metadata/build-package-file.js.map +1 -1
- package/dist/src/rlc-common/metadata/build-readme-file.d.ts +2 -2
- package/dist/src/rlc-common/metadata/build-readme-file.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/build-readme-file.js +18 -108
- package/dist/src/rlc-common/metadata/build-readme-file.js.map +1 -1
- package/dist/src/rlc-common/metadata/build-sample-env-file.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/build-sample-env-file.js +1 -2
- package/dist/src/rlc-common/metadata/build-sample-env-file.js.map +1 -1
- package/dist/src/rlc-common/metadata/build-test-config.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/build-test-config.js +1 -4
- package/dist/src/rlc-common/metadata/build-test-config.js.map +1 -1
- package/dist/src/rlc-common/metadata/build-ts-config.d.ts +2 -2
- package/dist/src/rlc-common/metadata/build-ts-config.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/build-ts-config.js +19 -60
- package/dist/src/rlc-common/metadata/build-ts-config.js.map +1 -1
- package/dist/src/rlc-common/metadata/build-warp-config.d.ts +1 -1
- package/dist/src/rlc-common/metadata/build-warp-config.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/build-warp-config.js +0 -3
- package/dist/src/rlc-common/metadata/build-warp-config.js.map +1 -1
- package/dist/src/rlc-common/metadata/package-json/azure-package-common.d.ts +1 -38
- package/dist/src/rlc-common/metadata/package-json/azure-package-common.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/package-json/azure-package-common.js +1 -108
- package/dist/src/rlc-common/metadata/package-json/azure-package-common.js.map +1 -1
- package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.d.ts +0 -39
- package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.js +4 -20
- package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.js.map +1 -1
- package/dist/src/rlc-common/metadata/package-json/package-common.d.ts +1 -22
- package/dist/src/rlc-common/metadata/package-json/package-common.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/package-json/package-common.js +21 -98
- package/dist/src/rlc-common/metadata/package-json/package-common.js.map +1 -1
- package/dist/src/rlc-common/static/polling-content.d.ts +1 -1
- package/dist/src/rlc-common/static/polling-content.d.ts.map +1 -1
- package/dist/src/rlc-common/static/polling-content.js +1 -1
- package/dist/src/rlc-common/test/build-recorded-client.d.ts +1 -1
- package/dist/src/rlc-common/test/build-recorded-client.d.ts.map +1 -1
- package/dist/src/rlc-common/test/build-recorded-client.js +2 -5
- package/dist/src/rlc-common/test/build-recorded-client.js.map +1 -1
- package/dist/src/rlc-common/test/build-sample-test.d.ts +1 -1
- package/dist/src/rlc-common/test/build-sample-test.d.ts.map +1 -1
- package/dist/src/rlc-common/test/build-sample-test.js +2 -5
- package/dist/src/rlc-common/test/build-sample-test.js.map +1 -1
- package/dist/src/rlc-common/test/build-snippets.d.ts +1 -1
- package/dist/src/rlc-common/test/build-snippets.d.ts.map +1 -1
- package/dist/src/rlc-common/test/build-snippets.js +2 -6
- package/dist/src/rlc-common/test/build-snippets.js.map +1 -1
- package/dist/src/rlc-common/test/template.d.ts +3 -3
- package/dist/src/rlc-common/test/template.d.ts.map +1 -1
- package/dist/src/rlc-common/test/template.js +1 -35
- package/dist/src/rlc-common/test/template.js.map +1 -1
- package/dist/src/transform/transform-helper-function-details.d.ts +2 -2
- package/dist/src/transform/transform-helper-function-details.d.ts.map +1 -1
- package/dist/src/transform/transform-helper-function-details.js +1 -9
- package/dist/src/transform/transform-helper-function-details.js.map +1 -1
- package/dist/src/transform/transform-schemas.js +1 -1
- package/dist/src/transform/transform-schemas.js.map +1 -1
- package/dist/src/transform/transform.d.ts.map +1 -1
- package/dist/src/transform/transform.js +9 -16
- package/dist/src/transform/transform.js.map +1 -1
- package/dist/src/transform/transfrom-rlc-options.d.ts +2 -2
- package/dist/src/transform/transfrom-rlc-options.d.ts.map +1 -1
- package/dist/src/transform/transfrom-rlc-options.js +29 -94
- package/dist/src/transform/transfrom-rlc-options.js.map +1 -1
- package/dist/src/utils/client-utils.d.ts +1 -1
- package/dist/src/utils/client-utils.d.ts.map +1 -1
- package/dist/src/utils/client-utils.js +4 -5
- package/dist/src/utils/client-utils.js.map +1 -1
- package/dist/src/utils/emit-util.d.ts +0 -1
- package/dist/src/utils/emit-util.d.ts.map +1 -1
- package/dist/src/utils/emit-util.js +13 -24
- package/dist/src/utils/emit-util.js.map +1 -1
- package/dist/src/utils/file-system-utils.d.ts +4 -4
- package/dist/src/utils/file-system-utils.d.ts.map +1 -1
- package/dist/src/utils/file-system-utils.js +14 -16
- package/dist/src/utils/file-system-utils.js.map +1 -1
- package/dist/src/utils/import-helper.js +3 -3
- package/dist/src/utils/import-helper.js.map +1 -1
- package/dist/src/utils/model-utils.d.ts +1 -1
- package/dist/src/utils/model-utils.d.ts.map +1 -1
- package/dist/src/utils/model-utils.js +4 -11
- package/dist/src/utils/model-utils.js.map +1 -1
- package/dist/src/utils/resolve-project-root.d.ts +6 -4
- package/dist/src/utils/resolve-project-root.d.ts.map +1 -1
- package/dist/src/utils/resolve-project-root.js +11 -18
- package/dist/src/utils/resolve-project-root.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +44 -59
- package/src/framework/hooks/binder.ts +4 -5
- package/src/framework/hooks/sdk-types.ts +2 -3
- package/src/framework/load-static-helpers.ts +38 -41
- package/src/framework/sample.ts +1 -1
- package/src/index.ts +126 -204
- package/src/lib.ts +32 -143
- package/src/modular/build-classical-client.ts +2 -2
- package/src/modular/build-client-context.ts +6 -14
- package/src/modular/build-project-files.ts +11 -4
- package/src/modular/build-restore-poller.ts +2 -2
- package/src/modular/build-root-index.ts +9 -13
- package/src/modular/build-subpath-index.ts +4 -4
- package/src/modular/emit-logger-file.ts +0 -3
- package/src/modular/emit-models-options.ts +2 -2
- package/src/modular/emit-models.ts +7 -23
- package/src/modular/emit-samples.ts +10 -26
- package/src/modular/emit-tests.ts +28 -11
- package/src/modular/helpers/client-helpers.ts +7 -17
- package/src/modular/helpers/example-value-helpers.ts +11 -26
- package/src/modular/serialization/serialize-utils.ts +2 -2
- package/src/rlc-common/helpers/imports-util.ts +44 -56
- package/src/rlc-common/helpers/name-constructors.ts +1 -23
- package/src/rlc-common/index.ts +0 -18
- package/src/rlc-common/interfaces.ts +2 -23
- package/src/rlc-common/metadata/build-api-extractor-config.ts +5 -47
- package/src/rlc-common/metadata/build-es-lint-config.ts +3 -42
- package/src/rlc-common/metadata/build-package-file.ts +24 -86
- package/src/rlc-common/metadata/build-readme-file.ts +19 -121
- package/src/rlc-common/metadata/build-sample-env-file.ts +1 -4
- package/src/rlc-common/metadata/build-test-config.ts +1 -6
- package/src/rlc-common/metadata/build-ts-config.ts +30 -72
- package/src/rlc-common/metadata/build-warp-config.ts +0 -4
- package/src/rlc-common/metadata/package-json/azure-package-common.ts +2 -134
- package/src/rlc-common/metadata/package-json/build-azure-monorepo-package.ts +4 -24
- package/src/rlc-common/metadata/package-json/package-common.ts +22 -120
- package/src/rlc-common/static/polling-content.ts +1 -1
- package/src/rlc-common/test/build-recorded-client.ts +2 -5
- package/src/rlc-common/test/build-sample-test.ts +2 -5
- package/src/rlc-common/test/build-snippets.ts +2 -6
- package/src/rlc-common/test/template.ts +1 -35
- package/src/transform/transform-helper-function-details.ts +1 -10
- package/src/transform/transform-schemas.ts +1 -1
- package/src/transform/transform.ts +8 -19
- package/src/transform/transfrom-rlc-options.ts +29 -127
- package/src/utils/client-utils.ts +4 -5
- package/src/utils/emit-util.ts +14 -39
- package/src/utils/file-system-utils.ts +14 -15
- package/src/utils/import-helper.ts +3 -3
- package/src/utils/model-utils.ts +4 -17
- package/src/utils/resolve-project-root.ts +11 -24
- package/dist/src/rlc-common/build-client-definitions.d.ts +0 -6
- package/dist/src/rlc-common/build-client-definitions.d.ts.map +0 -1
- package/dist/src/rlc-common/build-client-definitions.js +0 -157
- package/dist/src/rlc-common/build-client-definitions.js.map +0 -1
- package/dist/src/rlc-common/build-client.d.ts +0 -9
- package/dist/src/rlc-common/build-client.d.ts.map +0 -1
- package/dist/src/rlc-common/build-client.js +0 -391
- package/dist/src/rlc-common/build-client.js.map +0 -1
- package/dist/src/rlc-common/build-index-file.d.ts +0 -6
- package/dist/src/rlc-common/build-index-file.d.ts.map +0 -1
- package/dist/src/rlc-common/build-index-file.js +0 -241
- package/dist/src/rlc-common/build-index-file.js.map +0 -1
- package/dist/src/rlc-common/build-is-unexpected-helper.d.ts +0 -6
- package/dist/src/rlc-common/build-is-unexpected-helper.d.ts.map +0 -1
- package/dist/src/rlc-common/build-is-unexpected-helper.js +0 -223
- package/dist/src/rlc-common/build-is-unexpected-helper.js.map +0 -1
- package/dist/src/rlc-common/build-logger.d.ts +0 -6
- package/dist/src/rlc-common/build-logger.d.ts.map +0 -1
- package/dist/src/rlc-common/build-logger.js +0 -31
- package/dist/src/rlc-common/build-logger.js.map +0 -1
- package/dist/src/rlc-common/build-method-shortcuts.d.ts +0 -5
- package/dist/src/rlc-common/build-method-shortcuts.d.ts.map +0 -1
- package/dist/src/rlc-common/build-method-shortcuts.js +0 -54
- package/dist/src/rlc-common/build-method-shortcuts.js.map +0 -1
- package/dist/src/rlc-common/build-object-types.d.ts +0 -29
- package/dist/src/rlc-common/build-object-types.d.ts.map +0 -1
- package/dist/src/rlc-common/build-object-types.js +0 -412
- package/dist/src/rlc-common/build-object-types.js.map +0 -1
- package/dist/src/rlc-common/build-paginate-helper.d.ts +0 -6
- package/dist/src/rlc-common/build-paginate-helper.d.ts.map +0 -1
- package/dist/src/rlc-common/build-paginate-helper.js +0 -27
- package/dist/src/rlc-common/build-paginate-helper.js.map +0 -1
- package/dist/src/rlc-common/build-parameter-types.d.ts +0 -14
- package/dist/src/rlc-common/build-parameter-types.d.ts.map +0 -1
- package/dist/src/rlc-common/build-parameter-types.js +0 -391
- package/dist/src/rlc-common/build-parameter-types.js.map +0 -1
- package/dist/src/rlc-common/build-polling-helper.d.ts +0 -6
- package/dist/src/rlc-common/build-polling-helper.d.ts.map +0 -1
- package/dist/src/rlc-common/build-polling-helper.js +0 -61
- package/dist/src/rlc-common/build-polling-helper.js.map +0 -1
- package/dist/src/rlc-common/build-response-types.d.ts +0 -6
- package/dist/src/rlc-common/build-response-types.d.ts.map +0 -1
- package/dist/src/rlc-common/build-response-types.js +0 -143
- package/dist/src/rlc-common/build-response-types.js.map +0 -1
- package/dist/src/rlc-common/build-samples.d.ts +0 -3
- package/dist/src/rlc-common/build-samples.d.ts.map +0 -1
- package/dist/src/rlc-common/build-samples.js +0 -30
- package/dist/src/rlc-common/build-samples.js.map +0 -1
- package/dist/src/rlc-common/build-schema-type.d.ts +0 -20
- package/dist/src/rlc-common/build-schema-type.d.ts.map +0 -1
- package/dist/src/rlc-common/build-schema-type.js +0 -71
- package/dist/src/rlc-common/build-schema-type.js.map +0 -1
- package/dist/src/rlc-common/build-serialize-helper.d.ts +0 -6
- package/dist/src/rlc-common/build-serialize-helper.d.ts.map +0 -1
- package/dist/src/rlc-common/build-serialize-helper.js +0 -36
- package/dist/src/rlc-common/build-serialize-helper.js.map +0 -1
- package/dist/src/rlc-common/build-top-level-index-file.d.ts +0 -6
- package/dist/src/rlc-common/build-top-level-index-file.d.ts.map +0 -1
- package/dist/src/rlc-common/build-top-level-index-file.js +0 -48
- package/dist/src/rlc-common/build-top-level-index-file.js.map +0 -1
- package/dist/src/rlc-common/helpers/package-util.d.ts +0 -7
- package/dist/src/rlc-common/helpers/package-util.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/package-util.js +0 -10
- package/dist/src/rlc-common/helpers/package-util.js.map +0 -1
- package/dist/src/rlc-common/helpers/path-utils.d.ts +0 -2
- package/dist/src/rlc-common/helpers/path-utils.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/path-utils.js +0 -10
- package/dist/src/rlc-common/helpers/path-utils.js.map +0 -1
- package/dist/src/rlc-common/helpers/shortcut-methods.d.ts +0 -4
- package/dist/src/rlc-common/helpers/shortcut-methods.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/shortcut-methods.js +0 -49
- package/dist/src/rlc-common/helpers/shortcut-methods.js.map +0 -1
- package/dist/src/rlc-common/helpers/value-generation-util.d.ts +0 -12
- package/dist/src/rlc-common/helpers/value-generation-util.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/value-generation-util.js +0 -161
- package/dist/src/rlc-common/helpers/value-generation-util.js.map +0 -1
- package/dist/src/rlc-common/metadata/build-rollup-config.d.ts +0 -6
- package/dist/src/rlc-common/metadata/build-rollup-config.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/build-rollup-config.js +0 -140
- package/dist/src/rlc-common/metadata/build-rollup-config.js.map +0 -1
- package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.d.ts +0 -8
- package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.js +0 -101
- package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.js.map +0 -1
- package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.d.ts +0 -57
- package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.js +0 -53
- package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.js.map +0 -1
- package/dist/src/rlc-common/transform-sample-groups.d.ts +0 -9
- package/dist/src/rlc-common/transform-sample-groups.d.ts.map +0 -1
- package/dist/src/rlc-common/transform-sample-groups.js +0 -313
- package/dist/src/rlc-common/transform-sample-groups.js.map +0 -1
- package/dist/src/utils/dirname.d.ts +0 -9
- package/dist/src/utils/dirname.d.ts.map +0 -1
- package/dist/src/utils/dirname.js +0 -12
- package/dist/src/utils/dirname.js.map +0 -1
- package/src/rlc-common/build-client-definitions.ts +0 -235
- package/src/rlc-common/build-client.ts +0 -490
- package/src/rlc-common/build-index-file.ts +0 -344
- package/src/rlc-common/build-is-unexpected-helper.ts +0 -248
- package/src/rlc-common/build-logger.ts +0 -43
- package/src/rlc-common/build-method-shortcuts.ts +0 -71
- package/src/rlc-common/build-object-types.ts +0 -603
- package/src/rlc-common/build-paginate-helper.ts +0 -31
- package/src/rlc-common/build-parameter-types.ts +0 -554
- package/src/rlc-common/build-polling-helper.ts +0 -83
- package/src/rlc-common/build-response-types.ts +0 -180
- package/src/rlc-common/build-samples.ts +0 -32
- package/src/rlc-common/build-schema-type.ts +0 -89
- package/src/rlc-common/build-serialize-helper.ts +0 -49
- package/src/rlc-common/build-top-level-index-file.ts +0 -58
- package/src/rlc-common/helpers/package-util.ts +0 -13
- package/src/rlc-common/helpers/path-utils.ts +0 -10
- package/src/rlc-common/helpers/shortcut-methods.ts +0 -58
- package/src/rlc-common/helpers/value-generation-util.ts +0 -234
- package/src/rlc-common/metadata/build-rollup-config.ts +0 -147
- package/src/rlc-common/metadata/package-json/build-azure-standalone-package.ts +0 -123
- package/src/rlc-common/metadata/package-json/build-flavorless-package.ts +0 -68
- package/src/rlc-common/transform-sample-groups.ts +0 -407
- package/src/utils/dirname.ts +0 -12
|
@@ -8,14 +8,13 @@ import {
|
|
|
8
8
|
SdkModelPropertyType,
|
|
9
9
|
SdkServiceOperation,
|
|
10
10
|
} from "@azure-tools/typespec-client-generator-core";
|
|
11
|
-
import { NoTarget } from "@typespec/compiler";
|
|
12
|
-
import { join } from "path";
|
|
11
|
+
import { joinPaths, NoTarget } from "@typespec/compiler";
|
|
13
12
|
import { FunctionDeclarationStructure, SourceFile, StructureKind } from "ts-morph";
|
|
14
13
|
import { useContext } from "../context-manager.js";
|
|
15
14
|
import { resolveReference } from "../framework/reference.js";
|
|
16
15
|
import { reportDiagnostic } from "../index.js";
|
|
17
16
|
import { AzureIdentityDependencies } from "../modular/external-dependencies.js";
|
|
18
|
-
import {
|
|
17
|
+
import { NameType, normalizeName } from "../rlc-common/index.js";
|
|
19
18
|
import { getSubscriptionId } from "../transform/transfrom-rlc-options.js";
|
|
20
19
|
import { hasKeyCredential, hasTokenCredential } from "../utils/credential-utils.js";
|
|
21
20
|
import { SdkContext } from "../utils/interfaces.js";
|
|
@@ -105,13 +104,13 @@ function emitMethodSamples(
|
|
|
105
104
|
}
|
|
106
105
|
const project = useContext("outputProject");
|
|
107
106
|
const operationPrefix = `${options.classicalMethodPrefix ?? ""} ${method.oriName ?? method.name}`;
|
|
108
|
-
const sampleFolder =
|
|
107
|
+
const sampleFolder = joinPaths(
|
|
109
108
|
dpgContext.generationPathDetail?.rootDir ?? "",
|
|
110
109
|
"samples-dev",
|
|
111
110
|
options.subFolder ?? "",
|
|
112
111
|
);
|
|
113
112
|
const fileName = normalizeName(`${operationPrefix} Sample`, NameType.File);
|
|
114
|
-
const sourceFile = project.createSourceFile(
|
|
113
|
+
const sourceFile = project.createSourceFile(joinPaths(sampleFolder, `${fileName}.ts`), "", {
|
|
115
114
|
overwrite: true,
|
|
116
115
|
});
|
|
117
116
|
const exampleFunctions = [];
|
|
@@ -465,7 +464,7 @@ function prepareExampleParameters(
|
|
|
465
464
|
}
|
|
466
465
|
|
|
467
466
|
function getCredentialExampleValue(
|
|
468
|
-
|
|
467
|
+
_dpgContext: SdkContext,
|
|
469
468
|
initialization: SdkClientInitializationType,
|
|
470
469
|
): ExampleValue | undefined {
|
|
471
470
|
const keyCredential = hasKeyCredential(initialization),
|
|
@@ -476,26 +475,11 @@ function getCredentialExampleValue(
|
|
|
476
475
|
name: "credential",
|
|
477
476
|
};
|
|
478
477
|
if (keyCredential || tokenCredential) {
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
};
|
|
485
|
-
} else if (keyCredential) {
|
|
486
|
-
// Support ApiKeyCredential for non-Azure packages
|
|
487
|
-
return {
|
|
488
|
-
...defaultSetting,
|
|
489
|
-
value: `{ key: "INPUT_YOUR_KEY_HERE" }`,
|
|
490
|
-
};
|
|
491
|
-
} else if (tokenCredential) {
|
|
492
|
-
// Support TokenCredential for non-Azure packages
|
|
493
|
-
return {
|
|
494
|
-
...defaultSetting,
|
|
495
|
-
value: `{ getToken: async () => {
|
|
496
|
-
return { token: "INPUT_YOUR_TOKEN_HERE", expiresOnTimestamp: now() }; } }`,
|
|
497
|
-
};
|
|
498
|
-
}
|
|
478
|
+
// Support DefaultAzureCredential for Azure packages
|
|
479
|
+
return {
|
|
480
|
+
...defaultSetting,
|
|
481
|
+
value: `new ${resolveReference(AzureIdentityDependencies.DefaultAzureCredential)}()`,
|
|
482
|
+
};
|
|
499
483
|
}
|
|
500
484
|
return undefined;
|
|
501
485
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { join } from "path";
|
|
1
|
+
import { type CompilerHost, joinPaths } from "@typespec/compiler";
|
|
3
2
|
import { SourceFile } from "ts-morph";
|
|
4
3
|
import { resolveReference } from "../framework/reference.js";
|
|
5
4
|
import { NameType, normalizeName } from "../rlc-common/index.js";
|
|
@@ -22,23 +21,36 @@ import { CreateRecorderHelpers } from "./static-helpers-metadata.js";
|
|
|
22
21
|
/**
|
|
23
22
|
* Clean up the test/generated folder before generating new tests
|
|
24
23
|
*/
|
|
25
|
-
async function cleanupTestFolder(dpgContext: SdkContext) {
|
|
24
|
+
async function cleanupTestFolder(dpgContext: SdkContext, host: CompilerHost) {
|
|
26
25
|
const clients = dpgContext.sdkPackage.clients;
|
|
27
|
-
const baseTestFolder =
|
|
26
|
+
const baseTestFolder = joinPaths(
|
|
27
|
+
dpgContext.generationPathDetail?.rootDir ?? "",
|
|
28
|
+
"test",
|
|
29
|
+
"generated",
|
|
30
|
+
);
|
|
31
|
+
|
|
32
|
+
async function dirExists(path: string): Promise<boolean> {
|
|
33
|
+
try {
|
|
34
|
+
const s = await host.stat(path);
|
|
35
|
+
return s.isDirectory();
|
|
36
|
+
} catch {
|
|
37
|
+
return false;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
28
40
|
|
|
29
41
|
// If there are multiple clients, clean up subfolders
|
|
30
42
|
if (clients.length > 1) {
|
|
31
43
|
for (const client of clients) {
|
|
32
44
|
const subFolder = normalizeName(getClassicalClientName(client), NameType.File);
|
|
33
|
-
const clientTestFolder =
|
|
34
|
-
if (
|
|
35
|
-
|
|
45
|
+
const clientTestFolder = joinPaths(baseTestFolder, subFolder);
|
|
46
|
+
if (await dirExists(clientTestFolder)) {
|
|
47
|
+
await host.rm(clientTestFolder, { recursive: true });
|
|
36
48
|
}
|
|
37
49
|
}
|
|
38
50
|
} else {
|
|
39
51
|
// Single client, clean up the entire test/generated folder
|
|
40
|
-
if (
|
|
41
|
-
|
|
52
|
+
if (await dirExists(baseTestFolder)) {
|
|
53
|
+
await host.rm(baseTestFolder, { recursive: true });
|
|
42
54
|
}
|
|
43
55
|
}
|
|
44
56
|
}
|
|
@@ -46,9 +58,14 @@ async function cleanupTestFolder(dpgContext: SdkContext) {
|
|
|
46
58
|
/**
|
|
47
59
|
* Helpers to emit tests similar to samples
|
|
48
60
|
*/
|
|
49
|
-
export async function emitTests(
|
|
61
|
+
export async function emitTests(
|
|
62
|
+
dpgContext: SdkContext,
|
|
63
|
+
host?: CompilerHost,
|
|
64
|
+
): Promise<SourceFile[]> {
|
|
50
65
|
// Clean up the test/generated folder before generating new tests
|
|
51
|
-
|
|
66
|
+
if (host) {
|
|
67
|
+
await cleanupTestFolder(dpgContext, host);
|
|
68
|
+
}
|
|
52
69
|
|
|
53
70
|
return iterateClientsAndMethods(dpgContext, emitMethodTests);
|
|
54
71
|
}
|
|
@@ -10,7 +10,7 @@ import { OptionalKind, ParameterDeclarationStructure, StatementedNode } from "ts
|
|
|
10
10
|
import { ModularEmitterOptions } from "../interfaces.js";
|
|
11
11
|
|
|
12
12
|
import { resolveReference } from "../../framework/reference.js";
|
|
13
|
-
import { NameType, normalizeName
|
|
13
|
+
import { NameType, normalizeName } from "../../rlc-common/index.js";
|
|
14
14
|
import { SdkContext } from "../../utils/interfaces.js";
|
|
15
15
|
import { CloudSettingHelpers } from "../static-helpers-metadata.js";
|
|
16
16
|
import { getTypeExpression } from "../type-expressions/get-type-expression.js";
|
|
@@ -169,16 +169,10 @@ export function buildGetClientEndpointParam(
|
|
|
169
169
|
client: SdkClientType<SdkServiceOperation>,
|
|
170
170
|
): { endpointParamName: string; assignedOptionalParams?: Set<string> } {
|
|
171
171
|
const assignedOptionalParams = new Set<string>();
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
: "";
|
|
177
|
-
coreEndpointParam = `options.endpoint${cloudSettingSuffix}`;
|
|
178
|
-
} else {
|
|
179
|
-
// unbranded does not have the deprecated baseUrl parameter
|
|
180
|
-
coreEndpointParam = `options.endpoint`;
|
|
181
|
-
}
|
|
172
|
+
const cloudSettingSuffix = dpgContext.arm
|
|
173
|
+
? ` ?? ${resolveReference(CloudSettingHelpers.getArmEndpoint)}(options.cloudSetting)`
|
|
174
|
+
: "";
|
|
175
|
+
const coreEndpointParam = `options.endpoint${cloudSettingSuffix}`;
|
|
182
176
|
// Special case: endpoint URL not defined
|
|
183
177
|
const endpointParam = getClientParameters(client, dpgContext, {
|
|
184
178
|
onClientOnly: true,
|
|
@@ -248,7 +242,7 @@ export function buildGetClientOptionsParam(
|
|
|
248
242
|
apiVersionParamName?: string,
|
|
249
243
|
): string {
|
|
250
244
|
const userAgentOptions = buildUserAgentOptions(context, emitterOptions, "azsdk-js-api");
|
|
251
|
-
const loggingOptions = buildLoggingOptions(
|
|
245
|
+
const loggingOptions = buildLoggingOptions();
|
|
252
246
|
const credentials = buildCredentials(emitterOptions, endpointParam);
|
|
253
247
|
|
|
254
248
|
// Use the actual api version parameter name for destructuring, defaulting to "apiVersion"
|
|
@@ -315,11 +309,7 @@ function buildCredentials(
|
|
|
315
309
|
return `{ ${scopes}${apiKeyHeaderName} }`;
|
|
316
310
|
}
|
|
317
311
|
|
|
318
|
-
function buildLoggingOptions(
|
|
319
|
-
if (flavor !== "azure") {
|
|
320
|
-
return undefined;
|
|
321
|
-
}
|
|
322
|
-
|
|
312
|
+
function buildLoggingOptions(): string | undefined {
|
|
323
313
|
return `{ logger: options.loggingOptions?.logger ?? logger.info }`;
|
|
324
314
|
}
|
|
325
315
|
|
|
@@ -8,11 +8,11 @@ import {
|
|
|
8
8
|
SdkModelPropertyType,
|
|
9
9
|
SdkServiceOperation,
|
|
10
10
|
} from "@azure-tools/typespec-client-generator-core";
|
|
11
|
-
import {
|
|
11
|
+
import { joinPaths } from "@typespec/compiler";
|
|
12
12
|
import { SourceFile } from "ts-morph";
|
|
13
13
|
import { useContext } from "../../context-manager.js";
|
|
14
14
|
import { resolveReference } from "../../framework/reference.js";
|
|
15
|
-
import {
|
|
15
|
+
import { NameType, normalizeName } from "../../rlc-common/index.js";
|
|
16
16
|
import { getSubscriptionId } from "../../transform/transfrom-rlc-options.js";
|
|
17
17
|
import { hasKeyCredential, hasTokenCredential } from "../../utils/credential-utils.js";
|
|
18
18
|
import { SdkContext } from "../../utils/interfaces.js";
|
|
@@ -73,7 +73,7 @@ export function prepareCommonValue(
|
|
|
73
73
|
* Get credential value for samples
|
|
74
74
|
*/
|
|
75
75
|
export function getCredentialSampleValue(
|
|
76
|
-
|
|
76
|
+
_dpgContext: SdkContext,
|
|
77
77
|
initialization: SdkClientInitializationType,
|
|
78
78
|
): CommonValue | undefined {
|
|
79
79
|
const keyCredential = hasKeyCredential(initialization),
|
|
@@ -84,26 +84,11 @@ export function getCredentialSampleValue(
|
|
|
84
84
|
name: "credential",
|
|
85
85
|
};
|
|
86
86
|
if (keyCredential || tokenCredential) {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
};
|
|
93
|
-
} else if (keyCredential) {
|
|
94
|
-
// Support ApiKeyCredential for non-Azure packages
|
|
95
|
-
return {
|
|
96
|
-
...defaultSetting,
|
|
97
|
-
value: `{ key: "INPUT_YOUR_KEY_HERE" }`,
|
|
98
|
-
};
|
|
99
|
-
} else if (tokenCredential) {
|
|
100
|
-
// Support TokenCredential for non-Azure packages
|
|
101
|
-
return {
|
|
102
|
-
...defaultSetting,
|
|
103
|
-
value: `{ getToken: async () => {
|
|
104
|
-
return { token: "INPUT_YOUR_TOKEN_HERE", expiresOnTimestamp: Date.now() }; } }`,
|
|
105
|
-
};
|
|
106
|
-
}
|
|
87
|
+
// Support DefaultAzureCredential for Azure packages
|
|
88
|
+
return {
|
|
89
|
+
...defaultSetting,
|
|
90
|
+
value: `new ${resolveReference(AzureIdentityDependencies.DefaultAzureCredential)}()`,
|
|
91
|
+
};
|
|
107
92
|
}
|
|
108
93
|
return undefined;
|
|
109
94
|
}
|
|
@@ -596,8 +581,8 @@ export function createSourceFile(
|
|
|
596
581
|
): SourceFile {
|
|
597
582
|
const project = useContext("outputProject");
|
|
598
583
|
const operationPrefix = `${options.classicalMethodPrefix ?? ""} ${method.oriName ?? method.name}`;
|
|
599
|
-
const baseFolder = type === "sample" ? "samples-dev" :
|
|
600
|
-
const folder =
|
|
584
|
+
const baseFolder = type === "sample" ? "samples-dev" : joinPaths("test", "generated");
|
|
585
|
+
const folder = joinPaths(
|
|
601
586
|
dpgContext.generationPathDetail?.rootDir ?? "",
|
|
602
587
|
baseFolder,
|
|
603
588
|
options.subFolder ?? "",
|
|
@@ -605,7 +590,7 @@ export function createSourceFile(
|
|
|
605
590
|
const fileExtension = type === "sample" ? ".ts" : ".spec.ts";
|
|
606
591
|
const normalizedFileName = normalizeName(fileName || `${operationPrefix} ${type}`, NameType.File);
|
|
607
592
|
|
|
608
|
-
return project.createSourceFile(
|
|
593
|
+
return project.createSourceFile(joinPaths(folder, `${normalizedFileName}${fileExtension}`), "", {
|
|
609
594
|
overwrite: true,
|
|
610
595
|
});
|
|
611
596
|
}
|
|
@@ -61,7 +61,7 @@ export function isSupportedSerializeType(type: SdkType): boolean {
|
|
|
61
61
|
* 6. nested model i.e. model with property that is a model with one of the above three conditions.
|
|
62
62
|
* If we consider array type, with all the above 6 types as the element types.
|
|
63
63
|
*/
|
|
64
|
-
const specialVariantMap = new
|
|
64
|
+
const specialVariantMap = new WeakMap<SdkType, boolean>();
|
|
65
65
|
export function isSpecialUnionVariant(
|
|
66
66
|
t: SdkType & { isNonExhaustive?: boolean },
|
|
67
67
|
variantStack: SdkType[] = [],
|
|
@@ -146,7 +146,7 @@ export function isSpecialHandledUnion(t: SdkType & { isNonExhaustive?: boolean }
|
|
|
146
146
|
return isDiscriminatedUnion(t!) || isPolymorphicUnion(t);
|
|
147
147
|
}
|
|
148
148
|
|
|
149
|
-
const polymorphicUnionMap = new
|
|
149
|
+
const polymorphicUnionMap = new WeakMap<SdkType, boolean>();
|
|
150
150
|
export function isPolymorphicUnion(t: SdkType): boolean {
|
|
151
151
|
if (polymorphicUnionMap.has(t)) {
|
|
152
152
|
return polymorphicUnionMap.get(t) ?? false;
|
|
@@ -1,64 +1,52 @@
|
|
|
1
1
|
import { SourceFile } from "ts-morph";
|
|
2
|
-
import { ImportType, Imports
|
|
2
|
+
import { ImportType, Imports } from "../interfaces.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
-
* Build the common imports for generated SDK
|
|
6
|
-
* @param flavor flavor of SDK to generate, if any. When set to "azure", Azure Core packages will be used. When unset, the generic `ts-http-runtime` package will be used.
|
|
5
|
+
* Build the common imports for generated SDK. Azure Core packages are always used.
|
|
7
6
|
* @returns
|
|
8
7
|
*/
|
|
9
|
-
export function buildRuntimeImports(
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
} as Imports;
|
|
52
|
-
} else {
|
|
53
|
-
// In non-azure branded scope we only have one dependency that is ts-http-runtime
|
|
54
|
-
return {
|
|
55
|
-
commonFallback: {
|
|
56
|
-
type: "commonFallback",
|
|
57
|
-
specifier: "@typespec/ts-http-runtime",
|
|
58
|
-
version: "0.1.0",
|
|
59
|
-
},
|
|
60
|
-
} as Imports;
|
|
61
|
-
}
|
|
8
|
+
export function buildRuntimeImports(): Imports {
|
|
9
|
+
return {
|
|
10
|
+
restClient: {
|
|
11
|
+
type: "restClient",
|
|
12
|
+
specifier: "@azure-rest/core-client",
|
|
13
|
+
version: "^2.0.0",
|
|
14
|
+
},
|
|
15
|
+
coreAuth: {
|
|
16
|
+
type: "coreAuth",
|
|
17
|
+
specifier: "@azure/core-auth",
|
|
18
|
+
version: "^1.6.0",
|
|
19
|
+
},
|
|
20
|
+
restPipeline: {
|
|
21
|
+
type: "restPipeline",
|
|
22
|
+
specifier: "@azure/core-rest-pipeline",
|
|
23
|
+
version: "^1.14.0",
|
|
24
|
+
},
|
|
25
|
+
coreUtil: {
|
|
26
|
+
type: "coreUtil",
|
|
27
|
+
specifier: "@azure/core-util",
|
|
28
|
+
version: "^1.4.0",
|
|
29
|
+
},
|
|
30
|
+
coreLogger: {
|
|
31
|
+
type: "coreLogger",
|
|
32
|
+
specifier: "@azure/logger",
|
|
33
|
+
version: "^1.0.4",
|
|
34
|
+
},
|
|
35
|
+
azureEslintPlugin: {
|
|
36
|
+
type: "azureEslintPlugin",
|
|
37
|
+
specifier: "@azure/eslint-plugin-azure-sdk",
|
|
38
|
+
version: "^3.0.0",
|
|
39
|
+
},
|
|
40
|
+
azureTestRecorder: {
|
|
41
|
+
type: "azureTestRecorder",
|
|
42
|
+
specifier: "@azure-tools/test-recorder",
|
|
43
|
+
version: "^3.0.0",
|
|
44
|
+
},
|
|
45
|
+
azureCoreLro: {
|
|
46
|
+
type: "azureCoreLro",
|
|
47
|
+
specifier: "@azure/core-lro",
|
|
48
|
+
},
|
|
49
|
+
} as Imports;
|
|
62
50
|
}
|
|
63
51
|
|
|
64
52
|
/**
|
|
@@ -76,30 +76,8 @@ export function getParameterTypeName(baseNameOrOperationGroup: string, operation
|
|
|
76
76
|
return normalizeName(`${baseNameOrOperationGroup}_Parameters`, NameType.Interface);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
export interface ModuleName {
|
|
80
|
-
esModulesName: string;
|
|
81
|
-
cjsName: string;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* This is a helper function that gets the right import module depending on the type of
|
|
85
|
-
* library being generated
|
|
86
|
-
*/
|
|
87
|
-
export function getImportModuleName(name: ModuleName, codeModel: RLCModel) {
|
|
88
|
-
if (codeModel.options?.moduleKind === "cjs") {
|
|
89
|
-
return name.cjsName;
|
|
90
|
-
}
|
|
91
|
-
return name.esModulesName;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
79
|
export function getClientName(model: RLCModel) {
|
|
95
|
-
|
|
96
|
-
const clientInterfaceName = model.options?.isModularLibrary
|
|
97
|
-
? model.libraryName
|
|
98
|
-
: clientName.endsWith("Client")
|
|
99
|
-
? `${clientName}`
|
|
100
|
-
: `${clientName}Client`;
|
|
101
|
-
|
|
102
|
-
return clientInterfaceName;
|
|
80
|
+
return model.libraryName;
|
|
103
81
|
}
|
|
104
82
|
|
|
105
83
|
export function getMultipartPartTypeName(schemaName: string, partName: string) {
|
package/src/rlc-common/index.ts
CHANGED
|
@@ -1,28 +1,12 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
export * from "./build-client-definitions.js";
|
|
5
|
-
export * from "./build-client.js";
|
|
6
|
-
export * from "./build-index-file.js";
|
|
7
|
-
export * from "./build-is-unexpected-helper.js";
|
|
8
|
-
export * from "./build-logger.js";
|
|
9
|
-
export * from "./build-paginate-helper.js";
|
|
10
|
-
export * from "./build-parameter-types.js";
|
|
11
|
-
export * from "./build-polling-helper.js";
|
|
12
|
-
export * from "./build-response-types.js";
|
|
13
|
-
export * from "./build-samples.js";
|
|
14
|
-
export * from "./build-schema-type.js";
|
|
15
|
-
export * from "./build-serialize-helper.js";
|
|
16
|
-
export * from "./build-top-level-index-file.js";
|
|
17
4
|
export * from "./helpers/api-version-util.js";
|
|
18
5
|
export * from "./helpers/imports-util.js";
|
|
19
6
|
export * from "./helpers/name-constructors.js";
|
|
20
7
|
export * from "./helpers/name-utils.js";
|
|
21
8
|
export * from "./helpers/operation-helpers.js";
|
|
22
|
-
export * from "./helpers/package-util.js";
|
|
23
9
|
export * from "./helpers/schema-helpers.js";
|
|
24
|
-
export * from "./helpers/shortcut-methods.js";
|
|
25
|
-
export * from "./helpers/value-generation-util.js";
|
|
26
10
|
export * from "./interfaces.js";
|
|
27
11
|
export * from "./metadata/build-api-extractor-config.js";
|
|
28
12
|
export * from "./metadata/build-changelog-file.js";
|
|
@@ -30,7 +14,6 @@ export * from "./metadata/build-es-lint-config.js";
|
|
|
30
14
|
export * from "./metadata/build-license-file.js";
|
|
31
15
|
export * from "./metadata/build-package-file.js";
|
|
32
16
|
export * from "./metadata/build-readme-file.js";
|
|
33
|
-
export * from "./metadata/build-rollup-config.js";
|
|
34
17
|
export * from "./metadata/build-sample-env-file.js";
|
|
35
18
|
export * from "./metadata/build-test-config.js";
|
|
36
19
|
export * from "./metadata/build-ts-config.js";
|
|
@@ -40,4 +23,3 @@ export * from "./test/build-karma-config.js";
|
|
|
40
23
|
export * from "./test/build-recorded-client.js";
|
|
41
24
|
export * from "./test/build-sample-test.js";
|
|
42
25
|
export * from "./test/build-snippets.js";
|
|
43
|
-
export * from "./transform-sample-groups.js";
|
|
@@ -39,7 +39,6 @@ export type ImportType =
|
|
|
39
39
|
| "coreUtil"
|
|
40
40
|
| "coreLogger"
|
|
41
41
|
// this is a fallback import if above imports are not available
|
|
42
|
-
// mainly used in non-branded scope
|
|
43
42
|
| "commonFallback"
|
|
44
43
|
/**azure specific imports */
|
|
45
44
|
| "azureEslintPlugin"
|
|
@@ -191,18 +190,11 @@ export interface OperationLroDetail {
|
|
|
191
190
|
precedence?: number;
|
|
192
191
|
}
|
|
193
192
|
|
|
194
|
-
/**
|
|
195
|
-
* Flavor of the package to generate. If "azure", an Azure-branded package should be generated. If left undefined, a package without Azure branding will be generated.
|
|
196
|
-
*/
|
|
197
|
-
export type PackageFlavor = "azure" | undefined;
|
|
198
|
-
|
|
199
193
|
export interface RLCOptions {
|
|
200
194
|
/**
|
|
201
195
|
* Whether to include response headers in the generated response types. If true, the generated response types will include headers as properties.
|
|
202
196
|
*/
|
|
203
197
|
includeHeadersInResponse?: boolean;
|
|
204
|
-
includeShortcuts?: boolean;
|
|
205
|
-
multiClient?: boolean;
|
|
206
198
|
batch?: any[];
|
|
207
199
|
packageDetails?: PackageDetails;
|
|
208
200
|
addCredentials?: boolean;
|
|
@@ -230,19 +222,11 @@ export interface RLCOptions {
|
|
|
230
222
|
*/
|
|
231
223
|
generateTest?: boolean;
|
|
232
224
|
generateSample?: boolean;
|
|
233
|
-
azureSdkForJs?: boolean;
|
|
234
225
|
azureOutputDirectory?: string;
|
|
235
226
|
isTypeSpecTest?: boolean;
|
|
236
|
-
title?: string;
|
|
237
|
-
dependencyInfo?: DependencyInfo;
|
|
238
|
-
productDocLink?: string;
|
|
239
227
|
serviceInfo?: ServiceInfo;
|
|
240
228
|
azureArm?: boolean;
|
|
241
|
-
sourceFrom?: "TypeSpec" | "Swagger";
|
|
242
|
-
isModularLibrary?: boolean;
|
|
243
|
-
moduleKind?: "esm" | "cjs";
|
|
244
229
|
enableOperationGroup?: boolean;
|
|
245
|
-
flavor?: PackageFlavor;
|
|
246
230
|
enableModelNamespace?: boolean;
|
|
247
231
|
hierarchyClient?: boolean;
|
|
248
232
|
compatibilityMode?: boolean;
|
|
@@ -259,7 +243,7 @@ export interface RLCOptions {
|
|
|
259
243
|
/**
|
|
260
244
|
* When set to true, non-model return types (arrays, scalars, enums, bytes with binary content type)
|
|
261
245
|
* will be wrapped in an XxxResponse type to maintain backward compatibility with HLC.
|
|
262
|
-
* This option defaults to true
|
|
246
|
+
* This option defaults to true unless explicitly set.
|
|
263
247
|
*/
|
|
264
248
|
wrapNonModelReturn?: boolean;
|
|
265
249
|
/**
|
|
@@ -275,7 +259,7 @@ export interface RLCOptions {
|
|
|
275
259
|
treatUnknownAsRecord?: boolean;
|
|
276
260
|
/**
|
|
277
261
|
* When set to true, generates React Native build targets (tsconfig, warp target, package.json exports).
|
|
278
|
-
* Defaults to false.
|
|
262
|
+
* Defaults to false.
|
|
279
263
|
*/
|
|
280
264
|
generateReactNativeTarget?: boolean;
|
|
281
265
|
}
|
|
@@ -285,11 +269,6 @@ export interface ServiceInfo {
|
|
|
285
269
|
description?: string;
|
|
286
270
|
}
|
|
287
271
|
|
|
288
|
-
export interface DependencyInfo {
|
|
289
|
-
link: string;
|
|
290
|
-
description: string;
|
|
291
|
-
}
|
|
292
|
-
|
|
293
272
|
export interface File {
|
|
294
273
|
path: string;
|
|
295
274
|
content: string;
|
|
@@ -4,54 +4,12 @@
|
|
|
4
4
|
import { Project } from "ts-morph";
|
|
5
5
|
import { RLCModel } from "../interfaces.js";
|
|
6
6
|
|
|
7
|
-
export function buildApiExtractorConfig(
|
|
8
|
-
const
|
|
9
|
-
const project = new Project();
|
|
7
|
+
export function buildApiExtractorConfig(_model: RLCModel) {
|
|
8
|
+
const project = new Project({ useInMemoryFileSystem: true });
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
mainEntryPointFilePath = `./types${generateTest || isModularLibrary ? "/src" : ""}/index.d.ts`;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
const config = azureSdkForJs
|
|
18
|
-
? {
|
|
19
|
-
extends: "../../../api-extractor-base.json",
|
|
20
|
-
}
|
|
21
|
-
: {
|
|
22
|
-
$schema:
|
|
23
|
-
"https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
24
|
-
mainEntryPointFilePath,
|
|
25
|
-
docModel: {
|
|
26
|
-
enabled: true,
|
|
27
|
-
},
|
|
28
|
-
apiReport: {
|
|
29
|
-
enabled: true,
|
|
30
|
-
reportFolder: "./review",
|
|
31
|
-
},
|
|
32
|
-
dtsRollup: {
|
|
33
|
-
enabled: true,
|
|
34
|
-
untrimmedFilePath: "",
|
|
35
|
-
publicTrimmedFilePath: `dist/${
|
|
36
|
-
packageDetails?.nameWithoutScope ?? packageDetails?.name
|
|
37
|
-
}.d.ts`,
|
|
38
|
-
},
|
|
39
|
-
messages: {
|
|
40
|
-
tsdocMessageReporting: {
|
|
41
|
-
default: {
|
|
42
|
-
logLevel: "none",
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
extractorMessageReporting: {
|
|
46
|
-
"ae-missing-release-tag": {
|
|
47
|
-
logLevel: "none",
|
|
48
|
-
},
|
|
49
|
-
"ae-unresolved-link": {
|
|
50
|
-
logLevel: "none",
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
};
|
|
10
|
+
const config = {
|
|
11
|
+
extends: "../../../api-extractor-base.json",
|
|
12
|
+
};
|
|
55
13
|
|
|
56
14
|
const filePath = "api-extractor.json";
|
|
57
15
|
const configFile = project.createSourceFile(filePath, JSON.stringify(config), {
|
|
@@ -4,36 +4,6 @@
|
|
|
4
4
|
import { Project } from "ts-morph";
|
|
5
5
|
import { RLCModel } from "../interfaces.js";
|
|
6
6
|
|
|
7
|
-
const eslintConfig = `import azsdkEslint from "@azure/eslint-plugin-azure-sdk";
|
|
8
|
-
|
|
9
|
-
export default azsdkEslint.config([
|
|
10
|
-
{
|
|
11
|
-
rules: {
|
|
12
|
-
"@azure/azure-sdk/ts-modules-only-named": "warn",
|
|
13
|
-
"@azure/azure-sdk/ts-package-json-types": "warn",
|
|
14
|
-
"@azure/azure-sdk/ts-package-json-engine-is-present": "warn",
|
|
15
|
-
"tsdoc/syntax": "warn"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
]);
|
|
19
|
-
`;
|
|
20
|
-
|
|
21
|
-
const esLintConfigEsm = `import azsdkEslint from "@azure/eslint-plugin-azure-sdk";
|
|
22
|
-
|
|
23
|
-
export default azsdkEslint.config([
|
|
24
|
-
{
|
|
25
|
-
rules: {
|
|
26
|
-
"@azure/azure-sdk/ts-modules-only-named": "warn",
|
|
27
|
-
"@azure/azure-sdk/ts-package-json-types": "warn",
|
|
28
|
-
"@azure/azure-sdk/ts-package-json-engine-is-present": "warn",
|
|
29
|
-
"@azure/azure-sdk/ts-package-json-files-required": "off",
|
|
30
|
-
"@azure/azure-sdk/ts-package-json-main-is-cjs": "off",
|
|
31
|
-
"tsdoc/syntax": "warn"
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
]);
|
|
35
|
-
`;
|
|
36
|
-
|
|
37
7
|
const esLintConfigEsmAzureSdk = `import azsdkEslint from "@azure/eslint-plugin-azure-sdk";
|
|
38
8
|
|
|
39
9
|
export default [
|
|
@@ -61,20 +31,11 @@ export default [
|
|
|
61
31
|
];
|
|
62
32
|
`;
|
|
63
33
|
|
|
64
|
-
export function buildEsLintConfig(
|
|
65
|
-
|
|
66
|
-
return;
|
|
67
|
-
}
|
|
68
|
-
const project = new Project();
|
|
34
|
+
export function buildEsLintConfig(_model: RLCModel) {
|
|
35
|
+
const project = new Project({ useInMemoryFileSystem: true });
|
|
69
36
|
const filePath = "eslint.config.mjs";
|
|
70
37
|
|
|
71
|
-
|
|
72
|
-
if (model.options?.moduleKind === "esm") {
|
|
73
|
-
template = model.options?.azureSdkForJs ? esLintConfigEsmAzureSdk : esLintConfigEsm;
|
|
74
|
-
} else {
|
|
75
|
-
template = eslintConfig;
|
|
76
|
-
}
|
|
77
|
-
const configFile = project.createSourceFile("eslint.config.mjs", template, {
|
|
38
|
+
const configFile = project.createSourceFile("eslint.config.mjs", esLintConfigEsmAzureSdk, {
|
|
78
39
|
overwrite: true,
|
|
79
40
|
});
|
|
80
41
|
return {
|