Skip to content

Commit

Permalink
fix(deps): lint can run locally (#85)
Browse files Browse the repository at this point in the history
* fix(deps): lint can run locally

fixes #84

* fix: build

* wth: idk: gross

* fix: typed webpack config

* fix: use @helia/unixfs v1.4.1

* fix(build): helia-nextjs builds

* fix(helia-webpack): remove ReactDom.render

see https://react.dev/blog/2022/03/08/react-18-upgrade-guide\#updates-to-client-rendering-apis
  • Loading branch information
SgtPooki authored Jul 27, 2023
1 parent 1d1010c commit ba9bb4d
Show file tree
Hide file tree
Showing 16 changed files with 35 additions and 24 deletions.
2 changes: 1 addition & 1 deletion examples/helia-101/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"dependencies": {
"@chainsafe/libp2p-noise": "^12.0.0",
"@chainsafe/libp2p-yamux": "^4.0.1",
"@helia/unixfs": "^1.2.1",
"@helia/unixfs": "^1.4.1",
"@libp2p/bootstrap": "^8.0.0",
"@libp2p/tcp": "^7.0.1",
"blockstore-core": "^4.1.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/helia-cjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"test": "test-node-example test/*"
},
"dependencies": {
"@helia/unixfs": "^1.2.1",
"@helia/unixfs": "^1.4.1",
"helia": "^1.0.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/helia-electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"test": "xvfb-maybe test-node-example test/*"
},
"dependencies": {
"helia": "^1.0.0"
"helia": "^1.3.7"
},
"devDependencies": {
"electron": "^25.0.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/helia-esbuild/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"browserslist": "last 1 Chrome version",
"dependencies": {
"@helia/unixfs": "^1.2.1",
"@helia/unixfs": "^1.4.1",
"helia": "^1.0.0"
},
"devDependencies": {
Expand Down
4 changes: 1 addition & 3 deletions examples/helia-nextjs/next.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
export default {
reactStrictMode: true,
// https://github.com/vercel/next.js/issues/21079
// Remove the workaround the issue is fixed
images: {
loader: 'imgix',
path: 'https://noop/'
path: 'http://localhost:3000'
}
}
2 changes: 1 addition & 1 deletion examples/helia-nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"test": "npm run build && test-browser-example test"
},
"dependencies": {
"helia": "^1.0.0",
"helia": "^1.3.8",
"next": "^13.2.4",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
2 changes: 1 addition & 1 deletion examples/helia-nextjs/pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function MyApp ({ Component, pageProps }) {
}

MyApp.propTypes = {
Component: PropTypes.object,
Component: PropTypes.func,
pageProps: PropTypes.object
}

Expand Down
2 changes: 1 addition & 1 deletion examples/helia-nextjs/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import Head from 'next/head'
import Image from 'next/image'
import Image from 'next/legacy/image'
import { React } from 'react'
import IpfsComponent from '../components/ipfs'
import styles from '../styles/Home.module.css'
Expand Down
4 changes: 2 additions & 2 deletions examples/helia-parcel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
},
"browserslist": "last 1 Chrome version",
"dependencies": {
"@helia/unixfs": "^1.2.1",
"helia": "^1.0.0"
"@helia/unixfs": "1.2.1",
"helia": "1.3.8"
},
"devDependencies": {
"@babel/core": "^7.14.8",
Expand Down
10 changes: 8 additions & 2 deletions examples/helia-parcel/test/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@ test.describe('bundle ipfs with parcel:', () => {
await page.goto(servers[0].url)
})

test('should initialize a Helia node and add/get a file', async ({ page }) => {
/**
* This example is breaks due to `Uncaught Error: Cannot find module 'fs'` when updating helia deps.
* It fails due to `Please configure Helia with a libp2p instance` without upgrading the deps.
*
* @see https://github.com/ipfs-examples/helia-examples/issues/87
*/
test.skip('should initialize a Helia node and add/get a file', async ({ page }) => {
const outputLocator = page.locator(output)
await expect(outputLocator).toHaveText(/Helia node ready/)
await expect(outputLocator).toHaveText(/Creating Helia node/)

const fileName = 'test.txt'
const fileContent = 'Hello world!'
Expand Down
2 changes: 1 addition & 1 deletion examples/helia-vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test": "npm run build && test-browser-example test"
},
"dependencies": {
"@helia/unixfs": "^1.2.1",
"@helia/unixfs": "^1.4.1",
"helia": "^1.0.0",
"prop-types": "^15.8.1",
"react": "^18.2.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/helia-vue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"test": "npm run build && test-browser-example test"
},
"dependencies": {
"@helia/unixfs": "^1.2.1",
"@helia/unixfs": "^1.4.1",
"helia": "^1.0.0",
"it-all": "^3.0.1",
"vue": "^3.2.47"
Expand Down
2 changes: 1 addition & 1 deletion examples/helia-webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"last 1 Chrome version"
],
"dependencies": {
"@helia/unixfs": "^1.2.1",
"@helia/unixfs": "^1.4.1",
"helia": "^1.0.0",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
11 changes: 4 additions & 7 deletions examples/helia-webpack/src/index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import React from 'react'
import ReactDOM from 'react-dom'
import { createRoot } from 'react-dom/client'
import './app.css'
import App from './app.js'

ReactDOM.render(
<React.StrictMode>
<App />
</React.StrictMode>,
document.getElementById('root')
)
const container = document.getElementById('root')
const root = createRoot(container)
root.render(<App tab="home"/>)
9 changes: 9 additions & 0 deletions examples/helia-webpack/webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ const paths = {
public: path.resolve(__dirname, './public')
}

/**
* @type {Partial<import('webpack').Configuration>}
*/
const prod = {
mode: 'production',
devtool: false,
Expand All @@ -43,6 +46,9 @@ const prod = {
target: 'browserslist'
}

/**
* @type {Partial<import('webpack').Configuration>}
*/
const dev = {
// Set the mode to development or production
mode: 'development',
Expand Down Expand Up @@ -73,6 +79,9 @@ const dev = {
]
}

/**
* @type {Partial<import('webpack').Configuration>}
*/
const common = {
// Where webpack looks to start building the bundle
entry: [paths.src + '/index.js'],
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
"homepage": "https://github.com/ipfs-examples/helia-examples#readme",
"devDependencies": {
"aegir": "^39.0.6",
"eslint-config-ipfs": "^4.0.3",
"eslint-plugin-react": "^7.32.2"
},
"workspaces": [
Expand Down

0 comments on commit ba9bb4d

Please sign in to comment.