-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat!: share.ipfs.io is powered by Helia (#138)
Co-authored-by: Cayman <[email protected]>
- Loading branch information
1 parent
f469bbe
commit 37d5478
Showing
220 changed files
with
36,876 additions
and
25,966 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,3 +69,8 @@ build/ | |
|
||
# Misc | ||
.DS_Store | ||
dist | ||
.vscode | ||
src/icons | ||
aegir-build | ||
.coverage |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.