@azure-tools/typespec-ts 0.54.0 → 0.55.0-dev.6
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/README.md +0 -4
- package/dist/src/contextManager.d.ts +5 -5
- package/dist/src/contextManager.d.ts.map +1 -1
- package/dist/src/contextManager.js +3 -3
- package/dist/src/contextManager.js.map +1 -1
- package/dist/src/framework/declaration.d.ts +1 -1
- package/dist/src/framework/declaration.d.ts.map +1 -1
- package/dist/src/framework/declaration.js +2 -4
- package/dist/src/framework/declaration.js.map +1 -1
- package/dist/src/framework/dependency.d.ts.map +1 -1
- 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 +31 -40
- package/dist/src/framework/hooks/binder.js.map +1 -1
- package/dist/src/framework/hooks/sdkTypes.d.ts +1 -1
- package/dist/src/framework/hooks/sdkTypes.d.ts.map +1 -1
- package/dist/src/framework/hooks/sdkTypes.js +8 -12
- package/dist/src/framework/hooks/sdkTypes.js.map +1 -1
- package/dist/src/framework/hooks/useDependencies.d.ts.map +1 -1
- package/dist/src/framework/hooks/useDependencies.js +1 -1
- package/dist/src/framework/hooks/useDependencies.js.map +1 -1
- package/dist/src/framework/load-static-helpers.d.ts +1 -1
- package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
- package/dist/src/framework/load-static-helpers.js +17 -31
- package/dist/src/framework/load-static-helpers.js.map +1 -1
- package/dist/src/framework/reference.d.ts.map +1 -1
- package/dist/src/framework/reference.js +2 -2
- package/dist/src/framework/reference.js.map +1 -1
- package/dist/src/framework/sample.js +8 -8
- package/dist/src/framework/sample.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +103 -92
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +1 -1
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +140 -140
- package/dist/src/lib.js.map +1 -1
- package/dist/src/metaTree.d.ts +1 -1
- package/dist/src/metaTree.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalClient.d.ts +1 -1
- package/dist/src/modular/buildClassicalClient.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalClient.js +60 -74
- package/dist/src/modular/buildClassicalClient.js.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.d.ts +2 -2
- package/dist/src/modular/buildClassicalOperationGroups.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.js +8 -10
- package/dist/src/modular/buildClassicalOperationGroups.js.map +1 -1
- package/dist/src/modular/buildClientContext.d.ts +2 -2
- package/dist/src/modular/buildClientContext.d.ts.map +1 -1
- package/dist/src/modular/buildClientContext.js +31 -38
- package/dist/src/modular/buildClientContext.js.map +1 -1
- package/dist/src/modular/buildModularOptions.d.ts +1 -1
- package/dist/src/modular/buildModularOptions.d.ts.map +1 -1
- package/dist/src/modular/buildModularOptions.js +5 -6
- package/dist/src/modular/buildModularOptions.js.map +1 -1
- package/dist/src/modular/buildOperations.d.ts +3 -3
- package/dist/src/modular/buildOperations.d.ts.map +1 -1
- package/dist/src/modular/buildOperations.js +23 -25
- package/dist/src/modular/buildOperations.js.map +1 -1
- package/dist/src/modular/buildProjectFiles.d.ts +1 -1
- package/dist/src/modular/buildProjectFiles.d.ts.map +1 -1
- package/dist/src/modular/buildProjectFiles.js +8 -11
- package/dist/src/modular/buildProjectFiles.js.map +1 -1
- package/dist/src/modular/buildRestorePoller.d.ts +1 -1
- package/dist/src/modular/buildRestorePoller.d.ts.map +1 -1
- package/dist/src/modular/buildRestorePoller.js +12 -13
- package/dist/src/modular/buildRestorePoller.js.map +1 -1
- package/dist/src/modular/buildRootIndex.d.ts +2 -2
- package/dist/src/modular/buildRootIndex.d.ts.map +1 -1
- package/dist/src/modular/buildRootIndex.js +36 -50
- package/dist/src/modular/buildRootIndex.js.map +1 -1
- package/dist/src/modular/buildSubpathIndex.d.ts.map +1 -1
- package/dist/src/modular/buildSubpathIndex.js +9 -18
- package/dist/src/modular/buildSubpathIndex.js.map +1 -1
- package/dist/src/modular/emitLoggerFile.d.ts.map +1 -1
- package/dist/src/modular/emitLoggerFile.js +4 -4
- package/dist/src/modular/emitLoggerFile.js.map +1 -1
- package/dist/src/modular/emitModels.d.ts +1 -1
- package/dist/src/modular/emitModels.d.ts.map +1 -1
- package/dist/src/modular/emitModels.js +81 -113
- package/dist/src/modular/emitModels.js.map +1 -1
- package/dist/src/modular/emitModelsOptions.d.ts +1 -1
- package/dist/src/modular/emitModelsOptions.d.ts.map +1 -1
- package/dist/src/modular/emitModelsOptions.js +7 -8
- package/dist/src/modular/emitModelsOptions.js.map +1 -1
- package/dist/src/modular/emitSamples.d.ts.map +1 -1
- package/dist/src/modular/emitSamples.js +69 -77
- package/dist/src/modular/emitSamples.js.map +1 -1
- package/dist/src/modular/emitTests.d.ts.map +1 -1
- package/dist/src/modular/emitTests.js +13 -18
- package/dist/src/modular/emitTests.js.map +1 -1
- package/dist/src/modular/external-dependencies.js +54 -54
- package/dist/src/modular/helpers/classicalOperationHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.js +59 -68
- package/dist/src/modular/helpers/classicalOperationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/clientHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.js +31 -54
- package/dist/src/modular/helpers/clientHelpers.js.map +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.js +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.js.map +1 -1
- package/dist/src/modular/helpers/exampleValueHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/exampleValueHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/exampleValueHelpers.js +72 -84
- package/dist/src/modular/helpers/exampleValueHelpers.js.map +1 -1
- package/dist/src/modular/helpers/namingHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/namingHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/namingHelpers.js +7 -10
- package/dist/src/modular/helpers/namingHelpers.js.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.js +204 -288
- package/dist/src/modular/helpers/operationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/typeHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.js +4 -6
- package/dist/src/modular/helpers/typeHelpers.js.map +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.js +58 -67
- package/dist/src/modular/serialization/buildDeserializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.js +65 -75
- package/dist/src/modular/serialization/buildSerializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js +73 -90
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/serializeUtils.d.ts.map +1 -1
- package/dist/src/modular/serialization/serializeUtils.js +25 -33
- package/dist/src/modular/serialization/serializeUtils.js.map +1 -1
- package/dist/src/modular/static-helpers-metadata.js +60 -60
- package/dist/src/modular/type-expressions/get-credential-expression.js +1 -1
- package/dist/src/modular/type-expressions/get-credential-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.js +1 -2
- package/dist/src/modular/type-expressions/get-enum-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-model-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-model-expression.js +10 -13
- package/dist/src/modular/type-expressions/get-model-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.js +2 -3
- package/dist/src/modular/type-expressions/get-nullable-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.js +5 -11
- package/dist/src/modular/type-expressions/get-type-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.js.map +1 -1
- package/dist/src/rlc-common/buildClient.d.ts +1 -1
- package/dist/src/rlc-common/buildClient.d.ts.map +1 -1
- package/dist/src/rlc-common/buildClient.js +67 -89
- package/dist/src/rlc-common/buildClient.js.map +1 -1
- package/dist/src/rlc-common/buildClientDefinitions.d.ts.map +1 -1
- package/dist/src/rlc-common/buildClientDefinitions.js +28 -45
- package/dist/src/rlc-common/buildClientDefinitions.js.map +1 -1
- package/dist/src/rlc-common/buildIndexFile.d.ts.map +1 -1
- package/dist/src/rlc-common/buildIndexFile.js +59 -60
- package/dist/src/rlc-common/buildIndexFile.js.map +1 -1
- package/dist/src/rlc-common/buildIsUnexpectedHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js +37 -38
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js.map +1 -1
- package/dist/src/rlc-common/buildLogger.d.ts.map +1 -1
- package/dist/src/rlc-common/buildLogger.js +4 -5
- package/dist/src/rlc-common/buildLogger.js.map +1 -1
- package/dist/src/rlc-common/buildMethodShortcuts.d.ts.map +1 -1
- package/dist/src/rlc-common/buildMethodShortcuts.js +4 -4
- package/dist/src/rlc-common/buildMethodShortcuts.js.map +1 -1
- package/dist/src/rlc-common/buildObjectTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildObjectTypes.js +57 -96
- package/dist/src/rlc-common/buildObjectTypes.js.map +1 -1
- package/dist/src/rlc-common/buildPaginateHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildPaginateHelper.js +2 -2
- package/dist/src/rlc-common/buildPaginateHelper.js.map +1 -1
- package/dist/src/rlc-common/buildParameterTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildParameterTypes.js +71 -61
- package/dist/src/rlc-common/buildParameterTypes.js.map +1 -1
- package/dist/src/rlc-common/buildPollingHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildPollingHelper.js +9 -10
- package/dist/src/rlc-common/buildPollingHelper.js.map +1 -1
- package/dist/src/rlc-common/buildResponseTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildResponseTypes.js +23 -27
- package/dist/src/rlc-common/buildResponseTypes.js.map +1 -1
- package/dist/src/rlc-common/buildSamples.d.ts +1 -1
- package/dist/src/rlc-common/buildSamples.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSamples.js +2 -2
- package/dist/src/rlc-common/buildSchemaType.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSchemaType.js +31 -13
- package/dist/src/rlc-common/buildSchemaType.js.map +1 -1
- package/dist/src/rlc-common/buildSerializeHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSerializeHelper.js +4 -4
- package/dist/src/rlc-common/buildSerializeHelper.js.map +1 -1
- package/dist/src/rlc-common/buildTopLevelIndexFile.d.ts.map +1 -1
- package/dist/src/rlc-common/buildTopLevelIndexFile.js +9 -13
- package/dist/src/rlc-common/buildTopLevelIndexFile.js.map +1 -1
- package/dist/src/rlc-common/helpers/apiVersionUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/apiVersionUtil.js +6 -8
- package/dist/src/rlc-common/helpers/apiVersionUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/importsUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/importsUtil.js +32 -37
- package/dist/src/rlc-common/helpers/importsUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/nameConstructors.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/nameConstructors.js +2 -4
- package/dist/src/rlc-common/helpers/nameConstructors.js.map +1 -1
- package/dist/src/rlc-common/helpers/nameUtils.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/nameUtils.js +17 -23
- package/dist/src/rlc-common/helpers/nameUtils.js.map +1 -1
- package/dist/src/rlc-common/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/operationHelpers.js +16 -31
- package/dist/src/rlc-common/helpers/operationHelpers.js.map +1 -1
- package/dist/src/rlc-common/helpers/packageUtil.js +3 -6
- package/dist/src/rlc-common/helpers/packageUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/pathUtils.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/pathUtils.js +1 -3
- package/dist/src/rlc-common/helpers/pathUtils.js.map +1 -1
- package/dist/src/rlc-common/helpers/schemaHelpers.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/schemaHelpers.js +3 -7
- package/dist/src/rlc-common/helpers/schemaHelpers.js.map +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.js +2 -2
- package/dist/src/rlc-common/helpers/shortcutMethods.js.map +1 -1
- package/dist/src/rlc-common/helpers/typeUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/typeUtil.js +4 -9
- package/dist/src/rlc-common/helpers/typeUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js +7 -11
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js.map +1 -1
- package/dist/src/rlc-common/index.d.ts +28 -28
- package/dist/src/rlc-common/index.d.ts.map +1 -1
- package/dist/src/rlc-common/index.js +28 -28
- package/dist/src/rlc-common/index.js.map +1 -1
- 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/buildApiExtractorConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js +14 -15
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildChangelogFile.js +2 -3
- package/dist/src/rlc-common/metadata/buildChangelogFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildESLintConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildESLintConfig.js +5 -8
- package/dist/src/rlc-common/metadata/buildESLintConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildLicenseFile.js +1 -1
- package/dist/src/rlc-common/metadata/buildPackageFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildPackageFile.js +33 -37
- package/dist/src/rlc-common/metadata/buildPackageFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildReadmeFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildReadmeFile.js +31 -39
- package/dist/src/rlc-common/metadata/buildReadmeFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildRollupConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildRollupConfig.js +4 -6
- package/dist/src/rlc-common/metadata/buildRollupConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js +3 -5
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildTestConfig.js +11 -12
- package/dist/src/rlc-common/metadata/buildTestConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildTsConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildTsConfig.js +28 -28
- package/dist/src/rlc-common/metadata/buildTsConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildVitestConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildVitestConfig.js +3 -5
- package/dist/src/rlc-common/metadata/buildVitestConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildWarpConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildWarpConfig.js +4 -5
- package/dist/src/rlc-common/metadata/buildWarpConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js +14 -14
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js +24 -29
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js +15 -16
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js +8 -8
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js +28 -31
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js.map +1 -1
- package/dist/src/rlc-common/metadata/utils.js +1 -2
- package/dist/src/rlc-common/metadata/utils.js.map +1 -1
- package/dist/src/rlc-common/test/buildKarmaConfig.js +1 -1
- package/dist/src/rlc-common/test/buildRecordedClient.js +4 -5
- package/dist/src/rlc-common/test/buildRecordedClient.js.map +1 -1
- package/dist/src/rlc-common/test/buildSampleTest.d.ts.map +1 -1
- package/dist/src/rlc-common/test/buildSampleTest.js +3 -4
- package/dist/src/rlc-common/test/buildSampleTest.js.map +1 -1
- package/dist/src/rlc-common/test/buildSnippets.d.ts.map +1 -1
- package/dist/src/rlc-common/test/buildSnippets.js +7 -10
- package/dist/src/rlc-common/test/buildSnippets.js.map +1 -1
- package/dist/src/rlc-common/transformSampleGroups.d.ts.map +1 -1
- package/dist/src/rlc-common/transformSampleGroups.js +41 -45
- package/dist/src/rlc-common/transformSampleGroups.js.map +1 -1
- package/dist/src/testing/index.d.ts.map +1 -1
- package/dist/src/testing/index.js +1 -1
- package/dist/src/testing/index.js.map +1 -1
- package/dist/src/transform/transform.d.ts +1 -1
- package/dist/src/transform/transform.d.ts.map +1 -1
- package/dist/src/transform/transform.js +28 -27
- package/dist/src/transform/transform.js.map +1 -1
- package/dist/src/transform/transformApiVersionInfo.d.ts +1 -1
- package/dist/src/transform/transformApiVersionInfo.d.ts.map +1 -1
- package/dist/src/transform/transformApiVersionInfo.js +12 -14
- package/dist/src/transform/transformApiVersionInfo.js.map +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.d.ts +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.d.ts.map +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.js +11 -14
- package/dist/src/transform/transformHelperFunctionDetails.js.map +1 -1
- package/dist/src/transform/transformParameters.d.ts +2 -2
- package/dist/src/transform/transformParameters.d.ts.map +1 -1
- package/dist/src/transform/transformParameters.js +32 -45
- package/dist/src/transform/transformParameters.js.map +1 -1
- package/dist/src/transform/transformPaths.d.ts +1 -1
- package/dist/src/transform/transformPaths.d.ts.map +1 -1
- package/dist/src/transform/transformPaths.js +19 -23
- package/dist/src/transform/transformPaths.js.map +1 -1
- package/dist/src/transform/transformResponses.d.ts +1 -1
- package/dist/src/transform/transformResponses.d.ts.map +1 -1
- package/dist/src/transform/transformResponses.js +21 -25
- package/dist/src/transform/transformResponses.js.map +1 -1
- package/dist/src/transform/transformSchemas.d.ts.map +1 -1
- package/dist/src/transform/transformSchemas.js +21 -32
- package/dist/src/transform/transformSchemas.js.map +1 -1
- package/dist/src/transform/transformTelemetryInfo.d.ts +1 -1
- package/dist/src/transform/transformTelemetryInfo.d.ts.map +1 -1
- package/dist/src/transform/transformTelemetryInfo.js +3 -3
- package/dist/src/transform/transformTelemetryInfo.js.map +1 -1
- package/dist/src/transform/transfromRLCOptions.d.ts +1 -1
- package/dist/src/transform/transfromRLCOptions.d.ts.map +1 -1
- package/dist/src/transform/transfromRLCOptions.js +28 -39
- package/dist/src/transform/transfromRLCOptions.js.map +1 -1
- package/dist/src/utils/clientUtils.d.ts +1 -1
- package/dist/src/utils/clientUtils.d.ts.map +1 -1
- package/dist/src/utils/clientUtils.js +15 -23
- package/dist/src/utils/clientUtils.js.map +1 -1
- package/dist/src/utils/credentialUtils.d.ts +1 -1
- package/dist/src/utils/credentialUtils.d.ts.map +1 -1
- package/dist/src/utils/credentialUtils.js +4 -5
- package/dist/src/utils/credentialUtils.js.map +1 -1
- package/dist/src/utils/crossLanguageDef.d.ts.map +1 -1
- package/dist/src/utils/crossLanguageDef.js +11 -15
- package/dist/src/utils/crossLanguageDef.js.map +1 -1
- package/dist/src/utils/emitUtil.d.ts +1 -1
- package/dist/src/utils/emitUtil.d.ts.map +1 -1
- package/dist/src/utils/emitUtil.js +5 -7
- package/dist/src/utils/emitUtil.js.map +1 -1
- package/dist/src/utils/fileSystemUtils.d.ts +2 -0
- package/dist/src/utils/fileSystemUtils.d.ts.map +1 -1
- package/dist/src/utils/fileSystemUtils.js +26 -7
- package/dist/src/utils/fileSystemUtils.js.map +1 -1
- package/dist/src/utils/importHelper.d.ts.map +1 -1
- package/dist/src/utils/importHelper.js +3 -6
- package/dist/src/utils/importHelper.js.map +1 -1
- package/dist/src/utils/interfaces.d.ts +1 -1
- package/dist/src/utils/interfaces.d.ts.map +1 -1
- package/dist/src/utils/mediaTypes.d.ts.map +1 -1
- package/dist/src/utils/mediaTypes.js +7 -19
- package/dist/src/utils/mediaTypes.js.map +1 -1
- package/dist/src/utils/modelUtils.d.ts +5 -5
- package/dist/src/utils/modelUtils.d.ts.map +1 -1
- package/dist/src/utils/modelUtils.js +168 -257
- package/dist/src/utils/modelUtils.js.map +1 -1
- package/dist/src/utils/namespaceUtils.d.ts.map +1 -1
- package/dist/src/utils/namespaceUtils.js +6 -7
- package/dist/src/utils/namespaceUtils.js.map +1 -1
- package/dist/src/utils/operationUtil.d.ts +1 -1
- package/dist/src/utils/operationUtil.d.ts.map +1 -1
- package/dist/src/utils/operationUtil.js +60 -81
- package/dist/src/utils/operationUtil.js.map +1 -1
- package/dist/src/utils/parameterUtils.d.ts +1 -1
- package/dist/src/utils/parameterUtils.d.ts.map +1 -1
- package/dist/src/utils/parameterUtils.js +26 -33
- package/dist/src/utils/parameterUtils.js.map +1 -1
- package/dist/src/utils/resolve-project-root.js +2 -2
- package/dist/src/utils/resolve-project-root.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +38 -45
- package/src/contextManager.ts +6 -9
- package/src/framework/declaration.ts +18 -28
- package/src/framework/dependency.ts +1 -2
- package/src/framework/hooks/binder.ts +47 -120
- package/src/framework/hooks/sdkTypes.ts +27 -54
- package/src/framework/hooks/useDependencies.ts +2 -4
- package/src/framework/load-static-helpers.ts +28 -51
- package/src/framework/reference.ts +2 -5
- package/src/framework/sample.ts +9 -9
- package/src/index.ts +145 -185
- package/src/lib.ts +143 -158
- package/src/metaTree.ts +1 -1
- package/src/modular/buildClassicalClient.ts +83 -160
- package/src/modular/buildClassicalOperationGroups.ts +14 -39
- package/src/modular/buildClientContext.ts +54 -83
- package/src/modular/buildModularOptions.ts +4 -5
- package/src/modular/buildOperations.ts +46 -73
- package/src/modular/buildProjectFiles.ts +18 -47
- package/src/modular/buildRestorePoller.ts +27 -46
- package/src/modular/buildRootIndex.ts +86 -160
- package/src/modular/buildSubpathIndex.ts +35 -58
- package/src/modular/emitLoggerFile.ts +4 -9
- package/src/modular/emitModels.ts +136 -266
- package/src/modular/emitModelsOptions.ts +10 -16
- package/src/modular/emitSamples.ts +92 -180
- package/src/modular/emitTests.ts +28 -61
- package/src/modular/external-dependencies.ts +54 -54
- package/src/modular/helpers/classicalOperationHelpers.ts +73 -126
- package/src/modular/helpers/clientHelpers.ts +41 -88
- package/src/modular/helpers/clientOptionHelpers.ts +4 -11
- package/src/modular/helpers/exampleValueHelpers.ts +99 -215
- package/src/modular/helpers/namingHelpers.ts +12 -28
- package/src/modular/helpers/operationHelpers.ts +430 -757
- package/src/modular/helpers/typeHelpers.ts +11 -22
- package/src/modular/serialization/buildDeserializerFunction.ts +88 -122
- package/src/modular/serialization/buildSerializerFunction.ts +91 -129
- package/src/modular/serialization/buildXmlSerializerFunction.ts +104 -183
- package/src/modular/serialization/serializeUtils.ts +12 -22
- package/src/modular/static/rollup.test.config.js +11 -14
- package/src/modular/static/scripts/renameOutput.mjs +2 -2
- package/src/modular/static-helpers-metadata.ts +60 -60
- package/src/modular/type-expressions/get-credential-expression.ts +1 -1
- package/src/modular/type-expressions/get-enum-expression.ts +5 -10
- package/src/modular/type-expressions/get-model-expression.ts +13 -17
- package/src/modular/type-expressions/get-nullable-expression.ts +4 -5
- package/src/modular/type-expressions/get-type-expression.ts +8 -12
- package/src/modular/type-expressions/get-union-expression.ts +4 -4
- package/src/modular/type-expressions/utils.ts +1 -1
- package/src/rlc-common/buildClient.ts +70 -141
- package/src/rlc-common/buildClientDefinitions.ts +44 -87
- package/src/rlc-common/buildIndexFile.ts +78 -78
- package/src/rlc-common/buildIsUnexpectedHelper.ts +34 -41
- package/src/rlc-common/buildLogger.ts +7 -7
- package/src/rlc-common/buildMethodShortcuts.ts +9 -21
- package/src/rlc-common/buildObjectTypes.ts +79 -156
- package/src/rlc-common/buildPaginateHelper.ts +9 -12
- package/src/rlc-common/buildParameterTypes.ts +116 -137
- package/src/rlc-common/buildPollingHelper.ts +7 -7
- package/src/rlc-common/buildResponseTypes.ts +34 -57
- package/src/rlc-common/buildSamples.ts +3 -3
- package/src/rlc-common/buildSchemaType.ts +37 -29
- package/src/rlc-common/buildSerializeHelper.ts +5 -5
- package/src/rlc-common/buildTopLevelIndexFile.ts +12 -19
- package/src/rlc-common/helpers/apiVersionUtil.ts +5 -10
- package/src/rlc-common/helpers/importsUtil.ts +27 -30
- package/src/rlc-common/helpers/nameConstructors.ts +16 -50
- package/src/rlc-common/helpers/nameUtils.ts +19 -42
- package/src/rlc-common/helpers/operationHelpers.ts +14 -31
- package/src/rlc-common/helpers/pathUtils.ts +2 -7
- package/src/rlc-common/helpers/schemaHelpers.ts +4 -15
- package/src/rlc-common/helpers/shortcutMethods.ts +6 -15
- package/src/rlc-common/helpers/typeUtil.ts +4 -11
- package/src/rlc-common/helpers/valueGenerationUtil.ts +16 -39
- package/src/rlc-common/index.ts +28 -28
- package/src/rlc-common/interfaces.ts +3 -11
- package/src/rlc-common/metadata/buildApiExtractorConfig.ts +17 -24
- package/src/rlc-common/metadata/buildChangelogFile.ts +1 -1
- package/src/rlc-common/metadata/buildESLintConfig.ts +3 -5
- package/src/rlc-common/metadata/buildLicenseFile.ts +1 -1
- package/src/rlc-common/metadata/buildPackageFile.ts +27 -35
- package/src/rlc-common/metadata/buildReadmeFile.ts +16 -29
- package/src/rlc-common/metadata/buildRollupConfig.ts +5 -8
- package/src/rlc-common/metadata/buildSampleEnvFile.ts +2 -3
- package/src/rlc-common/metadata/buildTestConfig.ts +10 -10
- package/src/rlc-common/metadata/buildTsConfig.ts +32 -35
- package/src/rlc-common/metadata/buildVitestConfig.ts +4 -10
- package/src/rlc-common/metadata/buildWarpConfig.ts +3 -6
- package/src/rlc-common/metadata/packageJson/azurePackageCommon.ts +16 -25
- package/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.ts +29 -50
- package/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.ts +20 -31
- package/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.ts +11 -13
- package/src/rlc-common/metadata/packageJson/packageCommon.ts +32 -52
- package/src/rlc-common/test/buildKarmaConfig.ts +1 -1
- package/src/rlc-common/test/buildRecordedClient.ts +3 -3
- package/src/rlc-common/test/buildSampleTest.ts +3 -3
- package/src/rlc-common/test/buildSnippets.ts +6 -12
- package/src/rlc-common/transformSampleGroups.ts +54 -105
- package/src/testing/index.ts +2 -5
- package/src/transform/transform.ts +22 -34
- package/src/transform/transformApiVersionInfo.ts +17 -30
- package/src/transform/transformHelperFunctionDetails.ts +14 -26
- package/src/transform/transformParameters.ts +55 -105
- package/src/transform/transformPaths.ts +26 -43
- package/src/transform/transformResponses.ts +26 -33
- package/src/transform/transformSchemas.ts +15 -33
- package/src/transform/transformTelemetryInfo.ts +8 -14
- package/src/transform/transfromRLCOptions.ts +53 -116
- package/src/utils/clientUtils.ts +22 -41
- package/src/utils/credentialUtils.ts +8 -19
- package/src/utils/crossLanguageDef.ts +15 -34
- package/src/utils/emitUtil.ts +11 -17
- package/src/utils/fileSystemUtils.ts +30 -8
- package/src/utils/importHelper.ts +5 -10
- package/src/utils/interfaces.ts +1 -1
- package/src/utils/mediaTypes.ts +13 -34
- package/src/utils/modelUtils.ts +175 -384
- package/src/utils/namespaceUtils.ts +8 -24
- package/src/utils/operationUtil.ts +98 -190
- package/src/utils/parameterUtils.ts +31 -54
- package/src/utils/resolve-project-root.ts +3 -3
- package/static/static-helpers/cloudSettingHelpers.ts +4 -6
- package/static/static-helpers/multipartHelpers.ts +3 -3
- package/static/static-helpers/pagingHelpers.ts +28 -63
- package/static/static-helpers/pollingHelpers.ts +16 -29
- package/static/static-helpers/serialization/build-multi-collection.ts +1 -4
- package/static/static-helpers/serialization/check-prop-undefined.ts +1 -4
- package/static/static-helpers/serialization/get-binary-response-browser.mts +3 -1
- package/static/static-helpers/serialization/get-binary-response.ts +2 -2
- package/static/static-helpers/serialization/get-binary-stream-response-browser.mts +1 -3
- package/static/static-helpers/serialization/get-binary-stream-response.ts +2 -4
- package/static/static-helpers/serialization/serialize-record.ts +1 -1
- package/static/static-helpers/serialization/serializers.ts +4 -7
- package/static/static-helpers/serialization/xml-helpers.ts +42 -90
- package/static/static-helpers/simplePollerHelpers.ts +10 -19
- package/static/static-helpers/storageCompatResponse.ts +10 -27
- package/static/static-helpers/urlTemplate.ts +4 -7
- package/static/test-helpers/recordedClient.ts +5 -10
package/src/index.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import
|
|
4
|
+
import { EmitContext, Program } from "@typespec/compiler";
|
|
5
|
+
import { provideContext, useContext } from "./contextManager.js";
|
|
6
|
+
import { buildRootIndex, buildSubClientIndexFile } from "./modular/buildRootIndex.js";
|
|
5
7
|
import {
|
|
6
8
|
AzureCoreDependencies,
|
|
7
9
|
AzureIdentityDependencies,
|
|
8
10
|
AzurePollingDependencies,
|
|
11
|
+
AzureTestDependencies,
|
|
9
12
|
DefaultCoreDependencies,
|
|
10
|
-
AzureTestDependencies
|
|
11
13
|
} from "./modular/external-dependencies.js";
|
|
12
|
-
import { clearDirectory } from "./utils/fileSystemUtils.js";
|
|
13
|
-
import { EmitContext, Program } from "@typespec/compiler";
|
|
14
|
-
import { GenerationDirDetail, SdkContext } from "./utils/interfaces.js";
|
|
15
14
|
import {
|
|
16
15
|
CloudSettingHelpers,
|
|
17
16
|
CreateRecorderHelpers,
|
|
@@ -23,100 +22,94 @@ import {
|
|
|
23
22
|
SimplePollerHelpers,
|
|
24
23
|
StorageCompatHelpers,
|
|
25
24
|
UrlTemplateHelpers,
|
|
26
|
-
XmlHelpers
|
|
25
|
+
XmlHelpers,
|
|
27
26
|
} from "./modular/static-helpers-metadata.js";
|
|
28
27
|
import {
|
|
29
28
|
RLCModel,
|
|
30
29
|
RLCOptions,
|
|
31
30
|
buildApiExtractorConfig,
|
|
31
|
+
buildChangelogFile,
|
|
32
32
|
buildClient,
|
|
33
33
|
buildClientDefinitions,
|
|
34
34
|
buildEsLintConfig,
|
|
35
35
|
buildIndexFile,
|
|
36
36
|
buildIsUnexpectedHelper,
|
|
37
37
|
buildLicenseFile,
|
|
38
|
-
buildChangelogFile,
|
|
39
38
|
buildLogger,
|
|
40
39
|
buildPackageFile,
|
|
41
40
|
buildParameterTypes,
|
|
42
41
|
buildPollingHelper,
|
|
43
42
|
buildPaginateHelper as buildRLCPaginateHelper,
|
|
44
43
|
buildReadmeFile,
|
|
45
|
-
hasClientNameChanged,
|
|
46
|
-
updateReadmeFile,
|
|
47
44
|
buildRecordedClientFile,
|
|
48
45
|
buildResponseTypes,
|
|
49
46
|
buildRollupConfig,
|
|
47
|
+
buildSampleEnvFile,
|
|
50
48
|
buildSampleTest,
|
|
51
49
|
buildSamples,
|
|
52
50
|
buildSerializeHelper,
|
|
51
|
+
buildSnippets,
|
|
52
|
+
buildTestBrowserTsConfig,
|
|
53
|
+
buildTestNodeTsConfig,
|
|
53
54
|
buildTopLevelIndex,
|
|
54
55
|
buildTsConfig,
|
|
56
|
+
buildTsLintConfig,
|
|
57
|
+
buildTsSampleConfig,
|
|
55
58
|
buildTsSnippetsConfig,
|
|
56
|
-
buildTsSrcEsmConfig,
|
|
57
59
|
buildTsSrcBrowserConfig,
|
|
58
|
-
buildTsSrcReactNativeConfig,
|
|
59
60
|
buildTsSrcCjsConfig,
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
buildTestNodeTsConfig,
|
|
61
|
+
buildTsSrcEsmConfig,
|
|
62
|
+
buildTsSrcReactNativeConfig,
|
|
63
63
|
buildVitestConfig,
|
|
64
64
|
buildWarpConfig,
|
|
65
65
|
getClientName,
|
|
66
|
+
hasClientNameChanged,
|
|
66
67
|
hasUnexpectedHelper,
|
|
67
68
|
isAzurePackage,
|
|
68
69
|
updatePackageFile,
|
|
69
|
-
|
|
70
|
-
buildSnippets,
|
|
71
|
-
buildTsSampleConfig
|
|
70
|
+
updateReadmeFile,
|
|
72
71
|
} from "./rlc-common/index.js";
|
|
73
|
-
import {
|
|
74
|
-
buildRootIndex,
|
|
75
|
-
buildSubClientIndexFile
|
|
76
|
-
} from "./modular/buildRootIndex.js";
|
|
77
72
|
import { emitContentByBuilder, emitModels } from "./utils/emitUtil.js";
|
|
78
|
-
import {
|
|
73
|
+
import { clearDirectory, emptyDir, pathExists } from "./utils/fileSystemUtils.js";
|
|
74
|
+
import { GenerationDirDetail, SdkContext } from "./utils/interfaces.js";
|
|
79
75
|
|
|
80
|
-
import { EmitterOptions } from "./lib.js";
|
|
81
|
-
import { ModularEmitterOptions } from "./modular/interfaces.js";
|
|
82
|
-
import { Project } from "ts-morph";
|
|
83
|
-
import { buildClassicOperationFiles } from "./modular/buildClassicalOperationGroups.js";
|
|
84
|
-
import { buildClassicalClient } from "./modular/buildClassicalClient.js";
|
|
85
|
-
import {
|
|
86
|
-
getClientContextPath,
|
|
87
|
-
buildClientContext
|
|
88
|
-
} from "./modular/buildClientContext.js";
|
|
89
|
-
import { buildApiOptions } from "./modular/emitModelsOptions.js";
|
|
90
|
-
import { buildOperationFiles } from "./modular/buildOperations.js";
|
|
91
|
-
import { buildRestorePoller } from "./modular/buildRestorePoller.js";
|
|
92
|
-
import { buildSubpathIndexFile } from "./modular/buildSubpathIndex.js";
|
|
93
76
|
import {
|
|
77
|
+
SdkClientType,
|
|
78
|
+
SdkServiceOperation,
|
|
94
79
|
createSdkContext,
|
|
95
80
|
listAllServiceNamespaces,
|
|
96
|
-
SdkClientType,
|
|
97
|
-
SdkServiceOperation
|
|
98
81
|
} from "@azure-tools/typespec-client-generator-core";
|
|
99
|
-
import { transformModularEmitterOptions } from "./modular/buildModularOptions.js";
|
|
100
|
-
import { emitLoggerFile } from "./modular/emitLoggerFile.js";
|
|
101
|
-
import { emitTypes, emitNonModelResponseTypes } from "./modular/emitModels.js";
|
|
102
82
|
import { existsSync } from "fs";
|
|
103
|
-
import { getModuleExports } from "./modular/buildProjectFiles.js";
|
|
104
|
-
import {
|
|
105
|
-
getClientHierarchyMap,
|
|
106
|
-
getRLCClients,
|
|
107
|
-
getModularClientOptions
|
|
108
|
-
} from "./utils/clientUtils.js";
|
|
109
83
|
import { basename, join } from "path";
|
|
110
|
-
import {
|
|
111
|
-
import { packageUsesXmlSerialization } from "./modular/serialization/buildXmlSerializerFunction.js";
|
|
84
|
+
import { Project } from "ts-morph";
|
|
112
85
|
import { provideBinder } from "./framework/hooks/binder.js";
|
|
113
86
|
import { provideSdkTypes } from "./framework/hooks/sdkTypes.js";
|
|
114
|
-
import {
|
|
115
|
-
import {
|
|
87
|
+
import { loadStaticHelpers } from "./framework/load-static-helpers.js";
|
|
88
|
+
import { EmitterOptions } from "./lib.js";
|
|
89
|
+
import { buildClassicalClient } from "./modular/buildClassicalClient.js";
|
|
90
|
+
import { buildClassicOperationFiles } from "./modular/buildClassicalOperationGroups.js";
|
|
91
|
+
import { buildClientContext, getClientContextPath } from "./modular/buildClientContext.js";
|
|
92
|
+
import { transformModularEmitterOptions } from "./modular/buildModularOptions.js";
|
|
93
|
+
import { buildOperationFiles } from "./modular/buildOperations.js";
|
|
94
|
+
import { getModuleExports } from "./modular/buildProjectFiles.js";
|
|
95
|
+
import { buildRestorePoller } from "./modular/buildRestorePoller.js";
|
|
96
|
+
import { buildSubpathIndexFile } from "./modular/buildSubpathIndex.js";
|
|
97
|
+
import { emitLoggerFile } from "./modular/emitLoggerFile.js";
|
|
98
|
+
import { emitNonModelResponseTypes, emitTypes } from "./modular/emitModels.js";
|
|
99
|
+
import { buildApiOptions } from "./modular/emitModelsOptions.js";
|
|
116
100
|
import { emitSamples } from "./modular/emitSamples.js";
|
|
117
101
|
import { emitTests } from "./modular/emitTests.js";
|
|
118
|
-
import { generateCrossLanguageDefinitionFile } from "./utils/crossLanguageDef.js";
|
|
119
102
|
import { getClassicalClientName } from "./modular/helpers/namingHelpers.js";
|
|
103
|
+
import { ModularEmitterOptions } from "./modular/interfaces.js";
|
|
104
|
+
import { packageUsesXmlSerialization } from "./modular/serialization/buildXmlSerializerFunction.js";
|
|
105
|
+
import { transformRLCModel } from "./transform/transform.js";
|
|
106
|
+
import { transformRLCOptions } from "./transform/transfromRLCOptions.js";
|
|
107
|
+
import {
|
|
108
|
+
getClientHierarchyMap,
|
|
109
|
+
getModularClientOptions,
|
|
110
|
+
getRLCClients,
|
|
111
|
+
} from "./utils/clientUtils.js";
|
|
112
|
+
import { generateCrossLanguageDefinitionFile } from "./utils/crossLanguageDef.js";
|
|
120
113
|
|
|
121
114
|
export * from "./lib.js";
|
|
122
115
|
|
|
@@ -140,16 +133,13 @@ export async function $onEmit(context: EmitContext) {
|
|
|
140
133
|
const rlcOptions = dpgContext.rlcOptions ?? {};
|
|
141
134
|
|
|
142
135
|
const needUnexpectedHelper: Map<string, boolean> = new Map<string, boolean>();
|
|
143
|
-
const serviceNameToRlcModelsMap: Map<string, RLCModel> = new Map<
|
|
144
|
-
string,
|
|
145
|
-
RLCModel
|
|
146
|
-
>();
|
|
136
|
+
const serviceNameToRlcModelsMap: Map<string, RLCModel> = new Map<string, RLCModel>();
|
|
147
137
|
provideContext("rlcMetaTree", new Map());
|
|
148
138
|
provideContext("symbolMap", new Map());
|
|
149
139
|
provideContext("outputProject", outputProject);
|
|
150
140
|
provideContext("emitContext", {
|
|
151
141
|
compilerContext: context,
|
|
152
|
-
tcgcContext: dpgContext
|
|
142
|
+
tcgcContext: dpgContext,
|
|
153
143
|
});
|
|
154
144
|
const staticHelpers = await loadStaticHelpers(
|
|
155
145
|
outputProject,
|
|
@@ -164,29 +154,29 @@ export async function $onEmit(context: EmitContext) {
|
|
|
164
154
|
...CloudSettingHelpers,
|
|
165
155
|
...XmlHelpers,
|
|
166
156
|
...(rlcOptions.generateTest ? CreateRecorderHelpers : {}),
|
|
167
|
-
...(rlcOptions.enableStorageCompat ? StorageCompatHelpers : {})
|
|
157
|
+
...(rlcOptions.enableStorageCompat ? StorageCompatHelpers : {}),
|
|
168
158
|
},
|
|
169
159
|
{
|
|
170
160
|
sourcesDir: dpgContext.generationPathDetail?.modularSourcesDir,
|
|
171
161
|
rootDir: dpgContext.generationPathDetail?.rootDir,
|
|
172
162
|
options: rlcOptions,
|
|
173
|
-
program
|
|
174
|
-
}
|
|
163
|
+
program,
|
|
164
|
+
},
|
|
175
165
|
);
|
|
176
166
|
const extraDependencies = isAzurePackage({ options: rlcOptions })
|
|
177
167
|
? {
|
|
178
168
|
...AzurePollingDependencies,
|
|
179
169
|
...AzureCoreDependencies,
|
|
180
170
|
...AzureIdentityDependencies,
|
|
181
|
-
...AzureTestDependencies
|
|
171
|
+
...AzureTestDependencies,
|
|
182
172
|
}
|
|
183
173
|
: { ...DefaultCoreDependencies };
|
|
184
174
|
const binder = provideBinder(outputProject, {
|
|
185
175
|
staticHelpers,
|
|
186
176
|
dependencies: {
|
|
187
|
-
...extraDependencies
|
|
177
|
+
...extraDependencies,
|
|
188
178
|
},
|
|
189
|
-
useSubpathImports: rlcOptions.azureSdkForJs === true
|
|
179
|
+
useSubpathImports: rlcOptions.azureSdkForJs === true,
|
|
190
180
|
});
|
|
191
181
|
provideSdkTypes(dpgContext);
|
|
192
182
|
|
|
@@ -210,7 +200,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
210
200
|
// 5. Generate metadata and test files
|
|
211
201
|
function getTypespecTsVersion(context: EmitContext): string | undefined {
|
|
212
202
|
const emitterMetadata = context.program.emitters.find(
|
|
213
|
-
(emitter) => emitter.metadata.name === "@azure-tools/typespec-ts"
|
|
203
|
+
(emitter) => emitter.metadata.name === "@azure-tools/typespec-ts",
|
|
214
204
|
);
|
|
215
205
|
return emitterMetadata?.metadata.version;
|
|
216
206
|
}
|
|
@@ -218,8 +208,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
218
208
|
await generateMetadataAndTest(dpgContext);
|
|
219
209
|
|
|
220
210
|
async function enrichDpgContext() {
|
|
221
|
-
const generationPathDetail: GenerationDirDetail =
|
|
222
|
-
await calculateGenerationDir();
|
|
211
|
+
const generationPathDetail: GenerationDirDetail = await calculateGenerationDir();
|
|
223
212
|
dpgContext.generationPathDetail = generationPathDetail;
|
|
224
213
|
dpgContext.allServiceNamespaces = listAllServiceNamespaces(dpgContext);
|
|
225
214
|
const options: RLCOptions = transformRLCOptions(emitterOptions, dpgContext);
|
|
@@ -228,14 +217,10 @@ export async function $onEmit(context: EmitContext) {
|
|
|
228
217
|
// clear output folder if needed
|
|
229
218
|
if (options.clearOutputFolder) {
|
|
230
219
|
// Clear output directory while preserving TempTypeSpecFiles
|
|
231
|
-
await clearDirectory(
|
|
232
|
-
context.emitterOutputDir,
|
|
233
|
-
["TempTypeSpecFiles"],
|
|
234
|
-
program
|
|
235
|
-
);
|
|
220
|
+
await clearDirectory(context.emitterOutputDir, ["TempTypeSpecFiles"], program);
|
|
236
221
|
}
|
|
237
|
-
const hasTestFolder = await
|
|
238
|
-
join(dpgContext.generationPathDetail?.metadataDir ?? "", "test")
|
|
222
|
+
const hasTestFolder = await pathExists(
|
|
223
|
+
join(dpgContext.generationPathDetail?.metadataDir ?? "", "test"),
|
|
239
224
|
);
|
|
240
225
|
options.generateTest =
|
|
241
226
|
options.generateTest === true ||
|
|
@@ -250,38 +235,33 @@ export async function $onEmit(context: EmitContext) {
|
|
|
250
235
|
const customizationFolder = join(projectRoot, "generated");
|
|
251
236
|
const srcGeneratedFolder = join(projectRoot, "src", "generated");
|
|
252
237
|
// if customization folder exists, use it as sources root
|
|
253
|
-
const finalCustomizationFolder = (await
|
|
254
|
-
srcGeneratedFolder
|
|
255
|
-
))
|
|
238
|
+
const finalCustomizationFolder = (await pathExists(srcGeneratedFolder))
|
|
256
239
|
? srcGeneratedFolder
|
|
257
240
|
: customizationFolder;
|
|
258
|
-
const sourcesRoot = (await
|
|
241
|
+
const sourcesRoot = (await pathExists(finalCustomizationFolder))
|
|
259
242
|
? finalCustomizationFolder
|
|
260
243
|
: join(projectRoot, "src");
|
|
261
244
|
return {
|
|
262
245
|
rootDir: projectRoot,
|
|
263
246
|
metadataDir: projectRoot,
|
|
264
247
|
rlcSourcesDir: sourcesRoot,
|
|
265
|
-
modularSourcesDir: sourcesRoot
|
|
248
|
+
modularSourcesDir: sourcesRoot,
|
|
266
249
|
};
|
|
267
250
|
}
|
|
268
251
|
|
|
269
252
|
async function clearSrcFolder() {
|
|
270
|
-
await
|
|
253
|
+
await emptyDir(
|
|
271
254
|
dpgContext.generationPathDetail?.modularSourcesDir ??
|
|
272
255
|
dpgContext.generationPathDetail?.rlcSourcesDir ??
|
|
273
|
-
""
|
|
256
|
+
"",
|
|
274
257
|
);
|
|
275
258
|
}
|
|
276
259
|
|
|
277
260
|
async function clearSamplesDevFolder() {
|
|
278
261
|
if (emitterOptions["generate-sample"] === true) {
|
|
279
|
-
const samplesDevPath = join(
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
);
|
|
283
|
-
if (await fsextra.pathExists(samplesDevPath)) {
|
|
284
|
-
await fsextra.emptyDir(samplesDevPath);
|
|
262
|
+
const samplesDevPath = join(dpgContext.generationPathDetail?.rootDir ?? "", "samples-dev");
|
|
263
|
+
if (await pathExists(samplesDevPath)) {
|
|
264
|
+
await emptyDir(samplesDevPath);
|
|
285
265
|
}
|
|
286
266
|
}
|
|
287
267
|
}
|
|
@@ -293,10 +273,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
293
273
|
rlcCodeModels.push(rlcModels);
|
|
294
274
|
const serviceName = client.services[0]?.name ?? "Unknown";
|
|
295
275
|
serviceNameToRlcModelsMap.set(serviceName, rlcModels);
|
|
296
|
-
needUnexpectedHelper.set(
|
|
297
|
-
getClientName(rlcModels),
|
|
298
|
-
hasUnexpectedHelper(rlcModels)
|
|
299
|
-
);
|
|
276
|
+
needUnexpectedHelper.set(getClientName(rlcModels), hasUnexpectedHelper(rlcModels));
|
|
300
277
|
}
|
|
301
278
|
}
|
|
302
279
|
|
|
@@ -318,37 +295,56 @@ export async function $onEmit(context: EmitContext) {
|
|
|
318
295
|
program,
|
|
319
296
|
buildSamples,
|
|
320
297
|
rlcModels,
|
|
321
|
-
dpgContext.generationPathDetail?.metadataDir
|
|
298
|
+
dpgContext.generationPathDetail?.metadataDir,
|
|
322
299
|
);
|
|
323
300
|
}
|
|
301
|
+
// The binder is only resolved in the modular path, so static helper files
|
|
302
|
+
// loaded into the outputProject are never written to disk in the RLC path.
|
|
303
|
+
// The RLC builders reference the platform-types helper (NodeReadableStream),
|
|
304
|
+
// so emit those files here.
|
|
305
|
+
await emitRLCStaticHelpers();
|
|
324
306
|
}
|
|
325
307
|
|
|
326
|
-
async function
|
|
327
|
-
|
|
328
|
-
|
|
308
|
+
async function emitRLCStaticHelpers() {
|
|
309
|
+
if (program.compilerOptions.noEmit || program.hasError() || !rlcCodeModels[0]) {
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
329
312
|
const project = useContext("outputProject");
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
313
|
+
for (const helperFile of project.getSourceFiles()) {
|
|
314
|
+
const filePath = helperFile.getFilePath();
|
|
315
|
+
// RLC builders (buildParameterTypes / buildSchemaType) only reference
|
|
316
|
+
// platform-types (and its browser/react-native variants); emit those
|
|
317
|
+
// files directly under src/ (strip the static-helpers/ segment) to match
|
|
318
|
+
// the RLC design where all generated output lives in src/.
|
|
319
|
+
if (!basename(filePath).startsWith("platform-types")) {
|
|
320
|
+
continue;
|
|
335
321
|
}
|
|
336
|
-
|
|
322
|
+
const outputPath = filePath.replace(/\/static-helpers\//g, "/");
|
|
323
|
+
await emitContentByBuilder(
|
|
324
|
+
program,
|
|
325
|
+
() => ({ content: helperFile.getFullText(), path: outputPath }),
|
|
326
|
+
rlcCodeModels[0],
|
|
327
|
+
);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
async function generateModularSources() {
|
|
332
|
+
const modularSourcesRoot = dpgContext.generationPathDetail?.modularSourcesDir ?? "src";
|
|
333
|
+
const project = useContext("outputProject");
|
|
334
|
+
modularEmitterOptions = transformModularEmitterOptions(dpgContext, modularSourcesRoot, {
|
|
335
|
+
casing: "camel",
|
|
336
|
+
});
|
|
337
337
|
|
|
338
338
|
emitLoggerFile(modularEmitterOptions, modularSourcesRoot);
|
|
339
339
|
|
|
340
|
-
const rootIndexFile = project.createSourceFile(
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
{
|
|
344
|
-
overwrite: true
|
|
345
|
-
}
|
|
346
|
-
);
|
|
340
|
+
const rootIndexFile = project.createSourceFile(`${modularSourcesRoot}/index.ts`, "", {
|
|
341
|
+
overwrite: true,
|
|
342
|
+
});
|
|
347
343
|
|
|
348
344
|
emitTypes(dpgContext, { sourceRoot: modularSourcesRoot });
|
|
349
345
|
emitNonModelResponseTypes(dpgContext, { sourceRoot: modularSourcesRoot });
|
|
350
346
|
buildSubpathIndexFile(modularEmitterOptions, "models", undefined, {
|
|
351
|
-
recursive: true
|
|
347
|
+
recursive: true,
|
|
352
348
|
});
|
|
353
349
|
const clientMap = getClientHierarchyMap(dpgContext);
|
|
354
350
|
if (clientMap.length === 0) {
|
|
@@ -364,12 +360,12 @@ export async function $onEmit(context: EmitContext) {
|
|
|
364
360
|
if (dpgContext.rlcOptions?.hierarchyClient) {
|
|
365
361
|
buildSubpathIndexFile(modularEmitterOptions, "api", subClient, {
|
|
366
362
|
exportIndex: false,
|
|
367
|
-
recursive: true
|
|
363
|
+
recursive: true,
|
|
368
364
|
});
|
|
369
365
|
} else {
|
|
370
366
|
buildSubpathIndexFile(modularEmitterOptions, "api", subClient, {
|
|
371
367
|
recursive: true,
|
|
372
|
-
exportIndex: true
|
|
368
|
+
exportIndex: true,
|
|
373
369
|
});
|
|
374
370
|
}
|
|
375
371
|
|
|
@@ -377,19 +373,14 @@ export async function $onEmit(context: EmitContext) {
|
|
|
377
373
|
buildClassicOperationFiles(dpgContext, subClient, modularEmitterOptions);
|
|
378
374
|
buildSubpathIndexFile(modularEmitterOptions, "classic", subClient, {
|
|
379
375
|
exportIndex: true,
|
|
380
|
-
interfaceOnly: true
|
|
376
|
+
interfaceOnly: true,
|
|
381
377
|
});
|
|
382
378
|
const { subfolder } = getModularClientOptions(subClient);
|
|
383
379
|
// Generate index file for clients with subfolders (multi-client scenarios and nested clients)
|
|
384
380
|
if (subfolder) {
|
|
385
381
|
buildSubClientIndexFile(dpgContext, subClient, modularEmitterOptions);
|
|
386
382
|
}
|
|
387
|
-
buildRootIndex(
|
|
388
|
-
dpgContext,
|
|
389
|
-
modularEmitterOptions,
|
|
390
|
-
rootIndexFile,
|
|
391
|
-
subClient
|
|
392
|
-
);
|
|
383
|
+
buildRootIndex(dpgContext, modularEmitterOptions, rootIndexFile, subClient);
|
|
393
384
|
}
|
|
394
385
|
// Enable modular sample generation when explicitly set to true or MPG
|
|
395
386
|
if (emitterOptions["generate-sample"] === true) {
|
|
@@ -401,10 +392,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
401
392
|
}
|
|
402
393
|
}
|
|
403
394
|
|
|
404
|
-
binder.resolveAllReferences(
|
|
405
|
-
modularSourcesRoot,
|
|
406
|
-
dpgContext.generationPathDetail?.rootDir
|
|
407
|
-
);
|
|
395
|
+
binder.resolveAllReferences(modularSourcesRoot, dpgContext.generationPathDetail?.rootDir);
|
|
408
396
|
if (program.compilerOptions.noEmit || program.hasError()) {
|
|
409
397
|
return;
|
|
410
398
|
}
|
|
@@ -413,7 +401,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
413
401
|
await emitContentByBuilder(
|
|
414
402
|
program,
|
|
415
403
|
() => ({ content: file.getFullText(), path: file.getFilePath() }),
|
|
416
|
-
modularEmitterOptions as any
|
|
404
|
+
modularEmitterOptions as any,
|
|
417
405
|
);
|
|
418
406
|
}
|
|
419
407
|
}
|
|
@@ -441,12 +429,11 @@ export async function $onEmit(context: EmitContext) {
|
|
|
441
429
|
content.emitterVersion = emitterVersion;
|
|
442
430
|
}
|
|
443
431
|
if (dpgContext.rlcOptions?.isModularLibrary) {
|
|
444
|
-
content.crossLanguageDefinitions =
|
|
445
|
-
generateCrossLanguageDefinitionFile(dpgContext);
|
|
432
|
+
content.crossLanguageDefinitions = generateCrossLanguageDefinitionFile(dpgContext);
|
|
446
433
|
}
|
|
447
434
|
return {
|
|
448
435
|
path: "metadata.json",
|
|
449
|
-
content: JSON.stringify(content, null, 2)
|
|
436
|
+
content: JSON.stringify(content, null, 2),
|
|
450
437
|
};
|
|
451
438
|
}
|
|
452
439
|
|
|
@@ -468,25 +455,21 @@ export async function $onEmit(context: EmitContext) {
|
|
|
468
455
|
// Generate metadata
|
|
469
456
|
const existingPackageFilePath = join(
|
|
470
457
|
dpgContext.generationPathDetail?.metadataDir ?? "",
|
|
471
|
-
"package.json"
|
|
458
|
+
"package.json",
|
|
472
459
|
);
|
|
473
460
|
const hasPackageFile = await existsSync(existingPackageFilePath);
|
|
474
461
|
const existingReadmeFilePath = join(
|
|
475
462
|
dpgContext.generationPathDetail?.metadataDir ?? "",
|
|
476
|
-
"README.md"
|
|
463
|
+
"README.md",
|
|
477
464
|
);
|
|
478
465
|
const hasReadmeFile = await existsSync(existingReadmeFilePath);
|
|
479
466
|
const existingChangelogFilePath = join(
|
|
480
467
|
dpgContext.generationPathDetail?.metadataDir ?? "",
|
|
481
|
-
"CHANGELOG.md"
|
|
468
|
+
"CHANGELOG.md",
|
|
482
469
|
);
|
|
483
470
|
const hasChangelogFile = await existsSync(existingChangelogFilePath);
|
|
484
|
-
const shouldGenerateMetadata =
|
|
485
|
-
|
|
486
|
-
const existingTestFolderPath = join(
|
|
487
|
-
dpgContext.generationPathDetail?.metadataDir ?? "",
|
|
488
|
-
"test"
|
|
489
|
-
);
|
|
471
|
+
const shouldGenerateMetadata = option.generateMetadata === true || !hasPackageFile;
|
|
472
|
+
const existingTestFolderPath = join(dpgContext.generationPathDetail?.metadataDir ?? "", "test");
|
|
490
473
|
const hasTestFolder = await existsSync(existingTestFolderPath);
|
|
491
474
|
if (option.generateTest === undefined) {
|
|
492
475
|
if (hasTestFolder) {
|
|
@@ -509,7 +492,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
509
492
|
buildApiExtractorConfig,
|
|
510
493
|
buildReadmeFile,
|
|
511
494
|
buildLicenseFile,
|
|
512
|
-
buildSampleEnvFile
|
|
495
|
+
buildSampleEnvFile,
|
|
513
496
|
];
|
|
514
497
|
if (option.generateTest) {
|
|
515
498
|
commonBuilders.push((model) => buildVitestConfig(model, "node"));
|
|
@@ -533,7 +516,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
533
516
|
let modularPackageInfo = {};
|
|
534
517
|
if (option.isModularLibrary) {
|
|
535
518
|
modularPackageInfo = {
|
|
536
|
-
exports: getModuleExports(context, modularEmitterOptions)
|
|
519
|
+
exports: getModuleExports(context, modularEmitterOptions),
|
|
537
520
|
};
|
|
538
521
|
// Build dependencies
|
|
539
522
|
const dependencies: Record<string, string> = {};
|
|
@@ -548,26 +531,19 @@ export async function $onEmit(context: EmitContext) {
|
|
|
548
531
|
modularPackageInfo = {
|
|
549
532
|
...modularPackageInfo,
|
|
550
533
|
dependencies,
|
|
551
|
-
clientContextPaths: getRelativeContextPaths(
|
|
552
|
-
context,
|
|
553
|
-
modularEmitterOptions
|
|
554
|
-
)
|
|
534
|
+
clientContextPaths: getRelativeContextPaths(context, modularEmitterOptions),
|
|
555
535
|
};
|
|
556
536
|
} else if (Object.keys(dependencies).length > 0) {
|
|
557
537
|
modularPackageInfo = {
|
|
558
538
|
...modularPackageInfo,
|
|
559
|
-
dependencies
|
|
539
|
+
dependencies,
|
|
560
540
|
};
|
|
561
541
|
}
|
|
562
542
|
}
|
|
563
|
-
commonBuilders.push((model) =>
|
|
564
|
-
buildPackageFile(model, modularPackageInfo)
|
|
565
|
-
);
|
|
543
|
+
commonBuilders.push((model) => buildPackageFile(model, modularPackageInfo));
|
|
566
544
|
// Generate warp.config.yml for Azure monorepo ESM packages
|
|
567
545
|
if (option.azureSdkForJs) {
|
|
568
|
-
commonBuilders.push((model) =>
|
|
569
|
-
buildWarpConfig(model, modularPackageInfo)
|
|
570
|
-
);
|
|
546
|
+
commonBuilders.push((model) => buildWarpConfig(model, modularPackageInfo));
|
|
571
547
|
}
|
|
572
548
|
commonBuilders.push(buildTsConfig);
|
|
573
549
|
if (option.azureSdkForJs) {
|
|
@@ -589,7 +565,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
589
565
|
if (option.generateTest) {
|
|
590
566
|
for (const subClient of dpgContext.sdkPackage.clients) {
|
|
591
567
|
commonBuilders.push((model) =>
|
|
592
|
-
buildSnippets(model, subClient.name, option.azureSdkForJs)
|
|
568
|
+
buildSnippets(model, subClient.name, option.azureSdkForJs),
|
|
593
569
|
);
|
|
594
570
|
}
|
|
595
571
|
commonBuilders.push(buildTsSnippetsConfig);
|
|
@@ -600,7 +576,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
600
576
|
program,
|
|
601
577
|
commonBuilders,
|
|
602
578
|
rlcClient,
|
|
603
|
-
dpgContext.generationPathDetail?.metadataDir
|
|
579
|
+
dpgContext.generationPathDetail?.metadataDir,
|
|
604
580
|
);
|
|
605
581
|
|
|
606
582
|
if (option.isModularLibrary) {
|
|
@@ -608,7 +584,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
608
584
|
await emitContentByBuilder(
|
|
609
585
|
program,
|
|
610
586
|
() => ({ content: file.getFullText(), path: file.getFilePath() }),
|
|
611
|
-
modularEmitterOptions as any
|
|
587
|
+
modularEmitterOptions as any,
|
|
612
588
|
);
|
|
613
589
|
}
|
|
614
590
|
}
|
|
@@ -626,13 +602,10 @@ export async function $onEmit(context: EmitContext) {
|
|
|
626
602
|
}
|
|
627
603
|
modularPackageInfo = {
|
|
628
604
|
exports: getModuleExports(context, modularEmitterOptions),
|
|
629
|
-
clientContextPaths: getRelativeContextPaths(
|
|
630
|
-
context,
|
|
631
|
-
modularEmitterOptions
|
|
632
|
-
),
|
|
605
|
+
clientContextPaths: getRelativeContextPaths(context, modularEmitterOptions),
|
|
633
606
|
...(Object.keys(additionalDependencies).length > 0 && {
|
|
634
|
-
dependencies: additionalDependencies
|
|
635
|
-
})
|
|
607
|
+
dependencies: additionalDependencies,
|
|
608
|
+
}),
|
|
636
609
|
};
|
|
637
610
|
}
|
|
638
611
|
|
|
@@ -640,40 +613,30 @@ export async function $onEmit(context: EmitContext) {
|
|
|
640
613
|
// and for modular packages (adds exports, clientContextPaths, LRO deps)
|
|
641
614
|
if (option.isModularLibrary || option.azureSdkForJs) {
|
|
642
615
|
updateBuilders.push((model: RLCModel) =>
|
|
643
|
-
updatePackageFile(model, existingPackageFilePath, modularPackageInfo)
|
|
616
|
+
updatePackageFile(model, existingPackageFilePath, modularPackageInfo),
|
|
644
617
|
);
|
|
645
618
|
}
|
|
646
619
|
|
|
647
620
|
// Update warp.config.yml for Azure monorepo packages
|
|
648
621
|
if (option.azureSdkForJs) {
|
|
649
|
-
updateBuilders.push((model: RLCModel) =>
|
|
650
|
-
buildWarpConfig(model, modularPackageInfo)
|
|
651
|
-
);
|
|
622
|
+
updateBuilders.push((model: RLCModel) => buildWarpConfig(model, modularPackageInfo));
|
|
652
623
|
}
|
|
653
624
|
|
|
654
625
|
// If the client name changed, regenerate the README and snippets completely;
|
|
655
626
|
// otherwise update only the API reference link in-place.
|
|
656
627
|
if (hasReadmeFile) {
|
|
657
|
-
const clientNameChanged = hasClientNameChanged(
|
|
658
|
-
rlcClient,
|
|
659
|
-
existingReadmeFilePath
|
|
660
|
-
);
|
|
628
|
+
const clientNameChanged = hasClientNameChanged(rlcClient, existingReadmeFilePath);
|
|
661
629
|
updateBuilders.push(
|
|
662
630
|
clientNameChanged
|
|
663
631
|
? buildReadmeFile
|
|
664
|
-
: (model: RLCModel) =>
|
|
665
|
-
updateReadmeFile(model, existingReadmeFilePath)
|
|
632
|
+
: (model: RLCModel) => updateReadmeFile(model, existingReadmeFilePath),
|
|
666
633
|
);
|
|
667
634
|
|
|
668
635
|
// Regenerate snippets.spec.ts only when the client name changed
|
|
669
636
|
if (clientNameChanged && option.azureSdkForJs) {
|
|
670
637
|
for (const subClient of dpgContext.sdkPackage.clients) {
|
|
671
638
|
updateBuilders.push((model: RLCModel) =>
|
|
672
|
-
buildSnippets(
|
|
673
|
-
model,
|
|
674
|
-
getClassicalClientName(subClient),
|
|
675
|
-
option.azureSdkForJs
|
|
676
|
-
)
|
|
639
|
+
buildSnippets(model, getClassicalClientName(subClient), option.azureSdkForJs),
|
|
677
640
|
);
|
|
678
641
|
}
|
|
679
642
|
}
|
|
@@ -684,7 +647,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
684
647
|
program,
|
|
685
648
|
updateBuilders,
|
|
686
649
|
rlcClient,
|
|
687
|
-
dpgContext.generationPathDetail?.metadataDir
|
|
650
|
+
dpgContext.generationPathDetail?.metadataDir,
|
|
688
651
|
);
|
|
689
652
|
}
|
|
690
653
|
if (isAzureFlavor) {
|
|
@@ -692,7 +655,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
692
655
|
program,
|
|
693
656
|
buildMetadataJson,
|
|
694
657
|
rlcClient,
|
|
695
|
-
dpgContext.generationPathDetail?.metadataDir
|
|
658
|
+
dpgContext.generationPathDetail?.metadataDir,
|
|
696
659
|
);
|
|
697
660
|
}
|
|
698
661
|
|
|
@@ -702,15 +665,12 @@ export async function $onEmit(context: EmitContext) {
|
|
|
702
665
|
program,
|
|
703
666
|
[buildRecordedClientFile, buildSampleTest],
|
|
704
667
|
rlcClient,
|
|
705
|
-
dpgContext.generationPathDetail?.metadataDir
|
|
668
|
+
dpgContext.generationPathDetail?.metadataDir,
|
|
706
669
|
);
|
|
707
670
|
}
|
|
708
671
|
}
|
|
709
672
|
|
|
710
|
-
function getRelativeContextPaths(
|
|
711
|
-
context: SdkContext,
|
|
712
|
-
options: ModularEmitterOptions
|
|
713
|
-
) {
|
|
673
|
+
function getRelativeContextPaths(context: SdkContext, options: ModularEmitterOptions) {
|
|
714
674
|
const clientMap = getClientHierarchyMap(context);
|
|
715
675
|
return Array.from(clientMap)
|
|
716
676
|
.map((subClient) => getClientContextPath(subClient, options))
|
|
@@ -719,7 +679,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
719
679
|
}
|
|
720
680
|
|
|
721
681
|
export async function createContextWithDefaultOptions(
|
|
722
|
-
context: EmitContext<Record<string, any
|
|
682
|
+
context: EmitContext<Record<string, any>>,
|
|
723
683
|
): Promise<SdkContext> {
|
|
724
684
|
const flattenUnionAsEnum =
|
|
725
685
|
context.options["experimental-extensible-enums"] === undefined
|
|
@@ -731,21 +691,21 @@ export async function createContextWithDefaultOptions(
|
|
|
731
691
|
emitters: [
|
|
732
692
|
{
|
|
733
693
|
main: "@azure-tools/typespec-ts",
|
|
734
|
-
metadata: { name: "@azure-tools/typespec-ts" }
|
|
735
|
-
}
|
|
736
|
-
]
|
|
694
|
+
metadata: { name: "@azure-tools/typespec-ts" },
|
|
695
|
+
},
|
|
696
|
+
],
|
|
737
697
|
};
|
|
738
698
|
context.options = {
|
|
739
699
|
...context.options,
|
|
740
|
-
...tcgcSettings
|
|
700
|
+
...tcgcSettings,
|
|
741
701
|
};
|
|
742
702
|
|
|
743
703
|
return (await createSdkContext(
|
|
744
704
|
context,
|
|
745
705
|
context.program.emitters[0]?.metadata.name ?? "@azure-tools/typespec-ts",
|
|
746
706
|
{
|
|
747
|
-
flattenUnionAsEnum
|
|
748
|
-
}
|
|
707
|
+
flattenUnionAsEnum,
|
|
708
|
+
},
|
|
749
709
|
)) as SdkContext;
|
|
750
710
|
}
|
|
751
711
|
|
|
@@ -757,7 +717,7 @@ function isArm(context: EmitContext<Record<string, any>>) {
|
|
|
757
717
|
|
|
758
718
|
export async function renameClientName(
|
|
759
719
|
client: SdkClientType<SdkServiceOperation>,
|
|
760
|
-
emitterOptions: ModularEmitterOptions
|
|
720
|
+
emitterOptions: ModularEmitterOptions,
|
|
761
721
|
) {
|
|
762
722
|
if (
|
|
763
723
|
emitterOptions.options.typespecTitleMap &&
|