Skip to content

Commit 69b4f50

Browse files
authored
Merge pull request #99 from imagekit-developer/upload-improve
Upload improve
2 parents aabfd00 + 3153f03 commit 69b4f50

35 files changed

+9484
-8602
lines changed

.babelrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
{
2-
"plugins": ["@babel/plugin-proposal-class-properties"],
2+
"plugins": [
3+
["@babel/plugin-transform-class-properties", { "loose": true }],
4+
"@babel/plugin-transform-optional-chaining"
5+
],
36
"presets": [
47
"@babel/preset-typescript",
58
[

.github/workflows/nodejs.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313

1414
strategy:
1515
matrix:
16-
node-version: [12.x]
16+
node-version: [20.x]
1717

1818
steps:
1919
- uses: actions/checkout@v1
@@ -26,6 +26,7 @@ jobs:
2626
npm install
2727
npm run build
2828
npm run test
29-
npm run report-coverage
3029
env:
3130
CI: true
31+
- name: Upload coverage to Codecov
32+
uses: codecov/codecov-action@v3

.github/workflows/npmpublish.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
strategy:
1414
matrix:
15-
node-version: [12.x]
15+
node-version: [20.x]
1616

1717
steps:
1818
- uses: actions/checkout@v1
@@ -35,14 +35,24 @@ jobs:
3535
- uses: actions/checkout@v1
3636
- uses: actions/setup-node@v1
3737
with:
38-
node-version: 12
38+
node-version: 20
3939
registry-url: https://registry.npmjs.org/
4040
- name: NPM Publish
4141
run: |
4242
npm install
4343
npm run build
4444
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
45-
npm publish
45+
# print the NPM user name for validation
46+
npm whoami
47+
VERSION=$(node -p "require('./package.json').version" )
48+
# Only publish stable versions to the latest tag
49+
if [[ "$VERSION" =~ ^[^-]+$ ]]; then
50+
NPM_TAG="latest"
51+
else
52+
NPM_TAG="beta"
53+
fi
54+
echo "Publishing $VERSION with $NPM_TAG tag."
55+
npm publish --tag $NPM_TAG --access public
4656
env:
4757
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
4858
CI: true

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ dist
77
.nyc_output
88
coverage.lcov
99
coverage
10-
out-tsc
10+
out-tsc
11+
docs

.mocharc.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"coverage": true,
3-
"require": ["esm", "./babel-register.js"],
3+
"require": ["./babel-register.js"],
44
"exit": true,
55
"timeout": "40000"
6-
}
6+
}

.npmignore

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

README.md

Lines changed: 14 additions & 517 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)