Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
SgtPooki committed Apr 18, 2024
2 parents 22b5388 + 5b06c3f commit 68c6d90
Show file tree
Hide file tree
Showing 33 changed files with 38,749 additions and 26,444 deletions.
89 changes: 89 additions & 0 deletions .aegir.js
@@ -0,0 +1,89 @@

/** @type {import('aegir').PartialOptions} */
export default {
dependencyCheck: {
ignore: [
// actual production deps not getting recognized
'@tableflip/react-dropdown',
'brace',
'chart.js',
'classnames',
'details-polyfill',
'internal-nav-helper',
'is-ipfs',
'istextorbinary',
'react-ace',
'react-chartjs-2',
'react-copy-to-clipboard',
'react-country-flag',
'react-debounce-render',
'react-dnd',
'react-hook-form',
'react-identicons',
'react-joyride',
'react-overlays',
'uint8arrays',

// type-only deps
'ipfs',

// webpack deps
'crypto-browserify',
'os-browserify',
'path-browserify',
'stream-browserify',
'fake-indexeddb',

// test deps
'enzyme',
'enzyme-adapter-react-16',
'jest',
'jest-environment-jsdom', // in npm script via --env=jsdom

// storybook deps
'@storybook/addons', // for types
'@storybook/addon-a11y',
'@storybook/addon-actions',
'@storybook/addon-controls',
'@storybook/addon-coverage',
'@storybook/addon-essentials',
'@storybook/addon-links',
'@storybook/builder-webpack5', // storybookConfig.core.builder
'@storybook/core-common', // types
'@storybook/manager-webpack5', // implicit storybook dep
'@storybook/preset-create-react-app',

// npm scripts
'wait-on',

// github CI
'nyc',
'semantic-release'
],

developmentIgnorePatterns: [
'src/**/*.js',
'!.aegir.js',
'!.eslintrc.cjs',
'!config-overrides.js',
'!custom-release-notes-generator.cjs',
'!postcss.config.js',
'!**/*.test.js',
'!**/*.stories.js',
'!test/**',
'!src/setupTests.js'
],

productionIgnorePatterns: [
'.aegir.js',
'.eslintrc.cjs',
'config-overrides.js',
'custom-release-notes-generator.cjs',
'postcss.config.js',
'**/*.test.js',
'**/*.stories.js',
'test/**',
'src/setupTests.js'
]
}
}
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Expand Up @@ -16,7 +16,7 @@ jobs:

# Separate cache for build dir, we reuse it in release publish workflow
- name: Cache build output
uses: actions/cache@v3.3.1
uses: actions/cache@v4
id: build-cache
with:
path: build
Expand Down
22 changes: 14 additions & 8 deletions .github/workflows/ci.yml
Expand Up @@ -39,7 +39,7 @@ jobs:
cache: 'npm'

- name: Cache build output
uses: actions/cache@v3.3.1
uses: actions/cache@v4
id: build-cache
with:
path: build
Expand All @@ -49,7 +49,7 @@ jobs:
${{ runner.os }}-build-${{ hashFiles('package.json', 'package-lock.json', 'public', 'src/**', '*.js', '*.ts') }}
- name: Cache bigger downloads
uses: actions/cache@v3.3.1
uses: actions/cache@v4
id: cache
with:
path: ${{ github.workspace }}/.cache
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
- name: Fail job due to pinning failure
# only fail if pinning failed for main commits
if: github.ref == 'refs/heads/main' && steps.pin-w3up.outcome == 'failure' && steps.pin-cluster.outcome == 'failure'
uses: actions/github-script@v6
uses: actions/github-script@v7
with:
script: |
core.setFailed('Pinning did not succeed')
Expand All @@ -167,13 +167,13 @@ jobs:
run: go install github.com/ipfs/dnslink-dnsimple@v0.1.0

# dev dnslink is updated on each main branch update
- run: dnslink-dnsimple --domain dev.webui.ipfs.io --record _dnslink --link /ipfs/${{ steps.ipfs.outputs.cid }}
- run: dnslink-dnsimple --domain ipfs.tech --record _dnslink.dev.webui --link /ipfs/${{ steps.ipfs.outputs.cid }}
if: github.ref == 'refs/heads/main'
env:
DNSIMPLE_TOKEN: ${{ secrets.DNSIMPLE_TOKEN }}

# production dnslink is updated on release (during tag build)
- run: dnslink-dnsimple --domain webui.ipfs.io --record _dnslink --link /ipfs/${{ steps.ipfs.outputs.cid }}
- run: dnslink-dnsimple --domain ipfs.tech --record _dnslink.webui --link /ipfs/${{ steps.ipfs.outputs.cid }}
if: github.ref == 'refs/heads/main' && github.event_name == 'workflow_dispatch'
env:
DNSIMPLE_TOKEN: ${{ secrets.DNSIMPLE_TOKEN }}
Expand All @@ -198,22 +198,28 @@ jobs:
needs: build
uses: ./.github/workflows/eslint.yml

# separate check for dep-check
depcheck:
name: depcheck
needs: build
uses: ./.github/workflows/depcheck.yml

# automatically commit new tag and changelog updates when a push to main happens.
# This will then trigger
# 1. The 'ci.yml' workflow for the newly committed git tag,
# 2. The 'publish-release-build.yml' workflow
release:
name: 'Run semantic release'
runs-on: ubuntu-latest
needs: [build, publishPreview, eslint, typecheck, test-e2e, test-unit, test-storybook]
needs: [build, publishPreview, eslint, typecheck, depcheck, test-e2e, test-unit, test-storybook]
steps:
- name: Checkout 🛎️
uses: actions/checkout@v3.6.0
with:
persist-credentials: false

- name: Cache bigger downloads
uses: actions/cache@v3.3.1
uses: actions/cache@v4
id: cache
with:
path: ${{ github.workspace }}/.cache
Expand All @@ -223,7 +229,7 @@ jobs:
${{ runner.os }}-
- name: Cache build dir
uses: actions/cache@v3.3.1
uses: actions/cache@v4
id: build-cache
with:
path: build
Expand Down
21 changes: 21 additions & 0 deletions .github/workflows/depcheck.yml
@@ -0,0 +1,21 @@
on:
workflow_call:

jobs:
depcheck:
name: dep-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3.6.0

- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 18.14.0
cache: 'npm'

- name: Install dependencies
run: npm ci --prefer-offline --no-audit --progress=false

- name: Dependency check
run: npm run dep-check
14 changes: 7 additions & 7 deletions .github/workflows/test-e2e.yml
Expand Up @@ -15,7 +15,7 @@ jobs:
cache: 'npm'

- name: Cache test-build output
uses: actions/cache@v3.3.1
uses: actions/cache@v4
id: test-build-cache
with:
path: build
Expand All @@ -24,7 +24,7 @@ jobs:
test-build-${{ runner.os }}-${{ hashFiles('package.json', 'package-lock.json', 'public', 'src/**', '*.js', '*.ts') }}
- name: Cache node_modules
uses: actions/cache@v3.3.1
uses: actions/cache@v4
id: test-npm-cache
with:
path: node_modules
Expand Down Expand Up @@ -60,7 +60,7 @@ jobs:
cache: 'npm'

- name: Cache test-build output
uses: actions/cache@v3.3.1
uses: actions/cache@v4
id: test-build-cache
with:
path: build
Expand All @@ -70,7 +70,7 @@ jobs:
# We don't want to re-install dependencies for every sharded run
- name: Cache node_modules
uses: actions/cache@v3.3.1
uses: actions/cache@v4
id: test-npm-cache
with:
path: node_modules
Expand All @@ -82,7 +82,7 @@ jobs:
run: npm ci --prefer-offline --no-audit --progress=false

# Cache playwright binaries
- uses: actions/cache@v3
- uses: actions/cache@v4
id: playwright-cache
with:
path: |
Expand All @@ -93,7 +93,7 @@ jobs:
if: steps.playwright-cache.outputs.cache-hit != 'true'

- name: Cache nyc_output dir
uses: actions/cache@v3.3.1
uses: actions/cache@v4
id: nyc_output-cache
with:
path: ./.nyc_output
Expand Down Expand Up @@ -131,7 +131,7 @@ jobs:
cache: 'npm'

- name: Cache nyc_output dir
uses: actions/cache@v3.3.1
uses: actions/cache@v4
id: nyc_output-cache
with:
path: ./.nyc_output
Expand Down
1 change: 0 additions & 1 deletion .storybook/main.cjs
@@ -1,4 +1,3 @@
/* eslint-disable import/esm-extensions */
/**
* @file StoryBook configuration file
* @see https://github.com/storybookjs/storybook/blob/master/MIGRATION.md#from-version-52x-to-53x
Expand Down
26 changes: 26 additions & 0 deletions CHANGELOG.md
@@ -1,3 +1,29 @@
## [4.2.1](https://github.com/ipfs/ipfs-webui/compare/v4.2.0...v4.2.1) (2024-04-08)


CID `bafybeigggyffcf6yfhx5irtwzx3cgnk6n3dwylkvcpckzhqqrigsxowjwe`

---



### Bug Fixes

* **peers:** add connection accepts valid multiaddrs ([#2199](https://github.com/ipfs/ipfs-webui/issues/2199)) ([91ff2ca](https://github.com/ipfs/ipfs-webui/commit/91ff2cae3d9bd9e7d9550e84b6cf2f2a7cdadb32))
* **pinning:** update scaleway logo and link ([#2194](https://github.com/ipfs/ipfs-webui/issues/2194)) ([b8ac64f](https://github.com/ipfs/ipfs-webui/commit/b8ac64f18226dbc88a553e3b89fa41ab86435ab7))


### Trivial Changes

* **deps:** bump actions/cache from 3 to 4 ([#2196](https://github.com/ipfs/ipfs-webui/issues/2196)) ([e131185](https://github.com/ipfs/ipfs-webui/commit/e1311855056cb04a637e09b34d780f0618515a98))
* disable countly analytics and hide unused UI ([#2216](https://github.com/ipfs/ipfs-webui/issues/2216)) ([d137048](https://github.com/ipfs/ipfs-webui/commit/d137048611fe5b56f812404395a74543611728b0)), closes [#2198](https://github.com/ipfs/ipfs-webui/issues/2198) [/github.com/ipfs/ipfs-webui/pull/2216/files#r1556085374](https://github.com/ipfs//github.com/ipfs/ipfs-webui/pull/2216/files/issues/r1556085374)
* missed renames (api→rpc, .io→.tech) ([51b2952](https://github.com/ipfs/ipfs-webui/commit/51b2952cba39fc0ad2ce9c82d0f3b02b24c4ade7))
* optimize CI caching ([#2183](https://github.com/ipfs/ipfs-webui/issues/2183)) ([b8a71d9](https://github.com/ipfs/ipfs-webui/commit/b8a71d9a0e141886be8f8fee8e36069126039f69))
* package-lock.json update ([#2200](https://github.com/ipfs/ipfs-webui/issues/2200)) ([5abc5d0](https://github.com/ipfs/ipfs-webui/commit/5abc5d07630cef5a62d05194053e678750012d18))
* remove estuary ([b560f5c](https://github.com/ipfs/ipfs-webui/commit/b560f5c3659d873baee0eaa2e135e7caefedf591))
* Update .github/dependabot.yml [skip ci] ([f847301](https://github.com/ipfs/ipfs-webui/commit/f847301ea4b6efec13b0f18ed1681d08663c981c))
* Update .github/workflows/stale.yml [skip ci] ([03c1c89](https://github.com/ipfs/ipfs-webui/commit/03c1c89276a207d88ec768dcecc08464acc792e3))

## [4.2.0](https://github.com/ipfs/ipfs-webui/compare/v4.1.1...v4.2.0) (2023-12-02)


Expand Down
12 changes: 6 additions & 6 deletions README.md
Expand Up @@ -62,9 +62,9 @@ In separate shells run the following:
> npm run storybook
```

### Configure IPFS API CORS headers
### Configure Kubo RPC API CORS headers

You must configure your IPFS API at http://127.0.0.1:5001 to allow [cross-origin (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) requests from your dev server at http://localhost:3000
You must configure your Kubo RPC endpoint at http://127.0.0.1:5001 to allow [cross-origin (CORS)](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) requests from your dev server at http://localhost:3000

Similarly if you want to try out pre-release versions at https://dev.webui.ipfs.io you need to add that as an allowed domain too.

Expand Down Expand Up @@ -117,7 +117,7 @@ To create an optimized static build of the app, output to the `build` directory:

## Test

The following command will run all tests: unit one for React and E2E against real HTTP API:
The following command will run all tests: unit one for React and E2E against real Kubo RPC:

```sh
> npm test
Expand All @@ -135,7 +135,7 @@ The WebUI uses Jest to run the isolated unit tests. Unit test files are located

## E2E tests

The end-to-end tests (E2E) test the full app in a headless Chromium browser. They spawn real IPFS node for HTTP API and a static HTTP server to serve the app.
The end-to-end tests (E2E) test the full app in a headless Chromium browser. They spawn real Kubo node for HTTP RPC and a static HTTP server to serve the app.
The purpose of those tests is not being comprehensible, but act as a quick regression and integration suite.
Test files are located in `test/e2e/`.

Expand All @@ -162,13 +162,13 @@ One can also override the binary used in e2e tests by providing a path to an alt

#### `E2E_API_URL`

Instead of spawning a disposable node and repo for tests, one can point the E2E test suite at arbitrary HTTP API running on localhost:
Instead of spawning a disposable node and repo for tests, one can point the E2E test suite at arbitrary Kubo-compatible RPC API running on localhost:

```sh
> E2E_API_URL=http://127.0.0.1:5001 npm run test:e2e
```

**Caveat 1:** HTTP API used in tests needs to run on the local machine for Peers screen to pass (they test manual swarm connect to ephemeral `/ip4/120.0.0.1/..` multiaddr)
**Caveat 1:** HTTP RPC API used in tests needs to run on the local machine for Peers screen to pass (they test manual swarm connect to ephemeral `/ip4/120.0.0.1/..` multiaddr)

**Caveat 2:** CORS requests from `http://localhost:3001` (static server hosting dev version of webui) need to be added to `Access-Control-Allow-Origin` whitelist array in node's config:

Expand Down
13 changes: 6 additions & 7 deletions config-overrides.js
Expand Up @@ -11,7 +11,6 @@ const PURE_ESM_MODULES = [
// 'ipld-explorer-components',
'@chainsafe/is-ip',
'@multiformats/multiaddr',
'@libp2p/interface',
'dag-jose',
'uint8arrays'
]
Expand Down Expand Up @@ -139,12 +138,12 @@ const configOverride = {
setupFiles: [...config.setupFiles, 'fake-indexeddb/auto'],
moduleNameMapper: {
...config.moduleNameMapper,
'multiformats/basics': '<rootDir>/node_modules/multiformats/src/basics.js',
'@libp2p/interface/errors': '<rootDir>/node_modules/@libp2p/interface/dist/src/errors.js',
'multiformats/bases/base32': '<rootDir>/node_modules/multiformats/src/bases/base32.js',
'multiformats/bases/base58': '<rootDir>/node_modules/multiformats/src/bases/base58.js',
'multiformats/cid': '<rootDir>/node_modules/multiformats/src/cid.js',
'multiformats/hashes/digest': '<rootDir>/node_modules/multiformats/src/hashes/digest.js',
'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',
Expand Down
10 changes: 0 additions & 10 deletions ipfs-core-types/index.d.ts

This file was deleted.

0 comments on commit 68c6d90

Please sign in to comment.