Skip to content

Commit

Permalink
feat: use ipld-explorer-components@8.1.0 (#2283)
Browse files Browse the repository at this point in the history
* feat: use latest ipld-explorer-components

* fix: unit tests pass

* fix: e2e tests work

* fix: update ipld-explorer-components patch

* fix: storybook ci tests pass

* chore: fix dep-check

* feat: use latest ipld-explorer-components

* feat: use latest ipld-explorer-components

* feat: resolve button types issue

* chore: fix depcheck

* test: fix storybook tests

* chore: attempt to fix fleek deploy

* test: stop using react-rewired-esm for unit tests

* test: use kubo standard ports for e2e tests

* chore: use ipld-explorer-components@8.1.0

* chore: use node lts version

replaces #2259
  • Loading branch information
SgtPooki authored Nov 7, 2024
1 parent 682de0b commit 437b8fe
Show file tree
Hide file tree
Showing 63 changed files with 30,907 additions and 30,276 deletions.
9 changes: 9 additions & 0 deletions .aegir.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,33 @@ export default {
dependencyCheck: {
ignore: [
// actual production deps not getting recognized
'@loadable/component',
'@tableflip/react-dropdown',
'brace',
'chart.js',
'classnames',
'details-polyfill',
'internal-nav-helper',
'ipfs-css',
'ipld-explorer-components',
'is-ipfs',
'istextorbinary',
'prop-types',
'react-ace',
'react-chartjs-2',
'react-copy-to-clipboard',
'react-country-flag',
'react-debounce-render',
'react-dnd',
'react-helmet',
'react-hook-form',
'react-i18next',
'react-identicons',
'react-joyride',
'react-overlays',
'react-virtualized',
'redux-bundler-react',
'tachyons',
'uint8arrays',

// type-only deps
Expand Down
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
parser: '@babel/eslint-parser',
parser: '@typescript-eslint/parser',
parserOptions: {
requireConfigFile: false,
babelOptions: {
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18.14.0
node-version: lts/*
cache: 'npm'

# Separate cache for build dir, we reuse it in release publish workflow
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18.14.0
node-version: lts/*
cache: 'npm'

- name: Cache build output
Expand Down Expand Up @@ -245,7 +245,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18.14.0
node-version: lts/*
cache: 'npm'

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/depcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18.14.0
node-version: lts/*
cache: 'npm'

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/eslint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18.14.0
node-version: lts/*
cache: 'npm'

- name: Install dependencies
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/test-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18.14.0
node-version: lts/*
cache: 'npm'

- name: Cache test-build output
Expand Down Expand Up @@ -56,7 +56,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18.14.0
node-version: lts/*
cache: 'npm'

- name: Cache test-build output
Expand Down Expand Up @@ -127,7 +127,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18.14.0
node-version: lts/*
cache: 'npm'

- name: Cache nyc_output dir
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-storybook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18.14.0
node-version: lts/*
cache: 'npm'

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test-unit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18.14.0
node-version: lts/*
cache: 'npm'

- name: Install dependencies
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18.14.0
node-version: lts/*
cache: 'npm'

- name: Install dependencies
Expand Down
7 changes: 6 additions & 1 deletion .storybook/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import '../src/index.css'
import getStore from '../src/bundles/index.js'
import i18n from '../src/i18n.js'
import DndBackend from '../src/lib/dnd-backend.js'
import { HeliaProvider, ExploreProvider } from 'ipld-explorer-components/providers'

/**
* @type {import('@storybook/addons').BaseAnnotations}
Expand All @@ -18,7 +19,11 @@ const baseAnnotations = {
<Provider store={getStore(undefined)}>
<I18nextProvider i18n={i18n} >
<DndProvider backend={DndBackend}>
<Story />
<HeliaProvider>
<ExploreProvider>
<Story />
</ExploreProvider>
</HeliaProvider>
</DndProvider>
</I18nextProvider>
</Provider>
Expand Down
3 changes: 1 addition & 2 deletions babel.config.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

module.exports = {
presets: ['@babel/preset-react']
presets: ['@babel/env', '@babel/preset-react', '@babel/preset-typescript']
}
35 changes: 3 additions & 32 deletions config-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import webpack from 'webpack'

const PURE_ESM_MODULES = [
'ipfs-geoip',
// 'ipld-explorer-components',
'ipld-explorer-components',
'@chainsafe/is-ip',
'@multiformats/multiaddr',
'dag-jose',
Expand Down Expand Up @@ -107,6 +107,7 @@ function webpackOverride (config) {
fullySpecified: false
}
})
config.resolve.extensions = ['.js', '.jsx', '.tsx', '.ts', '...']

// Instrument for code coverage in development mode
const REACT_APP_ENV = process.env.REACT_APP_ENV ?? process.env.NODE_ENV ?? 'development'
Expand All @@ -128,37 +129,7 @@ function webpackOverride (config) {
}

const configOverride = {
webpack: webpackOverride,
jest: (config) => {
/**
* @type {import('jest').Config}
*/
return ({
...config,
setupFiles: [...config.setupFiles, 'fake-indexeddb/auto'],
moduleNameMapper: {
...config.moduleNameMapper,
'multiformats/basics': '<rootDir>/node_modules/multiformats/dist/src/basics.js',
'multiformats/bases/base32': '<rootDir>/node_modules/multiformats/dist/src/bases/base32.js',
'multiformats/bases/base58': '<rootDir>/node_modules/multiformats/dist/src/bases/base58.js',
'multiformats/cid': '<rootDir>/node_modules/multiformats/dist/src/cid.js',
'multiformats/hashes/digest': '<rootDir>/node_modules/multiformats/dist/src/hashes/digest.js',
'multiformats/hashes/sha2': '<rootDir>/node_modules/multiformats/dist/src/hashes/sha2.js',
'uint8arrays/alloc': '<rootDir>/node_modules/uint8arrays/dist/src/alloc.js',
'uint8arrays/concat': '<rootDir>/node_modules/uint8arrays/dist/src/concat.js',
'uint8arrays/equals': '<rootDir>/node_modules/uint8arrays/dist/src/equals.js',
'uint8arrays/from-string': '<rootDir>/node_modules/uint8arrays/dist/src/from-string.js',
'uint8arrays/to-string': '<rootDir>/node_modules/uint8arrays/dist/src/to-string.js',
'@chainsafe/is-ip/parse': '<rootDir>/node_modules/@chainsafe/is-ip/lib/parse.js',
// eslint-disable-next-line quote-props
'eventemitter3': '<rootDir>/node_modules/eventemitter3/dist/eventemitter3.esm.js'
},
transformIgnorePatterns: [
'node_module/(?!(eventemitter3)/).+\\.(js|jsx|mjs|cjs|ts|tsx)$',
'^.+\\.module\\.(css|sass|scss)$' // default
]
})
}
webpack: webpackOverride
}

export default configOverride
49 changes: 49 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
/** @type {import('jest').Config} */
// eslint-disable-next-line import/no-anonymous-default-export
export default {
testMatch: [
'**/__tests__/**/*.[jt]s?(x)',
'**/?(*.)+(spec|test).[jt]s?(x)'
],
testPathIgnorePatterns: [
'/node_modules/',
'/test/e2e'
],
testEnvironment: 'jsdom',
setupFiles: ['<rootDir>/src/setupTests.js', 'fake-indexeddb/auto'],
moduleNameMapper: {
// ...config.moduleNameMapper,
'^dnd-core$': 'dnd-core/dist/cjs',
'^react-dnd$': 'react-dnd/dist/cjs',
'^react-dnd-html5-backend$': 'react-dnd-html5-backend/dist/cjs',
'multiformats/basics': '<rootDir>/node_modules/multiformats/dist/src/basics.js',
'multiformats/bases/base32': '<rootDir>/node_modules/multiformats/dist/src/bases/base32.js',
'multiformats/bases/base58': '<rootDir>/node_modules/multiformats/dist/src/bases/base58.js',
'multiformats/cid': '<rootDir>/node_modules/multiformats/dist/src/cid.js',
'multiformats/hashes/digest': '<rootDir>/node_modules/multiformats/dist/src/hashes/digest.js',
'multiformats/hashes/sha2': '<rootDir>/node_modules/multiformats/dist/src/hashes/sha2.js',
'uint8arrays/alloc': '<rootDir>/node_modules/uint8arrays/dist/src/alloc.js',
'uint8arrays/concat': '<rootDir>/node_modules/uint8arrays/dist/src/concat.js',
'uint8arrays/equals': '<rootDir>/node_modules/uint8arrays/dist/src/equals.js',
'uint8arrays/from-string': '<rootDir>/node_modules/uint8arrays/dist/src/from-string.js',
'uint8arrays/to-string': '<rootDir>/node_modules/uint8arrays/dist/src/to-string.js',
'@chainsafe/is-ip/parse': '<rootDir>/node_modules/@chainsafe/is-ip/lib/parse.js',
// eslint-disable-next-line quote-props
'eventemitter3': '<rootDir>/node_modules/eventemitter3/dist/eventemitter3.esm.js',
'cheerio/lib/utils': '<rootDir>/node_modules/cheerio/dist/commonjs/utils.js',
'@ipld/dag-pb': '<rootDir>/node_modules/@ipld/dag-pb/src/index.js',
'@multiformats/multiaddr': '<rootDir>/node_modules/@multiformats/multiaddr/dist/src/index.js',
'uint8-varint': '<rootDir>/node_modules/uint8-varint/dist/src/index.js',
'@chainsafe/netmask': '<rootDir>/node_modules/@chainsafe/netmask/dist/src/index.js',
'@chainsafe/is-ip': '<rootDir>/node_modules/@chainsafe/is-ip/lib/is-ip.js',
'\\.(css|less|scss|sass)$': 'identity-obj-proxy'
},
transform: {
'^.+\\.[tj]sx?$': 'babel-jest'
},
transformIgnorePatterns: [
'node_module/(?!(eventemitter3)/).+\\.(js|jsx|mjs|cjs|ts|tsx)$',
'^.+\\.module\\.(css|sass|scss)$' // default
]

}
Loading

0 comments on commit 437b8fe

Please sign in to comment.