Skip to content
Draft
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
16 changes: 5 additions & 11 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
{
"name": "App Container",
"image": "mcr.microsoft.com/devcontainers/javascript-node:latest",
"image": "mcr.microsoft.com/devcontainers/base:ubuntu",
"features": {
"ghcr.io/devcontainers/features/node:1": {
"version": "lts",
"pnpm": "latest"
}
"ghcr.io/devcontainers-community/features/deno": {}
},
"customizations": {
"vscode": {
Expand All @@ -14,16 +11,13 @@
"editor.tabSize": 2
},
"extensions": [
"dbaeumer.vscode-eslint"
"denoland.vscode-deno"
]
}
},
"mounts": [
"source=${localEnv:HOME}/.gitconfig,target=/home/node/.gitconfig,type=bind,consistency=cached",
"source=${localEnv:HOME}/.ssh,target=/home/node/.ssh,type=bind,consistency=cached"
],
"postCreateCommand": "pnpm install",
"containerEnv": {
"npm_config_store_dir": "/home/node/.local/share/pnpm/store"
}
}
"postCreateCommand": "deno install"
}
8 changes: 0 additions & 8 deletions .eslintignore

This file was deleted.

19 changes: 0 additions & 19 deletions .eslintrc.js

This file was deleted.

15 changes: 7 additions & 8 deletions .github/workflows/branch_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,13 @@ jobs:
set -e

# Lint
pnpm run lint
pnpm tsc --noemit
deno lint

# Test
pnpm test:coverage
deno task test:coverage

# Build
pnpm run build
deno task build

# Tag
if [ "$(git log -1 --pretty=format:%ae)" = "noreply@github.com" ]; then
Expand All @@ -65,14 +64,14 @@ jobs:

echo "Current Version is $VERSION and the milestone is $MILESTONE"
if [[ "$MILESTONE" == "major-version" ]]; then
pnpm run bumpManifestVer major $VERSION
deno task bumpManifestVer major $VERSION
elif [[ "$MILESTONE" == "minor-version" ]]; then
pnpm run bumpManifestVer minor $VERSION
deno task bumpManifestVer minor $VERSION
else
pnpm run bumpManifestVer patch $VERSION
deno task bumpManifestVer patch $VERSION
fi

pnpm prettier --write manifest.json
deno fmt manifest.json -- --fix

- name: Update the Manifest in git
run: |
Expand Down
15 changes: 7 additions & 8 deletions .github/workflows/pr_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,13 @@ jobs:
set -e

# Lint
pnpm run lint
pnpm tsc --noemit
deno lint

# Test
pnpm test:coverage
deno task test:coverage

# Build
pnpm run build
deno task build

# Tag
if [ "$(git log -1 --pretty=format:%ae)" = "noreply@github.com" ]; then
Expand All @@ -64,14 +63,14 @@ jobs:

echo "Current Version is $VERSION and the milestone is $MILESTONE"
if [[ "$MILESTONE" == "major-version" ]]; then
pnpm run bumpManifestVer major $VERSION
deno task bumpManifestVer major $VERSION
elif [[ "$MILESTONE" == "minor-version" ]]; then
pnpm run bumpManifestVer minor $VERSION
deno task bumpManifestVer minor $VERSION
else
pnpm run bumpManifestVer patch $VERSION
deno task bumpManifestVer patch $VERSION
fi

pnpm prettier --write manifest.json
deno fmt manifest.json -- --fix

- name: Package app zip
working-directory: dist
Expand Down
2 changes: 0 additions & 2 deletions .npmrc

This file was deleted.

2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@
"console": "integratedTerminal"
}
]
}
}
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
"label": "pnpm: test"
}
]
}
}
18 changes: 10 additions & 8 deletions DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
Companies House App
===
# Companies House App

The Companies House app integrates seamlessly with Deskpro’s existing platform, letting you quickly and easily search for information on any registered UK company. The app will display the essential information about the business, including:
The Companies House app integrates seamlessly with Deskpro’s existing platform,
letting you quickly and easily search for information on any registered UK
company. The app will display the essential information about the business,
including:

* Registered Name
* Company Number
* Company Type
* Date of Creation
* Status
- Registered Name
- Company Number
- Company Type
- Date of Creation
- Status
23 changes: 11 additions & 12 deletions LICENSE.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,19 @@ MIT License

Copyright (c) 2024 Deskpro

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
15 changes: 10 additions & 5 deletions SETUP.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
# Companies House App Setup

First, register for an [account with Companies House](https://developer.company-information.service.gov.uk/signin).
First, register for an
[account with Companies House](https://developer.company-information.service.gov.uk/signin).

[![](/docs/img/setup/companies-house-setup-01.png)](/docs/img/setup/companies-house-setup-01.png)

Once logged into your account, click "Create an application"

[![](/docs/img/setup/companies-house-setup-02.png)](/docs/img/setup/companies-house-setup-02.png)

Enter the details for your new Companies House integration app, making sure the Environment for the application is "Live". Once done click "Create"
Enter the details for your new Companies House integration app, making sure the
Environment for the application is "Live". Once done click "Create"

[![](/docs/img/setup/companies-house-setup-03.png)](/docs/img/setup/companies-house-setup-03.png)

When your app has been created, click "View all applications" and select your app.
When your app has been created, click "View all applications" and select your
app.

[![](/docs/img/setup/companies-house-setup-04.png)](/docs/img/setup/companies-house-setup-04.png)

Once inside your app, click on "Create new key", enter a name and description, set the type of API client as REST, and click on "Create key".
Once inside your app, click on "Create new key", enter a name and description,
set the type of API client as REST, and click on "Create key".

[![](/docs/img/setup/companies-house-setup-05.png)](/docs/img/setup/companies-house-setup-05.png)

Once the key has been created, copy the "API key" field, insert it in the settings app and install.
Once the key has been created, copy the "API key" field, insert it in the
settings app and install.
5 changes: 3 additions & 2 deletions bin/bumpManifestVer.js → bin/bumpManifestVer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const fs = require("fs");
import process from "node:process";
import fs from "node:fs";

const bumpSemanticVersion = (versionString, bumpType = "patch") => {
let [major, minor, patch] = versionString.split(".");
Expand Down Expand Up @@ -30,7 +31,7 @@ const packageJson = JSON.parse(fs.readFileSync("./manifest.json", "utf8"));
//1
packageJson.version = bumpSemanticVersion(
process.argv[3] ? process.argv[3] : packageJson.version,
process.argv[2]
process.argv[2],
);

fs.writeFileSync("./manifest.json", JSON.stringify(packageJson));
17 changes: 0 additions & 17 deletions bin/package.js

This file was deleted.

20 changes: 20 additions & 0 deletions bin/package.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import fs from "node:fs";
import slugify from "slugify";
import child_process from 'node:child_process';

const manifest = JSON.parse(fs.readFileSync(`${import.meta.dirname}/../manifest.json`).toString('utf8'));

const name = slugify(manifest.name, { strict: true, replacement: "" });
const version = manifest.version.replaceAll(".", "_");

const packagePath = `build/${name}-${version}.zip`;
try {
fs.mkdirSync(`${import.meta.dirname}/../build`, {recursive: true});
} catch {
// do nothing as the folder already existing is fine.
}
child_process.execSync(`zip -r ${import.meta.dirname}/../${packagePath} .`, {
cwd: `${import.meta.dirname}/../dist`,
});

console.info(`App package version ${manifest.version} created: ${packagePath}`);
Loading