Skip to content

Commit 52d6f95

Browse files
authored
chore(deps): updated project dependencies (#5)
1 parent 53a530e commit 52d6f95

29 files changed

+10580
-12108
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ root = true
33

44
[*]
55
indent_style = space
6-
indent_size = 4
6+
indent_size = 2
77
end_of_line = lf
88
charset = utf-8
99
trim_trailing_whitespace = true

.eslintrc.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,17 @@ module.exports = {
1111
Atomics: 'readonly',
1212
SharedArrayBuffer: 'readonly',
1313
cy: true,
14-
Cypress: true,
14+
Cypress: true
1515
},
16+
parser: "@babel/eslint-parser",
1617
parserOptions: {
1718
ecmaVersion: 2018,
1819
sourceType: 'module'
1920
},
21+
plugins: [
22+
"@babel"
23+
],
2024
rules: {
25+
'max-len': ["error", { "code": 180 }]
2126
}
2227
}

.firebaserc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"projects": {
3+
"default": "tensorflowjs-remove-background"
4+
}
5+
}

.github/workflows/ci.yml

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: CI/CD
33
on:
44
push:
55
branches:
6-
- master
6+
- main
77
pull_request:
88
types: [opened, synchronize, reopened]
99

@@ -18,7 +18,7 @@ jobs:
1818
- name: Setup Nodejs
1919
uses: actions/setup-node@v1
2020
with:
21-
node-version: '12.x'
21+
node-version: '14.x'
2222

2323
- name: Cache node modules
2424
uses: actions/cache@v1
@@ -50,7 +50,7 @@ jobs:
5050
run: npm run build
5151

5252
- name: Cypress run
53-
uses: cypress-io/github-action@v1
53+
uses: cypress-io/github-action@v2
5454
with:
5555
record: true
5656
start: npm run start:serve
@@ -61,25 +61,11 @@ jobs:
6161
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6262
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}
6363

64-
- name: Upload Staging
65-
uses: amondnet/now-deployment@v2
66-
id: now-deployment-staging
67-
if: github.event_name == 'pull_request'
64+
- name: Deployment
65+
if: ${{ github.ref == 'refs/heads/main' }}
66+
uses: FirebaseExtended/action-hosting-deploy@v0
6867
with:
69-
github-token: ${{ secrets.GITHUB_TOKEN }}
70-
zeit-token: ${{ secrets.ZEIT_TOKEN }}
71-
now-org-id: ${{ secrets.NOW_ORG_ID }}
72-
now-project-id: ${{ secrets.NOW_PROJECT_ID_STATIC }}
73-
working-directory: dist/
74-
75-
- name: Upload Live
76-
uses: amondnet/now-deployment@v2
77-
id: now-deployment-production
78-
if: github.event_name == 'push'
79-
with:
80-
github-token: ${{ secrets.GITHUB_TOKEN }}
81-
zeit-token: ${{ secrets.ZEIT_TOKEN }}
82-
now-org-id: ${{ secrets.NOW_ORG_ID }}
83-
now-project-id: ${{ secrets.NOW_PROJECT_ID_STATIC }}
84-
now-args: '--prod'
85-
working-directory: dist/
68+
repoToken: '${{ secrets.GITHUB_TOKEN }}'
69+
firebaseServiceAccount: '${{ secrets.FIREBASE_SERVICE_ACCOUNT_VANILLA_FRONT_END_STARTER }}'
70+
channelId: live
71+
projectId: vanilla-front-end-starter
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Refresh screenshots
2+
3+
on:
4+
schedule:
5+
# Every 1st day of a month at 1am
6+
- cron: '0 1 1 * *'
7+
8+
jobs:
9+
remove-old-artifacts:
10+
runs-on: ubuntu-latest
11+
timeout-minutes: 10
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v2
16+
17+
- name: Setup Nodejs
18+
uses: actions/setup-node@v1
19+
with:
20+
node-version: '14.x'
21+
22+
- name: Cache node modules
23+
uses: actions/cache@v1
24+
env:
25+
cache-name: cache-node-modules
26+
with:
27+
path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS
28+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
29+
restore-keys: |
30+
${{ runner.os }}-build-${{ env.cache-name }}-
31+
${{ runner.os }}-build-
32+
${{ runner.os }}-
33+
34+
- name: Install Dependencies
35+
run: npm install
36+
37+
- name: Build
38+
run: npm run build
39+
40+
- name: Cypress run
41+
uses: cypress-io/github-action@v2
42+
with:
43+
record: true
44+
start: npm run start:serve
45+
wait-on: 'http://localhost:5000'
46+
command-prefix: 'percy exec -- npx'
47+
env:
48+
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
PERCY_TOKEN: ${{ secrets.PERCY_TOKEN }}

.github/workflows/remove-old-artifacts.yml

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

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ cypress/videos/
66
cypress/screenshots/
77
.scannerwork/
88
.tmp/
9-
.now
9+
*-debug.log

Dockerfile

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

README.MD

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# tensorflowjs-remove-background
22
![CI/CD](https://github.com/poly-glot/tensorflowjs-remove-background/workflows/CI/CD/badge.svg)
33
[![codecov](https://codecov.io/gh/poly-glot/tensorflowjs-remove-background/branch/master/graph/badge.svg)](https://codecov.io/gh/poly-glot/tensorflowjs-remove-background)
4-
[![This project is using Percy.io for visual regression testing.](https://percy.io/static/images/percy-badge.svg)](https://percy.io/poly-glot/tensorflowjs-remove-background)
4+
[![This project is using Percy.io for visual regression testing.](https://percy.io/static/images/percy-badge.svg)](https://percy.io/328a6753/tensorflowjs-remove-background)
55
[![Cypress.io Dashboard](https://img.shields.io/badge/cypress-dashboard-brightgreen.svg)](https://dashboard.cypress.io/projects/jp2thc/runs)
66
[![DeepScan grade](https://deepscan.io/api/teams/8408/projects/10623/branches/149386/badge/grade.svg)](https://deepscan.io/dashboard#view=project&tid=8408&pid=10623&bid=149386)
77
[![Maintainability](https://api.codeclimate.com/v1/badges/e9ab18c4667689e347de/maintainability)](https://codeclimate.com/github/poly-glot/tensorflowjs-remove-background/maintainability)
@@ -15,9 +15,6 @@ npm install
1515
npm start
1616
```
1717

18-
# How it is pieced together
19-
<img src="https://removebg.junaid.eu/assets/diagram.svg" alt="Flow diagram" />
20-
2118
## Demonstration
2219
<table width="100%">
2320
<tr>
@@ -27,27 +24,27 @@ npm start
2724
<tr>
2825
<td width="100">Canvas</td>
2926
<td><a href="https://github.com/poly-glot/tensorflowjs-remove-background/blob/00b6333c660ea1ecf7d1562dae56b68eea137041/src/component/output/events.js#L42" target="_blank">Save Canvas image.</a></td>
30-
</tr>
27+
</tr>
3128
<tr>
3229
<td width="100">SEO</td>
3330
<td><a href="https://support.google.com/gsa/answer/6329153?hl=en#82542">Excluding Unwanted Text from the Google Index</a> <code>&lt;!--googleoff: index--&gt;</code></td>
34-
</tr>
31+
</tr>
3532
<tr>
3633
<td width="100">HTML</td>
3734
<td>Use <code>referrerpolicy="no-referrer"</code> to disable hotlink protection.</td>
3835
</tr>
3936
<tr>
4037
<td width="100">HTML</td>
4138
<td>Use accept attribute e.g. <code>accept=".jpg,.png,.jpeg"</code> to allow users to select required file type.</td>
42-
</tr>
39+
</tr>
4340
<tr>
4441
<td width="100">JS</td>
4542
<td>Handle events using <a href="https://javascript.info/bubbling-and-capturing">Event Bubbling</a>.</td>
46-
</tr>
43+
</tr>
4744
<tr>
4845
<td width="100">Accessibility</td>
4946
<td>A small &amp; Accessible Collapse implementation.</td>
50-
</tr>
47+
</tr>
5148
</table>
5249

5350
# Browser Support
Loading

cypress/plugins/index.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
1-
const percyHealthCheck = require('@percy/cypress/task')
1+
/// <reference types="cypress" />
2+
// ***********************************************************
3+
// This example plugins/index.js can be used to load plugins
4+
//
5+
// You can change the location of this file or turn off loading
6+
// the plugins file with the 'pluginsFile' configuration option.
7+
//
8+
// You can read more here:
9+
// https://on.cypress.io/plugins-guide
10+
// ***********************************************************
211

12+
// This function is called when a project is opened or re-opened (e.g. due to
13+
// the project's config changing)
14+
15+
/**
16+
* @type {Cypress.PluginConfig}
17+
*/
18+
// eslint-disable-next-line no-unused-vars
319
module.exports = (on, config) => {
4-
on('task', percyHealthCheck)
20+
// `on` is used to hook into various events Cypress emits
21+
// `config` is the resolved Cypress config
522
}

docs/control-flow.drawio

Lines changed: 0 additions & 1 deletion
This file was deleted.

firebase.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"hosting": {
3+
"public": "dist",
4+
"ignore": [
5+
"firebase.json",
6+
"**/.*",
7+
"**/node_modules/**"
8+
]
9+
}
10+
}

now.json

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

0 commit comments

Comments
 (0)