From 9b4bc816ffc9462dd8d6c520fa2c7a160edd7ad7 Mon Sep 17 00:00:00 2001 From: Stephen Cresswell <229672+cressie176@users.noreply.github.com> Date: Fri, 20 Dec 2024 10:52:20 +0000 Subject: [PATCH] Rename organisation to owner --- README.md | 4 ++-- examples/personal/index.js | 4 ++-- package-lock.json | 4 ++-- test/knuff.test.js | 6 +++--- test/lib/StubDriver.js | 8 ++++---- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index abca618..bcd5dfe 100644 --- a/README.md +++ b/README.md @@ -86,12 +86,12 @@ const pathToReminders = process.argv[2] || 'reminders.yaml'; const config = { repositories: { 'acuminous/foo': { - organisation: 'acuminous', + owner: 'acuminous', name: 'foo', driver: 'github', }, 'acuminous/bar': { - organisation: 'acuminous', + owner: 'acuminous', name: 'bar', driver: 'github', }, diff --git a/examples/personal/index.js b/examples/personal/index.js index 0c200e6..5cdd7af 100644 --- a/examples/personal/index.js +++ b/examples/personal/index.js @@ -10,12 +10,12 @@ const pathToReminders = process.argv[2] || 'reminders.yaml'; const config = { repositories: { 'acuminous/foo': { - organisation: 'acuminous', + owner: 'acuminous', name: 'foo', driver: 'github', }, 'acuminous/bar': { - organisation: 'acuminous', + owner: 'acuminous', name: 'bar', driver: 'github', }, diff --git a/package-lock.json b/package-lock.json index 8649970..74c6aa2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "knuff", + "name": "@acuminous/knuff", "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "knuff", + "name": "@acuminous/knuff", "version": "1.0.0", "license": "ISC", "dependencies": { diff --git a/test/knuff.test.js b/test/knuff.test.js index 4414c0d..8139296 100644 --- a/test/knuff.test.js +++ b/test/knuff.test.js @@ -10,17 +10,17 @@ describe('knuff', () => { const repositories = { 'acuminous/foo': { - organisation: 'acuminous', + owner: 'acuminous', name: 'foo', driver: 'github', }, 'acuminous/bar': { - organisation: 'acuminous', + owner: 'acuminous', name: 'bar', driver: 'github', }, 'acuminous/baz': { - organisation: 'acuminous', + owner: 'acuminous', name: 'baz', driver: 'gitlab', }, diff --git a/test/lib/StubDriver.js b/test/lib/StubDriver.js index 33df22b..4f6cbdf 100644 --- a/test/lib/StubDriver.js +++ b/test/lib/StubDriver.js @@ -12,20 +12,20 @@ class StubDriver { } async findIssue(repository, reminderId) { - const key = this.#getRepositoryKey(repository.organisation, repository.name); + const key = this.#getRepositoryKey(repository.owner, repository.name); const { issues } = this.#repositories[key] || this.#initRepository(); return issues.find((issue) => issue.labels.find((label) => label === reminderId)); } async createIssue(repository, reminderId, issue) { - const key = this.#getRepositoryKey(repository.organisation, repository.name); + const key = this.#getRepositoryKey(repository.owner, repository.name); this.#repositories[key] = this.#repositories[key] || this.#initRepository(); const labels = [].concat(issue.labels || [], reminderId); this.#repositories[key].issues.push({ ...issue, labels }); } - #getRepositoryKey(organisation, name) { - return `${organisation}/${name}`; + #getRepositoryKey(owner, name) { + return `${owner}/${name}`; } #initRepository() {