Skip to content

Commit ff0d693

Browse files
authored
feat!: typescript, smoke-tests, min-stock option (#162)
Full typescript rewrite for better type-generation and future development. - adds min-stock option to stock command - adds smoke tests for several countries - adds postman collection & schema - adds workflow that runs postman collection on all countries for smoke tests - adds more tests BREAKING CHANGE:: some attributes and behavior may have changed as the whole lib has been re-written in TypeScript. Please update your integrations carefully.
1 parent 2cb34ce commit ff0d693

File tree

109 files changed

+8885
-6066
lines changed

Some content is hidden

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

109 files changed

+8885
-6066
lines changed

.codeclimate.yml

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

.commitlintrc.json

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

.depcheckrc

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,8 @@ ignores:
77
# related to linting commits
88
- "@commitlint/cli"
99
- "@commitlint/config-angular"
10-
# related to release tool semantic release
11-
- "@semantic-release/changelog"
12-
- "@semantic-release/commit-analyzer"
13-
- "@semantic-release/git"
14-
- "@semantic-release/npm"
15-
- "@semantic-release/release-notes-generator"
16-
- "@types/node"
10+
- "@commitlint/config-conventional"
11+
# types usually are not required directly
12+
- "@types/jest"
13+
# used to cleanup before build
14+
- "rimraf"

.editorconfig

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,16 @@
33
root = true
44

55
[*]
6+
indent_style = space
67
charset = utf-8
78
end_of_line = lf
89
trim_trailing_whitespace = true
910
insert_final_newline = true
1011

11-
[{.,}*.{js{,*},y{a,}ml}]
12-
indent_style = space
12+
[*.{ts,tsx,js,yaml,yml,json}]
1313
indent_size = 2
1414

15-
[types/**/*]
16-
insert_final_newline = false
17-
1815
[*.{md,txt}]
19-
indent_style = space
2016
indent_size = 4
2117
trim_trailing_whitespace = false
2218

.eslintrc.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module.exports = {
2+
parser: "@typescript-eslint/parser",
3+
parserOptions: {
4+
project: "tsconfig.json",
5+
sourceType: "module",
6+
},
7+
plugins: [
8+
"@typescript-eslint/eslint-plugin",
9+
"jest",
10+
"prettier",
11+
],
12+
extends: [
13+
"plugin:@typescript-eslint/eslint-recommended",
14+
"plugin:@typescript-eslint/recommended",
15+
"plugin:jest/recommended",
16+
"plugin:jest/style"
17+
],
18+
root: true,
19+
env: {
20+
node: true,
21+
jest: true,
22+
},
23+
ignorePatterns: [".eslintrc.js"]
24+
};

.eslintrc.json

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

.gitattributes

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

.github/actions/setup/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ runs:
1212
cache: npm
1313
- name: cache dependencies
1414
id: cache
15-
uses: actions/cache@v2
15+
uses: actions/cache@v3
1616
with:
1717
path: ./node_modules
1818
key: node-modules-${{ runner.name }}-${{ runner.arch}}-${{ hashFiles('package-lock.json') }}
1919
- name: install dependencies
20-
run: npm ci --no-audit --no-scripts
20+
run: npm ci --ignore-scripts --no-audit --no-progress --prefer-offline
2121
# only run npm ci when restoring the cache didn’t work to save some time
2222
# as npm ci would remove the node_modules again
2323
if: steps.cache.outputs.cache-hit != 'true'

.github/workflows/check-pr-title.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,6 @@ jobs:
1919
failure-state: Title does not follow the specification.
2020
context-name: conventional-pr-title
2121
preset: conventional-changelog-angular@latest
22+
target-url: https://www.conventionalcommits.org
2223
env:
2324
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/default.yml

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
1-
# SEE https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
2-
31
name: default
42

53
on:
6-
pull_request:
74
push:
85
branches:
9-
- master
10-
- main
11-
- next
12-
- next-major
13-
- alpha
14-
- beta
6+
- main
7+
- alpha
8+
- beta
9+
pull_request:
1510

1611
jobs:
12+
# https://github.com/github/super-linter
1713
lint:
1814
runs-on: ubuntu-latest
1915
steps:
@@ -28,21 +24,21 @@ jobs:
2824
VALIDATE_ALL_CODEBASE: false
2925
VALIDATE_JAVASCRIPT_ES: true
3026
VALIDATE_EDITORCONFIG: true
31-
VALIDATE_YAML: true
3227
VALIDATE_BASH: true
3328
VALIDATE_BASH_EXEC: true
34-
FILTER_REGEX_EXCLUDE: CHANGELOG.md
29+
FILTER_REGEX_EXCLUDE: CHANGELOG.md,postman/**/*.yaml,postman/**/*.json
3530

36-
lint-types:
31+
build:
3732
runs-on: ubuntu-latest
33+
needs: [lint]
3834
steps:
3935
- uses: actions/checkout@v3
4036
- uses: ./.github/actions/setup
41-
- run: npm run lint:types
37+
- run: npm run build
4238

4339
test:
4440
runs-on: ubuntu-latest
45-
needs: [lint, lint-types]
41+
needs: [lint, build]
4642

4743
steps:
4844
- uses: actions/checkout@v3

.github/workflows/depcheck.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# SEE https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
2-
31
# Runs `npx depcheck`
42
#
53
# Depcheck is a tool for analyzing the dependencies in a project to see: how
@@ -12,9 +10,7 @@ name: depcheck
1210

1311
on:
1412
# allow manual trigger workflow
15-
pull_request:
16-
branches:
17-
- main
13+
push:
1814
paths:
1915
# run only when one of the files matching the glob patterns changed
2016
- 'package.json'

.github/workflows/highlight-deps.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
11
name: Inspect dependencies
22

33
on:
4-
- pull_request
4+
pull_request:
5+
paths:
6+
# run only when one of the files matching the glob patterns changed
7+
- 'package.json'
8+
- 'package-lock.json'
59

610
jobs:
711
check_new_dependencies:
812
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
# required by hiwelo/new-dependencies-action
16+
pull-requests: write
917
steps:
18+
- uses: actions/checkout@v3
1019
- name: Check for new dependencies
1120
uses: hiwelo/[email protected]
1221
with:

.github/workflows/newman.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: newman
2+
3+
on: push
4+
5+
jobs:
6+
smokey:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- uses: ./.github/actions/setup
11+
- run: cd postman && make test
12+
continue-on-error: true

.github/workflows/pkg-size.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,17 @@ name: pkg-size
33
on:
44
pull_request:
55
branches:
6+
- main
67
- alpha
78
- beta
8-
- main
9-
- master
109

1110
jobs:
1211
test:
1312
runs-on: ubuntu-latest
13+
permissions:
14+
contents: read
15+
# required by pkg-size/action@v1
16+
pull-requests: write
1417
steps:
1518
- uses: actions/checkout@v3
1619
- uses: ./.github/actions/setup

.github/workflows/smokey.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: smokey
2+
3+
# run smoke tests actually testing different countries each day
4+
5+
on:
6+
push:
7+
schedule:
8+
- cron: "0 0/12 * * *"
9+
10+
jobs:
11+
smokey:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: ./.github/actions/setup
16+
- run: scripts/smokey.sh
17+
- run: scripts/smokey-formats.sh

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ node_modules
77
npm-debug.log
88

99
coverage
10-
.nyc_output/
10+
.nyc_output
11+
dist
1112

1213
*.tmp*

.husky/pre-commit

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,3 @@ fi
1717

1818
printf "%b>>>%b lint:fix...\n" "$GREEN" "$NO_COLOR"
1919
npm run -s lint:fix;
20-
21-
printf "%b>>>%b regenerate typescript types...\n" "$GREEN" "$NO_COLOR"
22-
npm run -s typings;
23-
24-
printf "%b>>>%b lint types...\n" "$GREEN" "$NO_COLOR"
25-
npm run -s lint:types;

.npmrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# force everyone to use the node version from the package.json
2+
engineStrict=true
3+
# always save installed packages without version range
4+
save-exact=true
5+
# always amends --ignore-scripts on npm installs
6+
ignore-scripts=true

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16
1+
18

.prettierignore

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

.releaserc.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1+
12
{
2-
"plugins": [
3-
"@semantic-release/commit-analyzer",
4-
"@semantic-release/release-notes-generator",
5-
"@semantic-release/changelog",
6-
"@semantic-release/npm",
7-
"@semantic-release/git",
8-
"@semantic-release/github"
3+
"branches": [
4+
"main",
5+
{
6+
"name": "beta",
7+
"prerelease": true
8+
},
9+
{
10+
"name": "alpha",
11+
"prerelease": true
12+
}
913
]
1014
}

CHANGELOG.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
## [1.2.1](https://github.com/Ephigenia/ikea-availability-checker/compare/v1.2.0...v1.2.1) (2023-01-03)
1+
# [2.0.0-alpha.6](https://github.com/Ephigenia/ikea-availability-checker/compare/v2.0.0-alpha.5...v2.0.0-alpha.6) (2022-11-11)
22

33

44
### Bug Fixes
55

6-
* **stores:** add fi, gb, ee, lv stores and remove closed gb store ([#152](https://github.com/Ephigenia/ikea-availability-checker/issues/152)) ([694e514](https://github.com/Ephigenia/ikea-availability-checker/commit/694e5141b46694e3599c6d51360e19b54fe94ae2))
6+
* wip ([fba15ee](https://github.com/Ephigenia/ikea-availability-checker/commit/fba15eef98288b625f1db2e103bc6f20134b926a))
7+
8+
9+
### Features
10+
11+
* **stock:** add restockDate for Ingka API ([#138](https://github.com/Ephigenia/ikea-availability-checker/issues/138)) ([c105bb2](https://github.com/Ephigenia/ikea-availability-checker/commit/c105bb2a4472f1a59818bbe102da81368e9d44e2))
712

813
# [1.2.0](https://github.com/Ephigenia/ikea-availability-checker/compare/v1.1.5...v1.2.0) (2022-08-21)
914

@@ -15,9 +20,9 @@
1520
## [1.1.5](https://github.com/Ephigenia/ikea-availability-checker/compare/v1.1.4...v1.1.5) (2022-08-14)
1621

1722

18-
### Bug Fixes
23+
### Features
1924

20-
* **stores:** adds Jurong store in Singapore ([#123](https://github.com/Ephigenia/ikea-availability-checker/issues/123)) ([eaf735e](https://github.com/Ephigenia/ikea-availability-checker/commit/eaf735e08c037f8a04155d7ab8744a5af6394bcb))
25+
* **stores:** adds the ability to list all stores ([83a1a41](https://github.com/Ephigenia/ikea-availability-checker/commit/83a1a41d08af42c387cfa65e67ccdb8668345b57))
2126

2227
## [1.1.4](https://github.com/Ephigenia/ikea-availability-checker/compare/v1.1.3...v1.1.4) (2022-05-15)
2328

0 commit comments

Comments
 (0)