Skip to content

Commit 64feeeb

Browse files
authored
Merge pull request #172 from imagekit-developer/v5
V5
2 parents 36b2559 + f684b5d commit 64feeeb

Some content is hidden

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

88 files changed

+2033
-29898
lines changed

.babelrc

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

.github/workflows/nodejs.yml

Lines changed: 7 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88

99
strategy:
1010
matrix:
11-
node-version: [12.x]
11+
node-version: [20.x]
1212

1313
steps:
1414
- uses: actions/checkout@v1
@@ -18,74 +18,17 @@ jobs:
1818
with:
1919
node-version: ${{ matrix.node-version }}
2020

21-
- name: Setup module and run unit tests
22-
run: |
23-
npm install
24-
# npm run test:ci
25-
env:
26-
CI: true
27-
REACT_APP_PUBLIC_KEY: ${{ secrets.ik_public_key }}
28-
REACT_APP_PRIVATE_KEY: ${{ secrets.ik_private_key }}
29-
REACT_APP_URL_ENDPOINT: ${{ secrets.ik_url_endopint }}
30-
31-
e2e:
32-
runs-on: ubuntu-latest
33-
34-
strategy:
35-
matrix:
36-
node-version: [12.x]
37-
38-
steps:
39-
- uses: actions/checkout@v1
40-
41-
- name: Use Node.js ${{ matrix.node-version }}
42-
uses: actions/setup-node@v1
43-
with:
44-
node-version: ${{ matrix.node-version }}
45-
46-
- name: Setup module
21+
- name: Build and Test
4722
run: |
4823
npm install
4924
npm run build
5025
npm pack
51-
- name: build test-app
52-
run: |
53-
cd tests/test-app
54-
echo REACT_APP_URL_ENDPOINT = ${{ secrets.ik_url_endopint }} > .env;
55-
echo REACT_APP_PUBLIC_KEY = ${{ secrets.ik_public_key }} >> .env;
56-
echo REACT_APP_PRIVATE_KEY = ${{ secrets.ik_private_key }} >> .env;
57-
echo REACT_APP_AUTHENTICATION_ENDPOINT = 'http://localhost:4001/auth' >> .env;
58-
npm install && npm install ../../imagekitio*.tgz --force && npm run build
59-
cd server
60-
echo PRIVATE_KEY = ${{ secrets.ik_private_key }} >> .env;
26+
cd test-app
6127
npm install
28+
npm install ../imagekit-react-*.tgz --no-save
29+
npx playwright install --with-deps
30+
npm run test:e2e
6231
env:
6332
CI: true
64-
REACT_APP_PUBLIC_KEY: ${{ secrets.ik_public_key }}
65-
REACT_APP_PRIVATE_KEY: ${{ secrets.ik_private_key }}
66-
REACT_APP_URL_ENDPOINT: ${{ secrets.ik_url_endopint }}
6733

68-
- name: Run E2E tests
69-
uses: cypress-io/github-action@v4
70-
with:
71-
start: npm run serve:test-app
72-
wait-on: 'http://localhost:4000, http://localhost:4001'
73-
env:
74-
DEBUG: 'cypress:server:browsers:electron'
75-
CI: true
76-
REACT_APP_PUBLIC_KEY: ${{ secrets.ik_public_key }}
77-
REACT_APP_PRIVATE_KEY: ${{ secrets.ik_private_key }}
78-
REACT_APP_URL_ENDPOINT: ${{ secrets.ik_url_endopint }}
79-
REACT_APP_AUTHENTICATION_ENDPOINT: 'http://localhost:4001/auth'
80-
81-
- name: tar workspace
82-
if: always()
83-
run: |
84-
tar -cf build.tar --exclude=./build.tar .
85-
- name: Archive build details
86-
if: always()
87-
uses: actions/upload-artifact@v4
88-
with:
89-
name: e2e-archive
90-
path: build.tar
91-
retention-days: 1
34+

.github/workflows/npmpublish.yml

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,27 @@ jobs:
1010

1111
strategy:
1212
matrix:
13-
node-version: [12.x]
13+
node-version: [20.x]
1414

1515
steps:
1616
- uses: actions/checkout@v1
1717
- name: Use Node.js ${{ matrix.node-version }}
1818
uses: actions/setup-node@v1
1919
with:
2020
node-version: ${{ matrix.node-version }}
21-
- name: npm install, build, and test
21+
- name: Build and Test
2222
run: |
23-
npm i
24-
# npm run test:ci
23+
npm install
2524
npm run build
25+
npm pack
26+
cd test-app
27+
npm install
28+
npm install ../imagekit-react-*.tgz --no-save
29+
npx playwright install --with-deps
30+
npm run test:e2e
2631
env:
2732
CI: true
28-
REACT_APP_PUBLIC_KEY: ${{ secrets.ik_public_key }}
29-
REACT_APP_PRIVATE_KEY: ${{ secrets.ik_private_key }}
30-
REACT_APP_URL_ENDPOINT: ${{ secrets.ik_url_endopint }}
33+
3134

3235
publish:
3336
needs: build
@@ -36,14 +39,24 @@ jobs:
3639
- uses: actions/checkout@v1
3740
- uses: actions/setup-node@v1
3841
with:
39-
node-version: 12
42+
node-version: 20
4043
registry-url: https://registry.npmjs.org/
41-
- name: npm publish
44+
- name: NPM Publish
4245
run: |
43-
npm i
46+
npm install
4447
npm run build
4548
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
46-
npm publish
49+
# print the NPM user name for validation
50+
npm whoami
51+
VERSION=$(node -p "require('./package.json').version" )
52+
# Only publish stable versions to the latest tag
53+
if [[ "$VERSION" =~ ^[^-]+$ ]]; then
54+
NPM_TAG="latest"
55+
else
56+
NPM_TAG="beta"
57+
fi
58+
echo "Publishing $VERSION with $NPM_TAG tag."
59+
npm publish --tag $NPM_TAG --access public
4760
env:
4861
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
4962
CI: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ lib
66
dist
77
coverage
88
.DS_Store
9+
*.tgz

.npmignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
package-lock.json

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
## 5.0.0
2+
3+
This is a major release that includes breaking changes. Please refer to the [official documentation](https://imagekit.io/docs/integration/react) for up-to-date usage instructions.
4+
5+
## 4.3.0
6+
7+
- Added support for React version 19 by [@ankur-dwivedi](https://github.com/ankur-dwivedi) in [#171](https://github.com/imagekit-developer/imagekit-react/pull/171)
8+
9+
**Full Changelog**: [v4.2.0...v4.3.0](https://github.com/imagekit-developer/imagekit-react/compare/4.2.0...4.3.0)
10+
11+
## 4.2.0
12+
13+
- Added `checks` parameter by [@imagekitio](https://github.com/imagekitio) in [#161](https://github.com/imagekit-developer/imagekit-react/pull/161)
14+
15+
**Full Changelog**: [v4.1.0...v4.2.0](https://github.com/imagekit-developer/imagekit-react/compare/4.1.0...4.2.0)
16+
17+
## 4.1.0
18+
19+
- Release details not specified.
20+
21+
**Full Changelog**: [v4.0.0...v4.1.0](https://github.com/imagekit-developer/imagekit-react/compare/4.0.0...4.1.0)
22+
23+
For the complete list of releases and changes, visit the [GitHub Releases Page](https://github.com/imagekit-developer/imagekit-react/releases).

CONTRIBUTING.md

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

0 commit comments

Comments
 (0)