diff --git a/src/base/deployBase.ts b/src/base/deployBase.ts index da46608..66ff67f 100644 --- a/src/base/deployBase.ts +++ b/src/base/deployBase.ts @@ -30,6 +30,7 @@ export type BaseDeployFlags = { 'target-org': Org; 'cpu-size': string; network?: string; + 'use-in-feature'?: string; }; export type DeployResult = SharedResultProps & { @@ -129,6 +130,7 @@ export abstract class DeployBase { // Build args array for spawn (avoids shell-escaping issues and enables streaming) const args = [ @@ -128,6 +129,10 @@ export class DatacodeBinaryExecutor { args.push('--network', network); } + if (useInFeature) { + args.push('--use-in-feature', useInFeature); + } + return new Promise((resolve, reject) => { debug('deploy spawn: datacustomcode %o', args); const child = spawn('datacustomcode', args, { diff --git a/test/commands/data-code-extension/deploy.test.ts b/test/commands/data-code-extension/deploy.test.ts index 2c270a4..bb4b5e3 100644 --- a/test/commands/data-code-extension/deploy.test.ts +++ b/test/commands/data-code-extension/deploy.test.ts @@ -232,6 +232,59 @@ describe('data-code-extension deploy', () => { expect(binaryDeployStub.firstCall.args[0]).to.equal('test-function'); }); + it('should pass default use-in-feature to binary', async () => { + await FunctionDeploy.run([ + '--name', + 'test-function', + '--package-version', + '1.0.0', + '--description', + 'Test function deployment', + '--package-dir', + testDir, + '--target-org', + 'test@example.com', + ]); + + expect(binaryDeployStub.firstCall.args[7]).to.equal('SearchIndexChunking'); + }); + + it('should pass explicit use-in-feature to binary', async () => { + await FunctionDeploy.run([ + '--name', + 'test-function', + '--package-version', + '1.0.0', + '--description', + 'Test function deployment', + '--package-dir', + testDir, + '--target-org', + 'test@example.com', + '--use-in-feature', + 'CustomFeature', + ]); + + expect(binaryDeployStub.firstCall.args[7]).to.equal('CustomFeature'); + }); + + it('should not pass use-in-feature for script deploy', async () => { + await ScriptDeploy.run([ + '--name', + 'test-script', + '--package-version', + '1.0.0', + '--description', + 'Test script deployment', + '--package-dir', + testDir, + '--target-org', + 'test@example.com', + ]); + + expect(binaryDeployStub.firstCall.args[7]).to.be.undefined; + }); + it('should validate CPU size options', async () => { try { await FunctionDeploy.run([