Skip to content

Commit

Permalink
feat!: use ipld-explorer-components@4.0.0 (#2117)
Browse files Browse the repository at this point in the history
* 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 ipld-explorer-components@4.0.0

* 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 <1895906+whizzzkid@users.noreply.github.com>

* chore: remove custom eslint rule

---------

Co-authored-by: Nishant Arora <1895906+whizzzkid@users.noreply.github.com>
  • Loading branch information
SgtPooki and whizzzkid authored Jun 12, 2023
1 parent 155afa3 commit 638e93d
Show file tree
Hide file tree
Showing 34 changed files with 35,499 additions and 93,077 deletions.
4 changes: 1 addition & 3 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,14 @@ module.exports = {
// ignore .ts files because it fails to parse it.
ignorePatterns: 'src/**/*.ts',
rules: {
'import/esm-extensions': 'error',
'react/prop-types': [0, { ignore: ['className'], customValidators: [], skipUndeclared: true }] // TODO: set this rule to error when all issues are resolved.
},
overrides: [
{
files: ['src/**/*.stories.js'],
excludedFiles: '*.test.js',
rules: {
'import/no-anonymous-default-export': 'off',
'import/esm-extensions': 'error'
'import/no-anonymous-default-export': 'off'
}
}
]
Expand Down
13 changes: 5 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,15 @@ jobs:
name: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3.5.2

- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3.6.0
with:
node-version: 16.12.0
- name: Setup npm@8.1.0
run: |
npm install -g npm@8.1.0
node-version: 18.14.0

- name: Cache bigger downloads
uses: actions/cache@v2
uses: actions/cache@v3.3.1
id: cache
with:
path: ${{ github.workspace }}/.cache
Expand All @@ -32,7 +29,7 @@ jobs:
# Separate cache for build dir, we reuse it in release publish workflow
- name: Cache build output
if: startsWith(github.ref, 'refs/tags/v')
uses: actions/cache@v2
uses: actions/cache@v3.3.1
id: build-cache
with:
path: build
Expand Down
24 changes: 9 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,12 @@ jobs:
outputs:
cid: ${{ steps.ipfs.outputs.cid }}
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3.5.2

- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3.6.0
with:
node-version: 16.12.0
- name: Setup npm@8.1.0
run: |
npm install -g npm@8.1.0
node-version: 18.14.0

- name: Download build artifact
uses: actions/download-artifact@v2
Expand All @@ -47,7 +44,7 @@ jobs:
path: build

- name: Cache bigger downloads
uses: actions/cache@v2
uses: actions/cache@v3.3.1
id: cache
with:
path: ${{ github.workspace }}/.cache
Expand Down Expand Up @@ -176,12 +173,12 @@ jobs:
needs: [build, publishPreview, eslint, typecheck, test-e2e, test-unit, test-storybook]
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
uses: actions/checkout@v3.5.2
with:
persist-credentials: false

- name: Cache bigger downloads
uses: actions/cache@v2
uses: actions/cache@v3.3.1
id: cache
with:
path: ${{ github.workspace }}/.cache
Expand All @@ -191,7 +188,7 @@ jobs:
${{ runner.os }}-
- name: Cache build dir
uses: actions/cache@v2
uses: actions/cache@v3.3.1
id: build-cache
with:
path: build
Expand All @@ -205,12 +202,9 @@ jobs:
echo ${{ needs.publishPreview.outputs.cid }} > .cid
- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3.6.0
with:
node-version: 16.12.0
- name: Setup npm@8.1.0
run: |
npm install -g npm@8.1.0
node-version: 18.14.0

- name: Install dependencies
run: npm ci --prefer-offline --no-audit --progress=false --cache ${{ github.workspace }}/.cache/npm
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,15 @@ jobs:
name: eslint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3.5.2

- name: Setup node
uses: actions/setup-node@v1
uses: actions/setup-node@v3.6.0
with:
node-version: 16.12.0
- name: Setup npm@8.1.0
run: |
npm install -g npm@8.1.0
node-version: 18.14.0

- name: Cache bigger downloads
uses: actions/cache@v2
uses: actions/cache@v3.3.1
id: cache
with:
path: ${{ github.workspace }}/.cache
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/node-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ jobs:
node-version: ${{ steps.node_version.outputs.version }}
steps:

- uses: actions/checkout@v2
- uses: actions/checkout@v3.5.2

- name: Use Node.js ${{ inputs.gh-node-version }}
uses: actions/setup-node@v1
uses: actions/setup-node@v3.6.0
with:
node-version: ${{ inputs.gh-node-version }}

Expand All @@ -54,7 +54,7 @@ jobs:
echo "version=$(node --version)" >> $GITHUB_OUTPUT
- name: Cache bigger downloads
uses: actions/cache@v2
uses: actions/cache@v3.3.1
id: cache
with:
path: ${{ github.workspace }}/.cache
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,15 @@ jobs:
matrix:
backend: [go] # TODO: add 'js' – see https://github.com/ipfs/ipfs-webui/issues/1737
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3.5.2

- name: Setup node
uses: actions/setup-node@v1
uses: actions/setup-node@v3.6.0
with:
node-version: 16.12.0
- name: Setup npm@8.1.0
run: |
npm install -g npm@8.1.0
node-version: 18.14.0

- name: Cache bigger downloads
uses: actions/cache@v2
uses: actions/cache@v3.3.1
id: cache
with:
path: ${{ github.workspace }}/.cache
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/test-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,15 @@ jobs:
name: 'test:storybook'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v3.5.2

- name: Setup node
uses: actions/setup-node@v3
uses: actions/setup-node@v3.6.0
with:
node-version: 16.12.0
- name: Setup npm@8.1.0
run: |
npm install -g npm@8.1.0
node-version: 18.14.0

- name: Cache bigger downloads
uses: actions/cache@v2
uses: actions/cache@v3.3.1
id: cache
with:
path: ${{ github.workspace }}/.cache
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,15 @@ jobs:
name: 'test:unit'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3.5.2

- name: Setup node
uses: actions/setup-node@v2
uses: actions/setup-node@v3.6.0
with:
node-version: 16.12.0
- name: Setup npm@8.1.0
run: |
npm install -g npm@8.1.0
node-version: 18.14.0

- name: Cache bigger downloads
uses: actions/cache@v2
uses: actions/cache@v3.3.1
id: cache
with:
path: ${{ github.workspace }}/.cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tx-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
tx-sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3.5.2
- name: Install Transifex client
run: |
curl -o- https://raw.githubusercontent.com/transifex/cli/master/install.sh | bash
Expand Down
11 changes: 4 additions & 7 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,15 @@ jobs:
name: typecheck
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3.5.2

- name: Setup node
uses: actions/setup-node@v1
uses: actions/setup-node@v3.6.0
with:
node-version: 16.12.0
- name: Setup npm@8.1.0
run: |
npm install -g npm@8.1.0
node-version: 18.14.0

- name: Cache bigger downloads
uses: actions/cache@v2
uses: actions/cache@v3.3.1
id: cache
with:
path: ${{ github.workspace }}/.cache
Expand Down
3 changes: 2 additions & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
engine-strict=true
engine-strict=false
node-options="--openssl-legacy-provider"
22 changes: 17 additions & 5 deletions config-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@
import webpack from 'webpack'

const PURE_ESM_MODULES = [
'ipfs-geoip'
'ipfs-geoip',
// 'ipld-explorer-components',
'@chainsafe/is-ip',
'dag-jose'
]

/**
Expand Down Expand Up @@ -74,7 +77,8 @@ function webpackOverride (config) {
Object.assign(fallback, {
stream: 'stream-browserify',
os: 'os-browserify/browser',
path: 'path-browserify'
path: 'path-browserify',
crypto: 'crypto-browserify'
})

config.resolve.fallback = fallback
Expand Down Expand Up @@ -103,9 +107,18 @@ function webpackOverride (config) {
})

// Instrument for code coverage in development mode
const REACT_APP_ENV = process.env.REACT_APP_ENV ?? process.env.NODE_ENV ?? 'production'
const REACT_APP_ENV = process.env.REACT_APP_ENV ?? process.env.NODE_ENV ?? 'development'
if (REACT_APP_ENV === 'test') {
config.module.rules = modifyBabelLoaderRuleForTest(config.module.rules)
} else if (REACT_APP_ENV === 'development') {
config.optimization = {
...config.optimization,
minimize: false,
mangleExports: false,
innerGraph: false,
moduleIds: 'named'
}
config.devtool = 'source-map'
}

return config
Expand All @@ -122,8 +135,7 @@ const configOverride = {
setupFiles: [...config.setupFiles, 'fake-indexeddb/auto'],
moduleNameMapper: {
...config.moduleNameMapper,
'multiformats/basics': '<rootDir>/node_modules/multiformats/cjs/src/basics.js',
'multiformats/bases/(.*)$': '<rootDir>/node_modules/multiformats/cjs/src/bases/$1.js'
'multiformats/basics': '<rootDir>/node_modules/multiformats/src/basics.js'
}
})
}
Expand Down
Loading

0 comments on commit 638e93d

Please sign in to comment.