Skip to content

Commit d3dd43d

Browse files
authored
fix: update ipfs versions (#365)
Updates all examples to use ESM versions of IPFS, swaps parcel for vite everywhere and removes old browserify example because it only understands CJS.
1 parent d995340 commit d3dd43d

File tree

4 files changed

+24
-15
lines changed

4 files changed

+24
-15
lines changed

package.json

+8-7
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,28 @@
22
"name": "example-ipfs-client-add-files",
33
"version": "1.0.0",
44
"private": true,
5+
"type": "module",
56
"description": "",
67
"scripts": {
7-
"clean": "rimraf ./dist ./.cache ./.parcel-cache",
8-
"build": "parcel build index.html --no-scope-hoist",
9-
"serve": "parcel serve index.html --open -p 8888",
8+
"clean": "rimraf ./dist ./.cache ./node_modules/.vite",
9+
"build": "vite build",
10+
"serve": "vite dev --port 8888",
1011
"start": "npm run serve",
1112
"test": "npm run build && playwright test tests"
1213
},
1314
"browserslist": "last 1 Chrome version",
1415
"dependencies": {
15-
"ipfs-client": "^0.7.6"
16+
"ipfs-client": "^0.8.2"
1617
},
1718
"devDependencies": {
1819
"@babel/core": "^7.14.8",
1920
"@playwright/test": "^1.12.3",
20-
"ipfs": "^0.62.0",
21-
"parcel": "^2.3.2",
21+
"ipfs": "^0.63.3",
2222
"playwright": "^1.12.3",
2323
"process": "^0.11.10",
2424
"rimraf": "^3.0.2",
2525
"test-util-ipfs-example": "^1.0.2",
26-
"util": "^0.12.4"
26+
"util": "^0.12.4",
27+
"vite": "^3.0.0-beta.1"
2728
}
2829
}

src/app.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
/* eslint-disable no-console */
2-
'use strict'
3-
42
import { create as ipfsClient } from 'ipfs-client'
53

64
const App = () => {

tests/test.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
'use strict'
2-
3-
const { test, expect } = require('@playwright/test');
4-
const { playwright } = require('test-util-ipfs-example');
1+
import { test, expect } from '@playwright/test';
2+
import { playwright } from 'test-util-ipfs-example';
3+
import * as ipfsModule from 'ipfs'
4+
import * as ipfsClientModule from 'ipfs-client'
55

66
// Setup
77
const play = test.extend({
88
...playwright.servers(),
99
...playwright.daemons(
1010
{
11-
ipfsClientModule: require('ipfs-client'),
12-
ipfsBin: require('ipfs').path()
11+
ipfsClientModule,
12+
ipfsBin: ipfsModule.path()
1313
},
1414
{},
1515
[

vite.config.js

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
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+
}

0 commit comments

Comments
 (0)