From a5329bbeac8fb227c0e84c6d1d63f15f5f0e85e8 Mon Sep 17 00:00:00 2001 From: mehnoorsiddiqui Date: Tue, 6 Oct 2026 16:51:26 +0500 Subject: [PATCH 1/4] refactor: drop BuildConfig's write-back code and stale build-file test setup Nothing writes APIMATIC-BUILD.json back to disk since the portal moved to apimatic.json, so toJSON, the pass-through index signature and the from() factory went unused. The plugin generate tests no longer create the file, which plugin generation has not needed since #333. Co-Authored-By: Claude Opus 5.5 (1M context) --- src/types/build/build.ts | 12 +----------- test/actions/plugin/generate.test.ts | 7 ++----- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/types/build/build.ts b/src/types/build/build.ts index 319f4aae9..d8d040e2d 100644 --- a/src/types/build/build.ts +++ b/src/types/build/build.ts @@ -1,7 +1,6 @@ export interface BuildConfigData { generateVersionedPortal?: object; versionsPath?: string; - [key: string]: unknown; } // Immutable wrapper around the parsed APIMATIC-BUILD.json. Since version 2 the portal is @@ -11,16 +10,7 @@ export class BuildConfig { private constructor(private readonly data: BuildConfigData) {} public static parse(json: string): BuildConfig { - return BuildConfig.from(JSON.parse(json) as BuildConfigData); - } - - public static from(data: BuildConfigData): BuildConfig { - return new BuildConfig(data); - } - - // Called implicitly by JSON.stringify when the config is written back to disk. - public toJSON(): BuildConfigData { - return this.data; + return new BuildConfig(JSON.parse(json) as BuildConfigData); } public isVersioned(): boolean { diff --git a/test/actions/plugin/generate.test.ts b/test/actions/plugin/generate.test.ts index e308b7197..05e1e2eef 100644 --- a/test/actions/plugin/generate.test.ts +++ b/test/actions/plugin/generate.test.ts @@ -87,7 +87,6 @@ describe('PluginGenerateAction', () => { pluginArchive = await fsExtra.readFile(archivePath.toString()); await fsExtra.ensureDir(sourceDirectory); - await fsExtra.writeJson(path.join(sourceDirectory, 'APIMATIC-BUILD.json'), {}); await writeConfig({ plugin: PLUGIN, languages: LANGUAGES }); // The spinner would render to stdout; pass the underlying promise straight through. @@ -126,9 +125,8 @@ describe('PluginGenerateAction', () => { expect(generatePlugin.called).to.be.false; }); - it('generates without an APIMATIC-BUILD.json, which only portal and v3 SDK builds need', async () => { + it('generates without an APIMATIC-BUILD.json, which only SDK generation reads', async () => { const generatePlugin = generated(); - await fsExtra.remove(path.join(sourceDirectory, 'APIMATIC-BUILD.json')); expect((await execute()).isSuccess()).to.be.true; expect(generatePlugin.called).to.be.true; @@ -177,13 +175,12 @@ describe('PluginGenerateAction', () => { // The server reads the plugin's identity and languages from the `apimatic.json` in the upload. describe('the upload', () => { - it('is src as it stands, apimatic.json beside the build file', async () => { + it('carries the apimatic.json in src', async () => { generated(); await execute(); expect(JSON.parse(uploaded['apimatic.json'])).to.deep.equal({ plugin: PLUGIN, languages: LANGUAGES }); - expect(uploaded).to.have.property('APIMATIC-BUILD.json'); }); it('synthesizes nothing: no plugin-config.json is written for the server', async () => { From 79765a9ee432bf95eccad0101752de3bbbd33956 Mon Sep 17 00:00:00 2001 From: mehnoorsiddiqui Date: Tue, 6 Oct 2026 16:51:26 +0500 Subject: [PATCH 2/4] refactor: remove code nothing calls, and the isomorphic-git dependency GitService was left behind when sdk save-changes was retired (#359), along with Directory.createFromRelativePaths, which only it called. Also removes unused methods on FileService, LauncherService, ActionResult, ServiceError, FileName, UrlPath and the SDK publish prompts. Co-Authored-By: Claude Opus 5.5 (1M context) --- package.json | 1 - pnpm-lock.yaml | 172 ------------------------- src/actions/action-result.ts | 19 --- src/infrastructure/file-service.ts | 33 ----- src/infrastructure/git-service.ts | 105 --------------- src/infrastructure/launcher-service.ts | 41 ------ src/infrastructure/service-error.ts | 11 -- src/prompts/sdk/publish/interactive.ts | 4 - src/types/file/directory.ts | 39 ------ src/types/file/fileName.ts | 4 - src/types/file/urlPath.ts | 6 - 11 files changed, 435 deletions(-) delete mode 100644 src/infrastructure/git-service.ts diff --git a/package.json b/package.json index 6338f58eb..28f84f20c 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,6 @@ "fumadocs-ui": "16.15.17", "get-port": "^7.1.0", "is-in-ci": "^2.0.0", - "isomorphic-git": "^1.37.2", "lucide-react": "1.47.0", "mustache": "^4.2.0", "neverthrow": "^8.2.0", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 61cda5135..32c1a4f43 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -109,9 +109,6 @@ importers: is-in-ci: specifier: ^2.0.0 version: 2.0.0 - isomorphic-git: - specifier: ^1.37.2 - version: 1.37.6 lucide-react: specifier: 1.47.0 version: 1.47.0(react@19.2.8) @@ -2923,10 +2920,6 @@ packages: '@yuku-toolchain/types@0.9.5': resolution: {integrity: sha512-KiuLNNgX9uNealaWAR+G3/cMXnRk9x4TY2EkYe/KIag+UPdwiA0RRf1hr1WAxzTP8KGzCTkqUdLPvqh32sEO3w==} - abort-controller@3.0.0: - resolution: {integrity: sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==} - engines: {node: '>=6.5'} - acorn-jsx@5.3.2: resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: @@ -3068,9 +3061,6 @@ packages: resolution: {integrity: sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==} engines: {node: '>= 0.4'} - async-lock@1.4.1: - resolution: {integrity: sha512-Az2ZTpuytrtqENulXwO3GGv1Bztugx6TT37NIo7imr/Qo0gsYiGtSdBa2B6fsXhTpVZDNfu1Qn3pk531e3q+nQ==} - async-mutex@0.5.0: resolution: {integrity: sha512-1A94B18jkJ3DYq284ohPxoXbfTA5HsQ7/Mf4DEhcyLx3Bz27Rh59iScbB6EPiP+B+joue6YCxcMXSbFC1tZKwA==} @@ -3103,9 +3093,6 @@ packages: resolution: {integrity: sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==} engines: {node: 18 || 20 || >=22} - base64-js@1.5.1: - resolution: {integrity: sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==} - before-after-hook@4.0.0: resolution: {integrity: sha512-q6tR3RPqIB1pMiTRMFcZwuG5T8vwp+vUvEG0vuI6B+Rikh5BfPp2fQ82c925FOs+b0lcFQ8CFrL+KbilfZFhOQ==} @@ -3141,9 +3128,6 @@ packages: resolution: {integrity: sha512-Db1SbgBS/fg/392AblrMJk97KggmvYhr4pB5ZIMTWtaivCPMWLkmb7m21cJvpvgK+J3nsU2CmmixNBZx4vFj/w==} engines: {node: '>=8.0.0'} - buffer@6.0.3: - resolution: {integrity: sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==} - cacheable-lookup@7.0.0: resolution: {integrity: sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w==} engines: {node: '>=14.16'} @@ -3244,9 +3228,6 @@ packages: class-variance-authority@0.7.1: resolution: {integrity: sha512-Ka+9Trutv7G8M6WT6SeiRWz792K5qEqIGEGzXKhAE6xOWAY6pPH8U+9IY3oCMv6kqTmLsv7Xh/2w2RigkePMsg==} - clean-git-ref@2.0.1: - resolution: {integrity: sha512-bLSptAy2P0s6hU4PzuIMKmMJJSE6gLXGH1cntDu7bWJUksvuM+7ReOK61mozULErYvP6a15rnYl0zFDef+pyPw==} - clean-stack@2.2.0: resolution: {integrity: sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==} engines: {node: '>=6'} @@ -3430,11 +3411,6 @@ packages: typescript: optional: true - crc-32@1.2.2: - resolution: {integrity: sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==} - engines: {node: '>=0.8'} - hasBin: true - cross-spawn@7.0.6: resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==} engines: {node: '>= 8'} @@ -3553,9 +3529,6 @@ packages: devlop@1.1.0: resolution: {integrity: sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==} - diff3@0.0.3: - resolution: {integrity: sha512-iSq8ngPOt0K53A6eVr4d5Kn6GNrM2nQZtC740pzIriHtn4pOQ2lyzEXQMBeVcWERN0ye7fhBsk9PbLLQOnUx/g==} - diff@8.0.4: resolution: {integrity: sha512-DPi0FmjiSU5EvQV0++GFDOJ9ASQUVFh5kD+OzOnYdi7n3Wpm9hWWGfB/O2blfHcMVTL5WkQXSnRiK9makhrcnw==} engines: {node: '>=0.3.1'} @@ -3808,14 +3781,6 @@ packages: resolution: {integrity: sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==} engines: {node: '>=0.10.0'} - event-target-shim@5.0.1: - resolution: {integrity: sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==} - engines: {node: '>=6'} - - events@3.3.0: - resolution: {integrity: sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==} - engines: {node: '>=0.8.x'} - execa@5.1.1: resolution: {integrity: sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==} engines: {node: '>=10'} @@ -4403,9 +4368,6 @@ packages: resolution: {integrity: sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==} engines: {node: '>=0.10.0'} - ieee754@1.2.1: - resolution: {integrity: sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==} - ignore@5.3.2: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} @@ -4662,11 +4624,6 @@ packages: isexe@2.0.0: resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==} - isomorphic-git@1.37.6: - resolution: {integrity: sha512-qr1NFCPsVTZ6YGqTXw0CzamnsHyH9QQ1OTEfeXIweSljRUMzuHFCJdUn0wc6OcjtTDns6knxjPb7N6LmJeftOA==} - engines: {node: '>=14.17'} - hasBin: true - issue-parser@7.0.2: resolution: {integrity: sha512-7atWPjhGEIX3JEtMrOYd8TKzboYlq+5sNbdl9POiLYOI14G5HZiQbZP0Xj5EZdrufQVXfJlpTV0hys0CuxwxZw==} engines: {node: ^18.17 || >=20.6.1} @@ -5285,9 +5242,6 @@ packages: minimist@1.2.8: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} - minimisted@2.0.1: - resolution: {integrity: sha512-1oPjfuLQa2caorJUM8HV8lGgWCc0qqAO1MNv/k05G4qslmsndV/5WdNZrqCiyqiz3wohia2Ij2B7w2Dr7/IyrA==} - minipass@7.1.3: resolution: {integrity: sha512-tEBHqDnIoM/1rXME1zgka9g6Q2lcoCkxHLuc7ODJ5BxbP5d4c2Z5cGgtXAku59200Cx7diuHTOYfSBD8n6mm8A==} engines: {node: '>=16 || 14 >=14.17'} @@ -5527,9 +5481,6 @@ packages: engines: {node: '>=18.0.0'} hasBin: true - once@1.4.0: - resolution: {integrity: sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==} - onetime@5.1.2: resolution: {integrity: sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==} engines: {node: '>=6'} @@ -5634,9 +5585,6 @@ packages: package-json-from-dist@1.0.1: resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==} - pako@1.0.11: - resolution: {integrity: sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==} - param-case@3.0.4: resolution: {integrity: sha512-RXlj7zCYokReqWpOPH9oYivUzLYZ5vAPIfEmCTNViosC78F8F0H9y7T7gG2M39ymgutxF5gcFEsyZQSph9Bp3A==} @@ -5733,10 +5681,6 @@ packages: resolution: {integrity: sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==} engines: {node: '>=4'} - pify@4.0.1: - resolution: {integrity: sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==} - engines: {node: '>=6'} - pkg-conf@2.1.0: resolution: {integrity: sha512-C+VUP+8jis7EsQZIhDYmS5qlNtjv2yP4SNtjXK9AP1ZcTRlnSfuumaTnRfYZnYgUUYVIKqL0fRvmUGDV2fmp6g==} engines: {node: '>=4'} @@ -5781,10 +5725,6 @@ packages: resolution: {integrity: sha512-JOnOPQ/8TZgjs1JIH/m9ni7FfimjNa/PRx7y/Wb5qdItsnhO0jE4AT7fC0HjC28DUQWDr50dwSYZLdRMlqDq3Q==} engines: {node: '>=8'} - process@0.11.10: - resolution: {integrity: sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==} - engines: {node: '>= 0.6.0'} - propagate@2.0.1: resolution: {integrity: sha512-vGrhOavPSTz4QVNuBNdcNXePNdNMaO1xj9yBeH1ScQPjk/rhg9sSlCXPhMkFuaNNW/syTvYqsnbIJxMBfRbbag==} engines: {node: '>= 8'} @@ -5872,10 +5812,6 @@ packages: readable-stream@2.3.8: resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} - readable-stream@4.7.0: - resolution: {integrity: sha512-oIGGmcpTLwPga8Bn6/Z75SVaH1z5dUut2ibSyAMVhmUggWpmDn2dapB0n7f8nwaSiRtepAsfJyfXIO5DCVAODg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - readdirp@4.1.2: resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} engines: {node: '>= 14.18.0'} @@ -6086,11 +6022,6 @@ packages: resolution: {integrity: sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==} engines: {node: '>= 0.4'} - sha.js@2.4.12: - resolution: {integrity: sha512-8LzC5+bvI45BjpfXU8V5fdU2mfeKiQe1D1gIMn7XUlF3OTUrpdJpPPH4EMAnF0DsHHdSZqCdSss5qCmJKuiO3w==} - engines: {node: '>= 0.10'} - hasBin: true - shebang-command@2.0.0: resolution: {integrity: sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==} engines: {node: '>=8'} @@ -6130,12 +6061,6 @@ packages: resolution: {integrity: sha512-iuh+gPf28RkltuJC7W5MRi6XAjTDCAPC/prJUpQoG4vIP3MJZ+GTydVnodXA7pwvTKb2cA0m9OFZW/cdWy/I/w==} engines: {node: '>=6'} - simple-concat@1.0.1: - resolution: {integrity: sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==} - - simple-get@4.0.1: - resolution: {integrity: sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==} - simple-git@3.36.0: resolution: {integrity: sha512-cGQjLjK8bxJw4QuYT7gxHw3/IouVESbhahSsHrX97MzCL1gu2u7oy38W6L2ZIGECEfIBG4BabsWDPjBxJENv9Q==} @@ -6253,9 +6178,6 @@ packages: string_decoder@1.1.1: resolution: {integrity: sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==} - string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - stringify-entities@4.0.4: resolution: {integrity: sha512-IwfBptatlO+QCJUo19AqvrPNqlVMpW9YEL2LIVY+Rpv2qsjCGxaDLNRgeGsQWJhfItebuJhsGSLjaBbNSQ+ieg==} @@ -6396,10 +6318,6 @@ packages: resolution: {integrity: sha512-voyz6MApa1rQGUxT3E+BK7/ROe8itEx7vD8/HEvt4xwXucvQ5G5oeEiHkmHZJuBO21RpOf+YYm9MOivj709jow==} engines: {node: '>=14.14'} - to-buffer@1.2.2: - resolution: {integrity: sha512-db0E3UJjcFhpDhAF4tLo03oli3pwl3dbnzXOUIlRKrp+ldk/VUxzpWYZENsw2SZiuBjHAk7DfB0VU7NKdpb6sw==} - engines: {node: '>= 0.4'} - to-regex-range@5.0.1: resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==} engines: {node: '>=8.0'} @@ -6803,9 +6721,6 @@ packages: resolution: {integrity: sha512-42AtmgqjV+X1VpdOfyTGOYRi0/zsoLqtXQckTmqTeybT+BDIbM/Guxo7x3pE2vtpr1ok6xRqM9OpBe+Jyoqyww==} engines: {node: '>=18'} - wrappy@1.0.2: - resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - write-file-atomic@3.0.3: resolution: {integrity: sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==} @@ -9956,10 +9871,6 @@ snapshots: '@yuku-toolchain/types@0.9.5': {} - abort-controller@3.0.0: - dependencies: - event-target-shim: 5.0.1 - acorn-jsx@5.3.2(acorn@8.16.0): dependencies: acorn: 8.16.0 @@ -10104,8 +10015,6 @@ snapshots: async-function@1.0.0: {} - async-lock@1.4.1: {} - async-mutex@0.5.0: dependencies: tslib: 2.8.1 @@ -10145,8 +10054,6 @@ snapshots: balanced-match@4.0.4: {} - base64-js@1.5.1: {} - before-after-hook@4.0.0: {} bottleneck@2.19.5: {} @@ -10181,11 +10088,6 @@ snapshots: buffer-crc32@1.0.0: {} - buffer@6.0.3: - dependencies: - base64-js: 1.5.1 - ieee754: 1.2.1 - cacheable-lookup@7.0.0: {} cacheable-request@10.2.14: @@ -10309,8 +10211,6 @@ snapshots: dependencies: clsx: 2.1.1 - clean-git-ref@2.0.1: {} - clean-stack@2.2.0: {} clean-stack@3.0.1: @@ -10488,8 +10388,6 @@ snapshots: optionalDependencies: typescript: '@typescript/typescript6@6.0.2' - crc-32@1.2.2: {} - cross-spawn@7.0.6: dependencies: path-key: 3.1.1 @@ -10590,8 +10488,6 @@ snapshots: dependencies: dequal: 2.0.3 - diff3@0.0.3: {} - diff@8.0.4: {} dir-glob@3.0.1: @@ -10984,10 +10880,6 @@ snapshots: esutils@2.0.3: {} - event-target-shim@5.0.1: {} - - events@3.3.0: {} - execa@5.1.1: dependencies: cross-spawn: 7.0.6 @@ -11671,8 +11563,6 @@ snapshots: dependencies: safer-buffer: 2.1.2 - ieee754@1.2.1: {} - ignore@5.3.2: {} ignore@7.0.5: {} @@ -11882,20 +11772,6 @@ snapshots: isexe@2.0.0: {} - isomorphic-git@1.37.6: - dependencies: - async-lock: 1.4.1 - clean-git-ref: 2.0.1 - crc-32: 1.2.2 - diff3: 0.0.3 - ignore: 5.3.2 - minimisted: 2.0.1 - pako: 1.0.11 - pify: 4.0.1 - readable-stream: 4.7.0 - sha.js: 2.4.12 - simple-get: 4.0.1 - issue-parser@7.0.2: dependencies: lodash.capitalize: 4.2.1 @@ -12739,10 +12615,6 @@ snapshots: minimist@1.2.8: {} - minimisted@2.0.1: - dependencies: - minimist: 1.2.8 - minipass@7.1.3: {} mocha@11.7.5: @@ -12985,10 +12857,6 @@ snapshots: - aws-crt - supports-color - once@1.4.0: - dependencies: - wrappy: 1.0.2 - onetime@5.1.2: dependencies: mimic-fn: 2.1.0 @@ -13091,8 +12959,6 @@ snapshots: package-json-from-dist@1.0.1: {} - pako@1.0.11: {} - param-case@3.0.4: dependencies: dot-case: 3.0.4 @@ -13185,8 +13051,6 @@ snapshots: pify@3.0.0: {} - pify@4.0.1: {} - pkg-conf@2.1.0: dependencies: find-up: 2.1.0 @@ -13224,8 +13088,6 @@ snapshots: dependencies: fromentries: 1.3.2 - process@0.11.10: {} - propagate@2.0.1: {} property-information@7.2.0: {} @@ -13321,14 +13183,6 @@ snapshots: string_decoder: 1.1.1 util-deprecate: 1.0.2 - readable-stream@4.7.0: - dependencies: - abort-controller: 3.0.0 - buffer: 6.0.3 - events: 3.3.0 - process: 0.11.10 - string_decoder: 1.3.0 - readdirp@4.1.2: {} readdirp@5.1.1: {} @@ -13645,12 +13499,6 @@ snapshots: es-errors: 1.3.0 es-object-atoms: 1.1.1 - sha.js@2.4.12: - dependencies: - inherits: 2.0.4 - safe-buffer: 5.2.1 - to-buffer: 1.2.2 - shebang-command@2.0.0: dependencies: shebang-regex: 3.0.0 @@ -13706,14 +13554,6 @@ snapshots: figures: 2.0.0 pkg-conf: 2.1.0 - simple-concat@1.0.1: {} - - simple-get@4.0.1: - dependencies: - decompress-response: 6.0.0 - once: 1.4.0 - simple-concat: 1.0.1 - simple-git@3.36.0: dependencies: '@kwsites/file-exists': 1.1.1 @@ -13863,10 +13703,6 @@ snapshots: dependencies: safe-buffer: 5.1.2 - string_decoder@1.3.0: - dependencies: - safe-buffer: 5.2.1 - stringify-entities@4.0.4: dependencies: character-entities-html4: 2.1.0 @@ -13994,12 +13830,6 @@ snapshots: tmp@0.2.5: {} - to-buffer@1.2.2: - dependencies: - isarray: 2.0.5 - safe-buffer: 5.2.1 - typed-array-buffer: 1.0.3 - to-regex-range@5.0.1: dependencies: is-number: 7.0.0 @@ -14379,8 +14209,6 @@ snapshots: string-width: 7.2.0 strip-ansi: 7.2.0 - wrappy@1.0.2: {} - write-file-atomic@3.0.3: dependencies: imurmurhash: 0.1.4 diff --git a/src/actions/action-result.ts b/src/actions/action-result.ts index 6765d56d4..be0fc9e12 100644 --- a/src/actions/action-result.ts +++ b/src/actions/action-result.ts @@ -51,21 +51,6 @@ export class ActionResult { return this.resultType === ResultType.Cancel; } - public match( - onSuccess: (value: T) => R, - onFailure: (message: string) => R, - onCancel: (message: string) => R - ): R { - switch (this.resultType) { - case ResultType.Success: - return onSuccess(this.value!); - case ResultType.Failure: - return onFailure(this.message); - case ResultType.Cancel: - return onCancel(this.message); - } - } - public getValue(): T { if (!this.isSuccess()) { throw new Error(`Cannot unwrap ${ResultType[this.resultType]} result: ${this.message}`); @@ -73,10 +58,6 @@ export class ActionResult { return this.value!; } - public getValueOr(defaultValue: T): T { - return this.isSuccess() ? this.value! : defaultValue; - } - public discardValue(): ActionResult { return new ActionResult(this.resultType, this.message); } diff --git a/src/infrastructure/file-service.ts b/src/infrastructure/file-service.ts index 9b523b9a9..30c06410e 100644 --- a/src/infrastructure/file-service.ts +++ b/src/infrastructure/file-service.ts @@ -8,7 +8,6 @@ import { FilePath } from '../types/file/filePath.js'; import { DirectoryPath } from '../types/file/directoryPath.js'; import { Directory, DirectoryItem } from '../types/file/directory.js'; import { FileName } from '../types/file/fileName.js'; -import { sleep } from './timer-extensions.js'; /** `stat` follows a link, so a link to nothing fails as though the entry were not there. */ function isDanglingLink(error: unknown): boolean { @@ -33,15 +32,6 @@ export class FileService { } } - public fileExistsSync(file: FilePath): boolean { - try { - const stat = fsExtra.statSync(file.toString()); - return stat.isFile(); - } catch { - return false; - } - } - public async directoryExists(dir: DirectoryPath): Promise { try { const stat = await fsExtra.stat(dir.toString()); @@ -243,25 +233,6 @@ export class FileService { } } - public async pollDeleteDirectory(dirPath: DirectoryPath, onDeleteFailurePersists: () => void): Promise { - const timeoutMs = 5 * 60 * 1000; - const deadline = Date.now() + timeoutMs; - const deleteFailurePersistsMaxDelay = Date.now() + 5 * 1000; - let actionPerformed = false; - while ( - Date.now() < deadline && - (await this.deleteDirectory(dirPath) - .then(() => false) - .catch(() => true)) - ) { - if (!actionPerformed && Date.now() > deleteFailurePersistsMaxDelay) { - onDeleteFailurePersists(); - actionPerformed = true; - } - await sleep(500); - } - } - public async getStream(filePath: FilePath) { return fs.createReadStream(filePath.toString()); } @@ -328,10 +299,6 @@ export class FileService { return true; } - public async copyToDir(source: FilePath, destination: DirectoryPath) { - await fsExtra.copyFile(source.toString(), source.replaceDirectory(destination).toString()); - } - public async isZipFile(filePath: FilePath): Promise { try { const buffer = await fsExtra.readFile(filePath.toString()); diff --git a/src/infrastructure/git-service.ts b/src/infrastructure/git-service.ts deleted file mode 100644 index be45b0e86..000000000 --- a/src/infrastructure/git-service.ts +++ /dev/null @@ -1,105 +0,0 @@ -import git from "isomorphic-git"; -import fs from "fs"; -import { DirectoryPath } from "../types/file/directoryPath.js"; -import { FileName } from "../types/file/fileName.js"; -import { FilePath } from "../types/file/filePath.js"; -import { Directory } from "../types/file/directory.js"; - -const GIT_AUTHOR = { name: "APIMatic-bot", email: "developer@apimatic.io" } as const; -const CUSTOM_BRANCH = "custom-code"; -const MAIN_BRANCH = "main"; - -export class GitService { - public async checkoutCustomBranch(dirPath: DirectoryPath): Promise { - const dir = dirPath.toString(); - - if (!await this.hasCustomBranch(dirPath)) { - await git.branch({ fs, dir, ref: CUSTOM_BRANCH }); - } - - await git.checkout({ fs, dir, ref: CUSTOM_BRANCH}); - } - - public async hasCustomBranch(dirPath: DirectoryPath): Promise { - const dir = dirPath.toString(); - const branches = await git.listBranches({ fs, dir }); - return branches.includes(CUSTOM_BRANCH); - } - - public getMergeFiles(dirPath: DirectoryPath): FilePath[] { - const gitDir = dirPath.join(".git"); - const mergeFiles = ["MERGE_HEAD", "MERGE_MODE", "MERGE_MSG"]; - return mergeFiles.map((filename) => new FilePath(gitDir, new FileName(filename))); - } - - public async forceCheckoutMainBranch(dirPath: DirectoryPath): Promise { - await git.checkout({ fs, dir: dirPath.toString(), ref: MAIN_BRANCH, force: true }); - } - - public async getDirectoryWithUpdatedFiles(dirPath: DirectoryPath): Promise { - const statusMatrix = await git.statusMatrix({ fs, dir: dirPath.toString() }); - - const relativeUncommitedFiles = statusMatrix - // include updated and resolved conflict files - .filter(([, headStatus, workdirStatus, stageStatus]) => headStatus !== workdirStatus || stageStatus === 3) - .map(([relativePath, workdirStatus, headStatus]) => { - if (headStatus === 0) { - return { fileName: new FileName(relativePath), description: "# Deleted" }; - } - if (workdirStatus === 0) { - return { fileName: new FileName(relativePath), description: "# Added" }; - } - return { fileName: new FileName(relativePath), description: "# Modified" }; - }); - - return Directory.createFromRelativePaths(dirPath, relativeUncommitedFiles); - } - - private async stageAll(dir: DirectoryPath): Promise { - const statusMatrix = await git.statusMatrix({ fs, dir: dir.toString() }); - await Promise.all( - statusMatrix - // include updated and resolved conflict files - .filter(([, headStatus, workdirStatus, stageStatus]) => headStatus !== workdirStatus || stageStatus === 3) - .map(([relativePath, , workdirStatus]) => { - if (workdirStatus === 0) { - return git.remove({ fs, dir: dir.toString(), filepath: relativePath }); - } - return git.add({ fs, dir: dir.toString(), filepath: relativePath }); - }) - ); - } - - public async getDirectoryWithUnmergedFiles(dir: DirectoryPath): Promise { - try { - await git.merge({ fs, dir: dir.toString(), ours: CUSTOM_BRANCH, theirs: MAIN_BRANCH, author: GIT_AUTHOR }); - return new Directory(dir, []); - } catch (error) { - if (error instanceof git.Errors.UnmergedPathsError) { - return Directory.createFromRelativePaths(dir, error.data.filepaths.map((filePath) => ({ fileName: new FileName(filePath), description: "# Conflicted file" }))); - } - if (error instanceof git.Errors.MergeConflictError) { - return new Directory(dir, []); - } - throw error; - } - } - - public async commitResolvedConflicts(dir: DirectoryPath): Promise { - await this.stageAll(dir); - const headOid = await git.resolveRef({ fs, dir: dir.toString(), ref: "HEAD" }); - const mainOid = await git.resolveRef({ fs, dir: dir.toString(), ref: MAIN_BRANCH }); - await git.commit({ - fs, - dir: dir.toString(), - message: `Merge branch '${MAIN_BRANCH}' into ${CUSTOM_BRANCH}`, - author: GIT_AUTHOR, - parent: [headOid, mainOid], - }); - } - - public async commitReviewedChanges(dir: DirectoryPath): Promise { - await this.stageAll(dir); - await git.commit({ fs, dir: dir.toString(), message: "feat: add customizations to generated SDK", author: GIT_AUTHOR }); - } -} diff --git a/src/infrastructure/launcher-service.ts b/src/infrastructure/launcher-service.ts index e02f5e34c..dd1f4695d 100644 --- a/src/infrastructure/launcher-service.ts +++ b/src/infrastructure/launcher-service.ts @@ -19,47 +19,6 @@ export class LauncherService { } } - public async isIdeAvailable(): Promise { - try { - const command = process.platform === "win32" ? "where" : "which"; - await execa(command, ["code"]); - return true; - } catch { - return false; - } - } - - public async openFolderInIdeWithWait( - directoryPath: DirectoryPath, - filesToOpen: FilePath[] - ): Promise { - try { - const args = [directoryPath.toString(), ...filesToOpen.map(f => f.toString())]; - await execa("code", ["--new-window", "--wait", ...args]); - return true; - } catch { - return false; - } - } - - public async openInEditor(filePath: FilePath): Promise { - if (isInCi) return; - try { - await execa("code", ["--wait", filePath.toString()]); - } catch { - // TODO: check for fallback (start) - if (process.platform === "win32") { - await execa("cmd", ["/c", "start", "/wait", "notepad", filePath.toString()], { stdio: "ignore" }); - } else if (process.platform === "darwin") { - await execa("vim", [filePath.toString()], { stdio: "inherit" }); - } - } - } - - public async openFile(filePath: FilePath): Promise { - await this.openPath(filePath.toString()); - } - public async openDirectory(directoryPath: DirectoryPath): Promise { await this.openPath(directoryPath.toString()); } diff --git a/src/infrastructure/service-error.ts b/src/infrastructure/service-error.ts index 1301808ab..313922aff 100644 --- a/src/infrastructure/service-error.ts +++ b/src/infrastructure/service-error.ts @@ -37,9 +37,6 @@ export class ServiceError { static notFound(customMessage: string): ServiceError { return new ServiceError(ServiceErrorCode.NotFound, customMessage, {}); } - static invalidResponse(customMessage: string): ServiceError { - return new ServiceError(ServiceErrorCode.InvalidResponse, customMessage, {}); - } static timeout(customMessage: string): ServiceError { return new ServiceError(ServiceErrorCode.Timeout, customMessage, {}); } @@ -55,14 +52,6 @@ export class ServiceError { return new ServiceError(ServiceErrorCode.UnAuthorized, message, {}); } - static readonly values: ServiceError[] = [ - ServiceError.NotFound, - ServiceError.ServerError, - ServiceError.NetworkError, - ServiceError.InvalidResponse, - ServiceError.UnAuthorized - ]; - private constructor( public readonly code: ServiceErrorCode, private readonly defaultMessage: string, diff --git a/src/prompts/sdk/publish/interactive.ts b/src/prompts/sdk/publish/interactive.ts index 4b1a9e12c..fc5d729f3 100644 --- a/src/prompts/sdk/publish/interactive.ts +++ b/src/prompts/sdk/publish/interactive.ts @@ -55,10 +55,6 @@ export class SdkPublishInteractivePrompts { return DirectoryPath.fromUserInput(value); } - public sdkDirectoryCannotBeSameAsSourceDirectory() { - log.error(`SDK directory must be different from the ${f.var('src')} directory.`); - } - public async noSdkDirectoryProvided() { log.error('No SDK directory was provided.'); } diff --git a/src/types/file/directory.ts b/src/types/file/directory.ts index c6e06440c..b2f163935 100644 --- a/src/types/file/directory.ts +++ b/src/types/file/directory.ts @@ -106,43 +106,4 @@ export class Directory { } return files; } - - public static createFromRelativePaths(rootDir: DirectoryPath, fileItems: FileItem[]): Directory { - type PendingDirectoryItem = FileItem | PendingDir; - type PendingDir = { pendingDirPath: DirectoryPath; items: PendingDirectoryItem[] }; - - const buildDirectory = (pending: PendingDir): Directory => - new Directory( - pending.pendingDirPath, - pending.items.map((item) => ('pendingDirPath' in item ? buildDirectory(item) : item)) - ); - - const root: PendingDir = { pendingDirPath: rootDir, items: [] }; - for (const file of fileItems) { - const parts = file.fileName.toString().split(/[\\/]/); - let currentDir = root; - - for (let i = 0; i < parts.length; i++) { - const part = parts[i]; - const isLastPart = i === parts.length - 1; - - if (isLastPart) { - currentDir.items.push({ fileName: new FileName(part), description: file.description }); - } else { - let existingDir = currentDir.items.find( - (item) => 'pendingDirPath' in item && item.pendingDirPath.leafName() === part - ) as PendingDir | undefined; - - if (!existingDir) { - existingDir = { pendingDirPath: currentDir.pendingDirPath.join(part), items: [] }; - currentDir.items.push(existingDir); - } - - currentDir = existingDir; - } - } - } - - return buildDirectory(root); - } } diff --git a/src/types/file/fileName.ts b/src/types/file/fileName.ts index e08ab449e..601fc9c01 100644 --- a/src/types/file/fileName.ts +++ b/src/types/file/fileName.ts @@ -5,10 +5,6 @@ export class FileName { this.name = name; } - public isMarkDown() { - return this.hasExtension('.md'); - } - /** Whether the name ends in `extension`, compared without regard to case. */ public hasExtension(extension: string): boolean { return this.name.toLowerCase().endsWith(extension.toLowerCase()); diff --git a/src/types/file/urlPath.ts b/src/types/file/urlPath.ts index ed5c0b301..42e92c47f 100644 --- a/src/types/file/urlPath.ts +++ b/src/types/file/urlPath.ts @@ -23,12 +23,6 @@ export class UrlPath { return this.url; } - /** True when the URL points at the local machine (`localhost` or `127.0.0.1`). */ - public isLocalhost(): boolean { - const hostname = new URL(this.url).hostname; - return hostname === "localhost" || hostname === "127.0.0.1"; - } - /** Structural equality against another URL. */ public isEqual(other: UrlPath): boolean { return this.url === other.url; From b2710ccf594f96b2b0b9274b4a1a083848582351 Mon Sep 17 00:00:00 2001 From: mehnoorsiddiqui Date: Mon, 12 Oct 2026 09:41:08 +0500 Subject: [PATCH 3/4] remove unused code --- src/infrastructure/file-service.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/infrastructure/file-service.ts b/src/infrastructure/file-service.ts index 45bf40e5a..3c3cbad6b 100644 --- a/src/infrastructure/file-service.ts +++ b/src/infrastructure/file-service.ts @@ -9,7 +9,6 @@ import { FilePath } from '../types/file/filePath.js'; import { DirectoryPath } from '../types/file/directoryPath.js'; import { Directory, DirectoryItem } from '../types/file/directory.js'; import { FileName } from '../types/file/fileName.js'; -import { sleep } from './timer-extensions.js'; import { errorMessage } from '../utils/error-utils.js'; /** `stat` follows a link, so a link to nothing fails as though the entry were not there. */ From 16ac1a51714d9784b03ef3e0a627bf0d5df042e2 Mon Sep 17 00:00:00 2001 From: mehnoorsiddiqui Date: Mon, 19 Oct 2026 12:08:06 +0500 Subject: [PATCH 4/4] refactor: remove the dead code review found, and test the upload against a spec - Remove `ActionResult.getValueOr` (back after the dev merge), `FileService.copyDirectoryExcluding`, `Directory.mapFilesInDirectory` and `Directory.isEmpty` (only `mapFilesInDirectory` called it), and `CodegenOption.codeGenerationVersion`; none has a caller. - The plugin upload test seeds a spec under `src/` and checks it goes up beside `apimatic.json`, so a test still shows the whole of `src/` is sent. - Drop the "generates without an APIMATIC-BUILD.json" test: every test now runs without the build file. - The value-object skill names `hasExtension` as `FileName`'s predicate. Co-Authored-By: Claude Opus 5.5 (1M context) --- .ai/skills/value-object.md | 2 +- src/actions/action-result.ts | 4 ---- src/infrastructure/file-service.ts | 30 ---------------------------- src/types/file/directory.ts | 27 ------------------------- src/types/sdk/generate.ts | 4 ---- test/actions/plugin/generate.test.ts | 11 +++------- 6 files changed, 4 insertions(+), 74 deletions(-) diff --git a/.ai/skills/value-object.md b/.ai/skills/value-object.md index db7397c7a..e5b297858 100644 --- a/.ai/skills/value-object.md +++ b/.ai/skills/value-object.md @@ -122,7 +122,7 @@ These patterns exist in the current codebase and are flagged for awareness: |---|---| | Ideal simple wrapper — private field, `static create()`, `toString()` only | `src/types/file/urlPath.ts` | | `static createInput()` fallback, rich join/equality methods | `src/types/file/directoryPath.ts` | -| Rich predicate (`isMarkDown`) and transform (`normalize`) returning rich type | `src/types/file/fileName.ts` | +| Rich predicate (`hasExtension`) and transform (`normalize`) returning rich type | `src/types/file/fileName.ts` | | Composed value object — holds two rich types, `static create()` splits at boundary | `src/types/file/filePath.ts` | | Correct boundary unwrapping — all `.toString()` calls at `fs.*` / `path.*` sites | `src/infrastructure/file-service.ts` | | Context with flagged public getter (display use) | `src/types/sdk-context.ts` | diff --git a/src/actions/action-result.ts b/src/actions/action-result.ts index af35f934f..404bc5cb2 100644 --- a/src/actions/action-result.ts +++ b/src/actions/action-result.ts @@ -60,10 +60,6 @@ export class ActionResult { return this.value!; } - public getValueOr(defaultValue: T): T { - return this.isSuccess() ? this.value! : defaultValue; - } - public getError(): E | undefined { return this.error; } diff --git a/src/infrastructure/file-service.ts b/src/infrastructure/file-service.ts index 3c3cbad6b..c82933623 100644 --- a/src/infrastructure/file-service.ts +++ b/src/infrastructure/file-service.ts @@ -213,36 +213,6 @@ export class FileService { ); } - public async copyDirectoryExcluding( - source: DirectoryPath, - destination: DirectoryPath, - excludeNames: FileName[] - ): Promise { - await this.createDirectoryIfNotExists(destination); - - const entries = await fsExtra.readdir(source.toString()); - - await Promise.all( - entries - .filter((entry) => !excludeNames.find((exclude) => exclude.toString() === entry)) - .map(async (entry) => { - const sourcePath = path.join(source.toString(), entry); - const destPath = path.join(destination.toString(), entry); - const stat = await fsExtra.stat(sourcePath); - - if (stat.isDirectory()) { - return this.copyDirectoryExcluding( - new DirectoryPath(sourcePath), - new DirectoryPath(destPath), - excludeNames - ); - } - - return fsExtra.copyFile(sourcePath, destPath); - }) - ); - } - public async deleteFile(filePath: FilePath): Promise { const exists = await this.fileExists(filePath); if (exists) { diff --git a/src/types/file/directory.ts b/src/types/file/directory.ts index b2f163935..57d6343c7 100644 --- a/src/types/file/directory.ts +++ b/src/types/file/directory.ts @@ -50,33 +50,6 @@ export class Directory { }; } - public async mapFilesInDirectory( - map: (rootDir: DirectoryPath, fileItem: FileItem) => Promise - ): Promise { - const mappedItems: DirectoryItem[] = []; - - for (const item of this.items) { - if (item instanceof Directory) { - const mappedSubDir = await item.mapFilesInDirectory(map); - if (!mappedSubDir.isEmpty()) { - mappedItems.push(mappedSubDir); - } - continue; - } - - const mappedItem = await map(this.directoryPath, item); - if (mappedItem) { - mappedItems.push(mappedItem); - } - } - - return new Directory(this.directoryPath, mappedItems); - } - - public isEmpty(): boolean { - return this.items.length === 0; - } - public excluding(names: FileName[]): Directory { const excluded = names.map((name) => name.toString()); const kept = this.items.filter((item) => diff --git a/src/types/sdk/generate.ts b/src/types/sdk/generate.ts index 21cce16a8..749c5b660 100644 --- a/src/types/sdk/generate.ts +++ b/src/types/sdk/generate.ts @@ -64,10 +64,6 @@ export class CodegenOption { return new CodegenOption(version, stability); } - public codeGenerationVersion(): CodeGenerationVersion { - return this.version; - } - public stabilityLevel(): Stability { return this.stability; } diff --git a/test/actions/plugin/generate.test.ts b/test/actions/plugin/generate.test.ts index 05e1e2eef..bd150024c 100644 --- a/test/actions/plugin/generate.test.ts +++ b/test/actions/plugin/generate.test.ts @@ -124,13 +124,6 @@ describe('PluginGenerateAction', () => { expect((await execute()).isFailed()).to.be.true; expect(generatePlugin.called).to.be.false; }); - - it('generates without an APIMATIC-BUILD.json, which only SDK generation reads', async () => { - const generatePlugin = generated(); - - expect((await execute()).isSuccess()).to.be.true; - expect(generatePlugin.called).to.be.true; - }); }); describe('overwrite guard', () => { @@ -175,12 +168,14 @@ describe('PluginGenerateAction', () => { // The server reads the plugin's identity and languages from the `apimatic.json` in the upload. describe('the upload', () => { - it('carries the apimatic.json in src', async () => { + it('is src as it stands, apimatic.json beside the spec', async () => { generated(); + await fsExtra.outputFile(path.join(sourceDirectory, 'spec', 'openapi.json'), '{"openapi": "3.0.0"}'); await execute(); expect(JSON.parse(uploaded['apimatic.json'])).to.deep.equal({ plugin: PLUGIN, languages: LANGUAGES }); + expect(uploaded['spec/openapi.json']).to.equal('{"openapi": "3.0.0"}'); }); it('synthesizes nothing: no plugin-config.json is written for the server', async () => {