@azure-tools/typespec-ts 0.53.3 → 0.54.0
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 +11 -0
- package/dist/src/framework/hooks/binder.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.js +102 -44
- package/dist/src/framework/hooks/binder.js.map +1 -1
- package/dist/src/framework/hooks/sdkTypes.js +1 -1
- package/dist/src/framework/hooks/sdkTypes.js.map +1 -1
- package/dist/src/framework/load-static-helpers.js +1 -1
- package/dist/src/framework/load-static-helpers.js.map +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +1 -10
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +0 -5
- 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.js +1 -1
- package/dist/src/modular/buildClassicalClient.js.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.js +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.js.map +1 -1
- package/dist/src/modular/buildClientContext.js +1 -1
- package/dist/src/modular/buildClientContext.js.map +1 -1
- package/dist/src/modular/buildOperations.js +1 -1
- package/dist/src/modular/buildOperations.js.map +1 -1
- package/dist/src/modular/buildProjectFiles.js +1 -1
- package/dist/src/modular/buildProjectFiles.js.map +1 -1
- package/dist/src/modular/buildRestorePoller.js +1 -1
- package/dist/src/modular/buildRestorePoller.js.map +1 -1
- package/dist/src/modular/buildRootIndex.js +1 -1
- package/dist/src/modular/buildRootIndex.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 +1 -1
- package/dist/src/modular/emitModels.js.map +1 -1
- package/dist/src/modular/emitModelsOptions.js +1 -1
- package/dist/src/modular/emitModelsOptions.js.map +1 -1
- package/dist/src/modular/emitSamples.js +1 -1
- package/dist/src/modular/emitSamples.js.map +1 -1
- package/dist/src/modular/emitTests.js +1 -1
- package/dist/src/modular/emitTests.js.map +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.js +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.js +1 -1
- package/dist/src/modular/helpers/clientHelpers.js.map +1 -1
- package/dist/src/modular/helpers/exampleValueHelpers.js +1 -1
- 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 +1 -1
- package/dist/src/modular/helpers/namingHelpers.js.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.js +53 -34
- package/dist/src/modular/helpers/operationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.js +1 -1
- package/dist/src/modular/helpers/typeHelpers.js.map +1 -1
- package/dist/src/modular/interfaces.d.ts +1 -1
- package/dist/src/modular/interfaces.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.js +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.js +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js.map +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.js +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.js.map +1 -1
- package/dist/src/rlc-common/buildClient.d.ts +9 -0
- package/dist/src/rlc-common/buildClient.d.ts.map +1 -0
- package/dist/src/rlc-common/buildClient.js +413 -0
- package/dist/src/rlc-common/buildClient.js.map +1 -0
- package/dist/src/rlc-common/buildClientDefinitions.d.ts +6 -0
- package/dist/src/rlc-common/buildClientDefinitions.d.ts.map +1 -0
- package/dist/src/rlc-common/buildClientDefinitions.js +174 -0
- package/dist/src/rlc-common/buildClientDefinitions.js.map +1 -0
- package/dist/src/rlc-common/buildIndexFile.d.ts +6 -0
- package/dist/src/rlc-common/buildIndexFile.d.ts.map +1 -0
- package/dist/src/rlc-common/buildIndexFile.js +242 -0
- package/dist/src/rlc-common/buildIndexFile.js.map +1 -0
- package/dist/src/rlc-common/buildIsUnexpectedHelper.d.ts +6 -0
- package/dist/src/rlc-common/buildIsUnexpectedHelper.d.ts.map +1 -0
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js +224 -0
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js.map +1 -0
- package/dist/src/rlc-common/buildLogger.d.ts +6 -0
- package/dist/src/rlc-common/buildLogger.d.ts.map +1 -0
- package/dist/src/rlc-common/buildLogger.js +32 -0
- package/dist/src/rlc-common/buildLogger.js.map +1 -0
- package/dist/src/rlc-common/buildMethodShortcuts.d.ts +5 -0
- package/dist/src/rlc-common/buildMethodShortcuts.d.ts.map +1 -0
- package/dist/src/rlc-common/buildMethodShortcuts.js +54 -0
- package/dist/src/rlc-common/buildMethodShortcuts.js.map +1 -0
- package/dist/src/rlc-common/buildObjectTypes.d.ts +29 -0
- package/dist/src/rlc-common/buildObjectTypes.d.ts.map +1 -0
- package/dist/src/rlc-common/buildObjectTypes.js +451 -0
- package/dist/src/rlc-common/buildObjectTypes.js.map +1 -0
- package/dist/src/rlc-common/buildPaginateHelper.d.ts +6 -0
- package/dist/src/rlc-common/buildPaginateHelper.d.ts.map +1 -0
- package/dist/src/rlc-common/buildPaginateHelper.js +27 -0
- package/dist/src/rlc-common/buildPaginateHelper.js.map +1 -0
- package/dist/src/rlc-common/buildParameterTypes.d.ts +14 -0
- package/dist/src/rlc-common/buildParameterTypes.d.ts.map +1 -0
- package/dist/src/rlc-common/buildParameterTypes.js +381 -0
- package/dist/src/rlc-common/buildParameterTypes.js.map +1 -0
- package/dist/src/rlc-common/buildPollingHelper.d.ts +6 -0
- package/dist/src/rlc-common/buildPollingHelper.d.ts.map +1 -0
- package/dist/src/rlc-common/buildPollingHelper.js +62 -0
- package/dist/src/rlc-common/buildPollingHelper.js.map +1 -0
- package/dist/src/rlc-common/buildResponseTypes.d.ts +6 -0
- package/dist/src/rlc-common/buildResponseTypes.d.ts.map +1 -0
- package/dist/src/rlc-common/buildResponseTypes.js +147 -0
- package/dist/src/rlc-common/buildResponseTypes.js.map +1 -0
- package/dist/src/rlc-common/buildSamples.d.ts +3 -0
- package/dist/src/rlc-common/buildSamples.d.ts.map +1 -0
- package/dist/src/rlc-common/buildSamples.js +30 -0
- package/dist/src/rlc-common/buildSamples.js.map +1 -0
- package/dist/src/rlc-common/buildSchemaType.d.ts +20 -0
- package/dist/src/rlc-common/buildSchemaType.d.ts.map +1 -0
- package/dist/src/rlc-common/buildSchemaType.js +53 -0
- package/dist/src/rlc-common/buildSchemaType.js.map +1 -0
- package/dist/src/rlc-common/buildSerializeHelper.d.ts +6 -0
- package/dist/src/rlc-common/buildSerializeHelper.d.ts.map +1 -0
- package/dist/src/rlc-common/buildSerializeHelper.js +36 -0
- package/dist/src/rlc-common/buildSerializeHelper.js.map +1 -0
- package/dist/src/rlc-common/buildTopLevelIndexFile.d.ts +6 -0
- package/dist/src/rlc-common/buildTopLevelIndexFile.d.ts.map +1 -0
- package/dist/src/rlc-common/buildTopLevelIndexFile.js +52 -0
- package/dist/src/rlc-common/buildTopLevelIndexFile.js.map +1 -0
- package/dist/src/rlc-common/helpers/apiVersionUtil.d.ts +17 -0
- package/dist/src/rlc-common/helpers/apiVersionUtil.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/apiVersionUtil.js +45 -0
- package/dist/src/rlc-common/helpers/apiVersionUtil.js.map +1 -0
- package/dist/src/rlc-common/helpers/importsUtil.d.ts +18 -0
- package/dist/src/rlc-common/helpers/importsUtil.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/importsUtil.js +169 -0
- package/dist/src/rlc-common/helpers/importsUtil.js.map +1 -0
- package/dist/src/rlc-common/helpers/nameConstructors.d.ts +42 -0
- package/dist/src/rlc-common/helpers/nameConstructors.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/nameConstructors.js +63 -0
- package/dist/src/rlc-common/helpers/nameConstructors.js.map +1 -0
- package/dist/src/rlc-common/helpers/nameUtils.d.ts +37 -0
- package/dist/src/rlc-common/helpers/nameUtils.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/nameUtils.js +246 -0
- package/dist/src/rlc-common/helpers/nameUtils.js.map +1 -0
- package/dist/src/rlc-common/helpers/operationHelpers.d.ts +16 -0
- package/dist/src/rlc-common/helpers/operationHelpers.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/operationHelpers.js +119 -0
- package/dist/src/rlc-common/helpers/operationHelpers.js.map +1 -0
- package/dist/src/rlc-common/helpers/packageUtil.d.ts +7 -0
- package/dist/src/rlc-common/helpers/packageUtil.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/packageUtil.js +13 -0
- package/dist/src/rlc-common/helpers/packageUtil.js.map +1 -0
- package/dist/src/rlc-common/helpers/pathUtils.d.ts +2 -0
- package/dist/src/rlc-common/helpers/pathUtils.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/pathUtils.js +12 -0
- package/dist/src/rlc-common/helpers/pathUtils.js.map +1 -0
- package/dist/src/rlc-common/helpers/schemaHelpers.d.ts +10 -0
- package/dist/src/rlc-common/helpers/schemaHelpers.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/schemaHelpers.js +41 -0
- package/dist/src/rlc-common/helpers/schemaHelpers.js.map +1 -0
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts +4 -0
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/shortcutMethods.js +49 -0
- package/dist/src/rlc-common/helpers/shortcutMethods.js.map +1 -0
- package/dist/src/rlc-common/helpers/typeUtil.d.ts +32 -0
- package/dist/src/rlc-common/helpers/typeUtil.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/typeUtil.js +167 -0
- package/dist/src/rlc-common/helpers/typeUtil.js.map +1 -0
- package/dist/src/rlc-common/helpers/valueGenerationUtil.d.ts +12 -0
- package/dist/src/rlc-common/helpers/valueGenerationUtil.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js +165 -0
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js.map +1 -0
- package/dist/src/rlc-common/index.d.ts +41 -0
- package/dist/src/rlc-common/index.d.ts.map +1 -0
- package/dist/src/rlc-common/index.js +43 -0
- package/dist/src/rlc-common/index.js.map +1 -0
- package/dist/src/rlc-common/interfaces.d.ts +369 -0
- package/dist/src/rlc-common/interfaces.d.ts.map +1 -0
- package/dist/src/rlc-common/interfaces.js +11 -0
- package/dist/src/rlc-common/interfaces.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.d.ts +6 -0
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js +56 -0
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildChangelogFile.d.ts +6 -0
- package/dist/src/rlc-common/metadata/buildChangelogFile.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildChangelogFile.js +26 -0
- package/dist/src/rlc-common/metadata/buildChangelogFile.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildESLintConfig.d.ts +6 -0
- package/dist/src/rlc-common/metadata/buildESLintConfig.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildESLintConfig.js +82 -0
- package/dist/src/rlc-common/metadata/buildESLintConfig.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildLicenseFile.d.ts +5 -0
- package/dist/src/rlc-common/metadata/buildLicenseFile.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildLicenseFile.js +32 -0
- package/dist/src/rlc-common/metadata/buildLicenseFile.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildPackageFile.d.ts +25 -0
- package/dist/src/rlc-common/metadata/buildPackageFile.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildPackageFile.js +201 -0
- package/dist/src/rlc-common/metadata/buildPackageFile.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildReadmeFile.d.ts +11 -0
- package/dist/src/rlc-common/metadata/buildReadmeFile.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildReadmeFile.js +426 -0
- package/dist/src/rlc-common/metadata/buildReadmeFile.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildRollupConfig.d.ts +6 -0
- package/dist/src/rlc-common/metadata/buildRollupConfig.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildRollupConfig.js +142 -0
- package/dist/src/rlc-common/metadata/buildRollupConfig.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.d.ts +6 -0
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js +17 -0
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildTestConfig.d.ts +16 -0
- package/dist/src/rlc-common/metadata/buildTestConfig.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildTestConfig.js +55 -0
- package/dist/src/rlc-common/metadata/buildTestConfig.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildTsConfig.d.ts +61 -0
- package/dist/src/rlc-common/metadata/buildTsConfig.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildTsConfig.js +170 -0
- package/dist/src/rlc-common/metadata/buildTsConfig.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildVitestConfig.d.ts +6 -0
- package/dist/src/rlc-common/metadata/buildVitestConfig.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildVitestConfig.js +28 -0
- package/dist/src/rlc-common/metadata/buildVitestConfig.js.map +1 -0
- package/dist/src/rlc-common/metadata/buildWarpConfig.d.ts +20 -0
- package/dist/src/rlc-common/metadata/buildWarpConfig.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/buildWarpConfig.js +77 -0
- package/dist/src/rlc-common/metadata/buildWarpConfig.js.map +1 -0
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts +51 -0
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js +121 -0
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js.map +1 -0
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.d.ts +242 -0
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js +176 -0
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js.map +1 -0
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.d.ts +8 -0
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js +102 -0
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js.map +1 -0
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.d.ts +57 -0
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js +53 -0
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js.map +1 -0
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.d.ts +64 -0
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js +183 -0
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js.map +1 -0
- package/dist/src/rlc-common/metadata/utils.d.ts +3 -0
- package/dist/src/rlc-common/metadata/utils.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/utils.js +7 -0
- package/dist/src/rlc-common/metadata/utils.js.map +1 -0
- package/dist/src/rlc-common/static/paginateContent.d.ts +2 -0
- package/dist/src/rlc-common/static/paginateContent.d.ts.map +1 -0
- package/dist/src/rlc-common/static/paginateContent.js +345 -0
- package/dist/src/rlc-common/static/paginateContent.js.map +1 -0
- package/dist/src/rlc-common/static/pollingContent.d.ts +2 -0
- package/dist/src/rlc-common/static/pollingContent.d.ts.map +1 -0
- package/dist/src/rlc-common/static/pollingContent.js +225 -0
- package/dist/src/rlc-common/static/pollingContent.js.map +1 -0
- package/dist/src/rlc-common/static/sampleTemplate.d.ts +2 -0
- package/dist/src/rlc-common/static/sampleTemplate.d.ts.map +1 -0
- package/dist/src/rlc-common/static/sampleTemplate.js +56 -0
- package/dist/src/rlc-common/static/sampleTemplate.js.map +1 -0
- package/dist/src/rlc-common/static/serializeHelper.d.ts +6 -0
- package/dist/src/rlc-common/static/serializeHelper.d.ts.map +1 -0
- package/dist/src/rlc-common/static/serializeHelper.js +31 -0
- package/dist/src/rlc-common/static/serializeHelper.js.map +1 -0
- package/dist/src/rlc-common/test/buildKarmaConfig.d.ts +6 -0
- package/dist/src/rlc-common/test/buildKarmaConfig.d.ts.map +1 -0
- package/dist/src/rlc-common/test/buildKarmaConfig.js +11 -0
- package/dist/src/rlc-common/test/buildKarmaConfig.js.map +1 -0
- package/dist/src/rlc-common/test/buildRecordedClient.d.ts +6 -0
- package/dist/src/rlc-common/test/buildRecordedClient.d.ts.map +1 -0
- package/dist/src/rlc-common/test/buildRecordedClient.js +18 -0
- package/dist/src/rlc-common/test/buildRecordedClient.js.map +1 -0
- package/dist/src/rlc-common/test/buildSampleTest.d.ts +6 -0
- package/dist/src/rlc-common/test/buildSampleTest.d.ts.map +1 -0
- package/dist/src/rlc-common/test/buildSampleTest.js +15 -0
- package/dist/src/rlc-common/test/buildSampleTest.js.map +1 -0
- package/dist/src/rlc-common/test/buildSnippets.d.ts +6 -0
- package/dist/src/rlc-common/test/buildSnippets.d.ts.map +1 -0
- package/dist/src/rlc-common/test/buildSnippets.js +29 -0
- package/dist/src/rlc-common/test/buildSnippets.js.map +1 -0
- package/dist/src/rlc-common/test/template.d.ts +5 -0
- package/dist/src/rlc-common/test/template.d.ts.map +1 -0
- package/dist/src/rlc-common/test/template.js +261 -0
- package/dist/src/rlc-common/test/template.js.map +1 -0
- package/dist/src/rlc-common/transformSampleGroups.d.ts +9 -0
- package/dist/src/rlc-common/transformSampleGroups.d.ts.map +1 -0
- package/dist/src/rlc-common/transformSampleGroups.js +317 -0
- package/dist/src/rlc-common/transformSampleGroups.js.map +1 -0
- 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 +1 -1
- 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 +1 -1
- 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/transformParameters.d.ts +1 -1
- package/dist/src/transform/transformParameters.d.ts.map +1 -1
- package/dist/src/transform/transformParameters.js +1 -1
- 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 +1 -1
- 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 +1 -1
- package/dist/src/transform/transformResponses.js.map +1 -1
- package/dist/src/transform/transformSchemas.js +1 -1
- 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/transfromRLCOptions.d.ts +1 -1
- package/dist/src/transform/transfromRLCOptions.d.ts.map +1 -1
- package/dist/src/transform/transfromRLCOptions.js +1 -3
- package/dist/src/transform/transfromRLCOptions.js.map +1 -1
- package/dist/src/utils/clientUtils.js +1 -1
- package/dist/src/utils/clientUtils.js.map +1 -1
- package/dist/src/utils/crossLanguageDef.js +1 -1
- 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 +1 -1
- package/dist/src/utils/emitUtil.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/modelUtils.d.ts +1 -1
- package/dist/src/utils/modelUtils.d.ts.map +1 -1
- package/dist/src/utils/modelUtils.js +1 -1
- package/dist/src/utils/modelUtils.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 +1 -1
- 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 +1 -1
- package/dist/src/utils/parameterUtils.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +9 -9
- package/src/framework/hooks/binder.ts +142 -51
- package/src/framework/hooks/sdkTypes.ts +1 -1
- package/src/framework/load-static-helpers.ts +1 -1
- package/src/index.ts +5 -1
- package/src/lib.ts +1 -16
- package/src/metaTree.ts +1 -1
- package/src/modular/buildClassicalClient.ts +1 -1
- package/src/modular/buildClassicalOperationGroups.ts +1 -1
- package/src/modular/buildClientContext.ts +1 -1
- package/src/modular/buildOperations.ts +1 -1
- package/src/modular/buildProjectFiles.ts +1 -1
- package/src/modular/buildRestorePoller.ts +1 -1
- package/src/modular/buildRootIndex.ts +1 -1
- package/src/modular/emitModels.ts +1 -1
- package/src/modular/emitModelsOptions.ts +1 -1
- package/src/modular/emitSamples.ts +1 -1
- package/src/modular/emitTests.ts +1 -1
- package/src/modular/helpers/classicalOperationHelpers.ts +1 -1
- package/src/modular/helpers/clientHelpers.ts +1 -1
- package/src/modular/helpers/exampleValueHelpers.ts +1 -1
- package/src/modular/helpers/namingHelpers.ts +1 -1
- package/src/modular/helpers/operationHelpers.ts +65 -42
- package/src/modular/helpers/typeHelpers.ts +1 -1
- package/src/modular/interfaces.ts +1 -1
- package/src/modular/serialization/buildDeserializerFunction.ts +1 -1
- package/src/modular/serialization/buildSerializerFunction.ts +1 -1
- package/src/modular/serialization/buildXmlSerializerFunction.ts +1 -1
- package/src/modular/type-expressions/get-type-expression.ts +1 -1
- package/src/rlc-common/buildClient.ts +561 -0
- package/src/rlc-common/buildClientDefinitions.ts +278 -0
- package/src/rlc-common/buildIndexFile.ts +344 -0
- package/src/rlc-common/buildIsUnexpectedHelper.ts +255 -0
- package/src/rlc-common/buildLogger.ts +43 -0
- package/src/rlc-common/buildMethodShortcuts.ts +83 -0
- package/src/rlc-common/buildObjectTypes.ts +680 -0
- package/src/rlc-common/buildPaginateHelper.ts +34 -0
- package/src/rlc-common/buildParameterTypes.ts +575 -0
- package/src/rlc-common/buildPollingHelper.ts +83 -0
- package/src/rlc-common/buildResponseTypes.ts +203 -0
- package/src/rlc-common/buildSamples.ts +32 -0
- package/src/rlc-common/buildSchemaType.ts +81 -0
- package/src/rlc-common/buildSerializeHelper.ts +49 -0
- package/src/rlc-common/buildTopLevelIndexFile.ts +65 -0
- package/src/rlc-common/helpers/apiVersionUtil.ts +53 -0
- package/src/rlc-common/helpers/importsUtil.ts +187 -0
- package/src/rlc-common/helpers/nameConstructors.ts +144 -0
- package/src/rlc-common/helpers/nameUtils.ts +319 -0
- package/src/rlc-common/helpers/operationHelpers.ts +155 -0
- package/src/rlc-common/helpers/packageUtil.ts +13 -0
- package/src/rlc-common/helpers/pathUtils.ts +15 -0
- package/src/rlc-common/helpers/schemaHelpers.ts +61 -0
- package/src/rlc-common/helpers/shortcutMethods.ts +67 -0
- package/src/rlc-common/helpers/typeUtil.ts +173 -0
- package/src/rlc-common/helpers/valueGenerationUtil.ts +257 -0
- package/src/rlc-common/index.ts +43 -0
- package/src/rlc-common/interfaces.ts +441 -0
- package/src/rlc-common/metadata/buildApiExtractorConfig.ts +71 -0
- package/src/rlc-common/metadata/buildChangelogFile.ts +29 -0
- package/src/rlc-common/metadata/buildESLintConfig.ts +86 -0
- package/src/rlc-common/metadata/buildLicenseFile.ts +33 -0
- package/src/rlc-common/metadata/buildPackageFile.ts +250 -0
- package/src/rlc-common/metadata/buildReadmeFile.ts +528 -0
- package/src/rlc-common/metadata/buildRollupConfig.ts +150 -0
- package/src/rlc-common/metadata/buildSampleEnvFile.ts +22 -0
- package/src/rlc-common/metadata/buildTestConfig.ts +72 -0
- package/src/rlc-common/metadata/buildTsConfig.ts +222 -0
- package/src/rlc-common/metadata/buildVitestConfig.ts +36 -0
- package/src/rlc-common/metadata/buildWarpConfig.ts +94 -0
- package/src/rlc-common/metadata/packageJson/azurePackageCommon.ts +161 -0
- package/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.ts +220 -0
- package/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.ts +134 -0
- package/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.ts +70 -0
- package/src/rlc-common/metadata/packageJson/packageCommon.ts +255 -0
- package/src/rlc-common/metadata/utils.ts +8 -0
- package/src/rlc-common/static/paginateContent.ts +345 -0
- package/src/rlc-common/static/pollingContent.ts +225 -0
- package/src/rlc-common/static/sampleTemplate.ts +56 -0
- package/src/rlc-common/static/serializeHelper.ts +34 -0
- package/src/rlc-common/test/buildKarmaConfig.ts +12 -0
- package/src/rlc-common/test/buildRecordedClient.ts +18 -0
- package/src/rlc-common/test/buildSampleTest.ts +15 -0
- package/src/rlc-common/test/buildSnippets.ts +35 -0
- package/src/rlc-common/test/template.ts +263 -0
- package/src/rlc-common/transformSampleGroups.ts +458 -0
- package/src/transform/transform.ts +1 -1
- package/src/transform/transformApiVersionInfo.ts +1 -1
- package/src/transform/transformHelperFunctionDetails.ts +1 -1
- package/src/transform/transformParameters.ts +1 -1
- package/src/transform/transformPaths.ts +1 -1
- package/src/transform/transformResponses.ts +1 -1
- package/src/transform/transformSchemas.ts +1 -1
- package/src/transform/transformTelemetryInfo.ts +1 -1
- package/src/transform/transfromRLCOptions.ts +1 -3
- package/src/utils/clientUtils.ts +1 -1
- package/src/utils/crossLanguageDef.ts +1 -1
- package/src/utils/emitUtil.ts +1 -1
- package/src/utils/interfaces.ts +1 -1
- package/src/utils/modelUtils.ts +1 -1
- package/src/utils/operationUtil.ts +1 -1
- package/src/utils/parameterUtils.ts +1 -1
- package/LICENSE +0 -21
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import { RLCModel } from "../interfaces.js";
|
|
5
|
+
import { getPackageName } from "./utils.js";
|
|
6
|
+
|
|
7
|
+
function shouldGenerateTestConfig(model: RLCModel): boolean {
|
|
8
|
+
const isAzureSdkForJs = model.options?.azureSdkForJs ?? false;
|
|
9
|
+
return !(
|
|
10
|
+
model.options?.generateMetadata === false ||
|
|
11
|
+
model.options?.generateTest === false ||
|
|
12
|
+
isAzureSdkForJs !== true
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Builds config/tsconfig.test.browser.json — extends eng/tsconfigs/test.browser.json
|
|
18
|
+
*/
|
|
19
|
+
export function buildTestBrowserTsConfig(model: RLCModel) {
|
|
20
|
+
if (!shouldGenerateTestConfig(model)) {
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const name = getPackageName(model);
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
path: "config/tsconfig.test.browser.json",
|
|
28
|
+
content: JSON.stringify(
|
|
29
|
+
{
|
|
30
|
+
extends: "../../../../eng/tsconfigs/test.browser.json",
|
|
31
|
+
compilerOptions: {
|
|
32
|
+
paths: {
|
|
33
|
+
[name]: ["../src/index.ts"],
|
|
34
|
+
[`${name}/*`]: ["../src/*"],
|
|
35
|
+
"$internal/*": ["../src/*"]
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
null,
|
|
40
|
+
2
|
|
41
|
+
)
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Builds config/tsconfig.test.node.json — extends eng/tsconfigs/test.node.json
|
|
47
|
+
*/
|
|
48
|
+
export function buildTestNodeTsConfig(model: RLCModel) {
|
|
49
|
+
if (!shouldGenerateTestConfig(model)) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const name = getPackageName(model);
|
|
54
|
+
|
|
55
|
+
return {
|
|
56
|
+
path: "config/tsconfig.test.node.json",
|
|
57
|
+
content: JSON.stringify(
|
|
58
|
+
{
|
|
59
|
+
extends: "../../../../eng/tsconfigs/test.node.json",
|
|
60
|
+
compilerOptions: {
|
|
61
|
+
paths: {
|
|
62
|
+
[name]: ["../src/index.ts"],
|
|
63
|
+
[`${name}/*`]: ["../src/*"],
|
|
64
|
+
"$internal/*": ["../src/*"]
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
null,
|
|
69
|
+
2
|
|
70
|
+
)
|
|
71
|
+
};
|
|
72
|
+
}
|
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import { Project } from "ts-morph";
|
|
5
|
+
import { RLCModel } from "../interfaces.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Builds the root tsconfig.json.
|
|
9
|
+
*
|
|
10
|
+
* For azureSdkForJs packages, emits project references pointing into the
|
|
11
|
+
* `config/` subfolder (following the eng/tsconfigs pattern).
|
|
12
|
+
*/
|
|
13
|
+
export function buildTsConfig(model: RLCModel) {
|
|
14
|
+
const { packageDetails, azureSdkForJs } = model.options || {};
|
|
15
|
+
const { generateTest, generateSample, generateReactNativeTarget } =
|
|
16
|
+
model.options || {};
|
|
17
|
+
const clientPackageName = packageDetails?.name ?? "";
|
|
18
|
+
const project = new Project();
|
|
19
|
+
|
|
20
|
+
let tsConfig: Record<string, any>;
|
|
21
|
+
|
|
22
|
+
if (azureSdkForJs) {
|
|
23
|
+
const references: { path: string }[] = [
|
|
24
|
+
{ path: "./config/tsconfig.src.esm.json" },
|
|
25
|
+
{ path: "./config/tsconfig.src.browser.json" }
|
|
26
|
+
];
|
|
27
|
+
|
|
28
|
+
if (generateReactNativeTarget) {
|
|
29
|
+
references.push({ path: "./config/tsconfig.src.react-native.json" });
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
references.push({ path: "./config/tsconfig.src.cjs.json" });
|
|
33
|
+
|
|
34
|
+
if (generateTest) {
|
|
35
|
+
references.push(
|
|
36
|
+
{ path: "./config/tsconfig.test.node.json" },
|
|
37
|
+
{ path: "./config/tsconfig.test.browser.json" }
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
if (generateSample) {
|
|
42
|
+
references.push({ path: "./config/tsconfig.samples.json" });
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
if (generateTest) {
|
|
46
|
+
references.push({ path: "./config/tsconfig.snippets.json" });
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
tsConfig = { references, files: [] };
|
|
50
|
+
} else {
|
|
51
|
+
const { options } = model;
|
|
52
|
+
tsConfig = {
|
|
53
|
+
compilerOptions: {
|
|
54
|
+
target: "ES2017",
|
|
55
|
+
module: options?.moduleKind === "esm" ? "NodeNext" : "es6",
|
|
56
|
+
lib: [],
|
|
57
|
+
declaration: true,
|
|
58
|
+
declarationMap: true,
|
|
59
|
+
inlineSources: true,
|
|
60
|
+
sourceMap: true,
|
|
61
|
+
importHelpers: true,
|
|
62
|
+
strict: true,
|
|
63
|
+
alwaysStrict: true,
|
|
64
|
+
noUnusedLocals: true,
|
|
65
|
+
noUnusedParameters: true,
|
|
66
|
+
noImplicitReturns: true,
|
|
67
|
+
noFallthroughCasesInSwitch: true,
|
|
68
|
+
forceConsistentCasingInFileNames: true,
|
|
69
|
+
moduleResolution: options?.moduleKind === "esm" ? "NodeNext" : "node",
|
|
70
|
+
allowSyntheticDefaultImports: true,
|
|
71
|
+
esModuleInterop: true,
|
|
72
|
+
outDir: options?.moduleKind === "cjs" ? "./dist-esm" : undefined,
|
|
73
|
+
declarationDir: options?.moduleKind === "cjs" ? "./types" : undefined
|
|
74
|
+
},
|
|
75
|
+
include: ["src/**/*.ts"]
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
if (generateTest) {
|
|
79
|
+
tsConfig["include"].push("test/**/*.ts");
|
|
80
|
+
}
|
|
81
|
+
if (generateSample) {
|
|
82
|
+
tsConfig["include"].push("samples-dev/**/*.ts");
|
|
83
|
+
tsConfig["compilerOptions"]["paths"] = {};
|
|
84
|
+
tsConfig["compilerOptions"]["paths"][clientPackageName] = ["./src/index"];
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
const filePath = "tsconfig.json";
|
|
89
|
+
const configFile = project.createSourceFile(
|
|
90
|
+
filePath,
|
|
91
|
+
JSON.stringify(tsConfig, null, 2),
|
|
92
|
+
{ overwrite: true }
|
|
93
|
+
);
|
|
94
|
+
return {
|
|
95
|
+
path: filePath,
|
|
96
|
+
content: configFile.getFullText()
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* Builds config/tsconfig.src.esm.json — extends eng/tsconfigs/src.esm.json
|
|
102
|
+
*/
|
|
103
|
+
export function buildTsSrcEsmConfig() {
|
|
104
|
+
return {
|
|
105
|
+
path: "config/tsconfig.src.esm.json",
|
|
106
|
+
content: JSON.stringify(
|
|
107
|
+
{
|
|
108
|
+
extends: "../../../../eng/tsconfigs/src.esm.json",
|
|
109
|
+
include: ["../src/index.ts"]
|
|
110
|
+
},
|
|
111
|
+
null,
|
|
112
|
+
2
|
|
113
|
+
)
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Builds config/tsconfig.src.browser.json — extends eng/tsconfigs/src.browser.json
|
|
119
|
+
*/
|
|
120
|
+
export function buildTsSrcBrowserConfig() {
|
|
121
|
+
return {
|
|
122
|
+
path: "config/tsconfig.src.browser.json",
|
|
123
|
+
content: JSON.stringify(
|
|
124
|
+
{
|
|
125
|
+
extends: "../../../../eng/tsconfigs/src.browser.json",
|
|
126
|
+
include: ["../src/index.ts"]
|
|
127
|
+
},
|
|
128
|
+
null,
|
|
129
|
+
2
|
|
130
|
+
)
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* Builds config/tsconfig.src.react-native.json — extends eng/tsconfigs/src.react-native.json
|
|
136
|
+
*/
|
|
137
|
+
export function buildTsSrcReactNativeConfig() {
|
|
138
|
+
return {
|
|
139
|
+
path: "config/tsconfig.src.react-native.json",
|
|
140
|
+
content: JSON.stringify(
|
|
141
|
+
{
|
|
142
|
+
extends: "../../../../eng/tsconfigs/src.react-native.json",
|
|
143
|
+
include: ["../src/index.ts"]
|
|
144
|
+
},
|
|
145
|
+
null,
|
|
146
|
+
2
|
|
147
|
+
)
|
|
148
|
+
};
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* Builds config/tsconfig.src.cjs.json — extends eng/tsconfigs/src.cjs.json
|
|
153
|
+
*/
|
|
154
|
+
export function buildTsSrcCjsConfig() {
|
|
155
|
+
return {
|
|
156
|
+
path: "config/tsconfig.src.cjs.json",
|
|
157
|
+
content: JSON.stringify(
|
|
158
|
+
{
|
|
159
|
+
extends: "../../../../eng/tsconfigs/src.cjs.json",
|
|
160
|
+
include: ["../src/index.ts"]
|
|
161
|
+
},
|
|
162
|
+
null,
|
|
163
|
+
2
|
|
164
|
+
)
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Builds config/tsconfig.samples.json — extends eng/tsconfigs/samples.json
|
|
170
|
+
*/
|
|
171
|
+
export function buildTsSampleConfig(model: RLCModel) {
|
|
172
|
+
const { packageDetails } = model.options || {};
|
|
173
|
+
const clientPackageName = packageDetails?.name ?? "";
|
|
174
|
+
return {
|
|
175
|
+
path: "config/tsconfig.samples.json",
|
|
176
|
+
content: JSON.stringify(
|
|
177
|
+
{
|
|
178
|
+
extends: "../../../../eng/tsconfigs/samples.json",
|
|
179
|
+
compilerOptions: {
|
|
180
|
+
paths: {
|
|
181
|
+
[clientPackageName]: ["../dist/esm"]
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
},
|
|
185
|
+
null,
|
|
186
|
+
2
|
|
187
|
+
)
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Builds config/tsconfig.lint.json — used by eslint.config.mjs for type-aware linting
|
|
193
|
+
*/
|
|
194
|
+
export function buildTsLintConfig() {
|
|
195
|
+
return {
|
|
196
|
+
path: "config/tsconfig.lint.json",
|
|
197
|
+
content: JSON.stringify(
|
|
198
|
+
{
|
|
199
|
+
extends: "../../../../tsconfig.json",
|
|
200
|
+
include: ["../src", "../test"]
|
|
201
|
+
},
|
|
202
|
+
null,
|
|
203
|
+
2
|
|
204
|
+
)
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* Builds config/tsconfig.snippets.json — extends eng/tsconfigs/snippets.json
|
|
210
|
+
*/
|
|
211
|
+
export function buildTsSnippetsConfig() {
|
|
212
|
+
return {
|
|
213
|
+
path: "config/tsconfig.snippets.json",
|
|
214
|
+
content: JSON.stringify(
|
|
215
|
+
{
|
|
216
|
+
extends: "../../../../eng/tsconfigs/snippets.json"
|
|
217
|
+
},
|
|
218
|
+
null,
|
|
219
|
+
2
|
|
220
|
+
)
|
|
221
|
+
};
|
|
222
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import { RLCModel } from "../interfaces.js";
|
|
5
|
+
|
|
6
|
+
const nodeConfig = `import viteConfig from "../../../vitest.shared.config.ts";
|
|
7
|
+
|
|
8
|
+
export default viteConfig;
|
|
9
|
+
`;
|
|
10
|
+
|
|
11
|
+
const browserConfig = `export { default } from "../../../eng/vitestconfigs/browser.config.ts";
|
|
12
|
+
`;
|
|
13
|
+
|
|
14
|
+
export function buildVitestConfig(
|
|
15
|
+
model: RLCModel,
|
|
16
|
+
platform: "browser" | "node"
|
|
17
|
+
) {
|
|
18
|
+
if (
|
|
19
|
+
model.options?.generateMetadata === false ||
|
|
20
|
+
model.options?.generateTest === false
|
|
21
|
+
) {
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
switch (platform) {
|
|
25
|
+
case "browser":
|
|
26
|
+
return {
|
|
27
|
+
path: "vitest.browser.config.ts",
|
|
28
|
+
content: browserConfig
|
|
29
|
+
};
|
|
30
|
+
case "node":
|
|
31
|
+
return {
|
|
32
|
+
path: "vitest.config.ts",
|
|
33
|
+
content: nodeConfig
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import { RLCModel } from "../interfaces.js";
|
|
5
|
+
|
|
6
|
+
export interface WarpConfigOptions {
|
|
7
|
+
/** Source-level exports, e.g. { ".": "./src/index.ts", "./models": "./src/models/index.ts" } */
|
|
8
|
+
exports?: Record<string, string>;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Default exports included in every warp config. */
|
|
12
|
+
const BASE_EXPORTS: Record<string, string> = {
|
|
13
|
+
"./package.json": "./package.json",
|
|
14
|
+
".": "./src/index.ts"
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
/** Full inline warp config template with react-native target. */
|
|
18
|
+
const WarpConfigTemplateWithReactNative = `# warp.config.yml — build configuration
|
|
19
|
+
|
|
20
|
+
exports:
|
|
21
|
+
{{exports}}
|
|
22
|
+
|
|
23
|
+
targets:
|
|
24
|
+
- name: browser
|
|
25
|
+
tsconfig: "./config/tsconfig.src.browser.json"
|
|
26
|
+
|
|
27
|
+
- name: react-native
|
|
28
|
+
tsconfig: "./config/tsconfig.src.react-native.json"
|
|
29
|
+
|
|
30
|
+
- name: esm
|
|
31
|
+
condition: import
|
|
32
|
+
tsconfig: "./config/tsconfig.src.esm.json"
|
|
33
|
+
|
|
34
|
+
- name: commonjs
|
|
35
|
+
condition: require
|
|
36
|
+
tsconfig: "./config/tsconfig.src.cjs.json"
|
|
37
|
+
moduleType: commonjs
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
/** Warp config template without react-native target (default). */
|
|
41
|
+
const WarpConfigTemplateDefault = `# warp.config.yml — build configuration
|
|
42
|
+
|
|
43
|
+
exports:
|
|
44
|
+
{{exports}}
|
|
45
|
+
|
|
46
|
+
targets:
|
|
47
|
+
- name: browser
|
|
48
|
+
tsconfig: "./config/tsconfig.src.browser.json"
|
|
49
|
+
|
|
50
|
+
- name: esm
|
|
51
|
+
condition: import
|
|
52
|
+
tsconfig: "./config/tsconfig.src.esm.json"
|
|
53
|
+
|
|
54
|
+
- name: commonjs
|
|
55
|
+
condition: require
|
|
56
|
+
tsconfig: "./config/tsconfig.src.cjs.json"
|
|
57
|
+
moduleType: commonjs
|
|
58
|
+
`;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Builds a self-contained warp.config.yml file.
|
|
62
|
+
*
|
|
63
|
+
* Emits a full inline config with all exports and targets.
|
|
64
|
+
* Polyfill resolution (browser/react-native file substitution) is handled
|
|
65
|
+
* via package.json `imports` subpath imports (#platform/*).
|
|
66
|
+
*
|
|
67
|
+
* By default, react-native target is NOT included. Set `generateReactNativeTarget: true`
|
|
68
|
+
* in options to include it.
|
|
69
|
+
*/
|
|
70
|
+
export function buildWarpConfig(
|
|
71
|
+
model: RLCModel,
|
|
72
|
+
{ exports }: WarpConfigOptions = {}
|
|
73
|
+
) {
|
|
74
|
+
if (model.options?.moduleKind !== "esm") {
|
|
75
|
+
return;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const allExports: Record<string, string> = {
|
|
79
|
+
...BASE_EXPORTS,
|
|
80
|
+
...exports
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
const exportsContent = Object.entries(allExports)
|
|
84
|
+
.map(([key, value]) => ` ${JSON.stringify(key)}: ${JSON.stringify(value)}`)
|
|
85
|
+
.join("\n");
|
|
86
|
+
|
|
87
|
+
const template = model.options?.generateReactNativeTarget
|
|
88
|
+
? WarpConfigTemplateWithReactNative
|
|
89
|
+
: WarpConfigTemplateDefault;
|
|
90
|
+
|
|
91
|
+
const content = template.replace("{{exports}}", exportsContent);
|
|
92
|
+
|
|
93
|
+
return { path: "warp.config.yml", content };
|
|
94
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
PackageCommonInfoConfig,
|
|
6
|
+
getCommonPackageDevDependencies
|
|
7
|
+
} from "./packageCommon.js";
|
|
8
|
+
|
|
9
|
+
export interface AzurePackageInfoConfig extends PackageCommonInfoConfig {
|
|
10
|
+
hasLro: boolean;
|
|
11
|
+
specSource: "Swagger" | "TypeSpec";
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Build the common package.json config for an Azure package.
|
|
16
|
+
*/
|
|
17
|
+
export function getAzureCommonPackageInfo(config: AzurePackageInfoConfig) {
|
|
18
|
+
return {
|
|
19
|
+
keywords: ["node", "azure", "cloud", "typescript", "browser", "isomorphic"],
|
|
20
|
+
author: "Microsoft Corporation",
|
|
21
|
+
license: "MIT",
|
|
22
|
+
...getAzureCjsCommonInfo(config),
|
|
23
|
+
...getAzureEsmCommonInfo(config)
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Builds the common dependencies for an Azure package.
|
|
29
|
+
*/
|
|
30
|
+
export function getAzurePackageDependencies({
|
|
31
|
+
hasLro,
|
|
32
|
+
specSource,
|
|
33
|
+
dependencies
|
|
34
|
+
}: AzurePackageInfoConfig) {
|
|
35
|
+
let azureDependencies: Record<string, string> = {
|
|
36
|
+
...dependencies,
|
|
37
|
+
"@azure-rest/core-client": specSource === "Swagger" ? "^1.4.0" : "^2.3.1",
|
|
38
|
+
"@azure/core-auth": "^1.6.0",
|
|
39
|
+
"@azure/core-rest-pipeline": "^1.5.0",
|
|
40
|
+
"@azure/logger": "^1.0.0",
|
|
41
|
+
tslib: "^2.6.2"
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
if (hasLro) {
|
|
45
|
+
azureDependencies = {
|
|
46
|
+
...azureDependencies,
|
|
47
|
+
"@azure/core-lro": "^3.1.0",
|
|
48
|
+
"@azure/abort-controller": "^2.1.2"
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return azureDependencies;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function getAzureCjsCommonInfo({
|
|
56
|
+
withTests,
|
|
57
|
+
withSamples,
|
|
58
|
+
name,
|
|
59
|
+
nameWithoutScope,
|
|
60
|
+
moduleKind
|
|
61
|
+
}: AzurePackageInfoConfig) {
|
|
62
|
+
if (moduleKind !== "cjs") {
|
|
63
|
+
return {};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
files: [
|
|
68
|
+
"dist/",
|
|
69
|
+
"!dist/**/*.d.*ts.map",
|
|
70
|
+
withTests || withSamples ? "dist-esm/src/" : "dist-esm/",
|
|
71
|
+
`types/${nameWithoutScope ?? name}.d.ts`,
|
|
72
|
+
"README.md",
|
|
73
|
+
"LICENSE"
|
|
74
|
+
]
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function getAzureEsmCommonInfo({ moduleKind }: AzurePackageInfoConfig) {
|
|
79
|
+
if (moduleKind !== "esm") {
|
|
80
|
+
return {};
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
files: ["dist/", "!dist/**/*.d.*ts.map", "README.md", "LICENSE"]
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function getAzurePackageCjsDevDependencies({
|
|
88
|
+
moduleKind,
|
|
89
|
+
withTests
|
|
90
|
+
}: AzurePackageInfoConfig) {
|
|
91
|
+
if (moduleKind !== "cjs") {
|
|
92
|
+
return {};
|
|
93
|
+
}
|
|
94
|
+
const testDevDependencies = {
|
|
95
|
+
"@azure-tools/test-credential": "^1.1.0",
|
|
96
|
+
"@azure-tools/test-recorder": "^3.0.0",
|
|
97
|
+
nyc: "^15.1.0",
|
|
98
|
+
mocha: "^11.0.2",
|
|
99
|
+
"@types/mocha": "^10.0.0",
|
|
100
|
+
"@types/chai": "^4.2.8",
|
|
101
|
+
chai: "^4.2.0",
|
|
102
|
+
"karma-chrome-launcher": "^3.0.0",
|
|
103
|
+
"karma-coverage": "^2.0.0",
|
|
104
|
+
"karma-env-preprocessor": "^0.1.1",
|
|
105
|
+
"karma-firefox-launcher": "^2.1.3",
|
|
106
|
+
"karma-junit-reporter": "^2.0.1",
|
|
107
|
+
"karma-mocha-reporter": "^2.2.5",
|
|
108
|
+
"karma-mocha": "^2.0.1",
|
|
109
|
+
"karma-source-map-support": "~1.4.0",
|
|
110
|
+
"karma-sourcemap-loader": "^0.4.0",
|
|
111
|
+
karma: "^6.2.0"
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
return {
|
|
115
|
+
...(withTests && testDevDependencies),
|
|
116
|
+
"source-map-support": "^0.5.9"
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function getAzurePackageEsmDevDependencies({
|
|
121
|
+
moduleKind,
|
|
122
|
+
withTests
|
|
123
|
+
}: AzurePackageInfoConfig) {
|
|
124
|
+
if (moduleKind !== "esm") {
|
|
125
|
+
return {};
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
let devDependencies: Record<string, string> = {};
|
|
129
|
+
|
|
130
|
+
if (withTests) {
|
|
131
|
+
devDependencies = {
|
|
132
|
+
...devDependencies,
|
|
133
|
+
"@vitest/browser-playwright": "^4.0.6",
|
|
134
|
+
"@vitest/coverage-istanbul": "^4.0.6",
|
|
135
|
+
playwright: "^1.41.2",
|
|
136
|
+
vitest: "^4.0.6",
|
|
137
|
+
"@azure-tools/test-credential": "^2.0.0",
|
|
138
|
+
"@azure-tools/test-recorder": "^4.0.0"
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
return devDependencies;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
export function getAzurePackageDevDependencies(config: AzurePackageInfoConfig) {
|
|
146
|
+
const esmDevDependencies = getAzurePackageEsmDevDependencies(config);
|
|
147
|
+
const cjsDevDependencies = getAzurePackageCjsDevDependencies(config);
|
|
148
|
+
|
|
149
|
+
const testDevDependencies = {
|
|
150
|
+
"@azure/identity": "^4.2.1"
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
return {
|
|
154
|
+
dotenv: "^16.0.0",
|
|
155
|
+
...getCommonPackageDevDependencies(config),
|
|
156
|
+
...(config.withTests && testDevDependencies),
|
|
157
|
+
...(config.specSource === "Swagger" && { autorest: "latest" }),
|
|
158
|
+
...esmDevDependencies,
|
|
159
|
+
...cjsDevDependencies
|
|
160
|
+
};
|
|
161
|
+
}
|