Skip to content

Commit

Permalink
migrate from cuid to @paralleldrive/cuid2
Browse files Browse the repository at this point in the history
  • Loading branch information
puglet5 committed Feb 6, 2023
1 parent 2b7c37b commit 5a3f27a
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 13 deletions.
4 changes: 2 additions & 2 deletions lib/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable no-undef */
import BasePlugin from "@uppy/core/lib/BasePlugin.js"
import cuid from "cuid"
import { createId } from "@paralleldrive/cuid2"
// const Translator = require('@uppy/utils/lib/Translator');
// const { Provider, Socket } = require('@uppy/companion-client');
// const emitSocketProgress = require('@uppy/utils/lib/emitSocketProgress');
Expand Down Expand Up @@ -96,7 +96,7 @@ module.exports = class ActiveStorageUpload extends BasePlugin {
}

const upload = new DirectUpload(data, this.opts.directUploadUrl, this.opts.token, this.opts.attachmentName, directHandlers)
const id = cuid()
const id = createId()

upload.create((error, blob) => {
this.uppy.log(`[XHRUpload] ${id} finished`)
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
"type": "git",
"url": "git+https://github.com/excid3/uppy-activestorage-upload.git"
},
"dependencies": {
"cuid": "^2.1.8"
},
"devDependencies": {
"@rails/activestorage": "^7.0.4",
"@uppy/core": "^3.0.4"
Expand All @@ -38,5 +35,8 @@
},
"publishConfig": {
"registry": "https://npm.pkg.github.com/"
},
"dependencies": {
"@paralleldrive/cuid2": "^2.0.1"
}
}
25 changes: 17 additions & 8 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,31 @@ __metadata:
version: 0.0.0-use.local
resolution: "@excid3/uppy-activestorage-upload@workspace:."
dependencies:
"@paralleldrive/cuid2": ^2.0.1
"@rails/activestorage": ^7.0.4
"@uppy/core": ^3.0.4
cuid: ^2.1.8
peerDependencies:
"@rails/activestorage": "*"
"@uppy/core": "*"
languageName: unknown
linkType: soft

"@noble/hashes@npm:^1.1.5":
version: 1.2.0
resolution: "@noble/hashes@npm:1.2.0"
checksum: 8ca080ce557b8f40fb2f78d3aedffd95825a415ac8e13d7ffe3643f8626a8c2d99a3e5975b555027ac24316d8b3c02a35b8358567c0c23af681e6573602aa434
languageName: node
linkType: hard

"@paralleldrive/cuid2@npm:^2.0.1":
version: 2.0.1
resolution: "@paralleldrive/cuid2@npm:2.0.1"
dependencies:
"@noble/hashes": ^1.1.5
checksum: 700e6d719f88e8ff3237dd72f106bb394e50149eeada9008694a7f91e05db1369ff0a4bb8248024d1764fcf964ce3035cc8ea9cfaab51694669925f542d07d74
languageName: node
linkType: hard

"@rails/activestorage@npm:^7.0.4":
version: 7.0.4
resolution: "@rails/activestorage@npm:7.0.4"
Expand Down Expand Up @@ -66,13 +82,6 @@ __metadata:
languageName: node
linkType: hard

"cuid@npm:^2.1.8":
version: 2.1.8
resolution: "cuid@npm:2.1.8"
checksum: 12b85b3f5150a6f0b9e4f345c8d98299d74647419151751fa1132f6702fe2b5388ceceb1c9b49bad7cab1b3ac033c7cedea8ffc034930f90005b8a4345025288
languageName: node
linkType: hard

"lodash.throttle@npm:^4.1.1":
version: 4.1.1
resolution: "lodash.throttle@npm:4.1.1"
Expand Down

0 comments on commit 5a3f27a

Please sign in to comment.