diff --git a/README.md b/README.md index 64683678..915e93c3 100644 --- a/README.md +++ b/README.md @@ -96,7 +96,7 @@ $ npm install -g @adobe/aio-cli $ aio COMMAND running command... $ aio (--version|-v) -@adobe/aio-cli/10.3.2 darwin-arm64 node-v22.11.0 +@adobe/aio-cli/10.3.3 darwin-arm64 node-v20.18.2 $ aio --help [COMMAND] USAGE $ aio COMMAND @@ -3430,6 +3430,7 @@ FLAGS DESCRIPTION Discover plugins to install + Lists only plugins with prefix '@adobe/aio-cli-plugin' To install a plugin, run 'aio plugins install NAME' @@ -3437,7 +3438,7 @@ ALIASES $ aio plugins discover ``` -_See code: [src/commands/discover.ts](https://github.com/adobe/aio-cli/blob/10.3.2/src/commands/discover.ts)_ +_See code: [src/commands/discover.ts](https://github.com/adobe/aio-cli/blob/10.3.3/src/commands/discover.ts)_ ## `aio event` @@ -4335,6 +4336,7 @@ FLAGS DESCRIPTION Discover plugins to install + Lists only plugins with prefix '@adobe/aio-cli-plugin' To install a plugin, run 'aio plugins install NAME' @@ -4598,7 +4600,7 @@ DESCRIPTION Clears all installed plugins. ``` -_See code: [src/commands/rollback.ts](https://github.com/adobe/aio-cli/blob/10.3.2/src/commands/rollback.ts)_ +_See code: [src/commands/rollback.ts](https://github.com/adobe/aio-cli/blob/10.3.3/src/commands/rollback.ts)_ ## `aio rt` @@ -13844,7 +13846,7 @@ DESCRIPTION - update user-installed plugins that are not core ``` -_See code: [src/commands/update.ts](https://github.com/adobe/aio-cli/blob/10.3.2/src/commands/update.ts)_ +_See code: [src/commands/update.ts](https://github.com/adobe/aio-cli/blob/10.3.3/src/commands/update.ts)_ ## `aio where` diff --git a/package-lock.json b/package-lock.json index bf45a296..00394d8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@adobe/aio-cli", - "version": "10.3.2", + "version": "10.3.3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@adobe/aio-cli", - "version": "10.3.2", + "version": "10.3.3", "license": "Apache-2.0", "dependencies": { "@adobe/aio-cli-plugin-app": "^13", diff --git a/package.json b/package.json index 2c8af57b..f32dff12 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@adobe/aio-cli", "description": "Adobe I/O Extensible CLI\n\n******* *******\n****** ******\n***** *****\n**** * ****\n*** *** ***\n** ***** **\n* ** *\n", - "version": "10.3.2", + "version": "10.3.3", "author": "Adobe Inc.", "bin": { "aio": "bin/run" diff --git a/src/commands/discover.js b/src/commands/discover.js index f688e372..a4e29a64 100644 --- a/src/commands/discover.js +++ b/src/commands/discover.js @@ -98,7 +98,7 @@ class DiscoCommand extends Command { // ours only, this could become a flag, searching for oclif-plugin reveals some more const adobeOnly = json.objects .map(e => e.package) - .filter(elem => elem.scope === 'adobe') + .filter(elem => elem.name && elem.name.startsWith('@adobe/aio-cli-plugin')) sortValues(adobeOnly, { descending: flags['sort-order'] !== 'asc', @@ -117,6 +117,7 @@ class DiscoCommand extends Command { } DiscoCommand.description = `Discover plugins to install +Lists only plugins with prefix '@adobe/aio-cli-plugin' To install a plugin, run 'aio plugins install NAME' ` diff --git a/test/commands/discover.test.js b/test/commands/discover.test.js index fced89f0..a0ecc185 100644 --- a/test/commands/discover.test.js +++ b/test/commands/discover.test.js @@ -23,7 +23,7 @@ beforeEach(() => { fetch.resetMocks() command = new TheCommand([]) command.config = { - commands: [{ pluginName: 'baz' }], + commands: [{ pluginName: '@adobe/aio-cli-plugin-baz' }], runCommand: jest.fn() } }) @@ -39,8 +39,8 @@ describe('sorting', () => { const expectedResult = { objects: [ - { package: { scope: 'adobe', name: 'foo', description: 'some foo', version: '1.0.0', date: genesis } }, - { package: { scope: 'adobe', name: 'bar', description: 'some bar', version: '1.0.1', date: later } } + { package: { name: '@adobe/aio-cli-plugin-a', description: 'plugin a', version: '1.0.0', date: genesis } }, + { package: { name: '@adobe/aio-cli-plugin-b', description: 'plugin b', version: '1.0.1', date: later } } ] } beforeEach(() => { @@ -59,32 +59,32 @@ describe('sorting', () => { command.argv = ['--sort-field', 'name', '--sort-order', 'asc'] await command.run() const splitOutput = stdout.output.split('\n') - expect(splitOutput[2]).toMatch('bar') // bar is first - expect(splitOutput[3]).toMatch('foo') // foo is second + expect(splitOutput[2]).toMatch('@adobe/aio-cli-plugin-a') // @adobe/aio-cli-plugin-a is first + expect(splitOutput[3]).toMatch('@adobe/aio-cli-plugin-b') // @adobe/aio-cli-plugin-b is second }) test('sort-field=name, descending', async () => { command.argv = ['--sort-field', 'name', '--sort-order', 'desc'] await command.run() const splitOutput = stdout.output.split('\n') - expect(splitOutput[2]).toMatch('foo') // foo is first - expect(splitOutput[3]).toMatch('bar') // bar is second + expect(splitOutput[2]).toMatch('@adobe/aio-cli-plugin-b') // @adobe/aio-cli-plugin-b is first + expect(splitOutput[3]).toMatch('@adobe/aio-cli-plugin-a') // @adobe/aio-cli-plugin-a is second }) test('sort-field=date, ascending', async () => { command.argv = ['--sort-field', 'date', '--sort-order', 'asc'] await command.run() const splitOutput = stdout.output.split('\n') - expect(splitOutput[2]).toMatch('foo') // foo is first - expect(splitOutput[3]).toMatch('bar') // bar is second + expect(splitOutput[2]).toMatch('@adobe/aio-cli-plugin-a') // @adobe/aio-cli-plugin-a is first + expect(splitOutput[3]).toMatch('@adobe/aio-cli-plugin-b') // @adobe/aio-cli-plugin-b is second }) test('sort-field=date, descending', async () => { command.argv = ['--sort-field', 'date', '--sort-order', 'desc'] await command.run() const splitOutput = stdout.output.split('\n') - expect(splitOutput[2]).toMatch('bar') // bar is first - expect(splitOutput[3]).toMatch('foo') // foo is second + expect(splitOutput[2]).toMatch('@adobe/aio-cli-plugin-b') // @adobe/aio-cli-plugin-b is first + expect(splitOutput[3]).toMatch('@adobe/aio-cli-plugin-a') // @adobe/aio-cli-plugin-a is second }) }) @@ -95,22 +95,22 @@ test('interactive install', async () => { const expectedResult = { objects: [ - { package: { scope: 'adobe', name: 'foo', description: 'some foo', version: '1.0.0', date: now } }, - { package: { scope: 'adobe', name: 'bar', description: 'some bar', version: '1.0.1', date: tomorrow } }, - { package: { scope: 'adobe', name: 'baz', description: 'some baz', version: '1.0.2', date: dayAfter } } + { package: { name: '@adobe/aio-cli-plugin-foo', description: 'some foo', version: '1.0.0', date: now } }, + { package: { name: '@adobe/aio-cli-plugin-bar', description: 'some bar', version: '1.0.1', date: tomorrow } }, + { package: { name: '@adobe/aio-cli-plugin-baz', description: 'some baz', version: '1.0.2', date: dayAfter } } ] } fetch.mockResponseOnce(JSON.stringify(expectedResult)) command.argv = ['-i'] inquirer.prompt = jest.fn().mockResolvedValue({ - plugins: ['bar', 'foo'] + plugins: ['@adobe/aio-cli-plugin-bar', '@adobe/aio-cli-plugin-foo'] }) const result = await command.run() - expect(result).toEqual(['bar', 'foo']) + expect(result).toEqual(['@adobe/aio-cli-plugin-bar', '@adobe/aio-cli-plugin-foo']) const arg = inquirer.prompt.mock.calls[0][0] // first arg of first call - expect(arg[0].choices.map(elem => elem.value)).toEqual(['bar', 'foo']) // baz was an existing plugin, filtered out + expect(arg[0].choices.map(elem => elem.value)).toEqual(['@adobe/aio-cli-plugin-bar', '@adobe/aio-cli-plugin-foo']) // @adobe/aio-cli-plugin-baz was an existing plugin, filtered out }) test('interactive install - no choices', async () => { @@ -118,7 +118,7 @@ test('interactive install - no choices', async () => { const expectedResult = { objects: [ - { package: { scope: 'adobe', name: 'baz', description: 'some baz', version: '1.0.2', date: now } } + { package: { name: '@adobe/aio-cli-plugin-baz', description: 'some baz', version: '1.0.2', date: now } } ] } fetch.mockResponseOnce(JSON.stringify(expectedResult))