Skip to content

Commit

Permalink
feat!: share.ipfs.io is powered by Helia (#138)
Browse files Browse the repository at this point in the history
Co-authored-by: Cayman <[email protected]>
  • Loading branch information
SgtPooki and wemeetagain authored Oct 8, 2024
1 parent f469bbe commit 37d5478
Show file tree
Hide file tree
Showing 220 changed files with 36,876 additions and 25,966 deletions.
79 changes: 79 additions & 0 deletions .aegir.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/** @type {import('aegir').PartialOptions} */
const options = {
lint: {
files: [
'src/**/*.ts',
'src/**/*.tsx',
'test/**/*.ts',
'test/**/*.tsx',
]
},
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',
'blockstore-idb',
'datastore-idb',
'interface-blockstore',
'interface-datastore',

// 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

0 comments on commit 37d5478

Please sign in to comment.