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

This file was deleted.

14 changes: 0 additions & 14 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 @@ -12,3 +12,4 @@ node_modules
coverage/
junit.xml
package-lock.json
.claude
24 changes: 24 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/*
Copyright 2026 Adobe. All rights reserved.
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 pluginJest = require('eslint-plugin-jest')

module.exports = [
...aioLibConfig,
pluginJest.configs['flat/recommended'],
{
rules: {
'jsdoc/no-defaults': 'off'
}
}
]
19 changes: 7 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,19 @@
"repository": "adobe/aio-cli-plugin-certificate",
"homepage": "https://github.com/adobe/aio-cli-plugin-certificate",
"dependencies": {
"@oclif/core": "^1.9.0",
"@oclif/core": "^4.9.0",
"debug": "^4.3.3",
"fs-extra": "^9.0.0",
"node-forge": "^1.3.0"
},
"devDependencies": {
"@adobe/eslint-config-aio-lib-config": "^4.0.0",
"eslint": "^8.57.1",
"eslint-config-oclif": "^4.0.0",
"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",
"@adobe/eslint-config-aio-lib-config": "^5.0.0",
"eslint": "^9",
"eslint-plugin-jest": "^29",
"eslint-plugin-jsdoc": "^48",
"jest": "^29",
"oclif": "^3.2.0",
"neostandard": "^0",
"oclif": "^4.0.0",
"stdout-stderr": "^0.1.9"
},
"engines": {
Expand Down
11 changes: 5 additions & 6 deletions src/commands/certificate/fingerprint.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/

const { Command } = require('@oclif/core')
const { Command, Args } = require('@oclif/core')
const fs = require('fs-extra')
const debug = require('debug')('aio-cli-plugin-certificate:fingerprint')

Expand Down Expand Up @@ -41,12 +41,11 @@ class FingerprintCommand extends Command {

FingerprintCommand.description = 'Compute the fingerprint of a public key certificate for use with Adobe I/O'

FingerprintCommand.args = [
{
name: 'file',
FingerprintCommand.args = {
file: Args.string({
required: true,
description: 'file path to certificate to fingerprint'
}
]
})
}

module.exports = FingerprintCommand
11 changes: 5 additions & 6 deletions src/commands/certificate/verify.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ OF ANY KIND, either express or implied. See the License for the specific languag
governing permissions and limitations under the License.
*/

const { Command, Flags } = require('@oclif/core')
const { Command, Flags, Args } = require('@oclif/core')
const fs = require('fs-extra')
const debug = require('debug')('aio-cli-plugin-certificate:verify')

Expand Down Expand Up @@ -70,12 +70,11 @@ VerifyCommand.flags = {
})
}

VerifyCommand.args = [
{
name: 'file',
VerifyCommand.args = {
file: Args.string({
required: true,
description: 'file path to certificate to verify'
}
]
})
}

module.exports = VerifyCommand
9 changes: 5 additions & 4 deletions test/commands/certificate/fingerprint.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,11 @@ test('description', async () => {
})

test('args', async () => {
const arg = TheCommand.args[0]
expect(arg.name).toBeDefined()
expect(Object.keys(TheCommand.args)[0]).toBeDefined()
})

const mockConfig = { runHook: jest.fn().mockResolvedValue({ successes: [], failures: [] }) }

describe('instance methods - mock forge', () => {
let CommandUnderTest, command, handleError, mockFS, mockForge
jest.isolateModules(() => {
Expand All @@ -63,7 +64,7 @@ describe('instance methods - mock forge', () => {
})

beforeEach(() => {
command = new CommandUnderTest([])
command = new CommandUnderTest([], mockConfig)
handleError = jest.spyOn(command, 'error')
})

Expand Down Expand Up @@ -103,7 +104,7 @@ describe('instance methods - real forge', () => {
})

beforeEach(() => {
command = new CommandUnderTest([])
command = new CommandUnderTest([], mockConfig)
handleError = jest.spyOn(command, 'error')
})

Expand Down
4 changes: 3 additions & 1 deletion test/commands/certificate/generate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@ test('description', async () => {
expect(TheCommand.description).toBeDefined()
})

const mockConfig = { runHook: jest.fn().mockResolvedValue({ successes: [], failures: [] }) }

describe('instance methods', () => {
let command, handleError

beforeEach(() => {
command = new TheCommand([])
command = new TheCommand([], mockConfig)
handleError = jest.spyOn(command, 'error')
})

Expand Down
7 changes: 4 additions & 3 deletions test/commands/certificate/verify.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@ test('description', async () => {
})

test('args', async () => {
const arg = TheCommand.args[0]
expect(arg.name).toBeDefined()
expect(Object.keys(TheCommand.args)[0]).toBeDefined()
})

const mockConfig = { runHook: jest.fn().mockResolvedValue({ successes: [], failures: [] }) }

describe('instance methods', () => {
let command, handleError

beforeEach(() => {
command = new TheCommand([])
command = new TheCommand([], mockConfig)
handleError = jest.spyOn(command, 'error')
})

Expand Down
Loading