Преглед на файлове

Fix run example uppy-with-companion (#3975)

Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
Co-authored-by: Merlijn Vos <merlijn@soverin.net>
mostafa khaki преди 2 години
родител
ревизия
0a19e8e377
променени са 4 файла, в които са добавени 8 реда и са изтрити 5 реда
  1. 3 2
      examples/uppy-with-companion/README.md
  2. 1 0
      examples/uppy-with-companion/package.json
  3. 3 3
      examples/uppy-with-companion/server/index.js
  4. 1 0
      yarn.lock

+ 3 - 2
examples/uppy-with-companion/README.md

@@ -7,7 +7,8 @@ This is a simple, lean example that combines the usage of @uppy/companion and up
 To run this example, make sure you've correctly installed the **repository root**:
 
 ```bash
-npm install
+corepack yarn install
+corepack yarn build
 ```
 
 That will also install the dependencies for this example.
@@ -15,5 +16,5 @@ That will also install the dependencies for this example.
 Then, again in the **repository root**, start this example by doing:
 
 ```bash
-npm run example uppy-with-companion
+corepack yarn workspace @uppy-example/uppy-with-companion start
 ```

+ 1 - 0
examples/uppy-with-companion/package.json

@@ -2,6 +2,7 @@
   "name": "@uppy-example/uppy-with-companion",
   "version": "0.0.0",
   "dependencies": {
+    "@uppy/companion": "workspace:*",
     "body-parser": "^1.18.2",
     "express": "^4.16.2",
     "express-session": "^1.15.6",

+ 3 - 3
examples/uppy-with-companion/server/index.js

@@ -1,7 +1,7 @@
 const express = require('express')
 const bodyParser = require('body-parser')
 const session = require('express-session')
-const companion = require('../../../packages/@uppy/companion')
+const companion = require('@uppy/companion')
 
 const app = express()
 
@@ -24,7 +24,7 @@ app.get('/', (req, res) => {
 })
 
 // initialize uppy
-const uppyOptions = {
+const companionOptions = {
   providerOptions: {
     drive: {
       key: 'your google key',
@@ -53,7 +53,7 @@ const uppyOptions = {
   debug: true,
 }
 
-const { app: companionApp } = companion.app(uppyOptions)
+const { app: companionApp } = companion.app(companionOptions)
 app.use(companionApp)
 
 // handle 404

+ 1 - 0
yarn.lock

@@ -10020,6 +10020,7 @@ __metadata:
   version: 0.0.0-use.local
   resolution: "@uppy-example/uppy-with-companion@workspace:examples/uppy-with-companion"
   dependencies:
+    "@uppy/companion": "workspace:*"
     body-parser: ^1.18.2
     express: ^4.16.2
     express-session: ^1.15.6