Skip to content

Commit

Permalink
Add types from public offer (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith Broughton authored Jul 19, 2021
1 parent d5c9a6d commit 4cc3cb2
Show file tree
Hide file tree
Showing 5 changed files with 620 additions and 346 deletions.
9 changes: 2 additions & 7 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,26 +41,21 @@ jobs:
command: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > ~/repo/.npmrc
- run:
name: Publish package
command: yarn publish
command: npm publish

workflows:
version: 2
build-publish:
jobs:
- build:
context: LE
filters:
tags:
only: /^v.*/
- publish:
context: LE
requires:
- build
filters:
tags:
only: /^v.*/
branches:
ignore: /.*/
only: master

experimental:
notify:
Expand Down
11 changes: 2 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,7 @@ if (vendor.requiresTravellerDetails('00128000018BZkIAAW')) {
}

```
## Release
## Publishing

Use `npm` to patch, minor or whatever version:

```
npm version patch -m "release version %s"
git push && git push --tags
```

https://docs.npmjs.com/cli/version
Update the version in package.json as part of your PR and CircleCI will do the rest.

22 changes: 22 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
declare module "@luxuryescapes/lib-global" {
interface PackageNightOption {
packageId: string;
extraNights: number;
roomTypeId: string;
roomRateId: string;
name: string;
duration: number;
prices: {
price: number;
value: number;
nightly_price: number;
nightly_value: number;
};
}

const offer: {
flexibleNights: {
generateAllOptions: (pkg: any) => Array<PackageNightOption>;
};
};
}
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "@luxuryescapes/lib-global",
"version": "2.2.10",
"version": "2.3.0",
"description": "Lib for expanding functionality and deduplicating code between services",
"main": "compiled/index.js",
"types": "index.d.ts",
"homepage": "https://github.com/brandsExclusive/lib-global#readme",
"repository": "git@github.com:brandsExclusive/lib-global.git",
"license": "UNLICENSED",
Expand Down Expand Up @@ -34,7 +35,7 @@
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-promise": "^5.1.0",
"mocha": "^5.2.0",
"mocha": "^6.2.3",
"prettier": "^2.3.2"
}
}
Loading

0 comments on commit 4cc3cb2

Please sign in to comment.