Skip to content
Open
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
8 changes: 0 additions & 8 deletions .eslintrc.json

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ coverage/
junit.xml
package-lock.json
oclif.manifest.json
.claude
5 changes: 0 additions & 5 deletions e2e/.eslintrc.json

This file was deleted.

28 changes: 28 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
Copyright 2020 Adobe. All rights reserved.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be 2026 since it is new

This file is licensed to you under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License. You may obtain a copy
of the License at http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under
the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
OF ANY KIND, either express or implied. See the License for the specific language
governing permissions and limitations under the License.
*/

const aioLibConfig = require('@adobe/eslint-config-aio-lib-config')
const jest = require('eslint-plugin-jest')

module.exports = [
...aioLibConfig,
{
...jest.configs['flat/recommended'],
files: ['test/**/*.js', 'e2e/**/*.js']
},
{
files: ['test/**/*.js', 'e2e/**/*.js'],
rules: {
'n/no-unpublished-require': 'off'
}
}
]
17 changes: 6 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"bugs": "https://github.com/adobe/aio-cli-plugin-info/issues",
"dependencies": {
"@adobe/aio-lib-core-config": "^5",
"@oclif/core": "^2.0.0",
"@oclif/core": "^4.10.2",
"chalk": "^4.0.0",
"debug": "^4.3.3",
"envinfo": "^7.5.0",
Expand All @@ -17,23 +17,18 @@
"semver": "^7.3.7"
},
"devDependencies": {
"@adobe/eslint-config-aio-lib-config": "^4.0.0",
"@adobe/eslint-config-aio-lib-config": "^5.0.0",
"acorn": "^8.7.0",
"dedent": "^1.5.1",
"eslint": "^8.57.1",
"eslint-config-oclif": "^5.2.2",
"eslint-config-standard": "^17.1.0",
"eslint-plugin-import": "^2.31.0",
"eslint-plugin-jest": "^27.9.0",
"eslint-plugin-jsdoc": "^48.11.0",
"eslint-plugin-n": "^15.7.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^6.6.0",
"eslint": "^9",
"eslint-plugin-jest": "^29",
"eslint-plugin-jsdoc": "^48",
"execa": "^9.5.2",
"jest": "^29.5.0",
"jest-haste-map": "^29.5.0",
"jest-junit": "^16.0.0",
"jest-resolve": "^29.7.0",
"neostandard": "^0",
"oclif": "^4.17.13",
"stdout-stderr": "^0.1.13"
},
Expand Down
5 changes: 2 additions & 3 deletions src/commands/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ class InfoCommand extends Command {
}

async run () {
const { flags } = await this.parse(InfoCommand)

try {
const { flags } = await this.parse(InfoCommand)
const resInfo = await envinfo.run({
System: ['OS', 'CPU', 'Memory', 'Shell'],
Binaries: ['Node', 'Yarn', 'npm'],
Expand All @@ -57,7 +56,7 @@ class InfoCommand extends Command {
showNotFound: true
})

const plugins = this.config.plugins
const plugins = [...this.config.plugins.values()]
.filter(p => !p.parent)
.sort((a, b) => a.name < b.name ? -1 : 1)

Expand Down
5 changes: 0 additions & 5 deletions test/.eslintrc.json

This file was deleted.

9 changes: 9 additions & 0 deletions test/commands/info.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ describe('instance methods', () => {
test('calls envinfo.run', () => {
command.argv = []
command.config = {
runHook: jest.fn().mockResolvedValue({ successes: [], failures: [] }),
pjson: {
name: 'ima-cli',
oclif: {
Expand Down Expand Up @@ -126,6 +127,7 @@ describe('instance methods', () => {
test('proxies, cli plugins (core, user, link) stdout', () => {
command.argv = []
command.config = {
runHook: jest.fn().mockResolvedValue({ successes: [], failures: [] }),
pjson: {
name: 'ima-cli',
oclif: {
Expand Down Expand Up @@ -178,6 +180,7 @@ describe('instance methods', () => {

command.argv = []
command.config = {
runHook: jest.fn().mockResolvedValue({ successes: [], failures: [] }),
pjson: {
name: 'ima-cli',
oclif: {
Expand Down Expand Up @@ -222,6 +225,7 @@ describe('instance methods', () => {
test('proxies, cli plugins (core, user, link) --json', () => {
command.argv = ['-j']
command.config = {
runHook: jest.fn().mockResolvedValue({ successes: [], failures: [] }),
pjson: {
name: 'ima-cli',
oclif: {
Expand Down Expand Up @@ -297,6 +301,7 @@ describe('instance methods', () => {
test('proxies, cli plugins (core, user, link) --yml', async () => {
command.argv = ['-y']
command.config = {
runHook: jest.fn().mockResolvedValue({ successes: [], failures: [] }),
pjson: {
name: 'ima-cli',
oclif: {
Expand Down Expand Up @@ -352,6 +357,7 @@ describe('instance methods', () => {
test('calls envinfo.run --json', () => {
command.argv = ['-j']
command.config = {
runHook: jest.fn().mockResolvedValue({ successes: [], failures: [] }),
pjson: {
name: 'ima-cli',
oclif: {
Expand Down Expand Up @@ -385,6 +391,7 @@ describe('instance methods', () => {
test('calls envinfo.run --yml', () => {
command.argv = ['-y']
command.config = {
runHook: jest.fn().mockResolvedValue({ successes: [], failures: [] }),
pjson: {
name: 'ima-cli',
oclif: {
Expand Down Expand Up @@ -428,6 +435,7 @@ describe('instance methods', () => {

test('warns if node is not supported', async () => {
command.config = {
runHook: jest.fn().mockResolvedValue({ successes: [], failures: [] }),
pjson: {
name: 'ima-cli',
oclif: {
Expand All @@ -451,6 +459,7 @@ describe('instance methods', () => {

test('plugins list is sorted', async () => {
command.config = {
runHook: jest.fn().mockResolvedValue({ successes: [], failures: [] }),
pjson: {
name: 'ima-cli',
oclif: {
Expand Down
8 changes: 4 additions & 4 deletions test/commands/report.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('instance methods', () => {

test('calls envinfo.run for bugs (object)', () => {
command.argv = []
command.config = { pjson: { bugs: { url: 'some-link' } } }
command.config = { runHook: jest.fn().mockResolvedValue({ successes: [], failures: [] }), pjson: { bugs: { url: 'some-link' } } }
return command.run()
.then(() => {
expect(envinfo.run).toHaveBeenCalledWith(expect.objectContaining({
Expand All @@ -67,7 +67,7 @@ describe('instance methods', () => {

test('calls envinfo.run for bugs (string)', () => {
command.argv = []
command.config = { pjson: { bugs: 'some-link' } }
command.config = { runHook: jest.fn().mockResolvedValue({ successes: [], failures: [] }), pjson: { bugs: 'some-link' } }
return command.run()
.then(() => {
expect(envinfo.run).toHaveBeenCalledWith(expect.objectContaining({
Expand All @@ -85,7 +85,7 @@ describe('instance methods', () => {

test('does not call envinfo.run for feature', () => {
command.argv = ['-f']
command.config = { pjson: { bugs: { url: 'some-link' } } }
command.config = { runHook: jest.fn().mockResolvedValue({ successes: [], failures: [] }), pjson: { bugs: { url: 'some-link' } } }
return command.run().then(() => {
expect(envinfo.run).not.toHaveBeenCalled()
expect(open).toHaveBeenCalled()
Expand All @@ -95,7 +95,7 @@ describe('instance methods', () => {

test('outputs error if cli package.json does not define a bugs.url', async () => {
command.argv = []
command.config = { pjson: { bugs: { } } }
command.config = { runHook: jest.fn().mockResolvedValue({ successes: [], failures: [] }), pjson: { bugs: { } } }
command.error = jest.fn(() => { throw new Error('Bang bang there goes your heart') })
const unexpectedError = new Error('it should not reach here')

Expand Down
Loading