@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,220 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
AzurePackageInfoConfig,
|
|
6
|
+
getAzureCommonPackageInfo
|
|
7
|
+
} from "./azurePackageCommon.js";
|
|
8
|
+
import {
|
|
9
|
+
getCommonPackageScripts,
|
|
10
|
+
getPackageCommonInfo
|
|
11
|
+
} from "./packageCommon.js";
|
|
12
|
+
|
|
13
|
+
export interface AzureMonorepoInfoConfig extends AzurePackageInfoConfig {
|
|
14
|
+
monorepoPackageDirectory?: string;
|
|
15
|
+
clientFilePaths: string[];
|
|
16
|
+
clientContextPaths?: string[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Builds the package.json for an Azure package that will be hosted in the azure-sdk-for-js mono repo.
|
|
21
|
+
*/
|
|
22
|
+
export function buildAzureMonorepoPackage(config: AzureMonorepoInfoConfig) {
|
|
23
|
+
const packageInfo = {
|
|
24
|
+
...getAzureMonorepoPackageInfo(config),
|
|
25
|
+
...getAzureMonorepoDependencies(config),
|
|
26
|
+
scripts: getAzureMonorepoScripts(config),
|
|
27
|
+
...getSampleMetadata(config)
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
return packageInfo;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Builds the dependencies for an Azure package that will be hosted in the azure-sdk-for-js mono repo.
|
|
35
|
+
*/
|
|
36
|
+
export function getAzureMonorepoDependencies(config: AzureMonorepoInfoConfig) {
|
|
37
|
+
const { hasLro, dependencies, withTests } = config;
|
|
38
|
+
|
|
39
|
+
// revert this change after sdk repo update.
|
|
40
|
+
const runtimeDeps = {
|
|
41
|
+
...dependencies,
|
|
42
|
+
"@azure-rest/core-client": "^2.3.1",
|
|
43
|
+
...(hasLro && {
|
|
44
|
+
"@azure/abort-controller": "^2.1.2"
|
|
45
|
+
}),
|
|
46
|
+
"@azure/core-auth": "^1.9.0",
|
|
47
|
+
...(hasLro && {
|
|
48
|
+
"@azure/core-lro": "^3.1.0"
|
|
49
|
+
}),
|
|
50
|
+
"@azure/core-rest-pipeline": "^1.20.0",
|
|
51
|
+
"@azure/core-util": "^1.12.0",
|
|
52
|
+
"@azure/logger": "^1.2.0",
|
|
53
|
+
tslib: "^2.8.1"
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const testDeps = withTests
|
|
57
|
+
? {
|
|
58
|
+
"@vitest/browser-playwright": "catalog:testing",
|
|
59
|
+
"@vitest/coverage-istanbul": "catalog:testing",
|
|
60
|
+
dotenv: "catalog:testing",
|
|
61
|
+
playwright: "catalog:testing",
|
|
62
|
+
typescript: "catalog:",
|
|
63
|
+
vitest: "catalog:testing"
|
|
64
|
+
}
|
|
65
|
+
: {
|
|
66
|
+
typescript: "catalog:"
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
dependencies: runtimeDeps,
|
|
71
|
+
devDependencies: {
|
|
72
|
+
"@azure-tools/test-credential": "workspace:^",
|
|
73
|
+
"@azure-tools/test-recorder": "workspace:^",
|
|
74
|
+
"@azure-tools/test-utils-vitest": "workspace:^",
|
|
75
|
+
"@azure/dev-tool": "workspace:^",
|
|
76
|
+
"@azure/eslint-plugin-azure-sdk": "workspace:^",
|
|
77
|
+
"@azure/identity": "catalog:internal",
|
|
78
|
+
"@types/node": "catalog:",
|
|
79
|
+
"cross-env": "catalog:",
|
|
80
|
+
eslint: "catalog:",
|
|
81
|
+
prettier: "catalog:",
|
|
82
|
+
rimraf: "catalog:",
|
|
83
|
+
...(config.specSource === "Swagger" && {
|
|
84
|
+
autorest: "catalog:"
|
|
85
|
+
}),
|
|
86
|
+
...testDeps
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Build the common package.json config for an Azure package that will be hosted in the azure-sdk-for-js mono repo.
|
|
93
|
+
*/
|
|
94
|
+
export function getAzureMonorepoPackageInfo(
|
|
95
|
+
config: AzureMonorepoInfoConfig
|
|
96
|
+
): Record<string, any> {
|
|
97
|
+
const commonPackageInfo = getPackageCommonInfo(config);
|
|
98
|
+
const repositoryDirectory = config.monorepoPackageDirectory ?? "sdk/";
|
|
99
|
+
|
|
100
|
+
return {
|
|
101
|
+
...commonPackageInfo,
|
|
102
|
+
...getAzureCommonPackageInfo(config),
|
|
103
|
+
"sdk-type": `${config.azureArm ? "mgmt" : "client"}`,
|
|
104
|
+
repository: {
|
|
105
|
+
type: "git",
|
|
106
|
+
url: "git+https://github.com/Azure/azure-sdk-for-js",
|
|
107
|
+
directory: repositoryDirectory
|
|
108
|
+
},
|
|
109
|
+
bugs: {
|
|
110
|
+
url: "https://github.com/Azure/azure-sdk-for-js/issues"
|
|
111
|
+
},
|
|
112
|
+
...(config.monorepoPackageDirectory && {
|
|
113
|
+
homepage: `https://github.com/Azure/azure-sdk-for-js/tree/main/${config.monorepoPackageDirectory}/README.md`
|
|
114
|
+
}),
|
|
115
|
+
prettier: "@azure/eslint-plugin-azure-sdk/prettier.json",
|
|
116
|
+
"//metadata": getMetadataInfo(config)
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function getSampleMetadata({
|
|
121
|
+
name,
|
|
122
|
+
version,
|
|
123
|
+
withSamples
|
|
124
|
+
}: AzureMonorepoInfoConfig) {
|
|
125
|
+
if (!withSamples) {
|
|
126
|
+
return {};
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
let apiRefUrlQueryParameter: string = "";
|
|
130
|
+
if (version.includes("beta")) {
|
|
131
|
+
apiRefUrlQueryParameter = "?view=azure-node-preview";
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return {
|
|
135
|
+
"//sampleConfiguration": {
|
|
136
|
+
productName: name,
|
|
137
|
+
productSlugs: ["azure"],
|
|
138
|
+
disableDocsMs: true,
|
|
139
|
+
apiRefLink: `https://learn.microsoft.com/javascript/api/${name}${apiRefUrlQueryParameter}`
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
function addSwaggerMetadata(
|
|
145
|
+
metadata: Record<string, any>,
|
|
146
|
+
specSource: "Swagger" | "TypeSpec"
|
|
147
|
+
) {
|
|
148
|
+
if (specSource !== "Swagger") {
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
metadata["constantPaths"].push({
|
|
153
|
+
path: "swagger/README.md",
|
|
154
|
+
prefix: "package-version"
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function getAzureMonorepoScripts(config: AzureMonorepoInfoConfig) {
|
|
159
|
+
const esmScripts = getEsmScripts(config);
|
|
160
|
+
const skipLinting = config.azureArm && config.isModularLibrary;
|
|
161
|
+
const buildSampleScripts = config.azureArm
|
|
162
|
+
? "tsc -p config/tsconfig.samples.json && dev-tool samples publish -f"
|
|
163
|
+
: "tsc -p config/tsconfig.samples.json";
|
|
164
|
+
return {
|
|
165
|
+
...getCommonPackageScripts(),
|
|
166
|
+
"build:samples": config.withSamples ? buildSampleScripts : "echo skipped",
|
|
167
|
+
"check-format": `prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore "src/**/*.{ts,cts,mts}" "test/**/*.{ts,cts,mts}" "*.{js,cjs,mjs,json}" ${
|
|
168
|
+
config.withSamples ? '"samples-dev/*.ts"' : ""
|
|
169
|
+
}`,
|
|
170
|
+
clean:
|
|
171
|
+
"rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
|
|
172
|
+
"execute:samples": config.withSamples
|
|
173
|
+
? "dev-tool samples run samples-dev"
|
|
174
|
+
: "echo skipped",
|
|
175
|
+
"extract-api": "rimraf review && dev-tool run extract-api",
|
|
176
|
+
format: `prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore "src/**/*.{ts,cts,mts}" "test/**/*.{ts,cts,mts}" "*.{js,cjs,mjs,json}" ${
|
|
177
|
+
config.withSamples ? '"samples-dev/*.ts"' : ""
|
|
178
|
+
}`,
|
|
179
|
+
"generate:client": "echo skipped",
|
|
180
|
+
"test:browser": "dev-tool run test:vitest --browser",
|
|
181
|
+
"lint:fix": skipLinting
|
|
182
|
+
? "echo skipped"
|
|
183
|
+
: "eslint package.json src test --fix --fix-type [problem,suggestion]",
|
|
184
|
+
lint: skipLinting ? "echo skipped" : "eslint package.json src test",
|
|
185
|
+
pack: `pnpm pack 2>&1`,
|
|
186
|
+
...esmScripts,
|
|
187
|
+
"update-snippets": "dev-tool run update-snippets"
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
function getEsmScripts({ moduleKind }: AzureMonorepoInfoConfig) {
|
|
192
|
+
if (moduleKind !== "esm") {
|
|
193
|
+
return {};
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
return {
|
|
197
|
+
build:
|
|
198
|
+
"npm run clean && dev-tool run build-package && dev-tool run extract-api",
|
|
199
|
+
"test:node": "dev-tool run test:vitest",
|
|
200
|
+
test: "tsc -b --noEmit && npm run test:node && npm run test:browser"
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function getMetadataInfo(config: AzureMonorepoInfoConfig) {
|
|
205
|
+
const metadata: Record<string, any> = {
|
|
206
|
+
constantPaths: []
|
|
207
|
+
};
|
|
208
|
+
const paths = config.isModularLibrary
|
|
209
|
+
? config.clientContextPaths
|
|
210
|
+
: config.clientFilePaths;
|
|
211
|
+
addSwaggerMetadata(metadata, config.specSource);
|
|
212
|
+
for (const path of paths ?? []) {
|
|
213
|
+
metadata["constantPaths"].push({
|
|
214
|
+
path: path,
|
|
215
|
+
prefix: "userAgentInfo"
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
return metadata;
|
|
220
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
AzurePackageInfoConfig,
|
|
6
|
+
getAzureCommonPackageInfo,
|
|
7
|
+
getAzurePackageDependencies,
|
|
8
|
+
getAzurePackageDevDependencies
|
|
9
|
+
} from "./azurePackageCommon.js";
|
|
10
|
+
import {
|
|
11
|
+
getCommonPackageScripts,
|
|
12
|
+
getPackageCommonInfo
|
|
13
|
+
} from "./packageCommon.js";
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Builds the package.json for an Azure package that won't be hosted in the azure-sdk-for-js repo.
|
|
17
|
+
*/
|
|
18
|
+
export function buildAzureStandalonePackage(config: AzurePackageInfoConfig) {
|
|
19
|
+
const packageInfo = {
|
|
20
|
+
...getAzureStandalonePackageInfo(config),
|
|
21
|
+
...getAzureStandaloneDependencies(config),
|
|
22
|
+
scripts: getAzureStandaloneScripts(config)
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
return packageInfo;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function getAzureStandalonePackageInfo(
|
|
29
|
+
config: AzurePackageInfoConfig
|
|
30
|
+
): Record<string, any> {
|
|
31
|
+
const commonPackageInfo = getPackageCommonInfo(config);
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
...commonPackageInfo,
|
|
35
|
+
...getAzureCommonPackageInfo(config)
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function getAzureStandaloneDependencies(
|
|
40
|
+
config: AzurePackageInfoConfig
|
|
41
|
+
): Record<string, any> {
|
|
42
|
+
return {
|
|
43
|
+
dependencies: {
|
|
44
|
+
...getAzurePackageDependencies(config)
|
|
45
|
+
},
|
|
46
|
+
devDependencies: {
|
|
47
|
+
...getStandaloneDevDependencies(config),
|
|
48
|
+
"@microsoft/api-extractor": "^7.40.3",
|
|
49
|
+
rimraf: "^5.0.5",
|
|
50
|
+
mkdirp: "^3.0.1"
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function getStandaloneDevDependencies(config: AzurePackageInfoConfig) {
|
|
56
|
+
return {
|
|
57
|
+
...getAzurePackageDevDependencies(config),
|
|
58
|
+
"@microsoft/api-extractor": "^7.40.3",
|
|
59
|
+
...getStandaloneCjsDevDependencies(config)
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function getStandaloneCjsDevDependencies(config: AzurePackageInfoConfig) {
|
|
64
|
+
if (config.moduleKind !== "cjs") {
|
|
65
|
+
return {};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return {
|
|
69
|
+
"@rollup/plugin-commonjs": "^24.0.0",
|
|
70
|
+
"@rollup/plugin-json": "^6.0.0",
|
|
71
|
+
"@rollup/plugin-multi-entry": "^6.0.0",
|
|
72
|
+
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
73
|
+
...(config.moduleKind === "cjs" &&
|
|
74
|
+
config.withTests && { "cross-env": "^7.0.2" }),
|
|
75
|
+
rollup: "^2.66.1",
|
|
76
|
+
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
77
|
+
"uglify-js": "^3.4.9"
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function getAzureStandaloneScripts(
|
|
82
|
+
config: AzurePackageInfoConfig
|
|
83
|
+
): Record<string, any> {
|
|
84
|
+
const testScripts = {
|
|
85
|
+
"test:browser": "karma start --single-run",
|
|
86
|
+
"test:node": `nyc mocha -r esm --require source-map-support/register --timeout 5000000 --full-trace "dist-esm/test/{,!(browser)/**/}*.spec.js"`,
|
|
87
|
+
test: "npm run test:node && npm run test:browser"
|
|
88
|
+
};
|
|
89
|
+
return {
|
|
90
|
+
...getCommonPackageScripts(),
|
|
91
|
+
clean:
|
|
92
|
+
"rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
|
|
93
|
+
...(config.withTests && testScripts),
|
|
94
|
+
...getCjsScripts(config),
|
|
95
|
+
...getEsmScripts(config)
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function getCjsScripts(config: AzurePackageInfoConfig): Record<string, any> {
|
|
100
|
+
if (config.moduleKind !== "cjs") {
|
|
101
|
+
return {};
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
const testScripts = {
|
|
105
|
+
"build:test": "tsc -p . && rollup -c 2>&1",
|
|
106
|
+
"build:browser": "tsc -p . && cross-env ONLY_BROWSER=true rollup -c 2>&1",
|
|
107
|
+
"build:node": "tsc -p . && cross-env ONLY_NODE=true rollup -c 2>&1"
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
return {
|
|
111
|
+
build:
|
|
112
|
+
"npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api",
|
|
113
|
+
...(config.withTests && testScripts),
|
|
114
|
+
minify:
|
|
115
|
+
"uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js"
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function getEsmScripts(config: AzurePackageInfoConfig): Record<string, any> {
|
|
120
|
+
if (config.moduleKind !== "esm") {
|
|
121
|
+
return {};
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
const testScripts = {
|
|
125
|
+
test: "npm run clean && tshy && npm run unit-test:node && npm run unit-test:browser && npm run integration-test",
|
|
126
|
+
"test:node": "vitest -c vitest.config.ts",
|
|
127
|
+
"test:browser": "vitest -c vitest.browser.config.ts"
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
return {
|
|
131
|
+
build: "npm run clean && tshy && npm run extract-api",
|
|
132
|
+
...(config.withTests && testScripts)
|
|
133
|
+
};
|
|
134
|
+
}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
PackageCommonInfoConfig,
|
|
6
|
+
getPackageCommonInfo,
|
|
7
|
+
getCommonPackageScripts,
|
|
8
|
+
getCommonPackageDevDependencies,
|
|
9
|
+
commonPackageDependencies
|
|
10
|
+
} from "./packageCommon.js";
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Builds the package.json for a flavorless package.
|
|
14
|
+
*/
|
|
15
|
+
export function buildFlavorlessPackage(config: PackageCommonInfoConfig) {
|
|
16
|
+
const packageInfo = {
|
|
17
|
+
...getFlavorlessPackageInfo(config),
|
|
18
|
+
scripts: getFlavorlessScripts(config),
|
|
19
|
+
devDependencies: {
|
|
20
|
+
...getCommonPackageDevDependencies(config),
|
|
21
|
+
"@microsoft/api-extractor": "^7.40.3",
|
|
22
|
+
rimraf: "^5.0.5",
|
|
23
|
+
mkdirp: "^3.0.1"
|
|
24
|
+
},
|
|
25
|
+
dependencies: {
|
|
26
|
+
...commonPackageDependencies,
|
|
27
|
+
"@typespec/ts-http-runtime": "0.1.0"
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
return packageInfo;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function getFlavorlessPackageInfo(
|
|
35
|
+
config: PackageCommonInfoConfig
|
|
36
|
+
): Record<string, any> {
|
|
37
|
+
const commonPackageInfo = getPackageCommonInfo(config);
|
|
38
|
+
|
|
39
|
+
return {
|
|
40
|
+
...commonPackageInfo
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function getFlavorlessScripts(config: PackageCommonInfoConfig) {
|
|
45
|
+
return {
|
|
46
|
+
...getCommonPackageScripts(),
|
|
47
|
+
...getCjsScripts(config),
|
|
48
|
+
...getEsmScripts(config)
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function getCjsScripts({ moduleKind }: PackageCommonInfoConfig) {
|
|
53
|
+
if (moduleKind !== "cjs") {
|
|
54
|
+
return {};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
build: "npm run clean && tsc && npm run extract-api"
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function getEsmScripts({ moduleKind }: PackageCommonInfoConfig) {
|
|
63
|
+
if (moduleKind !== "esm") {
|
|
64
|
+
return {};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
build: "npm run clean && tshy && npm run extract-api"
|
|
69
|
+
};
|
|
70
|
+
}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
|
|
4
|
+
export interface PackageCommonInfoConfig {
|
|
5
|
+
name: string;
|
|
6
|
+
nameWithoutScope?: string;
|
|
7
|
+
version: string;
|
|
8
|
+
description: string;
|
|
9
|
+
moduleKind: "esm" | "cjs";
|
|
10
|
+
withTests: boolean;
|
|
11
|
+
withSamples: boolean;
|
|
12
|
+
exports?: Record<string, any>;
|
|
13
|
+
dependencies?: Record<string, string>;
|
|
14
|
+
azureArm?: boolean;
|
|
15
|
+
isModularLibrary?: boolean;
|
|
16
|
+
azureSdkForJs?: boolean;
|
|
17
|
+
/**
|
|
18
|
+
* When true, generates React Native build targets (dist/react-native, exports condition).
|
|
19
|
+
* Defaults to false. Only applicable when azureSdkForJs is true.
|
|
20
|
+
*/
|
|
21
|
+
generateReactNativeTarget?: boolean;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Common package.json config for a package.
|
|
26
|
+
*/
|
|
27
|
+
export function getPackageCommonInfo(config: PackageCommonInfoConfig) {
|
|
28
|
+
const { name, version, description } = config;
|
|
29
|
+
|
|
30
|
+
return {
|
|
31
|
+
name,
|
|
32
|
+
version,
|
|
33
|
+
description,
|
|
34
|
+
engines: {
|
|
35
|
+
node: ">=20.0.0"
|
|
36
|
+
},
|
|
37
|
+
sideEffects: false,
|
|
38
|
+
autoPublish: false,
|
|
39
|
+
...getEntryPointInformation(config)
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export const commonPackageDependencies = {
|
|
44
|
+
tslib: "^2.6.2"
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export function getCommonPackageDevDependencies(
|
|
48
|
+
config: PackageCommonInfoConfig
|
|
49
|
+
) {
|
|
50
|
+
return {
|
|
51
|
+
"@types/node": "^20.0.0",
|
|
52
|
+
eslint: "^9.9.0",
|
|
53
|
+
typescript: "~5.8.2",
|
|
54
|
+
...getEsmDevDependencies(config)
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function getEsmDevDependencies({
|
|
59
|
+
moduleKind,
|
|
60
|
+
azureSdkForJs
|
|
61
|
+
}: PackageCommonInfoConfig) {
|
|
62
|
+
if (moduleKind !== "esm") {
|
|
63
|
+
return {};
|
|
64
|
+
}
|
|
65
|
+
// Azure monorepo packages use warp (invoked via dev-tool), no tshy needed
|
|
66
|
+
if (azureSdkForJs) {
|
|
67
|
+
return {};
|
|
68
|
+
}
|
|
69
|
+
return {
|
|
70
|
+
tshy: "^2.0.0"
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
function getEntryPointInformation(config: PackageCommonInfoConfig) {
|
|
75
|
+
return {
|
|
76
|
+
...getCjsEntrypointInformation(config),
|
|
77
|
+
...getEsmEntrypointInformation(config)
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
function getCjsEntrypointInformation({
|
|
82
|
+
name,
|
|
83
|
+
nameWithoutScope,
|
|
84
|
+
moduleKind,
|
|
85
|
+
withTests,
|
|
86
|
+
withSamples
|
|
87
|
+
}: PackageCommonInfoConfig) {
|
|
88
|
+
if (moduleKind !== "cjs") {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const types =
|
|
93
|
+
withTests || withSamples
|
|
94
|
+
? `./types/src/${nameWithoutScope ?? name}.d.ts`
|
|
95
|
+
: `./types/${nameWithoutScope ?? name}.d.ts`;
|
|
96
|
+
const main = withTests || withSamples ? "dist/src/index.js" : "dist/index.js";
|
|
97
|
+
return {
|
|
98
|
+
main,
|
|
99
|
+
module:
|
|
100
|
+
withTests || withSamples
|
|
101
|
+
? "./dist-esm/src/index.js"
|
|
102
|
+
: "./dist-esm/index.js",
|
|
103
|
+
types
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function getEsmEntrypointInformation(config: PackageCommonInfoConfig) {
|
|
108
|
+
if (config.moduleKind !== "esm") {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
// Azure monorepo packages use warp instead of tshy
|
|
113
|
+
if (config.azureSdkForJs) {
|
|
114
|
+
const result: Record<string, any> = {
|
|
115
|
+
type: "module",
|
|
116
|
+
main: "./dist/commonjs/index.js",
|
|
117
|
+
module: "./dist/esm/index.js",
|
|
118
|
+
types: "./dist/commonjs/index.d.ts",
|
|
119
|
+
browser: "./dist/browser/index.js",
|
|
120
|
+
imports: {
|
|
121
|
+
"#platform/*": {
|
|
122
|
+
browser: "./src/*-browser.mts",
|
|
123
|
+
default: "./src/*.ts"
|
|
124
|
+
} as Record<string, string>
|
|
125
|
+
},
|
|
126
|
+
exports: resolveWarpExports(
|
|
127
|
+
config.exports,
|
|
128
|
+
config.generateReactNativeTarget
|
|
129
|
+
)
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
if (config.generateReactNativeTarget) {
|
|
133
|
+
result["react-native"] = "./dist/react-native/index.js";
|
|
134
|
+
(result["imports"]["#platform/*"] as Record<string, string>)[
|
|
135
|
+
"react-native"
|
|
136
|
+
] = "./src/*-react-native.mts";
|
|
137
|
+
// Reorder so react-native comes before default
|
|
138
|
+
const importsEntry = result["imports"]["#platform/*"] as Record<
|
|
139
|
+
string,
|
|
140
|
+
string
|
|
141
|
+
>;
|
|
142
|
+
result["imports"]["#platform/*"] = {
|
|
143
|
+
browser: importsEntry["browser"],
|
|
144
|
+
"react-native": importsEntry["react-native"],
|
|
145
|
+
default: importsEntry["default"]
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
return result;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Non-monorepo packages use tshy which manages polyfill resolution
|
|
153
|
+
// via esmDialects — do NOT add imports here.
|
|
154
|
+
const result: Record<string, any> = {
|
|
155
|
+
tshy: getTshyConfig(config),
|
|
156
|
+
type: "module",
|
|
157
|
+
browser: "./dist/browser/index.js"
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
if (config.generateReactNativeTarget) {
|
|
161
|
+
result["react-native"] = "./dist/react-native/index.js";
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return result;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* Resolve source-level exports to dist-level exports for warp.
|
|
169
|
+
* Converts { ".": "./src/index.ts" } to the nested condition map with
|
|
170
|
+
* browser/import/require conditions pointing to dist/ paths.
|
|
171
|
+
*/
|
|
172
|
+
export function resolveWarpExports(
|
|
173
|
+
sourceExports?: Record<string, any>,
|
|
174
|
+
includeReactNative?: boolean
|
|
175
|
+
): Record<string, any> {
|
|
176
|
+
const exports: Record<string, any> = {};
|
|
177
|
+
const allExports: Record<string, string> = {
|
|
178
|
+
"./package.json": "./package.json",
|
|
179
|
+
".": "./src/index.ts",
|
|
180
|
+
...sourceExports
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
for (const [subpath, sourcePath] of Object.entries(allExports)) {
|
|
184
|
+
// Pass-through entries (e.g. "./package.json": "./package.json")
|
|
185
|
+
if (!/\.ts$/.test(sourcePath)) {
|
|
186
|
+
exports[subpath] = sourcePath;
|
|
187
|
+
continue;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
// Convert source path to dist path: "./src/foo/index.ts" -> "foo/index"
|
|
191
|
+
const relPath = sourcePath.replace(/^\.\/src\//, "").replace(/\.ts$/, "");
|
|
192
|
+
|
|
193
|
+
const exportEntry: Record<string, any> = {
|
|
194
|
+
browser: {
|
|
195
|
+
types: `./dist/browser/${relPath}.d.ts`,
|
|
196
|
+
default: `./dist/browser/${relPath}.js`
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
if (includeReactNative) {
|
|
201
|
+
exportEntry["react-native"] = {
|
|
202
|
+
types: `./dist/react-native/${relPath}.d.ts`,
|
|
203
|
+
default: `./dist/react-native/${relPath}.js`
|
|
204
|
+
};
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
exportEntry["import"] = {
|
|
208
|
+
types: `./dist/esm/${relPath}.d.ts`,
|
|
209
|
+
default: `./dist/esm/${relPath}.js`
|
|
210
|
+
};
|
|
211
|
+
|
|
212
|
+
exportEntry["require"] = {
|
|
213
|
+
types: `./dist/commonjs/${relPath}.d.ts`,
|
|
214
|
+
default: `./dist/commonjs/${relPath}.js`
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
exports[subpath] = exportEntry;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
return exports;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
export function getTshyConfig(config: PackageCommonInfoConfig) {
|
|
224
|
+
const { exports = {} } = config;
|
|
225
|
+
const esmDialects = config.generateReactNativeTarget
|
|
226
|
+
? ["browser", "react-native"]
|
|
227
|
+
: ["browser"];
|
|
228
|
+
const tshyConfig: Record<string, any> = {
|
|
229
|
+
exports: {
|
|
230
|
+
"./package.json": "./package.json",
|
|
231
|
+
".": "./src/index.ts",
|
|
232
|
+
...exports
|
|
233
|
+
},
|
|
234
|
+
dialects: ["esm", "commonjs"],
|
|
235
|
+
esmDialects,
|
|
236
|
+
selfLink: false
|
|
237
|
+
};
|
|
238
|
+
if (config.azureSdkForJs) {
|
|
239
|
+
tshyConfig["project"] = "../../../tsconfig.src.build.json";
|
|
240
|
+
}
|
|
241
|
+
return tshyConfig;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
export function getCommonPackageScripts() {
|
|
245
|
+
return {
|
|
246
|
+
clean:
|
|
247
|
+
"rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log",
|
|
248
|
+
"extract-api":
|
|
249
|
+
"rimraf review && mkdirp ./review && api-extractor run --local",
|
|
250
|
+
pack: "npm pack 2>&1",
|
|
251
|
+
lint: "eslint package.json api-extractor.json src",
|
|
252
|
+
"lint:fix":
|
|
253
|
+
"eslint package.json api-extractor.json src --fix --fix-type [problem,suggestion]"
|
|
254
|
+
};
|
|
255
|
+
}
|