Skip to content

Commit f316743

Browse files
authored
Merge pull request #133 from piyushryn/piyush/sdk-overhaul
Piyush/sdk overhaul
2 parents 5259c99 + 71a98a4 commit f316743

File tree

115 files changed

+15300
-22528
lines changed

Some content is hidden

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

115 files changed

+15300
-22528
lines changed

.github/workflows/codeql.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,4 +38,4 @@ jobs:
3838
- name: Perform CodeQL Analysis
3939
uses: github/codeql-action/analyze@v2
4040
with:
41-
category: "/language:${{ matrix.language }}"
41+
category: "/language:${{ matrix.language }}"

.github/workflows/e2e.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# This is a test workflow for testing the tests
2+
name: E2E Tests
3+
4+
on:
5+
push:
6+
branches: ['*']
7+
pull_request:
8+
branches: ['*']
9+
10+
jobs:
11+
playwright-run:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
project: ['Desktop Chrome']
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Node.js
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: '20'
26+
cache: 'npm'
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
31+
- name: Build SDK and pack
32+
run: npm run pack
33+
34+
- name: Verify SDK build
35+
run: |
36+
if [ ! -d "dist/imagekit-angular" ]; then
37+
echo "Error: SDK build directory not found"
38+
exit 1
39+
fi
40+
echo "✓ SDK built successfully"
41+
42+
- name: Install test app dependencies
43+
working-directory: ./test-app
44+
run: npm install
45+
- name: Install SDK
46+
working-directory: ./test-app
47+
run: npm install ../dist/imagekit-angular/imagekit-angular-*.tgz --no-save
48+
# Note: Playwright browsers are installed via postinstall script
49+
50+
- name: Install browsers for Playwright
51+
working-directory: ./test-app
52+
run: npx playwright install --with-deps
53+
54+
- name: Run Playwright tests
55+
working-directory: ./test-app
56+
run: npm run test:e2e
57+
58+
- name: Upload test results on failure
59+
if: failure()
60+
uses: actions/upload-artifact@v4
61+
with:
62+
name: playwright-results-${{ matrix.project }}
63+
path: test-app/test-results/
64+
if-no-files-found: ignore
65+
66+
- name: Upload Playwright report
67+
if: always()
68+
uses: actions/upload-artifact@v4
69+
with:
70+
name: playwright-report-${{ matrix.project }}
71+
path: test-app/playwright-report/
72+
retention-days: 30
73+
if-no-files-found: ignore
74+
75+
- name: Generate test report
76+
if: always()
77+
run: |
78+
echo "## Test Results - ${{ matrix.project }}" >> $GITHUB_STEP_SUMMARY
79+
echo "Project: ${{ matrix.project }}" >> $GITHUB_STEP_SUMMARY
80+
81+

.github/workflows/nodejs.yml

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

.github/workflows/npmpublish.yml

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

.github/workflows/publish.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
matrix:
13+
node-version: [20.x]
14+
15+
steps:
16+
- uses: actions/checkout@v1
17+
- name: Use Node.js ${{ matrix.node-version }}
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: ${{ matrix.node-version }}
21+
- name: Build and Test
22+
run: |
23+
npm install
24+
npm run build
25+
npm pack
26+
cd test-app
27+
npm install
28+
npm install ../dist/imagekit-angular/imagekit-angular-*.tgz --no-save
29+
npx playwright install --with-deps
30+
npm run test:e2e
31+
env:
32+
CI: true
33+
34+
35+
publish:
36+
needs: build
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@v1
40+
- uses: actions/setup-node@v1
41+
with:
42+
node-version: 20
43+
registry-url: https://registry.npmjs.org/
44+
- name: NPM Publish
45+
run: |
46+
npm install
47+
npm run build
48+
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
49+
# print the NPM user name for validation
50+
npm whoami
51+
VERSION=$(node -p "require('./projects/imagekit-angular/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
60+
env:
61+
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
62+
CI: true

.gitignore

Lines changed: 39 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,68 @@
11
# See http://help.github.com/ignore-files/ for more about ignoring files.
22

3-
# compiled output
3+
# Compiled output
44
/dist
55
/tmp
66
/out-tsc
7+
/bazel-out
78

8-
# dependencies
9-
node_modules
9+
# Node
10+
/node_modules
11+
/test-app/node_modules
12+
13+
npm-debug.log
14+
yarn-error.log
1015

1116
# IDEs and editors
12-
/.idea
17+
.idea/
1318
.project
1419
.classpath
1520
.c9/
1621
*.launch
1722
.settings/
1823
*.sublime-workspace
1924

20-
# IDE - VSCode
25+
# Visual Studio Code
2126
.vscode/*
2227
!.vscode/settings.json
2328
!.vscode/tasks.json
2429
!.vscode/launch.json
2530
!.vscode/extensions.json
31+
.history/*
2632

27-
# misc
28-
/.sass-cache
33+
# Miscellaneous
34+
/.angular/cache
35+
/test-app/.angular/cache
36+
.sass-cache/
2937
/connect.lock
3038
/coverage
3139
/libpeerconnection.log
32-
npm-debug.log
3340
testem.log
3441
/typings
42+
/test-app/package-lock.json
3543

36-
# e2e
37-
/e2e/*.js
38-
/e2e/*.map
39-
40-
# System Files
44+
# System files
4145
.DS_Store
4246
Thumbs.db
47+
48+
# Playwright
49+
/test-app/test-results/
50+
/test-app/playwright-report/
51+
/test-app/playwright/.cache/
52+
53+
# Logs
54+
*.log
55+
logs/
56+
57+
# Build artifacts
58+
*.tsbuildinfo
59+
*.map
60+
61+
# Test coverage
62+
coverage/
63+
.nyc_output/
64+
65+
# Environment files
66+
.env
67+
.env.local
68+
.env.*.local

0 commit comments

Comments
 (0)