This repository was archived by the owner on Jun 4, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +34
-22
lines changed Expand file tree Collapse file tree 6 files changed +34
-22
lines changed Original file line number Diff line number Diff line change 18
18
/>
19
19
< link rel ="shortcut icon " href ="favicon.ico " />
20
20
21
- < script type ="module " src ="./src/index.js " defer > </ script >
21
+ < script type ="module " src ="./src/index.jsx " defer > </ script >
22
22
</ head >
23
23
< body class ="montserrat f5 ">
24
24
< div id ="root "> </ div >
Original file line number Diff line number Diff line change 2
2
"name" : " example-http-client-upload-file" ,
3
3
"version" : " 1.0.0" ,
4
4
"private" : true ,
5
+ "type" : " module" ,
5
6
"description" : " Upload file to IPFS via browser using js-ipfs-http-client" ,
6
7
"license" : " MIT" ,
7
8
"author" :
" Harlan T Wood <[email protected] >" ,
8
9
"contributors" : [
9
10
" Victor Bjelkholm <[email protected] >"
10
11
],
11
12
"scripts" : {
12
- "clean" : " rimraf ./dist ./.cache ./.parcel-cache " ,
13
- "build" : " parcel build index.html --no-scope-hoist " ,
14
- "serve" : " parcel serve index.html --open -p 8888" ,
13
+ "clean" : " rimraf ./dist ./.cache ./node_modules/.vite " ,
14
+ "build" : " vite build" ,
15
+ "serve" : " vite dev --port 8888" ,
15
16
"start" : " npm run serve" ,
16
17
"test" : " npm run build && playwright test tests"
17
18
},
18
19
"browserslist" : " last 1 Chrome version" ,
19
20
"dependencies" : {
20
- "ipfs-http-client" : " ^56 .0.0 " ,
21
+ "ipfs-http-client" : " ^57 .0.1 " ,
21
22
"react" : " ^17.0.2" ,
22
23
"react-dom" : " ^17.0.2"
23
24
},
24
25
"devDependencies" : {
25
26
"@babel/core" : " ^7.14.8" ,
26
27
"@playwright/test" : " ^1.12.3" ,
27
- "ipfs" : " ^0.62.0" ,
28
- "parcel" : " ^2.3.2" ,
28
+ "ipfs" : " ^0.63.3" ,
29
29
"playwright" : " ^1.12.3" ,
30
30
"process" : " ^0.11.10" ,
31
31
"rimraf" : " ^3.0.2" ,
32
32
"test-util-ipfs-example" : " ^1.0.2" ,
33
- "util" : " ^0.12.4"
33
+ "util" : " ^0.12.4" ,
34
+ "vite" : " ^3.0.0-beta.1"
34
35
}
35
36
}
Original file line number Diff line number Diff line change 1
1
/* eslint-disable no-console */
2
- 'use strict'
3
-
4
2
import { create } from 'ipfs-http-client'
5
3
import React , { useState , useEffect } from 'react'
6
- import logo from "url:./.. /public/ipfs-logo.svg" ;
4
+ import logo from '.. /public/ipfs-logo.svg'
7
5
8
6
const Connect = ( { setIpfs } ) => {
9
7
const [ multiaddr , setMultiaddr ] = useState ( '/ip4/127.0.0.1/tcp/5001' )
@@ -153,7 +151,7 @@ const Details = ({keys, obj}) => {
153
151
{ keys ?. map ( ( key ) => (
154
152
< div className = 'mb4' key = { key } >
155
153
< h2 className = 'f5 ma0 pb2 aqua fw4' > { key } </ h2 >
156
- < div className = 'bg-white pa2 br2 truncate monospace' data-test = { key } > { obj [ key ] } </ div >
154
+ < div className = 'bg-white pa2 br2 truncate monospace' data-test = { key } > { obj [ key ] . toString ( ) } </ div >
157
155
</ div >
158
156
) ) }
159
157
</ >
@@ -221,4 +219,4 @@ const App = () => {
221
219
)
222
220
}
223
221
224
- module . exports = App
222
+ export default App
Original file line number Diff line number Diff line change 1
1
/* eslint-disable no-unused-vars */
2
2
'use strict'
3
- const React = require ( 'react' )
4
- const ReactDOM = require ( 'react-dom' )
5
- const App = require ( './app' )
3
+ import React from 'react'
4
+ import ReactDOM from 'react-dom'
5
+ import App from './app.jsx'
6
6
7
7
ReactDOM . render ( < App /> , document . getElementById ( 'root' ) )
Original file line number Diff line number Diff line change 1
- 'use strict'
1
+ import { test , expect } from '@playwright/test' ;
2
+ import path from 'path'
3
+ import { playwright } from 'test-util-ipfs-example' ;
4
+ import { fileURLToPath } from 'url'
5
+ import * as ipfsModule from 'ipfs'
6
+ import * as ipfsHttpModule from 'ipfs-http-client'
2
7
3
- const { test, expect } = require ( '@playwright/test' ) ;
4
- const path = require ( 'path' )
5
- const { playwright } = require ( 'test-util-ipfs-example' ) ;
8
+ const __dirname = path . dirname ( fileURLToPath ( import . meta. url ) )
6
9
7
10
// Setup
8
11
const play = test . extend ( {
9
12
...playwright . servers ( ) ,
10
13
...playwright . daemons (
11
14
{
12
- ipfsHttpModule : require ( 'ipfs-http-client' ) ,
13
- ipfsBin : require ( 'ipfs' ) . path ( )
15
+ ipfsHttpModule,
16
+ ipfsBin : ipfsModule . path ( )
14
17
} ,
15
18
{ } ,
16
19
[
Original file line number Diff line number Diff line change
1
+ export default {
2
+ build : {
3
+ target : 'esnext' ,
4
+ minify : false
5
+ } ,
6
+ define : {
7
+ 'process.env.NODE_DEBUG' : 'false' ,
8
+ 'global' : 'globalThis'
9
+ }
10
+ }
You can’t perform that action at this time.
0 commit comments