Skip to content

Commit 5b61362

Browse files
DamianDunajskiDamian Dunajski
andauthored
Prepare project for release to NPM registry (#8)
* Change name * Remove compiled code * Add dist directory to .gitignore * Add pre / post publishing scripts * Limit NPM tarball to dist directory only * Add optional dependency installation to pre publish script * Bump version in version file * Set version in package.json to unversioned * Add license file and update license in package.json * Update README Co-authored-by: Damian Dunajski <[email protected]>
1 parent 1bb3614 commit 5b61362

File tree

144 files changed

+37
-3014
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+37
-3014
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ test.ts
77
.python-version
88
/coverage
99
.settings
10+
dist/

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2019 Companies House
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@ This SDK abstract the calls to our public APIs.
66

77
Use NPM to install the SDK in your project;
88

9-
npm i git+ssh://[email protected]:companieshouse/api-sdk-node.git
9+
npm i @companieshouse/api-sdk-node
1010

1111
Note that this install may need to be run with the 'sudo' command to avoid an error related to file permissions (and Sophos virus scanning).
1212

1313
The following snippet shows how to get up and running quickly using TypeScript.
1414

1515
```typescript
1616

17-
import {createApiClient} from "api-sdk-node";
17+
import {createApiClient} from "@companieshouse/api-sdk-node";
1818

1919
(async () => {
2020
const api = createApiClient("your-api-key");
@@ -28,7 +28,7 @@ import {createApiClient} from "api-sdk-node";
2828
There is an alternative way of calling some of the services, which forces you to check for errors. It borrows concepts from the Either class found in functional programming.
2929
```typescript
3030

31-
import {createApiClient} from "api-sdk-node";
31+
import {createApiClient} from "@companieshouse/api-sdk-node";
3232

3333
(async () => {
3434
const api = createApiClient("your-api-key");
@@ -69,11 +69,3 @@ Note that if your local project is running within a Vagrant Virtual Machine, thi
6969
To tun the tests with coverage, pass the `--coverage` flag on the command line.
7070

7171
npm t -- --coverage
72-
73-
## Building a new version
74-
75-
When you want to release a new version, you first need to compile the TypeScript code.
76-
77-
npm run build
78-
79-
This will output the generated JavaScript, Declaration files and Source Maps to the [dist](./dist) directory. The generated source code needs to be committed under version control as there is no internal npm registry yet.

dist/client.d.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

dist/client.js

Lines changed: 0 additions & 35 deletions
This file was deleted.

dist/client.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/config.d.ts

Lines changed: 0 additions & 2 deletions
This file was deleted.

dist/config.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

dist/config.js.map

Lines changed: 0 additions & 1 deletion
This file was deleted.

dist/http/http-client.d.ts

Lines changed: 0 additions & 88 deletions
This file was deleted.

0 commit comments

Comments
 (0)