Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: share.ipfs.io is powered by Helia #138

Merged
merged 58 commits into from
Oct 8, 2024
Merged
Show file tree
Hide file tree
Changes from 37 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
3263f24
feat!: removing react-scripts and old cruft
SgtPooki Sep 18, 2024
acc3995
feat: vite dev progress
SgtPooki Sep 18, 2024
bcd9fc8
feat: replace ipfs-core with Helia
SgtPooki Sep 18, 2024
8f79d27
feat: remove react-scripts
SgtPooki Sep 18, 2024
e086dad
feat: add files/folders with Helia
SgtPooki Sep 18, 2024
ed20a07
feat: publish provider record for file CIDs
SgtPooki Sep 18, 2024
ec73265
chore: ignore dist folder
SgtPooki Sep 18, 2024
5ea68ba
fix: footer UI update
SgtPooki Sep 18, 2024
1c19e4a
feat: libp2p devtools & file downloading
SgtPooki Sep 18, 2024
08f822f
chore: documenting work to be done
SgtPooki Sep 18, 2024
987621e
chore: remove Makefile
wemeetagain Sep 19, 2024
ffd8a28
feat: remove react-bundle
wemeetagain Sep 20, 2024
f6f4ece
feat!: more ts, linting fixes, build fixes
SgtPooki Sep 26, 2024
c9fb31c
Merge pull request #139 from wemeetagain/feat/remove-bundle
SgtPooki Sep 26, 2024
02485b4
chore: migrate from circleci to github ci
SgtPooki Sep 26, 2024
4e8b54d
chore: remove some prop drilling
SgtPooki Sep 26, 2024
51198f7
fix: group share link
SgtPooki Sep 26, 2024
2cc2a7e
feat: migrate language selector dropdown to ts
SgtPooki Sep 26, 2024
10de340
chore: replace withTranslation with useTranslation
SgtPooki Sep 26, 2024
85e19d3
chore: convert more js to ts
SgtPooki Sep 26, 2024
41b4a45
fix: share links are disabled unless published
SgtPooki Sep 26, 2024
313992a
feat: publish folder CID
SgtPooki Sep 26, 2024
716e246
feat: making progress on download
SgtPooki Sep 26, 2024
2c7f770
feat: use more aegir, add test
SgtPooki Sep 27, 2024
4c0ec1b
feat: downloading files works
SgtPooki Sep 27, 2024
8534595
chore: remove some deps
SgtPooki Sep 27, 2024
1e16263
chore: update all deps
SgtPooki Sep 27, 2024
c5a9991
chore: update package-lock.json
SgtPooki Sep 27, 2024
1a2d1bd
feat: view link opens preview modal
SgtPooki Sep 30, 2024
c620bcf
fix: remove link from filename
SgtPooki Sep 30, 2024
5bc1136
feat: recognize raw cid as file type, add debugging info
SgtPooki Sep 30, 2024
b1e1df6
fix: type error and peerId setting for node-info
SgtPooki Sep 30, 2024
c9d2ae6
fix: qrcode is scannable
SgtPooki Oct 1, 2024
bee8216
chore: fix build
SgtPooki Oct 1, 2024
47f9369
fix: onhashchange handles updated url
SgtPooki Oct 1, 2024
87f02f0
feat: use helia@next and update nodeInfo
SgtPooki Oct 1, 2024
fef7122
feat: overhaul of fileProvider and reducers
SgtPooki Oct 1, 2024
bdec615
chore: cleanup download files
SgtPooki Oct 2, 2024
8eff1a7
fix: some styling improvements
SgtPooki Oct 2, 2024
959b847
chore: comment cleanup & remove done todo
SgtPooki Oct 7, 2024
839871c
fix: remove outdated messaging about ipfs daemon
SgtPooki Oct 7, 2024
781580b
chore: some minor drag-n-drop code cleanup
SgtPooki Oct 7, 2024
5c5849b
fix: uri encoding of filename on download screen
SgtPooki Oct 7, 2024
1ba1c4e
fix: use idb block&data stores
SgtPooki Oct 7, 2024
06068cb
chore: fix linting
SgtPooki Oct 7, 2024
756bebd
chore: simulate download progress
SgtPooki Oct 7, 2024
3cfeb3c
chore: fix dep-check
SgtPooki Oct 7, 2024
76369bb
chore: update all deps
SgtPooki Oct 8, 2024
67db9b1
fix: share button bg when disabled
SgtPooki Oct 8, 2024
5e1ee67
chore: minor cleanup
SgtPooki Oct 8, 2024
2d119be
fix: kebab-case filenames
SgtPooki Oct 8, 2024
f7da4ed
chore: don't import using extensions (for fleek deploy)
SgtPooki Oct 8, 2024
8cf3fc0
Revert "chore: don't import using extensions (for fleek deploy)"
SgtPooki Oct 8, 2024
ae1d2ca
chore: trying to fix fleek build
SgtPooki Oct 8, 2024
679e73b
chore: import .js instead of .jsx in app.tsx
SgtPooki Oct 8, 2024
713d428
chore(fleek-fix): remove import extensions
SgtPooki Oct 8, 2024
1e5eb25
chore: more file renaming
SgtPooki Oct 8, 2024
d1d1c60
fix: casing on css imports
SgtPooki Oct 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 73 additions & 0 deletions .aegir.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/** @type {import('aegir').PartialOptions} */
const options = {
lint: {
paths: [
'src',
'test'
]
},
build: {
bundle: false,
/**
* esbuild options:
*/
config: {
loader: {
'.js': 'jsx',
'.ts': 'ts',
'.tsx': 'tsx'
}
}
},
test: {
build: false, // we trigger aegir build in package.json
files: [
'aegir-build/test/**/*.spec.js'
],
before: ({runner}) => {
// if (runner === 'node') {
// process.exit(0)
// }
// // skip tests
}
},
dependencyCheck: {
ignore: [
'tachyons', // we import tachyons in App.css

// aegir dep-check doesn't check tsx files properly:
'@helia/mfs',
'@libp2p/devtools-metrics',
'classnames',
'helia',
'ipfs-css',
'qrcode.react',
'react-circular-progressbar',
'react-copy-to-clipboard',
'react-dnd',
'react-dnd-html5-backend',
'react-dom',
'react-helmet',
'react-i18next',
'react-loader-spinner',
'react-modal',
'@multiformats/multiaddr-matcher',

// error when testing without this dep
'node-datachannel'
],
productionIgnorePatterns: [
'.storybook',
'vite.config.ts',
'test',
'**/*.stories.*',
'dist',
'aegir-build'
],
developmentIgnorePatterns: [
'dist',
'aegir-build'
]
}
}
export default options
52 changes: 0 additions & 52 deletions .circleci/config.yml

This file was deleted.

5 changes: 0 additions & 5 deletions .eslintrc.js

This file was deleted.

64 changes: 64 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build and Deploy

# Run this workflow on push events to specific branches
on:
push:
branches:
- main
- production

jobs:
# Build job
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 'lts'

- name: Install dependencies
run: npm ci

- name: Build the project
run: npm run build

- name: Persist build output
id: build_output
run: |
echo "::set-output name=build_dir::build"

# Deploy job
deploy:
runs-on: ubuntu-latest
needs: build
environment:
name: ipfs-dns-deploy
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Docker
uses: docker/setup-buildx-action@v2

- name: Pull deployment image
run: docker pull olizilla/ipfs-dns-deploy:latest

- name: Deploy website to IPFS
run: |
pin_name="ipfs-share-files build ${{ github.run_number }}"

# Pin the build directory to IPFS
hash=$(docker run --rm -e BUILD_DIR=${{ steps.build_output.outputs.build_dir }} olizilla/ipfs-dns-deploy:latest pin-to-cluster.sh "$pin_name" /github/workspace/build)

echo "Website added to IPFS: https://dweb.link/ipfs/$hash"

# Update DNSlink for production or dev domain
if [ "${{ github.ref }}" == "refs/heads/production" ]; then
docker run --rm olizilla/ipfs-dns-deploy:latest dnslink-dnsimple -d share.ipfs.io -r _dnslink -l /ipfs/$hash
elif [ "${{ github.ref }}" == "refs/heads/main" ]; then
docker run --rm olizilla/ipfs-dns-deploy:latest dnslink-dnsimple -d dev.share.ipfs.io -r _dnslink -l /ipfs/$hash
fi
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -69,3 +69,8 @@ build/

# Misc
.DS_Store
dist
.vscode
src/icons
aegir-build
.coverage
4 changes: 0 additions & 4 deletions .storybook/addons.js

This file was deleted.

10 changes: 0 additions & 10 deletions .storybook/config.js

This file was deleted.

36 changes: 36 additions & 0 deletions .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import type { StorybookConfig } from '@storybook/react-vite';

// TODO: fix storybook dev and build

const config: StorybookConfig = {
stories: ['../src/**/*.stories.@(js|jsx|ts|tsx)'],

addons: [
'@storybook/addon-links',
// '@storybook/addon-essentials',
'@storybook/addon-interactions',
'@storybook/addon-coverage',
'@chromatic-com/storybook'
],

framework: {
name: '@storybook/react-vite',
options: {},
},

// async viteFinal(config) {
// // Merge custom configuration into the default config
// return mergeConfig(config, viteConfig);
// },
// docs: {}
typescript: {
// reactDocgen: 'react-docgen-typescript'
reactDocgen: false
// reactDocgenTypescriptOptions: {

// }
},

docs: {}
};
export default config;
17 changes: 17 additions & 0 deletions .storybook/preview.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { type Preview } from '@storybook/react';
// import { Buffer } from 'buffer'

// globalThis.Buffer = Buffer

// import CSS files
// import 'ipfs-css'
// import 'react-virtualized/styles.css'
// import 'tachyons'
// import '../src/components/loader/Loader.css'
// import '../src/components/object-info/LinksTable.css'

const preview: Preview = {
tags: ['autodocs', 'autodocs', 'autodocs']
};

export default preview;
10 changes: 0 additions & 10 deletions Makefile

This file was deleted.

26 changes: 26 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,32 @@ On the app side, translations are stored in [`public/locales`](./public/locales)

To learn more about internationalization on the IPFS project as a whole, or contribute translations to other IPFS repos, check out [ipfs/i18n](https://github.com/ipfs/i18n).

## REFRESH - TODO

### UI

1. Update the "progress bar" circular progress bar to be a loading indicator for record publishing
1. Disable share buttons when:
* no listening webrtc address
* CID is not published
1. Remove protocol labs footer -> replace with "powered by Helia"
1. Show the users what is actually happening in the background:
* Finding closest peers
* asking them to publish our provider record

### Functionality

1. publish directory CID
1. Make sure that when share.ipfs.io link with CID deeplink is shared, that browser retrieval client can get the file.
1. On self:update, we need to check if the listening webrtc address has changed, and republish all "files" and "directory" if so.
1. Ability to remove individual files from share list
1. Fix downloading the files filename

### debugging

1. Add libp2p-devtools


## Contribute

Contributions are more than welcome! Check out the [currently open issues](https://github.com/ipfs-shipyard/ipfs-share-files/issues) and start hacking on anything that sounds interesting. Issues are labeled with a variety of tags to help you find a good fit — you may wish to start with the [`help-wanted`](https://github.com/ipfs-shipyard/ipfs-share-files/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) tag.
Expand Down
Loading