Skip to content

Commit 196ce69

Browse files
committed
chore: update documentation
1 parent 901e9a0 commit 196ce69

File tree

3 files changed

+316
-277
lines changed

3 files changed

+316
-277
lines changed

DEVELOPMENT.md

Lines changed: 59 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,80 @@
11
## SDK development
22

3-
SDK is build in angular 4 for forward compatibilty and `ng-packagr` is used to create final package. Make sure `@angular/cli` is at `v1.4.*` and node ver `14.x` before building the package.
3+
SDK is built using Angular 12.x and `ng-packagr` for packaging. The project is located in the `sdk/` directory.
4+
5+
**Prerequisites:**
6+
- Node.js v14.x
7+
- Angular CLI compatible with Angular 12.x
48

59
## Building package
610

7-
Execute following command from the `sdk` folder to build the library. This creates a package in `dist/imagekitio-angular` folder.
11+
Execute the following command from the `sdk` folder to build the library. This creates a package in `dist/imagekit-angular` folder.
812
```sh
9-
# run `npm install` for first time
13+
# Install dependencies (first time)
14+
npm install
15+
16+
# Build the SDK
1017
npm run build
1118
```
1219

1320
## Running test cases
1421

15-
The designated directory for the tests is `sdk/tests/sdk-tests` folder. All tests will be executed once on the Chrome Headless browser.
22+
### Unit Tests
23+
24+
The designated directory for the tests is `sdk/tests/sdk-tests` folder. All tests are executed on Chrome Headless browser.
1625

17-
Execute following command from the `sdk` folder to start testing.
26+
Execute the following command from the `sdk` folder to run unit tests:
1827
```sh
28+
# Run tests in watch mode
1929
npm run test
30+
31+
# Run tests once for CI
32+
npm run test:ci
33+
```
34+
35+
### E2E Tests
36+
37+
E2E tests are located in the `test-app/` directory and use Cypress for browser automation.
38+
39+
To run E2E tests:
40+
```sh
41+
# Navigate to test-app directory
42+
cd test-app
43+
44+
# Install the SDK
45+
./install_sdk.sh
46+
47+
# Install dependencies
48+
npm install
49+
50+
# Start the dev server in one terminal
51+
npm start
52+
53+
# Run Cypress tests in another terminal
54+
npm run e2e
55+
56+
# Or open Cypress UI
57+
npm run e2e:open
2058
```
2159

2260
## Building custom SDK for sample angular app
2361

2462
Repository to get sample app: https://github.com/imagekit-samples/quickstart
2563

26-
Before sample apps can be used, `imagekitio-angular` library needs to be packed and installed using the file system within the sample apps. Use the following steps to run any sample app.
64+
Before sample app can be used, `@imagekit/angular` library needs to be packed and installed using the file system within the sample app. Use the following steps to run any sample app:
65+
66+
1. Navigate to the `test-app` directory
67+
2. Run ./install_sdk.sh. This will build and pack the sdk and install it in the `test-app` project
68+
69+
7. Use `npm start` from the `test-app` folder to run the app
70+
71+
## Testing with the test-app
72+
73+
The repository includes a `test-app/` directory that demonstrates SDK usage:
2774

28-
1. In the `sdk` folder, install dependencies with `npm install`
29-
2. Build library with `npm run build`
30-
3. In the `sdk/dist/imagekitio-angular` folder, use `npm pack` to create a tarball with version mentioned in the current package.json for sdk.
31-
4. Go to the Angular sample app's root folder and use `npm install` to install dependencies.
32-
5. Use `npm install <path to this SDK>/sdk/dist/imagekitio-angular/imagekitio-angular-x.x.x.tgz` where x.x.x needs to be replaced with the current version. For example, SDK version is `0.0.1`, then above command becomes `npm install <path to this SDK>/sdk/dist/imagekitio-angular/imagekitio-angular-2.0.0.tgz`
33-
6. Configure sample app with required keys. Use each app's `Readme.md` for exact details.
34-
7. Use npm start from the Angular sample app's root folder to run the app
75+
1. Build the SDK as described above
76+
2. Navigate to `test-app/` directory
77+
3. Install the built SDK: `./install_sdk.sh`
78+
4. Configure environment variables in `test-app/src/environments/`
79+
5. Run the app: `npm start`
80+
6. Access the demo at `http://localhost:4200`

LICENSE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Copyright 2025 ImageKit Private Limited
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4+
5+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6+
7+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

0 commit comments

Comments
 (0)