Skip to content

Commit

Permalink
feat: Rework wrapper and switch to GQL API
Browse files Browse the repository at this point in the history
  • Loading branch information
RinseV committed Feb 8, 2025
1 parent ce07bc9 commit 188ef95
Show file tree
Hide file tree
Showing 67 changed files with 25,818 additions and 5,133 deletions.
8 changes: 8 additions & 0 deletions .changeset/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changesets

Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it [in our repository](https://github.com/changesets/changesets)

We have a quick list of common questions to get you started engaging with this project in
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md)
11 changes: 11 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.0.5/schema.json",
"changelog": "@changesets/cli/changelog",
"commit": false,
"fixed": [],
"linked": [],
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": []
}
39 changes: 0 additions & 39 deletions .eslintrc.js

This file was deleted.

2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

16 changes: 16 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: CI

on: push

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- name: Install dependencies
run: pnpm i
- name: Run Biome
run: pnpm check
18 changes: 8 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,19 @@ name: Publish

on:
release:
types: [created]
types: [ created ]

jobs:
build:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
node-version: '14.x'
registry-url: 'https://registry.npmjs.org/'
version: 10
- name: Install dependencies and build
run: yarn install && yarn build
- name: Publish on NPM
run: yarn publish --access public
run: pnpm i && pnpm build
- name: Publish on NPM
run: pnpm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

15 changes: 9 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ name: CI
on: push

jobs:
build:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install dependencies
run: yarn
- name: Run tests
run: yarn test
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
with:
version: 10
- name: Install dependencies
run: pnpm i
- name: Run tests
run: pnpm test
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,6 @@ dist
# and uncomment the following lines
# .pnp.*

.idea

# End of https://www.toptal.com/developers/gitignore/api/yarn,node
31 changes: 11 additions & 20 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
app
.env
.env.local
.changeset
.github
.idea
.tsup
node_modules
src
.eslintrc
.gitignore
.npmignore
.prettierrc
rollup.config.ts
tsconfig.json
.gitattributes
yarn-error.log
node_modules/
.nvmrc
.gitattributes
.env.example
coverage
test
jest.config.ts
.github
*.tgz
.eslintrc.js
.gitignore
.tool-versions
biome.json
pnpm-lock.yaml
tsup.config.ts
vitest.config.mts
1 change: 0 additions & 1 deletion .nvmrc

This file was deleted.

8 changes: 0 additions & 8 deletions .prettierrc

This file was deleted.

2 changes: 2 additions & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pnpm 9.15.5
nodejs 22.13.1
49 changes: 49 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# albert-heijn-wrapper

## 3.0.0

### Major Changes

- Switched over to GraphQL API for all requests
- Removed the functions for the subclasses, they can now be accessed directly (`ah.product` vs `ah.product()`)
- Removed the `bonus` & `category` subclasses since the GraphQL API does not have 1-to-1 equivalents
- Reworked the product functions:
- `getProductsFromName` is now `search` and uses a different set of arguments
- `getProductFromId` is now `get`
- Reworked the recipe functions:
- `getRecipeFromName` is now `search` and uses a different set of arguments
- `getRecipeFromId` is now `get`
- Reworked the store functions:
- `getStoresFromLocation` is now `search` and uses a different set of arguments
- Rewrote tests using MSW and Vitest
- Switched from `yarn` to `pnpm`
- Removed `axios` and `date-fns` dependencies, this package now has no external dependencies
- Updated to Node 22

## 2.0.1

### Patch Changes

- Fixed error 400 due to missing header

## 2.0.0

### Major changes

- Updated to major version due to breaking changes
- Restructured all functions to use objects instead of multiple parameters
- Added category & bonus objects
- Added tests
- Updated readme

## 1.1.0

### Minor changes

- Restructured all functions to use objects instead of multiple parameters

## 1.0.0

### Major changes

- Initial release
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2023 RinseV
Copyright (c) 2025 RinseV

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading

0 comments on commit 188ef95

Please sign in to comment.