From 10e3dff34d5093f9d931563018bf34ed57cbb987 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Wed, 18 Oct 2023 09:58:38 +0000 Subject: [PATCH] CodeGen from PR 26283 in Azure/azure-rest-api-specs Merge 7d693687b2a5ffa528fece8328d1e59999bfbed5 into 4c38cb9966cd6afbb03c7e9b14997720a728baee --- common/config/rush/pnpm-lock.yaml | 204 ++++++++++++++++++++- sdk/network/arm-network/_meta.json | 6 +- sdk/network/arm-network/package.json | 27 +-- sdk/network/arm-network/rollup.config.js | 122 ++++++++++++ sdk/network/arm-network/test/sampleTest.ts | 43 +++++ sdk/network/arm-network/tsconfig.json | 10 +- 6 files changed, 379 insertions(+), 33 deletions(-) create mode 100644 sdk/network/arm-network/rollup.config.js create mode 100644 sdk/network/arm-network/test/sampleTest.ts diff --git a/common/config/rush/pnpm-lock.yaml b/common/config/rush/pnpm-lock.yaml index 84379969daa2..8943c61c1eab 100644 --- a/common/config/rush/pnpm-lock.yaml +++ b/common/config/rush/pnpm-lock.yaml @@ -1148,6 +1148,21 @@ packages: - supports-color dev: false + /@azure/arm-network@32.2.0: + resolution: {integrity: sha512-6QmZ9aGdiz+9u7jPhQEg2zY/Tn8hwJrmjAMuHlWpnqE2kHvSDnKCE3BiNLZsENfi/IeLKBuW0QIdZ5UhbSSA0A==} + engines: {node: '>=14.0.0'} + dependencies: + '@azure/abort-controller': 1.1.0 + '@azure/core-auth': 1.5.0 + '@azure/core-client': 1.7.3 + '@azure/core-lro': 2.5.4 + '@azure/core-paging': 1.5.0 + '@azure/core-rest-pipeline': 1.12.1 + tslib: 2.6.2 + transitivePeerDependencies: + - supports-color + dev: false + /@azure/communication-signaling@1.0.0-beta.20: resolution: {integrity: sha512-Vjsiv6lWiVFqTG51cKNOAwnhuUhKbb6oOsQ833NEaWl9MwlqEQtxSOMJPYsoSCjb+pnIYvbioC+hIHkKfkAxbQ==} engines: {node: '>=8.0.0'} @@ -2252,6 +2267,24 @@ packages: - supports-color dev: false + /@rollup/plugin-commonjs@24.1.0(rollup@2.79.1): + resolution: {integrity: sha512-eSL45hjhCWI0jCCXcNtLVqM5N1JlBGvlFfY0m6oOYnLCJ6N0qEXoZql4sY2MOUArzhH4SA/qBpTxvvZp2Sc+DQ==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^2.68.0||^3.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@rollup/pluginutils': 5.0.5(rollup@2.79.1) + commondir: 1.0.1 + estree-walker: 2.0.2 + glob: 8.1.0 + is-reference: 1.2.1 + magic-string: 0.27.0 + rollup: 2.79.1 + dev: false + /@rollup/plugin-commonjs@25.0.7(rollup@3.29.4): resolution: {integrity: sha512-nEvcR+LRjEjsaSsc4x3XZfCCvZIaSMenZu/OiwOKGN2UhQpAYI7ru7czFvyWbErlpoGjnSX3D5Ch5FcMA3kRWQ==} engines: {node: '>=14.0.0'} @@ -2285,6 +2318,19 @@ packages: rollup: 3.29.4 dev: false + /@rollup/plugin-json@6.0.1(rollup@2.79.1): + resolution: {integrity: sha512-RgVfl5hWMkxN1h/uZj8FVESvPuBJ/uf6ly6GTj0GONnkfoBN5KC0MSz+PN2OLDgYXMhtG0mWpTrkiOjoxAIevw==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@rollup/pluginutils': 5.0.5(rollup@2.79.1) + rollup: 2.79.1 + dev: false + /@rollup/plugin-json@6.0.1(rollup@3.29.4): resolution: {integrity: sha512-RgVfl5hWMkxN1h/uZj8FVESvPuBJ/uf6ly6GTj0GONnkfoBN5KC0MSz+PN2OLDgYXMhtG0mWpTrkiOjoxAIevw==} engines: {node: '>=14.0.0'} @@ -2298,6 +2344,20 @@ packages: rollup: 3.29.4 dev: false + /@rollup/plugin-multi-entry@6.0.1(rollup@2.79.1): + resolution: {integrity: sha512-AXm6toPyTSfbYZWghQGbom1Uh7dHXlrGa+HoiYNhQtDUE3Q7LqoUYdVQx9E1579QWS1uOiu+cZRSE4okO7ySgw==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@rollup/plugin-virtual': 3.0.2(rollup@2.79.1) + matched: 5.0.1 + rollup: 2.79.1 + dev: false + /@rollup/plugin-multi-entry@6.0.1(rollup@3.29.4): resolution: {integrity: sha512-AXm6toPyTSfbYZWghQGbom1Uh7dHXlrGa+HoiYNhQtDUE3Q7LqoUYdVQx9E1579QWS1uOiu+cZRSE4okO7ySgw==} engines: {node: '>=14.0.0'} @@ -2312,6 +2372,21 @@ packages: rollup: 3.29.4 dev: false + /@rollup/plugin-node-resolve@13.3.0(rollup@2.79.1): + resolution: {integrity: sha512-Lus8rbUo1eEcnS4yTFKLZrVumLPY+YayBdWXgFSHYhTT2iJbMhoaaBL3xl5NCdeRytErGr8tZ0L71BMRmnlwSw==} + engines: {node: '>= 10.0.0'} + peerDependencies: + rollup: ^2.42.0 + dependencies: + '@rollup/pluginutils': 3.1.0(rollup@2.79.1) + '@types/resolve': 1.17.1 + deepmerge: 4.3.1 + is-builtin-module: 3.2.1 + is-module: 1.0.0 + resolve: 1.22.8 + rollup: 2.79.1 + dev: false + /@rollup/plugin-node-resolve@15.2.3(rollup@3.29.4): resolution: {integrity: sha512-j/lym8nf5E21LwBT4Df1VD6hRO2L2iwUeUmP7litikRsVp1H6NWx20NEp0Y7su+7XGc476GnXXc4kFeZNGmaSQ==} engines: {node: '>=14.0.0'} @@ -2330,6 +2405,18 @@ packages: rollup: 3.29.4 dev: false + /@rollup/plugin-virtual@3.0.2(rollup@2.79.1): + resolution: {integrity: sha512-10monEYsBp3scM4/ND4LNH5Rxvh3e/cVeL3jWTgZ2SrQ+BmUoQcopVQvnaMcOnykb1VkxUFuDAN+0FnpTFRy2A==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + rollup: 2.79.1 + dev: false + /@rollup/plugin-virtual@3.0.2(rollup@3.29.4): resolution: {integrity: sha512-10monEYsBp3scM4/ND4LNH5Rxvh3e/cVeL3jWTgZ2SrQ+BmUoQcopVQvnaMcOnykb1VkxUFuDAN+0FnpTFRy2A==} engines: {node: '>=14.0.0'} @@ -2342,6 +2429,33 @@ packages: rollup: 3.29.4 dev: false + /@rollup/pluginutils@3.1.0(rollup@2.79.1): + resolution: {integrity: sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==} + engines: {node: '>= 8.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0 + dependencies: + '@types/estree': 0.0.39 + estree-walker: 1.0.1 + picomatch: 2.3.1 + rollup: 2.79.1 + dev: false + + /@rollup/pluginutils@5.0.5(rollup@2.79.1): + resolution: {integrity: sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q==} + engines: {node: '>=14.0.0'} + peerDependencies: + rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 + peerDependenciesMeta: + rollup: + optional: true + dependencies: + '@types/estree': 1.0.3 + estree-walker: 2.0.2 + picomatch: 2.3.1 + rollup: 2.79.1 + dev: false + /@rollup/pluginutils@5.0.5(rollup@3.29.4): resolution: {integrity: sha512-6aEYR910NyP73oHiJglti74iRyOwgFU4x3meH/H8OJx6Ry0j6cOVZ5X/wTvub7G7Ao6qaHBEaNsV3GLJkSsF+Q==} engines: {node: '>=14.0.0'} @@ -2527,6 +2641,10 @@ packages: '@types/json-schema': 7.0.13 dev: false + /@types/estree@0.0.39: + resolution: {integrity: sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==} + dev: false + /@types/estree@1.0.3: resolution: {integrity: sha512-CS2rOaoQ/eAgAfcTfq6amKG7bsN+EMcgGY4FAFQdvSj2y1ixvOZTUA9mOtCai7E1SYu283XNw7urKK30nP3wkQ==} dev: false @@ -2698,6 +2816,12 @@ packages: resolution: {integrity: sha512-xrO9OoVPqFuYyR/loIHjnbvvyRZREYKLjxV4+dY6v3FQR3stQ9ZxIGkaclF7YhI9hfjpuTbu14hZEy94qKLtOA==} dev: false + /@types/resolve@1.17.1: + resolution: {integrity: sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==} + dependencies: + '@types/node': 16.18.58 + dev: false + /@types/resolve@1.20.2: resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} dev: false @@ -3192,6 +3316,12 @@ packages: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} dev: false + /atob@2.1.2: + resolution: {integrity: sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==} + engines: {node: '>= 4.5.0'} + hasBin: true + dev: false + /autorest@3.6.3: resolution: {integrity: sha512-j/Axwk9bniifTNtBLYVxfQZGQIGPKljFaCQCBWOiybVar2j3tkHP1btiC4a/t9pAJXY6IaFgWctoPM3G/Puhyg==} engines: {node: '>=12.0.0'} @@ -3846,6 +3976,11 @@ packages: engines: {node: '>=10'} dev: false + /decode-uri-component@0.2.2: + resolution: {integrity: sha512-FqUYQ+8o158GyGTrMFJms9qh3CqTKvAqgqsTnkLI8sKu0028orqBhxNMFkFen0zGyg6epACD32pjVk58ngIErQ==} + engines: {node: '>=0.10'} + dev: false + /decompress-response@6.0.0: resolution: {integrity: sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==} engines: {node: '>=10'} @@ -4056,7 +4191,7 @@ packages: dependencies: semver: 7.5.4 shelljs: 0.8.5 - typescript: 5.3.0-dev.20231017 + typescript: 5.3.0-dev.20231018 dev: false /eastasianwidth@0.2.0: @@ -4500,6 +4635,10 @@ packages: engines: {node: '>=4.0'} dev: false + /estree-walker@1.0.1: + resolution: {integrity: sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==} + dev: false + /estree-walker@2.0.2: resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==} dev: false @@ -7692,6 +7831,22 @@ packages: rollup: 3.29.4 dev: false + /rollup-plugin-sourcemaps@0.6.3(@types/node@16.18.58)(rollup@2.79.1): + resolution: {integrity: sha512-paFu+nT1xvuO1tPFYXGe+XnQvg4Hjqv/eIhG8i5EspfYYPBKL57X7iVbfv55aNVASg3dzWvES9dmWsL2KhfByw==} + engines: {node: '>=10.0.0'} + peerDependencies: + '@types/node': '>=10.0.0' + rollup: '>=0.31.2' + peerDependenciesMeta: + '@types/node': + optional: true + dependencies: + '@rollup/pluginutils': 3.1.0(rollup@2.79.1) + '@types/node': 16.18.58 + rollup: 2.79.1 + source-map-resolve: 0.6.0 + dev: false + /rollup-plugin-visualizer@5.9.2(rollup@3.29.4): resolution: {integrity: sha512-waHktD5mlWrYFrhOLbti4YgQCn1uR24nYsNuXxg7LkPH8KdTXVWR9DNY1WU0QqokyMixVXJS4J04HNrVTMP01A==} engines: {node: '>=14'} @@ -7709,6 +7864,14 @@ packages: yargs: 17.7.2 dev: false + /rollup@2.79.1: + resolution: {integrity: sha512-uKxbd0IhMZOhjAiD5oAFp7BqvkA4Dv47qpOCtaNvng4HBwdbWtdOh8f5nZNuk2rp51PMGk3bzfWu5oayNEuYnw==} + engines: {node: '>=10.0.0'} + hasBin: true + optionalDependencies: + fsevents: 2.3.3 + dev: false + /rollup@3.29.4: resolution: {integrity: sha512-oWzmBZwvYrU0iJHtDmhsm662rC15FRXmcjCk1xD771dFDx5jJ02ufAQQTn0etB2emNk4J9EZg/yWKpsn9BWGRw==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} @@ -7982,6 +8145,14 @@ packages: - utf-8-validate dev: false + /source-map-resolve@0.6.0: + resolution: {integrity: sha512-KXBr9d/fO/bWo97NXsPIAW1bFSBOuCnjbNTBMO7N59hsv5i9yzRDfcYwwt0l04+VqnKC+EwzvJZIP/qkuMgR/w==} + deprecated: See https://github.com/lydell/source-map-resolve#deprecated + dependencies: + atob: 2.1.2 + decode-uri-component: 0.2.2 + dev: false + /source-map-support@0.5.21: resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} dependencies: @@ -8535,8 +8706,8 @@ packages: hasBin: true dev: false - /typescript@5.3.0-dev.20231017: - resolution: {integrity: sha512-Gb9CxdHEnJBcghPIdgmYT+j30pAGX44Uvwc22Z9WoWMollP+5jf6VqUdmiF+PXjarjFWuo6HbQAnWoH9zWQwdQ==} + /typescript@5.3.0-dev.20231018: + resolution: {integrity: sha512-qBPaVi+ntB9Ys4T3uP1ZYCtxFWIV/1ieooBDhFEd8nw4IqAoB/Us7XobF3xb756bnX8cS/zIt9fgukde4MG4bA==} engines: {node: '>=14.17'} hasBin: true dev: false @@ -10584,10 +10755,11 @@ packages: dev: false file:projects/arm-compute-1.tgz: - resolution: {integrity: sha512-vkb4Nmo7gQoyhxVttBUa0wJOmFMsVuVJvGcbjGSu8dIOSMTEzMy/Z1MLUexd3WbCaWDaHS2TpFYKV19yfjelIA==, tarball: file:projects/arm-compute-1.tgz} + resolution: {integrity: sha512-jte7uDnVEu//xRjdsdmratDHSflZ+l9Wa3gtyQNthP+lEmz/7GFNchClfWetUBSEPYN8J8t1uuchQFa/P3CN4A==, tarball: file:projects/arm-compute-1.tgz} name: '@rush-temp/arm-compute-1' version: 0.0.0 dependencies: + '@azure/arm-network': 32.2.0 '@microsoft/api-extractor': 7.38.0(@types/node@16.18.58) '@types/chai': 4.3.9 '@types/node': 16.18.58 @@ -10604,6 +10776,7 @@ packages: transitivePeerDependencies: - '@swc/core' - '@swc/wasm' + - supports-color dev: false file:projects/arm-compute-profile-2020-09-01-hybrid.tgz: @@ -10630,10 +10803,11 @@ packages: dev: false file:projects/arm-compute.tgz: - resolution: {integrity: sha512-2378AXQ5Z/8ct0C3m7aosYnj+ukc3Y/0cKKkGbxVQ8wUKi1qTKXV941DiCD4+zEdk7Wrri2ngRccj3f5P080YQ==, tarball: file:projects/arm-compute.tgz} + resolution: {integrity: sha512-cSnE7bsCn63sGxQTJlz+oIAs/7UectzTr7v9z0beZSdJ6lrggwTD/IJRAsg51NJKcHMg2KSpyqdbjZvEvA/9Eg==, tarball: file:projects/arm-compute.tgz} name: '@rush-temp/arm-compute' version: 0.0.0 dependencies: + '@azure/arm-network': 32.2.0 '@microsoft/api-extractor': 7.38.0(@types/node@16.18.58) '@types/chai': 4.3.9 '@types/node': 16.18.58 @@ -11693,10 +11867,11 @@ packages: dev: false file:projects/arm-eventhub.tgz: - resolution: {integrity: sha512-z1yY7N4rLzi90eIXQqnXqtnCLqfrzaxBywxTJMoyrJNt2DxRMRCsO28zGRe8pRFfd2mF/6rZQpIvZZ5TiViQ9Q==, tarball: file:projects/arm-eventhub.tgz} + resolution: {integrity: sha512-at+Uc/ebU6lloMmIQf9g6kxta+fJvRLtYt0qQkHB/wSLqthIpLQTMUAGwRkPKiUjAY0ycLe/WgIgDH3GPm9EEA==, tarball: file:projects/arm-eventhub.tgz} name: '@rush-temp/arm-eventhub' version: 0.0.0 dependencies: + '@azure/arm-network': 32.2.0 '@microsoft/api-extractor': 7.38.0(@types/node@16.18.58) '@types/chai': 4.3.9 '@types/node': 16.18.58 @@ -11713,6 +11888,7 @@ packages: transitivePeerDependencies: - '@swc/core' - '@swc/wasm' + - supports-color dev: false file:projects/arm-extendedlocation.tgz: @@ -12869,19 +13045,27 @@ packages: dev: false file:projects/arm-network-1.tgz: - resolution: {integrity: sha512-Bc5zxH5E3v7u9PwNvSZt/KJ48btSo82pPRrQUJfL0o7FuHDlED4uoevNxcI+JkKjZdfoa63Lu+aRcovK7Tt9Jg==, tarball: file:projects/arm-network-1.tgz} + resolution: {integrity: sha512-IWiP3LT3IaX+NYLltiYDXZSqNUdFpV2ZkQuo2bYL8rv6CPH/mCS2zacqKlHK/r7lSHgHC3RhuUeaXEtnkuFE9A==, tarball: file:projects/arm-network-1.tgz} name: '@rush-temp/arm-network-1' version: 0.0.0 dependencies: '@microsoft/api-extractor': 7.38.0(@types/node@16.18.58) + '@rollup/plugin-commonjs': 24.1.0(rollup@2.79.1) + '@rollup/plugin-json': 6.0.1(rollup@2.79.1) + '@rollup/plugin-multi-entry': 6.0.1(rollup@2.79.1) + '@rollup/plugin-node-resolve': 13.3.0(rollup@2.79.1) '@types/chai': 4.3.9 + '@types/mocha': 10.0.2 '@types/node': 16.18.58 chai: 4.3.10 cross-env: 7.0.3 dotenv: 16.3.1 + esm: 3.2.25 mkdirp: 2.1.6 mocha: 10.2.0 - rimraf: 3.0.2 + rimraf: 5.0.5 + rollup: 2.79.1 + rollup-plugin-sourcemaps: 0.6.3(@types/node@16.18.58)(rollup@2.79.1) ts-node: 10.9.1(@types/node@16.18.58)(typescript@5.0.4) tslib: 2.6.2 typescript: 5.0.4 @@ -13595,10 +13779,11 @@ packages: dev: false file:projects/arm-rediscache.tgz: - resolution: {integrity: sha512-sM4op37n2PAlI+3c0zSXwWo4yCO8vo6TUAfEkbh1Xq45TYb7l1J4dUZu32B2EO3cTI4EitOsYo4uvUJYiX9USg==, tarball: file:projects/arm-rediscache.tgz} + resolution: {integrity: sha512-S4bDQn0ZYHu4i7IfwuRYOnRHU3MpQe/4ccWRGLVXpmgNY73N43UUhzMd56AxTH/j6i5D+E56t+KtZLKmkkQHgA==, tarball: file:projects/arm-rediscache.tgz} name: '@rush-temp/arm-rediscache' version: 0.0.0 dependencies: + '@azure/arm-network': 32.2.0 '@microsoft/api-extractor': 7.38.0(@types/node@16.18.58) '@types/chai': 4.3.9 '@types/node': 16.18.58 @@ -13615,6 +13800,7 @@ packages: transitivePeerDependencies: - '@swc/core' - '@swc/wasm' + - supports-color dev: false file:projects/arm-redisenterprisecache.tgz: diff --git a/sdk/network/arm-network/_meta.json b/sdk/network/arm-network/_meta.json index a60e4a22d99b..30a2cc352219 100644 --- a/sdk/network/arm-network/_meta.json +++ b/sdk/network/arm-network/_meta.json @@ -1,8 +1,8 @@ { - "commit": "241397aafd74aaad6161cd0058449f9eb6d5163c", + "commit": "168c3ea045ae75d562bb23cc7ea3cc48d598caaa", "readme": "specification/network/resource-manager/readme.md", - "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=D:\\Git\\azure-sdk-for-js ..\\azure-rest-api-specs\\specification\\network\\resource-manager\\readme.md --use=@autorest/typescript@6.0.8 --generate-sample=true", + "autorest_command": "autorest --version=3.9.7 --typescript --modelerfour.lenient-model-deduplication --azure-arm --head-as-boolean=true --license-header=MICROSOFT_MIT_NO_VERSION --generate-test --typescript-sdks-folder=/mnt/vss/_work/1/s/azure-sdk-for-js ../azure-rest-api-specs/specification/network/resource-manager/readme.md --use=@autorest/typescript@^6.0.11", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", "release_tool": "@azure-tools/js-sdk-release-tools@2.7.2", - "use": "@autorest/typescript@6.0.8" + "use": "@autorest/typescript@^6.0.11" } \ No newline at end of file diff --git a/sdk/network/arm-network/package.json b/sdk/network/arm-network/package.json index d7c79db66aed..378d3afd824c 100644 --- a/sdk/network/arm-network/package.json +++ b/sdk/network/arm-network/package.json @@ -29,15 +29,23 @@ "types": "./types/arm-network.d.ts", "devDependencies": { "@microsoft/api-extractor": "^7.31.1", + "@rollup/plugin-commonjs": "^24.0.0", + "@rollup/plugin-json": "^6.0.0", + "@rollup/plugin-multi-entry": "^6.0.0", + "@rollup/plugin-node-resolve": "^13.1.3", "mkdirp": "^2.1.2", + "rollup": "^2.66.1", + "rollup-plugin-sourcemaps": "^0.6.3", "typescript": "~5.0.0", "uglify-js": "^3.4.9", - "rimraf": "^3.0.0", + "rimraf": "^5.0.0", "dotenv": "^16.0.0", "@azure/identity": "^3.3.0", "@azure-tools/test-recorder": "^3.0.0", "@azure-tools/test-credential": "^1.0.0", "mocha": "^10.0.0", + "@types/mocha": "^10.0.0", + "esm": "^3.2.18", "@types/chai": "^4.2.8", "chai": "^4.2.0", "cross-env": "^7.0.2", @@ -64,20 +72,21 @@ "src/**/*.ts", "README.md", "LICENSE", + "rollup.config.js", "tsconfig.json", "review/*", "CHANGELOG.md", "types/*" ], "scripts": { - "build": "npm run clean && tsc && dev-tool run bundle && npm run minify && mkdirp ./review && npm run extract-api", + "build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api", "minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js", "prepack": "npm run build", "pack": "npm pack 2>&1", "extract-api": "api-extractor run --local", "lint": "echo skipped", "audit": "echo skipped", - "clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log", + "clean": "rimraf --glob dist dist-browser dist-esm test-dist temp types *.tgz *.log", "build:node": "echo skipped", "build:browser": "echo skipped", "build:test": "echo skipped", @@ -105,13 +114,5 @@ ] }, "autoPublish": true, - "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/network/arm-network", - "//sampleConfiguration": { - "productName": "", - "productSlugs": [ - "azure" - ], - "disableDocsMs": true, - "apiRefLink": "https://docs.microsoft.com/javascript/api/@azure/arm-network?view=azure-node-preview" - } -} + "homepage": "https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/network/arm-network" +} \ No newline at end of file diff --git a/sdk/network/arm-network/rollup.config.js b/sdk/network/arm-network/rollup.config.js new file mode 100644 index 000000000000..3f89d7309da5 --- /dev/null +++ b/sdk/network/arm-network/rollup.config.js @@ -0,0 +1,122 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import nodeResolve from "@rollup/plugin-node-resolve"; +import cjs from "@rollup/plugin-commonjs"; +import sourcemaps from "rollup-plugin-sourcemaps"; +import multiEntry from "@rollup/plugin-multi-entry"; +import json from "@rollup/plugin-json"; + +import nodeBuiltins from "builtin-modules"; + +// #region Warning Handler + +/** + * A function that can determine whether a rollup warning should be ignored. If + * the function returns `true`, then the warning will not be displayed. + */ + +function ignoreNiseSinonEval(warning) { + return ( + warning.code === "EVAL" && + warning.id && + (warning.id.includes("node_modules/nise") || + warning.id.includes("node_modules/sinon")) === true + ); +} + +function ignoreChaiCircularDependency(warning) { + return ( + warning.code === "CIRCULAR_DEPENDENCY" && + warning.importer && warning.importer.includes("node_modules/chai") === true + ); +} + +const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval]; + +/** + * Construct a warning handler for the shared rollup configuration + * that ignores certain warnings that are not relevant to testing. + */ +function makeOnWarnForTesting() { + return (warning, warn) => { + // If every inhibitor returns false (i.e. no inhibitors), then show the warning + if (warningInhibitors.every((inhib) => !inhib(warning))) { + warn(warning); + } + }; +} + +// #endregion + +function makeBrowserTestConfig() { + const config = { + input: { + include: ["dist-esm/test/**/*.spec.js"], + exclude: ["dist-esm/test/**/node/**"] + }, + output: { + file: `dist-test/index.browser.js`, + format: "umd", + sourcemap: true + }, + preserveSymlinks: false, + plugins: [ + multiEntry({ exports: false }), + nodeResolve({ + mainFields: ["module", "browser"] + }), + cjs(), + json(), + sourcemaps() + //viz({ filename: "dist-test/browser-stats.html", sourcemap: true }) + ], + onwarn: makeOnWarnForTesting(), + // Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0, + // rollup started respecting the "sideEffects" field in package.json. Since + // our package.json sets "sideEffects=false", this also applies to test + // code, which causes all tests to be removed by tree-shaking. + treeshake: false + }; + + return config; +} + +const defaultConfigurationOptions = { + disableBrowserBundle: false +}; + +export function makeConfig(pkg, options) { + options = { + ...defaultConfigurationOptions, + ...(options || {}) + }; + + const baseConfig = { + // Use the package's module field if it has one + input: pkg["module"] || "dist-esm/src/index.js", + external: [ + ...nodeBuiltins, + ...Object.keys(pkg.dependencies), + ...Object.keys(pkg.devDependencies) + ], + output: { file: "dist/index.js", format: "cjs", sourcemap: true }, + preserveSymlinks: false, + plugins: [sourcemaps(), nodeResolve()] + }; + + const config = [baseConfig]; + + if (!options.disableBrowserBundle) { + config.push(makeBrowserTestConfig()); + } + + return config; +} + +export default makeConfig(require("./package.json")); diff --git a/sdk/network/arm-network/test/sampleTest.ts b/sdk/network/arm-network/test/sampleTest.ts new file mode 100644 index 000000000000..25aeb3ebcc36 --- /dev/null +++ b/sdk/network/arm-network/test/sampleTest.ts @@ -0,0 +1,43 @@ +/* + * Copyright (c) Microsoft Corporation. + * Licensed under the MIT License. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is regenerated. + */ + +import { + Recorder, + RecorderStartOptions, + env +} from "@azure-tools/test-recorder"; +import { assert } from "chai"; +import { Context } from "mocha"; + +const replaceableVariables: Record = { + AZURE_CLIENT_ID: "azure_client_id", + AZURE_CLIENT_SECRET: "azure_client_secret", + AZURE_TENANT_ID: "88888888-8888-8888-8888-888888888888", + SUBSCRIPTION_ID: "azure_subscription_id" +}; + +const recorderOptions: RecorderStartOptions = { + envSetupForPlayback: replaceableVariables +}; + +describe("My test", () => { + let recorder: Recorder; + + beforeEach(async function(this: Context) { + recorder = new Recorder(this.currentTest); + await recorder.start(recorderOptions); + }); + + afterEach(async function() { + await recorder.stop(); + }); + + it("sample test", async function() { + console.log("Hi, I'm a test!"); + }); +}); diff --git a/sdk/network/arm-network/tsconfig.json b/sdk/network/arm-network/tsconfig.json index 094dfbf3dbe3..3e6ae96443f3 100644 --- a/sdk/network/arm-network/tsconfig.json +++ b/sdk/network/arm-network/tsconfig.json @@ -15,17 +15,11 @@ ], "declaration": true, "outDir": "./dist-esm", - "importHelpers": true, - "paths": { - "@azure/arm-network": [ - "./src/index" - ] - } + "importHelpers": true }, "include": [ "./src/**/*.ts", - "./test/**/*.ts", - "samples-dev/**/*.ts" + "./test/**/*.ts" ], "exclude": [ "node_modules"