Skip to content

Commit b96dad5

Browse files
committed
Fix tests
1 parent 667cfc3 commit b96dad5

File tree

13 files changed

+607
-329
lines changed

13 files changed

+607
-329
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,14 @@ jobs:
2020
- name: "Install node & npm"
2121
uses: actions/setup-node@v1
2222
with:
23-
node-version: 12.x
23+
node-version: 18.x
2424

2525
- name: "Install repository dependencies"
2626
run: npm ci
2727

2828
- name: "Check code style"
2929
run: find . -type f \( -iname \*.js -o -iname \*.jsx -o -iname \*.ts -o -iname \*.tsx \) | grep -v node_modules | grep -v /dist/ | xargs ./node_modules/.bin/prettier --check
3030

31-
- name: "Lib (npm install)"
32-
run: npm ci
33-
working-directory: ./projects/angular-uploader
34-
3531
# Note: we put other steps between the 'npm start' and the test runs, just to make time for the server to spin-up.
3632
- name: "Tests"
3733
run: npm run test:unit
@@ -41,6 +37,7 @@ jobs:
4137
env:
4238
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Automatically generated by GitHub / is not in our secrets.
4339
NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
40+
NODE_OPTIONS: --openssl-legacy-provider
4441
working-directory: ./projects/angular-uploader
4542
run: |
4643
npm set //registry.npmjs.org/:_authToken=${NPM_AUTH_TOKEN}

BUILD.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ This repository contains a hot-reloading sandbox for developing the `angular-upl
88

99
| Package | Version |
1010
| ------- | -------- |
11-
| Node | v12.22.0 |
12-
| NPM | v6.14.11 |
11+
| Node | v18.12.1 |
12+
| NPM | v8.19.2 |
1313
| ng | v13.3.1 |
1414

1515
## Repository Structure
@@ -32,7 +32,6 @@ cd angular-uploader
3232

3333
```shell
3434
npm install
35-
(cd projects/angular-uploader && npm install)
3635
```
3736

3837
### 3. Run The Sandbox

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -235,24 +235,26 @@ The callbacks receive a `Array<UploaderResult>`:
235235

236236
```javascript
237237
{
238-
fileUrl: "https://upcdn.io/FW25...", // The URL to use when serving this file.
239-
240-
editedFile: undefined, // The edited file (if present). Same as below.
238+
fileUrl: "https://upcdn.io/FW25...", // URL to use when serving this file.
239+
filePath: "/uploads/example.jpg", // File path (we recommend saving this to your database).
240+
241+
editedFile: undefined, // Edited file (for image crops). Same structure as below.
241242

242243
originalFile: {
243-
accountId: "FW251aX", // The Upload.io account that owns the file.
244-
file: { ... }, // DOM file object (from the <input> element).
245-
fileId: "FW251aXa9ku...", // The uploaded file ID.
246-
fileUrl: "https://upcdn.io/FW25...", // The uploaded file URL.
247-
fileSize: 12345, // File size in bytes.
248-
mime: "image/jpeg", // File MIME type.
249-
suggestedOptimization: {
250-
transformationUrl: "https://upcdn.io/..", // The suggested URL for serving this file.
251-
transformationSlug: "thumbnail" // Append to 'fileUrl' to produce the above URL.
244+
fileUrl: "https://upcdn.io/FW25...", // Uploaded file URL.
245+
filePath: "/uploads/example.jpg", // Uploaded file path (relative to your raw file directory).
246+
accountId: "FW251aX", // Upload.io account the file was uploaded to.
247+
originalFileName: "example.jpg", // Original file name from the user's machine.
248+
file: { ... }, // Original DOM file object from the <input> element.
249+
size: 12345, // File size in bytes.
250+
lastModified: 1663410542397, // Epoch timestamp of when the file was uploaded or updated.
251+
mime: "image/jpeg", // File MIME type.
252+
metadata: {
253+
... // User-provided JSON object.
252254
},
253-
tags: [ // Tags manually & auto-assigned to this file.
254-
{ name: "tag1", searchable: true },
255-
{ name: "tag2", searchable: true },
255+
tags: [
256+
"tag1", // User-provided & auto-generated tags.
257+
"tag2",
256258
...
257259
]
258260
}

0 commit comments

Comments
 (0)