Skip to content

Commit 638e93d

Browse files
SgtPookiwhizzzkid
andauthored
* feat!: use latest ipld-explorer-components BREAKING CHANGE: This change updates the version of ipld-explorer-components we're using. The new ipld-explorer-components does not depend on old js-ipfs nor ipld dependencies. * fix: transient dependency warning * test: fix peer-locations.test.js * test: fix src/bundles/peer-bandwidth.test.js * test: fix test/e2e/explore.test.js * fix: support async peer info * test: fix src/bundles/peer-locations.test.js * fix: don't throw on lack of coverage data * feat: use [email protected] * chore: attempt to remove npm strict engines * fix: 🔧 Fixing ipld-explorer Builds (#2120) * chore(CI): remove unnecessary npm install * fix: remove unused var * fix: test-storybook:ci script * Update src/bundles/peer-locations.js Co-authored-by: Nishant Arora <[email protected]> * chore: remove custom eslint rule --------- Co-authored-by: Nishant Arora <[email protected]>
1 parent 155afa3 commit 638e93d

34 files changed

+35499
-93077
lines changed

.eslintrc.cjs

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,14 @@ module.exports = {
1111
// ignore .ts files because it fails to parse it.
1212
ignorePatterns: 'src/**/*.ts',
1313
rules: {
14-
'import/esm-extensions': 'error',
1514
'react/prop-types': [0, { ignore: ['className'], customValidators: [], skipUndeclared: true }] // TODO: set this rule to error when all issues are resolved.
1615
},
1716
overrides: [
1817
{
1918
files: ['src/**/*.stories.js'],
2019
excludedFiles: '*.test.js',
2120
rules: {
22-
'import/no-anonymous-default-export': 'off',
23-
'import/esm-extensions': 'error'
21+
'import/no-anonymous-default-export': 'off'
2422
}
2523
}
2624
]

.github/workflows/build.yml

+5-8
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,15 @@ jobs:
66
name: build
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v3.5.2
1010

1111
- name: Setup node
12-
uses: actions/setup-node@v2
12+
uses: actions/setup-node@v3.6.0
1313
with:
14-
node-version: 16.12.0
15-
- name: Setup [email protected]
16-
run: |
17-
npm install -g [email protected]
14+
node-version: 18.14.0
1815

1916
- name: Cache bigger downloads
20-
uses: actions/cache@v2
17+
uses: actions/cache@v3.3.1
2118
id: cache
2219
with:
2320
path: ${{ github.workspace }}/.cache
@@ -32,7 +29,7 @@ jobs:
3229
# Separate cache for build dir, we reuse it in release publish workflow
3330
- name: Cache build output
3431
if: startsWith(github.ref, 'refs/tags/v')
35-
uses: actions/cache@v2
32+
uses: actions/cache@v3.3.1
3633
id: build-cache
3734
with:
3835
path: build

.github/workflows/ci.yml

+9-15
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,12 @@ jobs:
3030
outputs:
3131
cid: ${{ steps.ipfs.outputs.cid }}
3232
steps:
33-
- uses: actions/checkout@v2
33+
- uses: actions/checkout@v3.5.2
3434

3535
- name: Setup node
36-
uses: actions/setup-node@v2
36+
uses: actions/setup-node@v3.6.0
3737
with:
38-
node-version: 16.12.0
39-
- name: Setup [email protected]
40-
run: |
41-
npm install -g [email protected]
38+
node-version: 18.14.0
4239

4340
- name: Download build artifact
4441
uses: actions/download-artifact@v2
@@ -47,7 +44,7 @@ jobs:
4744
path: build
4845

4946
- name: Cache bigger downloads
50-
uses: actions/cache@v2
47+
uses: actions/cache@v3.3.1
5148
id: cache
5249
with:
5350
path: ${{ github.workspace }}/.cache
@@ -176,12 +173,12 @@ jobs:
176173
needs: [build, publishPreview, eslint, typecheck, test-e2e, test-unit, test-storybook]
177174
steps:
178175
- name: Checkout 🛎️
179-
uses: actions/checkout@v2
176+
uses: actions/checkout@v3.5.2
180177
with:
181178
persist-credentials: false
182179

183180
- name: Cache bigger downloads
184-
uses: actions/cache@v2
181+
uses: actions/cache@v3.3.1
185182
id: cache
186183
with:
187184
path: ${{ github.workspace }}/.cache
@@ -191,7 +188,7 @@ jobs:
191188
${{ runner.os }}-
192189
193190
- name: Cache build dir
194-
uses: actions/cache@v2
191+
uses: actions/cache@v3.3.1
195192
id: build-cache
196193
with:
197194
path: build
@@ -205,12 +202,9 @@ jobs:
205202
echo ${{ needs.publishPreview.outputs.cid }} > .cid
206203
207204
- name: Setup node
208-
uses: actions/setup-node@v2
205+
uses: actions/setup-node@v3.6.0
209206
with:
210-
node-version: 16.12.0
211-
- name: Setup [email protected]
212-
run: |
213-
npm install -g [email protected]
207+
node-version: 18.14.0
214208

215209
- name: Install dependencies
216210
run: npm ci --prefer-offline --no-audit --progress=false --cache ${{ github.workspace }}/.cache/npm

.github/workflows/eslint.yml

+4-7
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,15 @@ jobs:
66
name: eslint
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v1
9+
- uses: actions/checkout@v3.5.2
1010

1111
- name: Setup node
12-
uses: actions/setup-node@v1
12+
uses: actions/setup-node@v3.6.0
1313
with:
14-
node-version: 16.12.0
15-
- name: Setup [email protected]
16-
run: |
17-
npm install -g [email protected]
14+
node-version: 18.14.0
1815

1916
- name: Cache bigger downloads
20-
uses: actions/cache@v2
17+
uses: actions/cache@v3.3.1
2118
id: cache
2219
with:
2320
path: ${{ github.workspace }}/.cache

.github/workflows/node-test.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ jobs:
3737
node-version: ${{ steps.node_version.outputs.version }}
3838
steps:
3939

40-
- uses: actions/checkout@v2
40+
- uses: actions/checkout@v3.5.2
4141

4242
- name: Use Node.js ${{ inputs.gh-node-version }}
43-
uses: actions/setup-node@v1
43+
uses: actions/setup-node@v3.6.0
4444
with:
4545
node-version: ${{ inputs.gh-node-version }}
4646

@@ -54,7 +54,7 @@ jobs:
5454
echo "version=$(node --version)" >> $GITHUB_OUTPUT
5555
5656
- name: Cache bigger downloads
57-
uses: actions/cache@v2
57+
uses: actions/cache@v3.3.1
5858
id: cache
5959
with:
6060
path: ${{ github.workspace }}/.cache

.github/workflows/test-e2e.yml

+4-7
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,15 @@ jobs:
1111
matrix:
1212
backend: [go] # TODO: add 'js' – see https://github.com/ipfs/ipfs-webui/issues/1737
1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v3.5.2
1515

1616
- name: Setup node
17-
uses: actions/setup-node@v1
17+
uses: actions/setup-node@v3.6.0
1818
with:
19-
node-version: 16.12.0
20-
- name: Setup [email protected]
21-
run: |
22-
npm install -g [email protected]
19+
node-version: 18.14.0
2320

2421
- name: Cache bigger downloads
25-
uses: actions/cache@v2
22+
uses: actions/cache@v3.3.1
2623
id: cache
2724
with:
2825
path: ${{ github.workspace }}/.cache

.github/workflows/test-storybook.yml

+4-7
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,15 @@ jobs:
77
name: 'test:storybook'
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v3
10+
- uses: actions/checkout@v3.5.2
1111

1212
- name: Setup node
13-
uses: actions/setup-node@v3
13+
uses: actions/setup-node@v3.6.0
1414
with:
15-
node-version: 16.12.0
16-
- name: Setup [email protected]
17-
run: |
18-
npm install -g [email protected]
15+
node-version: 18.14.0
1916

2017
- name: Cache bigger downloads
21-
uses: actions/cache@v2
18+
uses: actions/cache@v3.3.1
2219
id: cache
2320
with:
2421
path: ${{ github.workspace }}/.cache

.github/workflows/test-unit.yml

+4-7
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,15 @@ jobs:
66
name: 'test:unit'
77
runs-on: ubuntu-latest
88
steps:
9-
- uses: actions/checkout@v2
9+
- uses: actions/checkout@v3.5.2
1010

1111
- name: Setup node
12-
uses: actions/setup-node@v2
12+
uses: actions/setup-node@v3.6.0
1313
with:
14-
node-version: 16.12.0
15-
- name: Setup [email protected]
16-
run: |
17-
npm install -g [email protected]
14+
node-version: 18.14.0
1815

1916
- name: Cache bigger downloads
20-
uses: actions/cache@v2
17+
uses: actions/cache@v3.3.1
2118
id: cache
2219
with:
2320
path: ${{ github.workspace }}/.cache

.github/workflows/tx-pull.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
tx-sync:
99
runs-on: ubuntu-latest
1010
steps:
11-
- uses: actions/checkout@v2
11+
- uses: actions/checkout@v3.5.2
1212
- name: Install Transifex client
1313
run: |
1414
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash

.github/workflows/typecheck.yml

+4-7
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,15 @@ jobs:
77
name: typecheck
88
runs-on: ubuntu-latest
99
steps:
10-
- uses: actions/checkout@v1
10+
- uses: actions/checkout@v3.5.2
1111

1212
- name: Setup node
13-
uses: actions/setup-node@v1
13+
uses: actions/setup-node@v3.6.0
1414
with:
15-
node-version: 16.12.0
16-
- name: Setup [email protected]
17-
run: |
18-
npm install -g [email protected]
15+
node-version: 18.14.0
1916

2017
- name: Cache bigger downloads
21-
uses: actions/cache@v2
18+
uses: actions/cache@v3.3.1
2219
id: cache
2320
with:
2421
path: ${{ github.workspace }}/.cache

.npmrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
engine-strict=true
1+
engine-strict=false
2+
node-options="--openssl-legacy-provider"

config-overrides.js

+17-5
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77
import webpack from 'webpack'
88

99
const PURE_ESM_MODULES = [
10-
'ipfs-geoip'
10+
'ipfs-geoip',
11+
// 'ipld-explorer-components',
12+
'@chainsafe/is-ip',
13+
'dag-jose'
1114
]
1215

1316
/**
@@ -74,7 +77,8 @@ function webpackOverride (config) {
7477
Object.assign(fallback, {
7578
stream: 'stream-browserify',
7679
os: 'os-browserify/browser',
77-
path: 'path-browserify'
80+
path: 'path-browserify',
81+
crypto: 'crypto-browserify'
7882
})
7983

8084
config.resolve.fallback = fallback
@@ -103,9 +107,18 @@ function webpackOverride (config) {
103107
})
104108

105109
// Instrument for code coverage in development mode
106-
const REACT_APP_ENV = process.env.REACT_APP_ENV ?? process.env.NODE_ENV ?? 'production'
110+
const REACT_APP_ENV = process.env.REACT_APP_ENV ?? process.env.NODE_ENV ?? 'development'
107111
if (REACT_APP_ENV === 'test') {
108112
config.module.rules = modifyBabelLoaderRuleForTest(config.module.rules)
113+
} else if (REACT_APP_ENV === 'development') {
114+
config.optimization = {
115+
...config.optimization,
116+
minimize: false,
117+
mangleExports: false,
118+
innerGraph: false,
119+
moduleIds: 'named'
120+
}
121+
config.devtool = 'source-map'
109122
}
110123

111124
return config
@@ -122,8 +135,7 @@ const configOverride = {
122135
setupFiles: [...config.setupFiles, 'fake-indexeddb/auto'],
123136
moduleNameMapper: {
124137
...config.moduleNameMapper,
125-
'multiformats/basics': '<rootDir>/node_modules/multiformats/cjs/src/basics.js',
126-
'multiformats/bases/(.*)$': '<rootDir>/node_modules/multiformats/cjs/src/bases/$1.js'
138+
'multiformats/basics': '<rootDir>/node_modules/multiformats/src/basics.js'
127139
}
128140
})
129141
}

0 commit comments

Comments
 (0)