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

examples: update angular-example to Angular v13 #3325

Merged
merged 7 commits into from Nov 22, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.js
Expand Up @@ -118,7 +118,7 @@ module.exports = {

// jsdoc
'jsdoc/check-alignment': 'error',
'jsdoc/check-examples': 'error',
'jsdoc/check-examples': 'off', // cannot yet be supported for ESLint 8, see https://github.com/eslint/eslint/issues/14745
'jsdoc/check-param-names': ['warn'],
'jsdoc/check-syntax': ['warn'],
'jsdoc/check-tag-names': 'error',
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,6 +4,7 @@ npm-debug.log
npm-debug.log*
nohup.out
node_modules
.angular
.cache
.parcel-cache
.eslintcache
Expand Down
2 changes: 1 addition & 1 deletion examples/angular-example/e2e/src/app.e2e-spec.ts
Expand Up @@ -11,7 +11,7 @@ describe('workspace-project App', () => {

it('should display welcome message', async () => {
await page.navigateTo()
expect(await page.getTitleText()).toEqual('angular-example app is running!')
expect(await page.getTitleText()).toEqual('Uppy Angular Example')
})

afterEach(async () => {
Expand Down
40 changes: 20 additions & 20 deletions examples/angular-example/package.json
Expand Up @@ -11,14 +11,14 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~12.1.0",
"@angular/common": "~12.1.0",
"@angular/compiler": "~12.1.0",
"@angular/core": "~12.1.0",
"@angular/forms": "~12.1.0",
"@angular/platform-browser": "~12.1.0",
"@angular/platform-browser-dynamic": "~12.1.0",
"@angular/router": "~12.1.0",
"@angular/animations": "~13.0.2",
"@angular/common": "~13.0.2",
"@angular/compiler": "~13.0.2",
"@angular/core": "~13.0.2",
"@angular/forms": "~13.0.2",
"@angular/platform-browser": "~13.0.2",
"@angular/platform-browser-dynamic": "~13.0.2",
"@angular/router": "~13.0.2",
"@uppy/angular": "workspace:*",
"@uppy/core": "workspace:*",
"@uppy/drag-drop": "workspace:*",
Expand All @@ -31,31 +31,31 @@
"zone.js": "~0.11.3"
},
"devDependencies": {
"@angular-devkit/build-angular": "~12.1.0",
"@angular-eslint/builder": "12.2.0",
"@angular-eslint/eslint-plugin": "12.2.0",
"@angular-eslint/eslint-plugin-template": "12.2.0",
"@angular-eslint/schematics": "12.2.0",
"@angular-eslint/template-parser": "12.2.0",
"@angular/cli": "~12.1.0",
"@angular/compiler-cli": "~12.1.0",
"@angular-devkit/build-angular": "~13.0.3",
"@angular-eslint/builder": "13.0.0",
"@angular-eslint/eslint-plugin": "13.0.0",
"@angular-eslint/eslint-plugin-template": "13.0.0",
"@angular-eslint/schematics": "13.0.0",
"@angular-eslint/template-parser": "13.0.0",
"@angular/cli": "~13.0.3",
"@angular/compiler-cli": "~13.0.2",
"@types/jasmine": "~3.6.0",
"@types/node": "^12.11.1",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"eslint": "^8.0.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsdoc": "^36.0.0",
"eslint-plugin-prefer-arrow": "latest",
"eslint-plugin-jsdoc": "^37.0.0",
"eslint-plugin-prefer-arrow": "^1.2.3",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.1.0",
"karma": "~6.3.9",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage": "~2.0.3",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"typescript": "~4.3"
"typescript": "~4.4"
}
}
2 changes: 1 addition & 1 deletion examples/angular-example/src/app/app.component.spec.ts
Expand Up @@ -26,6 +26,6 @@ describe('AppComponent', () => {
const fixture = TestBed.createComponent(AppComponent)
fixture.detectChanges()
const compiled = fixture.nativeElement
expect(compiled.querySelector('.content span').textContent).toContain('angular-example app is running!')
expect(compiled.textContent).toContain('Uppy Angular Example')
})
})
2 changes: 1 addition & 1 deletion examples/svelte-example/package.json
Expand Up @@ -25,7 +25,7 @@
"svelte-check": "^1.0.0",
"svelte-preprocess": "^4.6.1",
"tslib": "^2.0.0",
"typescript": "~4.3"
"typescript": "~4.4"
},
"dependencies": {
"@uppy/core": "workspace:*",
Expand Down
10 changes: 5 additions & 5 deletions package.json
Expand Up @@ -69,15 +69,15 @@
"disc": "^1.3.3",
"eslint": "^8.0.0",
"eslint-config-transloadit": "^2.0.0",
"eslint-plugin-compat": "^3.8.0",
"eslint-plugin-compat": "^4.0.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-jest": "^25.0.0",
"eslint-plugin-jsdoc": "^36.0.0",
"eslint-plugin-jsdoc": "^37.0.0",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-markdown": "^2.2.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prefer-import": "^0.0.1",
"eslint-plugin-promise": "^4.3.1",
"eslint-plugin-promise": "^5.1.1",
"eslint-plugin-react": "^7.22.0",
"eslint-plugin-react-hooks": "^4.2.0",
"events.once": "^2.0.2",
Expand Down Expand Up @@ -122,7 +122,7 @@
"tinyify": "^3.0.0",
"tsd": "^0.17.0",
"tsify": "^5.0.1",
"typescript": "~4.3",
"typescript": "~4.4",
"verdaccio": "^5.1.1",
"watchify": "^4.0.0"
},
Expand Down Expand Up @@ -193,7 +193,7 @@
]
},
"resolutions": {
"@typescript-eslint/experimental-utils": "5.0.0",
"@types/eslint@^7.2.13": "^8.2.0",
"npm-auth-to-token@1.0.0": "patch:npm-auth-to-token@npm:1.0.0#.yarn/patches/npm-auth-to-token-npm-1.0.0-c288ce201f"
}
}
10 changes: 5 additions & 5 deletions packages/@uppy/angular/package.json
Expand Up @@ -57,11 +57,11 @@
"babel-loader": "^8.1.0",
"eslint": "^8.0.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-jsdoc": "^36.0.0",
"eslint-plugin-prefer-arrow": "latest",
"eslint-plugin-jsdoc": "^37.0.0",
"eslint-plugin-prefer-arrow": "^1.2.3",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~6.1.0",
"jasmine-spec-reporter": "~7.0.0",
"karma": "~6.3.9",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
Expand All @@ -70,7 +70,7 @@
"protractor": "~7.0.0",
"redux": "^4.0.5",
"ts-node": "~8.3.0",
"typescript": "~4.3"
"typescript": "~4.4"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/companion-client/src/RequestClient.js
Expand Up @@ -49,7 +49,7 @@ module.exports = class RequestClient {
return stripSlash(companion && companion[host] ? companion[host] : host)
}

static defaultHeaders ={
static defaultHeaders = {
Accept: 'application/json',
'Content-Type': 'application/json',
'Uppy-Versions': `@uppy/companion-client=${RequestClient.VERSION}`,
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/companion-client/src/Socket.js
Expand Up @@ -72,7 +72,7 @@ module.exports = class UppySocket {
this.#emitter.once(action, handler)
}

#handleMessage= (e) => {
#handleMessage = (e) => {
try {
const message = JSON.parse(e.data)
this.emit(message.action, message.payload)
Expand Down
4 changes: 2 additions & 2 deletions packages/@uppy/companion/package.json
Expand Up @@ -73,7 +73,7 @@
"@types/connect-redis": "0.0.7",
"@types/cookie-parser": "1.4.2",
"@types/cors": "2.8.6",
"@types/eslint": "^7.2.14",
"@types/eslint": "^8.2.0",
"@types/express-session": "1.17.3",
"@types/jsonwebtoken": "8.3.7",
"@types/lodash.merge": "4.6.6",
Expand All @@ -88,7 +88,7 @@
"into-stream": "^6.0.0",
"nock": "^13.1.3",
"supertest": "3.4.2",
"typescript": "~4.3"
"typescript": "~4.4"
},
"files": [
"bin/",
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/dashboard/src/components/FileCard/index.js
Expand Up @@ -6,7 +6,7 @@ const ignoreEvent = require('../../utils/ignoreEvent.js')
const FilePreview = require('../FilePreview')

class FileCard extends Component {
form = document.createElement('form');
form = document.createElement('form')

constructor (props) {
super(props)
Expand Down
@@ -1,7 +1,7 @@
const { h, Fragment } = require('preact')
const prettierBytes = require('@transloadit/prettier-bytes')
const MetaErrorMessage = require('../MetaErrorMessage')
const truncateString = require('@uppy/utils/lib/truncateString')
const MetaErrorMessage = require('../MetaErrorMessage')

const renderFileName = (props) => {
const { author, name } = props.file.meta
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/informer/src/FadeIn.js
Expand Up @@ -3,7 +3,7 @@ const { h, Component, createRef } = require('preact')
const TRANSITION_MS = 300

module.exports = class FadeIn extends Component {
ref = createRef();
ref = createRef()

componentWillEnter (callback) {
this.ref.current.style.opacity = '1'
Expand Down
4 changes: 2 additions & 2 deletions packages/@uppy/status-bar/src/index.js
Expand Up @@ -13,7 +13,7 @@ const locale = require('./locale.js')
*/
module.exports = class StatusBar extends UIPlugin {
// eslint-disable-next-line global-require
static VERSION = require('../package.json').version;
static VERSION = require('../package.json').version

constructor (uppy, opts) {
super(uppy, opts)
Expand Down Expand Up @@ -54,7 +54,7 @@ module.exports = class StatusBar extends UIPlugin {
return this.uppy.upload().catch(() => {
// Error logged in Core
})
};
}

render (state) {
const {
Expand Down
8 changes: 4 additions & 4 deletions packages/@uppy/transloadit/src/AssemblyWatcher.js
Expand Up @@ -41,7 +41,7 @@ class TransloaditAssemblyWatcher extends Emitter {
return this.#assemblyIDs.indexOf(id) !== -1
}

#onAssemblyComplete =(assembly) => {
#onAssemblyComplete = (assembly) => {
if (!this.#watching(assembly.assembly_id)) {
return
}
Expand All @@ -53,15 +53,15 @@ class TransloaditAssemblyWatcher extends Emitter {
this.#checkAllComplete()
}

#onAssemblyCancel =(assembly) => {
#onAssemblyCancel = (assembly) => {
if (!this.#watching(assembly.assembly_id)) {
return
}

this.#checkAllComplete()
}

#onAssemblyError =(assembly, error) => {
#onAssemblyError = (assembly, error) => {
if (!this.#watching(assembly.assembly_id)) {
return
}
Expand All @@ -74,7 +74,7 @@ class TransloaditAssemblyWatcher extends Emitter {
this.#checkAllComplete()
}

#onImportError =(assembly, fileID, error) => {
#onImportError = (assembly, fileID, error) => {
if (!this.#watching(assembly.assembly_id)) {
return
}
Expand Down
10 changes: 5 additions & 5 deletions packages/@uppy/transloadit/src/index.js
Expand Up @@ -273,7 +273,7 @@ module.exports = class Transloadit extends BasePlugin {
* Used when `importFromUploadURLs` is enabled: adds files to the Assembly
* once they have been fully uploaded.
*/
#onFileUploadURLAvailable =(rawFile) => {
#onFileUploadURLAvailable = (rawFile) => {
const file = this.uppy.getFile(rawFile.id)
if (!file || !file.transloadit || !file.transloadit.assembly) {
return
Expand Down Expand Up @@ -386,7 +386,7 @@ module.exports = class Transloadit extends BasePlugin {
/**
* When all files are removed, cancel in-progress Assemblies.
*/
#onCancelAll =() => {
#onCancelAll = () => {
const { uploadsAssemblies } = this.getPluginState()

const assemblyIDs = Object.values(uploadsAssemblies).flat(1)
Expand Down Expand Up @@ -418,7 +418,7 @@ module.exports = class Transloadit extends BasePlugin {
})
}

#onRestored =(pluginData) => {
#onRestored = (pluginData) => {
const savedState = pluginData && pluginData[this.id] ? pluginData[this.id] : {}
const previousAssemblies = savedState.assemblies || {}
const uploadsAssemblies = savedState.uploadsAssemblies || {}
Expand Down Expand Up @@ -626,7 +626,7 @@ module.exports = class Transloadit extends BasePlugin {
})
}

#afterUpload =(fileIDs, uploadID) => {
#afterUpload = (fileIDs, uploadID) => {
const files = fileIDs.map(fileID => this.uppy.getFile(fileID))
// Only use files without errors
const filteredFileIDs = files.filter((file) => !file.error).map(file => file.id)
Expand Down Expand Up @@ -706,7 +706,7 @@ module.exports = class Transloadit extends BasePlugin {
.catch(sendErrorToConsole(err))
}

#onTusError =(err) => {
#onTusError = (err) => {
if (err && /^tus: /.test(err.message)) {
const xhr = err.originalRequest ? err.originalRequest.getUnderlyingObject() : null
const url = xhr && xhr.responseURL ? xhr.responseURL : null
Expand Down
2 changes: 1 addition & 1 deletion packages/@uppy/url/src/index.js
@@ -1,8 +1,8 @@
const { UIPlugin } = require('@uppy/core')
const { h } = require('preact')
const { RequestClient } = require('@uppy/companion-client')
const UrlUI = require('./UrlUI.js')
const toArray = require('@uppy/utils/lib/toArray')
const UrlUI = require('./UrlUI.js')
const forEachDroppedOrPastedUrl = require('./utils/forEachDroppedOrPastedUrl')

const locale = require('./locale')
Expand Down
8 changes: 4 additions & 4 deletions packages/@uppy/utils/src/ProgressTimeout.js
Expand Up @@ -5,13 +5,13 @@
* Call `timer.done()` when the upload has completed.
*/
class ProgressTimeout {
#aliveTimer;
#aliveTimer

#isDone = false;
#isDone = false

#onTimedOut;
#onTimedOut

#timeout;
#timeout

constructor (timeout, timeoutHandler) {
this.#timeout = timeout
Expand Down