Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump vite and @angular-devkit/build-angular #109

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
37d4791
Add latest angular version support
anorboev Jan 26, 2021
403a8db
Merge pull request #46 from flowjs/dependabot/npm_and_yarn/dot-prop-4…
MartinNuc Feb 2, 2021
4cb42c6
Merge pull request #49 from m-anorboev-sage/master
MartinNuc Feb 2, 2021
15eba95
release v0.4.6
MartinNuc Feb 2, 2021
6913836
chore: upgrade to new angular
MartinNuc Jul 22, 2021
ad1adee
Add angular 13 support
itsaplev Apr 3, 2022
0a62a77
Merge pull request #86 from itsaplev/master
itsaplev Apr 27, 2022
fa6a5e9
fix package publishing name
AidasK Apr 28, 2022
48ca47e
lockfile update
AidasK Apr 28, 2022
65c5687
update yarn lock file
AidasK Apr 28, 2022
c673106
Update .travis.yml
AidasK Apr 29, 2022
4dfb088
Add angular 14 support
rternavskyi Jul 8, 2022
618838a
Fix type JQueryStyleEventEmitter
rternavskyi Jul 14, 2022
50bfcf6
Merge pull request #91 from rternavskyi/master
MartinNuc Jul 20, 2022
4dfdf7f
Fix build error
rternavskyi Aug 1, 2022
132c2b9
Merge pull request #92 from rternavskyi/master
MartinNuc Aug 1, 2022
af46a98
bump to v0.6
MartinNuc Aug 1, 2022
8735956
Update build script
rternavskyi Aug 3, 2022
68c5034
Update README.md
rternavskyi Aug 3, 2022
287e2f1
Merge pull request #93 from rternavskyi/master
MartinNuc Aug 3, 2022
35931f3
Add support Angular 16 (#105)
Hilario-Rodriguez Nov 27, 2023
e0e19d7
Bump to v0.7.0
evilaliv3 Jan 6, 2024
103a323
fix(common): update deps (#97) (#107)
CosmoFruit Jan 16, 2024
b5918a8
Create npm-publish.yml
CosmoFruit Jan 16, 2024
e975a18
Bump follow-redirects from 1.15.1 to 1.15.5 (#108)
dependabot[bot] Jan 16, 2024
3f4bc68
Bump vite and @angular-devkit/build-angular
dependabot[bot] Jan 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Editor configuration, see http://editorconfig.org
# Editor configuration, see https://editorconfig.org
root = true

[*]
Expand All @@ -8,6 +8,9 @@ indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

[*.ts]
quote_type = single

[*.md]
max_line_length = off
trim_trailing_whitespace = false
35 changes: 35 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Node.js Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 20
- run: npm ci
- run: npm test

publish-npm:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://registry.npmjs.org/
- run: npm ci
- run: npm run build:lib
- run: cd dist/ngx-flow
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{secrets.npm_token}}
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,15 @@
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out

# dependencies
node_modules/

# profiling files
chrome-profiler-events*.json

# IDEs and editors
/.idea
.project
Expand All @@ -23,8 +28,10 @@ node_modules/
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
Expand Down
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
language: node_js
node_js:
- 'lts/*'
dist: trusty
sudo: required
env:
global:
Expand Down
26 changes: 8 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,27 +68,21 @@ We use dependecy injection to provide flow.js library.
1. Now you can use either directive `flowButton` for select file dialog:

```html
<input type="file"
flowButton
[flow]="flow.flowJs"
[flowAttributes]="{accept: 'image/*'}">
<input type="file" flowButton [flow]="flow.flowJs" [flowAttributes]="{accept: 'image/*'}" />
```

Or `flowDrop` for drag&drop feature:

```html
<div class="drop-area"
flowDrop
[flow]="flow.flowJs">
</div>
<div class="drop-area" flowDrop [flow]="flow.flowJs"></div>
```

For both you have to pass `[flow]=flow.flowJs` where `flow` is template variable exported in step 1.

1. You can than subscribe to observable of transfers:

```html
<div *ngFor="let transfer of (flow.transfers$ | async).transfers">
<div *ngFor="let transfer of (flow.transfers$ | async).transfers"></div>
```

1. After adding files you can begin upload using `upload()` method:
Expand Down Expand Up @@ -177,7 +171,7 @@ You can find it under `flow` variable.
Use `trackBy` for `ngFor`:

```html
<div *ngFor="let transfer of (flow.transfers$ | async).transfers; trackBy: trackTransfer">
<div *ngFor="let transfer of (flow.transfers$ | async).transfers; trackBy: trackTransfer"></div>
```

```typescript
Expand All @@ -201,11 +195,7 @@ Add `singleFile: true` to your flow config:
Add `flowDirectoryOnly="true"` to your button:

```html
<input type="file"
flowButton
[flow]="flow.flowJs"
flowDirectoryOnly="true"
[flowAttributes]="{accept: 'image/*'}">
<input type="file" flowButton [flow]="flow.flowJs" flowDirectoryOnly="true" [flowAttributes]="{accept: 'image/*'}" />
```

### I want to display image which is going to be uploaded
Expand All @@ -214,7 +204,7 @@ Use directive `flowSrc`:

```html
<div *ngFor="let transfer of (flow.transfers$ | async).transfers">
<img [flowSrc]="transfer">
<img [flowSrc]="transfer" />
</div>
```

Expand All @@ -230,7 +220,7 @@ export class AppComponent implements AfterViewInit, OnDestroy {
autoUploadSubscription: Subscription;

ngAfterViewInit() {
this.autoUploadSubscription = this.flow.events$.subscribe(event => {
this.autoUploadSubscription = this.flow.events$.subscribe((event) => {
if (event.type === 'filesSubmitted') {
this.flow.upload();
}
Expand All @@ -245,7 +235,7 @@ export class AppComponent implements AfterViewInit, OnDestroy {

### Development

`npm run build` - builds the library into dist folder
`npm run build:lib` - builds the library into dist folder

After that you can publish to npm repository from `dist` folder:

Expand Down
Loading