Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: app pack and app install help was hidden in the README text #758

Merged
merged 1 commit into from
Feb 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions src/commands/app/install.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ const { validateJsonWithSchema } = require('../../lib/install-helper')
const jsYaml = require('js-yaml')
const { USER_CONFIG_FILE, DEPLOY_CONFIG_FILE } = require('../../lib/defaults')
const ora = require('ora')
const chalk = require('chalk')

// eslint-disable-next-line node/no-missing-require
const libConfig = require('@adobe/aio-cli-lib-app-config')
Expand All @@ -30,8 +29,6 @@ class InstallCommand extends BaseCommand {
async run () {
const { args, flags } = await this.parse(InstallCommand)

this.preRelease()

aioLogger.debug(`flags: ${JSON.stringify(flags, null, 2)}`)
aioLogger.debug(`args: ${JSON.stringify(args, null, 2)}`)

Expand Down Expand Up @@ -155,10 +152,8 @@ class InstallCommand extends BaseCommand {
}
}

InstallCommand.hidden = true // hide from help for pre-release

InstallCommand.description = chalk.yellow(`(Pre-release) This command will support installing apps packaged by '<%= config.bin %> app pack'.
`)
InstallCommand.description = `This command will support installing apps packaged by '<%= config.bin %> app pack'.
`

InstallCommand.flags = {
...BaseCommand.flags,
Expand Down
9 changes: 2 additions & 7 deletions src/commands/app/pack.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ const execa = require('execa')
const { loadConfigFile, writeFile } = require('../../lib/import-helper')
const { getObjectValue } = require('../../lib/app-helper')
const ora = require('ora')
const chalk = require('chalk')
const junk = require('junk')

// eslint-disable-next-line node/no-missing-require
Expand All @@ -37,8 +36,6 @@ class Pack extends BaseCommand {
async run () {
const { args, flags } = await this.parse(Pack)

this.preRelease()

aioLogger.debug(`flags: ${JSON.stringify(flags, null, 2)}`)
aioLogger.debug(`args: ${JSON.stringify(args, null, 2)}`)

Expand Down Expand Up @@ -356,10 +353,8 @@ class Pack extends BaseCommand {
}
}

Pack.hidden = true // hide from help for pre-release

Pack.description = chalk.yellow(`(Pre-release) This command will support packaging apps for redistribution.
`)
Pack.description = `This command will support packaging apps for redistribution.
`

Pack.flags = {
...BaseCommand.flags,
Expand Down
15 changes: 11 additions & 4 deletions test/BaseCommand.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,19 @@ test('args', async () => {

test('basecommand defines method', async () => {
const cmd = new TheCommand()

expect(cmd.getLaunchUrlPrefix).toBeDefined()
expect(typeof cmd.getLaunchUrlPrefix).toBe('function')
mockAioConfig.get.mockReturnValue('http://prefix?fake=')
expect(cmd.getLaunchUrlPrefix()).toBe('http://prefix?fake=')
mockAioConfig.get.mockReturnValue(null)
expect(cmd.getLaunchUrlPrefix()).toEqual(expect.stringContaining('https://'))
expect(cmd.preRelease).toBeDefined()
expect(typeof cmd.preRelease).toBe('function')
})

test('preRelease() outputs to log', async () => {
const cmd = new TheCommand()
cmd.log = jest.fn()

cmd.preRelease()
expect(cmd.log).toHaveBeenCalledWith(expect.stringMatching('Pre-release warning: This command is in pre-release, and not suitable for production.'))
})

test('getLaunchUrlPrefix() warns on older url', async () => {
Expand Down
1 change: 1 addition & 0 deletions test/commands/app/install.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ test('exports', () => {
expect(TheCommand.prototype instanceof BaseCommand).toBeTruthy()
expect(typeof TheCommand.flags).toBe('object')
expect(TheCommand.description).toBeDefined()
expect(TheCommand.hidden).toBeFalsy()
})

test('description', async () => {
Expand Down
1 change: 1 addition & 0 deletions test/commands/app/pack.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ test('exports', async () => {
expect(TheCommand.prototype instanceof BaseCommand).toBeTruthy()
expect(typeof TheCommand.flags).toBe('object')
expect(TheCommand.description).toBeDefined()
expect(TheCommand.hidden).toBeFalsy()
})

test('description', async () => {
Expand Down
Loading